From ffad66e81ebd67a0ef3c6c7d303ee92988cc3b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0ulovsk=C3=BD?= Date: Mon, 4 Mar 2024 15:26:14 +0100 Subject: [PATCH 1/6] tmp: Trezor Account Importing --- .husky/pre-commit | 2 +- packages/app-extension/package.json | 1 + .../Onboarding/pages/KeyringTypeSelector.tsx | 7 + .../Onboarding/pages/OnboardAccount.tsx | 11 +- .../AddConnectWallet/ImportMnemonic.tsx | 13 +- .../common/Account/ImportWallets.tsx | 68 +- packages/app-extension/src/manifest.json | 9 +- .../src/webextension/trezor/README.md | 2 + .../trezor/trezor-content-script.js | 21 + .../trezor/trezor-usb-permissions.html | 40 + .../trezor/trezor-usb-permissions.js | 72 + packages/app-extension/webpack.config.js | 14 +- packages/common/src/types.ts | 2 +- packages/i18n/src/locales/en.json | 1 + .../recoil/src/context/OnboardingProvider.tsx | 12 +- .../src/keyring/BlockchainKeyring.ts | 21 +- .../secure-background/src/keyring/index.ts | 11 +- .../secure-background/src/keyring/trezor.ts | 75 + .../secure-background/src/keyring/types.ts | 32 +- .../src/services/svm/keyring.ts | 38 + .../src/services/user/server.ts | 9 +- .../src/store/KeyringStore/UserKeyring.ts | 63 +- .../transports/ToSecureUITransportSender.ts | 9 +- .../secure-background/src/types/blockchain.ts | 128 +- packages/secure-ui/package.json | 1 + .../PreviewPublicKeysRequest.tsx | 38 + .../TrezorPreviewPublicKeysRequest.tsx | 196 ++ .../_utils/isLegalTrezorPath.ts | 11 + .../TrezorRequests/_utils/trezorConnect.ts | 11 + packages/secure-ui/src/SecureUI.tsx | 25 +- yarn.lock | 2824 +++++------------ 31 files changed, 1649 insertions(+), 2118 deletions(-) create mode 100644 packages/app-extension/src/webextension/trezor/README.md create mode 100644 packages/app-extension/src/webextension/trezor/trezor-content-script.js create mode 100644 packages/app-extension/src/webextension/trezor/trezor-usb-permissions.html create mode 100644 packages/app-extension/src/webextension/trezor/trezor-usb-permissions.js create mode 100644 packages/secure-background/src/keyring/trezor.ts create mode 100644 packages/secure-ui/src/RequestHandlers/PreviewPublicKeysRequest.tsx create mode 100644 packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorPreviewPublicKeysRequest.tsx create mode 100644 packages/secure-ui/src/RequestHandlers/TrezorRequests/_utils/isLegalTrezorPath.ts create mode 100644 packages/secure-ui/src/RequestHandlers/TrezorRequests/_utils/trezorConnect.ts diff --git a/.husky/pre-commit b/.husky/pre-commit index 012bc6957..a58c4ee74 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,5 +2,5 @@ . "$(dirname "$0")/_/husky.sh" npx lint-staged -node scripts/sync-expo-deps.js --dry-run +#node scripts/sync-expo-deps.js --dry-run source scripts/verify_workspace_package.sh diff --git a/packages/app-extension/package.json b/packages/app-extension/package.json index d85270c92..40fee3550 100644 --- a/packages/app-extension/package.json +++ b/packages/app-extension/package.json @@ -60,6 +60,7 @@ "@solana/web3.js": "^1.63.1", "@tanstack/react-query": "^5.17.19", "@testing-library/jest-dom": "^5.11.4", + "@trezor/connect-web": "^9.1.12", "@uidotdev/usehooks": "^2.4.1", "bip39": "^3.1.0", "click-to-react-component": "^1.1.0", diff --git a/packages/app-extension/src/components/Onboarding/pages/KeyringTypeSelector.tsx b/packages/app-extension/src/components/Onboarding/pages/KeyringTypeSelector.tsx index 462d8db70..ca7b3cb38 100644 --- a/packages/app-extension/src/components/Onboarding/pages/KeyringTypeSelector.tsx +++ b/packages/app-extension/src/components/Onboarding/pages/KeyringTypeSelector.tsx @@ -38,6 +38,13 @@ export const KeyringTypeSelector = ({ onPress={() => onNext("ledger")} textAlign="left" /> + } + label={t("have_hardware_wallet_trezor")} + justifyContent="flex-start" + onPress={() => onNext("trezor")} + textAlign="left" + /> } diff --git a/packages/app-extension/src/components/Onboarding/pages/OnboardAccount.tsx b/packages/app-extension/src/components/Onboarding/pages/OnboardAccount.tsx index d102d4415..0f505e69e 100644 --- a/packages/app-extension/src/components/Onboarding/pages/OnboardAccount.tsx +++ b/packages/app-extension/src/components/Onboarding/pages/OnboardAccount.tsx @@ -6,7 +6,7 @@ import type { } from "@coral-xyz/common"; import { useTranslation } from "@coral-xyz/i18n"; import { useOnboarding } from "@coral-xyz/recoil"; -import { useTheme,XStack, YStack } from "@coral-xyz/tamagui"; +import { useTheme, XStack, YStack } from "@coral-xyz/tamagui"; import { useSteps } from "../../../hooks/useSteps"; import { CreatePassword } from "../../common/Account/CreatePassword"; @@ -139,7 +139,9 @@ export const OnboardAccount = ({ />, ] : []), - ...(keyringType === "mnemonic" || keyringType === "ledger" + ...(keyringType === "mnemonic" || + keyringType === "ledger" || + keyringType === "trezor" ? // if were importing mnemonic of ledger we need to select the blockchiain [ , - ...(keyringType === "ledger" || action === "import" + ...(keyringType === "ledger" || + keyringType === "trezor" || + action === "import" ? [ (); + const isHardware = ledger === true || trezor === true; + const device = ledger ? "ledger" : trezor ? "trezor" : undefined; const closeParentDrawer = () => { navigation.popToTop(); @@ -158,6 +162,12 @@ export function ImportMnemonic({ device: "ledger", ...walletDescriptor, }; + } else if (trezor) { + return { + type: BlockchainWalletInitType.HARDWARE, + device: "trezor", + ...walletDescriptor, + }; } else if (mnemonic === true) { return { type: BlockchainWalletInitType.MNEMONIC, @@ -215,7 +225,8 @@ export function ImportMnemonic({ key="ImportWallets" fullscreen={false} blockchain={blockchain} - mnemonic={ledger ? undefined : mnemonic} + mnemonic={isHardware ? undefined : mnemonic} + device={device} recovery={publicKey} onNext={async (walletDescriptors: Array) => { await onComplete(walletDescriptors); diff --git a/packages/app-extension/src/components/common/Account/ImportWallets.tsx b/packages/app-extension/src/components/common/Account/ImportWallets.tsx index 26c8a85c4..9684bbaa7 100644 --- a/packages/app-extension/src/components/common/Account/ImportWallets.tsx +++ b/packages/app-extension/src/components/common/Account/ImportWallets.tsx @@ -39,6 +39,7 @@ const fundedAddressesLabel = "Funded Addresses"; export function ImportWallets({ blockchain, mnemonic, + device, onNext, // onError, allowMultiple = true, @@ -54,6 +55,7 @@ export function ImportWallets({ allowMultiple?: boolean; autoSelect?: boolean; fullscreen?: boolean; + device?: "ledger" | "trezor"; }) { const userClient = useRecoilValue(userClientAtom); const blockchainConfig = useRecoilValue(blockchainConfigAtom(blockchain)); @@ -117,26 +119,37 @@ export function ImportWallets({ const walletPreview = mnemonic === undefined ? ({ - type: BlockchainWalletPreviewType.HARDWARE, - derivationPaths: fetchDerivationPaths, - blockchain, - } as BlockchainWalletPublicKeyRequest) + type: BlockchainWalletPreviewType.HARDWARE, + derivationPaths: fetchDerivationPaths, + device: device, + blockchain, + } as BlockchainWalletPublicKeyRequest) : ({ - type: BlockchainWalletPreviewType.MNEMONIC, - mnemonic: typeof mnemonic === "string" ? mnemonic : undefined, - derivationPaths: fetchDerivationPaths, - blockchain, - } as BlockchainWalletPublicKeyRequest); + type: BlockchainWalletPreviewType.MNEMONIC, + mnemonic: typeof mnemonic === "string" ? mnemonic : undefined, + derivationPaths: fetchDerivationPaths, + blockchain, + } as BlockchainWalletPublicKeyRequest); + console.log( + "[DEBUG] [ImportWallets] loadPublicKeys walletPreview", + walletPreview + ); + console.log( + "[DEBUG] [ImportWallets] loadPublicKeys userClient", + userClient + ); return safeClientResponse(userClient.previewWallets(walletPreview)) .then((result_) => { - setLoadPublicKeysError(false) + console.log("[DEBUG] [ImportWallets] loadPublicKeys success"); + setLoadPublicKeysError(false); const result = result_.wallets[0].walletDescriptors.map( (descriptor) => ({ ...descriptor, mnemonic, // bring back option for mnemonic === true to differentiat privatkey_derived & mnemnoic }) ) as WalletDescriptor[]; + console.log("[DEBUG] [ImportWallets] loadPublicKeys result", result_); setImportedPublicKeys( result_.wallets[0].walletDescriptors .filter((descriptor) => descriptor.imported) @@ -153,9 +166,10 @@ export function ImportWallets({ return result.find((fetched) => fetched.derivationPath === path)!; }); }) - .catch(() => { - setLoadPublicKeysError(true) - return [] + .catch((e) => { + console.log("[DEBUG] [ImportWallets] loadPublicKeys error", e); + setLoadPublicKeysError(true); + return []; }); }, [blockchain, userClient, walletDescriptorsCache] @@ -213,12 +227,20 @@ export function ImportWallets({ blockchain: Blockchain; }[] ) => { + console.log( + "[DEBUG] [ImportWallets] fetchPublicKeys newWalletDescriptors", + newWalletDescriptors + ); if (!isFundedAddresses) { setWalletDescriptors(newWalletDescriptors); } const balances = await loadBalances( newWalletDescriptors.map((descriptor) => descriptor.publicKey) ); + console.log( + "[DEBUG] [ImportWallets] fetchPublicKeys balances", + balances + ); const balancesObj = Object.fromEntries( balances .sort((a, b) => @@ -272,7 +294,6 @@ export function ImportWallets({ // setWalletDescriptors, ]); - useEffect(() => { fetchPublicKeys(); }, [fetchPublicKeys]); @@ -376,13 +397,14 @@ export function ImportWallets({ const renderItem = useCallback( (item: WalletDescriptor) => { const { publicKey, derivationPath } = item; - const displayBalance = `${balances?.[publicKey] - ? (+ethers.utils.formatUnits( - balances?.[publicKey], - decimals - )).toFixed(4) - : "-" - } ${symbol}`; + const displayBalance = `${ + balances?.[publicKey] + ? (+ethers.utils.formatUnits( + balances?.[publicKey], + decimals + )).toFixed(4) + : "-" + } ${symbol}`; const label = formatWalletAddress(item.publicKey, 5); const disabled = isDisabledPublicKey(publicKey); @@ -502,7 +524,7 @@ export function ImportWallets({ {walletDescriptors === null || - (balances === null && isFundedAddresses) ? ( + (balances === null && isFundedAddresses) ? ( ) : !derivationPathInputError && walletDescriptors.length > 0 ? ( @@ -524,7 +546,7 @@ export function ImportWallets({ { - fetchPublicKeys() + fetchPublicKeys(); }} /> ) : ( diff --git a/packages/app-extension/src/manifest.json b/packages/app-extension/src/manifest.json index d1fc7b205..fc661b41c 100644 --- a/packages/app-extension/src/manifest.json +++ b/packages/app-extension/src/manifest.json @@ -20,6 +20,9 @@ } } }, + "content-security-policy": { + "extension_pages": "'frame-src': 'self' 'https://connect.trezor.io/*' 'https://connect.trezor.io/'" + }, "content_scripts": [ { "matches": [""], @@ -27,6 +30,10 @@ "exclude_globs": ["*chrome-extension*"], "js": ["contentScript.js"], "all_frames": true + }, + { + "matches": ["*://connect.trezor.io/*/popup.html"], + "js": ["vendor/trezor-content-script.js"] } ], "icons": { @@ -34,5 +41,5 @@ "192": "anchor.png", "512": "anchor.png" }, - "permissions": ["alarms", "storage", "background"] + "permissions": ["alarms", "storage", "background", "*://connect.trezor.io/*"] } diff --git a/packages/app-extension/src/webextension/trezor/README.md b/packages/app-extension/src/webextension/trezor/README.md new file mode 100644 index 000000000..9ab79d889 --- /dev/null +++ b/packages/app-extension/src/webextension/trezor/README.md @@ -0,0 +1,2 @@ +Contents of this directory copied directly from +https://github.com/trezor/connect/tree/develop/src/js/plugins/webextension diff --git a/packages/app-extension/src/webextension/trezor/trezor-content-script.js b/packages/app-extension/src/webextension/trezor/trezor-content-script.js new file mode 100644 index 000000000..151034600 --- /dev/null +++ b/packages/app-extension/src/webextension/trezor/trezor-content-script.js @@ -0,0 +1,21 @@ +/* +Passing messages from background script to popup +*/ + +let port = chrome.runtime.connect({ name: "trezor-connect" }); +port.onMessage.addListener((message) => { + window.postMessage(message, window.location.origin); +}); +port.onDisconnect.addListener(() => { + port = null; +}); + +/* +Passing messages from popup to background script +*/ + +window.addEventListener("message", (event) => { + if (port && event.source === window && event.data) { + port.postMessage({ data: event.data }); + } +}); diff --git a/packages/app-extension/src/webextension/trezor/trezor-usb-permissions.html b/packages/app-extension/src/webextension/trezor/trezor-usb-permissions.html new file mode 100644 index 000000000..d53c5961a --- /dev/null +++ b/packages/app-extension/src/webextension/trezor/trezor-usb-permissions.html @@ -0,0 +1,40 @@ + + + + + + + TrezorConnect | Trezor + + + + + + + + + + + + + + diff --git a/packages/app-extension/src/webextension/trezor/trezor-usb-permissions.js b/packages/app-extension/src/webextension/trezor/trezor-usb-permissions.js new file mode 100644 index 000000000..97bf7e864 --- /dev/null +++ b/packages/app-extension/src/webextension/trezor/trezor-usb-permissions.js @@ -0,0 +1,72 @@ +const VERSION = "8.2.7-beta.3"; +const versionN = VERSION.split(".").map((s) => parseInt(s, 10)); +// const DIRECTORY = `${ versionN[0] }${ (versionN[1] > 0 ? `.${versionN[1]}` : '') }/`; +const DIRECTORY = `${versionN[0]}/`; +const url = `https://connect.trezor.io/${DIRECTORY}`; + +/* Handling messages from usb permissions iframe */ +const switchToPopupTab = (event) => { + window.removeEventListener("beforeunload", switchToPopupTab); + + if (!event) { + // triggered from 'usb-permissions-close' message + // close current tab + chrome.tabs.query( + { + currentWindow: true, + active: true, + }, + (current) => { + if (current.length < 0) return; + chrome.tabs.remove(current[0].id); + } + ); + } + + // find tab by popup pattern and switch to it + chrome.tabs.query( + { + url: `${url}popup.html`, + }, + (tabs) => { + if (tabs.length < 0) return; + chrome.tabs.update(tabs[0].id, { active: true }); + } + ); +}; + +window.addEventListener("message", (event) => { + if (event.data === "usb-permissions-init") { + const iframe = document.getElementById("trezor-usb-permissions"); + if (!iframe || !(iframe instanceof HTMLIFrameElement)) { + throw new Error("trezor-usb-permissions missing or incorrect dom type"); + } + iframe.contentWindow.postMessage( + { + type: "usb-permissions-init", + extension: chrome.runtime.id, + }, + "*" + ); + } else if (event.data === "usb-permissions-close") { + switchToPopupTab(); + } +}); + +window.addEventListener("beforeunload", switchToPopupTab); +window.addEventListener("load", () => { + const instance = document.createElement("iframe"); + instance.id = "trezor-usb-permissions"; + instance.frameBorder = "0"; + instance.width = "100%"; + instance.height = "100%"; + instance.style.border = "0px"; + instance.style.width = "100%"; + instance.style.height = "100%"; + instance.setAttribute("src", `${url}extension-permissions.html`); + instance.setAttribute("allow", "usb"); + + if (document.body) { + document.body.appendChild(instance); + } +}); diff --git a/packages/app-extension/webpack.config.js b/packages/app-extension/webpack.config.js index 93f0ebe5e..8c8a80dee 100644 --- a/packages/app-extension/webpack.config.js +++ b/packages/app-extension/webpack.config.js @@ -311,7 +311,7 @@ const options = { ? { // add support for react devtools in development mode extension_pages: - "script-src 'self' http://localhost:8097; object-src 'self'", + "script-src 'self' http://localhost:8097; object-src 'self'; frame-src: 'self'", } : undefined, }, @@ -357,6 +357,18 @@ const options = { to: "injected.js", force: true, }, + { + from: "src/webextension/trezor/trezor-content-script.js", + to: "vendor/trezor-content-script.js", + }, + { + from: "src/webextension/trezor/trezor-usb-permissions.js", + to: "vendor/trezor-usb-permissions.js", + }, + { + from: "src/webextension/trezor/trezor-usb-permissions.html", + to: "vendor/trezor-usb-permissions.html", + }, ], }), ], diff --git a/packages/common/src/types.ts b/packages/common/src/types.ts index a84e2b7a9..c9cde20a7 100644 --- a/packages/common/src/types.ts +++ b/packages/common/src/types.ts @@ -116,7 +116,7 @@ export type NftAttribute = { value: string; }; -export type KeyringType = "mnemonic" | "ledger" | "private-key"; +export type KeyringType = "mnemonic" | "ledger" | "trezor" | "private-key"; export type MnemonicKeyringInit = { signedWalletDescriptors: Array; diff --git a/packages/i18n/src/locales/en.json b/packages/i18n/src/locales/en.json index 04d05d009..8af2dbe0c 100644 --- a/packages/i18n/src/locales/en.json +++ b/packages/i18n/src/locales/en.json @@ -269,6 +269,7 @@ "hardware": "Hardware", "hardware_wallet": "Hardware wallet", "have_hardware_wallet": "Import hardware wallet", + "have_hardware_wallet_trezor": "Import hardware wallet (Trezor)", "help_ampersand_support": "Help & Support", "help_us_learn_more_about_you_as_an_investor": "Help us learn more about you as an investor. We’re required by law to collect this information.", "hidden_tokens": "Hidden Tokens", diff --git a/packages/recoil/src/context/OnboardingProvider.tsx b/packages/recoil/src/context/OnboardingProvider.tsx index 04bd08b02..41388c824 100644 --- a/packages/recoil/src/context/OnboardingProvider.tsx +++ b/packages/recoil/src/context/OnboardingProvider.tsx @@ -178,6 +178,7 @@ export function OnboardingProvider({ // TODO: we shouldn't use the same handler for both paths here. if ( + keyringType === "trezor" || keyringType === "ledger" || action === "import" || keyringType === "private-key" @@ -238,7 +239,10 @@ export function OnboardingProvider({ ): MnemonicKeyringInit | LedgerKeyringInit | PrivateKeyKeyringInit => { if (data.keyringType === "private-key") { return data.privateKeyKeyringInit!; - } else if (data.keyringType === "ledger") { + } else if ( + data.keyringType === "ledger" || + data.keyringType === "trezor" + ) { return { signedWalletDescriptors: data.signedWalletDescriptors!, }; @@ -268,6 +272,12 @@ export function OnboardingProvider({ device: "ledger", ...descriptor, })); + } else if (data.keyringType === "trezor") { + return data.signedWalletDescriptors!.map((descriptor) => ({ + type: BlockchainWalletInitType.HARDWARE, + device: "trezor", + ...descriptor, + })); } else { return data.signedWalletDescriptors!.map((descriptor) => ({ type: BlockchainWalletInitType.MNEMONIC, diff --git a/packages/secure-background/src/keyring/BlockchainKeyring.ts b/packages/secure-background/src/keyring/BlockchainKeyring.ts index adff4bacb..7dd4a5fb1 100644 --- a/packages/secure-background/src/keyring/BlockchainKeyring.ts +++ b/packages/secure-background/src/keyring/BlockchainKeyring.ts @@ -21,6 +21,8 @@ import type { KeyringFactory, LedgerKeyring, LedgerKeyringFactory, + TrezorKeyring, + TrezorKeyringFactory, } from "./types"; const logger = getLogger("background/backend/keyring"); @@ -31,9 +33,11 @@ export class BlockchainKeyring { private hdKeyringFactory: HdKeyringFactory; private keyringFactory: KeyringFactory; private ledgerKeyringFactory: LedgerKeyringFactory; + private trezorKeyringFactory: TrezorKeyringFactory; private hdKeyring?: HdKeyring; private importedKeyring?: Keyring; public ledgerKeyring?: LedgerKeyring; + public trezorKeyring?: TrezorKeyring; private activeWallet?: string; private deletedWallets?: Array; private blockchain: Blockchain; @@ -43,12 +47,14 @@ export class BlockchainKeyring { store: SecureStore, hdKeyringFactory: HdKeyringFactory, keyringFactory: KeyringFactory, - ledgerKeyringFactory: LedgerKeyringFactory + ledgerKeyringFactory: LedgerKeyringFactory, + trezorKeyringFactory: TrezorKeyringFactory ) { this.store = store; this.hdKeyringFactory = hdKeyringFactory; this.keyringFactory = keyringFactory; this.ledgerKeyringFactory = ledgerKeyringFactory; + this.trezorKeyringFactory = trezorKeyringFactory; this.blockchain = blockchain; } @@ -56,6 +62,7 @@ export class BlockchainKeyring { hdPublicKeys: Array; importedPublicKeys: Array; ledgerPublicKeys: Array; + trezorPublicKeys: Array; } { const hdPublicKeys = this.hdKeyring ? this.hdKeyring.publicKeys() : []; const importedPublicKeys = this.importedKeyring @@ -64,10 +71,15 @@ export class BlockchainKeyring { const ledgerPublicKeys = this.ledgerKeyring ? this.ledgerKeyring.publicKeys() : []; + const trezorPublicKeys = this.trezorKeyring + ? this.trezorKeyring.publicKeys() + : []; + return { hdPublicKeys, importedPublicKeys, ledgerPublicKeys, + trezorPublicKeys, }; } @@ -77,6 +89,7 @@ export class BlockchainKeyring { } this.ledgerKeyring = this.ledgerKeyringFactory.init([]); + this.trezorKeyring = this.trezorKeyringFactory.init([]); this.importedKeyring = this.keyringFactory.init([]); } @@ -225,13 +238,14 @@ export class BlockchainKeyring { } public toJson(): BlockchainKeyringJson { - if (!this.importedKeyring || !this.ledgerKeyring) { + if (!this.importedKeyring || !this.ledgerKeyring || !this.trezorKeyring) { throw new Error("blockchain keyring is locked"); } return { hdKeyring: this.hdKeyring ? this.hdKeyring.toJson() : undefined, importedKeyring: this.importedKeyring.toJson(), ledgerKeyring: this.ledgerKeyring.toJson(), + trezorKeyring: this.trezorKeyring.toJson(), activeWallet: this.activeWallet!, deletedWallets: this.deletedWallets!, }; @@ -242,6 +256,7 @@ export class BlockchainKeyring { hdKeyring, importedKeyring, ledgerKeyring, + trezorKeyring, activeWallet, deletedWallets, } = json; @@ -250,6 +265,7 @@ export class BlockchainKeyring { : undefined; this.importedKeyring = this.keyringFactory.fromJson(importedKeyring); this.ledgerKeyring = this.ledgerKeyringFactory.fromJson(ledgerKeyring); + this.trezorKeyring = this.trezorKeyringFactory.fromJson(trezorKeyring); this.activeWallet = activeWallet; this.deletedWallets = deletedWallets; } @@ -283,6 +299,7 @@ export class BlockchainKeyring { this.hdKeyring, this.importedKeyring, this.ledgerKeyring, + this.trezorKeyring, ]) { if (keyring && keyring.publicKeys().find((k) => k === publicKey)) { return keyring; diff --git a/packages/secure-background/src/keyring/index.ts b/packages/secure-background/src/keyring/index.ts index 59f8803cd..d24589102 100644 --- a/packages/secure-background/src/keyring/index.ts +++ b/packages/secure-background/src/keyring/index.ts @@ -10,6 +10,7 @@ import { SolanaHdKeyringFactory, SolanaKeyringFactory, SolanaLedgerKeyringFactory, + SolanaTrezorKeyringFactory, } from "../services/svm/keyring"; import type { SecureStore } from "../store/SecureStore"; @@ -33,21 +34,25 @@ export function keyringForBlockchain( store, new SolanaHdKeyringFactory(), new SolanaKeyringFactory(), - new SolanaLedgerKeyringFactory() + new SolanaLedgerKeyringFactory(), + new SolanaTrezorKeyringFactory() ), [Blockchain.ECLIPSE]: new BlockchainKeyring( Blockchain.ECLIPSE, store, new SolanaHdKeyringFactory(), new SolanaKeyringFactory(), - new SolanaLedgerKeyringFactory() + new SolanaLedgerKeyringFactory(), + new SolanaTrezorKeyringFactory() ), [Blockchain.ETHEREUM]: new BlockchainKeyring( Blockchain.ETHEREUM, store, new EthereumHdKeyringFactory(), new EthereumKeyringFactory(), - new EthereumLedgerKeyringFactory() + new EthereumLedgerKeyringFactory(), + // FIXME: Fix ETH Trezor properly + new SolanaTrezorKeyringFactory() ), }[blockchain]; } diff --git a/packages/secure-background/src/keyring/trezor.ts b/packages/secure-background/src/keyring/trezor.ts new file mode 100644 index 000000000..ef17dbda2 --- /dev/null +++ b/packages/secure-background/src/keyring/trezor.ts @@ -0,0 +1,75 @@ +import type { Blockchain, WalletDescriptor } from "@coral-xyz/common"; + +import type { TrezorKeyring, TrezorKeyringJson } from "./types"; + +export class TrezorKeyringBase + implements + Omit +{ + protected walletDescriptors: Array; + protected blockchain: Blockchain; + + constructor( + walletDescriptors: Array, + blockchain: Blockchain + ) { + this.walletDescriptors = walletDescriptors; + this.blockchain = blockchain; + } + + signTransaction(tx: Buffer, address: string): Promise { + throw new Error("Method not implemented."); + } + signMessage(tx: Buffer, address: string): Promise { + throw new Error("Method not implemented."); + } + + public deletePublicKey(publicKey: string) { + this.walletDescriptors = this.walletDescriptors.filter( + (x) => x.publicKey !== publicKey + ); + } + + public async add(walletDescriptor: WalletDescriptor) { + const found = this.walletDescriptors.find( + (x) => x.publicKey === walletDescriptor.publicKey + ); + if (found) { + throw new Error("trezor account already exists"); + } + this.walletDescriptors.push(walletDescriptor); + } + + public publicKeys(): Array { + return this.walletDescriptors.map((x) => x.publicKey); + } + + public exportSecretKey(_address: string): string | null { + throw new Error("trezor keyring cannot export secret keys"); + } + public importSecretKey(_secretKey: string): string { + throw new Error("trezor keyring cannot import secret keys"); + } + + public seedToSecretKey(seed: Buffer, derivationPath: string): string { + throw new Error("trezor keyring cannot derive secrets"); + } + + public secretKeyToPublicKeys( + secretKey: string + ): { type: string; publicKey: string }[] { + throw new Error("trezor keyring has no secrets"); + } + + public toString(): string { + return JSON.stringify({ + walletDescriptors: this.walletDescriptors, + }); + } + + public toJson(): TrezorKeyringJson { + return { + walletDescriptors: this.walletDescriptors, + }; + } +} diff --git a/packages/secure-background/src/keyring/types.ts b/packages/secure-background/src/keyring/types.ts index e2e5cea04..c0a527bfc 100644 --- a/packages/secure-background/src/keyring/types.ts +++ b/packages/secure-background/src/keyring/types.ts @@ -4,6 +4,7 @@ export type BlockchainKeyringJson = { hdKeyring?: HdKeyringJson; importedKeyring: KeyringJson; ledgerKeyring: LedgerKeyringJson; + trezorKeyring: TrezorKeyringJson; activeWallet: string; deletedWallets: Array; }; @@ -24,6 +25,11 @@ export type LedgerKeyringJson = { walletDescriptors: Array; }; +// TODO: Implement & Type Check +export type TrezorKeyringJson = { + walletDescriptors: Array; +}; + export interface KeyringFactory { init(secretKeys: Array): Keyring; fromJson(payload: KeyringJson): Keyring; @@ -81,4 +87,28 @@ export interface LedgerKeyring extends KeyringBase { toJson(): LedgerKeyringJson; } -export type AnyKeyring = Keyring | HdKeyring | LedgerKeyring; +// +// Trezor keyring types +// + +// TODO: Implement & Type Check +export interface TrezorKeyringFactory { + init(walletDescriptors: Array): LedgerKeyring; + fromJson(obj: LedgerKeyringJson): LedgerKeyring; +} + +// TODO: Implement & Type Check +export interface TrezorKeyring extends KeyringBase { + prepareSignTransaction(request: { publicKey: string; tx: string }): Promise<{ + signableTx: string; + derivationPath: string; + }>; + prepareSignMessage(request: { publicKey: string; message: string }): Promise<{ + signableMessage: string; + derivationPath: string; + }>; + add(walletDescriptor: WalletDescriptor): Promise; + toJson(): TrezorKeyringJson; +} + +export type AnyKeyring = Keyring | HdKeyring | LedgerKeyring | TrezorKeyring; diff --git a/packages/secure-background/src/services/svm/keyring.ts b/packages/secure-background/src/services/svm/keyring.ts index cace105b9..06fb3ed82 100644 --- a/packages/secure-background/src/services/svm/keyring.ts +++ b/packages/secure-background/src/services/svm/keyring.ts @@ -6,6 +6,7 @@ import { encode } from "bs58"; import nacl from "tweetnacl"; import { LedgerKeyringBase } from "../../keyring/ledger"; +import { TrezorKeyringBase } from "../../keyring/trezor"; import type { HdKeyring, HdKeyringFactory, @@ -16,6 +17,8 @@ import type { KeyringJson, LedgerKeyring, LedgerKeyringJson, + TrezorKeyring, + TrezorKeyringJson, } from "../../keyring/types"; import { @@ -280,3 +283,38 @@ class SolanaLedgerKeyring extends LedgerKeyringBase implements LedgerKeyring { }; } } + +export class SolanaTrezorKeyringFactory { + public init(walletDescriptors: Array): TrezorKeyring { + return new SolanaTrezorKeyring(walletDescriptors, Blockchain.SOLANA); + } + + public fromJson(obj: TrezorKeyringJson): TrezorKeyring { + return new SolanaTrezorKeyring(obj.walletDescriptors, Blockchain.SOLANA); + } +} + +export class SolanaTrezorKeyring + extends TrezorKeyringBase + implements TrezorKeyring +{ + public async prepareSignTransaction(request: { + publicKey: string; + tx: string; + }): Promise<{ + signableTx: string; + derivationPath: string; + }> { + throw new Error("[DEBUG] [SOLANA TREZOR KEYRING] Method not implemented."); + } + + public async prepareSignMessage(request: { + publicKey: string; + message: string; + }): Promise<{ + signableMessage: string; + derivationPath: string; + }> { + throw new Error("[DEBUG] [SOLANA TREZOR KEYRING] Method not implemented."); + } +} diff --git a/packages/secure-background/src/services/user/server.ts b/packages/secure-background/src/services/user/server.ts index 0981edf04..6cf8bdeea 100644 --- a/packages/secure-background/src/services/user/server.ts +++ b/packages/secure-background/src/services/user/server.ts @@ -160,6 +160,7 @@ export class UserService { private handlePreviewWallets: TransportHandler<"SECURE_USER_PREVIEW_WALLETS"> = async ({ request, event, respond, error }) => { + console.log("[DEBUG] handlePreviewWallets", request); const keyringStoreState = await this.keyringStore.state(); const userKeyring = keyringStoreState !== KeyringStoreState.NeedsOnboarding @@ -174,15 +175,17 @@ export class UserService { switch (request.type) { case BlockchainWalletPreviewType.HARDWARE: { - const ledgerResponse = await safeClientResponse( + console.log("[DEBUG] handlePreviewWallets 2", request); + const hardwareResponse = await safeClientResponse( this.secureUIClient.confirm(event, {}) ); + console.log("[DEBUG] hardwareResponse", hardwareResponse); - const walletDescriptors = ledgerResponse.walletDescriptors.map( + const walletDescriptors = hardwareResponse.walletDescriptors.map( (walletDescriptor) => { const descriptor: BlockchainWalletDescriptor = { type: BlockchainWalletDescriptorType.HARDWARE, - device: "ledger", + device: request.device, blockchain: request.blockchain, publicKey: walletDescriptor.publicKey, derivationPath: walletDescriptor.derivationPath, diff --git a/packages/secure-background/src/store/KeyringStore/UserKeyring.ts b/packages/secure-background/src/store/KeyringStore/UserKeyring.ts index a89487455..3f1cfc691 100644 --- a/packages/secure-background/src/store/KeyringStore/UserKeyring.ts +++ b/packages/secure-background/src/store/KeyringStore/UserKeyring.ts @@ -134,6 +134,8 @@ export class UserKeyring { this.blockchains.set(blockchain, keyring); } + // Temporarily to fix a weird switch issue + /* eslint-disable no-fallthrough */ switch (blockchainWalletInit.type) { case BlockchainWalletInitType.MNEMONIC: { if (blockchainWalletInit.mnemonic) { @@ -158,12 +160,22 @@ export class UserKeyring { return { publicKey, name, blockchain }; } case BlockchainWalletInitType.HARDWARE: { - return { - ...(await this.ledgerImport({ - ...blockchainWalletInit, - })), - blockchain, - }; + switch (blockchainWalletInit.device) { + case "ledger": + return { + ...(await this.ledgerImport({ + ...blockchainWalletInit, + })), + blockchain, + }; + case "trezor": + return { + ...(await this.trezorImport({ + ...blockchainWalletInit, + })), + blockchain, + }; + } } case BlockchainWalletInitType.PRIVATEKEY_DERIVED: { const [publicKey, name] = await keyring.importSecretFromMnemonic( @@ -177,6 +189,7 @@ export class UserKeyring { } } } + /* eslint-enable no-fallthrough */ public async blockchainKeyringRemove(blockchain: Blockchain): Promise { const user = await this.store.getActiveUser(); @@ -288,6 +301,44 @@ export class UserKeyring { }; } + private async trezorImport(walletDescriptor: WalletDescriptor): Promise<{ + publicKey: string; + name: string; + }> { + const blockchainKeyring = this.blockchains.get(walletDescriptor.blockchain); + const trezorKeyring = blockchainKeyring!.trezorKeyring!; + console.log( + "[DEBUG] UserKeyring: trezorImport: walletDescriptor:", + walletDescriptor, + blockchainKeyring, + trezorKeyring + ); + + throw new Error("Method not implemented."); + /* + const ledgerKeyring = blockchainKeyring!.ledgerKeyring!; + await ledgerKeyring.add(walletDescriptor); + const name = this.store.defaultKeyname.defaultLedger( + ledgerKeyring.publicKeys().length + ); + await this.store.setUserPublicKey( + this.uuid, + walletDescriptor.blockchain, + walletDescriptor.publicKey, + { + name, + isCold: true, + type: "hardware", + } + ); + + return { + name, + publicKey: walletDescriptor.publicKey, + }; + */ + } + public async keyDelete({ blockchain, publicKey, diff --git a/packages/secure-background/src/transports/ToSecureUITransportSender.ts b/packages/secure-background/src/transports/ToSecureUITransportSender.ts index 7bd0ad90c..09b01d6ca 100644 --- a/packages/secure-background/src/transports/ToSecureUITransportSender.ts +++ b/packages/secure-background/src/transports/ToSecureUITransportSender.ts @@ -23,7 +23,7 @@ const logger = getLogger("secure-ui ToSecureUITransportSender"); // Forwarder does not set its own origin and instead expects a origin to exist on the request. export class ToSecureUITransportSender< X extends SECURE_EVENTS, - R extends SecureRequestType = undefined + R extends SecureRequestType = undefined, > implements TransportSender { private port: chrome.runtime.Port | null = null; @@ -90,6 +90,7 @@ export class ToSecureUITransportSender< ); // if same port has reconnected (reload) if (newPort?.name === port.name) { + console.log("[DEBUG] ToSecureUITransportSender: err 1"); return; //-> dont send error responses } @@ -102,6 +103,7 @@ export class ToSecureUITransportSender< try { port.disconnect(); } catch (e) { + console.log("[DEBUG] ToSecureUITransportSender: err 2"); /* this is okay to fail, as it means no listeners left. */ logger.error("Plugin Disconnect", e); } @@ -110,6 +112,7 @@ export class ToSecureUITransportSender< this.responseQueue .filter((response) => response.portName === port.name) .forEach((response) => { + console.log("[DEBUG] ToSecureUITransportSender: err 3", response); const responseWithId = { name: response.request.name, id: response.request.id, @@ -183,6 +186,7 @@ export class ToSecureUITransportSender< if (queuedRequest) { queuedRequest.resolve(response.data); } else { + console.log("[DEBUG] ToSecureUITransportSender: err 4"); logger.error("No queued request found.", response.data); } @@ -219,6 +223,7 @@ export class ToSecureUITransportSender< globalThis.chrome?.windows .remove(this.port.sender.tab.windowId) .catch((e) => { + console.log("[DEBUG] ToSecureUITransportSender: err 5"); logger.error("Plugin Close", name, e); }); } @@ -259,6 +264,7 @@ export class ToSecureUITransportSender< focused: true, }) .catch((e) => { + console.log("[DEBUG] ToSecureUITransportSender: err 6"); logger.error("window.update", e); }); } @@ -267,6 +273,7 @@ export class ToSecureUITransportSender< private openPopup = (windowId: string) => { this.lastOpenedWindowId = windowId; openPopupWindow("popup.html?windowId=" + windowId).catch((e) => { + console.log("[DEBUG] ToSecureUITransportSender: err 7"); logger.error("openPopup", e); }); }; diff --git a/packages/secure-background/src/types/blockchain.ts b/packages/secure-background/src/types/blockchain.ts index 942be0683..e1c7be13e 100644 --- a/packages/secure-background/src/types/blockchain.ts +++ b/packages/secure-background/src/types/blockchain.ts @@ -20,64 +20,64 @@ export enum BlockchainWalletDescriptorType { } export type BlockchainWalletPublicKeyRequest< - T extends BlockchainWalletPreviewType = BlockchainWalletPreviewType + T extends BlockchainWalletPreviewType = BlockchainWalletPreviewType, > = T extends BlockchainWalletPreviewType.HARDWARE ? { type: T; - device: "ledger"; + device: "ledger" | "trezor"; blockchain: Blockchain; derivationPaths: string[]; } : T extends BlockchainWalletPreviewType.PRIVATEKEY - ? { - type: T; - blockchain: Blockchain; - privateKey: string; - } - : T extends BlockchainWalletPreviewType.MNEMONIC - ? { - type: T; - blockchain: Blockchain; - mnemonic?: string; - derivationPaths: string[]; - } - : T extends BlockchainWalletPreviewType.MNEMONIC_NEXT - ? { - type: T; - blockchain: Blockchain; - mnemonic?: string; - } - : never; + ? { + type: T; + blockchain: Blockchain; + privateKey: string; + } + : T extends BlockchainWalletPreviewType.MNEMONIC + ? { + type: T; + blockchain: Blockchain; + mnemonic?: string; + derivationPaths: string[]; + } + : T extends BlockchainWalletPreviewType.MNEMONIC_NEXT + ? { + type: T; + blockchain: Blockchain; + mnemonic?: string; + } + : never; export type BlockchainWalletDescriptor< - T extends BlockchainWalletDescriptorType = BlockchainWalletDescriptorType + T extends BlockchainWalletDescriptorType = BlockchainWalletDescriptorType, > = T extends BlockchainWalletDescriptorType.HARDWARE ? { type: T; - device: "ledger"; + device: "ledger" | "trezor"; blockchain: Blockchain; publicKey: string; imported: boolean; derivationPath: string; } : T extends BlockchainWalletDescriptorType.PRIVATEKEY - ? { - type: T; - blockchain: Blockchain; - publicKey: string; - imported: boolean; - } - : T extends BlockchainWalletDescriptorType.MNEMONIC - ? { - type: T; - blockchain: Blockchain; - publicKey: string; - imported: boolean; - derivationPath: string; - } - : never; + ? { + type: T; + blockchain: Blockchain; + publicKey: string; + imported: boolean; + } + : T extends BlockchainWalletDescriptorType.MNEMONIC + ? { + type: T; + blockchain: Blockchain; + publicKey: string; + imported: boolean; + derivationPath: string; + } + : never; export type BlockchainWalletInit< - T extends BlockchainWalletInitType = BlockchainWalletInitType + T extends BlockchainWalletInitType = BlockchainWalletInitType, > = T extends BlockchainWalletInitType.MNEMONIC ? { type: T; @@ -87,31 +87,31 @@ export type BlockchainWalletInit< derivationPath: string; } : T extends BlockchainWalletInitType.PRIVATEKEY_DERIVED - ? { - type: T; - blockchain: Blockchain; - mnemonic: string; - publicKey: string; - derivationPath: string; - name?: string; - } - : T extends BlockchainWalletInitType.PRIVATEKEY - ? { - type: T; - blockchain: Blockchain; - publicKey: string; - privateKey: string; - name?: string; - } - : T extends BlockchainWalletInitType.HARDWARE - ? { - type: T; - device: "ledger"; - blockchain: Blockchain; - publicKey: string; - derivationPath: string; - } - : never; + ? { + type: T; + blockchain: Blockchain; + mnemonic: string; + publicKey: string; + derivationPath: string; + name?: string; + } + : T extends BlockchainWalletInitType.PRIVATEKEY + ? { + type: T; + blockchain: Blockchain; + publicKey: string; + privateKey: string; + name?: string; + } + : T extends BlockchainWalletInitType.HARDWARE + ? { + type: T; + device: "ledger" | "trezor"; + blockchain: Blockchain; + publicKey: string; + derivationPath: string; + } + : never; export type BlockchainConfig = { caip2Id: string; // caip-2 "namespace:reference" diff --git a/packages/secure-ui/package.json b/packages/secure-ui/package.json index bd8d66e80..6811711ea 100644 --- a/packages/secure-ui/package.json +++ b/packages/secure-ui/package.json @@ -44,6 +44,7 @@ "@solana/wallet-standard-features": "^1.2.0", "@solana/wallet-standard-util": "^1.1.1", "@solana/web3.js": "1.63.1", + "@trezor/connect-web": "^9.1.12", "bs58": "^5.0.0", "ethers5": "npm:ethers@^5.5.1", "ethers6": "npm:ethers@^6.8.0", diff --git a/packages/secure-ui/src/RequestHandlers/PreviewPublicKeysRequest.tsx b/packages/secure-ui/src/RequestHandlers/PreviewPublicKeysRequest.tsx new file mode 100644 index 000000000..5bfa7f6c4 --- /dev/null +++ b/packages/secure-ui/src/RequestHandlers/PreviewPublicKeysRequest.tsx @@ -0,0 +1,38 @@ +import { + BlockchainWalletPreviewType, + BlockchainWalletPublicKeyRequest, +} from "@coral-xyz/secure-background/types"; + +import { LedgerPreviewPublicKeysRequest } from "./LedgerRequests/LedgerPreviewPublicKeysRequest"; +import { TrezorPreviewPublicKeysRequest } from "./TrezorRequests/TrezorPreviewPublicKeysRequest"; +import type { QueuedUiRequest } from "../_atoms/requestAtoms"; + +export function HardwarePreviewPublicKeysRequest({ + currentRequest, +}: { + currentRequest: QueuedUiRequest<"SECURE_USER_PREVIEW_WALLETS">; +}) { + const request = + currentRequest.request as BlockchainWalletPublicKeyRequest; + + switch (request.device) { + case "ledger": + return ( + + } + /> + ); + case "trezor": + return ( + + } + /> + ); + default: + return null; + } +} diff --git a/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorPreviewPublicKeysRequest.tsx b/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorPreviewPublicKeysRequest.tsx new file mode 100644 index 000000000..a64e58ee9 --- /dev/null +++ b/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorPreviewPublicKeysRequest.tsx @@ -0,0 +1,196 @@ +import { Blockchain } from "@coral-xyz/common"; +import { + BlockchainWalletDescriptorType, + BlockchainWalletPreviewType, + BlockchainWalletPublicKeyRequest, +} from "@coral-xyz/secure-background/types"; +import { + HardwareIcon, + ErrorCrossMarkIcon, + Loader, + Progress, + StyledText, + YStack, +} from "@coral-xyz/tamagui"; +import { PublicKey } from "@solana/web3.js"; +import { useCallback, useEffect, useState } from "react"; + +import { isLegalTrezorPath } from "./_utils/isLegalTrezorPath"; +import TrezorConnect from "./_utils/trezorConnect"; +import type { QueuedUiRequest } from "../../_atoms/requestAtoms"; +import { RequestConfirmation } from "../../_sharedComponents/RequestConfirmation"; + +type DerivationPaths = { + blockchain: Blockchain; + publicKey: string; + derivationPath: string; +}[]; + +type FetchWallets = ( + setProgress: (progress: number) => void +) => Promise; + +export function TrezorPreviewPublicKeysRequest({ + currentRequest, +}: { + currentRequest: QueuedUiRequest<"SECURE_USER_PREVIEW_WALLETS">; +}) { + const request = + currentRequest.request as BlockchainWalletPublicKeyRequest; + + const fetchSolanaWallets = useCallback(async (setProgress) => { + const derivationPathBundle = request.derivationPaths + .filter(isLegalTrezorPath) + .map((path) => ({ + path, + showOnTrezor: false, + })); + + console.log("[DEBUG] [TREZOR] derivationPathBundle", derivationPathBundle); + + const result = await TrezorConnect.solanaGetPublicKey({ + bundle: derivationPathBundle, + }); + + if (result.success === false) { + throw new Error(result.payload.error); + } + + const derivationPaths: DerivationPaths = result.payload.map((payload) => ({ + publicKey: payload.publicKey, + derivationPath: payload.serializedPath, + blockchain: request.blockchain, + })); + + console.log( + "[DEBUG] [TREZOR] derivationPaths", + Object.values(derivationPaths) + ); + + setProgress(1); + return Object.values(derivationPaths); + }, []); + + // TODO: Implement Ethereum + const fetchEthereumWallets = () => { + throw new Error("Trezor is not implemented for Ethereum."); + }; + + switch (request.blockchain) { + case Blockchain.SOLANA: + return ( + + ); + case Blockchain.ETHEREUM: + return ( + + ); + default: + return null; + } +} + +function SelectWallets({ + currentRequest, + fetchWallets, + statuses, +}: { + currentRequest: QueuedUiRequest<"SECURE_USER_PREVIEW_WALLETS">; + fetchWallets: FetchWallets; + statuses: string[]; +}) { + const [status, setStatus] = useState("Connect your Trezor."); + const [progress, setProgress] = useState(0); + const [isError, setIsError] = useState(false); + const [isPermissionsError, setIsPermissionsError] = useState(false); + + useEffect(() => { + const result = fetchWallets(setProgress); + console.log("[DEBUG] [TREZOR] SelectWallets promise", result); + + result + .then((result) => { + console.log("[DEBUG] [TREZOR] SelectWallets result", result); + currentRequest.respond({ + walletDescriptors: result.map((descriptor) => ({ + ...descriptor, + type: BlockchainWalletDescriptorType.HARDWARE, + device: "trezor", + })), + }); + }) + .catch((e) => { + console.log("[DEBUG] [TREZOR] SelectWallets error", e); + // FIXME: This error can't happen for Trezor. + // Catch Trezor Errors instead. + if (e.message === "HID_PERMISSIONS_NOT_AVAILABLE") { + setIsError(true); + setIsPermissionsError(true); + setStatus("Missing HID browser permissions."); + } else { + setStatus(e.message); + setIsError(true); + setIsPermissionsError(false); + } + // currentRequest.error(e instanceof Error ? e : new Error(e)); + }); + }, [currentRequest.id]); + + return ( + { + window.close(); + }} + rightButton={isPermissionsError ? "Grant Trezor Permissions" : null} + onDeny={() => currentRequest.error(new Error("Cancelled by User"))} + buttonDirection="column-reverse" + > + + + + {statuses[0]} + + + {status} + + + {isError ? ( + + + + ) : ( + + + + + )} + + {status === statuses[1] ? ( + + + + ) : null} + + + ); +} diff --git a/packages/secure-ui/src/RequestHandlers/TrezorRequests/_utils/isLegalTrezorPath.ts b/packages/secure-ui/src/RequestHandlers/TrezorRequests/_utils/isLegalTrezorPath.ts new file mode 100644 index 000000000..b80b4e58e --- /dev/null +++ b/packages/secure-ui/src/RequestHandlers/TrezorRequests/_utils/isLegalTrezorPath.ts @@ -0,0 +1,11 @@ +/** + * Checks if the given path is a valid Trezor path conforming to + * [this firmware spec](https://github.com/vacuumlabs/trezor-firmware/blob/5ec9326f52fa4a6b15c0e38f81bfd6f9dbd0b475/core/src/apps/solana/__init__.py#L3-L7) + * + * @param path - The path to check + * @returns boolean indicating validity + */ +export function isLegalTrezorPath(path: string) { + const pathRegex = /^m\/44'\/501'(\/\d'){0,2}$/; + return pathRegex.test(path); +} diff --git a/packages/secure-ui/src/RequestHandlers/TrezorRequests/_utils/trezorConnect.ts b/packages/secure-ui/src/RequestHandlers/TrezorRequests/_utils/trezorConnect.ts new file mode 100644 index 000000000..1725be97f --- /dev/null +++ b/packages/secure-ui/src/RequestHandlers/TrezorRequests/_utils/trezorConnect.ts @@ -0,0 +1,11 @@ +import TrezorConnect from "@trezor/connect-web"; + +TrezorConnect.init({ + manifest: { + email: "samuel.sulovsky@vacuumlabs.com", + appUrl: "https://backpack.app/", + }, + lazyLoad: true, +}); + +export default TrezorConnect; diff --git a/packages/secure-ui/src/SecureUI.tsx b/packages/secure-ui/src/SecureUI.tsx index e8e298dae..79ff8d5b7 100644 --- a/packages/secure-ui/src/SecureUI.tsx +++ b/packages/secure-ui/src/SecureUI.tsx @@ -1,23 +1,20 @@ -import type { QueuedUiRequest } from "./_atoms/requestAtoms"; +import { + notificationListenerAtom, + secureBackgroundSenderAtom, +} from "@coral-xyz/recoil"; import type { SECURE_EVENTS, TransportBroadcastListener, TransportReceiver, TransportSender, } from "@coral-xyz/secure-clients/types"; - -import type { ReactNode } from "react"; -import { Suspense, useMemo } from "react"; - -import { - notificationListenerAtom, - secureBackgroundSenderAtom, -} from "@coral-xyz/recoil"; import { View, config as tamaguiConfig, TamaguiProvider, } from "@coral-xyz/tamagui"; +import type { ReactNode } from "react"; +import { Suspense, useMemo } from "react"; import { RecoilRoot, useRecoilValueLoadable } from "recoil"; import { Presentation, PresentationTypes } from "./Presentation"; @@ -27,13 +24,14 @@ import { EvmSignMessageRequest } from "./RequestHandlers/EvmSignMessageRequest"; import { EvmSignTransactionRequest } from "./RequestHandlers/EvmSignTransactionRequest/EvmSignTransactionRequest"; import { ExportBackupRequest } from "./RequestHandlers/ExportBackupRequest"; import { GetMnemonicRequest } from "./RequestHandlers/GetMnemonicRequest"; -import { LedgerPreviewPublicKeysRequest } from "./RequestHandlers/LedgerRequests/LedgerPreviewPublicKeysRequest"; import { LedgerSignEvents, LedgerSignRequest, } from "./RequestHandlers/LedgerRequests/LedgerSignRequest"; +import { HardwarePreviewPublicKeysRequest } from "./RequestHandlers/PreviewPublicKeysRequest"; import { ResetBackpackRequest } from "./RequestHandlers/ResetBackpackRequest"; import { SvmSignAllTransactionsRequest } from "./RequestHandlers/SvmSignAllTransactionsRequest"; +import { SvmSignInRequest } from "./RequestHandlers/SvmSignInRequest"; import { SvmSignMessageRequest } from "./RequestHandlers/SvmSignMessageRequest"; import { SvmSignTransactionRequest } from "./RequestHandlers/SvmSignTransactionRequest/SvmSignTransactionRequest"; import { UnlockRequest } from "./RequestHandlers/UnlockRequest"; @@ -43,7 +41,7 @@ import { currentRequestAtom, secureUIReceiverAtom, } from "./_atoms/requestAtoms"; -import { SvmSignInRequest } from "./RequestHandlers/SvmSignInRequest"; +import type { QueuedUiRequest } from "./_atoms/requestAtoms"; export function SecureUI({ timing = 0, @@ -80,6 +78,9 @@ export function SecureUI({ function SecureUIRoot({ presentation }: { presentation?: PresentationTypes }) { const currentRequestLoadable = useRecoilValueLoadable(currentRequestAtom); const currentRequest = currentRequestLoadable.getValue(); + + console.log("[DEBUG] [SecureUIRoot] currentRequest: ", currentRequest); + return ( {currentRequest @@ -138,7 +139,7 @@ function SecureUIRoot({ presentation }: { presentation?: PresentationTypes }) { ); case "SECURE_USER_PREVIEW_WALLETS": return ( - } diff --git a/yarn.lock b/yarn.lock index 709dd6cb0..0c3b0d51d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1850,7 +1850,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-flow-strip-types@npm:^7.20.0, @babel/plugin-transform-flow-strip-types@npm:^7.22.5": +"@babel/plugin-transform-flow-strip-types@npm:^7.20.0": version: 7.22.5 resolution: "@babel/plugin-transform-flow-strip-types@npm:7.22.5" dependencies: @@ -2151,17 +2151,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-object-assign@npm:^7.16.7": - version: 7.23.3 - resolution: "@babel/plugin-transform-object-assign@npm:7.23.3" - dependencies: - "@babel/helper-plugin-utils": "npm:^7.22.5" - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 17b8da5fe6cabc9f01adae9d57ad5a232a7535007249d737de3a120c73c63c330588ca5592419083d2b55df04c49b193d1ef5dbf071933fea11ac05022fd8716 - languageName: node - linkType: hard - "@babel/plugin-transform-object-rest-spread@npm:^7.12.13, @babel/plugin-transform-object-rest-spread@npm:^7.23.4": version: 7.23.4 resolution: "@babel/plugin-transform-object-rest-spread@npm:7.23.4" @@ -2912,7 +2901,7 @@ __metadata: languageName: node linkType: hard -"@babel/preset-typescript@npm:^7.12.12, @babel/preset-typescript@npm:^7.16.7": +"@babel/preset-typescript@npm:^7.12.12": version: 7.23.3 resolution: "@babel/preset-typescript@npm:7.23.3" dependencies: @@ -3440,6 +3429,7 @@ __metadata: "@swc/core": "npm:^1.3.22" "@tanstack/react-query": "npm:^5.17.19" "@testing-library/jest-dom": "npm:^5.11.4" + "@trezor/connect-web": "npm:^9.1.12" "@types/bn.js": "npm:^5.1.1" "@types/chrome": "npm:^0.0.190" "@types/jest": "npm:^28.1.1" @@ -3502,131 +3492,6 @@ __metadata: languageName: unknown linkType: soft -"@coral-xyz/app-mobile@workspace:packages/app-mobile": - version: 0.0.0-use.local - resolution: "@coral-xyz/app-mobile@workspace:packages/app-mobile" - dependencies: - "@apollo/client": "npm:^3.8.8" - "@babel/core": "npm:^7.20.0" - "@babel/plugin-proposal-private-methods": "npm:^7.18.6" - "@babel/plugin-transform-flow-strip-types": "npm:^7.22.5" - "@coral-xyz/anchor": "npm:^0.28.0" - "@coral-xyz/background": "workspace:*" - "@coral-xyz/common": "workspace:*" - "@coral-xyz/data-components": "workspace:*" - "@coral-xyz/expo-devtools": "workspace:*" - "@coral-xyz/i18n": "workspace:*" - "@coral-xyz/provider-injection": "workspace:*" - "@coral-xyz/recoil": "workspace:*" - "@coral-xyz/secure-background": "workspace:*" - "@coral-xyz/secure-clients": "workspace:*" - "@coral-xyz/secure-ui": "workspace:*" - "@coral-xyz/staking": "workspace:*" - "@coral-xyz/tamagui": "workspace:*" - "@dev-plugins/apollo-client": "npm:^0.0.5" - "@dev-plugins/react-navigation": "npm:^0.0.5" - "@dev-plugins/react-query": "npm:^0.0.5" - "@ethersproject/shims": "npm:^5.7.0" - "@expo-google-fonts/inter": "npm:^0.2.3" - "@expo/config": "npm:~8.5.0" - "@expo/react-native-action-sheet": "npm:^4.0.1" - "@expo/spawn-async": "npm:^1.7.2" - "@expo/vector-icons": "npm:^14.0.0" - "@gorhom/bottom-sheet": "npm:4.6.0" - "@graphql-codegen/cli": "npm:^4.0.1" - "@graphql-codegen/client-preset": "npm:^4.0.0" - "@hookform/error-message": "npm:^2.0.1" - "@react-native-async-storage/async-storage": "npm:1.21.0" - "@react-navigation/bottom-tabs": "npm:^6.5.11" - "@react-navigation/drawer": "npm:^6.6.3" - "@react-navigation/elements": "npm:^1.3.18" - "@react-navigation/material-top-tabs": "npm:^6.6.3" - "@react-navigation/native": "npm:^6.1.7" - "@react-navigation/native-stack": "npm:^6.9.13" - "@react-navigation/stack": "npm:^6.3.17" - "@sentry/react-native": "npm:5.17.0" - "@shopify/flash-list": "npm:1.6.3" - "@solana/web3.js": "npm:1.63.1" - "@tamagui/core": "npm:~1.76.0" - "@tamagui/lucide-icons": "npm:~1.76.0" - "@tanstack/eslint-plugin-query": "npm:^5.20.1" - "@tanstack/query-async-storage-persister": "npm:^5.17.19" - "@tanstack/react-query": "npm:^5.17.19" - "@tanstack/react-query-persist-client": "npm:^5.17.19" - "@treklabs/api-web": "npm:0.1.1" - "@types/lodash.throttle": "npm:^4" - "@uidotdev/usehooks": "npm:^2.0.1" - apollo3-cache-persist: "npm:^0.14.1" - babel-plugin-module-resolver: "npm:^5.0.0" - babel-plugin-transform-inline-environment-variables: "npm:^0.4.4" - babel-preset-expo: "npm:^10.0.0" - big-integer: "npm:^1.6.51" - bip39: "npm:^3.1.0" - bs58: "npm:^5.0.0" - buffer: "npm:^6.0.3" - chalk: "npm:~4.1.2" - crypto-browserify: "npm:^3.12.0" - eslint: "npm:^8.49.0" - eslint-config-custom: "npm:*" - eslint-plugin-no-relative-import-paths: "npm:^1.5.2" - eslint-plugin-valtio: "npm:^0.6.2" - ethers: "npm:^5.7.2" - expo: "npm:~50.0.6" - expo-application: "npm:~5.8.3" - expo-asset: "npm:~9.0.2" - expo-barcode-scanner: "npm:~12.9.2" - expo-camera: "npm:~14.0.4" - expo-clipboard: "npm:~5.0.1" - expo-constants: "npm:~15.4.5" - expo-crypto: "npm:~12.8.0" - expo-dev-client: "npm:~3.3.8" - expo-file-system: "npm:~16.0.6" - expo-font: "npm:~11.10.2" - expo-haptics: "npm:~12.8.1" - expo-image: "npm:~1.10.6" - expo-linking: "npm:~6.2.2" - expo-local-authentication: "npm:~13.8.0" - expo-localization: "npm:~14.8.3" - expo-media-library: "npm:~15.9.1" - expo-screen-orientation: "npm:~6.4.1" - expo-secure-store: "npm:~12.8.1" - expo-splash-screen: "npm:~0.26.4" - expo-status-bar: "npm:~1.11.1" - expo-updates: "npm:~0.24.10" - fastestsmallesttextencoderdecoder: "npm:^1.0.22" - graphql: "npm:^16.6.0" - lodash.throttle: "npm:^4.1.1" - p-debounce: "npm:^4.0.0" - patch-package: "npm:^6.5.0" - react: "npm:18.2.0" - react-content-loader: "npm:^6.2.1" - react-dom: "npm:18.2.0" - react-error-boundary: "npm:^4.0.4" - react-hook-form: "npm:^7.40.0" - react-native: "npm:0.73.4" - react-native-ble-plx: "npm:^3.1.2" - react-native-date-picker: "npm:^4.3.3" - react-native-gesture-handler: "npm:~2.14.0" - react-native-pager-view: "npm:6.2.3" - react-native-reanimated: "npm:~3.6.2" - react-native-safe-area-context: "npm:4.8.2" - react-native-screens: "npm:~3.29.0" - react-native-svg: "npm:14.1.0" - react-native-tab-view: "npm:^3.5.1" - react-native-url-polyfill: "npm:^1.3.0" - react-native-web: "npm:~0.19.6" - react-native-webview: "npm:13.6.4" - react-qr-code: "npm:^2.0.8" - recoil: "npm:^0.7.6" - tamagui: "npm:~1.76.0" - tweetnacl: "npm:^1.0.3" - typescript: "npm:^5.3.3" - use-async-effect: "npm:^2.2.7" - uuid: "npm:^9.0.0" - valtio: "npm:^1.12.1" - languageName: unknown - linkType: soft - "@coral-xyz/background@workspace:*, @coral-xyz/background@workspace:packages/background": version: 0.0.0-use.local resolution: "@coral-xyz/background@workspace:packages/background" @@ -3826,7 +3691,7 @@ __metadata: languageName: unknown linkType: soft -"@coral-xyz/expo-devtools@workspace:*, @coral-xyz/expo-devtools@workspace:packages/expo-devtools": +"@coral-xyz/expo-devtools@workspace:packages/expo-devtools": version: 0.0.0-use.local resolution: "@coral-xyz/expo-devtools@workspace:packages/expo-devtools" dependencies: @@ -4033,6 +3898,7 @@ __metadata: "@solana/wallet-standard-features": "npm:^1.2.0" "@solana/wallet-standard-util": "npm:^1.1.1" "@solana/web3.js": "npm:1.63.1" + "@trezor/connect-web": "npm:^9.1.12" bs58: "npm:^5.0.0" eslint-config-custom: "npm:*" ethers5: "npm:ethers@^5.5.1" @@ -4070,7 +3936,7 @@ __metadata: languageName: node linkType: hard -"@coral-xyz/staking@workspace:*, @coral-xyz/staking@workspace:^, @coral-xyz/staking@workspace:packages/staking": +"@coral-xyz/staking@workspace:^, @coral-xyz/staking@workspace:packages/staking": version: 0.0.0-use.local resolution: "@coral-xyz/staking@workspace:packages/staking" dependencies: @@ -4237,40 +4103,6 @@ __metadata: languageName: node linkType: hard -"@dev-plugins/apollo-client@npm:^0.0.5": - version: 0.0.5 - resolution: "@dev-plugins/apollo-client@npm:0.0.5" - peerDependencies: - expo: "*" - checksum: becdb2084f16f9d8e2a88db1a7fb1e652fcbf4d3da93be2b7c8af00e6e34a66b0bfb3efb6ee2a3312b13cb7978f38dd234da5eb2893a68c1a721b3cac4c5d953 - languageName: node - linkType: hard - -"@dev-plugins/react-navigation@npm:^0.0.5": - version: 0.0.5 - resolution: "@dev-plugins/react-navigation@npm:0.0.5" - dependencies: - "@react-navigation/devtools": "npm:^6.0.20" - nanoid: "npm:^3.1.23" - peerDependencies: - "@react-navigation/core": "*" - expo: "*" - checksum: b3304a8dc608ae8c15f80fda38e738428ebada774cd5c902445344f148f2f2095bbc200d6a67602169011ed26fa5610eaef1140f829ebba52156af5b505a5bd4 - languageName: node - linkType: hard - -"@dev-plugins/react-query@npm:^0.0.5": - version: 0.0.5 - resolution: "@dev-plugins/react-query@npm:0.0.5" - dependencies: - flatted: "npm:^3.2.9" - peerDependencies: - "@tanstack/react-query": "*" - expo: "*" - checksum: a1bca84ea0e9b1f420ff8ba489d5fb929f570e464a4eabe0f5b453bc72698077af18e74565dd8ceeb621a15505b4b3924e5fb092d9dc4f813b44d5d07697419c - languageName: node - linkType: hard - "@discoveryjs/json-ext@npm:^0.5.0": version: 0.5.7 resolution: "@discoveryjs/json-ext@npm:0.5.7" @@ -4508,6 +4340,20 @@ __metadata: languageName: node linkType: hard +"@emurgo/cardano-serialization-lib-browser@npm:^11.5.0": + version: 11.5.0 + resolution: "@emurgo/cardano-serialization-lib-browser@npm:11.5.0" + checksum: e4d74d20a59ebc20671363fa357c526c10f2f13c9f36fd34b2d269f1c6f3d637be62fe31ea89641cd90a1410aaf5f9613dfe7f3e616cff606ea8f63a7296ecb3 + languageName: node + linkType: hard + +"@emurgo/cardano-serialization-lib-nodejs@npm:11.5.0": + version: 11.5.0 + resolution: "@emurgo/cardano-serialization-lib-nodejs@npm:11.5.0" + checksum: 3fff8448001c6d70807ef8e1a80a663ef60381e55bfd26c0f1b644e096895da7298fb991ac86670d4c5aee2e3e417e44ac80ab59080f7af107d8fa89906f9075 + languageName: node + linkType: hard + "@esbuild-plugins/node-globals-polyfill@npm:^0.1.1": version: 0.1.1 resolution: "@esbuild-plugins/node-globals-polyfill@npm:0.1.1" @@ -4894,6 +4740,56 @@ __metadata: languageName: node linkType: hard +"@ethereumjs/common@npm:^4.1.0, @ethereumjs/common@npm:^4.2.0": + version: 4.2.0 + resolution: "@ethereumjs/common@npm:4.2.0" + dependencies: + "@ethereumjs/util": "npm:^9.0.2" + checksum: dbf208d118ac30ff9a14d72a0fd16d3a1766c7627f29ca5a34134684e9200bc083f4dbeccab084018711a2f974a34f2f9deecbb495ec07d6f94cf9bd81bfa2ef + languageName: node + linkType: hard + +"@ethereumjs/rlp@npm:^5.0.2": + version: 5.0.2 + resolution: "@ethereumjs/rlp@npm:5.0.2" + bin: + rlp: bin/rlp.cjs + checksum: 2af80d98faf7f64dfb6d739c2df7da7350ff5ad52426c3219897e843ee441215db0ffa346873200a6be6d11142edb9536e66acd62436b5005fa935baaf7eb6bd + languageName: node + linkType: hard + +"@ethereumjs/tx@npm:^5.1.0": + version: 5.2.1 + resolution: "@ethereumjs/tx@npm:5.2.1" + dependencies: + "@ethereumjs/common": "npm:^4.2.0" + "@ethereumjs/rlp": "npm:^5.0.2" + "@ethereumjs/util": "npm:^9.0.2" + ethereum-cryptography: "npm:^2.1.3" + peerDependencies: + c-kzg: ^2.1.2 + peerDependenciesMeta: + c-kzg: + optional: true + checksum: 87b473a99105c82f5a17f1f99442e421a0f515770ac3a9b58d9462a6d10ae1144f92a76a15abcf1b27496dfdcbb6e826eeb7b17636c8bde0613205623b0a1ddf + languageName: node + linkType: hard + +"@ethereumjs/util@npm:^9.0.2": + version: 9.0.2 + resolution: "@ethereumjs/util@npm:9.0.2" + dependencies: + "@ethereumjs/rlp": "npm:^5.0.2" + ethereum-cryptography: "npm:^2.1.3" + peerDependencies: + c-kzg: ^2.1.2 + peerDependenciesMeta: + c-kzg: + optional: true + checksum: 1b8aeb733f4c576bf9f0ade5a3d19da25d602cb068ed735a1fc344cc5f534a7dffe1f5c13139a3d7c805853bd9ec8ba194243fe6dee57d273f1201209846df83 + languageName: node + linkType: hard + "@ethersproject/abi@npm:5.7.0, @ethersproject/abi@npm:^5.5.0, @ethersproject/abi@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/abi@npm:5.7.0" @@ -5180,13 +5076,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/shims@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/shims@npm:5.7.0" - checksum: 50307fbf6b76f4335b4ae324f4ce83ea88200f95589a4051685a8894a450a114680cc92531bf82252dba1e07986338895fb5ab8bcd24dd7162ab49ffa862cfc3 - languageName: node - linkType: hard - "@ethersproject/signing-key@npm:5.7.0, @ethersproject/signing-key@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/signing-key@npm:5.7.0" @@ -5303,13 +5192,6 @@ __metadata: languageName: node linkType: hard -"@expo-google-fonts/inter@npm:^0.2.3": - version: 0.2.3 - resolution: "@expo-google-fonts/inter@npm:0.2.3" - checksum: 434dd414e4d4dd9b61283cc09dfc499d5a4162bcaa39d0ac88cc3664bac0f21d8c54c0be9868b36bcf6d562be077eec6fbe8874274bd447d29d4ee1e988d8682 - languageName: node - linkType: hard - "@expo/bunyan@npm:^4.0.0": version: 4.0.0 resolution: "@expo/bunyan@npm:4.0.0" @@ -5750,18 +5632,6 @@ __metadata: languageName: node linkType: hard -"@expo/react-native-action-sheet@npm:^4.0.1": - version: 4.0.1 - resolution: "@expo/react-native-action-sheet@npm:4.0.1" - dependencies: - "@types/hoist-non-react-statics": "npm:^3.3.1" - hoist-non-react-statics: "npm:^3.3.0" - peerDependencies: - react: ">=16.3.0" - checksum: 20ac8b1c6208feb490c22f381cc3c8ac6a768d0e1d7fd805ded134f7ae9bfcdaff4ee98fbfa00ca4d3314a60553be5e1732a9736cfcac3e27816e76d114c6716 - languageName: node - linkType: hard - "@expo/rudder-sdk-node@npm:1.1.1": version: 1.1.1 resolution: "@expo/rudder-sdk-node@npm:1.1.1" @@ -5855,6 +5725,16 @@ __metadata: languageName: node linkType: hard +"@fivebinaries/coin-selection@npm:2.2.1": + version: 2.2.1 + resolution: "@fivebinaries/coin-selection@npm:2.2.1" + dependencies: + "@emurgo/cardano-serialization-lib-browser": "npm:^11.5.0" + "@emurgo/cardano-serialization-lib-nodejs": "npm:11.5.0" + checksum: 3b5a45c9cf978978f96b781a994faf3e09d3cfe88f4f337205385caa1ba11f117d67fc059f09674a2a8064ccdde66bed69a2cb1182686bf83cbb9bdb13365d47 + languageName: node + linkType: hard + "@floating-ui/core@npm:^0.6.2": version: 0.6.2 resolution: "@floating-ui/core@npm:0.6.2" @@ -6086,18 +5966,6 @@ __metadata: languageName: node linkType: hard -"@graphql-codegen/add@npm:^5.0.0": - version: 5.0.0 - resolution: "@graphql-codegen/add@npm:5.0.0" - dependencies: - "@graphql-codegen/plugin-helpers": "npm:^5.0.0" - tslib: "npm:~2.5.0" - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: 0bc9b6cb63702defa5c1318cbee33b28a4eee6727d95f276c15fb49d295154debf1941dbf46f92146301e9d27245b1a142b4ce98fc489022f49f3819c193b9dc - languageName: node - linkType: hard - "@graphql-codegen/cli@npm:^3.3.1": version: 3.3.1 resolution: "@graphql-codegen/cli@npm:3.3.1" @@ -6148,56 +6016,6 @@ __metadata: languageName: node linkType: hard -"@graphql-codegen/cli@npm:^4.0.1": - version: 4.0.1 - resolution: "@graphql-codegen/cli@npm:4.0.1" - dependencies: - "@babel/generator": "npm:^7.18.13" - "@babel/template": "npm:^7.18.10" - "@babel/types": "npm:^7.18.13" - "@graphql-codegen/core": "npm:^4.0.0" - "@graphql-codegen/plugin-helpers": "npm:^5.0.0" - "@graphql-tools/apollo-engine-loader": "npm:^8.0.0" - "@graphql-tools/code-file-loader": "npm:^8.0.0" - "@graphql-tools/git-loader": "npm:^8.0.0" - "@graphql-tools/github-loader": "npm:^8.0.0" - "@graphql-tools/graphql-file-loader": "npm:^8.0.0" - "@graphql-tools/json-file-loader": "npm:^8.0.0" - "@graphql-tools/load": "npm:^8.0.0" - "@graphql-tools/prisma-loader": "npm:^8.0.0" - "@graphql-tools/url-loader": "npm:^8.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - "@parcel/watcher": "npm:^2.1.0" - "@whatwg-node/fetch": "npm:^0.8.0" - chalk: "npm:^4.1.0" - cosmiconfig: "npm:^8.1.3" - debounce: "npm:^1.2.0" - detect-indent: "npm:^6.0.0" - graphql-config: "npm:^5.0.2" - inquirer: "npm:^8.0.0" - is-glob: "npm:^4.0.1" - jiti: "npm:^1.17.1" - json-to-pretty-yaml: "npm:^1.2.2" - listr2: "npm:^4.0.5" - log-symbols: "npm:^4.0.0" - micromatch: "npm:^4.0.5" - shell-quote: "npm:^1.7.3" - string-env-interpolation: "npm:^1.0.1" - ts-log: "npm:^2.2.3" - tslib: "npm:^2.4.0" - yaml: "npm:^1.10.0" - yargs: "npm:^17.0.0" - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - bin: - gql-gen: cjs/bin.js - graphql-code-generator: cjs/bin.js - graphql-codegen: cjs/bin.js - graphql-codegen-esm: esm/bin.js - checksum: 57de92bd03cc90abcd15d1b84c4198ee6c9282e9299c6d32a31576e7212c53d5b878d102f79b725369d208f26bbaa0b86db810841199b74eea4a43d316af9a0f - languageName: node - linkType: hard - "@graphql-codegen/client-preset@npm:^3.0.1": version: 3.0.1 resolution: "@graphql-codegen/client-preset@npm:3.0.1" @@ -6221,29 +6039,6 @@ __metadata: languageName: node linkType: hard -"@graphql-codegen/client-preset@npm:^4.0.0": - version: 4.0.0 - resolution: "@graphql-codegen/client-preset@npm:4.0.0" - dependencies: - "@babel/helper-plugin-utils": "npm:^7.20.2" - "@babel/template": "npm:^7.20.7" - "@graphql-codegen/add": "npm:^5.0.0" - "@graphql-codegen/gql-tag-operations": "npm:4.0.0" - "@graphql-codegen/plugin-helpers": "npm:^5.0.0" - "@graphql-codegen/typed-document-node": "npm:^5.0.0" - "@graphql-codegen/typescript": "npm:^4.0.0" - "@graphql-codegen/typescript-operations": "npm:^4.0.0" - "@graphql-codegen/visitor-plugin-common": "npm:^4.0.0" - "@graphql-tools/documents": "npm:^1.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - "@graphql-typed-document-node/core": "npm:3.2.0" - tslib: "npm:~2.5.0" - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: a0e17ccf55795dbb56514bba6fc9f76cf195982726ec1feba01115283670e6bf9b74e64e4d531825b6ac4c4faf39c876ab6d21b85e2d49100ca69d747c0bb34f - languageName: node - linkType: hard - "@graphql-codegen/core@npm:^3.1.0": version: 3.1.0 resolution: "@graphql-codegen/core@npm:3.1.0" @@ -6258,20 +6053,6 @@ __metadata: languageName: node linkType: hard -"@graphql-codegen/core@npm:^4.0.0": - version: 4.0.0 - resolution: "@graphql-codegen/core@npm:4.0.0" - dependencies: - "@graphql-codegen/plugin-helpers": "npm:^5.0.0" - "@graphql-tools/schema": "npm:^10.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - tslib: "npm:~2.5.0" - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: d9826e3bf454edaf82aa10b56b0d05502472ea53d86f58aadff05bf2fcea4ddbd92f8dd8eca713b878ce16cc6f9b78f53bd4fe71426b60309673bb395b491aba - languageName: node - linkType: hard - "@graphql-codegen/gql-tag-operations@npm:3.0.1": version: 3.0.1 resolution: "@graphql-codegen/gql-tag-operations@npm:3.0.1" @@ -6287,21 +6068,6 @@ __metadata: languageName: node linkType: hard -"@graphql-codegen/gql-tag-operations@npm:4.0.0": - version: 4.0.0 - resolution: "@graphql-codegen/gql-tag-operations@npm:4.0.0" - dependencies: - "@graphql-codegen/plugin-helpers": "npm:^5.0.0" - "@graphql-codegen/visitor-plugin-common": "npm:4.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - auto-bind: "npm:~4.0.0" - tslib: "npm:~2.5.0" - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: 933ec852f5c36289ea61ec8f07f3c51ab8582ff7182ae9d90c7ae9facb8c15ac2ddeb0544a69d4df6fe48ad5bcaf21e779565b426e8691d4a8873fda64def95c - languageName: node - linkType: hard - "@graphql-codegen/plugin-helpers@npm:^4.1.0, @graphql-codegen/plugin-helpers@npm:^4.2.0": version: 4.2.0 resolution: "@graphql-codegen/plugin-helpers@npm:4.2.0" @@ -6318,22 +6084,6 @@ __metadata: languageName: node linkType: hard -"@graphql-codegen/plugin-helpers@npm:^5.0.0": - version: 5.0.0 - resolution: "@graphql-codegen/plugin-helpers@npm:5.0.0" - dependencies: - "@graphql-tools/utils": "npm:^10.0.0" - change-case-all: "npm:1.0.15" - common-tags: "npm:1.8.2" - import-from: "npm:4.0.0" - lodash: "npm:~4.17.0" - tslib: "npm:~2.5.0" - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: c32a27ad5275c1665226f04860c7a0c1f8afb28077b524638f9bfaa2706c8adc93dc93017775c6c0f13220d7dd56d0371772d6386d556f21ac9c6df9dcc98451 - languageName: node - linkType: hard - "@graphql-codegen/schema-ast@npm:^3.0.1": version: 3.0.1 resolution: "@graphql-codegen/schema-ast@npm:3.0.1" @@ -6347,19 +6097,6 @@ __metadata: languageName: node linkType: hard -"@graphql-codegen/schema-ast@npm:^4.0.0": - version: 4.0.0 - resolution: "@graphql-codegen/schema-ast@npm:4.0.0" - dependencies: - "@graphql-codegen/plugin-helpers": "npm:^5.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - tslib: "npm:~2.5.0" - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: 5950b57b383c14476080108d8ef7ebe569446ac20fbf54371ecc051392c80ef4b28b16b33fcb06faa892213bed90fc72940bc46a9852e0f02491491811e6a47e - languageName: node - linkType: hard - "@graphql-codegen/typed-document-node@npm:^4.0.1": version: 4.0.1 resolution: "@graphql-codegen/typed-document-node@npm:4.0.1" @@ -6375,21 +6112,6 @@ __metadata: languageName: node linkType: hard -"@graphql-codegen/typed-document-node@npm:^5.0.0": - version: 5.0.0 - resolution: "@graphql-codegen/typed-document-node@npm:5.0.0" - dependencies: - "@graphql-codegen/plugin-helpers": "npm:^5.0.0" - "@graphql-codegen/visitor-plugin-common": "npm:4.0.0" - auto-bind: "npm:~4.0.0" - change-case-all: "npm:1.0.15" - tslib: "npm:~2.5.0" - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: 1e33f08900264bb871de6b000ecaf5eced6270111bc8e29ea51fbccd8005b77e7a06d5bfee013933f827cf5794c8646425a8fbc559bb1a085e37ffa9b1cecd1f - languageName: node - linkType: hard - "@graphql-codegen/typescript-operations@npm:^3.0.4": version: 3.0.4 resolution: "@graphql-codegen/typescript-operations@npm:3.0.4" @@ -6405,21 +6127,6 @@ __metadata: languageName: node linkType: hard -"@graphql-codegen/typescript-operations@npm:^4.0.0": - version: 4.0.0 - resolution: "@graphql-codegen/typescript-operations@npm:4.0.0" - dependencies: - "@graphql-codegen/plugin-helpers": "npm:^5.0.0" - "@graphql-codegen/typescript": "npm:^4.0.0" - "@graphql-codegen/visitor-plugin-common": "npm:4.0.0" - auto-bind: "npm:~4.0.0" - tslib: "npm:~2.5.0" - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: 9d8b70c83eee367077311a3a350bd757239a20f1bca95320038aaa1201aa73b8894b326d833e8905344535b848c54f99232821ff286d89e30dc1de66a8498130 - languageName: node - linkType: hard - "@graphql-codegen/typescript@npm:^3.0.4": version: 3.0.4 resolution: "@graphql-codegen/typescript@npm:3.0.4" @@ -6435,21 +6142,6 @@ __metadata: languageName: node linkType: hard -"@graphql-codegen/typescript@npm:^4.0.0": - version: 4.0.0 - resolution: "@graphql-codegen/typescript@npm:4.0.0" - dependencies: - "@graphql-codegen/plugin-helpers": "npm:^5.0.0" - "@graphql-codegen/schema-ast": "npm:^4.0.0" - "@graphql-codegen/visitor-plugin-common": "npm:4.0.0" - auto-bind: "npm:~4.0.0" - tslib: "npm:~2.5.0" - peerDependencies: - graphql: ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: 7dcc77bd012f5d61464c9e0b3268595dd3613d37988a029ebb3fea36a40a4726a06c4871720880f459ce548ee7451f7a873d3bcd27b531da3370761a52edc3d0 - languageName: node - linkType: hard - "@graphql-codegen/visitor-plugin-common@npm:3.1.1, @graphql-codegen/visitor-plugin-common@npm:^3.1.1": version: 3.1.1 resolution: "@graphql-codegen/visitor-plugin-common@npm:3.1.1" @@ -6470,26 +6162,6 @@ __metadata: languageName: node linkType: hard -"@graphql-codegen/visitor-plugin-common@npm:4.0.0, @graphql-codegen/visitor-plugin-common@npm:^4.0.0": - version: 4.0.0 - resolution: "@graphql-codegen/visitor-plugin-common@npm:4.0.0" - dependencies: - "@graphql-codegen/plugin-helpers": "npm:^5.0.0" - "@graphql-tools/optimize": "npm:^2.0.0" - "@graphql-tools/relay-operation-optimizer": "npm:^7.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - auto-bind: "npm:~4.0.0" - change-case-all: "npm:1.0.15" - dependency-graph: "npm:^0.11.0" - graphql-tag: "npm:^2.11.0" - parse-filepath: "npm:^1.0.2" - tslib: "npm:~2.5.0" - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: 7c94d9f18b77024ba93a61b7d628b2e803b0db7a5083f96adbbf131e6627ecb5e891e27d4fc53dae2874df05cf0e4a990cf868c2c7f1fe6dd23735b1ce70c9e9 - languageName: node - linkType: hard - "@graphql-tools/apollo-engine-loader@npm:^7.3.6": version: 7.3.26 resolution: "@graphql-tools/apollo-engine-loader@npm:7.3.26" @@ -6504,20 +6176,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/apollo-engine-loader@npm:^8.0.0": - version: 8.0.0 - resolution: "@graphql-tools/apollo-engine-loader@npm:8.0.0" - dependencies: - "@ardatan/sync-fetch": "npm:^0.0.1" - "@graphql-tools/utils": "npm:^10.0.0" - "@whatwg-node/fetch": "npm:^0.9.0" - tslib: "npm:^2.4.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 4f9b761de2ee787b1e5afd549ae4e328175ca080915c5e31f418f5cb1a322d87b17d863c87ce5c65dcc24c7a9cab35034b457814a8021e45a6d4fba1da1700de - languageName: node - linkType: hard - "@graphql-tools/batch-execute@npm:^8.5.19": version: 8.5.19 resolution: "@graphql-tools/batch-execute@npm:8.5.19" @@ -6532,20 +6190,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/batch-execute@npm:^9.0.0": - version: 9.0.0 - resolution: "@graphql-tools/batch-execute@npm:9.0.0" - dependencies: - "@graphql-tools/utils": "npm:^10.0.0" - dataloader: "npm:^2.2.2" - tslib: "npm:^2.4.0" - value-or-promise: "npm:^1.0.12" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 580d5b190f17ccd33ce95428ce4cdaa64d5513a23c93005ac5e6793fdb1a814ed9144c52ce23f84b51e84aff153afb391cf51923286fdac68cb892114bc45302 - languageName: node - linkType: hard - "@graphql-tools/code-file-loader@npm:^7.3.17": version: 7.3.22 resolution: "@graphql-tools/code-file-loader@npm:7.3.22" @@ -6561,38 +6205,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/code-file-loader@npm:^8.0.0": - version: 8.0.1 - resolution: "@graphql-tools/code-file-loader@npm:8.0.1" - dependencies: - "@graphql-tools/graphql-tag-pluck": "npm:8.0.1" - "@graphql-tools/utils": "npm:^10.0.0" - globby: "npm:^11.0.3" - tslib: "npm:^2.4.0" - unixify: "npm:^1.0.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 8da2f0a9732593e418606bb69cae78a376e27075c885530e90eb4415330c13462ca07db830f8cbdca0e39f0ef685709049e3000bb68c31d4bbf02b4643b548b6 - languageName: node - linkType: hard - -"@graphql-tools/delegate@npm:^10.0.0": - version: 10.0.0 - resolution: "@graphql-tools/delegate@npm:10.0.0" - dependencies: - "@graphql-tools/batch-execute": "npm:^9.0.0" - "@graphql-tools/executor": "npm:^1.0.0" - "@graphql-tools/schema": "npm:^10.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - dataloader: "npm:^2.2.2" - tslib: "npm:^2.5.0" - value-or-promise: "npm:^1.0.12" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 7f2898568351ebb1e33b9cc8f0b2e631a3e6a3d3c40f3d10afbe74147a5c6be4e82b49d90f207d605783e653657d48a91bb1667b1f2bb0c2e00fc7266c2cf068 - languageName: node - linkType: hard - "@graphql-tools/delegate@npm:^9.0.31": version: 9.0.32 resolution: "@graphql-tools/delegate@npm:9.0.32" @@ -6622,18 +6234,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/documents@npm:^1.0.0": - version: 1.0.0 - resolution: "@graphql-tools/documents@npm:1.0.0" - dependencies: - lodash.sortby: "npm:^4.7.0" - tslib: "npm:^2.4.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 4fe29835abf4942c813c136a10742ddcff09a3dc0acbe34eeab48193d1c16ed2074ccb5608b6118ffbfda756d27ef4feae35b6476736395c6d079dd8738b0642 - languageName: node - linkType: hard - "@graphql-tools/executor-graphql-ws@npm:^0.0.14": version: 0.0.14 resolution: "@graphql-tools/executor-graphql-ws@npm:0.0.14" @@ -6651,23 +6251,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/executor-graphql-ws@npm:^1.0.0": - version: 1.0.0 - resolution: "@graphql-tools/executor-graphql-ws@npm:1.0.0" - dependencies: - "@graphql-tools/utils": "npm:^10.0.0" - "@repeaterjs/repeater": "npm:3.0.4" - "@types/ws": "npm:^8.0.0" - graphql-ws: "npm:5.13.1" - isomorphic-ws: "npm:5.0.0" - tslib: "npm:^2.4.0" - ws: "npm:8.13.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 6f3ee735b16c292e597fc84d9aa73b8608786ba587f8b88af020b14961415bf2e4dd1462aa6b782aa59c14fc3ef4dcaa8af99be07b8bf8348ee19a58bfa53b9f - languageName: node - linkType: hard - "@graphql-tools/executor-http@npm:^0.1.7, @graphql-tools/executor-http@npm:^0.1.9": version: 0.1.9 resolution: "@graphql-tools/executor-http@npm:0.1.9" @@ -6686,24 +6269,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/executor-http@npm:^1.0.0": - version: 1.0.0 - resolution: "@graphql-tools/executor-http@npm:1.0.0" - dependencies: - "@graphql-tools/utils": "npm:^10.0.0" - "@repeaterjs/repeater": "npm:^3.0.4" - "@whatwg-node/fetch": "npm:^0.9.0" - dset: "npm:^3.1.2" - extract-files: "npm:^11.0.0" - meros: "npm:^1.2.1" - tslib: "npm:^2.4.0" - value-or-promise: "npm:^1.0.12" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 1e33c3218cf51842ebebce06064212d46ad2fb37ccb5c0a5ed0c16c071dabfdb217cecbb76ef4cceb1cc3f3fc276832b2bb02438ba2c0ef0b5b8f8362704922f - languageName: node - linkType: hard - "@graphql-tools/executor-legacy-ws@npm:^0.0.11": version: 0.0.11 resolution: "@graphql-tools/executor-legacy-ws@npm:0.0.11" @@ -6719,21 +6284,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/executor-legacy-ws@npm:^1.0.0": - version: 1.0.0 - resolution: "@graphql-tools/executor-legacy-ws@npm:1.0.0" - dependencies: - "@graphql-tools/utils": "npm:^10.0.0" - "@types/ws": "npm:^8.0.0" - isomorphic-ws: "npm:5.0.0" - tslib: "npm:^2.4.0" - ws: "npm:8.13.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 645e0c0cdf02af179087ae17eca894aa863a47f4c47e39fa409ce7969826284b6ed25f3182d18d749de9bd6280b869dce3b983ac102f007b8d8cf9b4ca10c6e6 - languageName: node - linkType: hard - "@graphql-tools/executor@npm:^0.0.18": version: 0.0.18 resolution: "@graphql-tools/executor@npm:0.0.18" @@ -6749,21 +6299,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/executor@npm:^1.0.0": - version: 1.1.0 - resolution: "@graphql-tools/executor@npm:1.1.0" - dependencies: - "@graphql-tools/utils": "npm:^10.0.0" - "@graphql-typed-document-node/core": "npm:3.2.0" - "@repeaterjs/repeater": "npm:^3.0.4" - tslib: "npm:^2.4.0" - value-or-promise: "npm:^1.0.12" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 673fcd0054f79ca0a4ca23d9ee3f5c6553e4b12bf5ed0d5d2e4ee94048e84e2314b818ff5aca0350694f00ef336dcb0cbbf41e14de302beaeeb0498ab8624ac1 - languageName: node - linkType: hard - "@graphql-tools/git-loader@npm:^7.2.13": version: 7.2.21 resolution: "@graphql-tools/git-loader@npm:7.2.21" @@ -6780,22 +6315,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/git-loader@npm:^8.0.0": - version: 8.0.1 - resolution: "@graphql-tools/git-loader@npm:8.0.1" - dependencies: - "@graphql-tools/graphql-tag-pluck": "npm:8.0.1" - "@graphql-tools/utils": "npm:^10.0.0" - is-glob: "npm:4.0.3" - micromatch: "npm:^4.0.4" - tslib: "npm:^2.4.0" - unixify: "npm:^1.0.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 5bf93971abd6d4b25831ecdfcc095065e490de0f7d17419667c51fe2697a4662263cb546e7de9f2d48d03cb98b6bc27a910657ce0a9f8b33d80cebcdea812026 - languageName: node - linkType: hard - "@graphql-tools/github-loader@npm:^7.3.20": version: 7.3.28 resolution: "@graphql-tools/github-loader@npm:7.3.28" @@ -6813,23 +6332,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/github-loader@npm:^8.0.0": - version: 8.0.0 - resolution: "@graphql-tools/github-loader@npm:8.0.0" - dependencies: - "@ardatan/sync-fetch": "npm:^0.0.1" - "@graphql-tools/executor-http": "npm:^1.0.0" - "@graphql-tools/graphql-tag-pluck": "npm:^8.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - "@whatwg-node/fetch": "npm:^0.9.0" - tslib: "npm:^2.4.0" - value-or-promise: "npm:^1.0.12" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: d29e00d5fe63069b983f585636493e03211e673397ce5e4c8e4d99ebae9d321417373444134978d1d6c2b4f614a58873f0d3a4e8f2deaebdec651474603a12b1 - languageName: node - linkType: hard - "@graphql-tools/graphql-file-loader@npm:^7.3.7, @graphql-tools/graphql-file-loader@npm:^7.5.0": version: 7.5.17 resolution: "@graphql-tools/graphql-file-loader@npm:7.5.17" @@ -6845,21 +6347,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/graphql-file-loader@npm:^8.0.0": - version: 8.0.0 - resolution: "@graphql-tools/graphql-file-loader@npm:8.0.0" - dependencies: - "@graphql-tools/import": "npm:7.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - globby: "npm:^11.0.3" - tslib: "npm:^2.4.0" - unixify: "npm:^1.0.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: bf1248593123f6aa740da8b58746e2a60f5a1f413da1dcff8890daae0f2eeeac1837a2d419bdbdfb6ccb2877e03103d335ae0d1696e392f6af247414b0ad8406 - languageName: node - linkType: hard - "@graphql-tools/graphql-tag-pluck@npm:7.5.1, @graphql-tools/graphql-tag-pluck@npm:^7.4.6": version: 7.5.1 resolution: "@graphql-tools/graphql-tag-pluck@npm:7.5.1" @@ -6876,22 +6363,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/graphql-tag-pluck@npm:8.0.1, @graphql-tools/graphql-tag-pluck@npm:^8.0.0": - version: 8.0.1 - resolution: "@graphql-tools/graphql-tag-pluck@npm:8.0.1" - dependencies: - "@babel/parser": "npm:^7.16.8" - "@babel/plugin-syntax-import-assertions": "npm:^7.20.0" - "@babel/traverse": "npm:^7.16.8" - "@babel/types": "npm:^7.16.8" - "@graphql-tools/utils": "npm:^10.0.0" - tslib: "npm:^2.4.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 7717f48b7c695be4408c10e2d534673ccbb00c8e2f196744a7115062a7ae588d113b79520cd8a87e67e2846a63a6d6e36a5f9d1693fdba4fb3ee7752580cb973 - languageName: node - linkType: hard - "@graphql-tools/import@npm:6.7.18": version: 6.7.18 resolution: "@graphql-tools/import@npm:6.7.18" @@ -6905,19 +6376,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/import@npm:7.0.0": - version: 7.0.0 - resolution: "@graphql-tools/import@npm:7.0.0" - dependencies: - "@graphql-tools/utils": "npm:^10.0.0" - resolve-from: "npm:5.0.0" - tslib: "npm:^2.4.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 74741f670fb028526c363cd83871eeb9a1f51ecae27d1640914b0d5ddc482dc0a74d96b996244c726a12e80f63a4f8ec15fc71098e3b87ed3c463fa06ce8ac6c - languageName: node - linkType: hard - "@graphql-tools/json-file-loader@npm:^7.3.7, @graphql-tools/json-file-loader@npm:^7.4.1": version: 7.4.18 resolution: "@graphql-tools/json-file-loader@npm:7.4.18" @@ -6932,20 +6390,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/json-file-loader@npm:^8.0.0": - version: 8.0.0 - resolution: "@graphql-tools/json-file-loader@npm:8.0.0" - dependencies: - "@graphql-tools/utils": "npm:^10.0.0" - globby: "npm:^11.0.3" - tslib: "npm:^2.4.0" - unixify: "npm:^1.0.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: a023466e261599803d1f8e1af3bb7b0007a5206c29df4fb14a448c1dacc04807482b97374c2bbb82bd286523f6a032c355d74f39bffb866325651f1a0f0412a2 - languageName: node - linkType: hard - "@graphql-tools/load@npm:^7.5.5, @graphql-tools/load@npm:^7.8.0": version: 7.8.14 resolution: "@graphql-tools/load@npm:7.8.14" @@ -6960,20 +6404,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/load@npm:^8.0.0": - version: 8.0.0 - resolution: "@graphql-tools/load@npm:8.0.0" - dependencies: - "@graphql-tools/schema": "npm:^10.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - p-limit: "npm:3.1.0" - tslib: "npm:^2.4.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 64bbcaae28bf895f0d1f0636325a5b567cca1524ffd02bcad58a063087e74c65b9c1a5743adc2cc18a4f3c0379f7426090f8784abcddfd60997f187e6f100eb4 - languageName: node - linkType: hard - "@graphql-tools/merge@npm:^8.2.6, @graphql-tools/merge@npm:^8.4.1": version: 8.4.1 resolution: "@graphql-tools/merge@npm:8.4.1" @@ -6986,18 +6416,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/merge@npm:^9.0.0": - version: 9.0.0 - resolution: "@graphql-tools/merge@npm:9.0.0" - dependencies: - "@graphql-tools/utils": "npm:^10.0.0" - tslib: "npm:^2.4.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 7bf74f71a22d87dbc47fc778cf6d0366bcd36ae0a271cc5b382ffa90020f033e227ad97c94d785ac2943317ffce9e904119c60d72b3da5b655b5837e78652b82 - languageName: node - linkType: hard - "@graphql-tools/optimize@npm:^1.3.0": version: 1.4.0 resolution: "@graphql-tools/optimize@npm:1.4.0" @@ -7009,17 +6427,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/optimize@npm:^2.0.0": - version: 2.0.0 - resolution: "@graphql-tools/optimize@npm:2.0.0" - dependencies: - tslib: "npm:^2.4.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 7f79c0e1852abc571308e887d27d613da5b797256c8c6eb6c5fe7ca77f09e61524778ae281cebc0b698c51d4fe1074e2b8e0d0627b8e2dcf505aa6ed09b49a2f - languageName: node - linkType: hard - "@graphql-tools/prisma-loader@npm:^7.2.49": version: 7.2.71 resolution: "@graphql-tools/prisma-loader@npm:7.2.71" @@ -7048,34 +6455,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/prisma-loader@npm:^8.0.0": - version: 8.0.1 - resolution: "@graphql-tools/prisma-loader@npm:8.0.1" - dependencies: - "@graphql-tools/url-loader": "npm:^8.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - "@types/js-yaml": "npm:^4.0.0" - "@types/json-stable-stringify": "npm:^1.0.32" - "@whatwg-node/fetch": "npm:^0.9.0" - chalk: "npm:^4.1.0" - debug: "npm:^4.3.1" - dotenv: "npm:^16.0.0" - graphql-request: "npm:^6.0.0" - http-proxy-agent: "npm:^7.0.0" - https-proxy-agent: "npm:^7.0.0" - jose: "npm:^4.11.4" - js-yaml: "npm:^4.0.0" - json-stable-stringify: "npm:^1.0.1" - lodash: "npm:^4.17.20" - scuid: "npm:^1.1.0" - tslib: "npm:^2.4.0" - yaml-ast-parser: "npm:^0.0.43" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: a4b285fec2006e9b34b71f8e96f63f866411a53f95758e8b67942ea999925c6e843e3ecc2d2c9f2ccf722488d481e29fcec11dc87a4189188501e0948d41aa95 - languageName: node - linkType: hard - "@graphql-tools/relay-operation-optimizer@npm:^6.5.0": version: 6.5.18 resolution: "@graphql-tools/relay-operation-optimizer@npm:6.5.18" @@ -7089,33 +6468,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/relay-operation-optimizer@npm:^7.0.0": - version: 7.0.0 - resolution: "@graphql-tools/relay-operation-optimizer@npm:7.0.0" - dependencies: - "@ardatan/relay-compiler": "npm:12.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - tslib: "npm:^2.4.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 6eb7e6d3ed6e72eb2146b8272b20e0acba154fffdac518f894ceaee320cc7ef0284117c11a93dff85b8bbee1019b982a9fdd20ecf65923d998b48730d296a56d - languageName: node - linkType: hard - -"@graphql-tools/schema@npm:^10.0.0": - version: 10.0.0 - resolution: "@graphql-tools/schema@npm:10.0.0" - dependencies: - "@graphql-tools/merge": "npm:^9.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - tslib: "npm:^2.4.0" - value-or-promise: "npm:^1.0.12" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: dd784bcc460746adc32a63e9f19b241f9af6e81a8d123b346806853f24096003764aa117954bb88a35de67ce3484acc9e42a03ebe41dafad1446dd614fbcefb5 - languageName: node - linkType: hard - "@graphql-tools/schema@npm:^9.0.0, @graphql-tools/schema@npm:^9.0.18": version: 9.0.19 resolution: "@graphql-tools/schema@npm:9.0.19" @@ -7153,41 +6505,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/url-loader@npm:^8.0.0": - version: 8.0.0 - resolution: "@graphql-tools/url-loader@npm:8.0.0" - dependencies: - "@ardatan/sync-fetch": "npm:^0.0.1" - "@graphql-tools/delegate": "npm:^10.0.0" - "@graphql-tools/executor-graphql-ws": "npm:^1.0.0" - "@graphql-tools/executor-http": "npm:^1.0.0" - "@graphql-tools/executor-legacy-ws": "npm:^1.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - "@graphql-tools/wrap": "npm:^10.0.0" - "@types/ws": "npm:^8.0.0" - "@whatwg-node/fetch": "npm:^0.9.0" - isomorphic-ws: "npm:^5.0.0" - tslib: "npm:^2.4.0" - value-or-promise: "npm:^1.0.11" - ws: "npm:^8.12.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 206065c2490e0747f6f9d756171b151017f9e5ad2d5f4c82c1644af8da3bf03e0075e4c55e6317e1823e74e32d307af5dd102f58851c7c361022578aa52ca8c1 - languageName: node - linkType: hard - -"@graphql-tools/utils@npm:^10.0.0": - version: 10.0.1 - resolution: "@graphql-tools/utils@npm:10.0.1" - dependencies: - "@graphql-typed-document-node/core": "npm:^3.1.1" - tslib: "npm:^2.4.0" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: c2715b605a75146d1cd02704ac0ce89207f4051a1deac2ee2dcdb22c184941b7f1d63da68377fdfe766bbeeaef230ac79a44cbce4822b36000f2476c48304667 - languageName: node - linkType: hard - "@graphql-tools/utils@npm:^9.0.0, @graphql-tools/utils@npm:^9.1.1, @graphql-tools/utils@npm:^9.2.1": version: 9.2.1 resolution: "@graphql-tools/utils@npm:9.2.1" @@ -7200,21 +6517,6 @@ __metadata: languageName: node linkType: hard -"@graphql-tools/wrap@npm:^10.0.0": - version: 10.0.0 - resolution: "@graphql-tools/wrap@npm:10.0.0" - dependencies: - "@graphql-tools/delegate": "npm:^10.0.0" - "@graphql-tools/schema": "npm:^10.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - tslib: "npm:^2.4.0" - value-or-promise: "npm:^1.0.12" - peerDependencies: - graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 1e83058f0c88a9d9c5fc0cfc4c838db54a47b9dbf9588a0b0c60620824d392c99a171ccb3ae9fb1af32fefbaf1085435fc448cf3c7c8b20d43f00880cd9298fb - languageName: node - linkType: hard - "@graphql-tools/wrap@npm:^9.4.2": version: 9.4.2 resolution: "@graphql-tools/wrap@npm:9.4.2" @@ -7276,17 +6578,6 @@ __metadata: languageName: node linkType: hard -"@hookform/error-message@npm:^2.0.1": - version: 2.0.1 - resolution: "@hookform/error-message@npm:2.0.1" - peerDependencies: - react: ">=16.8.0" - react-dom: ">=16.8.0" - react-hook-form: ^7.0.0 - checksum: 96665a078471f68a9fcc78f55a024f4caf1db2e32b5ff36d1755b3e9bfbb54a4f114c76d7da27147cca281e96dc0773bcd904760e96df1fd5c336ff182b02633 - languageName: node - linkType: hard - "@humanwhocodes/config-array@npm:^0.11.11": version: 0.11.11 resolution: "@humanwhocodes/config-array@npm:0.11.11" @@ -8959,6 +8250,13 @@ __metadata: languageName: node linkType: hard +"@mobily/ts-belt@npm:^3.13.1": + version: 3.13.1 + resolution: "@mobily/ts-belt@npm:3.13.1" + checksum: d851e4f8b80f99646a67ecebc824994771f93509fe839680dcd3c21ab055099a0f04cd93ffa87e3529248fed0ea26abd62788302d7eb1bd2ffe42ad109229306 + languageName: node + linkType: hard + "@motionone/animation@npm:^10.12.0": version: 10.15.1 resolution: "@motionone/animation@npm:10.15.1" @@ -9930,7 +9228,7 @@ __metadata: languageName: node linkType: hard -"@noble/curves@npm:^1.1.0": +"@noble/curves@npm:1.3.0, @noble/curves@npm:^1.1.0, @noble/curves@npm:~1.3.0": version: 1.3.0 resolution: "@noble/curves@npm:1.3.0" dependencies: @@ -9960,7 +9258,7 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.3.3": +"@noble/hashes@npm:1.3.3, @noble/hashes@npm:~1.3.2": version: 1.3.3 resolution: "@noble/hashes@npm:1.3.3" checksum: 1025ddde4d24630e95c0818e63d2d54ee131b980fe113312d17ed7468bc18f54486ac86c907685759f8a7e13c2f9b9e83ec7b67d1cc20836f36b5e4a65bb102d @@ -11661,6 +10959,79 @@ __metadata: languageName: node linkType: hard +"@protobufjs/aspromise@npm:^1.1.1, @protobufjs/aspromise@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/aspromise@npm:1.1.2" + checksum: 8a938d84fe4889411296db66b29287bd61ea3c14c2d23e7a8325f46a2b8ce899857c5f038d65d7641805e6c1d06b495525c7faf00c44f85a7ee6476649034969 + languageName: node + linkType: hard + +"@protobufjs/base64@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/base64@npm:1.1.2" + checksum: c71b100daeb3c9bdccab5cbc29495b906ba0ae22ceedc200e1ba49717d9c4ab15a6256839cebb6f9c6acae4ed7c25c67e0a95e734f612b258261d1a3098fe342 + languageName: node + linkType: hard + +"@protobufjs/codegen@npm:^2.0.4": + version: 2.0.4 + resolution: "@protobufjs/codegen@npm:2.0.4" + checksum: c6ee5fa172a8464f5253174d3c2353ea520c2573ad7b6476983d9b1346f4d8f2b44aa29feb17a949b83c1816bc35286a5ea265ed9d8fdd2865acfa09668c0447 + languageName: node + linkType: hard + +"@protobufjs/eventemitter@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/eventemitter@npm:1.1.0" + checksum: 03af3e99f17ad421283d054c88a06a30a615922a817741b43ca1b13e7c6b37820a37f6eba9980fb5150c54dba6e26cb6f7b64a6f7d8afa83596fafb3afa218c3 + languageName: node + linkType: hard + +"@protobufjs/fetch@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/fetch@npm:1.1.0" + dependencies: + "@protobufjs/aspromise": "npm:^1.1.1" + "@protobufjs/inquire": "npm:^1.1.0" + checksum: 67ae40572ad536e4ef94269199f252c024b66e3059850906bdaee161ca1d75c73d04d35cd56f147a8a5a079f5808e342b99e61942c1dae15604ff0600b09a958 + languageName: node + linkType: hard + +"@protobufjs/float@npm:^1.0.2": + version: 1.0.2 + resolution: "@protobufjs/float@npm:1.0.2" + checksum: 634c2c989da0ef2f4f19373d64187e2a79f598c5fb7991afb689d29a2ea17c14b796b29725945fa34b9493c17fb799e08ac0a7ccaae460ee1757d3083ed35187 + languageName: node + linkType: hard + +"@protobufjs/inquire@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/inquire@npm:1.1.0" + checksum: c09efa34a5465cb120775e1a482136f2340a58b4abce7e93d72b8b5a9324a0e879275016ef9fcd73d72a4731639c54f2bb755bb82f916e4a78892d1d840bb3d2 + languageName: node + linkType: hard + +"@protobufjs/path@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/path@npm:1.1.2" + checksum: bb709567935fd385a86ad1f575aea98131bbd719c743fb9b6edd6b47ede429ff71a801cecbd64fc72deebf4e08b8f1bd8062793178cdaed3713b8d15771f9b83 + languageName: node + linkType: hard + +"@protobufjs/pool@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/pool@npm:1.1.0" + checksum: b9c7047647f6af28e92aac54f6f7c1f7ff31b201b4bfcc7a415b2861528854fce3ec666d7e7e10fd744da905f7d4aef2205bbcc8944ca0ca7a82e18134d00c46 + languageName: node + linkType: hard + +"@protobufjs/utf8@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/utf8@npm:1.1.0" + checksum: 131e289c57534c1d73a0e55782d6751dd821db1583cb2f7f7e017c9d6747addaebe79f28120b2e0185395d990aad347fb14ffa73ef4096fa38508d61a0e64602 + languageName: node + linkType: hard + "@randlabs/communication-bridge@npm:1.0.1": version: 1.0.1 resolution: "@randlabs/communication-bridge@npm:1.0.1" @@ -12149,23 +11520,6 @@ __metadata: languageName: node linkType: hard -"@react-navigation/bottom-tabs@npm:^6.5.11": - version: 6.5.11 - resolution: "@react-navigation/bottom-tabs@npm:6.5.11" - dependencies: - "@react-navigation/elements": "npm:^1.3.21" - color: "npm:^4.2.3" - warn-once: "npm:^0.1.0" - peerDependencies: - "@react-navigation/native": ^6.0.0 - react: "*" - react-native: "*" - react-native-safe-area-context: ">= 3.0.0" - react-native-screens: ">= 3.0.0" - checksum: c082a70d5143d4b0c505a3a2088f4397de14ab50cd1e8fda74bb100b509213a4b0cba5bf6ec4dbc199a1c890adddc2eee63db9fbec8f899b93def9526305da59 - languageName: node - linkType: hard - "@react-navigation/core@npm:^6.4.9": version: 6.4.9 resolution: "@react-navigation/core@npm:6.4.9" @@ -12182,50 +11536,6 @@ __metadata: languageName: node linkType: hard -"@react-navigation/devtools@npm:^6.0.20": - version: 6.0.20 - resolution: "@react-navigation/devtools@npm:6.0.20" - dependencies: - deep-equal: "npm:^2.0.5" - nanoid: "npm:^3.1.23" - stacktrace-parser: "npm:^0.1.10" - peerDependencies: - react: "*" - checksum: 2b3ace878d81462d5969aa0bed932877be823ef79b1b6c4194fab573733b2b601e887c54a2552939cd065d9aab85628ee1e3ceddc0a216c00c2441efd0359522 - languageName: node - linkType: hard - -"@react-navigation/drawer@npm:^6.6.3": - version: 6.6.3 - resolution: "@react-navigation/drawer@npm:6.6.3" - dependencies: - "@react-navigation/elements": "npm:^1.3.18" - color: "npm:^4.2.3" - warn-once: "npm:^0.1.0" - peerDependencies: - "@react-navigation/native": ^6.0.0 - react: "*" - react-native: "*" - react-native-gesture-handler: ">= 1.0.0" - react-native-reanimated: ">= 1.0.0" - react-native-safe-area-context: ">= 3.0.0" - react-native-screens: ">= 3.0.0" - checksum: 657b735cad5c29f066011f41808b5f7c239e8987c882ff2bb11dc5a53267917b3305cab331ff7e54bda56b15265762762426aa45110966b9f57223e62e4c4074 - languageName: node - linkType: hard - -"@react-navigation/elements@npm:^1.3.18": - version: 1.3.18 - resolution: "@react-navigation/elements@npm:1.3.18" - peerDependencies: - "@react-navigation/native": ^6.0.0 - react: "*" - react-native: "*" - react-native-safe-area-context: ">= 3.0.0" - checksum: d78a1c6e5f99c47c6f330b633d085e307627cd31968325666600b643a5cfee39c6db768b80bbd675e5db5ed72ab56462be47db597db181aaad092ccaf7d12222 - languageName: node - linkType: hard - "@react-navigation/elements@npm:^1.3.21": version: 1.3.21 resolution: "@react-navigation/elements@npm:1.3.21" @@ -12238,22 +11548,6 @@ __metadata: languageName: node linkType: hard -"@react-navigation/material-top-tabs@npm:^6.6.3": - version: 6.6.3 - resolution: "@react-navigation/material-top-tabs@npm:6.6.3" - dependencies: - color: "npm:^4.2.3" - warn-once: "npm:^0.1.0" - peerDependencies: - "@react-navigation/native": ^6.0.0 - react: "*" - react-native: "*" - react-native-pager-view: ">= 4.0.0" - react-native-tab-view: ">= 3.0.0" - checksum: 3d9755590691c151f7c248f91fc513ed9033a0c79098b4892b1995d3e233939310c230fcf38939203df68a8c6373575fa32ff6b332679160c13a4acb9b26a040 - languageName: node - linkType: hard - "@react-navigation/material-top-tabs@npm:^6.6.5": version: 6.6.5 resolution: "@react-navigation/material-top-tabs@npm:6.6.5" @@ -12270,22 +11564,6 @@ __metadata: languageName: node linkType: hard -"@react-navigation/native-stack@npm:^6.9.13": - version: 6.9.13 - resolution: "@react-navigation/native-stack@npm:6.9.13" - dependencies: - "@react-navigation/elements": "npm:^1.3.18" - warn-once: "npm:^0.1.0" - peerDependencies: - "@react-navigation/native": ^6.0.0 - react: "*" - react-native: "*" - react-native-safe-area-context: ">= 3.0.0" - react-native-screens: ">= 3.0.0" - checksum: b05b79a9a4ac2757739f83b6df7446576bd6b639aa241c457a20b0e80f803b5a5cec2336d810c762d6566c95efecf36285256a65c5fff0f8a99b84b825fa2d0b - languageName: node - linkType: hard - "@react-navigation/native@npm:^6.1.7": version: 6.1.7 resolution: "@react-navigation/native@npm:6.1.7" @@ -12310,24 +11588,6 @@ __metadata: languageName: node linkType: hard -"@react-navigation/stack@npm:^6.3.17": - version: 6.3.17 - resolution: "@react-navigation/stack@npm:6.3.17" - dependencies: - "@react-navigation/elements": "npm:^1.3.18" - color: "npm:^4.2.3" - warn-once: "npm:^0.1.0" - peerDependencies: - "@react-navigation/native": ^6.0.0 - react: "*" - react-native: "*" - react-native-gesture-handler: ">= 1.0.0" - react-native-safe-area-context: ">= 3.0.0" - react-native-screens: ">= 3.0.0" - checksum: cb39d55266857fa264e470d4822411b5c6ed271af22bc1825861975a73f0be957f0c2701ce1675541a7abcb864f35908712218b68f3da9e0e0fbe2b0da102f0f - languageName: node - linkType: hard - "@react-navigation/stack@npm:^6.3.20": version: 6.3.20 resolution: "@react-navigation/stack@npm:6.3.20" @@ -12507,6 +11767,24 @@ __metadata: languageName: node linkType: hard +"@scure/base@npm:~1.1.4": + version: 1.1.5 + resolution: "@scure/base@npm:1.1.5" + checksum: 543fa9991c6378b6a0d5ab7f1e27b30bb9c1e860d3ac81119b4213cfdf0ad7b61be004e06506e89de7ce0cec9391c17f5c082bb34c3b617a2ee6a04129f52481 + languageName: node + linkType: hard + +"@scure/bip32@npm:1.3.3": + version: 1.3.3 + resolution: "@scure/bip32@npm:1.3.3" + dependencies: + "@noble/curves": "npm:~1.3.0" + "@noble/hashes": "npm:~1.3.2" + "@scure/base": "npm:~1.1.4" + checksum: 4b8b75567866ff7d6b3ba154538add02d2951e9433e8dd7f0014331ac500cda5a88fe3d39b408fcc36e86b633682013f172b967af022c2e4e4ab07336801d688 + languageName: node + linkType: hard + "@scure/bip39@npm:1.1.0": version: 1.1.0 resolution: "@scure/bip39@npm:1.1.0" @@ -12517,6 +11795,16 @@ __metadata: languageName: node linkType: hard +"@scure/bip39@npm:1.2.2": + version: 1.2.2 + resolution: "@scure/bip39@npm:1.2.2" + dependencies: + "@noble/hashes": "npm:~1.3.2" + "@scure/base": "npm:~1.1.4" + checksum: f71aceda10a7937bf3779fd2b4c4156c95ec9813269470ddca464cb8ab610d2451b173037f4b1e6dac45414e406e7adc7b5814c51279f4474d5d38140bbee542 + languageName: node + linkType: hard + "@segment/loosely-validate-event@npm:^2.0.0": version: 2.0.0 resolution: "@segment/loosely-validate-event@npm:2.0.0" @@ -12527,230 +11815,6 @@ __metadata: languageName: node linkType: hard -"@sentry-internal/tracing@npm:7.81.1": - version: 7.81.1 - resolution: "@sentry-internal/tracing@npm:7.81.1" - dependencies: - "@sentry/core": "npm:7.81.1" - "@sentry/types": "npm:7.81.1" - "@sentry/utils": "npm:7.81.1" - checksum: 2bae510d77024898a828bf7e3c51e01670e68b5a4506c47e678b05b32e1c2721e5f6149be9c83c8cee3793746cf69e7242f13b4999aa9902150bee17b1282292 - languageName: node - linkType: hard - -"@sentry/browser@npm:7.81.1": - version: 7.81.1 - resolution: "@sentry/browser@npm:7.81.1" - dependencies: - "@sentry-internal/tracing": "npm:7.81.1" - "@sentry/core": "npm:7.81.1" - "@sentry/replay": "npm:7.81.1" - "@sentry/types": "npm:7.81.1" - "@sentry/utils": "npm:7.81.1" - checksum: cd06f364a13253fa3a166c415cfe2575c34f03f062fd91468724ba2737fd97dd367416c5280e4269d55192a962a54498a40054d95821f67b4227c6f02dc1180d - languageName: node - linkType: hard - -"@sentry/cli-darwin@npm:2.25.2": - version: 2.25.2 - resolution: "@sentry/cli-darwin@npm:2.25.2" - conditions: os=darwin - languageName: node - linkType: hard - -"@sentry/cli-linux-arm64@npm:2.25.2": - version: 2.25.2 - resolution: "@sentry/cli-linux-arm64@npm:2.25.2" - conditions: (os=linux | os=freebsd) & cpu=arm64 - languageName: node - linkType: hard - -"@sentry/cli-linux-arm@npm:2.25.2": - version: 2.25.2 - resolution: "@sentry/cli-linux-arm@npm:2.25.2" - conditions: (os=linux | os=freebsd) & cpu=arm - languageName: node - linkType: hard - -"@sentry/cli-linux-i686@npm:2.25.2": - version: 2.25.2 - resolution: "@sentry/cli-linux-i686@npm:2.25.2" - conditions: (os=linux | os=freebsd) & (cpu=x86 | cpu=ia32) - languageName: node - linkType: hard - -"@sentry/cli-linux-x64@npm:2.25.2": - version: 2.25.2 - resolution: "@sentry/cli-linux-x64@npm:2.25.2" - conditions: (os=linux | os=freebsd) & cpu=x64 - languageName: node - linkType: hard - -"@sentry/cli-win32-i686@npm:2.25.2": - version: 2.25.2 - resolution: "@sentry/cli-win32-i686@npm:2.25.2" - conditions: os=win32 & (cpu=x86 | cpu=ia32) - languageName: node - linkType: hard - -"@sentry/cli-win32-x64@npm:2.25.2": - version: 2.25.2 - resolution: "@sentry/cli-win32-x64@npm:2.25.2" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - -"@sentry/cli@npm:2.25.2": - version: 2.25.2 - resolution: "@sentry/cli@npm:2.25.2" - dependencies: - "@sentry/cli-darwin": "npm:2.25.2" - "@sentry/cli-linux-arm": "npm:2.25.2" - "@sentry/cli-linux-arm64": "npm:2.25.2" - "@sentry/cli-linux-i686": "npm:2.25.2" - "@sentry/cli-linux-x64": "npm:2.25.2" - "@sentry/cli-win32-i686": "npm:2.25.2" - "@sentry/cli-win32-x64": "npm:2.25.2" - https-proxy-agent: "npm:^5.0.0" - node-fetch: "npm:^2.6.7" - progress: "npm:^2.0.3" - proxy-from-env: "npm:^1.1.0" - which: "npm:^2.0.2" - dependenciesMeta: - "@sentry/cli-darwin": - optional: true - "@sentry/cli-linux-arm": - optional: true - "@sentry/cli-linux-arm64": - optional: true - "@sentry/cli-linux-i686": - optional: true - "@sentry/cli-linux-x64": - optional: true - "@sentry/cli-win32-i686": - optional: true - "@sentry/cli-win32-x64": - optional: true - bin: - sentry-cli: bin/sentry-cli - checksum: 72572039702207ebec7ee5a7f279ad7e34b643396ed8d0f1af77395263f0a3093e0037bcee3de29bd4fd42e660331f8ad51a12fd5f75a1e95fffad1114b8cc2c - languageName: node - linkType: hard - -"@sentry/core@npm:7.81.1": - version: 7.81.1 - resolution: "@sentry/core@npm:7.81.1" - dependencies: - "@sentry/types": "npm:7.81.1" - "@sentry/utils": "npm:7.81.1" - checksum: 3bb001c147f9425b4d93f780260eb928d486dec3772ec6bc3648f882a8ef9f8e69d71eaaf5fcce80b50316de7d10cdec54e6926a335c3361a1e7009d2d1b4ea4 - languageName: node - linkType: hard - -"@sentry/hub@npm:7.81.1": - version: 7.81.1 - resolution: "@sentry/hub@npm:7.81.1" - dependencies: - "@sentry/core": "npm:7.81.1" - "@sentry/types": "npm:7.81.1" - "@sentry/utils": "npm:7.81.1" - checksum: a0b65c8e0d76ce92ce02e5035b3b7f7563e97db4b5c1d1c43cc3050394e41ca82e95cdde652fb2f5d7b948c91eb83a9568da83866ad8adbfe3078932baf6c4fd - languageName: node - linkType: hard - -"@sentry/integrations@npm:7.81.1": - version: 7.81.1 - resolution: "@sentry/integrations@npm:7.81.1" - dependencies: - "@sentry/core": "npm:7.81.1" - "@sentry/types": "npm:7.81.1" - "@sentry/utils": "npm:7.81.1" - localforage: "npm:^1.8.1" - checksum: 13b6a0bcf47e717ca61d25ab0c8c1d839e9c6b43962ce1be9127becc3fcf19d9191d3938778a17217f5e0a7980630aae025215c7d711cdac522f0210bcb14247 - languageName: node - linkType: hard - -"@sentry/react-native@npm:5.17.0": - version: 5.17.0 - resolution: "@sentry/react-native@npm:5.17.0" - dependencies: - "@sentry/browser": "npm:7.81.1" - "@sentry/cli": "npm:2.25.2" - "@sentry/core": "npm:7.81.1" - "@sentry/hub": "npm:7.81.1" - "@sentry/integrations": "npm:7.81.1" - "@sentry/react": "npm:7.81.1" - "@sentry/types": "npm:7.81.1" - "@sentry/utils": "npm:7.81.1" - peerDependencies: - expo: ">=49.0.0" - react: ">=17.0.0" - react-native: ">=0.65.0" - peerDependenciesMeta: - expo: - optional: true - bin: - sentry-expo-upload-sourcemaps: scripts/expo-upload-sourcemaps.js - checksum: c2e7bb151409e73718490b87bf97bdbcde78ee6d13199bca96c15f07233f3bbf00b158362b740a726bdea2c09d3bed09a5507fadf5e5f88c6370142d8d0ee319 - languageName: node - linkType: hard - -"@sentry/react@npm:7.81.1": - version: 7.81.1 - resolution: "@sentry/react@npm:7.81.1" - dependencies: - "@sentry/browser": "npm:7.81.1" - "@sentry/types": "npm:7.81.1" - "@sentry/utils": "npm:7.81.1" - hoist-non-react-statics: "npm:^3.3.2" - peerDependencies: - react: 15.x || 16.x || 17.x || 18.x - checksum: 660894a157ac8af0147077608df49ef37f97f46e5c202e1ab77dce3994d836d7320699be00d62edbd09809a5c485bb4ecd6ef16e837b7546e2abaefe4b298ca9 - languageName: node - linkType: hard - -"@sentry/replay@npm:7.81.1": - version: 7.81.1 - resolution: "@sentry/replay@npm:7.81.1" - dependencies: - "@sentry-internal/tracing": "npm:7.81.1" - "@sentry/core": "npm:7.81.1" - "@sentry/types": "npm:7.81.1" - "@sentry/utils": "npm:7.81.1" - checksum: 8ba893cc98409cda5ae74128dea1922885bd8d782cb53be4feff486248b4ae52d51d9aae928da7d868171953c718af87e2e90254e4c65cbf5e4ae4d9a4059b2c - languageName: node - linkType: hard - -"@sentry/types@npm:7.81.1": - version: 7.81.1 - resolution: "@sentry/types@npm:7.81.1" - checksum: 26164e48ae8322218a1c081217de97bd50856b554604c5ffb0328f5356fed64c8ddfa9b155c4bbe4f66264c0881a017face36d53a0fc230fc1aa5e7948ffecc5 - languageName: node - linkType: hard - -"@sentry/utils@npm:7.81.1": - version: 7.81.1 - resolution: "@sentry/utils@npm:7.81.1" - dependencies: - "@sentry/types": "npm:7.81.1" - checksum: 12a13adced1c2ca87bc93d0adb66c8fe9f5f2b9247c7cd2773c2e26edf8dd6437ab1f316af4afdd8e9ee912bdfabbaed89757a427a0c84e42a483b65ea790cdc - languageName: node - linkType: hard - -"@shopify/flash-list@npm:1.6.3": - version: 1.6.3 - resolution: "@shopify/flash-list@npm:1.6.3" - dependencies: - recyclerlistview: "npm:4.2.0" - tslib: "npm:2.4.0" - peerDependencies: - "@babel/runtime": "*" - react: "*" - react-native: "*" - checksum: b2c272b447cc528676eac0dfbcb9aead756bb00e9bfda93fc9e3886f93d4cb39fa9fa2d16a3077a86b18dfafc6a67a0e2c4b5917ea5b1efea9e63f485688cb51 - languageName: node - linkType: hard - "@sideway/address@npm:^4.1.3": version: 4.1.4 resolution: "@sideway/address@npm:4.1.4" @@ -12795,6 +11859,13 @@ __metadata: languageName: node linkType: hard +"@sinclair/typebox@npm:^0.31.28": + version: 0.31.28 + resolution: "@sinclair/typebox@npm:0.31.28" + checksum: 27c3af5539a12af9b3cda4432959c69fb500920f1dd3739700a1437cfa9de809a292398a0b3b871c7471e96e4088d58406105bed5407d089c91c56090c526013 + languageName: node + linkType: hard + "@sindresorhus/is@npm:^0.7.0": version: 0.7.0 resolution: "@sindresorhus/is@npm:0.7.0" @@ -14672,26 +13743,6 @@ __metadata: languageName: node linkType: hard -"@tanstack/eslint-plugin-query@npm:^5.20.1": - version: 5.20.1 - resolution: "@tanstack/eslint-plugin-query@npm:5.20.1" - dependencies: - "@typescript-eslint/utils": "npm:^6.20.0" - peerDependencies: - eslint: ^8.0.0 - checksum: 7730ba24fb45f54186262813e48bf626cc875a74d906fc0260d7eb2d4df56b05d542766a64145b7a89f7f59a553b1e8c5dab5a2fcfd74a3ba40d0350e5e76164 - languageName: node - linkType: hard - -"@tanstack/query-async-storage-persister@npm:^5.17.19": - version: 5.17.19 - resolution: "@tanstack/query-async-storage-persister@npm:5.17.19" - dependencies: - "@tanstack/query-persist-client-core": "npm:5.17.19" - checksum: 3902d7df89b7d50bdff547720b6f33a1f792f24ec1d06cd56a54f2257abe62cc8501d00c8365e7ce540ade3c69c74874a4b3869852b3e45a025fa22e7542d5c7 - languageName: node - linkType: hard - "@tanstack/query-core@npm:4.36.1": version: 4.36.1 resolution: "@tanstack/query-core@npm:4.36.1" @@ -14715,15 +13766,6 @@ __metadata: languageName: node linkType: hard -"@tanstack/query-persist-client-core@npm:5.17.19": - version: 5.17.19 - resolution: "@tanstack/query-persist-client-core@npm:5.17.19" - dependencies: - "@tanstack/query-core": "npm:5.17.19" - checksum: 301c41f3543b3f304e6a6aad55127a17ade38ba1517d51b8f7d848a5db5039d65feca8a73038b06fdeaf2a4ed6385540c8abf1061373abacaa60665649e40592 - languageName: node - linkType: hard - "@tanstack/query-sync-storage-persister@npm:^4.0.10": version: 4.36.1 resolution: "@tanstack/query-sync-storage-persister@npm:4.36.1" @@ -14744,18 +13786,6 @@ __metadata: languageName: node linkType: hard -"@tanstack/react-query-persist-client@npm:^5.17.19": - version: 5.17.19 - resolution: "@tanstack/react-query-persist-client@npm:5.17.19" - dependencies: - "@tanstack/query-persist-client-core": "npm:5.17.19" - peerDependencies: - "@tanstack/react-query": ^5.17.19 - react: ^18.0.0 - checksum: af87bf1a50e7b62ec246fa1c122968b1c60e08968adc30fc5c10e64476cb48ce4d34aa60a96346dfa7223eaf7196aa9fe74321288f864bae1bbcf5dcec5e27a1 - languageName: node - linkType: hard - "@tanstack/react-query@npm:^4.0.10": version: 4.36.1 resolution: "@tanstack/react-query@npm:4.36.1" @@ -14839,33 +13869,247 @@ __metadata: languageName: node linkType: hard -"@treklabs/api-web@npm:0.1.1": - version: 0.1.1 - resolution: "@treklabs/api-web@npm:0.1.1" +"@trezor/analytics@npm:1.0.14": + version: 1.0.14 + resolution: "@trezor/analytics@npm:1.0.14" dependencies: - axios: "npm:^1.6.0" - ts-morph: "npm:^20.0.0" - tweetnacl: "npm:^1.0.3" - checksum: 769e1f2b9950cd6fe5d3d9223940a93bf749a7a8c641ee6f56013e5f582053d5def591dba700a2fedc173fcd892ffc5bb3a82a8db339eb0ecc47fdab8de85e93 + "@trezor/env-utils": "npm:1.0.13" + "@trezor/utils": "npm:9.0.21" + peerDependencies: + tslib: ^2.6.2 + checksum: 526842a66af608c90904b51f7c5a71ab4686eaeafd5ca37b96a922653739a908ff29907dab3a6bce7af65e42675ea14901b8768740cb27e99d9310765f6ea024 languageName: node linkType: hard -"@trysound/sax@npm:0.2.0": - version: 0.2.0 - resolution: "@trysound/sax@npm:0.2.0" - checksum: 7379713eca480ac0d9b6c7b063e06b00a7eac57092354556c81027066eb65b61ea141a69d0cc2e15d32e05b2834d4c9c2184793a5e36bbf5daf05ee5676af18c +"@trezor/blockchain-link-types@npm:1.0.13": + version: 1.0.13 + resolution: "@trezor/blockchain-link-types@npm:1.0.13" + dependencies: + "@solana/web3.js": "npm:^1.87.6" + "@trezor/type-utils": "npm:1.0.4" + "@trezor/utxo-lib": "npm:2.0.6" + socks-proxy-agent: "npm:6.1.1" + checksum: 6232c55f0153e2e42863a51ebd32fa1bc6ebff16ba2a526a18a63ac9f9a055e69916e7f4594a3533e4a311051dd29f7767c668648f72e0f2ff75eda377db5fbe languageName: node linkType: hard -"@ts-morph/common@npm:~0.21.0": - version: 0.21.0 - resolution: "@ts-morph/common@npm:0.21.0" +"@trezor/blockchain-link-utils@npm:1.0.14": + version: 1.0.14 + resolution: "@trezor/blockchain-link-utils@npm:1.0.14" dependencies: - fast-glob: "npm:^3.2.12" - minimatch: "npm:^7.4.3" - mkdirp: "npm:^2.1.6" - path-browserify: "npm:^1.0.1" - checksum: dbfffae478bb9da71182faf87c14f578de21afe098a388bbcbdeebc5864e9f17e136526dbad6a8e760fe20e5bb943b2dfa62dc47d14b8e6e9077ce08f6de6242 + "@mobily/ts-belt": "npm:^3.13.1" + "@solana/web3.js": "npm:^1.87.6" + "@trezor/utils": "npm:9.0.21" + bignumber.js: "npm:^9.1.1" + peerDependencies: + tslib: ^2.6.2 + checksum: 2d7b64b2b0d418b4065f2c589b715d0ce13821ffb19fb331a624d43a810af75e96c2f0d9a61edcdcf50d6c1651cf51803594ddbcfbfc937153bb9f07c7862ee3 + languageName: node + linkType: hard + +"@trezor/blockchain-link@npm:2.1.25": + version: 2.1.25 + resolution: "@trezor/blockchain-link@npm:2.1.25" + dependencies: + "@solana/buffer-layout": "npm:^4.0.1" + "@solana/web3.js": "npm:^1.87.6" + "@trezor/blockchain-link-types": "npm:1.0.13" + "@trezor/blockchain-link-utils": "npm:1.0.14" + "@trezor/utils": "npm:9.0.21" + "@trezor/utxo-lib": "npm:2.0.6" + "@types/web": "npm:^0.0.119" + bignumber.js: "npm:^9.1.1" + events: "npm:^3.3.0" + ripple-lib: "npm:^1.10.1" + socks-proxy-agent: "npm:6.1.1" + ws: "npm:^8.16.0" + peerDependencies: + tslib: ^2.6.2 + checksum: 78346cf7031d29ea42796f8e78e3ced6d9d8023c6ac522851aafb7fc2ac547e10b3223af75103acac39da896b0a1eb4b8701c02418cf66b26334e5f5a767acf8 + languageName: node + linkType: hard + +"@trezor/connect-analytics@npm:1.0.12": + version: 1.0.12 + resolution: "@trezor/connect-analytics@npm:1.0.12" + dependencies: + "@trezor/analytics": "npm:1.0.14" + peerDependencies: + tslib: ^2.6.2 + checksum: 44515d44f9ba205585a3f0772a9859029470f570bbb0ec0958b23e9afa74e60244530f2d363e91b18f2cd1b8cc5e6679f5416ac31944db423f8810e5f6ecf469 + languageName: node + linkType: hard + +"@trezor/connect-common@npm:0.0.28": + version: 0.0.28 + resolution: "@trezor/connect-common@npm:0.0.28" + dependencies: + "@trezor/env-utils": "npm:1.0.13" + "@trezor/utils": "npm:9.0.21" + peerDependencies: + tslib: ^2.6.2 + checksum: 9be1773d954e1643878aa549afd216a23ae5945bebd822fed535458a6ffa71809a7d6267831367dbb8d6bbc0cc93a54b343dd7f4a97b9154bac4767774f1dc54 + languageName: node + linkType: hard + +"@trezor/connect-web@npm:^9.1.12": + version: 9.1.12 + resolution: "@trezor/connect-web@npm:9.1.12" + dependencies: + "@trezor/connect": "npm:9.1.12" + "@trezor/utils": "npm:9.0.21" + events: "npm:^3.3.0" + peerDependencies: + tslib: ^2.6.2 + checksum: a32a003c1fe034603a80151722fee4eaad7aebdfe00f2064ae28761647ecdb4935abca48a72e7029fbf8ae689e0b965594d93e674d918adb6d746378bb81d599 + languageName: node + linkType: hard + +"@trezor/connect@npm:9.1.12": + version: 9.1.12 + resolution: "@trezor/connect@npm:9.1.12" + dependencies: + "@ethereumjs/common": "npm:^4.1.0" + "@ethereumjs/tx": "npm:^5.1.0" + "@fivebinaries/coin-selection": "npm:2.2.1" + "@trezor/blockchain-link": "npm:2.1.25" + "@trezor/blockchain-link-types": "npm:1.0.13" + "@trezor/connect-analytics": "npm:1.0.12" + "@trezor/connect-common": "npm:0.0.28" + "@trezor/protobuf": "npm:1.0.8" + "@trezor/protocol": "npm:1.0.5" + "@trezor/schema-utils": "npm:1.0.1" + "@trezor/transport": "npm:1.1.24" + "@trezor/utils": "npm:9.0.21" + "@trezor/utxo-lib": "npm:2.0.6" + bignumber.js: "npm:^9.1.1" + blakejs: "npm:^1.2.1" + bs58: "npm:^5.0.0" + bs58check: "npm:^3.0.1" + cross-fetch: "npm:^4.0.0" + events: "npm:^3.3.0" + peerDependencies: + tslib: ^2.6.2 + checksum: 31ed89f79a820655d3e80ba41ad653c77015d475aee62fe96563728b6ff4458bba275aaeff80d8f20fd364b520f234574aa3fc37002c32f700bf27150e522370 + languageName: node + linkType: hard + +"@trezor/env-utils@npm:1.0.13": + version: 1.0.13 + resolution: "@trezor/env-utils@npm:1.0.13" + dependencies: + ua-parser-js: "npm:^1.0.37" + peerDependencies: + expo-localization: "*" + react-native: "*" + tslib: ^2.6.2 + peerDependenciesMeta: + expo-localization: + optional: true + react-native: + optional: true + checksum: 8886cd5850ea61db0fb9a7965dff9984b148605c3fa33637e71d27473475edc53d7f565f414dbc9016453ce1c077dce8283e73151d8a580edab8c4afac0f7fd8 + languageName: node + linkType: hard + +"@trezor/protobuf@npm:1.0.8": + version: 1.0.8 + resolution: "@trezor/protobuf@npm:1.0.8" + dependencies: + "@trezor/schema-utils": "npm:1.0.1" + long: "npm:^4.0.0" + protobufjs: "npm:7.2.5" + peerDependencies: + tslib: ^2.6.2 + checksum: f6d99e7c8ad5245830696ec473b4d5484173848b7bb47209ec955b5e603993744c6c5895862feef100a124a2b6ad36332ae394a70145da3e7ab4a90fd1db2c29 + languageName: node + linkType: hard + +"@trezor/protocol@npm:1.0.5": + version: 1.0.5 + resolution: "@trezor/protocol@npm:1.0.5" + peerDependencies: + tslib: ^2.6.2 + checksum: cbe5a18ceb28790fcde780ef54960894805a25255666ec04853a95eaecef917b374e8aaf8adef48726479d2690f73191f68a79d3f53aa5661cfa5e956b68b9e4 + languageName: node + linkType: hard + +"@trezor/schema-utils@npm:1.0.1": + version: 1.0.1 + resolution: "@trezor/schema-utils@npm:1.0.1" + dependencies: + "@sinclair/typebox": "npm:^0.31.28" + ts-mixer: "npm:^6.0.3" + checksum: 8bed9302c164e241a31ac2c481ea9c6731af3d9c914d45de2132887b109ce9753a97ba6368cb67acbe92d434a85922e4a67272d889ec45d5e0f72b82db545544 + languageName: node + linkType: hard + +"@trezor/transport@npm:1.1.24": + version: 1.1.24 + resolution: "@trezor/transport@npm:1.1.24" + dependencies: + "@trezor/protobuf": "npm:1.0.8" + "@trezor/protocol": "npm:1.0.5" + "@trezor/utils": "npm:9.0.21" + cross-fetch: "npm:^4.0.0" + json-stable-stringify: "npm:^1.0.2" + long: "npm:^4.0.0" + protobufjs: "npm:7.2.5" + usb: "npm:^2.11.0" + peerDependencies: + tslib: ^2.6.2 + checksum: be82ce208bad8213fe2d264ec040b56fe864d63906fd50b50437a4cc502d236eb32cf89c6c3c52086e5a0ffd7e8ff3591b44e392a280fd60c44777134b2bd7d1 + languageName: node + linkType: hard + +"@trezor/type-utils@npm:1.0.4": + version: 1.0.4 + resolution: "@trezor/type-utils@npm:1.0.4" + checksum: b73fb3ee4b0382dfe9ab93a7a43b35b236fd2288a4c6384c197dbf41d974dfcae793b56d0343a4ffe2714fd913d9cde6c7976cd4b84a79f1862c2217cd503f85 + languageName: node + linkType: hard + +"@trezor/utils@npm:9.0.21": + version: 9.0.21 + resolution: "@trezor/utils@npm:9.0.21" + peerDependencies: + tslib: ^2.6.2 + checksum: 35f426fefec7ca0dae04f88d301b541c8b73c143cfc0e588061267af5bc05bcfed87e6ba29e4f19e2d76e80ff834c370f9a5b33e6a010f80f5eedcb297c498e6 + languageName: node + linkType: hard + +"@trezor/utxo-lib@npm:2.0.6": + version: 2.0.6 + resolution: "@trezor/utxo-lib@npm:2.0.6" + dependencies: + "@trezor/utils": "npm:9.0.21" + bchaddrjs: "npm:^0.5.2" + bech32: "npm:^2.0.0" + bip66: "npm:^1.1.5" + bitcoin-ops: "npm:^1.4.1" + blake-hash: "npm:^2.0.0" + blakejs: "npm:^1.2.1" + bn.js: "npm:^5.2.1" + bs58: "npm:^5.0.0" + bs58check: "npm:^3.0.1" + create-hash: "npm:^1.2.0" + create-hmac: "npm:^1.1.7" + int64-buffer: "npm:^1.0.1" + pushdata-bitcoin: "npm:^1.0.1" + tiny-secp256k1: "npm:^1.1.6" + typeforce: "npm:^1.18.0" + varuint-bitcoin: "npm:^1.1.2" + wif: "npm:^4.0.0" + peerDependencies: + tslib: ^2.6.2 + checksum: c6e7fe4c6604f07d66b6634c775a7d39212f5335417ccfd50fbb9832ae9e3a993e25fc56550db1710b60f9ade97aa2c77d120d83ae0a34da1c28735342478066 + languageName: node + linkType: hard + +"@trysound/sax@npm:0.2.0": + version: 0.2.0 + resolution: "@trysound/sax@npm:0.2.0" + checksum: 7379713eca480ac0d9b6c7b063e06b00a7eac57092354556c81027066eb65b61ea141a69d0cc2e15d32e05b2834d4c9c2184793a5e36bbf5daf05ee5676af18c languageName: node linkType: hard @@ -15458,16 +14702,6 @@ __metadata: languageName: node linkType: hard -"@types/hoist-non-react-statics@npm:^3.3.1": - version: 3.3.1 - resolution: "@types/hoist-non-react-statics@npm:3.3.1" - dependencies: - "@types/react": "npm:*" - hoist-non-react-statics: "npm:^3.3.0" - checksum: 071e6d75a0ed9aa0e9ca2cc529a8c15bf7ac3e4a37aac279772ea6036fd0bf969b67fb627b65cfce65adeab31fec1e9e95b4dcdefeab075b580c0c7174206f63 - languageName: node - linkType: hard - "@types/html-minifier-terser@npm:^6.0.0": version: 6.1.0 resolution: "@types/html-minifier-terser@npm:6.1.0" @@ -15612,16 +14846,7 @@ __metadata: languageName: node linkType: hard -"@types/lodash.throttle@npm:^4": - version: 4.1.9 - resolution: "@types/lodash.throttle@npm:4.1.9" - dependencies: - "@types/lodash": "npm:*" - checksum: 6d330072387f062d408747f0dbe62869820ee3f3fbec43965f703ce9c9083e4ff9082faa4fe92aea000d6367b7645955e9c8db6a4e04e6bd769697fdd19c12b1 - languageName: node - linkType: hard - -"@types/lodash@npm:*": +"@types/lodash@npm:^4.14.136": version: 4.14.202 resolution: "@types/lodash@npm:4.14.202" checksum: 1bb9760a5b1dda120132c4b987330d67979c95dbc22612678682cd61b00302e190f4207228f3728580059cdab5582362262e3819aea59960c1017bd2b9fb26f6 @@ -16012,7 +15237,21 @@ __metadata: languageName: node linkType: hard -"@types/ws@npm:^7.4.4": +"@types/w3c-web-usb@npm:^1.0.6": + version: 1.0.10 + resolution: "@types/w3c-web-usb@npm:1.0.10" + checksum: 6ac6786a0788f0846a48b103ab06ca5fde5eb95674217b522420a2f6157bee3e181a961c1b7011940f497c55f4f5cc46129657d881fdd8112b48764089679ad6 + languageName: node + linkType: hard + +"@types/web@npm:^0.0.119": + version: 0.0.119 + resolution: "@types/web@npm:0.0.119" + checksum: abaabd19a59368939e5048590d6287bb5a9707031434ca11cdfa6f348ed42744f673f02cdca0de8c744898ffdc5d100df2e606abffaacb32c903b47a2ef8ac7e + languageName: node + linkType: hard + +"@types/ws@npm:^7.2.0, @types/ws@npm:^7.4.4": version: 7.4.7 resolution: "@types/ws@npm:7.4.7" dependencies: @@ -16206,16 +15445,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:6.21.0": - version: 6.21.0 - resolution: "@typescript-eslint/scope-manager@npm:6.21.0" - dependencies: - "@typescript-eslint/types": "npm:6.21.0" - "@typescript-eslint/visitor-keys": "npm:6.21.0" - checksum: fe91ac52ca8e09356a71dc1a2f2c326480f3cccfec6b2b6d9154c1a90651ab8ea270b07c67df5678956c3bbf0bbe7113ab68f68f21b20912ea528b1214197395 - languageName: node - linkType: hard - "@typescript-eslint/type-utils@npm:6.17.0": version: 6.17.0 resolution: "@typescript-eslint/type-utils@npm:6.17.0" @@ -16271,13 +15500,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:6.21.0": - version: 6.21.0 - resolution: "@typescript-eslint/types@npm:6.21.0" - checksum: e26da86d6f36ca5b6ef6322619f8ec55aabcd7d43c840c977ae13ae2c964c3091fc92eb33730d8be08927c9de38466c5323e78bfb270a9ff1d3611fe821046c5 - languageName: node - linkType: hard - "@typescript-eslint/typescript-estree@npm:5.56.0": version: 5.56.0 resolution: "@typescript-eslint/typescript-estree@npm:5.56.0" @@ -16334,25 +15556,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:6.21.0": - version: 6.21.0 - resolution: "@typescript-eslint/typescript-estree@npm:6.21.0" - dependencies: - "@typescript-eslint/types": "npm:6.21.0" - "@typescript-eslint/visitor-keys": "npm:6.21.0" - debug: "npm:^4.3.4" - globby: "npm:^11.1.0" - is-glob: "npm:^4.0.3" - minimatch: "npm:9.0.3" - semver: "npm:^7.5.4" - ts-api-utils: "npm:^1.0.1" - peerDependenciesMeta: - typescript: - optional: true - checksum: b32fa35fca2a229e0f5f06793e5359ff9269f63e9705e858df95d55ca2cd7fdb5b3e75b284095a992c48c5fc46a1431a1a4b6747ede2dd08929dc1cbacc589b8 - languageName: node - linkType: hard - "@typescript-eslint/utils@npm:6.17.0": version: 6.17.0 resolution: "@typescript-eslint/utils@npm:6.17.0" @@ -16387,23 +15590,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:^6.20.0": - version: 6.21.0 - resolution: "@typescript-eslint/utils@npm:6.21.0" - dependencies: - "@eslint-community/eslint-utils": "npm:^4.4.0" - "@types/json-schema": "npm:^7.0.12" - "@types/semver": "npm:^7.5.0" - "@typescript-eslint/scope-manager": "npm:6.21.0" - "@typescript-eslint/types": "npm:6.21.0" - "@typescript-eslint/typescript-estree": "npm:6.21.0" - semver: "npm:^7.5.4" - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - checksum: b404a2c55a425a79d054346ae123087d30c7ecf7ed7abcf680c47bf70c1de4fabadc63434f3f460b2fa63df76bc9e4a0b9fa2383bb8a9fcd62733fb5c4e4f3e3 - languageName: node - linkType: hard - "@typescript-eslint/visitor-keys@npm:5.56.0": version: 5.56.0 resolution: "@typescript-eslint/visitor-keys@npm:5.56.0" @@ -16434,16 +15620,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:6.21.0": - version: 6.21.0 - resolution: "@typescript-eslint/visitor-keys@npm:6.21.0" - dependencies: - "@typescript-eslint/types": "npm:6.21.0" - eslint-visitor-keys: "npm:^3.4.1" - checksum: 30422cdc1e2ffad203df40351a031254b272f9c6f2b7e02e9bfa39e3fc2c7b1c6130333b0057412968deda17a3a68a578a78929a8139c6acef44d9d841dc72e1 - languageName: node - linkType: hard - "@ubeswap/token-math@npm:^4.4.4": version: 4.4.8 resolution: "@ubeswap/token-math@npm:4.4.8" @@ -16475,16 +15651,6 @@ __metadata: languageName: node linkType: hard -"@uidotdev/usehooks@npm:^2.0.1": - version: 2.0.1 - resolution: "@uidotdev/usehooks@npm:2.0.1" - peerDependencies: - react: ">=18.0.0" - react-dom: ">=18.0.0" - checksum: a099d59f76c338abe980a0b55bc0b09fe38314b4cbcbb4b5a3565384dd407e7fd31a9c040cb50d333162502444433cb10d95238de9b53cc748ea9529f924c190 - languageName: node - linkType: hard - "@uidotdev/usehooks@npm:^2.4.1": version: 2.4.1 resolution: "@uidotdev/usehooks@npm:2.4.1" @@ -17265,13 +16431,6 @@ __metadata: languageName: node linkType: hard -"@whatwg-node/events@npm:^0.1.0": - version: 0.1.1 - resolution: "@whatwg-node/events@npm:0.1.1" - checksum: 3a356ca23522190201e27446cfd7ebf1cf96815ddb9d1ba5da0a00bbe6c1d28b4094862104411101fbedd47c758b25fe3683033f6a3e80933029efd664c33567 - languageName: node - linkType: hard - "@whatwg-node/fetch@npm:^0.8.0, @whatwg-node/fetch@npm:^0.8.1, @whatwg-node/fetch@npm:^0.8.2": version: 0.8.5 resolution: "@whatwg-node/fetch@npm:0.8.5" @@ -17285,16 +16444,6 @@ __metadata: languageName: node linkType: hard -"@whatwg-node/fetch@npm:^0.9.0": - version: 0.9.4 - resolution: "@whatwg-node/fetch@npm:0.9.4" - dependencies: - "@whatwg-node/node-fetch": "npm:^0.4.3" - urlpattern-polyfill: "npm:^9.0.0" - checksum: 8b17610358a07f3c559675754507d0cfd70adff0b4e31df7f31b9114c55f294689cc8ef24c56a33030ee819524c3ddd563e6764bd9754beabb7cc583177665f6 - languageName: node - linkType: hard - "@whatwg-node/node-fetch@npm:^0.3.3": version: 0.3.5 resolution: "@whatwg-node/node-fetch@npm:0.3.5" @@ -17308,19 +16457,6 @@ __metadata: languageName: node linkType: hard -"@whatwg-node/node-fetch@npm:^0.4.3": - version: 0.4.3 - resolution: "@whatwg-node/node-fetch@npm:0.4.3" - dependencies: - "@whatwg-node/events": "npm:^0.1.0" - busboy: "npm:^1.6.0" - fast-querystring: "npm:^1.1.1" - fast-url-parser: "npm:^1.1.3" - tslib: "npm:^2.3.1" - checksum: 9b08fe3d97d9f346273d1b07cc7e027ffbed7a7cca8564cf254aa0ad311862e3d04526504f7f703c10ee0b0975fd098abdc88a515affd9f275fd882b590449ac - languageName: node - linkType: hard - "@wry/caches@npm:^1.0.0": version: 1.0.1 resolution: "@wry/caches@npm:1.0.1" @@ -17582,15 +16718,6 @@ __metadata: languageName: node linkType: hard -"agent-base@npm:^7.0.2, agent-base@npm:^7.1.0": - version: 7.1.0 - resolution: "agent-base@npm:7.1.0" - dependencies: - debug: "npm:^4.3.4" - checksum: f7828f991470a0cc22cb579c86a18cbae83d8a3cbed39992ab34fc7217c4d126017f1c74d0ab66be87f71455318a8ea3e757d6a37881b8d0f2a2c6aa55e5418f - languageName: node - linkType: hard - "agentkeepalive@npm:^4.2.1": version: 4.3.0 resolution: "agentkeepalive@npm:4.3.0" @@ -17659,18 +16786,6 @@ __metadata: languageName: node linkType: hard -"ajv@npm:8.11.0": - version: 8.11.0 - resolution: "ajv@npm:8.11.0" - dependencies: - fast-deep-equal: "npm:^3.1.1" - json-schema-traverse: "npm:^1.0.0" - require-from-string: "npm:^2.0.2" - uri-js: "npm:^4.2.2" - checksum: aa0dfd6cebdedde8e77747e84e7b7c55921930974b8547f54b4156164ff70445819398face32dafda4bd4c61bbc7513d308d4c2bf769f8ea6cb9c8449f9faf54 - languageName: node - linkType: hard - "ajv@npm:^6.12.4, ajv@npm:^6.12.5": version: 6.12.6 resolution: "ajv@npm:6.12.6" @@ -18008,13 +17123,6 @@ __metadata: languageName: node linkType: hard -"arg@npm:4.1.0": - version: 4.1.0 - resolution: "arg@npm:4.1.0" - checksum: dc0e1ea7f0adee7871c456bd57f06fb9f8c2ccd91fd0537c73b66f3fa0c9697ccdfc25b358a417a3ab263c062aac0ef2df3a5523433861fe6277cb2ff769a9bc - languageName: node - linkType: hard - "arg@npm:5.0.2, arg@npm:^5.0.2": version: 5.0.2 resolution: "arg@npm:5.0.2" @@ -18790,19 +17898,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-module-resolver@npm:^5.0.0": - version: 5.0.0 - resolution: "babel-plugin-module-resolver@npm:5.0.0" - dependencies: - find-babel-config: "npm:^2.0.0" - glob: "npm:^8.0.3" - pkg-up: "npm:^3.1.0" - reselect: "npm:^4.1.7" - resolve: "npm:^1.22.1" - checksum: 13924d6ec9958405b2ac1a471639f75a7e486f643a6a50363b26dca7b66abd2cf1d9fe301c4e7b50c817e37e782fa06c209d958a4e0570c9ded36e0b8b6c2e48 - languageName: node - linkType: hard - "babel-plugin-polyfill-corejs2@npm:^0.3.3": version: 0.3.3 resolution: "babel-plugin-polyfill-corejs2@npm:0.3.3" @@ -18898,13 +17993,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-transform-inline-environment-variables@npm:^0.4.4": - version: 0.4.4 - resolution: "babel-plugin-transform-inline-environment-variables@npm:0.4.4" - checksum: fa361287411301237fd8ce332aff4f8e8ccb8db30e87a2ddc7224c8bf7cd792eda47aca24dc2e09e70bce4c027bc8cbe22f4999056be37a25d2472945df21ef5 - languageName: node - linkType: hard - "babel-preset-current-node-syntax@npm:^1.0.0": version: 1.0.1 resolution: "babel-preset-current-node-syntax@npm:1.0.1" @@ -18927,7 +18015,7 @@ __metadata: languageName: node linkType: hard -"babel-preset-expo@npm:^10.0.0, babel-preset-expo@npm:~10.0.0, babel-preset-expo@npm:~10.0.1": +"babel-preset-expo@npm:~10.0.0, babel-preset-expo@npm:~10.0.1": version: 10.0.1 resolution: "babel-preset-expo@npm:10.0.1" dependencies: @@ -19058,7 +18146,7 @@ __metadata: languageName: node linkType: hard -"base-x@npm:^3.0.2, base-x@npm:^3.0.6, base-x@npm:^3.0.8": +"base-x@npm:^3.0.2, base-x@npm:^3.0.6, base-x@npm:^3.0.8, base-x@npm:^3.0.9": version: 3.0.9 resolution: "base-x@npm:3.0.9" dependencies: @@ -19083,7 +18171,7 @@ __metadata: languageName: node linkType: hard -"base64-js@npm:^1.2.3, base64-js@npm:^1.3.0, base64-js@npm:^1.3.1, base64-js@npm:^1.5.1": +"base64-js@npm:^1.2.3, base64-js@npm:^1.3.1, base64-js@npm:^1.5.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 @@ -19128,6 +18216,18 @@ __metadata: languageName: node linkType: hard +"bchaddrjs@npm:^0.5.2": + version: 0.5.2 + resolution: "bchaddrjs@npm:0.5.2" + dependencies: + bs58check: "npm:2.1.2" + buffer: "npm:^6.0.3" + cashaddrjs: "npm:0.4.4" + stream-browserify: "npm:^3.0.0" + checksum: ca79899b72efcad8fa696814532a4ded103402fcb18389ae8969df89d9e5415ea4209e707c6625fad855a2a20f9e23cf535902b235c05b897ce5375a19a4dc38 + languageName: node + linkType: hard + "bech32@npm:1.1.4": version: 1.1.4 resolution: "bech32@npm:1.1.4" @@ -19135,6 +18235,13 @@ __metadata: languageName: node linkType: hard +"bech32@npm:^2.0.0": + version: 2.0.0 + resolution: "bech32@npm:2.0.0" + checksum: fa15acb270b59aa496734a01f9155677b478987b773bf701f465858bf1606c6a970085babd43d71ce61895f1baa594cb41a2cd1394bd2c6698f03cc2d811300e + languageName: node + linkType: hard + "better-opn@npm:~3.0.2": version: 3.0.2 resolution: "better-opn@npm:3.0.2" @@ -19144,13 +18251,27 @@ __metadata: languageName: node linkType: hard -"big-integer@npm:1.6.x, big-integer@npm:^1.6.51": +"big-integer@npm:1.6.36": + version: 1.6.36 + resolution: "big-integer@npm:1.6.36" + checksum: 961fdd96c847765907e38759053ef4f9e66646739f2e6561087639dce7d1707db180dcb878761bb812a265af600f2d57cc31f5a57645dd790e4bd52c5d28382a + languageName: node + linkType: hard + +"big-integer@npm:1.6.x": version: 1.6.51 resolution: "big-integer@npm:1.6.51" checksum: c7a12640901906d6f6b6bdb42a4eaba9578397b6d9a0dd090cf001ec813ff2bfcd441e364068ea0416db6175d2615f8ed19cff7d1a795115bf7c92d44993f991 languageName: node linkType: hard +"big-integer@npm:^1.6.48": + version: 1.6.52 + resolution: "big-integer@npm:1.6.52" + checksum: 4bc6ae152a96edc9f95020f5fc66b13d26a9ad9a021225a9f0213f7e3dc44269f423aa8c42e19d6ac4a63bb2b22140b95d10be8f9ca7a6d9aa1b22b330d1f514 + languageName: node + linkType: hard + "big.js@npm:^5.2.2": version: 5.2.2 resolution: "big.js@npm:5.2.2" @@ -19265,6 +18386,22 @@ __metadata: languageName: node linkType: hard +"bip66@npm:^1.1.5": + version: 1.1.5 + resolution: "bip66@npm:1.1.5" + dependencies: + safe-buffer: "npm:^5.0.1" + checksum: 6257e90ff2149aa08740ff4009730c1bceb1a3456571d3006a36b39f30044f2973e05f043ea6977046d6ab66e4a8d6f5c9785094f8317f4ff546a325baece1ab + languageName: node + linkType: hard + +"bitcoin-ops@npm:^1.3.0, bitcoin-ops@npm:^1.4.1": + version: 1.4.1 + resolution: "bitcoin-ops@npm:1.4.1" + checksum: 3daa3303d6af49c0727041b5d7801a20c5806d00f1cc1afa2d53099974e30a7b1e7e9e578723dd25f5e120903f2725c595c0205d5d99a6578ad65213d74d806d + languageName: node + linkType: hard + "bl@npm:^1.0.0": version: 1.2.3 resolution: "bl@npm:1.2.3" @@ -19286,7 +18423,19 @@ __metadata: languageName: node linkType: hard -"blakejs@npm:^1.1.0": +"blake-hash@npm:^2.0.0": + version: 2.0.0 + resolution: "blake-hash@npm:2.0.0" + dependencies: + node-addon-api: "npm:^3.0.0" + node-gyp: "npm:latest" + node-gyp-build: "npm:^4.2.2" + readable-stream: "npm:^3.6.0" + checksum: 91cb584c2c98bfeb94f2fe01ab1663577fd8a69c330b03ea071ce53eda8e3e28293da891e3eacd78a95ad1275325cf7055e39294535c0474f297ada373083fd2 + languageName: node + linkType: hard + +"blakejs@npm:^1.1.0, blakejs@npm:^1.2.1": version: 1.2.1 resolution: "blakejs@npm:1.2.1" checksum: 0638b1bd058b21892633929c43005aa6a4cc4b2ac5b338a146c3c076622f1b360795bd7a4d1f077c9b01863ed2df0c1504a81c5b520d164179120434847e6cd7 @@ -19467,7 +18616,7 @@ __metadata: languageName: node linkType: hard -"brorand@npm:^1.0.1, brorand@npm:^1.1.0": +"brorand@npm:^1.0.1, brorand@npm:^1.0.5, brorand@npm:^1.1.0": version: 1.1.0 resolution: "brorand@npm:1.1.0" checksum: 8a05c9f3c4b46572dec6ef71012b1946db6cae8c7bb60ccd4b7dd5a84655db49fe043ecc6272e7ef1f69dc53d6730b9e2a3a03a8310509a3d797a618cbee52be @@ -19618,7 +18767,7 @@ __metadata: languageName: node linkType: hard -"bs58check@npm:<3.0.0, bs58check@npm:^2.1.1, bs58check@npm:^2.1.2": +"bs58check@npm:2.1.2, bs58check@npm:<3.0.0, bs58check@npm:^2.1.1, bs58check@npm:^2.1.2": version: 2.1.2 resolution: "bs58check@npm:2.1.2" dependencies: @@ -19629,6 +18778,16 @@ __metadata: languageName: node linkType: hard +"bs58check@npm:^3.0.1": + version: 3.0.1 + resolution: "bs58check@npm:3.0.1" + dependencies: + "@noble/hashes": "npm:^1.2.0" + bs58: "npm:^5.0.0" + checksum: dbbecc7a09f3836e821149266c864c4bbd545539cea43c35f23f4c3c46b54c86c52b65d224b9ea2e916fa6d93bd2ce9fac5b6c6bfcf19621a9c209a5602f71c8 + languageName: node + linkType: hard + "bser@npm:2.1.1": version: 2.1.1 resolution: "bser@npm:2.1.1" @@ -20048,6 +19207,15 @@ __metadata: languageName: node linkType: hard +"cashaddrjs@npm:0.4.4": + version: 0.4.4 + resolution: "cashaddrjs@npm:0.4.4" + dependencies: + big-integer: "npm:1.6.36" + checksum: f3764cf858938b5087b285e96eb39acf8333ebe67448eab1f5ae04aa1f850f45fdc2dc832fe8b17f6bb360ad8df55d954856facd6f562bd6c3277217e2b61835 + languageName: node + linkType: hard + "caw@npm:^2.0.1": version: 2.0.1 resolution: "caw@npm:2.0.1" @@ -20095,7 +19263,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:4.1.2, chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2, chalk@npm:~4.1.2": +"chalk@npm:4.1.2, chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2": version: 4.1.2 resolution: "chalk@npm:4.1.2" dependencies: @@ -20609,13 +19777,6 @@ __metadata: languageName: node linkType: hard -"code-block-writer@npm:^12.0.0": - version: 12.0.0 - resolution: "code-block-writer@npm:12.0.0" - checksum: 7dc531e652b4654f6e0487923df74cda7294da01c6ac225f523256c6ae5f7f4eb5c4dc7902a9e64b81dba4b22e7d843454ed71a59954d31aa8656184c6c0c8ff - languageName: node - linkType: hard - "collect-v8-coverage@npm:^1.0.0": version: 1.0.1 resolution: "collect-v8-coverage@npm:1.0.1" @@ -21160,18 +20321,6 @@ __metadata: languageName: node linkType: hard -"cosmiconfig@npm:^8.1.0, cosmiconfig@npm:^8.1.3": - version: 8.2.0 - resolution: "cosmiconfig@npm:8.2.0" - dependencies: - import-fresh: "npm:^3.2.1" - js-yaml: "npm:^4.1.0" - parse-json: "npm:^5.0.0" - path-type: "npm:^4.0.0" - checksum: e0b188f9a672ee7135851bf9d9fc8f0ba00f9769c95fda5af0ebc274804f6aeb713b753e04e706f595e1fbd0fa67c5073840666019068c0296a06057560ab39d - languageName: node - linkType: hard - "cosmiconfig@npm:^8.2.0": version: 8.3.6 resolution: "cosmiconfig@npm:8.3.6" @@ -21270,6 +20419,15 @@ __metadata: languageName: node linkType: hard +"cross-fetch@npm:^4.0.0": + version: 4.0.0 + resolution: "cross-fetch@npm:4.0.0" + dependencies: + node-fetch: "npm:^2.6.12" + checksum: e231a71926644ef122d334a3a4e73d9ba3ba4b480a8a277fb9badc434c1ba905b3d60c8034e18b348361a09afbec40ba9371036801ba2b675a7b84588f9f55d8 + languageName: node + linkType: hard + "cross-spawn@npm:^5.1.0": version: 5.1.0 resolution: "cross-spawn@npm:5.1.0" @@ -21859,7 +21017,7 @@ __metadata: languageName: node linkType: hard -"decimal.js@npm:^10.3.1, decimal.js@npm:^10.4.2": +"decimal.js@npm:^10.2.0, decimal.js@npm:^10.3.1, decimal.js@npm:^10.4.2": version: 10.4.3 resolution: "decimal.js@npm:10.4.3" checksum: de663a7bc4d368e3877db95fcd5c87b965569b58d16cdc4258c063d231ca7118748738df17cd638f7e9dd0be8e34cec08d7234b20f1f2a756a52fc5a38b188d0 @@ -22263,15 +21421,6 @@ __metadata: languageName: node linkType: hard -"derive-valtio@npm:0.1.0": - version: 0.1.0 - resolution: "derive-valtio@npm:0.1.0" - peerDependencies: - valtio: "*" - checksum: 3fec351a46cbe2aa37099059e4fc8f518bc4c2c9e9f29cc3e55811fb9ce61f3fc49302196c620705fc5584e5a8e1be629a4269f9903899450099a487ceea8e3b - languageName: node - linkType: hard - "des.js@npm:^1.0.0": version: 1.0.1 resolution: "des.js@npm:1.0.1" @@ -23433,13 +22582,6 @@ __metadata: languageName: node linkType: hard -"escape-string-regexp@npm:2.0.0, escape-string-regexp@npm:^2.0.0": - version: 2.0.0 - resolution: "escape-string-regexp@npm:2.0.0" - checksum: 9f8a2d5743677c16e85c810e3024d54f0c8dea6424fad3c79ef6666e81dd0846f7437f5e729dfcdac8981bc9e5294c39b4580814d114076b8d36318f46ae4395 - languageName: node - linkType: hard - "escape-string-regexp@npm:^1.0.2, escape-string-regexp@npm:^1.0.5": version: 1.0.5 resolution: "escape-string-regexp@npm:1.0.5" @@ -23447,6 +22589,13 @@ __metadata: languageName: node linkType: hard +"escape-string-regexp@npm:^2.0.0": + version: 2.0.0 + resolution: "escape-string-regexp@npm:2.0.0" + checksum: 9f8a2d5743677c16e85c810e3024d54f0c8dea6424fad3c79ef6666e81dd0846f7437f5e729dfcdac8981bc9e5294c39b4580814d114076b8d36318f46ae4395 + languageName: node + linkType: hard + "escape-string-regexp@npm:^4.0.0": version: 4.0.0 resolution: "escape-string-regexp@npm:4.0.0" @@ -23765,13 +22914,6 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-no-relative-import-paths@npm:^1.5.2": - version: 1.5.2 - resolution: "eslint-plugin-no-relative-import-paths@npm:1.5.2" - checksum: 7e507070b7d082e2e418ea263c2a4c3a01acff2d39240410b6002c68c1d53647279c046c04a140fd8b451b5ba79cb9003fc2f48ae0f6e2d9f9e8cee50bc3c6e4 - languageName: node - linkType: hard - "eslint-plugin-node@npm:^11.1.0": version: 11.1.0 resolution: "eslint-plugin-node@npm:11.1.0" @@ -23895,13 +23037,6 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-valtio@npm:^0.6.2": - version: 0.6.2 - resolution: "eslint-plugin-valtio@npm:0.6.2" - checksum: c5190d1720e180ff4bfd60de4b0f1856d09cadfe39325e98b918d77046c0c8cdba04e631e8be8179017f51c05733821998d1e2aa111ffc828e86a4d28f1d5168 - languageName: node - linkType: hard - "eslint-scope@npm:5.1.1": version: 5.1.1 resolution: "eslint-scope@npm:5.1.1" @@ -24171,6 +23306,18 @@ __metadata: languageName: node linkType: hard +"ethereum-cryptography@npm:^2.1.3": + version: 2.1.3 + resolution: "ethereum-cryptography@npm:2.1.3" + dependencies: + "@noble/curves": "npm:1.3.0" + "@noble/hashes": "npm:1.3.3" + "@scure/bip32": "npm:1.3.3" + "@scure/bip39": "npm:1.2.2" + checksum: cc5aa9a4368dc1dd7680ba921957c098ced7b3d7dbb1666334013ab2f8d4cd25a785ad84e66fd9f5c5a9b6de337930ea24ff8c722938f36a9c00cec597ca16b5 + languageName: node + linkType: hard + "ethereumjs-util@npm:^7.1.0": version: 7.1.5 resolution: "ethereumjs-util@npm:7.1.5" @@ -24437,15 +23584,6 @@ __metadata: languageName: node linkType: hard -"expo-application@npm:~5.8.3": - version: 5.8.3 - resolution: "expo-application@npm:5.8.3" - peerDependencies: - expo: "*" - checksum: 5b7d8f3df4cf658a89e62fe25ce00b91c3217bc59115d3a43fd3c4bff38f3c5593568913f59027244196dedeb5766fce98dc58f12bdd30c12581b1b52e51d718 - languageName: node - linkType: hard - "expo-asset@npm:~9.0.2": version: 9.0.2 resolution: "expo-asset@npm:9.0.2" @@ -24460,37 +23598,6 @@ __metadata: languageName: node linkType: hard -"expo-barcode-scanner@npm:~12.9.2": - version: 12.9.2 - resolution: "expo-barcode-scanner@npm:12.9.2" - dependencies: - expo-image-loader: "npm:~4.6.0" - peerDependencies: - expo: "*" - checksum: 9388a721c064d48954f81f9c9f23166f4a62a7aa000cca58edfe362fdfc4f64df8b279769a5be724b8dea679dc5dfa9da1bd08c8ac0eba1ebf98208036b523a8 - languageName: node - linkType: hard - -"expo-camera@npm:~14.0.4": - version: 14.0.4 - resolution: "expo-camera@npm:14.0.4" - dependencies: - invariant: "npm:^2.2.4" - peerDependencies: - expo: "*" - checksum: e69539320b8ca12e8ed2a35dab44a8923cf9901b37a5b9c040a052bc859eb4ed319b250a06711ddbbc3695bac6ce010867d16c3c72fb70ccf7da80f677fbfc5c - languageName: node - linkType: hard - -"expo-clipboard@npm:~5.0.1": - version: 5.0.1 - resolution: "expo-clipboard@npm:5.0.1" - peerDependencies: - expo: "*" - checksum: d3ac75dddcc4c453ae6268ccc63814b333fb81ea4b565c0a02baae1b422dc9c1da581412aa166cf6e1fe82e1660cd0d698f7a11209b5daf013df61a4d60652cc - languageName: node - linkType: hard - "expo-constants@npm:~15.4.0, expo-constants@npm:~15.4.3": version: 15.4.4 resolution: "expo-constants@npm:15.4.4" @@ -24502,86 +23609,6 @@ __metadata: languageName: node linkType: hard -"expo-constants@npm:~15.4.5": - version: 15.4.5 - resolution: "expo-constants@npm:15.4.5" - dependencies: - "@expo/config": "npm:~8.5.0" - peerDependencies: - expo: "*" - checksum: 9eb256895aa24efd41ca8c48b7dd76c03ecad4662e86c32440ea7d4162397014c80775b73db499add5e9452721f236c6ba333af93d8a277ad964f1fd938305f1 - languageName: node - linkType: hard - -"expo-crypto@npm:~12.8.0": - version: 12.8.0 - resolution: "expo-crypto@npm:12.8.0" - dependencies: - base64-js: "npm:^1.3.0" - peerDependencies: - expo: "*" - checksum: a9c77d0dbd82f8e791a1a5216fcc4775d0b88b1bf1a49fc5c8448c3350029c5c5b1b7f62e6c9ce6b3fb54b72b88f70bc5243d18ec32e28e6fe264d2cb7e52d50 - languageName: node - linkType: hard - -"expo-dev-client@npm:~3.3.8": - version: 3.3.8 - resolution: "expo-dev-client@npm:3.3.8" - dependencies: - expo-dev-launcher: "npm:3.6.6" - expo-dev-menu: "npm:4.5.5" - expo-dev-menu-interface: "npm:1.7.2" - expo-manifests: "npm:~0.13.0" - expo-updates-interface: "npm:~0.15.1" - peerDependencies: - expo: "*" - checksum: 8f37117ceb767b51d442b6895f0ed8a76a719a5b4084e1f081d6711e2a02b0414405514e360ca4696e4916cc1fd9d019b7559200fc35a811a05526db356e60fb - languageName: node - linkType: hard - -"expo-dev-launcher@npm:3.6.6": - version: 3.6.6 - resolution: "expo-dev-launcher@npm:3.6.6" - dependencies: - ajv: "npm:8.11.0" - expo-dev-menu: "npm:4.5.5" - expo-manifests: "npm:~0.13.0" - resolve-from: "npm:^5.0.0" - semver: "npm:^7.5.3" - peerDependencies: - expo: "*" - checksum: 143cad2bda5d8f82f1f7388ac98f9123d3ad4aea6c0a76d2ca5bb2b5beb48c433b782c732eb695d465f43bb339c3c2c1c09f42cb2ce9d6f1f0110f8aadec6515 - languageName: node - linkType: hard - -"expo-dev-menu-interface@npm:1.7.2": - version: 1.7.2 - resolution: "expo-dev-menu-interface@npm:1.7.2" - peerDependencies: - expo: "*" - checksum: 28df663590af53ec35014e934f61b61113f9acfdefa11dfded9be98a6f3875e32cd25750a6e1e1cccccef3ec6cc3faf08a2bf61ef02c6950e50327d1e01b84b3 - languageName: node - linkType: hard - -"expo-dev-menu@npm:4.5.5": - version: 4.5.5 - resolution: "expo-dev-menu@npm:4.5.5" - dependencies: - expo-dev-menu-interface: "npm:1.7.2" - semver: "npm:^7.5.3" - peerDependencies: - expo: "*" - checksum: 7389c9a8d00edee6d2490ff4f72117a9dddd22dffa8bc10a2f532e6c0008f82d911d5a8bb0bff20531e0383795f601197233db31c1798e6e00524548af4899f0 - languageName: node - linkType: hard - -"expo-eas-client@npm:~0.11.0": - version: 0.11.1 - resolution: "expo-eas-client@npm:0.11.1" - checksum: b36fd4d7366874f3795f7e4caa408c6832f6c992da5b5b78b72a26d9f59e7b98fc6e021ff7c7e496ec847dfed142fc20bd81fce5209644ae62f9ec7fd06520df - languageName: node - linkType: hard - "expo-file-system@npm:~16.0.0": version: 16.0.3 resolution: "expo-file-system@npm:16.0.3" @@ -24611,24 +23638,6 @@ __metadata: languageName: node linkType: hard -"expo-haptics@npm:~12.8.1": - version: 12.8.1 - resolution: "expo-haptics@npm:12.8.1" - peerDependencies: - expo: "*" - checksum: 62caee68d368c95ec91d0477c14ff538d66bb0c4707521153fc0ff396b72289fda158cd3858edb710f8a65ed9633709f9909af202506007da299813241bdff0b - languageName: node - linkType: hard - -"expo-image-loader@npm:~4.6.0": - version: 4.6.0 - resolution: "expo-image-loader@npm:4.6.0" - peerDependencies: - expo: "*" - checksum: 02981667f03dc429cd9db37e0acc302e4a0c4bb5875dc087b1c26388ef64563481e52dddc1d42dd32794eb7051d1acf5bc0c078413469c29025a02d4d4af1154 - languageName: node - linkType: hard - "expo-image@npm:~1.10.6": version: 1.10.6 resolution: "expo-image@npm:1.10.6" @@ -24640,13 +23649,6 @@ __metadata: languageName: node linkType: hard -"expo-json-utils@npm:~0.12.0": - version: 0.12.2 - resolution: "expo-json-utils@npm:0.12.2" - checksum: 61f3cd5cdbf57b7d19e8e5838dbf27a2eb42367dca011a308c06b025c37c697007c4813f444ea3f9627758114b03390ec367eb632a4f1d6ff182b0c7fc345be0 - languageName: node - linkType: hard - "expo-keep-awake@npm:~12.8.2": version: 12.8.2 resolution: "expo-keep-awake@npm:12.8.2" @@ -24666,49 +23668,6 @@ __metadata: languageName: node linkType: hard -"expo-local-authentication@npm:~13.8.0": - version: 13.8.0 - resolution: "expo-local-authentication@npm:13.8.0" - dependencies: - invariant: "npm:^2.2.4" - peerDependencies: - expo: "*" - checksum: 06ad68d96831058e51115fa398479faba9b4059564ecc44ee7eef739be7c5df1c632ec0138e008549dc2e7cd4a8eed9830d30ffb8ae97431e17f7ab8b2d55f87 - languageName: node - linkType: hard - -"expo-localization@npm:~14.8.3": - version: 14.8.3 - resolution: "expo-localization@npm:14.8.3" - dependencies: - rtl-detect: "npm:^1.0.2" - peerDependencies: - expo: "*" - checksum: 8a1c2b4413fde550778b8ed469b4c292b3c66264edede70534bdb468605e3dc092de5894cd634a96a8abfeddc23517ee3e4231a8943117d5619a705c0e59ef03 - languageName: node - linkType: hard - -"expo-manifests@npm:~0.13.0": - version: 0.13.1 - resolution: "expo-manifests@npm:0.13.1" - dependencies: - "@expo/config": "npm:~8.5.0" - expo-json-utils: "npm:~0.12.0" - peerDependencies: - expo: "*" - checksum: bcb5feb7b3fbe714a8ea3acd470588aacb8e161238097cba69060c831f55f13c0f5dd064a81be18c5b8a7e87bd894acd0cbc159a464f0ba696cb506556b565a0 - languageName: node - linkType: hard - -"expo-media-library@npm:~15.9.1": - version: 15.9.1 - resolution: "expo-media-library@npm:15.9.1" - peerDependencies: - expo: "*" - checksum: ddd21a2c380618a9dcb7c734c22f9deec70187aa5f9195011149fb72ef807dd3c32eb8ce7b4ecfa1b943f2db75a18bb831f073f90bbe247d2c1dd3233961648f - languageName: node - linkType: hard - "expo-module-scripts@npm:^3.1.0": version: 3.4.0 resolution: "expo-module-scripts@npm:3.4.0" @@ -24787,15 +23746,6 @@ __metadata: languageName: node linkType: hard -"expo-screen-orientation@npm:~6.4.1": - version: 6.4.1 - resolution: "expo-screen-orientation@npm:6.4.1" - peerDependencies: - expo: "*" - checksum: 6818c50bfe3da747fe42b574e028b030d31232efd35d6c5c049f5c6272464188bea04191702e661c599dc59f7fe70252129964ae8d353385121c971b8c79343f - languageName: node - linkType: hard - "expo-secure-store@npm:^11.2.0": version: 11.3.0 resolution: "expo-secure-store@npm:11.3.0" @@ -24814,63 +23764,6 @@ __metadata: languageName: node linkType: hard -"expo-splash-screen@npm:~0.26.4": - version: 0.26.4 - resolution: "expo-splash-screen@npm:0.26.4" - dependencies: - "@expo/prebuild-config": "npm:6.7.4" - peerDependencies: - expo: "*" - checksum: 1ec3f5440da735542a73ef3355e71b56089d817141cda88cd01dc31bac1a286ee784d367e6e436269260f4537a3c761e5182af8eb8c5b1db1b8d8f35cd1377d9 - languageName: node - linkType: hard - -"expo-status-bar@npm:~1.11.1": - version: 1.11.1 - resolution: "expo-status-bar@npm:1.11.1" - checksum: f2c9d51fd5211520d0a53df69310f1b0a1b40c935ded24a267ff23becaf0dfb19517440ab3b1ff8c4adda651e99dafef681c055a1efe397df68056667dde2512 - languageName: node - linkType: hard - -"expo-structured-headers@npm:~3.7.0": - version: 3.7.1 - resolution: "expo-structured-headers@npm:3.7.1" - checksum: a57911c5b9f40024d41a18d63f660c8a49363456dba7db6701cf810324d6b16ce8264f235bdcef8b14596353a6f8c85af3edf68b7c9c297f16637b02f3757b3e - languageName: node - linkType: hard - -"expo-updates-interface@npm:~0.15.1": - version: 0.15.2 - resolution: "expo-updates-interface@npm:0.15.2" - peerDependencies: - expo: "*" - checksum: e65942b59c284cc7b93942769ab3f0b467d9cf87c0fb7d4ba84e27650928d470e78f88e16aa3c928e6b1d09fdb39ae3f5a28db12e279340f4b04da7ab9489b1d - languageName: node - linkType: hard - -"expo-updates@npm:~0.24.10": - version: 0.24.10 - resolution: "expo-updates@npm:0.24.10" - dependencies: - "@expo/code-signing-certificates": "npm:0.0.5" - "@expo/config": "npm:~8.5.0" - "@expo/config-plugins": "npm:~7.8.0" - arg: "npm:4.1.0" - chalk: "npm:^4.1.2" - expo-eas-client: "npm:~0.11.0" - expo-manifests: "npm:~0.13.0" - expo-structured-headers: "npm:~3.7.0" - expo-updates-interface: "npm:~0.15.1" - fbemitter: "npm:^3.0.0" - resolve-from: "npm:^5.0.0" - peerDependencies: - expo: "*" - bin: - expo-updates: bin/cli.js - checksum: 510fe79fc830c8c3de7a7d280a65ace50575b5558dfb17c61f2ff3858d86936a0ef5f642f7fb67103c3228c2179de4b836b0e862b4838fd0256c19e5059e3389 - languageName: node - linkType: hard - "expo@npm:~50.0.6": version: 50.0.6 resolution: "expo@npm:50.0.6" @@ -25144,13 +24037,6 @@ __metadata: languageName: node linkType: hard -"fastestsmallesttextencoderdecoder@npm:^1.0.22": - version: 1.0.22 - resolution: "fastestsmallesttextencoderdecoder@npm:1.0.22" - checksum: 774f759fcb01196e9a66db7cd21f39741e2ad33317b69b27dc1a32ff13a3ca4780fdb6d71f32a1fc2085064cb4ba06556843328bbacc61f8399d78880f4c0e67 - languageName: node - linkType: hard - "fastq@npm:^1.6.0": version: 1.15.0 resolution: "fastq@npm:1.15.0" @@ -25368,16 +24254,6 @@ __metadata: languageName: node linkType: hard -"find-babel-config@npm:^2.0.0": - version: 2.0.0 - resolution: "find-babel-config@npm:2.0.0" - dependencies: - json5: "npm:^2.1.1" - path-exists: "npm:^4.0.0" - checksum: 06e50e920a2b35ff1c90fe33382e48aae70db4bdb6bbb58a4fdb5e687b50074e8b791a8ef2d9bb4b582c8d624d34b0cc763613c7cb585eeb352cd4521976f35a - languageName: node - linkType: hard - "find-cache-dir@npm:^2.0.0": version: 2.1.0 resolution: "find-cache-dir@npm:2.1.0" @@ -25531,13 +24407,6 @@ __metadata: languageName: node linkType: hard -"flatted@npm:^3.2.9": - version: 3.2.9 - resolution: "flatted@npm:3.2.9" - checksum: dc2b89e46a2ebde487199de5a4fcb79e8c46f984043fea5c41dbf4661eb881fefac1c939b5bdcd8a09d7f960ec364f516970c7ec44e58ff451239c07fd3d419b - languageName: node - linkType: hard - "flow-enums-runtime@npm:^0.0.6": version: 0.0.6 resolution: "flow-enums-runtime@npm:0.0.6" @@ -26215,7 +25084,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^8.0.1, glob@npm:^8.0.3": +"glob@npm:^8.0.1": version: 8.1.0 resolution: "glob@npm:8.1.0" dependencies: @@ -26466,31 +25335,6 @@ __metadata: languageName: node linkType: hard -"graphql-config@npm:^5.0.2": - version: 5.0.2 - resolution: "graphql-config@npm:5.0.2" - dependencies: - "@graphql-tools/graphql-file-loader": "npm:^8.0.0" - "@graphql-tools/json-file-loader": "npm:^8.0.0" - "@graphql-tools/load": "npm:^8.0.0" - "@graphql-tools/merge": "npm:^9.0.0" - "@graphql-tools/url-loader": "npm:^8.0.0" - "@graphql-tools/utils": "npm:^10.0.0" - cosmiconfig: "npm:^8.1.0" - jiti: "npm:^1.18.2" - minimatch: "npm:^4.2.3" - string-env-interpolation: "npm:^1.0.1" - tslib: "npm:^2.4.0" - peerDependencies: - cosmiconfig-toml-loader: ^1.0.0 - graphql: ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - peerDependenciesMeta: - cosmiconfig-toml-loader: - optional: true - checksum: 668f177e8c36e482b246ec84e10e0e9d7f29e51b519828d22866c724500cf2cc075a07e4d5d5f057df9eaa189550d485072d3814b15ff0b383367e0fa92f8bbf - languageName: node - linkType: hard - "graphql-request@npm:^6.0.0": version: 6.0.0 resolution: "graphql-request@npm:6.0.0" @@ -26523,15 +25367,6 @@ __metadata: languageName: node linkType: hard -"graphql-ws@npm:5.13.1": - version: 5.13.1 - resolution: "graphql-ws@npm:5.13.1" - peerDependencies: - graphql: ">=0.11 <=16" - checksum: 5d804aa9c4e724e117f00ffc783c3c9701b55bdfd76489d69c2e5064a351cfa7117f85b24ffea1b7b0b96ad584f950b87588902d0db2ef532f229f106b142f24 - languageName: node - linkType: hard - "graphql@npm:15.8.0": version: 15.8.0 resolution: "graphql@npm:15.8.0" @@ -26539,13 +25374,6 @@ __metadata: languageName: node linkType: hard -"graphql@npm:^16.6.0": - version: 16.6.0 - resolution: "graphql@npm:16.6.0" - checksum: f2ce5fdd5e1d8f66b40143b791e1063efe50b17071e0b06b30b8cd597a7fc08135d606586935db7e65dbd5ebbf207cd2f9b56c9c5cf4ad818f080d98f47282a4 - languageName: node - linkType: hard - "graphql@npm:^16.8.1": version: 16.8.1 resolution: "graphql@npm:16.8.1" @@ -27114,16 +25942,6 @@ __metadata: languageName: node linkType: hard -"http-proxy-agent@npm:^7.0.0": - version: 7.0.0 - resolution: "http-proxy-agent@npm:7.0.0" - dependencies: - agent-base: "npm:^7.1.0" - debug: "npm:^4.3.4" - checksum: dbaaf3d9f3fc4df4a5d7ec45d456ec50f575240b557160fa63427b447d1f812dd7fe4a4f17d2e1ba003d231f07edf5a856ea6d91cb32d533062ff20a7803ccac - languageName: node - linkType: hard - "http-proxy-middleware@npm:^2.0.3": version: 2.0.6 resolution: "http-proxy-middleware@npm:2.0.6" @@ -27180,16 +25998,6 @@ __metadata: languageName: node linkType: hard -"https-proxy-agent@npm:^7.0.0": - version: 7.0.0 - resolution: "https-proxy-agent@npm:7.0.0" - dependencies: - agent-base: "npm:^7.0.2" - debug: "npm:4" - checksum: 82faa9c9fc6093cdec13a248a4b5a607ea5cc9e0f9a2416d206dc1563dbd6816fb59ca06b5a882a2cb908d97e2f127db2ecbbded1eb261422f6b146ccc563f58 - languageName: node - linkType: hard - "human-signals@npm:^2.1.0": version: 2.1.0 resolution: "human-signals@npm:2.1.0" @@ -27451,6 +26259,13 @@ __metadata: languageName: node linkType: hard +"int64-buffer@npm:^1.0.1": + version: 1.0.1 + resolution: "int64-buffer@npm:1.0.1" + checksum: 63e358d0c12a7c80bb478519e80af016d2d67a9e9397456bec0ef9c7239a3e15e3c206c6501ed899527c4ea8c058d9773afc35646b7e40688f956842062610f8 + languageName: node + linkType: hard + "internal-ip@npm:4.3.0": version: 4.3.0 resolution: "internal-ip@npm:4.3.0" @@ -27503,7 +26318,7 @@ __metadata: languageName: node linkType: hard -"invariant@npm:2, invariant@npm:2.2.4, invariant@npm:^2.2.2, invariant@npm:^2.2.4": +"invariant@npm:2, invariant@npm:^2.2.2, invariant@npm:^2.2.4": version: 2.2.4 resolution: "invariant@npm:2.2.4" dependencies: @@ -27512,6 +26327,16 @@ __metadata: languageName: node linkType: hard +"ip-address@npm:^9.0.5": + version: 9.0.5 + resolution: "ip-address@npm:9.0.5" + dependencies: + jsbn: "npm:1.1.0" + sprintf-js: "npm:^1.1.3" + checksum: 1ed81e06721af012306329b31f532b5e24e00cb537be18ddc905a84f19fe8f83a09a1699862bf3a1ec4b9dea93c55a3fa5faf8b5ea380431469df540f38b092c + languageName: node + linkType: hard + "ip-regex@npm:^2.1.0": version: 2.1.0 resolution: "ip-regex@npm:2.1.0" @@ -29707,7 +28532,7 @@ __metadata: languageName: node linkType: hard -"jiti@npm:^1.17.1, jiti@npm:^1.18.2": +"jiti@npm:^1.17.1": version: 1.18.2 resolution: "jiti@npm:1.18.2" bin: @@ -29808,6 +28633,13 @@ __metadata: languageName: node linkType: hard +"jsbn@npm:1.1.0": + version: 1.1.0 + resolution: "jsbn@npm:1.1.0" + checksum: bebe7ae829bbd586ce8cbe83501dd8cb8c282c8902a8aeeed0a073a89dc37e8103b1244f3c6acd60278bcbfe12d93a3f83c9ac396868a3b3bbc3c5e5e3b648ef + languageName: node + linkType: hard + "jsc-android@npm:^250231.0.0": version: 250231.0.0 resolution: "jsc-android@npm:250231.0.0" @@ -30050,6 +28882,18 @@ __metadata: languageName: node linkType: hard +"json-stable-stringify@npm:^1.0.2": + version: 1.1.1 + resolution: "json-stable-stringify@npm:1.1.1" + dependencies: + call-bind: "npm:^1.0.5" + isarray: "npm:^2.0.5" + jsonify: "npm:^0.0.1" + object-keys: "npm:^1.1.1" + checksum: 60853c1f63451319b5c7953465a555aa816cf84e60e3ca36b6c05225d8fdc4615127fb4ecb92f9f5ad880c552ab8cbae9a519f78b995e7788d6d89e57afafdeb + languageName: node + linkType: hard + "json-stringify-safe@npm:5, json-stringify-safe@npm:^5.0.1": version: 5.0.1 resolution: "json-stringify-safe@npm:5.0.1" @@ -30078,7 +28922,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.1.1, json5@npm:^2.1.2, json5@npm:^2.2.0, json5@npm:^2.2.1, json5@npm:^2.2.2, json5@npm:^2.2.3": +"json5@npm:^2.1.2, json5@npm:^2.2.0, json5@npm:^2.2.1, json5@npm:^2.2.2, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -30126,6 +28970,13 @@ __metadata: languageName: node linkType: hard +"jsonschema@npm:1.2.2": + version: 1.2.2 + resolution: "jsonschema@npm:1.2.2" + checksum: aa778e23f1ff879345dabee968c2d7b36d39fe60bb0aa0d251e60d18aed7038499fb203be6c06f4185b0a301b5b187295a46a0a139f19be17b50b6c04b48193d + languageName: node + linkType: hard + "jss-plugin-camel-case@npm:^10.10.0": version: 10.10.0 resolution: "jss-plugin-camel-case@npm:10.10.0" @@ -30578,15 +29429,6 @@ __metadata: languageName: node linkType: hard -"lie@npm:3.1.1": - version: 3.1.1 - resolution: "lie@npm:3.1.1" - dependencies: - immediate: "npm:~3.0.5" - checksum: c2c7d9dcc3a9aae641f41cde4e2e2cd571e4426b1f5915862781d77776672dcbca43461e16f4d382c9a300825c15e1a4923f1def3a5568d97577e077a3cecb44 - languageName: node - linkType: hard - "lie@npm:~3.3.0": version: 3.3.0 resolution: "lie@npm:3.3.0" @@ -30929,15 +29771,6 @@ __metadata: languageName: node linkType: hard -"localforage@npm:^1.8.1": - version: 1.10.0 - resolution: "localforage@npm:1.10.0" - dependencies: - lie: "npm:3.1.1" - checksum: d5c44be3a09169b013a3ebe252e678aaeb6938ffe72e9e12c199fd4307c1ec9d1a057ac2dfdfbb1379dfeec467a34ad0fc3ecd27489a2c43a154fb72b2822542 - languageName: node - linkType: hard - "locate-path@npm:^3.0.0": version: 3.0.0 resolution: "locate-path@npm:3.0.0" @@ -31001,7 +29834,7 @@ __metadata: languageName: node linkType: hard -"lodash.debounce@npm:4.0.8, lodash.debounce@npm:^4.0.8": +"lodash.debounce@npm:^4.0.8": version: 4.0.8 resolution: "lodash.debounce@npm:4.0.8" checksum: cd0b2819786e6e80cb9f5cda26b1a8fc073daaf04e48d4cb462fa4663ec9adb3a5387aa22d7129e48eed1afa05b482e2a6b79bfc99b86886364449500cbb00fd @@ -31154,6 +29987,20 @@ __metadata: languageName: node linkType: hard +"long@npm:^4.0.0": + version: 4.0.0 + resolution: "long@npm:4.0.0" + checksum: 8296e2ba7bab30f9cfabb81ebccff89c819af6a7a78b4bb5a70ea411aa764ee0532f7441381549dfa6a1a98d72abe9138bfcf99f4fa41238629849bc035b845b + languageName: node + linkType: hard + +"long@npm:^5.0.0": + version: 5.2.3 + resolution: "long@npm:5.2.3" + checksum: 9167ec6947a825b827c30da169a7384eec6c0c9ec2f0b9c74da2e93d81159bbe39fb09c3f13dae9721d4b807ccfa09797a7dd1012f5d478e3e33ca3c78b608e6 + languageName: node + linkType: hard + "loose-envify@npm:^1.0.0, loose-envify@npm:^1.1.0, loose-envify@npm:^1.4.0": version: 1.4.0 resolution: "loose-envify@npm:1.4.0" @@ -32093,7 +30940,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:4.2.3, minimatch@npm:^4.2.3": +"minimatch@npm:4.2.3": version: 4.2.3 resolution: "minimatch@npm:4.2.3" dependencies: @@ -32120,7 +30967,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^7.4.3, minimatch@npm:^7.4.6": +"minimatch@npm:^7.4.6": version: 7.4.6 resolution: "minimatch@npm:7.4.6" dependencies: @@ -32260,15 +31107,6 @@ __metadata: languageName: node linkType: hard -"mkdirp@npm:^2.1.6": - version: 2.1.6 - resolution: "mkdirp@npm:2.1.6" - bin: - mkdirp: dist/cjs/src/bin.js - checksum: 4672fadb94dca8d2eafeb6fff53f2c5ea74e885565ef23251791709064f216105167c2387088c61ef068901bd0776648999785e341d74728164fa551b1c65996 - languageName: node - linkType: hard - "mnemonics@workspace:examples/xnft/mnemonics": version: 0.0.0-use.local resolution: "mnemonics@workspace:examples/xnft/mnemonics" @@ -32726,7 +31564,7 @@ __metadata: languageName: node linkType: hard -"node-addon-api@npm:^3.2.1": +"node-addon-api@npm:^3.0.0, node-addon-api@npm:^3.2.1": version: 3.2.1 resolution: "node-addon-api@npm:3.2.1" dependencies: @@ -32762,6 +31600,15 @@ __metadata: languageName: node linkType: hard +"node-addon-api@npm:^7.0.0": + version: 7.1.0 + resolution: "node-addon-api@npm:7.1.0" + dependencies: + node-gyp: "npm:latest" + checksum: e20487e98c76660f4957e81e85c45dfb667140d9be0bf872a3b3dfd86b4ea19c0275939116c90efebc0da7fc6af2c7b7b060512ceebe6417b1ed145a26910453 + languageName: node + linkType: hard + "node-dir@npm:^0.1.17": version: 0.1.17 resolution: "node-dir@npm:0.1.17" @@ -32806,6 +31653,20 @@ __metadata: languageName: node linkType: hard +"node-fetch@npm:^2.6.12": + version: 2.7.0 + resolution: "node-fetch@npm:2.7.0" + dependencies: + whatwg-url: "npm:^5.0.0" + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + checksum: b24f8a3dc937f388192e59bcf9d0857d7b6940a2496f328381641cb616efccc9866e89ec43f2ec956bbd6c3d3ee05524ce77fe7b29ccd34692b3a16f237d6676 + languageName: node + linkType: hard + "node-forge@npm:^1, node-forge@npm:^1.2.1, node-forge@npm:^1.3.1": version: 1.3.1 resolution: "node-forge@npm:1.3.1" @@ -32870,6 +31731,17 @@ __metadata: languageName: node linkType: hard +"node-gyp-build@npm:^4.2.2, node-gyp-build@npm:^4.5.0": + version: 4.8.0 + resolution: "node-gyp-build@npm:4.8.0" + bin: + node-gyp-build: bin.js + node-gyp-build-optional: optional.js + node-gyp-build-test: build-test.js + checksum: 80f410ab412df38e84171d3634a5716b6c6f14ecfa4eb971424d289381fb76f8bcbe1b666419ceb2c81060e558fd7c6d70cc0f60832bcca6a1559098925d9657 + languageName: node + linkType: hard + "node-gyp@npm:latest": version: 9.3.1 resolution: "node-gyp@npm:9.3.1" @@ -33542,13 +32414,6 @@ __metadata: languageName: node linkType: hard -"p-debounce@npm:^4.0.0": - version: 4.0.0 - resolution: "p-debounce@npm:4.0.0" - checksum: 7f796f6ed264cb964b83601e70c4c0d94dd52d54e1361400ee80df7527217a59074aa14ab746d4d3089b352181c4ffb5329158fd679cb4b4b52c208574e9e56d - languageName: node - linkType: hard - "p-event@npm:^2.1.0": version: 2.3.1 resolution: "p-event@npm:2.3.1" @@ -34160,15 +33025,6 @@ __metadata: languageName: node linkType: hard -"pkg-up@npm:^3.1.0": - version: 3.1.0 - resolution: "pkg-up@npm:3.1.0" - dependencies: - find-up: "npm:^3.0.0" - checksum: 5bac346b7c7c903613c057ae3ab722f320716199d753f4a7d053d38f2b5955460f3e6ab73b4762c62fd3e947f58e04f1343e92089e7bb6091c90877406fcd8c8 - languageName: node - linkType: hard - "please-upgrade-node@npm:^3.2.0": version: 3.2.0 resolution: "please-upgrade-node@npm:3.2.0" @@ -34927,7 +33783,7 @@ __metadata: languageName: node linkType: hard -"progress@npm:2.0.3, progress@npm:^2.0.3": +"progress@npm:2.0.3": version: 2.0.3 resolution: "progress@npm:2.0.3" checksum: e6f0bcb71f716eee9dfac0fe8a2606e3704d6a64dd93baaf49fbadbc8499989a610fe14cf1bc6f61b6d6653c49408d94f4a94e124538084efd8e4cf525e0293d @@ -34979,7 +33835,7 @@ __metadata: languageName: node linkType: hard -"prop-types@npm:15.8.1, prop-types@npm:^15.5.10, prop-types@npm:^15.6.2, prop-types@npm:^15.7.2, prop-types@npm:^15.8.1": +"prop-types@npm:^15.5.10, prop-types@npm:^15.6.2, prop-types@npm:^15.7.2, prop-types@npm:^15.8.1": version: 15.8.1 resolution: "prop-types@npm:15.8.1" dependencies: @@ -34997,6 +33853,26 @@ __metadata: languageName: node linkType: hard +"protobufjs@npm:7.2.5": + version: 7.2.5 + resolution: "protobufjs@npm:7.2.5" + dependencies: + "@protobufjs/aspromise": "npm:^1.1.2" + "@protobufjs/base64": "npm:^1.1.2" + "@protobufjs/codegen": "npm:^2.0.4" + "@protobufjs/eventemitter": "npm:^1.1.0" + "@protobufjs/fetch": "npm:^1.1.0" + "@protobufjs/float": "npm:^1.0.2" + "@protobufjs/inquire": "npm:^1.1.0" + "@protobufjs/path": "npm:^1.1.2" + "@protobufjs/pool": "npm:^1.1.0" + "@protobufjs/utf8": "npm:^1.1.0" + "@types/node": "npm:>=13.7.0" + long: "npm:^5.0.0" + checksum: 6c5aa62b61dff843f585f3acd9cb7a82d566de2dbf167a300b39afee91b04298c4b4aec61354b7c00308b40596f5f3f4b07d6246cfb4ee0abeaea25101033315 + languageName: node + linkType: hard + "proxy-addr@npm:~2.0.7": version: 2.0.7 resolution: "proxy-addr@npm:2.0.7" @@ -35007,13 +33883,6 @@ __metadata: languageName: node linkType: hard -"proxy-compare@npm:2.5.1": - version: 2.5.1 - resolution: "proxy-compare@npm:2.5.1" - checksum: 64b6277d08d89f0b2c468a84decf43f82a4e88da7075651e6adebc69d1b87fadc17cfeb43c024c00b65faa3f0908f7ac1e61f5f6849a404a547a742e6aa527a6 - languageName: node - linkType: hard - "proxy-from-env@npm:^1.1.0": version: 1.1.0 resolution: "proxy-from-env@npm:1.1.0" @@ -35098,6 +33967,15 @@ __metadata: languageName: node linkType: hard +"pushdata-bitcoin@npm:^1.0.1": + version: 1.0.1 + resolution: "pushdata-bitcoin@npm:1.0.1" + dependencies: + bitcoin-ops: "npm:^1.3.0" + checksum: 963fb0b61258e7654d6e3e34e68c8672bc3fdbd154da0a9af0482d2b7b9e9227b11bc17a39f42003f92e996cb552395e903d369347c840381a356964cf553967 + languageName: node + linkType: hard + "pvtsutils@npm:^1.3.2": version: 1.3.2 resolution: "pvtsutils@npm:1.3.2" @@ -35114,13 +33992,6 @@ __metadata: languageName: node linkType: hard -"qr.js@npm:0.0.0": - version: 0.0.0 - resolution: "qr.js@npm:0.0.0" - checksum: a05943d13cbc478e48935de8669b72312fe02de05057c35ebfab59a574c084530a9afb9ee651d53c8c870a54f9ec93ea7b63231de202740ce16a71c797e37ce9 - languageName: node - linkType: hard - "qrcode-terminal@npm:0.11.0": version: 0.11.0 resolution: "qrcode-terminal@npm:0.11.0" @@ -35419,7 +34290,7 @@ __metadata: languageName: node linkType: hard -"react-error-boundary@npm:^4.0.4, react-error-boundary@npm:^4.0.9": +"react-error-boundary@npm:^4.0.9": version: 4.0.9 resolution: "react-error-boundary@npm:4.0.9" dependencies: @@ -35446,15 +34317,6 @@ __metadata: languageName: node linkType: hard -"react-hook-form@npm:^7.40.0": - version: 7.45.1 - resolution: "react-hook-form@npm:7.45.1" - peerDependencies: - react: ^16.8.0 || ^17 || ^18 - checksum: 09efe9876deb072b0ecc716f792e6e0f4a5198150b0fbcacc03bf122ade180bb7f5cec715b4d4eff8d4b44955a8a7b8fb737b7006d90922ca18ff0a094c7a558 - languageName: node - linkType: hard - "react-i18next@npm:^13.0.2": version: 13.0.2 resolution: "react-i18next@npm:13.0.2" @@ -35508,28 +34370,6 @@ __metadata: languageName: node linkType: hard -"react-native-ble-plx@npm:^3.1.2": - version: 3.1.2 - resolution: "react-native-ble-plx@npm:3.1.2" - dependencies: - "@expo/config-plugins": "npm:^7.2.5" - peerDependencies: - react: "*" - react-native: "*" - checksum: 75e3960fcc8c236d0e39fe07a5abd10f617ae8e1cd4114e2179d0e33876aad0932ce229a39e768914f859b5029445b4e44e21e03d5f031cb680f9eee060e9f43 - languageName: node - linkType: hard - -"react-native-date-picker@npm:^4.3.3": - version: 4.3.3 - resolution: "react-native-date-picker@npm:4.3.3" - peerDependencies: - react: ">= 17.0.1" - react-native: ">= 0.64.3" - checksum: 10fa62ab702a72e252c2b8d9b3f6b6ab4738cffabfb6ea679993a384b49ccdae0320b6dc87421ecacd641fd8c67bacfabf51617916f3168612bdcf6054f811c1 - languageName: node - linkType: hard - "react-native-gesture-handler@npm:~2.14.0": version: 2.14.1 resolution: "react-native-gesture-handler@npm:2.14.1" @@ -35546,37 +34386,6 @@ __metadata: languageName: node linkType: hard -"react-native-pager-view@npm:6.2.3": - version: 6.2.3 - resolution: "react-native-pager-view@npm:6.2.3" - peerDependencies: - react: "*" - react-native: "*" - checksum: 9c08c9ffc27f3b6069f23d24ba5c1073a55fb67db4a45bcf490e544a37f26a9cfe7ad72259543f71f3f78a1fb26c78f711c076d905389d599c69c43fe29b7a67 - languageName: node - linkType: hard - -"react-native-reanimated@npm:~3.6.2": - version: 3.6.2 - resolution: "react-native-reanimated@npm:3.6.2" - dependencies: - "@babel/plugin-transform-object-assign": "npm:^7.16.7" - "@babel/preset-typescript": "npm:^7.16.7" - convert-source-map: "npm:^2.0.0" - invariant: "npm:^2.2.4" - peerDependencies: - "@babel/core": ^7.0.0-0 - "@babel/plugin-proposal-nullish-coalescing-operator": ^7.0.0-0 - "@babel/plugin-proposal-optional-chaining": ^7.0.0-0 - "@babel/plugin-transform-arrow-functions": ^7.0.0-0 - "@babel/plugin-transform-shorthand-properties": ^7.0.0-0 - "@babel/plugin-transform-template-literals": ^7.0.0-0 - react: "*" - react-native: "*" - checksum: 06c44d4dde054e48e1d030369e93e7590b8c56b6bc80f90e03f2deb9766dad8b96bf60b2c1406abf5bb424a78bc3a89d6274d5aba7d2ff89781357a23381a0a6 - languageName: node - linkType: hard - "react-native-safe-area-context@npm:4.8.2": version: 4.8.2 resolution: "react-native-safe-area-context@npm:4.8.2" @@ -35626,17 +34435,6 @@ __metadata: languageName: node linkType: hard -"react-native-url-polyfill@npm:^1.3.0": - version: 1.3.0 - resolution: "react-native-url-polyfill@npm:1.3.0" - dependencies: - whatwg-url-without-unicode: "npm:8.0.0-3" - peerDependencies: - react-native: "*" - checksum: e2dcfc11744ab16e841c44d037062dee971cf1387cfc20dd610f175e53eb8c203a1c9d9f0df3570605371560f3e64f6f078f31409846fa1c68dfd316b168df33 - languageName: node - linkType: hard - "react-native-web-internals@npm:1.76.0": version: 1.76.0 resolution: "react-native-web-internals@npm:1.76.0" @@ -35705,19 +34503,6 @@ __metadata: languageName: node linkType: hard -"react-native-webview@npm:13.6.4": - version: 13.6.4 - resolution: "react-native-webview@npm:13.6.4" - dependencies: - escape-string-regexp: "npm:2.0.0" - invariant: "npm:2.2.4" - peerDependencies: - react: "*" - react-native: "*" - checksum: 54cdecbc12de82b5442c376864830b13f5faff25c1041e4eeded9f1afc6921a69abb56cd448a709e89dc3840bde2183a082cd6f1000fe16df0dc387dc3a298b0 - languageName: node - linkType: hard - "react-native@npm:0.73.4": version: 0.73.4 resolution: "react-native@npm:0.73.4" @@ -35768,22 +34553,6 @@ __metadata: languageName: node linkType: hard -"react-qr-code@npm:^2.0.8": - version: 2.0.11 - resolution: "react-qr-code@npm:2.0.11" - dependencies: - prop-types: "npm:^15.8.1" - qr.js: "npm:0.0.0" - peerDependencies: - react: ^16.x || ^17.x || ^18.x - react-native-svg: "*" - peerDependenciesMeta: - react-native-svg: - optional: true - checksum: 680f7be35078892a29999013b24e36aae10c3529e4cdd2c1436573603864c45010445d6069969d7f76e4642c54584a3b941b8c944189273c3ac5b705156ad23b - languageName: node - linkType: hard - "react-reconciler@npm:^0.26.0": version: 0.26.2 resolution: "react-reconciler@npm:0.26.2" @@ -36082,20 +34851,6 @@ __metadata: languageName: node linkType: hard -"recyclerlistview@npm:4.2.0": - version: 4.2.0 - resolution: "recyclerlistview@npm:4.2.0" - dependencies: - lodash.debounce: "npm:4.0.8" - prop-types: "npm:15.8.1" - ts-object-utils: "npm:0.0.5" - peerDependencies: - react: ">= 15.2.1" - react-native: ">= 0.30.0" - checksum: 84c2fc1ee7d109e21ca30813f646a5d490a33fa789d1fb3f7f7854c191895de010109563ba1c67a35ec28340a872a039ceb6233a57053480098c48205fc147e9 - languageName: node - linkType: hard - "redent@npm:^3.0.0": version: 3.0.0 resolution: "redent@npm:3.0.0" @@ -36414,13 +35169,6 @@ __metadata: languageName: node linkType: hard -"reselect@npm:^4.1.7": - version: 4.1.8 - resolution: "reselect@npm:4.1.8" - checksum: 199984d9872f71cd207f4aa6e6fd2bd48d95154f7aa9b3aee3398335f39f5491059e732f28c12e9031d5d434adab2c458dc8af5afb6564d0ad37e1644445e09c - languageName: node - linkType: hard - "resolve-alpn@npm:^1.2.0": version: 1.2.1 resolution: "resolve-alpn@npm:1.2.1" @@ -36808,6 +35556,72 @@ __metadata: languageName: node linkType: hard +"ripple-address-codec@npm:^4.1.1, ripple-address-codec@npm:^4.3.1": + version: 4.3.1 + resolution: "ripple-address-codec@npm:4.3.1" + dependencies: + base-x: "npm:^3.0.9" + create-hash: "npm:^1.1.2" + checksum: 6eb258848127ccbe8dd77ae2c96174f31d64b9ec64719ca11f002b560b84a657429a9e9b6fa8d761c51d1fc660be7ca04b4fc7dbdb820a12d3d2cf4d7d306bc6 + languageName: node + linkType: hard + +"ripple-binary-codec@npm:^1.1.3": + version: 1.11.0 + resolution: "ripple-binary-codec@npm:1.11.0" + dependencies: + assert: "npm:^2.0.0" + big-integer: "npm:^1.6.48" + buffer: "npm:6.0.3" + create-hash: "npm:^1.2.0" + decimal.js: "npm:^10.2.0" + ripple-address-codec: "npm:^4.3.1" + checksum: d9efe46557da20ea3a11853bf4de47a02f938e92aaf0a64846657303a1e09ddd78e378eb19eee988c5fd992d3c7e57dc9c7c9cd59007f42058e664f42983587c + languageName: node + linkType: hard + +"ripple-keypairs@npm:^1.0.3": + version: 1.3.1 + resolution: "ripple-keypairs@npm:1.3.1" + dependencies: + bn.js: "npm:^5.1.1" + brorand: "npm:^1.0.5" + elliptic: "npm:^6.5.4" + hash.js: "npm:^1.0.3" + ripple-address-codec: "npm:^4.3.1" + checksum: 9669b77dd5da9e1e864d386cba3514ecbef9774f35370c3d4f949368ff0b7045e3faa3f383aa440876c6150d3bb497d56ccbee4f806462c2dec1bafff37059e8 + languageName: node + linkType: hard + +"ripple-lib-transactionparser@npm:0.8.2": + version: 0.8.2 + resolution: "ripple-lib-transactionparser@npm:0.8.2" + dependencies: + bignumber.js: "npm:^9.0.0" + lodash: "npm:^4.17.15" + checksum: 4b0084d97ac820589fc0ec7b8cfe00d757dc0fb8394dec0dbaf5b8a5e014e169d4b9be3926f41504eb30419f74d47c8beb2b64c74538f667eaa32dd1c91f20b1 + languageName: node + linkType: hard + +"ripple-lib@npm:^1.10.1": + version: 1.10.1 + resolution: "ripple-lib@npm:1.10.1" + dependencies: + "@types/lodash": "npm:^4.14.136" + "@types/ws": "npm:^7.2.0" + bignumber.js: "npm:^9.0.0" + https-proxy-agent: "npm:^5.0.0" + jsonschema: "npm:1.2.2" + lodash: "npm:^4.17.4" + ripple-address-codec: "npm:^4.1.1" + ripple-binary-codec: "npm:^1.1.3" + ripple-keypairs: "npm:^1.0.3" + ripple-lib-transactionparser: "npm:0.8.2" + ws: "npm:^7.2.0" + checksum: e77ebca3eda5c508d8f404b6ede60f5c9ac4bc23dab1d002b494f51af92c8b4cec3069eab11c0cacb1e06563f7bb0865e6b69060642711a291c04c313cae5a10 + languageName: node + linkType: hard + "rlp@npm:^2.2.4": version: 2.2.7 resolution: "rlp@npm:2.2.7" @@ -36845,13 +35659,6 @@ __metadata: languageName: node linkType: hard -"rtl-detect@npm:^1.0.2": - version: 1.1.2 - resolution: "rtl-detect@npm:1.1.2" - checksum: d19089c3b5f7a6fbabfa2c4724fcdf8694f313d196d44c8eee3625ba2e46418afe65b4da38e3e92822985291efd0656d85daa4b2ef296a46a65a702d0b156876 - languageName: node - linkType: hard - "run-async@npm:^2.4.0": version: 2.4.1 resolution: "run-async@npm:2.4.1" @@ -37717,6 +36524,17 @@ __metadata: languageName: node linkType: hard +"socks-proxy-agent@npm:6.1.1": + version: 6.1.1 + resolution: "socks-proxy-agent@npm:6.1.1" + dependencies: + agent-base: "npm:^6.0.2" + debug: "npm:^4.3.1" + socks: "npm:^2.6.1" + checksum: 53fb7d34bf3e5ed9cf4de73bf5c18b351d75c4a8757a0c0e384c2a7c86adf688e5f5e8f72eee7bc6c01ff619458f621ccf9d172bc986adb05f10fa0c9599c39e + languageName: node + linkType: hard + "socks-proxy-agent@npm:^7.0.0": version: 7.0.0 resolution: "socks-proxy-agent@npm:7.0.0" @@ -37728,6 +36546,16 @@ __metadata: languageName: node linkType: hard +"socks@npm:^2.6.1": + version: 2.8.1 + resolution: "socks@npm:2.8.1" + dependencies: + ip-address: "npm:^9.0.5" + smart-buffer: "npm:^4.2.0" + checksum: a3cc38e0716ab53a2db3fa00c703ca682ad54dbbc9ed4c7461624a999be6fa7cdc79fc904c411618e698d5eff55a55aa6d9329169a7db11636d0200814a2b5aa + languageName: node + linkType: hard + "socks@npm:^2.6.2": version: 2.7.1 resolution: "socks@npm:2.7.1" @@ -37961,6 +36789,13 @@ __metadata: languageName: node linkType: hard +"sprintf-js@npm:^1.1.3": + version: 1.1.3 + resolution: "sprintf-js@npm:1.1.3" + checksum: e7587128c423f7e43cc625fe2f87e6affdf5ca51c1cc468e910d8aaca46bb44a7fbcfa552f787b1d3987f7043aeb4527d1b99559e6621e01b42b3f45e5a24cbb + languageName: node + linkType: hard + "sprintf-js@npm:~1.0.2": version: 1.0.3 resolution: "sprintf-js@npm:1.0.3" @@ -39202,7 +38037,7 @@ __metadata: languageName: node linkType: hard -"tiny-secp256k1@npm:^1.1.3": +"tiny-secp256k1@npm:^1.1.3, tiny-secp256k1@npm:^1.1.6": version: 1.1.6 resolution: "tiny-secp256k1@npm:1.1.6" dependencies: @@ -39533,20 +38368,10 @@ __metadata: languageName: node linkType: hard -"ts-morph@npm:^20.0.0": - version: 20.0.0 - resolution: "ts-morph@npm:20.0.0" - dependencies: - "@ts-morph/common": "npm:~0.21.0" - code-block-writer: "npm:^12.0.0" - checksum: e93cf96fd347d45c1031de90f50146707959e1564d6e0bdd4abefc32004717f4f2adf5e155956c80f04fca55f6f1bce79193077c0041616ce9fe619bc15159d0 - languageName: node - linkType: hard - -"ts-object-utils@npm:0.0.5": - version: 0.0.5 - resolution: "ts-object-utils@npm:0.0.5" - checksum: 83c48fbdaba392fb2c01cea53b267ed5538d2bb44fc6c3eecc10bcfabc1780bfa6ec8569b52bbf0140d9b521d9049d5f15884e12286918244d463d854dbc73cb +"ts-mixer@npm:^6.0.3": + version: 6.0.4 + resolution: "ts-mixer@npm:6.0.4" + checksum: f20571a4a4ff7b5e1a2ff659208c1ea9d4180dda932b71d289edc99e25a2948c9048e2e676b930302ac0f8e88279e0da6022823183e67de3906a3f3a8b72ea80 languageName: node linkType: hard @@ -39870,7 +38695,7 @@ __metadata: languageName: node linkType: hard -"typeforce@npm:^1.11.5": +"typeforce@npm:^1.11.5, typeforce@npm:^1.18.0": version: 1.18.0 resolution: "typeforce@npm:1.18.0" checksum: dbf98c75b1d57e56e33c1e1271d5505e67981f4e6a2e2e6e8e31160b58777fea1726160810b6c606517db16476805b7dce315926ba2d4859b9a56cab05b7a41f @@ -39979,6 +38804,13 @@ __metadata: languageName: node linkType: hard +"ua-parser-js@npm:^1.0.37": + version: 1.0.37 + resolution: "ua-parser-js@npm:1.0.37" + checksum: 56508f2428ebac64382c4d41da14189e5013e3e2a5f5918aff4bee3ba77df1f4eaad6f81f90c24999f1cf12cc1596764684497fec07e0ff5182ce9a323a8c05b + languageName: node + linkType: hard + "unbox-primitive@npm:^1.0.2": version: 1.0.2 resolution: "unbox-primitive@npm:1.0.2" @@ -40297,10 +39129,15 @@ __metadata: languageName: node linkType: hard -"urlpattern-polyfill@npm:^9.0.0": - version: 9.0.0 - resolution: "urlpattern-polyfill@npm:9.0.0" - checksum: 63d59e08d58189d340e3acb0fb69c11d8f06da5e38c091cdac66cac07e4ca81378ad19cd1a923d5593a899603a0e607fe3ef793ef368fefbc1b2b840b24839b8 +"usb@npm:^2.11.0": + version: 2.11.0 + resolution: "usb@npm:2.11.0" + dependencies: + "@types/w3c-web-usb": "npm:^1.0.6" + node-addon-api: "npm:^7.0.0" + node-gyp: "npm:latest" + node-gyp-build: "npm:^4.5.0" + checksum: f65f513dd5ed5abcfec9e38383276dd1c97d95be09d37b16531cd86766b9fae0f058ad65bac595fdb1db5fe266c5706af1b1a545aa2247034f5e868457094614 languageName: node linkType: hard @@ -40507,25 +39344,6 @@ __metadata: languageName: node linkType: hard -"valtio@npm:^1.12.1": - version: 1.12.1 - resolution: "valtio@npm:1.12.1" - dependencies: - derive-valtio: "npm:0.1.0" - proxy-compare: "npm:2.5.1" - use-sync-external-store: "npm:1.2.0" - peerDependencies: - "@types/react": ">=16.8" - react: ">=16.8" - peerDependenciesMeta: - "@types/react": - optional: true - react: - optional: true - checksum: d60c83e42670eb41d947a39bf7eb54b4027385d106304d6ef0a3f3f2190f95894b1a149092a2fda4e901bff84d14fff2deea24d87ec8996f480ad8d79b9be415 - languageName: node - linkType: hard - "value-or-promise@npm:1.0.12, value-or-promise@npm:^1.0.11, value-or-promise@npm:^1.0.12": version: 1.0.12 resolution: "value-or-promise@npm:1.0.12" @@ -40533,6 +39351,15 @@ __metadata: languageName: node linkType: hard +"varuint-bitcoin@npm:^1.1.2": + version: 1.1.2 + resolution: "varuint-bitcoin@npm:1.1.2" + dependencies: + safe-buffer: "npm:^5.1.1" + checksum: 1c900bf08f2408ae33a6094dc5d809bdb6673eaf6039062d88c230155873e51e29c760053611f93ccd024854d04ebd92ed95c744720e94a79ca4e1150fcce071 + languageName: node + linkType: hard + "vary@npm:^1.1.2, vary@npm:~1.1.2": version: 1.1.2 resolution: "vary@npm:1.1.2" @@ -41242,6 +40069,15 @@ __metadata: languageName: node linkType: hard +"wif@npm:^4.0.0": + version: 4.0.0 + resolution: "wif@npm:4.0.0" + dependencies: + bs58check: "npm:^3.0.1" + checksum: 5b3438202c0e4509c1963872730d8aa33dd34f0da5c65d8fde8e1cd6338bae78d1f2144099d5cb2a4a9de4679e13a09e4d3da8a22af52be98dc9abf4de0581e4 + languageName: node + linkType: hard + "wildcard@npm:^2.0.0": version: 2.0.0 resolution: "wildcard@npm:2.0.0" @@ -41433,7 +40269,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^7, ws@npm:^7.4.0, ws@npm:^7.4.5, ws@npm:^7.5.1": +"ws@npm:^7, ws@npm:^7.2.0, ws@npm:^7.4.0, ws@npm:^7.4.5, ws@npm:^7.5.1": version: 7.5.9 resolution: "ws@npm:7.5.9" peerDependencies: @@ -41448,7 +40284,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.11.0": +"ws@npm:^8.11.0, ws@npm:^8.16.0": version: 8.16.0 resolution: "ws@npm:8.16.0" peerDependencies: From eceaa790ec33abd79c959589e03a34b0b498e7e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0ulovsk=C3=BD?= Date: Wed, 6 Mar 2024 15:15:05 +0100 Subject: [PATCH 2/6] tmp: trezor signing, mock preview pubkeys --- .../common/Account/ImportWallets.tsx | 5 +- packages/app-extension/src/manifest.json | 2 +- packages/app-extension/webpack.config.js | 2 +- packages/recoil/src/hooks/wallet.tsx | 1 + .../background-clients/safeClientResponse.ts | 3 +- .../src/services/svm/keyring.ts | 21 +- .../src/services/svm/server.ts | 138 ++++++++----- .../src/services/trezor/client.ts | 76 +++++++ .../src/store/KeyringStore/UserKeyring.ts | 17 +- .../src/store/SecureStore.ts | 3 + .../TrezorPreviewPublicKeysRequest.tsx | 155 ++++++++++++-- .../TrezorRequests/TrezorSignRequest.tsx | 189 ++++++++++++++++++ packages/secure-ui/src/SecureUI.tsx | 15 +- 13 files changed, 541 insertions(+), 86 deletions(-) create mode 100644 packages/secure-background/src/services/trezor/client.ts create mode 100644 packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorSignRequest.tsx diff --git a/packages/app-extension/src/components/common/Account/ImportWallets.tsx b/packages/app-extension/src/components/common/Account/ImportWallets.tsx index 9684bbaa7..b9a81fe36 100644 --- a/packages/app-extension/src/components/common/Account/ImportWallets.tsx +++ b/packages/app-extension/src/components/common/Account/ImportWallets.tsx @@ -232,7 +232,9 @@ export function ImportWallets({ newWalletDescriptors ); if (!isFundedAddresses) { - setWalletDescriptors(newWalletDescriptors); + setWalletDescriptors( + newWalletDescriptors.filter((it) => it != null) + ); } const balances = await loadBalances( newWalletDescriptors.map((descriptor) => descriptor.publicKey) @@ -251,6 +253,7 @@ export function ImportWallets({ setBalances(balancesObj); setWalletDescriptors( newWalletDescriptors + .filter((it) => it != null) .filter((walletDescriptor) => { if (isFundedAddresses) { const balance = balancesObj[walletDescriptor.publicKey]; diff --git a/packages/app-extension/src/manifest.json b/packages/app-extension/src/manifest.json index fc661b41c..331b2fb7b 100644 --- a/packages/app-extension/src/manifest.json +++ b/packages/app-extension/src/manifest.json @@ -21,7 +21,7 @@ } }, "content-security-policy": { - "extension_pages": "'frame-src': 'self' 'https://connect.trezor.io/*' 'https://connect.trezor.io/'" + "extension_pages": "frame-src: 'self' 'https://connect.trezor.io/'" }, "content_scripts": [ { diff --git a/packages/app-extension/webpack.config.js b/packages/app-extension/webpack.config.js index 8c8a80dee..073ccd8ef 100644 --- a/packages/app-extension/webpack.config.js +++ b/packages/app-extension/webpack.config.js @@ -311,7 +311,7 @@ const options = { ? { // add support for react devtools in development mode extension_pages: - "script-src 'self' http://localhost:8097; object-src 'self'; frame-src: 'self'", + "script-src 'self' http://localhost:8097; object-src 'self'; frame-src: 'self' 'https://connect.trezor.io/'", } : undefined, }, diff --git a/packages/recoil/src/hooks/wallet.tsx b/packages/recoil/src/hooks/wallet.tsx index 15506453c..31ed748e0 100644 --- a/packages/recoil/src/hooks/wallet.tsx +++ b/packages/recoil/src/hooks/wallet.tsx @@ -19,6 +19,7 @@ export function useActiveSolanaWallet(): { } export function useActiveWallet(): Wallet { + console.log("[DEBUG] useActiveWallet", useRecoilValue(atoms.activeWallet)); return useRecoilValue(atoms.activeWallet); } export function useActiveWalletNullable(): Wallet | null { diff --git a/packages/secure-background/src/background-clients/safeClientResponse.ts b/packages/secure-background/src/background-clients/safeClientResponse.ts index 6d0a1de17..a4823e448 100644 --- a/packages/secure-background/src/background-clients/safeClientResponse.ts +++ b/packages/secure-background/src/background-clients/safeClientResponse.ts @@ -3,12 +3,13 @@ import type { SecureRequestType, SecureResponse } from "../types/transports"; export async function safeClientResponse< T extends SECURE_EVENTS, - R extends SecureRequestType + R extends SecureRequestType, >( p: Promise> ): Promise["response"]>> { const response = await p; if (response.error) { + console.log("[DEBUG] safeClientResponse error:", response.error); throw response.error; } return response.response!; diff --git a/packages/secure-background/src/services/svm/keyring.ts b/packages/secure-background/src/services/svm/keyring.ts index 06fb3ed82..e14565419 100644 --- a/packages/secure-background/src/services/svm/keyring.ts +++ b/packages/secure-background/src/services/svm/keyring.ts @@ -305,7 +305,26 @@ export class SolanaTrezorKeyring signableTx: string; derivationPath: string; }> { - throw new Error("[DEBUG] [SOLANA TREZOR KEYRING] Method not implemented."); + console.log( + "[DEBUG] [SOLANA TREZOR KEYRING] prepareSignTransaction", + request + ); + + const walletDescriptor = this.walletDescriptors.find( + (p) => p.publicKey === request.publicKey + ); + if (!walletDescriptor) { + throw new Error("ledger address not found"); + } + + const transaction = deserializeTransaction(request.tx); + // TODO: Check if we can use `encode` here as for ledger + const signableTx = transaction.message.serialize().toString("hex"); + + return { + signableTx, + derivationPath: walletDescriptor.derivationPath.replace("m/", ""), + }; } public async prepareSignMessage(request: { diff --git a/packages/secure-background/src/services/svm/server.ts b/packages/secure-background/src/services/svm/server.ts index caa05cdbd..b35947dec 100644 --- a/packages/secure-background/src/services/svm/server.ts +++ b/packages/secure-background/src/services/svm/server.ts @@ -1,6 +1,9 @@ import type { WalletDescriptor } from "@coral-xyz/common"; import { Blockchain } from "@coral-xyz/common"; -import { createSignInMessage, createSignInMessageText } from "@solana/wallet-standard-util"; +import { + createSignInMessage, + createSignInMessageText, +} from "@solana/wallet-standard-util"; import { Connection, PublicKey, VersionedTransaction } from "@solana/web3.js"; import bs58, { decode, encode } from "bs58"; @@ -19,6 +22,7 @@ import type { TransportSender, } from "../../types/transports"; import { LedgerClient } from "../ledger/client"; +import { TrezorClient } from "../trezor/client"; import { UserClient } from "../user/client"; import type { SECURE_SVM_EVENTS, SECURE_SVM_SIGN_MESSAGE } from "./events"; @@ -28,6 +32,7 @@ export class SVMService { public destroy: TransportRemoveListener; private secureUIClient: SecureUIClient; private ledgerClient: LedgerClient; + private trezorClient: TrezorClient; private userClient: UserClient; private keyringStore: KeyringStore; @@ -41,6 +46,7 @@ export class SVMService { this.secureUIClient = new SecureUIClient(interfaces.secureUISender); this.userClient = new UserClient(interfaces.secureSender); this.ledgerClient = new LedgerClient(interfaces.secureUISender); + this.trezorClient = new TrezorClient(interfaces.secureUISender); this.destroy = interfaces.secureReceiver.setHandler( this.eventHandler.bind(this) ); @@ -137,64 +143,65 @@ export class SVMService { }); }; - private handleSignIn: TransportHandler<"SECURE_SVM_SIGN_IN"> = - async ({ - event, - request, - error, - respond - }) => { - - const user = await safeClientResponse( - this.userClient.getUser() - ); - if (user.keyringStoreState === KeyringStoreState.NeedsOnboarding) { - return error(new Error("No active user")); - } - let publicKey = - user.publicKeys?.platforms[request.blockchain]?.activePublicKey; + private handleSignIn: TransportHandler<"SECURE_SVM_SIGN_IN"> = async ({ + event, + request, + error, + respond, + }) => { + const user = await safeClientResponse(this.userClient.getUser()); + if (user.keyringStoreState === KeyringStoreState.NeedsOnboarding) { + return error(new Error("No active user")); + } + let publicKey = + user.publicKeys?.platforms[request.blockchain]?.activePublicKey; - if (!publicKey) { - return error(new Error("No account for blockchain")); - } + if (!publicKey) { + return error(new Error("No account for blockchain")); + } - if(request.input?.address) { - publicKey = request.input.address; - const publicKeyInfo = user.publicKeys?.platforms[request.blockchain]?.publicKeys[request.input.address]; - if(!publicKeyInfo) { - return error(new Error("Requested public key not found.")); - } + if (request.input?.address) { + publicKey = request.input.address; + const publicKeyInfo = + user.publicKeys?.platforms[request.blockchain]?.publicKeys[ + request.input.address + ]; + if (!publicKeyInfo) { + return error(new Error("Requested public key not found.")); } + } - const message = createSignInMessage({ - domain: event.origin.address, - address: publicKey, - ...request.input ?? {} - }); + const message = createSignInMessage({ + domain: event.origin.address, + address: publicKey, + ...(request.input ?? {}), + }); - const encodedMessage = encode(message); + const encodedMessage = encode(message); - await safeClientResponse(this.secureUIClient.confirm(event, { + await safeClientResponse( + this.secureUIClient.confirm(event, { message: encode(message), - publicKey - })); - - const { signature } = await this.getMessageSignature( - user, publicKey, - encodedMessage, - event.origin - ) + }) + ); + + const { signature } = await this.getMessageSignature( + user, + publicKey, + encodedMessage, + event.origin + ); - const connectionUrl = user.preferences.blockchains.solana.connectionUrl; + const connectionUrl = user.preferences.blockchains.solana.connectionUrl; - return respond({ - signedMessage: encodedMessage, - signature, - publicKey, - connectionUrl - }) - }; + return respond({ + signedMessage: encodedMessage, + signature, + publicKey, + connectionUrl, + }); + }; private handleSignMessage: TransportHandler<"SECURE_SVM_SIGN_MESSAGE"> = async (event) => { @@ -223,7 +230,7 @@ export class SVMService { publicKey, event.request.message, event.event.origin - ) + ); return event.respond({ signedMessage: signature, @@ -347,8 +354,32 @@ export class SVMService { ?.publicKeys() .includes(publicKey); + const isTrezorWallet = !!blockchainKeyring.trezorKeyring + ?.publicKeys() + .includes(publicKey); + // If we need ledger signature, request via ledgerClient - if (blockchainKeyring.ledgerKeyring && isLedgerWallet) { + if (blockchainKeyring.trezorKeyring && isTrezorWallet) { + const trezorRequest = + await blockchainKeyring.trezorKeyring.prepareSignTransaction({ + publicKey, + tx, + }); + + const trezorResponse = await safeClientResponse( + this.trezorClient.svmSignTransaction( + { + txMessage: trezorRequest.signableTx, + derivationPath: trezorRequest.derivationPath, + }, + { origin } + ) + ); + + return { + signature: trezorResponse.signature, + }; + } else if (blockchainKeyring.ledgerKeyring && isLedgerWallet) { const ledgerRequest = await blockchainKeyring.ledgerKeyring.prepareSignTransaction({ publicKey, @@ -422,10 +453,7 @@ export class SVMService { ); return { signature: ledgerResponse.signature }; } else { - const signature = await blockchainKeyring.signMessage( - message, - publicKey - ); + const signature = await blockchainKeyring.signMessage(message, publicKey); return { signature }; } } diff --git a/packages/secure-background/src/services/trezor/client.ts b/packages/secure-background/src/services/trezor/client.ts new file mode 100644 index 000000000..f9fba9c7f --- /dev/null +++ b/packages/secure-background/src/services/trezor/client.ts @@ -0,0 +1,76 @@ +import type { + SecureRequest, + SecureRequestOptions, + SecureResponse, + TransportSender, +} from "../../types/transports"; +import type { SECURE_LEDGER_EVENTS } from "../ledger/events"; + +// TODO: Replace with Trezor Events OR generic HW events, dependant on PR outcome +export class TrezorClient { + constructor(private client: TransportSender) {} + + public svmSignTransaction( + request: SecureRequest<"LEDGER_SVM_SIGN_TX">["request"], + options: SecureRequestOptions<"LEDGER_SVM_SIGN_TX", "ui"> + ): Promise> { + return this.client + .send({ + name: "LEDGER_SVM_SIGN_TX", + request, + uiOptions: {}, + ...options, + }) + .then((response) => { + return response; + }); + } + + public svmSignMessage( + request: SecureRequest<"LEDGER_SVM_SIGN_MESSAGE">["request"], + options: SecureRequestOptions<"LEDGER_SVM_SIGN_MESSAGE", "ui"> + ): Promise> { + return this.client + .send({ + name: "LEDGER_SVM_SIGN_MESSAGE", + request, + uiOptions: {}, + ...options, + }) + .then((response) => { + return response; + }); + } + + public evmSignMessage( + request: SecureRequest<"LEDGER_EVM_SIGN_MESSAGE">["request"], + options: SecureRequestOptions<"LEDGER_EVM_SIGN_MESSAGE", "ui"> + ): Promise> { + return this.client + .send({ + name: "LEDGER_EVM_SIGN_MESSAGE", + request, + uiOptions: {}, + ...options, + }) + .then((response) => { + return response; + }); + } + + public evmSignTransaction( + request: SecureRequest<"LEDGER_EVM_SIGN_TX">["request"], + options: SecureRequestOptions<"LEDGER_EVM_SIGN_TX", "ui"> + ): Promise> { + return this.client + .send({ + name: "LEDGER_EVM_SIGN_TX", + request, + uiOptions: {}, + ...options, + }) + .then((response) => { + return response; + }); + } +} diff --git a/packages/secure-background/src/store/KeyringStore/UserKeyring.ts b/packages/secure-background/src/store/KeyringStore/UserKeyring.ts index 3f1cfc691..18384b071 100644 --- a/packages/secure-background/src/store/KeyringStore/UserKeyring.ts +++ b/packages/secure-background/src/store/KeyringStore/UserKeyring.ts @@ -307,19 +307,11 @@ export class UserKeyring { }> { const blockchainKeyring = this.blockchains.get(walletDescriptor.blockchain); const trezorKeyring = blockchainKeyring!.trezorKeyring!; - console.log( - "[DEBUG] UserKeyring: trezorImport: walletDescriptor:", - walletDescriptor, - blockchainKeyring, - trezorKeyring - ); - throw new Error("Method not implemented."); - /* - const ledgerKeyring = blockchainKeyring!.ledgerKeyring!; - await ledgerKeyring.add(walletDescriptor); - const name = this.store.defaultKeyname.defaultLedger( - ledgerKeyring.publicKeys().length + await trezorKeyring.add(walletDescriptor); + + const name = this.store.defaultKeyname.defaultTrezor( + trezorKeyring.publicKeys().length ); await this.store.setUserPublicKey( this.uuid, @@ -336,7 +328,6 @@ export class UserKeyring { name, publicKey: walletDescriptor.publicKey, }; - */ } public async keyDelete({ diff --git a/packages/secure-background/src/store/SecureStore.ts b/packages/secure-background/src/store/SecureStore.ts index 60ebcbe04..97b199902 100644 --- a/packages/secure-background/src/store/SecureStore.ts +++ b/packages/secure-background/src/store/SecureStore.ts @@ -109,6 +109,9 @@ export class SecureStore { defaultLedger(index: number): string { return `Ledger ${index}`; }, + defaultTrezor(index: number): string { + return `Trezor ${index}`; + }, }; // this privatStore is passed to migrations diff --git a/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorPreviewPublicKeysRequest.tsx b/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorPreviewPublicKeysRequest.tsx index a64e58ee9..7edb13e7c 100644 --- a/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorPreviewPublicKeysRequest.tsx +++ b/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorPreviewPublicKeysRequest.tsx @@ -12,8 +12,7 @@ import { StyledText, YStack, } from "@coral-xyz/tamagui"; -import { PublicKey } from "@solana/web3.js"; -import { useCallback, useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { isLegalTrezorPath } from "./_utils/isLegalTrezorPath"; import TrezorConnect from "./_utils/trezorConnect"; @@ -38,7 +37,7 @@ export function TrezorPreviewPublicKeysRequest({ const request = currentRequest.request as BlockchainWalletPublicKeyRequest; - const fetchSolanaWallets = useCallback(async (setProgress) => { + const fetchSolanaWallets = async () => { const derivationPathBundle = request.derivationPaths .filter(isLegalTrezorPath) .map((path) => ({ @@ -48,16 +47,33 @@ export function TrezorPreviewPublicKeysRequest({ console.log("[DEBUG] [TREZOR] derivationPathBundle", derivationPathBundle); - const result = await TrezorConnect.solanaGetPublicKey({ - bundle: derivationPathBundle, - }); + let retries = 0; + let success = false; + let result: { address: string; serializedPath: string }[] = []; + + while (!success && retries < 10) { + const trezorResponse = await TrezorConnect.solanaGetAddress({ + bundle: derivationPathBundle, + }); - if (result.success === false) { - throw new Error(result.payload.error); + if (trezorResponse.success) { + console.log( + "[DEBUG] [TREZOR] trezorResponse, returning", + trezorResponse + ); + success = true; + result = trezorResponse.payload; + } else { + console.log( + "[DEBUG] [TREZOR] trezorResponse, retrying", + trezorResponse + ); + retries++; + } } - const derivationPaths: DerivationPaths = result.payload.map((payload) => ({ - publicKey: payload.publicKey, + const derivationPaths: DerivationPaths = result.map((payload) => ({ + publicKey: payload.address, derivationPath: payload.serializedPath, blockchain: request.blockchain, })); @@ -67,9 +83,8 @@ export function TrezorPreviewPublicKeysRequest({ Object.values(derivationPaths) ); - setProgress(1); return Object.values(derivationPaths); - }, []); + }; // TODO: Implement Ethereum const fetchEthereumWallets = () => { @@ -113,6 +128,121 @@ function SelectWallets({ const [isPermissionsError, setIsPermissionsError] = useState(false); useEffect(() => { + currentRequest.respond({ + walletDescriptors: [ + { + publicKey: "BdEB9hfSL9qZbjp5CwkYctVPpn3BWpeaMPBWoEj8y9ZH", + derivationPath: "m/44'/501'", + blockchain: "solana", + }, + { + publicKey: "ETxHeBBcuw9Yu4dGuP3oXrD12V5RECvmi8ogQ9PkjyVF", + derivationPath: "m/44'/501'/0'/0'", + blockchain: "solana", + }, + { + publicKey: "2MLmmoKgCrxVEzMeGatnjdABYS5RXsQSNikcWrmnvQna", + derivationPath: "m/44'/501'/1'/0'", + blockchain: "solana", + }, + { + publicKey: "DNDSiWVRF37n1KgQKRF3yuZNiadoXMCePLWqbuYFfveW", + derivationPath: "m/44'/501'/2'/0'", + blockchain: "solana", + }, + { + publicKey: "7UJWsKKwM5kTB1dg8hLD7PABdXtDE3MaqQLUk68GRCTF", + derivationPath: "m/44'/501'/3'/0'", + blockchain: "solana", + }, + { + publicKey: "BihV1HdhfDtiQxoG7fat4BbgnKZ3W8kpZgDPZPZGtgoH", + derivationPath: "m/44'/501'/4'/0'", + blockchain: "solana", + }, + { + publicKey: "AcpwvpfKX1Mb8ibddaYAZPJ6APxu1j9qmnpQMShqkAUW", + derivationPath: "m/44'/501'/5'/0'", + blockchain: "solana", + }, + { + publicKey: "GgtGKV9DZstMQ7uKvs1eoWU9DNbrsqLLxUkDSJncfMuN", + derivationPath: "m/44'/501'/6'/0'", + blockchain: "solana", + }, + { + publicKey: "8Mixr6hLqBbd3kBvY39csJK2HW6TwHsfhjVERbfpTQj6", + derivationPath: "m/44'/501'/7'/0'", + blockchain: "solana", + }, + { + publicKey: "32D4q91naKFrGLVhnw77FU2h2vMUJzkAZa4eweMFFf4T", + derivationPath: "m/44'/501'/8'/0'", + blockchain: "solana", + }, + { + publicKey: "DUoqdneN2odimpY5joSfq4tNKYXWUyAoSLRjDzHARKLd", + derivationPath: "m/44'/501'/9'/0'", + blockchain: "solana", + }, + { + publicKey: "98JrM15LDHAkzKwB3bFdpSDCgTUkrAcVFojX2KsuA8XE", + derivationPath: "m/44'/501'/0'", + blockchain: "solana", + }, + { + publicKey: "Dwv9FVA12vpbrdayRs5JrbNmTmbxXLbqvrtx6WGjTdPF", + derivationPath: "m/44'/501'/1'", + blockchain: "solana", + }, + { + publicKey: "J3aNU5PiN5HtMaLmKybYJZoxKTnLMeRRbsWD6K5GQUC", + derivationPath: "m/44'/501'/2'", + blockchain: "solana", + }, + { + publicKey: "6wjDZt5TSeaApvw8cPNRnGave6kVMuymJntKtzM81681", + derivationPath: "m/44'/501'/3'", + blockchain: "solana", + }, + { + publicKey: "FC1MSnnpbdKPFGVzcFKwFNfKAubNiZhTcam56vx3sERZ", + derivationPath: "m/44'/501'/4'", + blockchain: "solana", + }, + { + publicKey: "HYMq9yKFnpp8m56hDAXFCRRnSKLxjhcJ1F1EpbzgvHLU", + derivationPath: "m/44'/501'/5'", + blockchain: "solana", + }, + { + publicKey: "DYwqcXLmtmwB88c6nKcQQXVEm86h1crkpdi9cPREszkM", + derivationPath: "m/44'/501'/6'", + blockchain: "solana", + }, + { + publicKey: "Dwq63nu4ySq1A1L9vjWRRtkPCQ47Gd5BAzsQqWefGWfB", + derivationPath: "m/44'/501'/7'", + blockchain: "solana", + }, + { + publicKey: "9GkDryJG8USX2VSxTQ2Z3b1BAbBJPpGeuXdC7jK4KVXE", + derivationPath: "m/44'/501'/8'", + blockchain: "solana", + }, + { + publicKey: "53A8isrgEuFz8R41uQtuBQpT5WEAmZ6GoWSNy1jHaFxX", + derivationPath: "m/44'/501'/9'", + blockchain: "solana", + }, + ].map((descriptor) => ({ + ...descriptor, + blockchain: Blockchain.SOLANA, + type: BlockchainWalletDescriptorType.HARDWARE, + device: "trezor", + })), + }); + /* const result = fetchWallets(setProgress); console.log("[DEBUG] [TREZOR] SelectWallets promise", result); @@ -142,6 +272,7 @@ function SelectWallets({ } // currentRequest.error(e instanceof Error ? e : new Error(e)); }); + */ }, [currentRequest.id]); return ( diff --git a/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorSignRequest.tsx b/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorSignRequest.tsx new file mode 100644 index 000000000..fa64dabf9 --- /dev/null +++ b/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorSignRequest.tsx @@ -0,0 +1,189 @@ +import { openLedgerPermissions } from "@coral-xyz/common"; +import type { SECURE_LEDGER_EVENTS } from "@coral-xyz/secure-clients/types"; +import { + Loader, + StyledText, + HardwareIcon, + ErrorCrossMarkIcon, + YStack, +} from "@coral-xyz/tamagui"; +import { useCallback, useEffect, useState } from "react"; + +import TrezorConnect from "./_utils/trezorConnect"; +import { RequireUserUnlocked } from "../../RequireUserUnlocked/RequireUserUnlocked"; +import type { QueuedUiRequest } from "../../_atoms/requestAtoms"; +import { RequestConfirmation } from "../../_sharedComponents/RequestConfirmation"; + +type RequestHandlers = { + [Event in Events]: ( + currentRequest: QueuedUiRequest, + setStatus: (status: string) => void + ) => Promise; +}; + +// TODO: Once HW PR merged, this should be fine +export type HardwareSignEvents = + | "LEDGER_SVM_SIGN_TX" + | "LEDGER_SVM_SIGN_MESSAGE" + | "LEDGER_EVM_SIGN_TX" + | "LEDGER_EVM_SIGN_MESSAGE"; + +export function TrezorSignRequest({ + currentRequest, +}: { + currentRequest: QueuedUiRequest; +}) { + return ( + currentRequest.error(new Error("Login Failed"))} + > + + + ); +} + +function ApproveOnTrezor({ + currentRequest, +}: { + currentRequest: QueuedUiRequest; +}) { + const [error, setError] = useState(null); + const [status, setStatus] = useState( + "Approve Signature on your Trezor device." + ); + const isPermissionsError = error === "HID_PERMISSIONS_NOT_AVAILABLE"; + const isGestureRequiredError = error === "HID_GESTURE_REQUIRED"; + const execute = useCallback(() => { + (async function () { + const handlers: RequestHandlers = { + LEDGER_SVM_SIGN_TX: svmSignTx, + LEDGER_SVM_SIGN_MESSAGE: svmSignMessage, + LEDGER_EVM_SIGN_TX: evmSignTx, + LEDGER_EVM_SIGN_MESSAGE: evmSignMessage, + }; + + const handler = handlers[currentRequest.name]; + // TODO: replace :any + await handler?.(currentRequest as any, setStatus).catch((e) => { + if (e.message === "HID_PERMISSIONS_NOT_AVAILABLE") { + setError(e.message); + setStatus("Missing HID browser permissions."); + } else if (e.message === "HID_GESTURE_REQUIRED") { + setError(e.message); + setStatus("Ledger Connection lost."); + } else { + setStatus(e.message); + setError(e.message); + currentRequest.error(e instanceof Error ? e : new Error(e)); + } + }); + })(); + }, [currentRequest.id]); + + useEffect(() => { + execute(); + }, [execute]); + + return ( + { + if (isPermissionsError) { + openLedgerPermissions(); + window.close(); + } + if (isGestureRequiredError) { + setError(null); + execute(); + } + }} + rightButton={ + isPermissionsError + ? "Grant Ledger Permissions" + : isGestureRequiredError + ? "Try again!" + : null + } + onDeny={() => currentRequest.error(new Error("Cancelled by User"))} + buttonDirection="column-reverse" + > + + + + Approve on your Ledger Device + + + {status} + + + {error ? ( + + + + ) : ( + + + + + )} + + + ); +} + +async function svmSignTx( + currentRequest: QueuedUiRequest<"LEDGER_SVM_SIGN_TX">, + setStatus: (status: string) => void +) { + console.log("[DEBUG] [svmSignTx] currentRequest: ", currentRequest); + const { derivationPath, txMessage } = currentRequest.request; + const result = TrezorConnect.solanaSignTransaction({ + path: derivationPath, + serializedTx: txMessage, + }); + + console.log("[DEBUG] [svmSignTx] result: ", result); + + // wait for result + return result.then((result) => { + if (result.success === false) { + console.log("[DEBUG] [svmSignTx] error:", result.payload.error); + throw new Error(result.payload.error); + } + console.log( + "[DEBUG] [svmSignTx] signature, responding:", + result.payload.signature + ); + currentRequest.respond({ + signature: result.payload.signature, + }); + }); +} + +async function svmSignMessage( + currentRequest: QueuedUiRequest<"LEDGER_SVM_SIGN_MESSAGE">, + setStatus: (status: string) => void +) { + throw new Error("Not implemented"); +} + +async function evmSignTx( + currentRequest: QueuedUiRequest<"LEDGER_EVM_SIGN_TX">, + setStatus: (status: string) => void +) { + throw new Error("Not implemented"); +} + +async function evmSignMessage( + currentRequest: QueuedUiRequest<"LEDGER_EVM_SIGN_MESSAGE">, + setStatus: (status: string) => void +) { + throw new Error("Not implemented"); +} diff --git a/packages/secure-ui/src/SecureUI.tsx b/packages/secure-ui/src/SecureUI.tsx index 79ff8d5b7..8f53672e1 100644 --- a/packages/secure-ui/src/SecureUI.tsx +++ b/packages/secure-ui/src/SecureUI.tsx @@ -34,6 +34,7 @@ import { SvmSignAllTransactionsRequest } from "./RequestHandlers/SvmSignAllTrans import { SvmSignInRequest } from "./RequestHandlers/SvmSignInRequest"; import { SvmSignMessageRequest } from "./RequestHandlers/SvmSignMessageRequest"; import { SvmSignTransactionRequest } from "./RequestHandlers/SvmSignTransactionRequest/SvmSignTransactionRequest"; +import { TrezorSignRequest } from "./RequestHandlers/TrezorRequests/TrezorSignRequest"; import { UnlockRequest } from "./RequestHandlers/UnlockRequest"; import { RequireUserUnlocked } from "./RequireUserUnlocked/RequireUserUnlocked"; import SecureUIBottomSheetModalProvider from "./SecureUIBottomSheetModalProvider"; @@ -131,12 +132,24 @@ function SecureUIRoot({ presentation }: { presentation?: PresentationTypes }) { case "LEDGER_EVM_SIGN_TX": case "LEDGER_EVM_SIGN_MESSAGE": return ( - } /> ); + /* + TODO: Implement + case "TREZOR_SVM_SIGN_TX": + case "TREZOR_SVM_SIGN_MESSAGE": + return ( + + } + /> + ); + */ case "SECURE_USER_PREVIEW_WALLETS": return ( Date: Mon, 11 Mar 2024 16:14:35 +0100 Subject: [PATCH 3/6] tmp: trezor signing, account import Removed a plugin disconnect call which was stopping trezor calls going through. --- .../common/Account/ImportWallets.tsx | 73 +- packages/app-extension/src/manifest.json | 9 +- .../components/TransactionConfirmation.tsx | 1 + .../src/webextension/trezor/README.md | 19 +- .../trezor/trezor-content-script.js | 2768 ++++++++++++++++- .../trezor/trezor-usb-permissions.js | 2 +- packages/app-extension/webpack.config.js | 2 +- .../transports/ToSecureUITransportSender.ts | 24 +- packages/secure-ui/package.json | 1 - .../TrezorPreviewPublicKeysRequest.tsx | 105 +- .../TrezorRequests/TrezorSignRequest.tsx | 10 +- yarn.lock | 1 - 12 files changed, 2921 insertions(+), 94 deletions(-) diff --git a/packages/app-extension/src/components/common/Account/ImportWallets.tsx b/packages/app-extension/src/components/common/Account/ImportWallets.tsx index b9a81fe36..732e7dee7 100644 --- a/packages/app-extension/src/components/common/Account/ImportWallets.tsx +++ b/packages/app-extension/src/components/common/Account/ImportWallets.tsx @@ -139,7 +139,9 @@ export function ImportWallets({ userClient ); - return safeClientResponse(userClient.previewWallets(walletPreview)) + let r1 = await safeClientResponse( + userClient.previewWallets(walletPreview) + ) .then((result_) => { console.log("[DEBUG] [ImportWallets] loadPublicKeys success"); setLoadPublicKeysError(false); @@ -171,6 +173,56 @@ export function ImportWallets({ setLoadPublicKeysError(true); return []; }); + + if (r1.length === 0) { + console.log("[DEBUG] [ImportWallets] loadPublicKeys sleeping..."); + const sleep = () => { + return new Promise((resolve) => setTimeout(resolve, 2000)); + }; + await sleep(); + + console.log("[DEBUG] [ImportWallets] loadPublicKeys trying again..."); + + r1 = await safeClientResponse(userClient.previewWallets(walletPreview)) + .then((result_) => { + console.log("[DEBUG] [ImportWallets] 2 loadPublicKeys success"); + setLoadPublicKeysError(false); + const result = result_.wallets[0].walletDescriptors.map( + (descriptor) => ({ + ...descriptor, + mnemonic, // bring back option for mnemonic === true to differentiat privatkey_derived & mnemnoic + }) + ) as WalletDescriptor[]; + console.log( + "[DEBUG] [ImportWallets] 2 loadPublicKeys result", + result_ + ); + setImportedPublicKeys( + result_.wallets[0].walletDescriptors + .filter((descriptor) => descriptor.imported) + .map((descriptor) => descriptor.publicKey) + ); + setWalletDescriptorsCache((cached) => [ + ...(cached ?? []), + ...result, + ]); + return derivationPaths.map((path) => { + const cached = cachedDerivationPaths.find( + (cached) => cached.derivationPath === path + ); + if (cached) { + return cached; + } + return result.find((fetched) => fetched.derivationPath === path)!; + }); + }) + .catch((e) => { + console.log("[DEBUG] [ImportWallets] 2 loadPublicKeys error", e); + setLoadPublicKeysError(true); + return []; + }); + } + return r1; }, [blockchain, userClient, walletDescriptorsCache] ); @@ -227,17 +279,21 @@ export function ImportWallets({ blockchain: Blockchain; }[] ) => { + const discoveredWalletDescriptors = newWalletDescriptors.filter( + (it) => it != null + ); + console.log( - "[DEBUG] [ImportWallets] fetchPublicKeys newWalletDescriptors", - newWalletDescriptors + "[DEBUG] [ImportWallets] fetchPublicKeys discoveredWalletDescriptors", + discoveredWalletDescriptors ); if (!isFundedAddresses) { - setWalletDescriptors( - newWalletDescriptors.filter((it) => it != null) - ); + setWalletDescriptors(discoveredWalletDescriptors); } const balances = await loadBalances( - newWalletDescriptors.map((descriptor) => descriptor.publicKey) + discoveredWalletDescriptors.map( + (descriptor) => descriptor.publicKey + ) ); console.log( "[DEBUG] [ImportWallets] fetchPublicKeys balances", @@ -252,8 +308,7 @@ export function ImportWallets({ ); setBalances(balancesObj); setWalletDescriptors( - newWalletDescriptors - .filter((it) => it != null) + discoveredWalletDescriptors .filter((walletDescriptor) => { if (isFundedAddresses) { const balance = balancesObj[walletDescriptor.publicKey]; diff --git a/packages/app-extension/src/manifest.json b/packages/app-extension/src/manifest.json index 331b2fb7b..ae88cf808 100644 --- a/packages/app-extension/src/manifest.json +++ b/packages/app-extension/src/manifest.json @@ -21,7 +21,7 @@ } }, "content-security-policy": { - "extension_pages": "frame-src: 'self' 'https://connect.trezor.io/'" + "extension_pages": "frame-src: 'self' *://connect.trezor.io/*" }, "content_scripts": [ { @@ -32,8 +32,8 @@ "all_frames": true }, { - "matches": ["*://connect.trezor.io/*/popup.html"], - "js": ["vendor/trezor-content-script.js"] + "js": ["vendor/trezor-content-script.js"], + "matches": ["*://connect.trezor.io/9/*"] } ], "icons": { @@ -41,5 +41,6 @@ "192": "anchor.png", "512": "anchor.png" }, - "permissions": ["alarms", "storage", "background", "*://connect.trezor.io/*"] + "host-permissions": ["*://connect.trezor.io/*", "*://127.0.0.1:21325/*"], + "permissions": ["alarms", "storage", "background"] } diff --git a/packages/app-extension/src/refactor/components/TransactionConfirmation.tsx b/packages/app-extension/src/refactor/components/TransactionConfirmation.tsx index 6f894e3f3..583915382 100644 --- a/packages/app-extension/src/refactor/components/TransactionConfirmation.tsx +++ b/packages/app-extension/src/refactor/components/TransactionConfirmation.tsx @@ -175,6 +175,7 @@ export async function withTransactionCancelBypass(fn: Function) { await fn(); } catch (err: any) { const msg = (err.message ?? "") as string; + // FIXME: This throws on SUCCESSFUL token txs submitted through trezor console.error("unable to create transaction", err); if ( diff --git a/packages/app-extension/src/webextension/trezor/README.md b/packages/app-extension/src/webextension/trezor/README.md index 9ab79d889..d610a6592 100644 --- a/packages/app-extension/src/webextension/trezor/README.md +++ b/packages/app-extension/src/webextension/trezor/README.md @@ -1,2 +1,17 @@ -Contents of this directory copied directly from -https://github.com/trezor/connect/tree/develop/src/js/plugins/webextension +The process of building these files is as follows: +Follow the install steps here: +https://github.com/trezor/trezor-suite/tree/develop/packages/connect-examples/webextension-mv3-sw + +Namely: +Clone the `trezor/trezor-suite` repo, then inside it run: + +``` + yarn + yarn build:libs + yarn workspace @trezor/connect-webextension build + node packages/connect-examples/update-webextensions-sw.js + yarn workspace @trezor/connect-iframe build:core-module +``` + +You'll find the requisite files in `packages/connect-webextension/build`, copy them here +If additional files are necessary, modify the webpack config in `app-extension/webpack.config.js` to include them diff --git a/packages/app-extension/src/webextension/trezor/trezor-content-script.js b/packages/app-extension/src/webextension/trezor/trezor-content-script.js index 151034600..125cb6685 100644 --- a/packages/app-extension/src/webextension/trezor/trezor-content-script.js +++ b/packages/app-extension/src/webextension/trezor/trezor-content-script.js @@ -1,21 +1,2757 @@ -/* -Passing messages from background script to popup -*/ +/******/ (() => { + // webpackBootstrap + /******/ var __webpack_modules__ = { + /***/ 312: /***/ ( + __unused_webpack_module, + exports, + __webpack_require__ + ) => { + "use strict"; + var __webpack_unused_export__; + + __webpack_unused_export__ = { + value: true, + }; + exports.E = void 0; + const connect_common_1 = __webpack_require__(424); + class WindowServiceWorkerChannel extends connect_common_1.AbstractMessageChannel { + constructor({ name, channel }) { + super({ + channel, + sendFn: (message) => { + if (!this.port) throw new Error("port not assigned"); + this.port.postMessage(message); + }, + }); + const port = chrome.runtime.connect({ + name, + }); + this.port = port; + this.connect(); + } + connect() { + var _a; + (_a = this.port) === null || _a === void 0 + ? void 0 + : _a.onMessage.addListener((message) => { + if (message.channel.here === this.channel.here) return; + this.onMessage(message); + }); + this.isConnected = true; + } + disconnect() { + var _a; + if (!this.isConnected) return; + (_a = this.port) === null || _a === void 0 ? void 0 : _a.disconnect(); + this.isConnected = false; + } + } + exports.E = WindowServiceWorkerChannel; + + /***/ + }, -let port = chrome.runtime.connect({ name: "trezor-connect" }); -port.onMessage.addListener((message) => { - window.postMessage(message, window.location.origin); -}); -port.onDisconnect.addListener(() => { - port = null; -}); + /***/ 424: /***/ ( + __unused_webpack_module, + __webpack_exports__, + __webpack_require__ + ) => { + "use strict"; + // ESM COMPAT FLAG + __webpack_require__.r(__webpack_exports__); -/* -Passing messages from popup to background script + // EXPORTS + __webpack_require__.d(__webpack_exports__, { + AbstractMessageChannel: () => /* reexport */ AbstractMessageChannel, + getInstallerPackage: () => /* reexport */ getInstallerPackage, + getSystemInfo: () => /* reexport */ getSystemInfo, + storage: () => /* reexport */ storage, + }); + + // EXTERNAL MODULE: ../../node_modules/events/events.js + var events = __webpack_require__(928); // CONCATENATED MODULE: ../utils/src/typedEventEmitter.ts + /* +Usage example: +type EventMap = { + obj: { id: string }; + primitive: boolean | number | string | symbol; + noArgs: undefined; + multipleArgs: (a: number, b: string, c: boolean) => void; + [type: `dynamic/${string}`]: boolean; +}; */ -window.addEventListener("message", (event) => { - if (port && event.source === window && event.data) { - port.postMessage({ data: event.data }); + // NOTE: case 1. looks like case 4. but works differently. the order matters + + // 4. default + + // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging + class TypedEmitter extends events.EventEmitter { + // implement at least one function + listenerCount(eventName) { + return super.listenerCount(eventName); + } + } // CONCATENATED MODULE: ../connect-common/src/storage.ts + // https://github.com/trezor/connect/blob/develop/src/js/storage/index.js + + const storageVersion = 2; + const storageName = `storage_v${storageVersion}`; + + /** + * remembered: + * - physical device from webusb pairing dialogue + * - passphrase to be used + */ + + // TODO: move storage somewhere else. Having it here brings couple of problems: + // - We can not import types from connect (would cause cyclic dependency) + // - it has here dependency on window object, not good + + const getEmptyState = () => ({ + origin: {}, + }); + let memoryStorage = getEmptyState(); + const getPermanentStorage = () => { + const ls = localStorage.getItem(storageName); + return ls ? JSON.parse(ls) : getEmptyState(); + }; + class Storage extends TypedEmitter { + save(getNewState, temporary = false) { + if (temporary || !__webpack_require__.g.window) { + memoryStorage = getNewState(memoryStorage); + return; + } + try { + const newState = getNewState(getPermanentStorage()); + localStorage.setItem(storageName, JSON.stringify(newState)); + this.emit("changed", newState); + } catch (err) { + // memory storage is fallback of the last resort + console.warn("long term storage not available"); + memoryStorage = getNewState(memoryStorage); + } + } + saveForOrigin(getNewState, origin, temporary = false) { + this.save( + (state) => ({ + ...state, + origin: { + ...state.origin, + [origin]: getNewState(state.origin?.[origin] || {}), + }, + }), + temporary + ); + } + load(temporary = false) { + if (temporary || !__webpack_require__.g?.window?.localStorage) { + return memoryStorage; + } + try { + return getPermanentStorage(); + } catch (err) { + // memory storage is fallback of the last resort + console.warn("long term storage not available"); + return memoryStorage; + } + } + loadForOrigin(origin, temporary = false) { + const state = this.load(temporary); + return state.origin?.[origin] || {}; + } + } + const storage = new Storage(); // CONCATENATED MODULE: ../utils/src/createDeferred.ts + + // unwrap promise response from Deferred + + const createDeferred = (id) => { + let localResolve = () => {}; + let localReject = () => {}; + const promise = new Promise((resolve, reject) => { + localResolve = resolve; + localReject = reject; + }); + return { + id, + resolve: localResolve, + reject: localReject, + promise, + }; + }; // CONCATENATED MODULE: ../utils/src/scheduleAction.ts + // Ignored when attempts is AttemptParams[] + + const isArray = (attempts) => Array.isArray(attempts); + const abortedBySignal = () => new Error("Aborted by signal"); + const abortedByDeadline = () => new Error("Aborted by deadline"); + const abortedByTimeout = () => new Error("Aborted by timeout"); + const resolveAfterMs = (ms, clear) => + new Promise((resolve, reject) => { + if (clear.aborted) return reject(); + if (ms === undefined) return resolve(); + const timeout = setTimeout(resolve, ms); + const onClear = () => { + clearTimeout(timeout); + clear.removeEventListener("abort", onClear); + reject(); + }; + clear.addEventListener("abort", onClear); + }); + const rejectAfterMs = (ms, reason, clear) => + new Promise((_, reject) => { + if (clear.aborted) return reject(); + const timeout = + ms !== undefined + ? setTimeout(() => reject(reason()), ms) + : undefined; + const onClear = () => { + clearTimeout(timeout); + clear.removeEventListener("abort", onClear); + reject(); + }; + clear.addEventListener("abort", onClear); + }); + const rejectWhenAborted = (signal, clear) => + new Promise((_, reject) => { + if (clear.aborted) return reject(); + if (signal?.aborted) return reject(abortedBySignal()); + const onAbort = () => reject(abortedBySignal()); + signal?.addEventListener("abort", onAbort); + const onClear = () => { + signal?.removeEventListener("abort", onAbort); + clear.removeEventListener("abort", onClear); + reject(); + }; + clear.addEventListener("abort", onClear); + }); + const resolveAction = async (action, clear) => { + const aborter = new AbortController(); + const onClear = () => aborter.abort(); + if (clear.aborted) onClear(); + clear.addEventListener("abort", onClear); + try { + return await new Promise((resolve) => + resolve(action(aborter.signal)) + ); + } finally { + clear.removeEventListener("abort", onClear); + } + }; + const attemptLoop = async (attempts, attempt, failure, clear) => { + // Tries only (attempts - 1) times, because the last attempt throws its error + for (let a = 0; a < attempts - 1; a++) { + if (clear.aborted) break; + const aborter = new AbortController(); + const onClear = () => aborter.abort(); + clear.addEventListener("abort", onClear); + try { + return await attempt(a, aborter.signal); + } catch { + onClear(); + await failure(a); + } finally { + clear.removeEventListener("abort", onClear); + } + } + return clear.aborted ? Promise.reject() : attempt(attempts - 1, clear); + }; + const scheduleAction = async (action, params) => { + const { signal, delay, attempts, timeout, deadline, gap } = params; + const deadlineMs = deadline && deadline - Date.now(); + const attemptCount = isArray(attempts) + ? attempts.length + : attempts ?? (deadline ? Infinity : 1); + const clearAborter = new AbortController(); + const clear = clearAborter.signal; + const getParams = isArray(attempts) + ? (attempt) => attempts[attempt] + : () => ({ + timeout, + gap, + }); + try { + return await Promise.race([ + rejectWhenAborted(signal, clear), + rejectAfterMs(deadlineMs, abortedByDeadline, clear), + resolveAfterMs(delay, clear).then(() => + attemptLoop( + attemptCount, + (attempt, abort) => + Promise.race([ + rejectAfterMs( + getParams(attempt).timeout, + abortedByTimeout, + clear + ), + resolveAction(action, abort), + ]), + (attempt) => resolveAfterMs(getParams(attempt).gap ?? 0, clear), + clear + ) + ), + ]); + } finally { + clearAborter.abort(); + } + }; // CONCATENATED MODULE: ../connect-common/src/messageChannel/abstract.ts + /** + * IMPORTS WARNING + * this file is bundled into content script so be careful what you are importing not to bloat the bundle + */ + + // TODO: so logger should be probably moved to connect common, or this file should be moved to connect + // import type { Log } from '@trezor/connect/lib/utils/debug'; + + /** + * concepts: + * - it handshakes automatically with the other side of the channel + * - it queues messages fired before handshake and sends them after handshake is done + */ + class AbstractMessageChannel extends TypedEmitter { + messagePromises = {}; + /** queue of messages that were scheduled before handshake */ + messagesQueue = []; + messageID = 0; + isConnected = false; + handshakeMaxRetries = 5; + handshakeRetryInterval = 2000; + + /** + * function that passes data to the other side of the channel + */ + + /** + * channel identifiers that pairs AbstractMessageChannel instances on sending and receiving end together + */ + + constructor({ + sendFn, + channel, + logger, + lazyHandshake = false, + legacyMode = false, + }) { + super(); + this.channel = channel; + this.sendFn = sendFn; + this.lazyHandshake = lazyHandshake; + this.legacyMode = legacyMode; + this.logger = logger; + } + + /** + * initiates handshake sequence with peer. resolves after communication with peer is established + */ + init() { + if (!this.handshakeFinished) { + this.handshakeFinished = createDeferred(); + if (this.legacyMode) { + // Bypass handshake for communication with legacy components + // We add a delay for enough time for the other side to be ready + setTimeout(() => { + this.handshakeFinished?.resolve(); + }, 500); + } + if (!this.lazyHandshake) { + // When `lazyHandshake` handshakeWithPeer will start when received channel-handshake-request. + this.handshakeWithPeer(); + } + } + return this.handshakeFinished.promise; + } + + /** + * handshake between both parties of the channel. + * both parties initiate handshake procedure and keep asking over time in a loop until they time out or receive confirmation from peer + */ + handshakeWithPeer() { + this.logger?.log(this.channel.here, "handshake"); + return scheduleAction( + async () => { + this.postMessage( + { + type: "channel-handshake-request", + data: { + success: true, + payload: undefined, + }, + }, + { + usePromise: false, + useQueue: false, + } + ); + await this.handshakeFinished?.promise; + }, + { + attempts: this.handshakeMaxRetries, + timeout: this.handshakeRetryInterval, + } + ) + .then(() => { + this.logger?.log(this.channel.here, "handshake confirmed"); + this.messagesQueue.forEach((message) => { + message.channel = this.channel; + this.sendFn(message); + }); + this.messagesQueue = []; + }) + .catch(() => { + this.handshakeFinished?.reject(new Error("handshake failed")); + this.handshakeFinished = undefined; + }); + } + + /** + * message received from communication channel in descendants of this class + * should be handled by this common onMessage method + */ + onMessage(_message) { + // Older code used to send message as a data property of the message object. + // This is a workaround to keep backward compatibility. + let message = _message; + if ( + this.legacyMode && + message.type === undefined && + "data" in message && + typeof message.data === "object" && + message.data !== null && + "type" in message.data && + typeof message.data.type === "string" + ) { + // @ts-expect-error + message = message.data; + } + const { channel, id, type, payload, success } = message; + + // Don't verify channel in legacy mode + if (!this.legacyMode) { + if (!channel?.peer || channel.peer !== this.channel.here) { + // To wrong peer + return; + } + if (!channel?.here || this.channel.peer !== channel.here) { + // From wrong peer + return; + } + } + if (type === "channel-handshake-request") { + this.postMessage( + { + type: "channel-handshake-confirm", + data: { + success: true, + payload: undefined, + }, + }, + { + usePromise: false, + useQueue: false, + } + ); + if (this.lazyHandshake) { + // When received channel-handshake-request in lazyHandshake mode we start from this side. + this.handshakeWithPeer(); + } + return; + } + if (type === "channel-handshake-confirm") { + this.handshakeFinished?.resolve(undefined); + return; + } + if (this.messagePromises[id]) { + this.messagePromises[id].resolve({ + id, + payload, + success, + }); + delete this.messagePromises[id]; + } + const messagePromisesLength = Object.keys( + this.messagePromises + ).length; + if (messagePromisesLength > 5) { + this.logger?.warn( + `too many message promises (${messagePromisesLength}). this feels unexpected!` + ); + } + + // @ts-expect-error TS complains for odd reasons + this.emit("message", message); + } + + // todo: outgoing messages should be typed + postMessage(message, { usePromise = true, useQueue = true } = {}) { + message.channel = this.channel; + if (!usePromise) { + try { + this.sendFn(message); + } catch (err) { + if (useQueue) { + this.messagesQueue.push(message); + } + } + return; + } + this.messageID++; + message.id = this.messageID; + this.messagePromises[message.id] = createDeferred(); + try { + this.sendFn(message); + } catch (err) { + if (useQueue) { + this.messagesQueue.push(message); + } + } + return this.messagePromises[message.id].promise; + } + resolveMessagePromises(resolvePayload) { + // This is used when we know that the connection has been interrupted but there might be something waiting for it. + Object.keys(this.messagePromises).forEach((id) => + this.messagePromises[id].resolve({ + id, + payload: resolvePayload, + }) + ); + } + clear() { + this.handshakeFinished = undefined; + } + } + // EXTERNAL MODULE: ../../node_modules/ua-parser-js/src/ua-parser.js + var ua_parser = __webpack_require__(332); + var ua_parser_default = /*#__PURE__*/ __webpack_require__.n(ua_parser); // CONCATENATED MODULE: ../env-utils/src/envUtils.ts + const isWeb = () => process.env.SUITE_TYPE === "web"; + const isDesktop = () => process.env.SUITE_TYPE === "desktop"; + const isNative = () => false; + const getEnvironment = () => { + if (isWeb()) return "web"; + return "desktop"; + }; + let userAgentParser; + + /* This way, we can override simple utils, which helps to polyfill methods which are not available in react-native. */ + const getUserAgent = () => window.navigator.userAgent; + const getUserAgentParser = () => { + if (!userAgentParser) { + const ua = getUserAgent(); + userAgentParser = new (ua_parser_default())(ua); + } + return userAgentParser; + }; + const isAndroid = () => /Android/.test(getUserAgent()); + const isChromeOs = () => /CrOS/.test(getUserAgent()); + const getBrowserVersion = () => + getUserAgentParser().getBrowser().version || ""; + const getCommitHash = () => process.env.COMMITHASH || ""; + + /* Not correct for Linux as there is many different distributions in different versions */ + const getOsVersion = () => getUserAgentParser().getOS().version || ""; + const getSuiteVersion = () => process.env.VERSION || ""; + const getBrowserName = () => { + const browserName = getUserAgentParser().getBrowser().name; + return browserName?.toLowerCase() || ""; + }; + const isFirefox = () => getBrowserName() === "firefox"; + + // List of platforms https://docker.apachezone.com/blog/74 + const getPlatform = () => window.navigator.platform; + const getPlatformLanguages = () => window.navigator.languages; + const getScreenWidth = () => window.screen.width; + const getScreenHeight = () => window.screen.height; + const getWindowWidth = () => window.innerWidth; + const getWindowHeight = () => window.innerHeight; + const getLocationOrigin = () => window.location.origin; + const getLocationHostname = () => window.location.hostname; + const getProcessPlatform = () => + typeof process !== "undefined" ? process.platform : ""; + const isMacOs = () => { + if (getProcessPlatform() === "darwin") return true; + if (typeof window === "undefined") return; + return getPlatform().startsWith("Mac"); + }; + const isWindows = () => { + if (getProcessPlatform() === "win32") return true; + if (typeof window === "undefined") return; + return getPlatform().startsWith("Win"); + }; + const isIOs = () => ["iPhone", "iPad", "iPod"].includes(getPlatform()); + const isLinux = () => { + if (getProcessPlatform() === "linux") return true; + if (typeof window === "undefined") return; + + // exclude Android and Chrome OS as window.navigator.platform of those OS is Linux + if (isAndroid() || isChromeOs()) return false; + return getPlatform().startsWith("Linux"); + }; + const isCodesignBuild = () => process.env.IS_CODESIGN_BUILD === "true"; + const getOsName = () => { + if (isWindows()) return "windows"; + if (isMacOs()) return "macos"; + if (isAndroid()) return "android"; + if (isChromeOs()) return "chromeos"; + if (isLinux()) return "linux"; + if (isIOs()) return "ios"; + return ""; + }; + const getOsNameWeb = () => getUserAgentParser().getOS().name; + const getOsFamily = () => { + const osName = getUserAgentParser().getOS().name; + if (osName === "Windows") { + return "Windows"; + } + if (osName === "Mac OS") { + return "MacOS"; + } + return "Linux"; + }; + const getDeviceType = () => getUserAgentParser().getDevice().type; + const envUtils = { + isWeb, + isDesktop, + isNative, + getEnvironment, + getUserAgent, + isAndroid, + isChromeOs, + getOsVersion, + getBrowserName, + getBrowserVersion, + getCommitHash, + getDeviceType, + getSuiteVersion, + isFirefox, + getPlatform, + getPlatformLanguages, + getScreenWidth, + getScreenHeight, + getWindowWidth, + getWindowHeight, + getLocationOrigin, + getLocationHostname, + getProcessPlatform, + isMacOs, + isWindows, + isIOs, + isLinux, + isCodesignBuild, + getOsName, + getOsNameWeb, + getOsFamily, + }; // CONCATENATED MODULE: ../env-utils/src/index.ts + const { + isWeb: src_isWeb, + isDesktop: src_isDesktop, + isNative: src_isNative, + getEnvironment: src_getEnvironment, + getUserAgent: src_getUserAgent, + isAndroid: src_isAndroid, + isChromeOs: src_isChromeOs, + getBrowserVersion: src_getBrowserVersion, + getBrowserName: src_getBrowserName, + getCommitHash: src_getCommitHash, + getDeviceType: src_getDeviceType, + getOsVersion: src_getOsVersion, + getSuiteVersion: src_getSuiteVersion, + isFirefox: src_isFirefox, + getPlatform: src_getPlatform, + getPlatformLanguages: src_getPlatformLanguages, + getScreenWidth: src_getScreenWidth, + getScreenHeight: src_getScreenHeight, + getWindowWidth: src_getWindowWidth, + getWindowHeight: src_getWindowHeight, + getLocationOrigin: src_getLocationOrigin, + getLocationHostname: src_getLocationHostname, + getProcessPlatform: src_getProcessPlatform, + isMacOs: src_isMacOs, + isWindows: src_isWindows, + isIOs: src_isIOs, + isLinux: src_isLinux, + isCodesignBuild: src_isCodesignBuild, + getOsName: src_getOsName, + getOsNameWeb: src_getOsNameWeb, + getOsFamily: src_getOsFamily, + } = envUtils; // CONCATENATED MODULE: ../connect-common/src/systemInfo.ts + const getInstallerPackage = () => { + const agent = src_getUserAgent(); + switch (src_getOsFamily()) { + case "MacOS": + return "mac"; + case "Windows": { + const arch = agent.match(/(Win64|WOW64)/) ? "64" : "32"; + return `win${arch}`; + } + case "Linux": { + const isRpm = agent.match( + /CentOS|Fedora|Mandriva|Mageia|Red Hat|Scientific|SUSE/ + ) + ? "rpm" + : "deb"; + const is64x = agent.match(/Linux i[3456]86/) ? "32" : "64"; + return `${isRpm}${is64x}`; + } + default: + // no default, type safe + } + }; + const getSystemInfo = (supportedBrowsers) => { + const browserName = src_getBrowserName(); + const browserVersion = src_getBrowserVersion(); + const supportedBrowser = browserName + ? supportedBrowsers[browserName.toLowerCase()] + : undefined; + const outdatedBrowser = supportedBrowser + ? supportedBrowser.version > parseInt(browserVersion, 10) + : false; + const mobile = src_getDeviceType() === "mobile"; + const supportedMobile = mobile ? "usb" in navigator : true; + const supported = !!( + supportedBrowser && + !outdatedBrowser && + supportedMobile + ); + return { + os: { + family: src_getOsFamily(), + mobile, + }, + browser: { + supported, + outdated: outdatedBrowser, + }, + }; + }; // CONCATENATED MODULE: ../connect-common/src/index.ts + + /***/ + }, + + /***/ 928: /***/ (module) => { + "use strict"; + // Copyright Joyent, Inc. and other Node contributors. + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the + // "Software"), to deal in the Software without restriction, including + // without limitation the rights to use, copy, modify, merge, publish, + // distribute, sublicense, and/or sell copies of the Software, and to permit + // persons to whom the Software is furnished to do so, subject to the + // following conditions: + // + // The above copyright notice and this permission notice shall be included + // in all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + + var R = typeof Reflect === "object" ? Reflect : null; + var ReflectApply = + R && typeof R.apply === "function" + ? R.apply + : function ReflectApply(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); + }; + + var ReflectOwnKeys; + if (R && typeof R.ownKeys === "function") { + ReflectOwnKeys = R.ownKeys; + } else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target).concat( + Object.getOwnPropertySymbols(target) + ); + }; + } else { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target); + }; + } + + function ProcessEmitWarning(warning) { + if (console && console.warn) console.warn(warning); + } + + var NumberIsNaN = + Number.isNaN || + function NumberIsNaN(value) { + return value !== value; + }; + + function EventEmitter() { + EventEmitter.init.call(this); + } + module.exports = EventEmitter; + module.exports.once = once; + + // Backwards-compat with node 0.10.x + EventEmitter.EventEmitter = EventEmitter; + + EventEmitter.prototype._events = undefined; + EventEmitter.prototype._eventsCount = 0; + EventEmitter.prototype._maxListeners = undefined; + + // By default EventEmitters will print a warning if more than 10 listeners are + // added to it. This is a useful default which helps finding memory leaks. + var defaultMaxListeners = 10; + + function checkListener(listener) { + if (typeof listener !== "function") { + throw new TypeError( + 'The "listener" argument must be of type Function. Received type ' + + typeof listener + ); + } + } + + Object.defineProperty(EventEmitter, "defaultMaxListeners", { + enumerable: true, + get: function () { + return defaultMaxListeners; + }, + set: function (arg) { + if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError( + 'The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + + arg + + "." + ); + } + defaultMaxListeners = arg; + }, + }); + + EventEmitter.init = function () { + if ( + this._events === undefined || + this._events === Object.getPrototypeOf(this)._events + ) { + this._events = Object.create(null); + this._eventsCount = 0; + } + + this._maxListeners = this._maxListeners || undefined; + }; + + // Obviously not all Emitters should be limited to 10. This function allows + // that to be increased. Set to zero for unlimited. + EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) { + throw new RangeError( + 'The value of "n" is out of range. It must be a non-negative number. Received ' + + n + + "." + ); + } + this._maxListeners = n; + return this; + }; + + function _getMaxListeners(that) { + if (that._maxListeners === undefined) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; + } + + EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return _getMaxListeners(this); + }; + + EventEmitter.prototype.emit = function emit(type) { + var args = []; + for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); + var doError = type === "error"; + + var events = this._events; + if (events !== undefined) + doError = doError && events.error === undefined; + else if (!doError) return false; + + // If there is no 'error' event listener then throw. + if (doError) { + var er; + if (args.length > 0) er = args[0]; + if (er instanceof Error) { + // Note: The comments on the `throw` lines are intentional, they show + // up in Node's output if this results in an unhandled exception. + throw er; // Unhandled 'error' event + } + // At least give some kind of context to the user + var err = new Error( + "Unhandled error." + (er ? " (" + er.message + ")" : "") + ); + err.context = er; + throw err; // Unhandled 'error' event + } + + var handler = events[type]; + + if (handler === undefined) return false; + + if (typeof handler === "function") { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) ReflectApply(listeners[i], this, args); + } + + return true; + }; + + function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; + + checkListener(listener); + + events = target._events; + if (events === undefined) { + events = target._events = Object.create(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener !== undefined) { + target.emit( + "newListener", + type, + listener.listener ? listener.listener : listener + ); + + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } + + if (existing === undefined) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === "function") { + // Adding the second element, need to change to array. + existing = events[type] = prepend + ? [listener, existing] + : [existing, listener]; + // If we've already got an array, just append. + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + + // Check for listener leak + m = _getMaxListeners(target); + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + // No error code for this since it is a Warning + // eslint-disable-next-line no-restricted-syntax + var w = new Error( + "Possible EventEmitter memory leak detected. " + + existing.length + + " " + + String(type) + + " listeners " + + "added. Use emitter.setMaxListeners() to " + + "increase limit" + ); + w.name = "MaxListenersExceededWarning"; + w.emitter = target; + w.type = type; + w.count = existing.length; + ProcessEmitWarning(w); + } + } + + return target; + } + + EventEmitter.prototype.addListener = function addListener( + type, + listener + ) { + return _addListener(this, type, listener, false); + }; + + EventEmitter.prototype.on = EventEmitter.prototype.addListener; + + EventEmitter.prototype.prependListener = function prependListener( + type, + listener + ) { + return _addListener(this, type, listener, true); + }; + + function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + if (arguments.length === 0) return this.listener.call(this.target); + return this.listener.apply(this.target, arguments); + } + } + + function _onceWrap(target, type, listener) { + var state = { + fired: false, + wrapFn: undefined, + target: target, + type: type, + listener: listener, + }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; + } + + EventEmitter.prototype.once = function once(type, listener) { + checkListener(listener); + this.on(type, _onceWrap(this, type, listener)); + return this; + }; + + EventEmitter.prototype.prependOnceListener = function prependOnceListener( + type, + listener + ) { + checkListener(listener); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; + + // Emits a 'removeListener' event if and only if the listener was removed. + EventEmitter.prototype.removeListener = function removeListener( + type, + listener + ) { + var list, events, position, i, originalListener; + + checkListener(listener); + + events = this._events; + if (events === undefined) return this; + + list = events[type]; + if (list === undefined) return this; + + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) this._events = Object.create(null); + else { + delete events[type]; + if (events.removeListener) + this.emit("removeListener", type, list.listener || listener); + } + } else if (typeof list !== "function") { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } + + if (position < 0) return this; + + if (position === 0) list.shift(); + else { + spliceOne(list, position); + } + + if (list.length === 1) events[type] = list[0]; + + if (events.removeListener !== undefined) + this.emit("removeListener", type, originalListener || listener); + } + + return this; + }; + + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + + EventEmitter.prototype.removeAllListeners = function removeAllListeners( + type + ) { + var listeners, events, i; + + events = this._events; + if (events === undefined) return this; + + // not listening for removeListener, no need to emit + if (events.removeListener === undefined) { + if (arguments.length === 0) { + this._events = Object.create(null); + this._eventsCount = 0; + } else if (events[type] !== undefined) { + if (--this._eventsCount === 0) this._events = Object.create(null); + else delete events[type]; + } + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = Object.keys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === "removeListener") continue; + this.removeAllListeners(key); + } + this.removeAllListeners("removeListener"); + this._events = Object.create(null); + this._eventsCount = 0; + return this; + } + + listeners = events[type]; + + if (typeof listeners === "function") { + this.removeListener(type, listeners); + } else if (listeners !== undefined) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } + + return this; + }; + + function _listeners(target, type, unwrap) { + var events = target._events; + + if (events === undefined) return []; + + var evlistener = events[type]; + if (evlistener === undefined) return []; + + if (typeof evlistener === "function") + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + + return unwrap + ? unwrapListeners(evlistener) + : arrayClone(evlistener, evlistener.length); + } + + EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); + }; + + EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); + }; + + EventEmitter.listenerCount = function (emitter, type) { + if (typeof emitter.listenerCount === "function") { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } + }; + + EventEmitter.prototype.listenerCount = listenerCount; + function listenerCount(type) { + var events = this._events; + + if (events !== undefined) { + var evlistener = events[type]; + + if (typeof evlistener === "function") { + return 1; + } else if (evlistener !== undefined) { + return evlistener.length; + } + } + + return 0; + } + + EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; + }; + + function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) copy[i] = arr[i]; + return copy; + } + + function spliceOne(list, index) { + for (; index + 1 < list.length; index++) list[index] = list[index + 1]; + list.pop(); + } + + function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; + } + + function once(emitter, name) { + return new Promise(function (resolve, reject) { + function errorListener(err) { + emitter.removeListener(name, resolver); + reject(err); + } + + function resolver() { + if (typeof emitter.removeListener === "function") { + emitter.removeListener("error", errorListener); + } + resolve([].slice.call(arguments)); + } + + eventTargetAgnosticAddListener(emitter, name, resolver, { + once: true, + }); + if (name !== "error") { + addErrorHandlerIfEventEmitter(emitter, errorListener, { + once: true, + }); + } + }); + } + + function addErrorHandlerIfEventEmitter(emitter, handler, flags) { + if (typeof emitter.on === "function") { + eventTargetAgnosticAddListener(emitter, "error", handler, flags); + } + } + + function eventTargetAgnosticAddListener(emitter, name, listener, flags) { + if (typeof emitter.on === "function") { + if (flags.once) { + emitter.once(name, listener); + } else { + emitter.on(name, listener); + } + } else if (typeof emitter.addEventListener === "function") { + // EventTarget does not have `error` event semantics like Node + // EventEmitters, we do not listen for `error` events here. + emitter.addEventListener(name, function wrapListener(arg) { + // IE does not have builtin `{ once: true }` support so we + // have to do it manually. + if (flags.once) { + emitter.removeEventListener(name, wrapListener); + } + listener(arg); + }); + } else { + throw new TypeError( + 'The "emitter" argument must be of type EventEmitter. Received type ' + + typeof emitter + ); + } + } + + /***/ + }, + + /***/ 332: /***/ function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_RESULT__; ///////////////////////////////////////////////////////////////////////////////// + /* UAParser.js v1.0.37 + Copyright © 2012-2021 Faisal Salman + MIT License */ /* + Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. + Supports browser & node.js environment. + Demo : https://faisalman.github.io/ua-parser-js + Source : https://github.com/faisalman/ua-parser-js */ + ///////////////////////////////////////////////////////////////////////////////// + + (function (window, undefined) { + "use strict"; + + ////////////// + // Constants + ///////////// + + var LIBVERSION = "1.0.37", + EMPTY = "", + UNKNOWN = "?", + FUNC_TYPE = "function", + UNDEF_TYPE = "undefined", + OBJ_TYPE = "object", + STR_TYPE = "string", + MAJOR = "major", + MODEL = "model", + NAME = "name", + TYPE = "type", + VENDOR = "vendor", + VERSION = "version", + ARCHITECTURE = "architecture", + CONSOLE = "console", + MOBILE = "mobile", + TABLET = "tablet", + SMARTTV = "smarttv", + WEARABLE = "wearable", + EMBEDDED = "embedded", + UA_MAX_LENGTH = 500; + + var AMAZON = "Amazon", + APPLE = "Apple", + ASUS = "ASUS", + BLACKBERRY = "BlackBerry", + BROWSER = "Browser", + CHROME = "Chrome", + EDGE = "Edge", + FIREFOX = "Firefox", + GOOGLE = "Google", + HUAWEI = "Huawei", + LG = "LG", + MICROSOFT = "Microsoft", + MOTOROLA = "Motorola", + OPERA = "Opera", + SAMSUNG = "Samsung", + SHARP = "Sharp", + SONY = "Sony", + XIAOMI = "Xiaomi", + ZEBRA = "Zebra", + FACEBOOK = "Facebook", + CHROMIUM_OS = "Chromium OS", + MAC_OS = "Mac OS"; + + /////////// + // Helper + ////////// + + var extend = function (regexes, extensions) { + var mergedRegexes = {}; + for (var i in regexes) { + if (extensions[i] && extensions[i].length % 2 === 0) { + mergedRegexes[i] = extensions[i].concat(regexes[i]); + } else { + mergedRegexes[i] = regexes[i]; + } + } + return mergedRegexes; + }, + enumerize = function (arr) { + var enums = {}; + for (var i = 0; i < arr.length; i++) { + enums[arr[i].toUpperCase()] = arr[i]; + } + return enums; + }, + has = function (str1, str2) { + return typeof str1 === STR_TYPE + ? lowerize(str2).indexOf(lowerize(str1)) !== -1 + : false; + }, + lowerize = function (str) { + return str.toLowerCase(); + }, + majorize = function (version) { + return typeof version === STR_TYPE + ? version.replace(/[^\d\.]/g, EMPTY).split(".")[0] + : undefined; + }, + trim = function (str, len) { + if (typeof str === STR_TYPE) { + str = str.replace(/^\s\s*/, EMPTY); + return typeof len === UNDEF_TYPE + ? str + : str.substring(0, UA_MAX_LENGTH); + } + }; + + /////////////// + // Map helper + ////////////// + + var rgxMapper = function (ua, arrays) { + var i = 0, + j, + k, + p, + q, + matches, + match; + + // loop through all regexes maps + while (i < arrays.length && !matches) { + var regex = arrays[i], // even sequence (0,2,4,..) + props = arrays[i + 1]; // odd sequence (1,3,5,..) + j = k = 0; + + // try matching uastring with regexes + while (j < regex.length && !matches) { + if (!regex[j]) { + break; + } + matches = regex[j++].exec(ua); + + if (!!matches) { + for (p = 0; p < props.length; p++) { + match = matches[++k]; + q = props[p]; + // check if given property is actually array + if (typeof q === OBJ_TYPE && q.length > 0) { + if (q.length === 2) { + if (typeof q[1] == FUNC_TYPE) { + // assign modified match + this[q[0]] = q[1].call(this, match); + } else { + // assign given value, ignore regex match + this[q[0]] = q[1]; + } + } else if (q.length === 3) { + // check whether function or regex + if ( + typeof q[1] === FUNC_TYPE && + !(q[1].exec && q[1].test) + ) { + // call function (usually string mapper) + this[q[0]] = match + ? q[1].call(this, match, q[2]) + : undefined; + } else { + // sanitize match using given regex + this[q[0]] = match + ? match.replace(q[1], q[2]) + : undefined; + } + } else if (q.length === 4) { + this[q[0]] = match + ? q[3].call(this, match.replace(q[1], q[2])) + : undefined; + } + } else { + this[q] = match ? match : undefined; + } + } + } + } + i += 2; + } + }, + strMapper = function (str, map) { + for (var i in map) { + // check if current value is array + if (typeof map[i] === OBJ_TYPE && map[i].length > 0) { + for (var j = 0; j < map[i].length; j++) { + if (has(map[i][j], str)) { + return i === UNKNOWN ? undefined : i; + } + } + } else if (has(map[i], str)) { + return i === UNKNOWN ? undefined : i; + } + } + return str; + }; + + /////////////// + // String map + ////////////// + + // Safari < 3.0 + var oldSafariMap = { + "1.0": "/8", + 1.2: "/1", + 1.3: "/3", + "2.0": "/412", + "2.0.2": "/416", + "2.0.3": "/417", + "2.0.4": "/419", + "?": "/", + }, + windowsVersionMap = { + ME: "4.90", + "NT 3.11": "NT3.51", + "NT 4.0": "NT4.0", + 2000: "NT 5.0", + XP: ["NT 5.1", "NT 5.2"], + Vista: "NT 6.0", + 7: "NT 6.1", + 8: "NT 6.2", + 8.1: "NT 6.3", + 10: ["NT 6.4", "NT 10.0"], + RT: "ARM", + }; + + ////////////// + // Regex map + ///////////// + + var regexes = { + browser: [ + [ + /\b(?:crmo|crios)\/([\w\.]+)/i, // Chrome for Android/iOS + ], + [VERSION, [NAME, "Chrome"]], + [ + /edg(?:e|ios|a)?\/([\w\.]+)/i, // Microsoft Edge + ], + [VERSION, [NAME, "Edge"]], + [ + // Presto based + /(opera mini)\/([-\w\.]+)/i, // Opera Mini + /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, // Opera Mobi/Tablet + /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i, // Opera + ], + [NAME, VERSION], + [ + /opios[\/ ]+([\w\.]+)/i, // Opera mini on iphone >= 8.0 + ], + [VERSION, [NAME, OPERA + " Mini"]], + [ + /\bopr\/([\w\.]+)/i, // Opera Webkit + ], + [VERSION, [NAME, OPERA]], + [ + // Mixed + /\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i, // Baidu + ], + [VERSION, [NAME, "Baidu"]], + [ + /(kindle)\/([\w\.]+)/i, // Kindle + /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer + // Trident based + /(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser + /(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer + + // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon + /(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i, + // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ + /(heytap|ovi)browser\/([\d\.]+)/i, // Heytap/Ovi + /(weibo)__([\d\.]+)/i, // Weibo + ], + [NAME, VERSION], + [ + /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i, // UCBrowser + ], + [VERSION, [NAME, "UC" + BROWSER]], + [ + /microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser + /\bqbcore\/([\w\.]+).+microm/i, + /micromessenger\/([\w\.]+)/i, // WeChat + ], + [VERSION, [NAME, "WeChat"]], + [ + /konqueror\/([\w\.]+)/i, // Konqueror + ], + [VERSION, [NAME, "Konqueror"]], + [ + /trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i, // IE11 + ], + [VERSION, [NAME, "IE"]], + [ + /ya(?:search)?browser\/([\w\.]+)/i, // Yandex + ], + [VERSION, [NAME, "Yandex"]], + [ + /slbrowser\/([\w\.]+)/i, // Smart Lenovo Browser + ], + [VERSION, [NAME, "Smart Lenovo " + BROWSER]], + [ + /(avast|avg)\/([\w\.]+)/i, // Avast/AVG Secure Browser + ], + [[NAME, /(.+)/, "$1 Secure " + BROWSER], VERSION], + [ + /\bfocus\/([\w\.]+)/i, // Firefox Focus + ], + [VERSION, [NAME, FIREFOX + " Focus"]], + [ + /\bopt\/([\w\.]+)/i, // Opera Touch + ], + [VERSION, [NAME, OPERA + " Touch"]], + [ + /coc_coc\w+\/([\w\.]+)/i, // Coc Coc Browser + ], + [VERSION, [NAME, "Coc Coc"]], + [ + /dolfin\/([\w\.]+)/i, // Dolphin + ], + [VERSION, [NAME, "Dolphin"]], + [ + /coast\/([\w\.]+)/i, // Opera Coast + ], + [VERSION, [NAME, OPERA + " Coast"]], + [ + /miuibrowser\/([\w\.]+)/i, // MIUI Browser + ], + [VERSION, [NAME, "MIUI " + BROWSER]], + [ + /fxios\/([-\w\.]+)/i, // Firefox for iOS + ], + [VERSION, [NAME, FIREFOX]], + [ + /\bqihu|(qi?ho?o?|360)browser/i, // 360 + ], + [[NAME, "360 " + BROWSER]], + [/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i], + [[NAME, /(.+)/, "$1 " + BROWSER], VERSION], + [ + // Oculus/Sailfish/HuaweiBrowser/VivoBrowser + /samsungbrowser\/([\w\.]+)/i, // Samsung Internet + ], + [VERSION, [NAME, SAMSUNG + " Internet"]], + [ + /(comodo_dragon)\/([\w\.]+)/i, // Comodo Dragon + ], + [[NAME, /_/g, " "], VERSION], + [ + /metasr[\/ ]?([\d\.]+)/i, // Sogou Explorer + ], + [VERSION, [NAME, "Sogou Explorer"]], + [ + /(sogou)mo\w+\/([\d\.]+)/i, // Sogou Mobile + ], + [[NAME, "Sogou Mobile"], VERSION], + [ + /(electron)\/([\w\.]+) safari/i, // Electron-based App + /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla + /m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i, // QQBrowser/2345 Browser + ], + [NAME, VERSION], + [ + /(lbbrowser)/i, // LieBao Browser + /\[(linkedin)app\]/i, // LinkedIn App for iOS & Android + ], + [NAME], + [ + // WebView + /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i, // Facebook App for iOS & Android + ], + [[NAME, FACEBOOK], VERSION], + [ + /(Klarna)\/([\w\.]+)/i, // Klarna Shopping Browser for iOS & Android + /(kakao(?:talk|story))[\/ ]([\w\.]+)/i, // Kakao App + /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, // Naver InApp + /safari (line)\/([\w\.]+)/i, // Line App for iOS + /\b(line)\/([\w\.]+)\/iab/i, // Line App for Android + /(alipay)client\/([\w\.]+)/i, // Alipay + /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i, // Chromium/Instagram/Snapchat + ], + [NAME, VERSION], + [ + /\bgsa\/([\w\.]+) .*safari\//i, // Google Search Appliance on iOS + ], + [VERSION, [NAME, "GSA"]], + [ + /musical_ly(?:.+app_?version\/|_)([\w\.]+)/i, // TikTok + ], + [VERSION, [NAME, "TikTok"]], + [ + /headlesschrome(?:\/([\w\.]+)| )/i, // Chrome Headless + ], + [VERSION, [NAME, CHROME + " Headless"]], + [ + / wv\).+(chrome)\/([\w\.]+)/i, // Chrome WebView + ], + [[NAME, CHROME + " WebView"], VERSION], + [ + /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i, // Android Browser + ], + [VERSION, [NAME, "Android " + BROWSER]], + [ + /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i, // Chrome/OmniWeb/Arora/Tizen/Nokia + ], + [NAME, VERSION], + [ + /version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i, // Mobile Safari + ], + [VERSION, [NAME, "Mobile Safari"]], + [ + /version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i, // Safari & Safari Mobile + ], + [VERSION, NAME], + [ + /webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i, // Safari < 3.0 + ], + [NAME, [VERSION, strMapper, oldSafariMap]], + [/(webkit|khtml)\/([\w\.]+)/i], + [NAME, VERSION], + [ + // Gecko based + /(navigator|netscape\d?)\/([-\w\.]+)/i, // Netscape + ], + [[NAME, "Netscape"], VERSION], + [ + /mobile vr; rv:([\w\.]+)\).+firefox/i, // Firefox Reality + ], + [VERSION, [NAME, FIREFOX + " Reality"]], + [ + /ekiohf.+(flow)\/([\w\.]+)/i, // Flow + /(swiftfox)/i, // Swiftfox + /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i, + // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar + /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, + // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix + /(firefox)\/([\w\.]+)/i, // Other Firefox-based + /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, // Mozilla + + // Other + /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, + // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser + /(links) \(([\w\.]+)/i, // Links + /panasonic;(viera)/i, // Panasonic Viera + ], + [NAME, VERSION], + [ + /(cobalt)\/([\w\.]+)/i, // Cobalt + ], + [NAME, [VERSION, /master.|lts./, ""]], + ], + + cpu: [ + [ + /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i, // AMD64 (x64) + ], + [[ARCHITECTURE, "amd64"]], + [ + /(ia32(?=;))/i, // IA32 (quicktime) + ], + [[ARCHITECTURE, lowerize]], + [ + /((?:i[346]|x)86)[;\)]/i, // IA32 (x86) + ], + [[ARCHITECTURE, "ia32"]], + [ + /\b(aarch64|arm(v?8e?l?|_?64))\b/i, // ARM64 + ], + [[ARCHITECTURE, "arm64"]], + [ + /\b(arm(?:v[67])?ht?n?[fl]p?)\b/i, // ARMHF + ], + [[ARCHITECTURE, "armhf"]], + [ + // PocketPC mistakenly identified as PowerPC + /windows (ce|mobile); ppc;/i, + ], + [[ARCHITECTURE, "arm"]], + [ + /((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i, // PowerPC + ], + [[ARCHITECTURE, /ower/, EMPTY, lowerize]], + [ + /(sun4\w)[;\)]/i, // SPARC + ], + [[ARCHITECTURE, "sparc"]], + [ + /((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i, + // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC + ], + [[ARCHITECTURE, lowerize]], + ], + + device: [ + [ + ////////////////////////// + // MOBILES & TABLETS + ///////////////////////// + + // Samsung + /\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i, + ], + [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]], + [ + /\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, + /samsung[- ]([-\w]+)/i, + /sec-(sgh\w+)/i, + ], + [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], + [ + // Apple + /(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i, // iPod/iPhone + ], + [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], + [ + /\((ipad);[-\w\),; ]+apple/i, // iPad + /applecoremedia\/[\w\.]+ \((ipad)/i, + /\b(ipad)\d\d?,\d\d?[;\]].+ios/i, + ], + [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], + [/(macintosh);/i], + [MODEL, [VENDOR, APPLE]], + [ + // Sharp + /\b(sh-?[altvz]?\d\d[a-ekm]?)/i, + ], + [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]], + [ + // Huawei + /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i, + ], + [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], + [ + /(?:huawei|honor)([-\w ]+)[;\)]/i, + /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i, + ], + [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], + [ + // Xiaomi + /\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i, // Xiaomi POCO + /\b; (\w+) build\/hm\1/i, // Xiaomi Hongmi 'numeric' models + /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, // Xiaomi Hongmi + /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, // Xiaomi Redmi + /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i, // Xiaomi Redmi 'numeric' models + /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i, // Xiaomi Mi + ], + [ + [MODEL, /_/g, " "], + [VENDOR, XIAOMI], + [TYPE, MOBILE], + ], + [ + /oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i, // Redmi Pad + /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i, // Mi Pad tablets + ], + [ + [MODEL, /_/g, " "], + [VENDOR, XIAOMI], + [TYPE, TABLET], + ], + [ + // OPPO + /; (\w+) bui.+ oppo/i, + /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i, + ], + [MODEL, [VENDOR, "OPPO"], [TYPE, MOBILE]], + [ + // Vivo + /vivo (\w+)(?: bui|\))/i, + /\b(v[12]\d{3}\w?[at])(?: bui|;)/i, + ], + [MODEL, [VENDOR, "Vivo"], [TYPE, MOBILE]], + [ + // Realme + /\b(rmx[1-3]\d{3})(?: bui|;|\))/i, + ], + [MODEL, [VENDOR, "Realme"], [TYPE, MOBILE]], + [ + // Motorola + /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, + /\bmot(?:orola)?[- ](\w*)/i, + /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i, + ], + [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]], + [/\b(mz60\d|xoom[2 ]{0,2}) build\//i], + [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]], + [ + // LG + /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i, + ], + [MODEL, [VENDOR, LG], [TYPE, TABLET]], + [ + /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, + /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, + /\blg-?([\d\w]+) bui/i, + ], + [MODEL, [VENDOR, LG], [TYPE, MOBILE]], + [ + // Lenovo + /(ideatab[-\w ]+)/i, + /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i, + ], + [MODEL, [VENDOR, "Lenovo"], [TYPE, TABLET]], + [ + // Nokia + /(?:maemo|nokia).*(n900|lumia \d+)/i, + /nokia[-_ ]?([-\w\.]*)/i, + ], + [ + [MODEL, /_/g, " "], + [VENDOR, "Nokia"], + [TYPE, MOBILE], + ], + [ + // Google + /(pixel c)\b/i, // Google Pixel C + ], + [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]], + [ + /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i, // Google Pixel + ], + [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], + [ + // Sony + /droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i, + ], + [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], + [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i], + [ + [MODEL, "Xperia Tablet"], + [VENDOR, SONY], + [TYPE, TABLET], + ], + [ + // OnePlus + / (kb2005|in20[12]5|be20[12][59])\b/i, + /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i, + ], + [MODEL, [VENDOR, "OnePlus"], [TYPE, MOBILE]], + [ + // Amazon + /(alexa)webm/i, + /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, // Kindle Fire without Silk / Echo Show + /(kf[a-z]+)( bui|\)).+silk\//i, // Kindle Fire HD + ], + [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], + [ + /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i, // Fire Phone + ], + [ + [MODEL, /(.+)/g, "Fire Phone $1"], + [VENDOR, AMAZON], + [TYPE, MOBILE], + ], + [ + // BlackBerry + /(playbook);[-\w\),; ]+(rim)/i, // BlackBerry PlayBook + ], + [MODEL, VENDOR, [TYPE, TABLET]], + [ + /\b((?:bb[a-f]|st[hv])100-\d)/i, + /\(bb10; (\w+)/i, // BlackBerry 10 + ], + [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]], + [ + // Asus + /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i, + ], + [MODEL, [VENDOR, ASUS], [TYPE, TABLET]], + [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i], + [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]], + [ + // HTC + /(nexus 9)/i, // HTC Nexus 9 + ], + [MODEL, [VENDOR, "HTC"], [TYPE, TABLET]], + [ + /(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, // HTC + + // ZTE + /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, + /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i, // Alcatel/GeeksPhone/Nexian/Panasonic/Sony + ], + [VENDOR, [MODEL, /_/g, " "], [TYPE, MOBILE]], + [ + // Acer + /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i, + ], + [MODEL, [VENDOR, "Acer"], [TYPE, TABLET]], + [ + // Meizu + /droid.+; (m[1-5] note) bui/i, + /\bmz-([-\w]{2,})/i, + ], + [MODEL, [VENDOR, "Meizu"], [TYPE, MOBILE]], + [ + // Ulefone + /; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i, + ], + [MODEL, [VENDOR, "Ulefone"], [TYPE, MOBILE]], + [ + // MIXED + /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i, + // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron + /(hp) ([\w ]+\w)/i, // HP iPAQ + /(asus)-?(\w+)/i, // Asus + /(microsoft); (lumia[\w ]+)/i, // Microsoft Lumia + /(lenovo)[-_ ]?([-\w]+)/i, // Lenovo + /(jolla)/i, // Jolla + /(oppo) ?([\w ]+) bui/i, // OPPO + ], + [VENDOR, MODEL, [TYPE, MOBILE]], + [ + /(kobo)\s(ereader|touch)/i, // Kobo + /(archos) (gamepad2?)/i, // Archos + /(hp).+(touchpad(?!.+tablet)|tablet)/i, // HP TouchPad + /(kindle)\/([\w\.]+)/i, // Kindle + /(nook)[\w ]+build\/(\w+)/i, // Nook + /(dell) (strea[kpr\d ]*[\dko])/i, // Dell Streak + /(le[- ]+pan)[- ]+(\w{1,9}) bui/i, // Le Pan Tablets + /(trinity)[- ]*(t\d{3}) bui/i, // Trinity Tablets + /(gigaset)[- ]+(q\w{1,9}) bui/i, // Gigaset Tablets + /(vodafone) ([\w ]+)(?:\)| bui)/i, // Vodafone + ], + [VENDOR, MODEL, [TYPE, TABLET]], + [ + /(surface duo)/i, // Surface Duo + ], + [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]], + [ + /droid [\d\.]+; (fp\du?)(?: b|\))/i, // Fairphone + ], + [MODEL, [VENDOR, "Fairphone"], [TYPE, MOBILE]], + [ + /(u304aa)/i, // AT&T + ], + [MODEL, [VENDOR, "AT&T"], [TYPE, MOBILE]], + [ + /\bsie-(\w*)/i, // Siemens + ], + [MODEL, [VENDOR, "Siemens"], [TYPE, MOBILE]], + [ + /\b(rct\w+) b/i, // RCA Tablets + ], + [MODEL, [VENDOR, "RCA"], [TYPE, TABLET]], + [ + /\b(venue[\d ]{2,7}) b/i, // Dell Venue Tablets + ], + [MODEL, [VENDOR, "Dell"], [TYPE, TABLET]], + [ + /\b(q(?:mv|ta)\w+) b/i, // Verizon Tablet + ], + [MODEL, [VENDOR, "Verizon"], [TYPE, TABLET]], + [ + /\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i, // Barnes & Noble Tablet + ], + [MODEL, [VENDOR, "Barnes & Noble"], [TYPE, TABLET]], + [/\b(tm\d{3}\w+) b/i], + [MODEL, [VENDOR, "NuVision"], [TYPE, TABLET]], + [ + /\b(k88) b/i, // ZTE K Series Tablet + ], + [MODEL, [VENDOR, "ZTE"], [TYPE, TABLET]], + [ + /\b(nx\d{3}j) b/i, // ZTE Nubia + ], + [MODEL, [VENDOR, "ZTE"], [TYPE, MOBILE]], + [ + /\b(gen\d{3}) b.+49h/i, // Swiss GEN Mobile + ], + [MODEL, [VENDOR, "Swiss"], [TYPE, MOBILE]], + [ + /\b(zur\d{3}) b/i, // Swiss ZUR Tablet + ], + [MODEL, [VENDOR, "Swiss"], [TYPE, TABLET]], + [ + /\b((zeki)?tb.*\b) b/i, // Zeki Tablets + ], + [MODEL, [VENDOR, "Zeki"], [TYPE, TABLET]], + [ + /\b([yr]\d{2}) b/i, + /\b(dragon[- ]+touch |dt)(\w{5}) b/i, // Dragon Touch Tablet + ], + [[VENDOR, "Dragon Touch"], MODEL, [TYPE, TABLET]], + [ + /\b(ns-?\w{0,9}) b/i, // Insignia Tablets + ], + [MODEL, [VENDOR, "Insignia"], [TYPE, TABLET]], + [ + /\b((nxa|next)-?\w{0,9}) b/i, // NextBook Tablets + ], + [MODEL, [VENDOR, "NextBook"], [TYPE, TABLET]], + [ + /\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i, // Voice Xtreme Phones + ], + [[VENDOR, "Voice"], MODEL, [TYPE, MOBILE]], + [ + /\b(lvtel\-)?(v1[12]) b/i, // LvTel Phones + ], + [[VENDOR, "LvTel"], MODEL, [TYPE, MOBILE]], + [ + /\b(ph-1) /i, // Essential PH-1 + ], + [MODEL, [VENDOR, "Essential"], [TYPE, MOBILE]], + [ + /\b(v(100md|700na|7011|917g).*\b) b/i, // Envizen Tablets + ], + [MODEL, [VENDOR, "Envizen"], [TYPE, TABLET]], + [ + /\b(trio[-\w\. ]+) b/i, // MachSpeed Tablets + ], + [MODEL, [VENDOR, "MachSpeed"], [TYPE, TABLET]], + [ + /\btu_(1491) b/i, // Rotor Tablets + ], + [MODEL, [VENDOR, "Rotor"], [TYPE, TABLET]], + [ + /(shield[\w ]+) b/i, // Nvidia Shield Tablets + ], + [MODEL, [VENDOR, "Nvidia"], [TYPE, TABLET]], + [ + /(sprint) (\w+)/i, // Sprint Phones + ], + [VENDOR, MODEL, [TYPE, MOBILE]], + [ + /(kin\.[onetw]{3})/i, // Microsoft Kin + ], + [ + [MODEL, /\./g, " "], + [VENDOR, MICROSOFT], + [TYPE, MOBILE], + ], + [ + /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i, // Zebra + ], + [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]], + [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i], + [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]], + [ + /////////////////// + // SMARTTVS + /////////////////// + + /smart-tv.+(samsung)/i, // Samsung + ], + [VENDOR, [TYPE, SMARTTV]], + [/hbbtv.+maple;(\d+)/i], + [ + [MODEL, /^/, "SmartTV"], + [VENDOR, SAMSUNG], + [TYPE, SMARTTV], + ], + [ + /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i, // LG SmartTV + ], + [ + [VENDOR, LG], + [TYPE, SMARTTV], + ], + [ + /(apple) ?tv/i, // Apple TV + ], + [VENDOR, [MODEL, APPLE + " TV"], [TYPE, SMARTTV]], + [ + /crkey/i, // Google Chromecast + ], + [ + [MODEL, CHROME + "cast"], + [VENDOR, GOOGLE], + [TYPE, SMARTTV], + ], + [ + /droid.+aft(\w+)( bui|\))/i, // Fire TV + ], + [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], + [ + /\(dtv[\);].+(aquos)/i, + /(aquos-tv[\w ]+)\)/i, // Sharp + ], + [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]], + [ + /(bravia[\w ]+)( bui|\))/i, // Sony + ], + [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]], + [ + /(mitv-\w{5}) bui/i, // Xiaomi + ], + [MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]], + [ + /Hbbtv.*(technisat) (.*);/i, // TechniSAT + ], + [VENDOR, MODEL, [TYPE, SMARTTV]], + [ + /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, // Roku + /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i, // HbbTV devices + ], + [ + [VENDOR, trim], + [MODEL, trim], + [TYPE, SMARTTV], + ], + [ + /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i, // SmartTV from Unidentified Vendors + ], + [[TYPE, SMARTTV]], + [ + /////////////////// + // CONSOLES + /////////////////// + + /(ouya)/i, // Ouya + /(nintendo) ([wids3utch]+)/i, // Nintendo + ], + [VENDOR, MODEL, [TYPE, CONSOLE]], + [ + /droid.+; (shield) bui/i, // Nvidia + ], + [MODEL, [VENDOR, "Nvidia"], [TYPE, CONSOLE]], + [ + /(playstation [345portablevi]+)/i, // Playstation + ], + [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]], + [ + /\b(xbox(?: one)?(?!; xbox))[\); ]/i, // Microsoft Xbox + ], + [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]], + [ + /////////////////// + // WEARABLES + /////////////////// + + /((pebble))app/i, // Pebble + ], + [VENDOR, MODEL, [TYPE, WEARABLE]], + [ + /(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i, // Apple Watch + ], + [MODEL, [VENDOR, APPLE], [TYPE, WEARABLE]], + [ + /droid.+; (glass) \d/i, // Google Glass + ], + [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], + [/droid.+; (wt63?0{2,3})\)/i], + [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], + [ + /(quest( 2| pro)?)/i, // Oculus Quest + ], + [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], + [ + /////////////////// + // EMBEDDED + /////////////////// + + /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i, // Tesla + ], + [VENDOR, [TYPE, EMBEDDED]], + [ + /(aeobc)\b/i, // Echo Dot + ], + [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], + [ + //////////////////// + // MIXED (GENERIC) + /////////////////// + + /droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i, // Android Phones from Unidentified Vendors + ], + [MODEL, [TYPE, MOBILE]], + [ + /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i, // Android Tablets from Unidentified Vendors + ], + [MODEL, [TYPE, TABLET]], + [ + /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i, // Unidentifiable Tablet + ], + [[TYPE, TABLET]], + [ + /(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i, // Unidentifiable Mobile + ], + [[TYPE, MOBILE]], + [ + /(android[-\w\. ]{0,9});.+buil/i, // Generic Android Device + ], + [MODEL, [VENDOR, "Generic"]], + ], + + engine: [ + [ + /windows.+ edge\/([\w\.]+)/i, // EdgeHTML + ], + [VERSION, [NAME, EDGE + "HTML"]], + [ + /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i, // Blink + ], + [VERSION, [NAME, "Blink"]], + [ + /(presto)\/([\w\.]+)/i, // Presto + /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna + /ekioh(flow)\/([\w\.]+)/i, // Flow + /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links + /(icab)[\/ ]([23]\.[\d\.]+)/i, // iCab + /\b(libweb)/i, + ], + [NAME, VERSION], + [ + /rv\:([\w\.]{1,9})\b.+(gecko)/i, // Gecko + ], + [VERSION, NAME], + ], + + os: [ + [ + // Windows + /microsoft (windows) (vista|xp)/i, // Windows (iTunes) + ], + [NAME, VERSION], + [ + /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i, // Windows Phone + ], + [NAME, [VERSION, strMapper, windowsVersionMap]], + [ + /windows nt 6\.2; (arm)/i, // Windows RT + /windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i, + /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i, + ], + [ + [VERSION, strMapper, windowsVersionMap], + [NAME, "Windows"], + ], + [ + // iOS/macOS + /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS + /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i, + /cfnetwork\/.+darwin/i, + ], + [ + [VERSION, /_/g, "."], + [NAME, "iOS"], + ], + [ + /(mac os x) ?([\w\. ]*)/i, + /(macintosh|mac_powerpc\b)(?!.+haiku)/i, // Mac OS + ], + [ + [NAME, MAC_OS], + [VERSION, /_/g, "."], + ], + [ + // Mobile OSes + /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i, // Android-x86/HarmonyOS + ], + [VERSION, NAME], + [ + // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS + /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, + /(blackberry)\w*\/([\w\.]*)/i, // Blackberry + /(tizen|kaios)[\/ ]([\w\.]+)/i, // Tizen/KaiOS + /\((series40);/i, // Series 40 + ], + [NAME, VERSION], + [ + /\(bb(10);/i, // BlackBerry 10 + ], + [VERSION, [NAME, BLACKBERRY]], + [ + /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i, // Symbian + ], + [VERSION, [NAME, "Symbian"]], + [ + /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i, // Firefox OS + ], + [VERSION, [NAME, FIREFOX + " OS"]], + [ + /web0s;.+rt(tv)/i, + /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i, // WebOS + ], + [VERSION, [NAME, "webOS"]], + [ + /watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i, // watchOS + ], + [VERSION, [NAME, "watchOS"]], + [ + // Google Chromecast + /crkey\/([\d\.]+)/i, // Google Chromecast + ], + [VERSION, [NAME, CHROME + "cast"]], + [ + /(cros) [\w]+(?:\)| ([\w\.]+)\b)/i, // Chromium OS + ], + [[NAME, CHROMIUM_OS], VERSION], + [ + // Smart TVs + /panasonic;(viera)/i, // Panasonic Viera + /(netrange)mmh/i, // Netrange + /(nettv)\/(\d+\.[\w\.]+)/i, // NetTV + + // Console + /(nintendo|playstation) ([wids345portablevuch]+)/i, // Nintendo/Playstation + /(xbox); +xbox ([^\);]+)/i, // Microsoft Xbox (360, One, X, S, Series X, Series S) + + // Other + /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, // Joli/Palm + /(mint)[\/\(\) ]?(\w*)/i, // Mint + /(mageia|vectorlinux)[; ]/i, // Mageia/VectorLinux + /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, + // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire + /(hurd|linux) ?([\w\.]*)/i, // Hurd/Linux + /(gnu) ?([\w\.]*)/i, // GNU + /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly + /(haiku) (\w+)/i, // Haiku + ], + [NAME, VERSION], + [ + /(sunos) ?([\w\.\d]*)/i, // Solaris + ], + [[NAME, "Solaris"], VERSION], + [ + /((?:open)?solaris)[-\/ ]?([\w\.]*)/i, // Solaris + /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, // AIX + /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS + /(unix) ?([\w\.]*)/i, // UNIX + ], + [NAME, VERSION], + ], + }; + + ///////////////// + // Constructor + //////////////// + + var UAParser = function (ua, extensions) { + if (typeof ua === OBJ_TYPE) { + extensions = ua; + ua = undefined; + } + + if (!(this instanceof UAParser)) { + return new UAParser(ua, extensions).getResult(); + } + + var _navigator = + typeof window !== UNDEF_TYPE && window.navigator + ? window.navigator + : undefined; + var _ua = + ua || + (_navigator && _navigator.userAgent ? _navigator.userAgent : EMPTY); + var _uach = + _navigator && _navigator.userAgentData + ? _navigator.userAgentData + : undefined; + var _rgxmap = extensions ? extend(regexes, extensions) : regexes; + var _isSelfNav = _navigator && _navigator.userAgent == _ua; + + this.getBrowser = function () { + var _browser = {}; + _browser[NAME] = undefined; + _browser[VERSION] = undefined; + rgxMapper.call(_browser, _ua, _rgxmap.browser); + _browser[MAJOR] = majorize(_browser[VERSION]); + // Brave-specific detection + if ( + _isSelfNav && + _navigator && + _navigator.brave && + typeof _navigator.brave.isBrave == FUNC_TYPE + ) { + _browser[NAME] = "Brave"; + } + return _browser; + }; + this.getCPU = function () { + var _cpu = {}; + _cpu[ARCHITECTURE] = undefined; + rgxMapper.call(_cpu, _ua, _rgxmap.cpu); + return _cpu; + }; + this.getDevice = function () { + var _device = {}; + _device[VENDOR] = undefined; + _device[MODEL] = undefined; + _device[TYPE] = undefined; + rgxMapper.call(_device, _ua, _rgxmap.device); + if (_isSelfNav && !_device[TYPE] && _uach && _uach.mobile) { + _device[TYPE] = MOBILE; + } + // iPadOS-specific detection: identified as Mac, but has some iOS-only properties + if ( + _isSelfNav && + _device[MODEL] == "Macintosh" && + _navigator && + typeof _navigator.standalone !== UNDEF_TYPE && + _navigator.maxTouchPoints && + _navigator.maxTouchPoints > 2 + ) { + _device[MODEL] = "iPad"; + _device[TYPE] = TABLET; + } + return _device; + }; + this.getEngine = function () { + var _engine = {}; + _engine[NAME] = undefined; + _engine[VERSION] = undefined; + rgxMapper.call(_engine, _ua, _rgxmap.engine); + return _engine; + }; + this.getOS = function () { + var _os = {}; + _os[NAME] = undefined; + _os[VERSION] = undefined; + rgxMapper.call(_os, _ua, _rgxmap.os); + if ( + _isSelfNav && + !_os[NAME] && + _uach && + _uach.platform != "Unknown" + ) { + _os[NAME] = _uach.platform + .replace(/chrome os/i, CHROMIUM_OS) + .replace(/macos/i, MAC_OS); // backward compatibility + } + return _os; + }; + this.getResult = function () { + return { + ua: this.getUA(), + browser: this.getBrowser(), + engine: this.getEngine(), + os: this.getOS(), + device: this.getDevice(), + cpu: this.getCPU(), + }; + }; + this.getUA = function () { + return _ua; + }; + this.setUA = function (ua) { + _ua = + typeof ua === STR_TYPE && ua.length > UA_MAX_LENGTH + ? trim(ua, UA_MAX_LENGTH) + : ua; + return this; + }; + this.setUA(_ua); + return this; + }; + + UAParser.VERSION = LIBVERSION; + UAParser.BROWSER = enumerize([NAME, VERSION, MAJOR]); + UAParser.CPU = enumerize([ARCHITECTURE]); + UAParser.DEVICE = enumerize([ + MODEL, + VENDOR, + TYPE, + CONSOLE, + MOBILE, + SMARTTV, + TABLET, + WEARABLE, + EMBEDDED, + ]); + UAParser.ENGINE = UAParser.OS = enumerize([NAME, VERSION]); + + /////////// + // Export + ////////// + + // check js environment + if (typeof exports !== UNDEF_TYPE) { + // nodejs env + if ("object" !== UNDEF_TYPE && module.exports) { + exports = module.exports = UAParser; + } + exports.UAParser = UAParser; + } else { + // requirejs env (optional) + if ("function" === FUNC_TYPE && __webpack_require__.amdO) { + !((__WEBPACK_AMD_DEFINE_RESULT__ = function () { + return UAParser; + }.call(exports, __webpack_require__, exports, module)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof window !== UNDEF_TYPE) { + // browser env + window.UAParser = UAParser; + } + } + + // jQuery/Zepto specific (optional) + // Note: + // In AMD env the global scope should be kept clean, but jQuery is an exception. + // jQuery always exports to global scope, unless jQuery.noConflict(true) is used, + // and we should catch that. + var $ = typeof window !== UNDEF_TYPE && (window.jQuery || window.Zepto); + if ($ && !$.ua) { + var parser = new UAParser(); + $.ua = parser.getResult(); + $.ua.get = function () { + return parser.getUA(); + }; + $.ua.set = function (ua) { + parser.setUA(ua); + var result = parser.getResult(); + for (var prop in result) { + $.ua[prop] = result[prop]; + } + }; + } + })(typeof window === "object" ? window : this); + + /***/ + }, + + /******/ + }; + /************************************************************************/ + /******/ // The module cache + /******/ var __webpack_module_cache__ = {}; + /******/ + /******/ // The require function + /******/ function __webpack_require__(moduleId) { + /******/ // Check if module is in cache + /******/ var cachedModule = __webpack_module_cache__[moduleId]; + /******/ if (cachedModule !== undefined) { + /******/ return cachedModule.exports; + /******/ + } + /******/ // Create a new module (and put it into the cache) + /******/ var module = (__webpack_module_cache__[moduleId] = { + /******/ // no module.id needed + /******/ // no module.loaded needed + /******/ exports: {}, + /******/ + }); + /******/ + /******/ // Execute the module function + /******/ __webpack_modules__[moduleId].call( + module.exports, + module, + module.exports, + __webpack_require__ + ); + /******/ + /******/ // Return the exports of the module + /******/ return module.exports; + /******/ } -}); + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/amd options */ + /******/ (() => { + /******/ __webpack_require__.amdO = {}; + /******/ + })(); + /******/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ __webpack_require__.n = (module) => { + /******/ var getter = + module && module.__esModule + ? /******/ () => module["default"] + : /******/ () => module; + /******/ __webpack_require__.d(getter, { a: getter }); + /******/ return getter; + /******/ + }; + /******/ + })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ __webpack_require__.d = (exports, definition) => { + /******/ for (var key in definition) { + /******/ if ( + __webpack_require__.o(definition, key) && + !__webpack_require__.o(exports, key) + ) { + /******/ Object.defineProperty(exports, key, { + enumerable: true, + get: definition[key], + }); + /******/ + } + /******/ + } + /******/ + }; + /******/ + })(); + /******/ + /******/ /* webpack/runtime/global */ + /******/ (() => { + /******/ __webpack_require__.g = (function () { + /******/ if (typeof globalThis === "object") return globalThis; + /******/ try { + /******/ return this || new Function("return this")(); + /******/ + } catch (e) { + /******/ if (typeof window === "object") return window; + /******/ + } + /******/ + })(); + /******/ + })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ __webpack_require__.o = (obj, prop) => + Object.prototype.hasOwnProperty.call(obj, prop); + /******/ + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ __webpack_require__.r = (exports) => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(exports, Symbol.toStringTag, { + value: "Module", + }); + /******/ + } + /******/ Object.defineProperty(exports, "__esModule", { value: true }); + /******/ + }; + /******/ + })(); + /******/ + /************************************************************************/ + var __webpack_exports__ = {}; + // This entry need to be wrapped in an IIFE because it need to be in strict mode. + (() => { + "use strict"; + /* harmony import */ var _trezor_connect_web_lib_channels_window_serviceworker__WEBPACK_IMPORTED_MODULE_0__ = + __webpack_require__(312); + + /** + * communication between service worker and both webextension and popup manager + */ + const channel = + new _trezor_connect_web_lib_channels_window_serviceworker__WEBPACK_IMPORTED_MODULE_0__ /* .WindowServiceWorkerChannel */.E( + { + name: "trezor-connect", + channel: { + here: "@trezor/connect-content-script", + peer: "@trezor/connect-webextension", + }, + } + ); + channel.init().then(() => { + // once script is loaded. send information about the webextension that injected it into the popup + window.postMessage( + { + type: "popup-content-script-loaded", + payload: { + ...chrome.runtime.getManifest(), + id: chrome.runtime.id, + }, + }, + window.location.origin + ); + + /** + * Passing messages from service worker to popup + */ + channel.on("message", (message) => { + window.postMessage(message, window.location.origin); + }); + + /* + * Passing messages from popup to service worker + */ + window.addEventListener("message", (event) => { + if ( + event.data?.channel?.here === "@trezor/connect-webextension" || + event.data?.type === "popup-content-script-loaded" + ) { + return; + } + if (event.source === window && event.data) { + channel.postMessage(event.data, { + usePromise: false, + }); + } + }); + window.addEventListener("beforeunload", () => { + window.postMessage( + { + type: "popup-closed", + }, + window.location.origin + ); + }); + }); + })(); + + /******/ +})(); diff --git a/packages/app-extension/src/webextension/trezor/trezor-usb-permissions.js b/packages/app-extension/src/webextension/trezor/trezor-usb-permissions.js index 97bf7e864..cce448d2f 100644 --- a/packages/app-extension/src/webextension/trezor/trezor-usb-permissions.js +++ b/packages/app-extension/src/webextension/trezor/trezor-usb-permissions.js @@ -1,4 +1,4 @@ -const VERSION = "8.2.7-beta.3"; +const VERSION = "9.2.1"; const versionN = VERSION.split(".").map((s) => parseInt(s, 10)); // const DIRECTORY = `${ versionN[0] }${ (versionN[1] > 0 ? `.${versionN[1]}` : '') }/`; const DIRECTORY = `${versionN[0]}/`; diff --git a/packages/app-extension/webpack.config.js b/packages/app-extension/webpack.config.js index 073ccd8ef..0df1018f0 100644 --- a/packages/app-extension/webpack.config.js +++ b/packages/app-extension/webpack.config.js @@ -311,7 +311,7 @@ const options = { ? { // add support for react devtools in development mode extension_pages: - "script-src 'self' http://localhost:8097; object-src 'self'; frame-src: 'self' 'https://connect.trezor.io/'", + "script-src 'self' http://localhost:8097; object-src 'self'; frame-src: 'self' 'https://connect.trezor.io/*' '*://127.0.0.1:21325/*'", } : undefined, }, diff --git a/packages/secure-background/src/transports/ToSecureUITransportSender.ts b/packages/secure-background/src/transports/ToSecureUITransportSender.ts index 09b01d6ca..82ced93da 100644 --- a/packages/secure-background/src/transports/ToSecureUITransportSender.ts +++ b/packages/secure-background/src/transports/ToSecureUITransportSender.ts @@ -43,11 +43,16 @@ export class ToSecureUITransportSender< this.forwardOrigin = !!init.forwardOrigin; globalThis.chrome?.runtime?.onConnect.addListener((port) => { + console.log( + "[DEBUG] ToSecureUITransportSender: Plugin Connected", + port.name + ); logger.debug("Plugin Connected", port.name); // if we are still connected to a differnt plugin disconnect it if (this.port && this.port?.name !== port.name) { - this.disconnectPlugin(this.port); + // FIXME: This causes Trezor account discovery & other methods to fail. Why? + //this.disconnectPlugin(this.port); } // set port @@ -77,6 +82,10 @@ export class ToSecureUITransportSender< } private maybeDisconnectPlugin = async (port: chrome.runtime.Port) => { + console.log( + "[DEBUG] ToSecureUITransportSender: maybeDisconnectPlugin", + port.name + ); // It's possible that a plugin is closed because a new one opened. // We only handle the disconnect if the port is currently connected. if (this.port?.name !== port.name) { @@ -97,6 +106,10 @@ export class ToSecureUITransportSender< this.disconnectPlugin(port); }; private disconnectPlugin = (port: chrome.runtime.Port) => { + console.log( + "[DEBUG] ToSecureUITransportSender: disconnectPlugin", + port.name + ); logger.debug("Plugin Disconnected", port.name); // remove listeners & reference @@ -134,6 +147,7 @@ export class ToSecureUITransportSender< public send: TransportSend = ( request: TransportSendRequest ) => { + console.log("[DEBUG] ToSecureUITransportSender: send", request); // new request -> we wont need to close popup. clearTimeout(this.maybeClosePopupTimeout); @@ -163,6 +177,7 @@ export class ToSecureUITransportSender< channel: string; data: SecureResponse; }) => { + console.log("[DEBUG] ToSecureUITransportSender: responseHandler", response); if (response.channel !== CHANNEL_SECURE_UI_RESPONSE) { return; } @@ -202,6 +217,7 @@ export class ToSecureUITransportSender< }; private isPopupClosable = () => { + console.log("[DEBUG] ToSecureUITransportSender: isPopupClosable"); // if we're not waiting for any more responses // and this is the popup we originally opened // -> we can close popup. @@ -215,6 +231,7 @@ export class ToSecureUITransportSender< }; private maybeClosePopup() { + console.log("[DEBUG] ToSecureUITransportSender: maybeClosePopup"); // if we can close popup // -> close the popup. if (this.isPopupClosable() && this.port?.sender?.tab?.windowId) { @@ -230,6 +247,10 @@ export class ToSecureUITransportSender< } private sendRequests = () => { + console.log( + "[DEBUG] ToSecureUITransportSender: sendRequests", + this.requestQueue + ); // no queued requests -> done if (this.requestQueue.length <= 0) { return; @@ -271,6 +292,7 @@ export class ToSecureUITransportSender< }; private openPopup = (windowId: string) => { + console.log("[DEBUG] ToSecureUITransportSender: openPopup", windowId); this.lastOpenedWindowId = windowId; openPopupWindow("popup.html?windowId=" + windowId).catch((e) => { console.log("[DEBUG] ToSecureUITransportSender: err 7"); diff --git a/packages/secure-ui/package.json b/packages/secure-ui/package.json index 6811711ea..bd8d66e80 100644 --- a/packages/secure-ui/package.json +++ b/packages/secure-ui/package.json @@ -44,7 +44,6 @@ "@solana/wallet-standard-features": "^1.2.0", "@solana/wallet-standard-util": "^1.1.1", "@solana/web3.js": "1.63.1", - "@trezor/connect-web": "^9.1.12", "bs58": "^5.0.0", "ethers5": "npm:ethers@^5.5.1", "ethers6": "npm:ethers@^6.8.0", diff --git a/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorPreviewPublicKeysRequest.tsx b/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorPreviewPublicKeysRequest.tsx index 7edb13e7c..b8fe275e9 100644 --- a/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorPreviewPublicKeysRequest.tsx +++ b/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorPreviewPublicKeysRequest.tsx @@ -47,36 +47,22 @@ export function TrezorPreviewPublicKeysRequest({ console.log("[DEBUG] [TREZOR] derivationPathBundle", derivationPathBundle); - let retries = 0; - let success = false; - let result: { address: string; serializedPath: string }[] = []; - - while (!success && retries < 10) { - const trezorResponse = await TrezorConnect.solanaGetAddress({ - bundle: derivationPathBundle, - }); + // We want this method, not `solanaGetPublicKeys` to conform with ledger + const trezorResponse = await TrezorConnect.solanaGetAddress({ + bundle: derivationPathBundle, + }); - if (trezorResponse.success) { - console.log( - "[DEBUG] [TREZOR] trezorResponse, returning", - trezorResponse - ); - success = true; - result = trezorResponse.payload; - } else { - console.log( - "[DEBUG] [TREZOR] trezorResponse, retrying", - trezorResponse - ); - retries++; - } + if (trezorResponse.success === false) { + return []; } - const derivationPaths: DerivationPaths = result.map((payload) => ({ - publicKey: payload.address, - derivationPath: payload.serializedPath, - blockchain: request.blockchain, - })); + const derivationPaths: DerivationPaths = trezorResponse.payload.map( + ({ address, serializedPath }) => ({ + publicKey: address, + derivationPath: serializedPath, + blockchain: request.blockchain, + }) + ); console.log( "[DEBUG] [TREZOR] derivationPaths", @@ -128,6 +114,7 @@ function SelectWallets({ const [isPermissionsError, setIsPermissionsError] = useState(false); useEffect(() => { + /* currentRequest.respond({ walletDescriptors: [ { @@ -242,37 +229,43 @@ function SelectWallets({ device: "trezor", })), }); - /* - const result = fetchWallets(setProgress); - console.log("[DEBUG] [TREZOR] SelectWallets promise", result); + */ + + try { + const result = fetchWallets(setProgress); - result - .then((result) => { - console.log("[DEBUG] [TREZOR] SelectWallets result", result); - currentRequest.respond({ - walletDescriptors: result.map((descriptor) => ({ - ...descriptor, - type: BlockchainWalletDescriptorType.HARDWARE, - device: "trezor", - })), + result + .then((result) => { + console.log("[DEBUG] [TREZOR] SelectWallets result", result); + currentRequest.respond({ + walletDescriptors: result.map((descriptor) => ({ + ...descriptor, + type: BlockchainWalletDescriptorType.HARDWARE, + device: "trezor", + })), + }); + }) + .catch((e) => { + console.log("[DEBUG] [TREZOR] SelectWallets error", e); + // FIXME: This error can't happen for Trezor. + // Catch Trezor Errors instead. + if (e.message === "HID_PERMISSIONS_NOT_AVAILABLE") { + setIsError(true); + setIsPermissionsError(true); + setStatus("Missing HID browser permissions."); + } else { + setStatus(e.message); + setIsError(true); + setIsPermissionsError(false); + } + // currentRequest.error(e instanceof Error ? e : new Error(e)); }); - }) - .catch((e) => { - console.log("[DEBUG] [TREZOR] SelectWallets error", e); - // FIXME: This error can't happen for Trezor. - // Catch Trezor Errors instead. - if (e.message === "HID_PERMISSIONS_NOT_AVAILABLE") { - setIsError(true); - setIsPermissionsError(true); - setStatus("Missing HID browser permissions."); - } else { - setStatus(e.message); - setIsError(true); - setIsPermissionsError(false); - } - // currentRequest.error(e instanceof Error ? e : new Error(e)); - }); - */ + } catch (e) { + console.log( + "[DEBUG] [TREZOR] SelectWallets some kinda weird error calling fetchWallets", + e + ); + } }, [currentRequest.id]); return ( diff --git a/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorSignRequest.tsx b/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorSignRequest.tsx index fa64dabf9..3848059dc 100644 --- a/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorSignRequest.tsx +++ b/packages/secure-ui/src/RequestHandlers/TrezorRequests/TrezorSignRequest.tsx @@ -7,6 +7,7 @@ import { ErrorCrossMarkIcon, YStack, } from "@coral-xyz/tamagui"; +import { encode } from "bs58"; import { useCallback, useEffect, useState } from "react"; import TrezorConnect from "./_utils/trezorConnect"; @@ -143,9 +144,14 @@ async function svmSignTx( setStatus: (status: string) => void ) { console.log("[DEBUG] [svmSignTx] currentRequest: ", currentRequest); + // TODO: perhaps move this elsewhere? Keeping it here to keep the data flows unified + // Transform path into trezor compatible one const { derivationPath, txMessage } = currentRequest.request; + const path = derivationPath.startsWith("m/") + ? derivationPath + : `m/${derivationPath}`; const result = TrezorConnect.solanaSignTransaction({ - path: derivationPath, + path, serializedTx: txMessage, }); @@ -162,7 +168,7 @@ async function svmSignTx( result.payload.signature ); currentRequest.respond({ - signature: result.payload.signature, + signature: encode(Buffer.from(result.payload.signature, "hex")), }); }); } diff --git a/yarn.lock b/yarn.lock index 0c3b0d51d..198b41c04 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3898,7 +3898,6 @@ __metadata: "@solana/wallet-standard-features": "npm:^1.2.0" "@solana/wallet-standard-util": "npm:^1.1.1" "@solana/web3.js": "npm:1.63.1" - "@trezor/connect-web": "npm:^9.1.12" bs58: "npm:^5.0.0" eslint-config-custom: "npm:*" ethers5: "npm:ethers@^5.5.1" From cca8e3b015d57ca339e0e097feda14df32a1fe4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0ulovsk=C3=BD?= Date: Tue, 19 Mar 2024 11:39:41 +0800 Subject: [PATCH 4/6] tmp: trezor client notes --- packages/secure-background/src/services/trezor/client.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/secure-background/src/services/trezor/client.ts b/packages/secure-background/src/services/trezor/client.ts index f9fba9c7f..63f9b8141 100644 --- a/packages/secure-background/src/services/trezor/client.ts +++ b/packages/secure-background/src/services/trezor/client.ts @@ -14,6 +14,8 @@ export class TrezorClient { request: SecureRequest<"LEDGER_SVM_SIGN_TX">["request"], options: SecureRequestOptions<"LEDGER_SVM_SIGN_TX", "ui"> ): Promise> { + // TODO: This is in ServiceWorker + // use normal SVM Sign event, then request trezor connect window and sign return this.client .send({ name: "LEDGER_SVM_SIGN_TX", @@ -22,6 +24,7 @@ export class TrezorClient { ...options, }) .then((response) => { + // get the user to sign on trezor here return response; }); } From 1ef057a40e83289ee07ef85777bd2acb0b61727c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0ulovsk=C3=BD?= Date: Thu, 21 Mar 2024 16:37:28 +0800 Subject: [PATCH 5/6] tmp: rollback to `connect-web` from `connect-webextension` --- packages/app-extension/src/manifest.json | 6 +- .../src/webextension/trezor/README.md | 8 +- .../trezor/trezor-content-script.js | 2766 +---------------- 3 files changed, 23 insertions(+), 2757 deletions(-) diff --git a/packages/app-extension/src/manifest.json b/packages/app-extension/src/manifest.json index ae88cf808..fbbce9954 100644 --- a/packages/app-extension/src/manifest.json +++ b/packages/app-extension/src/manifest.json @@ -21,7 +21,7 @@ } }, "content-security-policy": { - "extension_pages": "frame-src: 'self' *://connect.trezor.io/*" + "extension_pages": "frame-src: 'self' '*://connect.trezor.io/*'" }, "content_scripts": [ { @@ -33,7 +33,7 @@ }, { "js": ["vendor/trezor-content-script.js"], - "matches": ["*://connect.trezor.io/9/*"] + "matches": ["*://connect.trezor.io/*"] } ], "icons": { @@ -42,5 +42,5 @@ "512": "anchor.png" }, "host-permissions": ["*://connect.trezor.io/*", "*://127.0.0.1:21325/*"], - "permissions": ["alarms", "storage", "background"] + "permissions": ["alarms", "storage", "background", "*://connect.trezor.io/*"] } diff --git a/packages/app-extension/src/webextension/trezor/README.md b/packages/app-extension/src/webextension/trezor/README.md index d610a6592..8ca9b1e8d 100644 --- a/packages/app-extension/src/webextension/trezor/README.md +++ b/packages/app-extension/src/webextension/trezor/README.md @@ -8,10 +8,10 @@ Clone the `trezor/trezor-suite` repo, then inside it run: ``` yarn yarn build:libs - yarn workspace @trezor/connect-webextension build - node packages/connect-examples/update-webextensions-sw.js - yarn workspace @trezor/connect-iframe build:core-module + yarn workspace @trezor/connect-web build:webextension + yarn workspace @trezor/connect-web build:inline + node packages/connect-examples/update-webextensions.js ``` -You'll find the requisite files in `packages/connect-webextension/build`, copy them here +You'll find the requisite files in `packages/connect-examples/webextension-mv3/build`, copy them here If additional files are necessary, modify the webpack config in `app-extension/webpack.config.js` to include them diff --git a/packages/app-extension/src/webextension/trezor/trezor-content-script.js b/packages/app-extension/src/webextension/trezor/trezor-content-script.js index 125cb6685..814082fd9 100644 --- a/packages/app-extension/src/webextension/trezor/trezor-content-script.js +++ b/packages/app-extension/src/webextension/trezor/trezor-content-script.js @@ -1,2757 +1,23 @@ -/******/ (() => { - // webpackBootstrap - /******/ var __webpack_modules__ = { - /***/ 312: /***/ ( - __unused_webpack_module, - exports, - __webpack_require__ - ) => { - "use strict"; - var __webpack_unused_export__; - - __webpack_unused_export__ = { - value: true, - }; - exports.E = void 0; - const connect_common_1 = __webpack_require__(424); - class WindowServiceWorkerChannel extends connect_common_1.AbstractMessageChannel { - constructor({ name, channel }) { - super({ - channel, - sendFn: (message) => { - if (!this.port) throw new Error("port not assigned"); - this.port.postMessage(message); - }, - }); - const port = chrome.runtime.connect({ - name, - }); - this.port = port; - this.connect(); - } - connect() { - var _a; - (_a = this.port) === null || _a === void 0 - ? void 0 - : _a.onMessage.addListener((message) => { - if (message.channel.here === this.channel.here) return; - this.onMessage(message); - }); - this.isConnected = true; - } - disconnect() { - var _a; - if (!this.isConnected) return; - (_a = this.port) === null || _a === void 0 ? void 0 : _a.disconnect(); - this.isConnected = false; - } - } - exports.E = WindowServiceWorkerChannel; - - /***/ - }, - - /***/ 424: /***/ ( - __unused_webpack_module, - __webpack_exports__, - __webpack_require__ - ) => { - "use strict"; - // ESM COMPAT FLAG - __webpack_require__.r(__webpack_exports__); - - // EXPORTS - __webpack_require__.d(__webpack_exports__, { - AbstractMessageChannel: () => /* reexport */ AbstractMessageChannel, - getInstallerPackage: () => /* reexport */ getInstallerPackage, - getSystemInfo: () => /* reexport */ getSystemInfo, - storage: () => /* reexport */ storage, - }); - - // EXTERNAL MODULE: ../../node_modules/events/events.js - var events = __webpack_require__(928); // CONCATENATED MODULE: ../utils/src/typedEventEmitter.ts - /* -Usage example: -type EventMap = { - obj: { id: string }; - primitive: boolean | number | string | symbol; - noArgs: undefined; - multipleArgs: (a: number, b: string, c: boolean) => void; - [type: `dynamic/${string}`]: boolean; -}; +/* + Passing messages from background script to popup */ - // NOTE: case 1. looks like case 4. but works differently. the order matters - - // 4. default - - // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging - class TypedEmitter extends events.EventEmitter { - // implement at least one function - listenerCount(eventName) { - return super.listenerCount(eventName); - } - } // CONCATENATED MODULE: ../connect-common/src/storage.ts - // https://github.com/trezor/connect/blob/develop/src/js/storage/index.js - - const storageVersion = 2; - const storageName = `storage_v${storageVersion}`; - - /** - * remembered: - * - physical device from webusb pairing dialogue - * - passphrase to be used - */ - - // TODO: move storage somewhere else. Having it here brings couple of problems: - // - We can not import types from connect (would cause cyclic dependency) - // - it has here dependency on window object, not good - - const getEmptyState = () => ({ - origin: {}, - }); - let memoryStorage = getEmptyState(); - const getPermanentStorage = () => { - const ls = localStorage.getItem(storageName); - return ls ? JSON.parse(ls) : getEmptyState(); - }; - class Storage extends TypedEmitter { - save(getNewState, temporary = false) { - if (temporary || !__webpack_require__.g.window) { - memoryStorage = getNewState(memoryStorage); - return; - } - try { - const newState = getNewState(getPermanentStorage()); - localStorage.setItem(storageName, JSON.stringify(newState)); - this.emit("changed", newState); - } catch (err) { - // memory storage is fallback of the last resort - console.warn("long term storage not available"); - memoryStorage = getNewState(memoryStorage); - } - } - saveForOrigin(getNewState, origin, temporary = false) { - this.save( - (state) => ({ - ...state, - origin: { - ...state.origin, - [origin]: getNewState(state.origin?.[origin] || {}), - }, - }), - temporary - ); - } - load(temporary = false) { - if (temporary || !__webpack_require__.g?.window?.localStorage) { - return memoryStorage; - } - try { - return getPermanentStorage(); - } catch (err) { - // memory storage is fallback of the last resort - console.warn("long term storage not available"); - return memoryStorage; - } - } - loadForOrigin(origin, temporary = false) { - const state = this.load(temporary); - return state.origin?.[origin] || {}; - } - } - const storage = new Storage(); // CONCATENATED MODULE: ../utils/src/createDeferred.ts - - // unwrap promise response from Deferred - - const createDeferred = (id) => { - let localResolve = () => {}; - let localReject = () => {}; - const promise = new Promise((resolve, reject) => { - localResolve = resolve; - localReject = reject; - }); - return { - id, - resolve: localResolve, - reject: localReject, - promise, - }; - }; // CONCATENATED MODULE: ../utils/src/scheduleAction.ts - // Ignored when attempts is AttemptParams[] - - const isArray = (attempts) => Array.isArray(attempts); - const abortedBySignal = () => new Error("Aborted by signal"); - const abortedByDeadline = () => new Error("Aborted by deadline"); - const abortedByTimeout = () => new Error("Aborted by timeout"); - const resolveAfterMs = (ms, clear) => - new Promise((resolve, reject) => { - if (clear.aborted) return reject(); - if (ms === undefined) return resolve(); - const timeout = setTimeout(resolve, ms); - const onClear = () => { - clearTimeout(timeout); - clear.removeEventListener("abort", onClear); - reject(); - }; - clear.addEventListener("abort", onClear); - }); - const rejectAfterMs = (ms, reason, clear) => - new Promise((_, reject) => { - if (clear.aborted) return reject(); - const timeout = - ms !== undefined - ? setTimeout(() => reject(reason()), ms) - : undefined; - const onClear = () => { - clearTimeout(timeout); - clear.removeEventListener("abort", onClear); - reject(); - }; - clear.addEventListener("abort", onClear); - }); - const rejectWhenAborted = (signal, clear) => - new Promise((_, reject) => { - if (clear.aborted) return reject(); - if (signal?.aborted) return reject(abortedBySignal()); - const onAbort = () => reject(abortedBySignal()); - signal?.addEventListener("abort", onAbort); - const onClear = () => { - signal?.removeEventListener("abort", onAbort); - clear.removeEventListener("abort", onClear); - reject(); - }; - clear.addEventListener("abort", onClear); - }); - const resolveAction = async (action, clear) => { - const aborter = new AbortController(); - const onClear = () => aborter.abort(); - if (clear.aborted) onClear(); - clear.addEventListener("abort", onClear); - try { - return await new Promise((resolve) => - resolve(action(aborter.signal)) - ); - } finally { - clear.removeEventListener("abort", onClear); - } - }; - const attemptLoop = async (attempts, attempt, failure, clear) => { - // Tries only (attempts - 1) times, because the last attempt throws its error - for (let a = 0; a < attempts - 1; a++) { - if (clear.aborted) break; - const aborter = new AbortController(); - const onClear = () => aborter.abort(); - clear.addEventListener("abort", onClear); - try { - return await attempt(a, aborter.signal); - } catch { - onClear(); - await failure(a); - } finally { - clear.removeEventListener("abort", onClear); - } - } - return clear.aborted ? Promise.reject() : attempt(attempts - 1, clear); - }; - const scheduleAction = async (action, params) => { - const { signal, delay, attempts, timeout, deadline, gap } = params; - const deadlineMs = deadline && deadline - Date.now(); - const attemptCount = isArray(attempts) - ? attempts.length - : attempts ?? (deadline ? Infinity : 1); - const clearAborter = new AbortController(); - const clear = clearAborter.signal; - const getParams = isArray(attempts) - ? (attempt) => attempts[attempt] - : () => ({ - timeout, - gap, - }); - try { - return await Promise.race([ - rejectWhenAborted(signal, clear), - rejectAfterMs(deadlineMs, abortedByDeadline, clear), - resolveAfterMs(delay, clear).then(() => - attemptLoop( - attemptCount, - (attempt, abort) => - Promise.race([ - rejectAfterMs( - getParams(attempt).timeout, - abortedByTimeout, - clear - ), - resolveAction(action, abort), - ]), - (attempt) => resolveAfterMs(getParams(attempt).gap ?? 0, clear), - clear - ) - ), - ]); - } finally { - clearAborter.abort(); - } - }; // CONCATENATED MODULE: ../connect-common/src/messageChannel/abstract.ts - /** - * IMPORTS WARNING - * this file is bundled into content script so be careful what you are importing not to bloat the bundle - */ - - // TODO: so logger should be probably moved to connect common, or this file should be moved to connect - // import type { Log } from '@trezor/connect/lib/utils/debug'; - - /** - * concepts: - * - it handshakes automatically with the other side of the channel - * - it queues messages fired before handshake and sends them after handshake is done - */ - class AbstractMessageChannel extends TypedEmitter { - messagePromises = {}; - /** queue of messages that were scheduled before handshake */ - messagesQueue = []; - messageID = 0; - isConnected = false; - handshakeMaxRetries = 5; - handshakeRetryInterval = 2000; - - /** - * function that passes data to the other side of the channel - */ - - /** - * channel identifiers that pairs AbstractMessageChannel instances on sending and receiving end together - */ - - constructor({ - sendFn, - channel, - logger, - lazyHandshake = false, - legacyMode = false, - }) { - super(); - this.channel = channel; - this.sendFn = sendFn; - this.lazyHandshake = lazyHandshake; - this.legacyMode = legacyMode; - this.logger = logger; - } - - /** - * initiates handshake sequence with peer. resolves after communication with peer is established - */ - init() { - if (!this.handshakeFinished) { - this.handshakeFinished = createDeferred(); - if (this.legacyMode) { - // Bypass handshake for communication with legacy components - // We add a delay for enough time for the other side to be ready - setTimeout(() => { - this.handshakeFinished?.resolve(); - }, 500); - } - if (!this.lazyHandshake) { - // When `lazyHandshake` handshakeWithPeer will start when received channel-handshake-request. - this.handshakeWithPeer(); - } - } - return this.handshakeFinished.promise; - } - - /** - * handshake between both parties of the channel. - * both parties initiate handshake procedure and keep asking over time in a loop until they time out or receive confirmation from peer - */ - handshakeWithPeer() { - this.logger?.log(this.channel.here, "handshake"); - return scheduleAction( - async () => { - this.postMessage( - { - type: "channel-handshake-request", - data: { - success: true, - payload: undefined, - }, - }, - { - usePromise: false, - useQueue: false, - } - ); - await this.handshakeFinished?.promise; - }, - { - attempts: this.handshakeMaxRetries, - timeout: this.handshakeRetryInterval, - } - ) - .then(() => { - this.logger?.log(this.channel.here, "handshake confirmed"); - this.messagesQueue.forEach((message) => { - message.channel = this.channel; - this.sendFn(message); - }); - this.messagesQueue = []; - }) - .catch(() => { - this.handshakeFinished?.reject(new Error("handshake failed")); - this.handshakeFinished = undefined; - }); - } - - /** - * message received from communication channel in descendants of this class - * should be handled by this common onMessage method - */ - onMessage(_message) { - // Older code used to send message as a data property of the message object. - // This is a workaround to keep backward compatibility. - let message = _message; - if ( - this.legacyMode && - message.type === undefined && - "data" in message && - typeof message.data === "object" && - message.data !== null && - "type" in message.data && - typeof message.data.type === "string" - ) { - // @ts-expect-error - message = message.data; - } - const { channel, id, type, payload, success } = message; - - // Don't verify channel in legacy mode - if (!this.legacyMode) { - if (!channel?.peer || channel.peer !== this.channel.here) { - // To wrong peer - return; - } - if (!channel?.here || this.channel.peer !== channel.here) { - // From wrong peer - return; - } - } - if (type === "channel-handshake-request") { - this.postMessage( - { - type: "channel-handshake-confirm", - data: { - success: true, - payload: undefined, - }, - }, - { - usePromise: false, - useQueue: false, - } - ); - if (this.lazyHandshake) { - // When received channel-handshake-request in lazyHandshake mode we start from this side. - this.handshakeWithPeer(); - } - return; - } - if (type === "channel-handshake-confirm") { - this.handshakeFinished?.resolve(undefined); - return; - } - if (this.messagePromises[id]) { - this.messagePromises[id].resolve({ - id, - payload, - success, - }); - delete this.messagePromises[id]; - } - const messagePromisesLength = Object.keys( - this.messagePromises - ).length; - if (messagePromisesLength > 5) { - this.logger?.warn( - `too many message promises (${messagePromisesLength}). this feels unexpected!` - ); - } - - // @ts-expect-error TS complains for odd reasons - this.emit("message", message); - } - - // todo: outgoing messages should be typed - postMessage(message, { usePromise = true, useQueue = true } = {}) { - message.channel = this.channel; - if (!usePromise) { - try { - this.sendFn(message); - } catch (err) { - if (useQueue) { - this.messagesQueue.push(message); - } - } - return; - } - this.messageID++; - message.id = this.messageID; - this.messagePromises[message.id] = createDeferred(); - try { - this.sendFn(message); - } catch (err) { - if (useQueue) { - this.messagesQueue.push(message); - } - } - return this.messagePromises[message.id].promise; - } - resolveMessagePromises(resolvePayload) { - // This is used when we know that the connection has been interrupted but there might be something waiting for it. - Object.keys(this.messagePromises).forEach((id) => - this.messagePromises[id].resolve({ - id, - payload: resolvePayload, - }) - ); - } - clear() { - this.handshakeFinished = undefined; - } - } - // EXTERNAL MODULE: ../../node_modules/ua-parser-js/src/ua-parser.js - var ua_parser = __webpack_require__(332); - var ua_parser_default = /*#__PURE__*/ __webpack_require__.n(ua_parser); // CONCATENATED MODULE: ../env-utils/src/envUtils.ts - const isWeb = () => process.env.SUITE_TYPE === "web"; - const isDesktop = () => process.env.SUITE_TYPE === "desktop"; - const isNative = () => false; - const getEnvironment = () => { - if (isWeb()) return "web"; - return "desktop"; - }; - let userAgentParser; - - /* This way, we can override simple utils, which helps to polyfill methods which are not available in react-native. */ - const getUserAgent = () => window.navigator.userAgent; - const getUserAgentParser = () => { - if (!userAgentParser) { - const ua = getUserAgent(); - userAgentParser = new (ua_parser_default())(ua); - } - return userAgentParser; - }; - const isAndroid = () => /Android/.test(getUserAgent()); - const isChromeOs = () => /CrOS/.test(getUserAgent()); - const getBrowserVersion = () => - getUserAgentParser().getBrowser().version || ""; - const getCommitHash = () => process.env.COMMITHASH || ""; - - /* Not correct for Linux as there is many different distributions in different versions */ - const getOsVersion = () => getUserAgentParser().getOS().version || ""; - const getSuiteVersion = () => process.env.VERSION || ""; - const getBrowserName = () => { - const browserName = getUserAgentParser().getBrowser().name; - return browserName?.toLowerCase() || ""; - }; - const isFirefox = () => getBrowserName() === "firefox"; - - // List of platforms https://docker.apachezone.com/blog/74 - const getPlatform = () => window.navigator.platform; - const getPlatformLanguages = () => window.navigator.languages; - const getScreenWidth = () => window.screen.width; - const getScreenHeight = () => window.screen.height; - const getWindowWidth = () => window.innerWidth; - const getWindowHeight = () => window.innerHeight; - const getLocationOrigin = () => window.location.origin; - const getLocationHostname = () => window.location.hostname; - const getProcessPlatform = () => - typeof process !== "undefined" ? process.platform : ""; - const isMacOs = () => { - if (getProcessPlatform() === "darwin") return true; - if (typeof window === "undefined") return; - return getPlatform().startsWith("Mac"); - }; - const isWindows = () => { - if (getProcessPlatform() === "win32") return true; - if (typeof window === "undefined") return; - return getPlatform().startsWith("Win"); - }; - const isIOs = () => ["iPhone", "iPad", "iPod"].includes(getPlatform()); - const isLinux = () => { - if (getProcessPlatform() === "linux") return true; - if (typeof window === "undefined") return; - - // exclude Android and Chrome OS as window.navigator.platform of those OS is Linux - if (isAndroid() || isChromeOs()) return false; - return getPlatform().startsWith("Linux"); - }; - const isCodesignBuild = () => process.env.IS_CODESIGN_BUILD === "true"; - const getOsName = () => { - if (isWindows()) return "windows"; - if (isMacOs()) return "macos"; - if (isAndroid()) return "android"; - if (isChromeOs()) return "chromeos"; - if (isLinux()) return "linux"; - if (isIOs()) return "ios"; - return ""; - }; - const getOsNameWeb = () => getUserAgentParser().getOS().name; - const getOsFamily = () => { - const osName = getUserAgentParser().getOS().name; - if (osName === "Windows") { - return "Windows"; - } - if (osName === "Mac OS") { - return "MacOS"; - } - return "Linux"; - }; - const getDeviceType = () => getUserAgentParser().getDevice().type; - const envUtils = { - isWeb, - isDesktop, - isNative, - getEnvironment, - getUserAgent, - isAndroid, - isChromeOs, - getOsVersion, - getBrowserName, - getBrowserVersion, - getCommitHash, - getDeviceType, - getSuiteVersion, - isFirefox, - getPlatform, - getPlatformLanguages, - getScreenWidth, - getScreenHeight, - getWindowWidth, - getWindowHeight, - getLocationOrigin, - getLocationHostname, - getProcessPlatform, - isMacOs, - isWindows, - isIOs, - isLinux, - isCodesignBuild, - getOsName, - getOsNameWeb, - getOsFamily, - }; // CONCATENATED MODULE: ../env-utils/src/index.ts - const { - isWeb: src_isWeb, - isDesktop: src_isDesktop, - isNative: src_isNative, - getEnvironment: src_getEnvironment, - getUserAgent: src_getUserAgent, - isAndroid: src_isAndroid, - isChromeOs: src_isChromeOs, - getBrowserVersion: src_getBrowserVersion, - getBrowserName: src_getBrowserName, - getCommitHash: src_getCommitHash, - getDeviceType: src_getDeviceType, - getOsVersion: src_getOsVersion, - getSuiteVersion: src_getSuiteVersion, - isFirefox: src_isFirefox, - getPlatform: src_getPlatform, - getPlatformLanguages: src_getPlatformLanguages, - getScreenWidth: src_getScreenWidth, - getScreenHeight: src_getScreenHeight, - getWindowWidth: src_getWindowWidth, - getWindowHeight: src_getWindowHeight, - getLocationOrigin: src_getLocationOrigin, - getLocationHostname: src_getLocationHostname, - getProcessPlatform: src_getProcessPlatform, - isMacOs: src_isMacOs, - isWindows: src_isWindows, - isIOs: src_isIOs, - isLinux: src_isLinux, - isCodesignBuild: src_isCodesignBuild, - getOsName: src_getOsName, - getOsNameWeb: src_getOsNameWeb, - getOsFamily: src_getOsFamily, - } = envUtils; // CONCATENATED MODULE: ../connect-common/src/systemInfo.ts - const getInstallerPackage = () => { - const agent = src_getUserAgent(); - switch (src_getOsFamily()) { - case "MacOS": - return "mac"; - case "Windows": { - const arch = agent.match(/(Win64|WOW64)/) ? "64" : "32"; - return `win${arch}`; - } - case "Linux": { - const isRpm = agent.match( - /CentOS|Fedora|Mandriva|Mageia|Red Hat|Scientific|SUSE/ - ) - ? "rpm" - : "deb"; - const is64x = agent.match(/Linux i[3456]86/) ? "32" : "64"; - return `${isRpm}${is64x}`; - } - default: - // no default, type safe - } - }; - const getSystemInfo = (supportedBrowsers) => { - const browserName = src_getBrowserName(); - const browserVersion = src_getBrowserVersion(); - const supportedBrowser = browserName - ? supportedBrowsers[browserName.toLowerCase()] - : undefined; - const outdatedBrowser = supportedBrowser - ? supportedBrowser.version > parseInt(browserVersion, 10) - : false; - const mobile = src_getDeviceType() === "mobile"; - const supportedMobile = mobile ? "usb" in navigator : true; - const supported = !!( - supportedBrowser && - !outdatedBrowser && - supportedMobile - ); - return { - os: { - family: src_getOsFamily(), - mobile, - }, - browser: { - supported, - outdated: outdatedBrowser, - }, - }; - }; // CONCATENATED MODULE: ../connect-common/src/index.ts - - /***/ - }, - - /***/ 928: /***/ (module) => { - "use strict"; - // Copyright Joyent, Inc. and other Node contributors. - // - // Permission is hereby granted, free of charge, to any person obtaining a - // copy of this software and associated documentation files (the - // "Software"), to deal in the Software without restriction, including - // without limitation the rights to use, copy, modify, merge, publish, - // distribute, sublicense, and/or sell copies of the Software, and to permit - // persons to whom the Software is furnished to do so, subject to the - // following conditions: - // - // The above copyright notice and this permission notice shall be included - // in all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - var R = typeof Reflect === "object" ? Reflect : null; - var ReflectApply = - R && typeof R.apply === "function" - ? R.apply - : function ReflectApply(target, receiver, args) { - return Function.prototype.apply.call(target, receiver, args); - }; - - var ReflectOwnKeys; - if (R && typeof R.ownKeys === "function") { - ReflectOwnKeys = R.ownKeys; - } else if (Object.getOwnPropertySymbols) { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target).concat( - Object.getOwnPropertySymbols(target) - ); - }; - } else { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target); - }; - } - - function ProcessEmitWarning(warning) { - if (console && console.warn) console.warn(warning); - } - - var NumberIsNaN = - Number.isNaN || - function NumberIsNaN(value) { - return value !== value; - }; - - function EventEmitter() { - EventEmitter.init.call(this); - } - module.exports = EventEmitter; - module.exports.once = once; - - // Backwards-compat with node 0.10.x - EventEmitter.EventEmitter = EventEmitter; - - EventEmitter.prototype._events = undefined; - EventEmitter.prototype._eventsCount = 0; - EventEmitter.prototype._maxListeners = undefined; - - // By default EventEmitters will print a warning if more than 10 listeners are - // added to it. This is a useful default which helps finding memory leaks. - var defaultMaxListeners = 10; - - function checkListener(listener) { - if (typeof listener !== "function") { - throw new TypeError( - 'The "listener" argument must be of type Function. Received type ' + - typeof listener - ); - } - } - - Object.defineProperty(EventEmitter, "defaultMaxListeners", { - enumerable: true, - get: function () { - return defaultMaxListeners; - }, - set: function (arg) { - if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) { - throw new RangeError( - 'The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + - arg + - "." - ); - } - defaultMaxListeners = arg; - }, - }); - - EventEmitter.init = function () { - if ( - this._events === undefined || - this._events === Object.getPrototypeOf(this)._events - ) { - this._events = Object.create(null); - this._eventsCount = 0; - } - - this._maxListeners = this._maxListeners || undefined; - }; - - // Obviously not all Emitters should be limited to 10. This function allows - // that to be increased. Set to zero for unlimited. - EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { - if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) { - throw new RangeError( - 'The value of "n" is out of range. It must be a non-negative number. Received ' + - n + - "." - ); - } - this._maxListeners = n; - return this; - }; - - function _getMaxListeners(that) { - if (that._maxListeners === undefined) - return EventEmitter.defaultMaxListeners; - return that._maxListeners; - } - - EventEmitter.prototype.getMaxListeners = function getMaxListeners() { - return _getMaxListeners(this); - }; - - EventEmitter.prototype.emit = function emit(type) { - var args = []; - for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); - var doError = type === "error"; - - var events = this._events; - if (events !== undefined) - doError = doError && events.error === undefined; - else if (!doError) return false; - - // If there is no 'error' event listener then throw. - if (doError) { - var er; - if (args.length > 0) er = args[0]; - if (er instanceof Error) { - // Note: The comments on the `throw` lines are intentional, they show - // up in Node's output if this results in an unhandled exception. - throw er; // Unhandled 'error' event - } - // At least give some kind of context to the user - var err = new Error( - "Unhandled error." + (er ? " (" + er.message + ")" : "") - ); - err.context = er; - throw err; // Unhandled 'error' event - } - - var handler = events[type]; - - if (handler === undefined) return false; - - if (typeof handler === "function") { - ReflectApply(handler, this, args); - } else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) ReflectApply(listeners[i], this, args); - } - - return true; - }; - - function _addListener(target, type, listener, prepend) { - var m; - var events; - var existing; - - checkListener(listener); - - events = target._events; - if (events === undefined) { - events = target._events = Object.create(null); - target._eventsCount = 0; - } else { - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (events.newListener !== undefined) { - target.emit( - "newListener", - type, - listener.listener ? listener.listener : listener - ); - - // Re-assign `events` because a newListener handler could have caused the - // this._events to be assigned to a new object - events = target._events; - } - existing = events[type]; - } - - if (existing === undefined) { - // Optimize the case of one listener. Don't need the extra array object. - existing = events[type] = listener; - ++target._eventsCount; - } else { - if (typeof existing === "function") { - // Adding the second element, need to change to array. - existing = events[type] = prepend - ? [listener, existing] - : [existing, listener]; - // If we've already got an array, just append. - } else if (prepend) { - existing.unshift(listener); - } else { - existing.push(listener); - } - - // Check for listener leak - m = _getMaxListeners(target); - if (m > 0 && existing.length > m && !existing.warned) { - existing.warned = true; - // No error code for this since it is a Warning - // eslint-disable-next-line no-restricted-syntax - var w = new Error( - "Possible EventEmitter memory leak detected. " + - existing.length + - " " + - String(type) + - " listeners " + - "added. Use emitter.setMaxListeners() to " + - "increase limit" - ); - w.name = "MaxListenersExceededWarning"; - w.emitter = target; - w.type = type; - w.count = existing.length; - ProcessEmitWarning(w); - } - } - - return target; - } - - EventEmitter.prototype.addListener = function addListener( - type, - listener - ) { - return _addListener(this, type, listener, false); - }; - - EventEmitter.prototype.on = EventEmitter.prototype.addListener; - - EventEmitter.prototype.prependListener = function prependListener( - type, - listener - ) { - return _addListener(this, type, listener, true); - }; - - function onceWrapper() { - if (!this.fired) { - this.target.removeListener(this.type, this.wrapFn); - this.fired = true; - if (arguments.length === 0) return this.listener.call(this.target); - return this.listener.apply(this.target, arguments); - } - } - - function _onceWrap(target, type, listener) { - var state = { - fired: false, - wrapFn: undefined, - target: target, - type: type, - listener: listener, - }; - var wrapped = onceWrapper.bind(state); - wrapped.listener = listener; - state.wrapFn = wrapped; - return wrapped; - } - - EventEmitter.prototype.once = function once(type, listener) { - checkListener(listener); - this.on(type, _onceWrap(this, type, listener)); - return this; - }; - - EventEmitter.prototype.prependOnceListener = function prependOnceListener( - type, - listener - ) { - checkListener(listener); - this.prependListener(type, _onceWrap(this, type, listener)); - return this; - }; - - // Emits a 'removeListener' event if and only if the listener was removed. - EventEmitter.prototype.removeListener = function removeListener( - type, - listener - ) { - var list, events, position, i, originalListener; - - checkListener(listener); - - events = this._events; - if (events === undefined) return this; - - list = events[type]; - if (list === undefined) return this; - - if (list === listener || list.listener === listener) { - if (--this._eventsCount === 0) this._events = Object.create(null); - else { - delete events[type]; - if (events.removeListener) - this.emit("removeListener", type, list.listener || listener); - } - } else if (typeof list !== "function") { - position = -1; - - for (i = list.length - 1; i >= 0; i--) { - if (list[i] === listener || list[i].listener === listener) { - originalListener = list[i].listener; - position = i; - break; - } - } - - if (position < 0) return this; - - if (position === 0) list.shift(); - else { - spliceOne(list, position); - } - - if (list.length === 1) events[type] = list[0]; +let port = chrome.runtime.connect({ name: "trezor-connect" }); - if (events.removeListener !== undefined) - this.emit("removeListener", type, originalListener || listener); - } +port.onMessage.addListener((message) => { + window.postMessage(message, window.location.origin); +}); - return this; - }; +port.onDisconnect.addListener(() => { + port = null; +}); - EventEmitter.prototype.off = EventEmitter.prototype.removeListener; - - EventEmitter.prototype.removeAllListeners = function removeAllListeners( - type - ) { - var listeners, events, i; - - events = this._events; - if (events === undefined) return this; - - // not listening for removeListener, no need to emit - if (events.removeListener === undefined) { - if (arguments.length === 0) { - this._events = Object.create(null); - this._eventsCount = 0; - } else if (events[type] !== undefined) { - if (--this._eventsCount === 0) this._events = Object.create(null); - else delete events[type]; - } - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - var keys = Object.keys(events); - var key; - for (i = 0; i < keys.length; ++i) { - key = keys[i]; - if (key === "removeListener") continue; - this.removeAllListeners(key); - } - this.removeAllListeners("removeListener"); - this._events = Object.create(null); - this._eventsCount = 0; - return this; - } - - listeners = events[type]; - - if (typeof listeners === "function") { - this.removeListener(type, listeners); - } else if (listeners !== undefined) { - // LIFO order - for (i = listeners.length - 1; i >= 0; i--) { - this.removeListener(type, listeners[i]); - } - } - - return this; - }; - - function _listeners(target, type, unwrap) { - var events = target._events; - - if (events === undefined) return []; - - var evlistener = events[type]; - if (evlistener === undefined) return []; - - if (typeof evlistener === "function") - return unwrap ? [evlistener.listener || evlistener] : [evlistener]; - - return unwrap - ? unwrapListeners(evlistener) - : arrayClone(evlistener, evlistener.length); - } - - EventEmitter.prototype.listeners = function listeners(type) { - return _listeners(this, type, true); - }; - - EventEmitter.prototype.rawListeners = function rawListeners(type) { - return _listeners(this, type, false); - }; - - EventEmitter.listenerCount = function (emitter, type) { - if (typeof emitter.listenerCount === "function") { - return emitter.listenerCount(type); - } else { - return listenerCount.call(emitter, type); - } - }; - - EventEmitter.prototype.listenerCount = listenerCount; - function listenerCount(type) { - var events = this._events; - - if (events !== undefined) { - var evlistener = events[type]; - - if (typeof evlistener === "function") { - return 1; - } else if (evlistener !== undefined) { - return evlistener.length; - } - } - - return 0; - } - - EventEmitter.prototype.eventNames = function eventNames() { - return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; - }; - - function arrayClone(arr, n) { - var copy = new Array(n); - for (var i = 0; i < n; ++i) copy[i] = arr[i]; - return copy; - } - - function spliceOne(list, index) { - for (; index + 1 < list.length; index++) list[index] = list[index + 1]; - list.pop(); - } - - function unwrapListeners(arr) { - var ret = new Array(arr.length); - for (var i = 0; i < ret.length; ++i) { - ret[i] = arr[i].listener || arr[i]; - } - return ret; - } - - function once(emitter, name) { - return new Promise(function (resolve, reject) { - function errorListener(err) { - emitter.removeListener(name, resolver); - reject(err); - } - - function resolver() { - if (typeof emitter.removeListener === "function") { - emitter.removeListener("error", errorListener); - } - resolve([].slice.call(arguments)); - } - - eventTargetAgnosticAddListener(emitter, name, resolver, { - once: true, - }); - if (name !== "error") { - addErrorHandlerIfEventEmitter(emitter, errorListener, { - once: true, - }); - } - }); - } - - function addErrorHandlerIfEventEmitter(emitter, handler, flags) { - if (typeof emitter.on === "function") { - eventTargetAgnosticAddListener(emitter, "error", handler, flags); - } - } - - function eventTargetAgnosticAddListener(emitter, name, listener, flags) { - if (typeof emitter.on === "function") { - if (flags.once) { - emitter.once(name, listener); - } else { - emitter.on(name, listener); - } - } else if (typeof emitter.addEventListener === "function") { - // EventTarget does not have `error` event semantics like Node - // EventEmitters, we do not listen for `error` events here. - emitter.addEventListener(name, function wrapListener(arg) { - // IE does not have builtin `{ once: true }` support so we - // have to do it manually. - if (flags.once) { - emitter.removeEventListener(name, wrapListener); - } - listener(arg); - }); - } else { - throw new TypeError( - 'The "emitter" argument must be of type EventEmitter. Received type ' + - typeof emitter - ); - } - } - - /***/ - }, - - /***/ 332: /***/ function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_RESULT__; ///////////////////////////////////////////////////////////////////////////////// - /* UAParser.js v1.0.37 - Copyright © 2012-2021 Faisal Salman - MIT License */ /* - Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. - Supports browser & node.js environment. - Demo : https://faisalman.github.io/ua-parser-js - Source : https://github.com/faisalman/ua-parser-js */ - ///////////////////////////////////////////////////////////////////////////////// - - (function (window, undefined) { - "use strict"; - - ////////////// - // Constants - ///////////// - - var LIBVERSION = "1.0.37", - EMPTY = "", - UNKNOWN = "?", - FUNC_TYPE = "function", - UNDEF_TYPE = "undefined", - OBJ_TYPE = "object", - STR_TYPE = "string", - MAJOR = "major", - MODEL = "model", - NAME = "name", - TYPE = "type", - VENDOR = "vendor", - VERSION = "version", - ARCHITECTURE = "architecture", - CONSOLE = "console", - MOBILE = "mobile", - TABLET = "tablet", - SMARTTV = "smarttv", - WEARABLE = "wearable", - EMBEDDED = "embedded", - UA_MAX_LENGTH = 500; - - var AMAZON = "Amazon", - APPLE = "Apple", - ASUS = "ASUS", - BLACKBERRY = "BlackBerry", - BROWSER = "Browser", - CHROME = "Chrome", - EDGE = "Edge", - FIREFOX = "Firefox", - GOOGLE = "Google", - HUAWEI = "Huawei", - LG = "LG", - MICROSOFT = "Microsoft", - MOTOROLA = "Motorola", - OPERA = "Opera", - SAMSUNG = "Samsung", - SHARP = "Sharp", - SONY = "Sony", - XIAOMI = "Xiaomi", - ZEBRA = "Zebra", - FACEBOOK = "Facebook", - CHROMIUM_OS = "Chromium OS", - MAC_OS = "Mac OS"; - - /////////// - // Helper - ////////// - - var extend = function (regexes, extensions) { - var mergedRegexes = {}; - for (var i in regexes) { - if (extensions[i] && extensions[i].length % 2 === 0) { - mergedRegexes[i] = extensions[i].concat(regexes[i]); - } else { - mergedRegexes[i] = regexes[i]; - } - } - return mergedRegexes; - }, - enumerize = function (arr) { - var enums = {}; - for (var i = 0; i < arr.length; i++) { - enums[arr[i].toUpperCase()] = arr[i]; - } - return enums; - }, - has = function (str1, str2) { - return typeof str1 === STR_TYPE - ? lowerize(str2).indexOf(lowerize(str1)) !== -1 - : false; - }, - lowerize = function (str) { - return str.toLowerCase(); - }, - majorize = function (version) { - return typeof version === STR_TYPE - ? version.replace(/[^\d\.]/g, EMPTY).split(".")[0] - : undefined; - }, - trim = function (str, len) { - if (typeof str === STR_TYPE) { - str = str.replace(/^\s\s*/, EMPTY); - return typeof len === UNDEF_TYPE - ? str - : str.substring(0, UA_MAX_LENGTH); - } - }; - - /////////////// - // Map helper - ////////////// - - var rgxMapper = function (ua, arrays) { - var i = 0, - j, - k, - p, - q, - matches, - match; - - // loop through all regexes maps - while (i < arrays.length && !matches) { - var regex = arrays[i], // even sequence (0,2,4,..) - props = arrays[i + 1]; // odd sequence (1,3,5,..) - j = k = 0; - - // try matching uastring with regexes - while (j < regex.length && !matches) { - if (!regex[j]) { - break; - } - matches = regex[j++].exec(ua); - - if (!!matches) { - for (p = 0; p < props.length; p++) { - match = matches[++k]; - q = props[p]; - // check if given property is actually array - if (typeof q === OBJ_TYPE && q.length > 0) { - if (q.length === 2) { - if (typeof q[1] == FUNC_TYPE) { - // assign modified match - this[q[0]] = q[1].call(this, match); - } else { - // assign given value, ignore regex match - this[q[0]] = q[1]; - } - } else if (q.length === 3) { - // check whether function or regex - if ( - typeof q[1] === FUNC_TYPE && - !(q[1].exec && q[1].test) - ) { - // call function (usually string mapper) - this[q[0]] = match - ? q[1].call(this, match, q[2]) - : undefined; - } else { - // sanitize match using given regex - this[q[0]] = match - ? match.replace(q[1], q[2]) - : undefined; - } - } else if (q.length === 4) { - this[q[0]] = match - ? q[3].call(this, match.replace(q[1], q[2])) - : undefined; - } - } else { - this[q] = match ? match : undefined; - } - } - } - } - i += 2; - } - }, - strMapper = function (str, map) { - for (var i in map) { - // check if current value is array - if (typeof map[i] === OBJ_TYPE && map[i].length > 0) { - for (var j = 0; j < map[i].length; j++) { - if (has(map[i][j], str)) { - return i === UNKNOWN ? undefined : i; - } - } - } else if (has(map[i], str)) { - return i === UNKNOWN ? undefined : i; - } - } - return str; - }; - - /////////////// - // String map - ////////////// - - // Safari < 3.0 - var oldSafariMap = { - "1.0": "/8", - 1.2: "/1", - 1.3: "/3", - "2.0": "/412", - "2.0.2": "/416", - "2.0.3": "/417", - "2.0.4": "/419", - "?": "/", - }, - windowsVersionMap = { - ME: "4.90", - "NT 3.11": "NT3.51", - "NT 4.0": "NT4.0", - 2000: "NT 5.0", - XP: ["NT 5.1", "NT 5.2"], - Vista: "NT 6.0", - 7: "NT 6.1", - 8: "NT 6.2", - 8.1: "NT 6.3", - 10: ["NT 6.4", "NT 10.0"], - RT: "ARM", - }; - - ////////////// - // Regex map - ///////////// - - var regexes = { - browser: [ - [ - /\b(?:crmo|crios)\/([\w\.]+)/i, // Chrome for Android/iOS - ], - [VERSION, [NAME, "Chrome"]], - [ - /edg(?:e|ios|a)?\/([\w\.]+)/i, // Microsoft Edge - ], - [VERSION, [NAME, "Edge"]], - [ - // Presto based - /(opera mini)\/([-\w\.]+)/i, // Opera Mini - /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, // Opera Mobi/Tablet - /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i, // Opera - ], - [NAME, VERSION], - [ - /opios[\/ ]+([\w\.]+)/i, // Opera mini on iphone >= 8.0 - ], - [VERSION, [NAME, OPERA + " Mini"]], - [ - /\bopr\/([\w\.]+)/i, // Opera Webkit - ], - [VERSION, [NAME, OPERA]], - [ - // Mixed - /\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i, // Baidu - ], - [VERSION, [NAME, "Baidu"]], - [ - /(kindle)\/([\w\.]+)/i, // Kindle - /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer - // Trident based - /(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser - /(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer - - // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon - /(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i, - // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ - /(heytap|ovi)browser\/([\d\.]+)/i, // Heytap/Ovi - /(weibo)__([\d\.]+)/i, // Weibo - ], - [NAME, VERSION], - [ - /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i, // UCBrowser - ], - [VERSION, [NAME, "UC" + BROWSER]], - [ - /microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser - /\bqbcore\/([\w\.]+).+microm/i, - /micromessenger\/([\w\.]+)/i, // WeChat - ], - [VERSION, [NAME, "WeChat"]], - [ - /konqueror\/([\w\.]+)/i, // Konqueror - ], - [VERSION, [NAME, "Konqueror"]], - [ - /trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i, // IE11 - ], - [VERSION, [NAME, "IE"]], - [ - /ya(?:search)?browser\/([\w\.]+)/i, // Yandex - ], - [VERSION, [NAME, "Yandex"]], - [ - /slbrowser\/([\w\.]+)/i, // Smart Lenovo Browser - ], - [VERSION, [NAME, "Smart Lenovo " + BROWSER]], - [ - /(avast|avg)\/([\w\.]+)/i, // Avast/AVG Secure Browser - ], - [[NAME, /(.+)/, "$1 Secure " + BROWSER], VERSION], - [ - /\bfocus\/([\w\.]+)/i, // Firefox Focus - ], - [VERSION, [NAME, FIREFOX + " Focus"]], - [ - /\bopt\/([\w\.]+)/i, // Opera Touch - ], - [VERSION, [NAME, OPERA + " Touch"]], - [ - /coc_coc\w+\/([\w\.]+)/i, // Coc Coc Browser - ], - [VERSION, [NAME, "Coc Coc"]], - [ - /dolfin\/([\w\.]+)/i, // Dolphin - ], - [VERSION, [NAME, "Dolphin"]], - [ - /coast\/([\w\.]+)/i, // Opera Coast - ], - [VERSION, [NAME, OPERA + " Coast"]], - [ - /miuibrowser\/([\w\.]+)/i, // MIUI Browser - ], - [VERSION, [NAME, "MIUI " + BROWSER]], - [ - /fxios\/([-\w\.]+)/i, // Firefox for iOS - ], - [VERSION, [NAME, FIREFOX]], - [ - /\bqihu|(qi?ho?o?|360)browser/i, // 360 - ], - [[NAME, "360 " + BROWSER]], - [/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i], - [[NAME, /(.+)/, "$1 " + BROWSER], VERSION], - [ - // Oculus/Sailfish/HuaweiBrowser/VivoBrowser - /samsungbrowser\/([\w\.]+)/i, // Samsung Internet - ], - [VERSION, [NAME, SAMSUNG + " Internet"]], - [ - /(comodo_dragon)\/([\w\.]+)/i, // Comodo Dragon - ], - [[NAME, /_/g, " "], VERSION], - [ - /metasr[\/ ]?([\d\.]+)/i, // Sogou Explorer - ], - [VERSION, [NAME, "Sogou Explorer"]], - [ - /(sogou)mo\w+\/([\d\.]+)/i, // Sogou Mobile - ], - [[NAME, "Sogou Mobile"], VERSION], - [ - /(electron)\/([\w\.]+) safari/i, // Electron-based App - /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla - /m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i, // QQBrowser/2345 Browser - ], - [NAME, VERSION], - [ - /(lbbrowser)/i, // LieBao Browser - /\[(linkedin)app\]/i, // LinkedIn App for iOS & Android - ], - [NAME], - [ - // WebView - /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i, // Facebook App for iOS & Android - ], - [[NAME, FACEBOOK], VERSION], - [ - /(Klarna)\/([\w\.]+)/i, // Klarna Shopping Browser for iOS & Android - /(kakao(?:talk|story))[\/ ]([\w\.]+)/i, // Kakao App - /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, // Naver InApp - /safari (line)\/([\w\.]+)/i, // Line App for iOS - /\b(line)\/([\w\.]+)\/iab/i, // Line App for Android - /(alipay)client\/([\w\.]+)/i, // Alipay - /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i, // Chromium/Instagram/Snapchat - ], - [NAME, VERSION], - [ - /\bgsa\/([\w\.]+) .*safari\//i, // Google Search Appliance on iOS - ], - [VERSION, [NAME, "GSA"]], - [ - /musical_ly(?:.+app_?version\/|_)([\w\.]+)/i, // TikTok - ], - [VERSION, [NAME, "TikTok"]], - [ - /headlesschrome(?:\/([\w\.]+)| )/i, // Chrome Headless - ], - [VERSION, [NAME, CHROME + " Headless"]], - [ - / wv\).+(chrome)\/([\w\.]+)/i, // Chrome WebView - ], - [[NAME, CHROME + " WebView"], VERSION], - [ - /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i, // Android Browser - ], - [VERSION, [NAME, "Android " + BROWSER]], - [ - /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i, // Chrome/OmniWeb/Arora/Tizen/Nokia - ], - [NAME, VERSION], - [ - /version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i, // Mobile Safari - ], - [VERSION, [NAME, "Mobile Safari"]], - [ - /version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i, // Safari & Safari Mobile - ], - [VERSION, NAME], - [ - /webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i, // Safari < 3.0 - ], - [NAME, [VERSION, strMapper, oldSafariMap]], - [/(webkit|khtml)\/([\w\.]+)/i], - [NAME, VERSION], - [ - // Gecko based - /(navigator|netscape\d?)\/([-\w\.]+)/i, // Netscape - ], - [[NAME, "Netscape"], VERSION], - [ - /mobile vr; rv:([\w\.]+)\).+firefox/i, // Firefox Reality - ], - [VERSION, [NAME, FIREFOX + " Reality"]], - [ - /ekiohf.+(flow)\/([\w\.]+)/i, // Flow - /(swiftfox)/i, // Swiftfox - /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i, - // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar - /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, - // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix - /(firefox)\/([\w\.]+)/i, // Other Firefox-based - /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, // Mozilla - - // Other - /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, - // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser - /(links) \(([\w\.]+)/i, // Links - /panasonic;(viera)/i, // Panasonic Viera - ], - [NAME, VERSION], - [ - /(cobalt)\/([\w\.]+)/i, // Cobalt - ], - [NAME, [VERSION, /master.|lts./, ""]], - ], - - cpu: [ - [ - /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i, // AMD64 (x64) - ], - [[ARCHITECTURE, "amd64"]], - [ - /(ia32(?=;))/i, // IA32 (quicktime) - ], - [[ARCHITECTURE, lowerize]], - [ - /((?:i[346]|x)86)[;\)]/i, // IA32 (x86) - ], - [[ARCHITECTURE, "ia32"]], - [ - /\b(aarch64|arm(v?8e?l?|_?64))\b/i, // ARM64 - ], - [[ARCHITECTURE, "arm64"]], - [ - /\b(arm(?:v[67])?ht?n?[fl]p?)\b/i, // ARMHF - ], - [[ARCHITECTURE, "armhf"]], - [ - // PocketPC mistakenly identified as PowerPC - /windows (ce|mobile); ppc;/i, - ], - [[ARCHITECTURE, "arm"]], - [ - /((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i, // PowerPC - ], - [[ARCHITECTURE, /ower/, EMPTY, lowerize]], - [ - /(sun4\w)[;\)]/i, // SPARC - ], - [[ARCHITECTURE, "sparc"]], - [ - /((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i, - // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC - ], - [[ARCHITECTURE, lowerize]], - ], - - device: [ - [ - ////////////////////////// - // MOBILES & TABLETS - ///////////////////////// - - // Samsung - /\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i, - ], - [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]], - [ - /\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, - /samsung[- ]([-\w]+)/i, - /sec-(sgh\w+)/i, - ], - [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], - [ - // Apple - /(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i, // iPod/iPhone - ], - [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], - [ - /\((ipad);[-\w\),; ]+apple/i, // iPad - /applecoremedia\/[\w\.]+ \((ipad)/i, - /\b(ipad)\d\d?,\d\d?[;\]].+ios/i, - ], - [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], - [/(macintosh);/i], - [MODEL, [VENDOR, APPLE]], - [ - // Sharp - /\b(sh-?[altvz]?\d\d[a-ekm]?)/i, - ], - [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]], - [ - // Huawei - /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i, - ], - [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], - [ - /(?:huawei|honor)([-\w ]+)[;\)]/i, - /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i, - ], - [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], - [ - // Xiaomi - /\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i, // Xiaomi POCO - /\b; (\w+) build\/hm\1/i, // Xiaomi Hongmi 'numeric' models - /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, // Xiaomi Hongmi - /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, // Xiaomi Redmi - /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i, // Xiaomi Redmi 'numeric' models - /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i, // Xiaomi Mi - ], - [ - [MODEL, /_/g, " "], - [VENDOR, XIAOMI], - [TYPE, MOBILE], - ], - [ - /oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i, // Redmi Pad - /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i, // Mi Pad tablets - ], - [ - [MODEL, /_/g, " "], - [VENDOR, XIAOMI], - [TYPE, TABLET], - ], - [ - // OPPO - /; (\w+) bui.+ oppo/i, - /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i, - ], - [MODEL, [VENDOR, "OPPO"], [TYPE, MOBILE]], - [ - // Vivo - /vivo (\w+)(?: bui|\))/i, - /\b(v[12]\d{3}\w?[at])(?: bui|;)/i, - ], - [MODEL, [VENDOR, "Vivo"], [TYPE, MOBILE]], - [ - // Realme - /\b(rmx[1-3]\d{3})(?: bui|;|\))/i, - ], - [MODEL, [VENDOR, "Realme"], [TYPE, MOBILE]], - [ - // Motorola - /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, - /\bmot(?:orola)?[- ](\w*)/i, - /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i, - ], - [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]], - [/\b(mz60\d|xoom[2 ]{0,2}) build\//i], - [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]], - [ - // LG - /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i, - ], - [MODEL, [VENDOR, LG], [TYPE, TABLET]], - [ - /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, - /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, - /\blg-?([\d\w]+) bui/i, - ], - [MODEL, [VENDOR, LG], [TYPE, MOBILE]], - [ - // Lenovo - /(ideatab[-\w ]+)/i, - /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i, - ], - [MODEL, [VENDOR, "Lenovo"], [TYPE, TABLET]], - [ - // Nokia - /(?:maemo|nokia).*(n900|lumia \d+)/i, - /nokia[-_ ]?([-\w\.]*)/i, - ], - [ - [MODEL, /_/g, " "], - [VENDOR, "Nokia"], - [TYPE, MOBILE], - ], - [ - // Google - /(pixel c)\b/i, // Google Pixel C - ], - [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]], - [ - /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i, // Google Pixel - ], - [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], - [ - // Sony - /droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i, - ], - [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], - [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i], - [ - [MODEL, "Xperia Tablet"], - [VENDOR, SONY], - [TYPE, TABLET], - ], - [ - // OnePlus - / (kb2005|in20[12]5|be20[12][59])\b/i, - /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i, - ], - [MODEL, [VENDOR, "OnePlus"], [TYPE, MOBILE]], - [ - // Amazon - /(alexa)webm/i, - /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, // Kindle Fire without Silk / Echo Show - /(kf[a-z]+)( bui|\)).+silk\//i, // Kindle Fire HD - ], - [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], - [ - /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i, // Fire Phone - ], - [ - [MODEL, /(.+)/g, "Fire Phone $1"], - [VENDOR, AMAZON], - [TYPE, MOBILE], - ], - [ - // BlackBerry - /(playbook);[-\w\),; ]+(rim)/i, // BlackBerry PlayBook - ], - [MODEL, VENDOR, [TYPE, TABLET]], - [ - /\b((?:bb[a-f]|st[hv])100-\d)/i, - /\(bb10; (\w+)/i, // BlackBerry 10 - ], - [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]], - [ - // Asus - /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i, - ], - [MODEL, [VENDOR, ASUS], [TYPE, TABLET]], - [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i], - [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]], - [ - // HTC - /(nexus 9)/i, // HTC Nexus 9 - ], - [MODEL, [VENDOR, "HTC"], [TYPE, TABLET]], - [ - /(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, // HTC - - // ZTE - /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, - /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i, // Alcatel/GeeksPhone/Nexian/Panasonic/Sony - ], - [VENDOR, [MODEL, /_/g, " "], [TYPE, MOBILE]], - [ - // Acer - /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i, - ], - [MODEL, [VENDOR, "Acer"], [TYPE, TABLET]], - [ - // Meizu - /droid.+; (m[1-5] note) bui/i, - /\bmz-([-\w]{2,})/i, - ], - [MODEL, [VENDOR, "Meizu"], [TYPE, MOBILE]], - [ - // Ulefone - /; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i, - ], - [MODEL, [VENDOR, "Ulefone"], [TYPE, MOBILE]], - [ - // MIXED - /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i, - // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron - /(hp) ([\w ]+\w)/i, // HP iPAQ - /(asus)-?(\w+)/i, // Asus - /(microsoft); (lumia[\w ]+)/i, // Microsoft Lumia - /(lenovo)[-_ ]?([-\w]+)/i, // Lenovo - /(jolla)/i, // Jolla - /(oppo) ?([\w ]+) bui/i, // OPPO - ], - [VENDOR, MODEL, [TYPE, MOBILE]], - [ - /(kobo)\s(ereader|touch)/i, // Kobo - /(archos) (gamepad2?)/i, // Archos - /(hp).+(touchpad(?!.+tablet)|tablet)/i, // HP TouchPad - /(kindle)\/([\w\.]+)/i, // Kindle - /(nook)[\w ]+build\/(\w+)/i, // Nook - /(dell) (strea[kpr\d ]*[\dko])/i, // Dell Streak - /(le[- ]+pan)[- ]+(\w{1,9}) bui/i, // Le Pan Tablets - /(trinity)[- ]*(t\d{3}) bui/i, // Trinity Tablets - /(gigaset)[- ]+(q\w{1,9}) bui/i, // Gigaset Tablets - /(vodafone) ([\w ]+)(?:\)| bui)/i, // Vodafone - ], - [VENDOR, MODEL, [TYPE, TABLET]], - [ - /(surface duo)/i, // Surface Duo - ], - [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]], - [ - /droid [\d\.]+; (fp\du?)(?: b|\))/i, // Fairphone - ], - [MODEL, [VENDOR, "Fairphone"], [TYPE, MOBILE]], - [ - /(u304aa)/i, // AT&T - ], - [MODEL, [VENDOR, "AT&T"], [TYPE, MOBILE]], - [ - /\bsie-(\w*)/i, // Siemens - ], - [MODEL, [VENDOR, "Siemens"], [TYPE, MOBILE]], - [ - /\b(rct\w+) b/i, // RCA Tablets - ], - [MODEL, [VENDOR, "RCA"], [TYPE, TABLET]], - [ - /\b(venue[\d ]{2,7}) b/i, // Dell Venue Tablets - ], - [MODEL, [VENDOR, "Dell"], [TYPE, TABLET]], - [ - /\b(q(?:mv|ta)\w+) b/i, // Verizon Tablet - ], - [MODEL, [VENDOR, "Verizon"], [TYPE, TABLET]], - [ - /\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i, // Barnes & Noble Tablet - ], - [MODEL, [VENDOR, "Barnes & Noble"], [TYPE, TABLET]], - [/\b(tm\d{3}\w+) b/i], - [MODEL, [VENDOR, "NuVision"], [TYPE, TABLET]], - [ - /\b(k88) b/i, // ZTE K Series Tablet - ], - [MODEL, [VENDOR, "ZTE"], [TYPE, TABLET]], - [ - /\b(nx\d{3}j) b/i, // ZTE Nubia - ], - [MODEL, [VENDOR, "ZTE"], [TYPE, MOBILE]], - [ - /\b(gen\d{3}) b.+49h/i, // Swiss GEN Mobile - ], - [MODEL, [VENDOR, "Swiss"], [TYPE, MOBILE]], - [ - /\b(zur\d{3}) b/i, // Swiss ZUR Tablet - ], - [MODEL, [VENDOR, "Swiss"], [TYPE, TABLET]], - [ - /\b((zeki)?tb.*\b) b/i, // Zeki Tablets - ], - [MODEL, [VENDOR, "Zeki"], [TYPE, TABLET]], - [ - /\b([yr]\d{2}) b/i, - /\b(dragon[- ]+touch |dt)(\w{5}) b/i, // Dragon Touch Tablet - ], - [[VENDOR, "Dragon Touch"], MODEL, [TYPE, TABLET]], - [ - /\b(ns-?\w{0,9}) b/i, // Insignia Tablets - ], - [MODEL, [VENDOR, "Insignia"], [TYPE, TABLET]], - [ - /\b((nxa|next)-?\w{0,9}) b/i, // NextBook Tablets - ], - [MODEL, [VENDOR, "NextBook"], [TYPE, TABLET]], - [ - /\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i, // Voice Xtreme Phones - ], - [[VENDOR, "Voice"], MODEL, [TYPE, MOBILE]], - [ - /\b(lvtel\-)?(v1[12]) b/i, // LvTel Phones - ], - [[VENDOR, "LvTel"], MODEL, [TYPE, MOBILE]], - [ - /\b(ph-1) /i, // Essential PH-1 - ], - [MODEL, [VENDOR, "Essential"], [TYPE, MOBILE]], - [ - /\b(v(100md|700na|7011|917g).*\b) b/i, // Envizen Tablets - ], - [MODEL, [VENDOR, "Envizen"], [TYPE, TABLET]], - [ - /\b(trio[-\w\. ]+) b/i, // MachSpeed Tablets - ], - [MODEL, [VENDOR, "MachSpeed"], [TYPE, TABLET]], - [ - /\btu_(1491) b/i, // Rotor Tablets - ], - [MODEL, [VENDOR, "Rotor"], [TYPE, TABLET]], - [ - /(shield[\w ]+) b/i, // Nvidia Shield Tablets - ], - [MODEL, [VENDOR, "Nvidia"], [TYPE, TABLET]], - [ - /(sprint) (\w+)/i, // Sprint Phones - ], - [VENDOR, MODEL, [TYPE, MOBILE]], - [ - /(kin\.[onetw]{3})/i, // Microsoft Kin - ], - [ - [MODEL, /\./g, " "], - [VENDOR, MICROSOFT], - [TYPE, MOBILE], - ], - [ - /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i, // Zebra - ], - [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]], - [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i], - [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]], - [ - /////////////////// - // SMARTTVS - /////////////////// - - /smart-tv.+(samsung)/i, // Samsung - ], - [VENDOR, [TYPE, SMARTTV]], - [/hbbtv.+maple;(\d+)/i], - [ - [MODEL, /^/, "SmartTV"], - [VENDOR, SAMSUNG], - [TYPE, SMARTTV], - ], - [ - /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i, // LG SmartTV - ], - [ - [VENDOR, LG], - [TYPE, SMARTTV], - ], - [ - /(apple) ?tv/i, // Apple TV - ], - [VENDOR, [MODEL, APPLE + " TV"], [TYPE, SMARTTV]], - [ - /crkey/i, // Google Chromecast - ], - [ - [MODEL, CHROME + "cast"], - [VENDOR, GOOGLE], - [TYPE, SMARTTV], - ], - [ - /droid.+aft(\w+)( bui|\))/i, // Fire TV - ], - [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], - [ - /\(dtv[\);].+(aquos)/i, - /(aquos-tv[\w ]+)\)/i, // Sharp - ], - [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]], - [ - /(bravia[\w ]+)( bui|\))/i, // Sony - ], - [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]], - [ - /(mitv-\w{5}) bui/i, // Xiaomi - ], - [MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]], - [ - /Hbbtv.*(technisat) (.*);/i, // TechniSAT - ], - [VENDOR, MODEL, [TYPE, SMARTTV]], - [ - /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, // Roku - /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i, // HbbTV devices - ], - [ - [VENDOR, trim], - [MODEL, trim], - [TYPE, SMARTTV], - ], - [ - /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i, // SmartTV from Unidentified Vendors - ], - [[TYPE, SMARTTV]], - [ - /////////////////// - // CONSOLES - /////////////////// - - /(ouya)/i, // Ouya - /(nintendo) ([wids3utch]+)/i, // Nintendo - ], - [VENDOR, MODEL, [TYPE, CONSOLE]], - [ - /droid.+; (shield) bui/i, // Nvidia - ], - [MODEL, [VENDOR, "Nvidia"], [TYPE, CONSOLE]], - [ - /(playstation [345portablevi]+)/i, // Playstation - ], - [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]], - [ - /\b(xbox(?: one)?(?!; xbox))[\); ]/i, // Microsoft Xbox - ], - [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]], - [ - /////////////////// - // WEARABLES - /////////////////// - - /((pebble))app/i, // Pebble - ], - [VENDOR, MODEL, [TYPE, WEARABLE]], - [ - /(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i, // Apple Watch - ], - [MODEL, [VENDOR, APPLE], [TYPE, WEARABLE]], - [ - /droid.+; (glass) \d/i, // Google Glass - ], - [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], - [/droid.+; (wt63?0{2,3})\)/i], - [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], - [ - /(quest( 2| pro)?)/i, // Oculus Quest - ], - [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], - [ - /////////////////// - // EMBEDDED - /////////////////// - - /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i, // Tesla - ], - [VENDOR, [TYPE, EMBEDDED]], - [ - /(aeobc)\b/i, // Echo Dot - ], - [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], - [ - //////////////////// - // MIXED (GENERIC) - /////////////////// - - /droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i, // Android Phones from Unidentified Vendors - ], - [MODEL, [TYPE, MOBILE]], - [ - /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i, // Android Tablets from Unidentified Vendors - ], - [MODEL, [TYPE, TABLET]], - [ - /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i, // Unidentifiable Tablet - ], - [[TYPE, TABLET]], - [ - /(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i, // Unidentifiable Mobile - ], - [[TYPE, MOBILE]], - [ - /(android[-\w\. ]{0,9});.+buil/i, // Generic Android Device - ], - [MODEL, [VENDOR, "Generic"]], - ], - - engine: [ - [ - /windows.+ edge\/([\w\.]+)/i, // EdgeHTML - ], - [VERSION, [NAME, EDGE + "HTML"]], - [ - /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i, // Blink - ], - [VERSION, [NAME, "Blink"]], - [ - /(presto)\/([\w\.]+)/i, // Presto - /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna - /ekioh(flow)\/([\w\.]+)/i, // Flow - /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links - /(icab)[\/ ]([23]\.[\d\.]+)/i, // iCab - /\b(libweb)/i, - ], - [NAME, VERSION], - [ - /rv\:([\w\.]{1,9})\b.+(gecko)/i, // Gecko - ], - [VERSION, NAME], - ], - - os: [ - [ - // Windows - /microsoft (windows) (vista|xp)/i, // Windows (iTunes) - ], - [NAME, VERSION], - [ - /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i, // Windows Phone - ], - [NAME, [VERSION, strMapper, windowsVersionMap]], - [ - /windows nt 6\.2; (arm)/i, // Windows RT - /windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i, - /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i, - ], - [ - [VERSION, strMapper, windowsVersionMap], - [NAME, "Windows"], - ], - [ - // iOS/macOS - /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS - /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i, - /cfnetwork\/.+darwin/i, - ], - [ - [VERSION, /_/g, "."], - [NAME, "iOS"], - ], - [ - /(mac os x) ?([\w\. ]*)/i, - /(macintosh|mac_powerpc\b)(?!.+haiku)/i, // Mac OS - ], - [ - [NAME, MAC_OS], - [VERSION, /_/g, "."], - ], - [ - // Mobile OSes - /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i, // Android-x86/HarmonyOS - ], - [VERSION, NAME], - [ - // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS - /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, - /(blackberry)\w*\/([\w\.]*)/i, // Blackberry - /(tizen|kaios)[\/ ]([\w\.]+)/i, // Tizen/KaiOS - /\((series40);/i, // Series 40 - ], - [NAME, VERSION], - [ - /\(bb(10);/i, // BlackBerry 10 - ], - [VERSION, [NAME, BLACKBERRY]], - [ - /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i, // Symbian - ], - [VERSION, [NAME, "Symbian"]], - [ - /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i, // Firefox OS - ], - [VERSION, [NAME, FIREFOX + " OS"]], - [ - /web0s;.+rt(tv)/i, - /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i, // WebOS - ], - [VERSION, [NAME, "webOS"]], - [ - /watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i, // watchOS - ], - [VERSION, [NAME, "watchOS"]], - [ - // Google Chromecast - /crkey\/([\d\.]+)/i, // Google Chromecast - ], - [VERSION, [NAME, CHROME + "cast"]], - [ - /(cros) [\w]+(?:\)| ([\w\.]+)\b)/i, // Chromium OS - ], - [[NAME, CHROMIUM_OS], VERSION], - [ - // Smart TVs - /panasonic;(viera)/i, // Panasonic Viera - /(netrange)mmh/i, // Netrange - /(nettv)\/(\d+\.[\w\.]+)/i, // NetTV - - // Console - /(nintendo|playstation) ([wids345portablevuch]+)/i, // Nintendo/Playstation - /(xbox); +xbox ([^\);]+)/i, // Microsoft Xbox (360, One, X, S, Series X, Series S) - - // Other - /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, // Joli/Palm - /(mint)[\/\(\) ]?(\w*)/i, // Mint - /(mageia|vectorlinux)[; ]/i, // Mageia/VectorLinux - /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, - // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire - /(hurd|linux) ?([\w\.]*)/i, // Hurd/Linux - /(gnu) ?([\w\.]*)/i, // GNU - /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly - /(haiku) (\w+)/i, // Haiku - ], - [NAME, VERSION], - [ - /(sunos) ?([\w\.\d]*)/i, // Solaris - ], - [[NAME, "Solaris"], VERSION], - [ - /((?:open)?solaris)[-\/ ]?([\w\.]*)/i, // Solaris - /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, // AIX - /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS - /(unix) ?([\w\.]*)/i, // UNIX - ], - [NAME, VERSION], - ], - }; - - ///////////////// - // Constructor - //////////////// - - var UAParser = function (ua, extensions) { - if (typeof ua === OBJ_TYPE) { - extensions = ua; - ua = undefined; - } - - if (!(this instanceof UAParser)) { - return new UAParser(ua, extensions).getResult(); - } - - var _navigator = - typeof window !== UNDEF_TYPE && window.navigator - ? window.navigator - : undefined; - var _ua = - ua || - (_navigator && _navigator.userAgent ? _navigator.userAgent : EMPTY); - var _uach = - _navigator && _navigator.userAgentData - ? _navigator.userAgentData - : undefined; - var _rgxmap = extensions ? extend(regexes, extensions) : regexes; - var _isSelfNav = _navigator && _navigator.userAgent == _ua; - - this.getBrowser = function () { - var _browser = {}; - _browser[NAME] = undefined; - _browser[VERSION] = undefined; - rgxMapper.call(_browser, _ua, _rgxmap.browser); - _browser[MAJOR] = majorize(_browser[VERSION]); - // Brave-specific detection - if ( - _isSelfNav && - _navigator && - _navigator.brave && - typeof _navigator.brave.isBrave == FUNC_TYPE - ) { - _browser[NAME] = "Brave"; - } - return _browser; - }; - this.getCPU = function () { - var _cpu = {}; - _cpu[ARCHITECTURE] = undefined; - rgxMapper.call(_cpu, _ua, _rgxmap.cpu); - return _cpu; - }; - this.getDevice = function () { - var _device = {}; - _device[VENDOR] = undefined; - _device[MODEL] = undefined; - _device[TYPE] = undefined; - rgxMapper.call(_device, _ua, _rgxmap.device); - if (_isSelfNav && !_device[TYPE] && _uach && _uach.mobile) { - _device[TYPE] = MOBILE; - } - // iPadOS-specific detection: identified as Mac, but has some iOS-only properties - if ( - _isSelfNav && - _device[MODEL] == "Macintosh" && - _navigator && - typeof _navigator.standalone !== UNDEF_TYPE && - _navigator.maxTouchPoints && - _navigator.maxTouchPoints > 2 - ) { - _device[MODEL] = "iPad"; - _device[TYPE] = TABLET; - } - return _device; - }; - this.getEngine = function () { - var _engine = {}; - _engine[NAME] = undefined; - _engine[VERSION] = undefined; - rgxMapper.call(_engine, _ua, _rgxmap.engine); - return _engine; - }; - this.getOS = function () { - var _os = {}; - _os[NAME] = undefined; - _os[VERSION] = undefined; - rgxMapper.call(_os, _ua, _rgxmap.os); - if ( - _isSelfNav && - !_os[NAME] && - _uach && - _uach.platform != "Unknown" - ) { - _os[NAME] = _uach.platform - .replace(/chrome os/i, CHROMIUM_OS) - .replace(/macos/i, MAC_OS); // backward compatibility - } - return _os; - }; - this.getResult = function () { - return { - ua: this.getUA(), - browser: this.getBrowser(), - engine: this.getEngine(), - os: this.getOS(), - device: this.getDevice(), - cpu: this.getCPU(), - }; - }; - this.getUA = function () { - return _ua; - }; - this.setUA = function (ua) { - _ua = - typeof ua === STR_TYPE && ua.length > UA_MAX_LENGTH - ? trim(ua, UA_MAX_LENGTH) - : ua; - return this; - }; - this.setUA(_ua); - return this; - }; - - UAParser.VERSION = LIBVERSION; - UAParser.BROWSER = enumerize([NAME, VERSION, MAJOR]); - UAParser.CPU = enumerize([ARCHITECTURE]); - UAParser.DEVICE = enumerize([ - MODEL, - VENDOR, - TYPE, - CONSOLE, - MOBILE, - SMARTTV, - TABLET, - WEARABLE, - EMBEDDED, - ]); - UAParser.ENGINE = UAParser.OS = enumerize([NAME, VERSION]); - - /////////// - // Export - ////////// - - // check js environment - if (typeof exports !== UNDEF_TYPE) { - // nodejs env - if ("object" !== UNDEF_TYPE && module.exports) { - exports = module.exports = UAParser; - } - exports.UAParser = UAParser; - } else { - // requirejs env (optional) - if ("function" === FUNC_TYPE && __webpack_require__.amdO) { - !((__WEBPACK_AMD_DEFINE_RESULT__ = function () { - return UAParser; - }.call(exports, __webpack_require__, exports, module)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof window !== UNDEF_TYPE) { - // browser env - window.UAParser = UAParser; - } - } - - // jQuery/Zepto specific (optional) - // Note: - // In AMD env the global scope should be kept clean, but jQuery is an exception. - // jQuery always exports to global scope, unless jQuery.noConflict(true) is used, - // and we should catch that. - var $ = typeof window !== UNDEF_TYPE && (window.jQuery || window.Zepto); - if ($ && !$.ua) { - var parser = new UAParser(); - $.ua = parser.getResult(); - $.ua.get = function () { - return parser.getUA(); - }; - $.ua.set = function (ua) { - parser.setUA(ua); - var result = parser.getResult(); - for (var prop in result) { - $.ua[prop] = result[prop]; - } - }; - } - })(typeof window === "object" ? window : this); - - /***/ - }, +/* + Passing messages from popup to background script +*/ - /******/ - }; - /************************************************************************/ - /******/ // The module cache - /******/ var __webpack_module_cache__ = {}; - /******/ - /******/ // The require function - /******/ function __webpack_require__(moduleId) { - /******/ // Check if module is in cache - /******/ var cachedModule = __webpack_module_cache__[moduleId]; - /******/ if (cachedModule !== undefined) { - /******/ return cachedModule.exports; - /******/ - } - /******/ // Create a new module (and put it into the cache) - /******/ var module = (__webpack_module_cache__[moduleId] = { - /******/ // no module.id needed - /******/ // no module.loaded needed - /******/ exports: {}, - /******/ - }); - /******/ - /******/ // Execute the module function - /******/ __webpack_modules__[moduleId].call( - module.exports, - module, - module.exports, - __webpack_require__ - ); - /******/ - /******/ // Return the exports of the module - /******/ return module.exports; - /******/ +window.addEventListener("message", (event) => { + if (port && event.source === window && event.data) { + port.postMessage({ data: event.data }); } - /******/ - /************************************************************************/ - /******/ /* webpack/runtime/amd options */ - /******/ (() => { - /******/ __webpack_require__.amdO = {}; - /******/ - })(); - /******/ - /******/ /* webpack/runtime/compat get default export */ - /******/ (() => { - /******/ // getDefaultExport function for compatibility with non-harmony modules - /******/ __webpack_require__.n = (module) => { - /******/ var getter = - module && module.__esModule - ? /******/ () => module["default"] - : /******/ () => module; - /******/ __webpack_require__.d(getter, { a: getter }); - /******/ return getter; - /******/ - }; - /******/ - })(); - /******/ - /******/ /* webpack/runtime/define property getters */ - /******/ (() => { - /******/ // define getter functions for harmony exports - /******/ __webpack_require__.d = (exports, definition) => { - /******/ for (var key in definition) { - /******/ if ( - __webpack_require__.o(definition, key) && - !__webpack_require__.o(exports, key) - ) { - /******/ Object.defineProperty(exports, key, { - enumerable: true, - get: definition[key], - }); - /******/ - } - /******/ - } - /******/ - }; - /******/ - })(); - /******/ - /******/ /* webpack/runtime/global */ - /******/ (() => { - /******/ __webpack_require__.g = (function () { - /******/ if (typeof globalThis === "object") return globalThis; - /******/ try { - /******/ return this || new Function("return this")(); - /******/ - } catch (e) { - /******/ if (typeof window === "object") return window; - /******/ - } - /******/ - })(); - /******/ - })(); - /******/ - /******/ /* webpack/runtime/hasOwnProperty shorthand */ - /******/ (() => { - /******/ __webpack_require__.o = (obj, prop) => - Object.prototype.hasOwnProperty.call(obj, prop); - /******/ - })(); - /******/ - /******/ /* webpack/runtime/make namespace object */ - /******/ (() => { - /******/ // define __esModule on exports - /******/ __webpack_require__.r = (exports) => { - /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { - /******/ Object.defineProperty(exports, Symbol.toStringTag, { - value: "Module", - }); - /******/ - } - /******/ Object.defineProperty(exports, "__esModule", { value: true }); - /******/ - }; - /******/ - })(); - /******/ - /************************************************************************/ - var __webpack_exports__ = {}; - // This entry need to be wrapped in an IIFE because it need to be in strict mode. - (() => { - "use strict"; - /* harmony import */ var _trezor_connect_web_lib_channels_window_serviceworker__WEBPACK_IMPORTED_MODULE_0__ = - __webpack_require__(312); - - /** - * communication between service worker and both webextension and popup manager - */ - const channel = - new _trezor_connect_web_lib_channels_window_serviceworker__WEBPACK_IMPORTED_MODULE_0__ /* .WindowServiceWorkerChannel */.E( - { - name: "trezor-connect", - channel: { - here: "@trezor/connect-content-script", - peer: "@trezor/connect-webextension", - }, - } - ); - channel.init().then(() => { - // once script is loaded. send information about the webextension that injected it into the popup - window.postMessage( - { - type: "popup-content-script-loaded", - payload: { - ...chrome.runtime.getManifest(), - id: chrome.runtime.id, - }, - }, - window.location.origin - ); - - /** - * Passing messages from service worker to popup - */ - channel.on("message", (message) => { - window.postMessage(message, window.location.origin); - }); - - /* - * Passing messages from popup to service worker - */ - window.addEventListener("message", (event) => { - if ( - event.data?.channel?.here === "@trezor/connect-webextension" || - event.data?.type === "popup-content-script-loaded" - ) { - return; - } - if (event.source === window && event.data) { - channel.postMessage(event.data, { - usePromise: false, - }); - } - }); - window.addEventListener("beforeunload", () => { - window.postMessage( - { - type: "popup-closed", - }, - window.location.origin - ); - }); - }); - })(); - - /******/ -})(); +}); From 4d830f4c2744b93afbd5d285bc2177189e220337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0ulovsk=C3=BD?= Date: Fri, 5 Apr 2024 13:33:24 +0800 Subject: [PATCH 6/6] Add explanation and temporary fix for TrezorConnect bug --- .../transports/ToSecureUITransportSender.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/secure-background/src/transports/ToSecureUITransportSender.ts b/packages/secure-background/src/transports/ToSecureUITransportSender.ts index 82ced93da..74b90cba9 100644 --- a/packages/secure-background/src/transports/ToSecureUITransportSender.ts +++ b/packages/secure-background/src/transports/ToSecureUITransportSender.ts @@ -279,6 +279,8 @@ export class ToSecureUITransportSender< // Focus window to bring it to front. // Since port comes from onConnect, tab/window information is available. + // FIXME: This is the source of the bug causing TrezorConnect ot fail. + // Since the *popup* opens the TrezorConnect popup, there is no way to focus back on the window if (this.port.sender?.tab?.windowId) { globalThis.chrome?.windows .update(this.port.sender?.tab?.windowId, { @@ -288,6 +290,22 @@ export class ToSecureUITransportSender< console.log("[DEBUG] ToSecureUITransportSender: err 6"); logger.error("window.update", e); }); + } else { + // This fixes the bug, but it's not an ideal solution + console.log( + "[DEBUG] ToSecureUITransportSender: Can't find windowId to focus." + ); + //chrome.windows.update(chrome.windows.WINDOW_ID_CURRENT, { focused: true }) + chrome.windows.getCurrent().then((window) => { + console.log( + "[DEBUG] ToSecureUITransportSender: current window", + window + ); + openPopupWindow(this.port!.sender!.url!).catch((e) => { + console.log("[DEBUG] ToSecureUITransportSender: err 7"); + logger.error("openPopup", e); + }); + }); } };