UNPKG

@web3-wallet/metamask

Version:
33 lines (32 loc) 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MetaMask = void 0; const core_1 = require("@web3-wallet/core"); const assets_1 = require("./assets"); const providerFilter = (p) => !!p.isMetaMask; const _walletName = 'MetaMask'; const walletName = _walletName; class MetaMask extends core_1.Connector { /** {@inheritdoc Connector.constructor} */ constructor(options) { super({ providerFilter, ...options, }); this.walletName = walletName; } /** * {@inheritdoc Connector.constructor} * * Certain versions of MetaMask incorrectly emit the "disconnect" event when chain is changed. * need to override the default "onDisconnect" method, so that we don't reset the connector * store state. * * @see: https://github.com/MetaMask/metamask-extension/issues/13375#issuecomment-1027663334 * */ onDisconnect(_) { } } exports.MetaMask = MetaMask; MetaMask.walletName = walletName; MetaMask.walletIcon = assets_1.icon;