@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
52 lines (47 loc) • 1.72 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var evm_connectors_injected_dist_thirdwebDevWalletsEvmConnectorsInjected = require('../../injected/dist/thirdweb-dev-wallets-evm-connectors-injected.cjs.dev.js');
var assertWindowEthereum = require('../../../../dist/assertWindowEthereum-0709ee9e.cjs.dev.js');
require('../../../../dist/defineProperty-9051a5d3.cjs.dev.js');
require('../../../../dist/WagmiConnector-6ff7d562.cjs.dev.js');
require('@thirdweb-dev/chains');
require('eventemitter3');
require('../../../../dist/errors-a8e8ea7b.cjs.dev.js');
require('../../../../dist/url-4b641c31.cjs.dev.js');
require('ethers');
require('../../../../dist/normalizeChainId-5da85f42.cjs.dev.js');
class ImTokenConnector extends evm_connectors_injected_dist_thirdwebDevWalletsEvmConnectorsInjected.InjectedConnector {
constructor(arg) {
const defaultOptions = {
name: "imToken",
getProvider() {
function getReady(ethereum) {
const isImToken = !!ethereum?.isImToken;
if (!isImToken) {
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.ImTokenConnector = ImTokenConnector;