mipd (Multi Injected Provider Discovery) is a TypeScript utility library from the wevm (formerly wagmi-dev) ecosystem, designed to facilitate the discovery and management of EIP-6963 compliant Ethereum wallet providers within dapps. EIP-6963 standardizes how multiple injected wallets announce themselves via custom DOM events, moving beyond the single `window.ethereum` paradigm. Currently at version 0.0.7, mipd offers a reactive store (`createStore`) that accumulates announced `EIP6963ProviderDetail` objects and allows dapps to subscribe to updates or retrieve the current list of providers. It includes essential TypeScript types such as `EIP6963ProviderDetail` and `EIP6963AnnounceProviderEvent`, and also provides a `/window` polyfill for enhanced type inference on global event listeners. Its release cadence is likely tied to updates within the broader wevm stack and EIP-6963 evolution. mipd is a foundational component for building robust multi-wallet dapps, complementing libraries like wagmi and viem by abstracting EIP-6963 complexities.
npm install mipdVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to initialize the EIP-6963 store, subscribe to provider announcements, retrieve current providers, and includes a conceptual React example using `useSyncExternalStore`.
Refer to the `mipd` GitHub repository for changelogs and migration guides for each new release. Pin exact versions (`"mipd": "0.0.7"`) to avoid unexpected updates.
Add `import 'mipd/window';` at the top-level of your application's entry file (e.g., `main.ts` or `App.tsx`) to globally augment the `Window` interface with the necessary EIP-6963 event types.
Prefer `import` statements for `mipd`. If working in a CJS-only environment, ensure your bundler (e.g., Webpack, Rollup) is configured to correctly handle ESM imports, or explicitly target the CJS bundle if available (e.g., `require('mipd/dist/cjs/index.js')`).Ensure your project explicitly installs a `typescript` version compatible with `mipd` (e.g., `npm install typescript@^5.0.4`). If using a lower version, you might encounter type-related issues.
Add `import 'mipd/window';` to your application's entry file to ensure TypeScript recognizes the `EIP6963AnnounceProviderEvent` type for `CustomEvent` dispatched on `window`.
For projects that need to use CommonJS `require`, ensure your build tool correctly handles ESM imports from `node_modules`. Alternatively, if applicable, consider migrating to ESM or using dynamic `import('mipd')` within an `async` context.Verify that your project's `typescript` version meets the `mipd` peer dependency (`>=5.0.4`). Ensure `EIP6963ProviderDetail` is imported as a type (`import type { EIP6963ProviderDetail } from 'mipd';`). Review the `mipd` source or documentation for the exact `Listener` type signature.