@thirdweb-dev/wallets
Version:
<p align="center"> <br /> <a href="https://thirdweb.com"><img src="https://github.com/thirdweb-dev/js/blob/main/packages/sdk/logo.svg?raw=true" width="200" alt=""/></a> <br /> </p> <h1 align="center">thirdweb Wallet SDK</h1> <p align="center"> <a href="ht
53 lines (48 loc) • 1.79 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var evm_connectors_injected_dist_thirdwebDevWalletsEvmConnectorsInjected = require('../../injected/dist/thirdweb-dev-wallets-evm-connectors-injected.cjs.prod.js');
var assertWindowEthereum = require('../../../../dist/assertWindowEthereum-1a9cc710.cjs.prod.js');
require('../../../../dist/defineProperty-6ca2d9a5.cjs.prod.js');
require('../../../../dist/classPrivateFieldSet-4a4973f9.cjs.prod.js');
require('../../../../dist/url-f55506f3.cjs.prod.js');
require('@thirdweb-dev/chains');
require('ethers');
require('../../../../dist/WagmiConnector-17577fd3.cjs.prod.js');
require('eventemitter3');
require('../../../../dist/normalizeChainId-a44d9dec.cjs.prod.js');
require('../../../../dist/errors-9cece35a.cjs.prod.js');
class TrustConnector extends evm_connectors_injected_dist_thirdwebDevWalletsEvmConnectorsInjected.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.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
});
}
}
exports.TrustConnector = TrustConnector;