UNPKG

@thirdweb-dev/wallets

Version:

<p align="center"> <br /> <a href="https://thirdweb.com"><img src="https://github.com/thirdweb-dev/js/blob/main/legacy_packages/sdk/logo.svg?raw=true" width="200" alt=""/></a> <br /> </p> <h1 align="center">thirdweb Wallet SDK</h1> <p align="center"> <a h

48 lines (45 loc) 1.44 kB
import { InjectedConnector } from '../../injected/dist/thirdweb-dev-wallets-evm-connectors-injected.esm.js'; import { a as assertWindowEthereum } from '../../../../dist/assertWindowEthereum-2bcf9787.esm.js'; import '../../../../dist/defineProperty-7303a112.esm.js'; import '../../../../dist/WagmiConnector-6011bbb1.esm.js'; import '@thirdweb-dev/chains'; import 'eventemitter3'; import '../../../../dist/errors-35fc3528.esm.js'; import '../../../../dist/url-0d129c6b.esm.js'; import 'ethers'; import '../../../../dist/normalizeChainId-abcb61d5.esm.js'; class TrustConnector extends InjectedConnector { constructor(arg) { const defaultOptions = { name: "Trust", getProvider() { function getReady(ethereum) { const isTrust = !!ethereum?.isTrust; if (!isTrust) { return; } return ethereum; } if (typeof window === "undefined") { return; } if (assertWindowEthereum(globalThis.window)) { if (globalThis.window.ethereum?.providers) { return globalThis.window.ethereum.providers.find(getReady); } return getReady(globalThis.window.ethereum); } } }; const options = { ...defaultOptions, ...arg.options }; super({ chains: arg.chains, options, connectorStorage: arg.connectorStorage }); } } export { TrustConnector };