@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
45 lines (42 loc) • 1.42 kB
JavaScript
import { InjectedConnector } from '../../injected/dist/thirdweb-dev-wallets-evm-connectors-injected.browser.esm.js';
import { a as assertWindowEthereum } from '../../../../dist/assertWindowEthereum-88295886.browser.esm.js';
import '../../../../dist/defineProperty-350fc508.browser.esm.js';
import '../../../../dist/WagmiConnector-2f14002d.browser.esm.js';
import '@thirdweb-dev/chains';
import 'eventemitter3';
import '../../../../dist/errors-9edc08c8.browser.esm.js';
import '../../../../dist/url-a45219bd.browser.esm.js';
import 'ethers';
import '../../../../dist/normalizeChainId-1fb9aedf.browser.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 (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 };