# Injected EVM (/connectors/injected-evm)



`@usebutr/evm` discovers browser EVM wallets (MetaMask, Rabby, Brave, Coinbase, …)
through [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) — the standard where
wallets announce themselves via window events instead of fighting over
`window.ethereum`.

## Discovery [#discovery]

`autoDiscovery()` from `@usebutr/wallets` handles EVM discovery automatically.
For an EVM-only setup, wire it directly with `createWalletSource`:

```ts
import { createWalletSource } from "@usebutr/core";
import { discoverEvmAdapters } from "@usebutr/evm";
import { WalletManagerProvider } from "@usebutr/react";

const discovery = createWalletSource(discoverEvmAdapters);

<WalletManagerProvider discovery={discovery}>
  {children}
</WalletManagerProvider>
```

## Injected fallback [#injected-fallback]

Some regional / legacy wallets only expose a raw EIP-1193 `window.ethereum` and
never announce via EIP-6963. `discoverInjectedAdapter` is the last-resort
fallback for them. When using `autoDiscovery()` the `injected` flag is
controlled by `DiscoverOptions` and defaults to `true` whenever `evm` is enabled.

```ts
import { discoverInjectedAdapter, GENERIC_INJECTED_ICON } from "@usebutr/evm";
```

## Capabilities [#capabilities]

Derived from the wallet's EIP-6963 provider info / RPC inspection. Typically
all of `getBalance`, `sendTransaction`, `signMessage`, `subscribe`,
`switchChain` are `true`; `requestAccounts` is `true` for wallets that honour
`wallet_requestPermissions`. Always branch on
[`wallet.connector.capabilities`](/concepts/capabilities) rather than
assuming.

## Chain switching [#chain-switching]

EVM connectors switch chains for real via `wallet_switchEthereumChain`. Use
`EVM_CHAINS_LIST` (or `CHAINS_BY_PLATFORM.evm` from `@usebutr/wallets`) for the
chain list — see [multi-chain](/guides/multi-chain).

## Helpers [#helpers]

`@usebutr/evm` also exports byte/hex utilities used by adapters and handy in app
code: `bytesToHex`, `hexToBytes`, `chainIdHexToDecimal`,
`chainIdDecimalToHex`, `formatEther`.

<Callout type="info">
  **Source:** `packages/evm/src`. Used by `apps/demo-next`, `apps/demo-tanstack-start`, and (via
  `@usebutr/wallets`) `apps/demo-vite`.
</Callout>
