Skip to main content

Overview

WAGMI is a development library that streamlines Ethereum development. Popular among developers for its ease in managing multiple wallets, it becomes even more powerful when combined with Magic. This integration streamlines user interactions across various wallets while leveraging Magic’s blazing-fast and secure passwordless login. This guide details the integration process using Magic’s DedicatedWalletConnector. For an immediate hands-on experience, explore our demo on GitHub.

Installation

Add wagmi and @magiclabs/wagmi-connector using your chosen package manager.

Initialization

To initialize, import the necessary dependencies from Magic and WAGMI in your root file (i.e. App.tsx). ⁠⁠Next, add the Magic DedicatedWalletConnector and its configuration as the connectors value of the config. Finally, pass the configuration to the WagmiConfig component to make WAGMI hooks available across the whole application.
JavaScript

Usage

With the Magic connector added, you can use WAGMI hooks for everything else per their documentation.

Connect to the network

JavaScript

Sign message

JavaScript

Send transaction

JavaScript

Check balance

JavaScript

Resources