Skip to content

MetamaskConnector

The Metamask connector has a distinct implementation compared to native wallets, making it a derivative of the EvmConnector and based on the WagmiConnectionStrategy.

Behind the scenes, it uses the metaMask connector from the wagmi.sh library, leveraging it to handle interactions with the browser extension and its states.

Instance

You can easily access the connector instance by using:

tsx
import { MetamaskConnector } from '@buidlerlabs/hashgraph-react-wallets/connectors'
import { useWallet } from '@buidlerlabs/hashgraph-react-wallets'

const App = () => {
  const { connector } = useWallet(MetamaskConnector) 

  return ...
}

Extras

It also includes a set of pre-defined icons for both white/dark theme:

ts
this._config = {
  icons: {
    white: MetamaskIconWhite,
    dark: MetamaskIconDark,
    ...props.config?.icons,
  },
  ...props.config,
}