blazor-wallet-connect

Connect browser wallets to Blazor apps using EIP-6963, MetaMask, or WalletConnect.

2.3k|744|Updated Nov 23, 2015
One-click install
npx skills add https://github.com/Nethereum/Nethereum --skill blazor-wallet-connect
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: blazor-wallet-connect
Source: https://github.com/Nethereum/Nethereum/tree/main/plugins/nethereum-skills/skills/blazor-wallet-connect
Command: npx skills add https://github.com/Nethereum/Nethereum --skill blazor-wallet-connect

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Integrating Ethereum browser wallets into Blazor applications requires handling JavaScript interop, wallet discovery, and account state management. This Skill provides ready-to-use patterns for connecting wallets in Blazor using EIP-6963 multi-wallet discovery, MetaMask, or WalletConnect/Reown AppKit.

Core Features & Use Cases

  • EIP-6963 Multi-Wallet Discovery: Detect all installed browser wallets and let users choose which one to connect via the Nethereum.Blazor package.
  • MetaMask Direct Integration: Connect MetaMask specifically using Nethereum.Metamask.Blazor with account change event handling.
  • WalletConnect/Reown AppKit: Support mobile and desktop wallets through the Reown AppKit button components.
  • Use Case: Build a Blazor WebAssembly dApp where users connect any browser wallet, view their ETH balance, switch chains to Optimism, and authenticate via Blazor's AuthorizeView.

Quick Start

Add the EIP-6963 wallet connection component to my Blazor app so users can connect any installed browser wallet and see their account balance.

Frequently Asked Questions about blazor-wallet-connect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect a wallet in a Blazor app?

Use the EIP6963Wallet component from Nethereum.Blazor after registering IEthereumHostProvider with EIP6963HostProvider. Add the NethereumEIP6963.js script to your index.html, then handle the OnWalletConnected callback to get the user's address and Web3 instance.

What is EIP-6963 wallet discovery in Ethereum dApps?

EIP-6963 is a standard that lets dApps discover all installed browser wallets instead of relying on window.ethereum, which only exposes one provider. Users see a list of their wallets and choose which one to connect.

MetaMask vs WalletConnect for Blazor dApp integration?

MetaMask direct integration via Nethereum.Metamask.Blazor targets only the MetaMask extension. WalletConnect through Nethereum.Reown.AppKit.Blazor supports many mobile and desktop wallets but requires a project ID from cloud.reown.com.

Does Nethereum Blazor wallet connection work with WebAssembly?

Yes, the wallet providers work in Blazor WebAssembly through JavaScript interop. The repository includes a full example at consoletests/MetamaskExampleBlazor.Wasm demonstrating MetaMask connection in a WASM app.

How do I switch Ethereum chains in a Blazor wallet app?

Call web3.Eth.HostWallet.SwitchEthereumChain with the target chain ID as a hex BigInteger. If the chain is not added to the wallet, use AddEthereumChain with parameters built from ChainDefaultFeaturesServicesRepository.

Why is my Blazor wallet connection not detecting installed wallets?

EIP-6963 discovery requires the NethereumEIP6963.js script loaded in index.html or _Host.cshtml before the app starts. Also verify EIP6963HostProvider is registered as the IEthereumHostProvider implementation in Program.cs.