All Projects → michielpost → MetaMask.Blazor

michielpost / MetaMask.Blazor

Licence: MIT license
Use MetaMask with Blazor WebAssembly

Programming Languages

C#
18002 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to MetaMask.Blazor

smart-blazor
Blazor UI Components & Examples
Stars: ✭ 32 (+23.08%)
Mutual labels:  blazor, blazor-webassembly
Blazor.PersianDatePicker
A free JavaScript Jalali (Persian) and Gregorian (Miladi) dual datepicker library for Blazor applications
Stars: ✭ 40 (+53.85%)
Mutual labels:  blazor, blazor-webassembly
AsteroidsWasm
Collection of applications based on a single C# .NET Standard project running in: Blazor Client (WebAssembly), Blazor Server, Electron, WPF, WinForms, Xamarin
Stars: ✭ 136 (+423.08%)
Mutual labels:  blazor, blazor-webassembly
ASPCore.BlazorCrud
CRUD Using Blazor And Entity Framework Core
Stars: ✭ 39 (+50%)
Mutual labels:  blazor, blazor-webassembly
TheLastTime
C# .NET 5 Blazor WebAssembly Progressive Web Application that tracks when was the last time you did something
Stars: ✭ 23 (-11.54%)
Mutual labels:  blazor, blazor-webassembly
blazor-tailwindcss-template
This template demostrates the integration of tailwindcss with blazor and covers important features like hot-reload and css isolation
Stars: ✭ 38 (+46.15%)
Mutual labels:  blazor, blazor-webassembly
MudBlazor
Blazor Component Library based on Material design with an emphasis on ease of use. Mainly written in C# with Javascript kept to a bare minimum it empowers .NET developers to easily debug it if needed.
Stars: ✭ 4,539 (+17357.69%)
Mutual labels:  blazor, blazor-webassembly
MudBlazor.Markdown
Markdown component based on the MudBlazor environment
Stars: ✭ 30 (+15.38%)
Mutual labels:  blazor, blazor-webassembly
MusicX
Simple web music player built with Blazor WebAssembly
Stars: ✭ 138 (+430.77%)
Mutual labels:  blazor, blazor-webassembly
FindRazorSourceFile
This is a set of NuGet packages that makes your Blazor apps display the source .razor file name that generated the HTML element under the mouse cursor when entering the Ctrl + Shift + F hotkeys.
Stars: ✭ 39 (+50%)
Mutual labels:  blazor, blazor-webassembly
blazor-ui
A collection of examples related to Telerik UI for Blazor Components: https://www.telerik.com/blazor-ui
Stars: ✭ 182 (+600%)
Mutual labels:  blazor, blazor-webassembly
Blazorade-Teams
A Blazor component library that is designed to be used when building applications for Microsoft Teams.
Stars: ✭ 29 (+11.54%)
Mutual labels:  blazor, blazor-webassembly
BlazorWasmWithDocker
Companion code sample for my blog post - Containerising a Blazor WebAssembly App
Stars: ✭ 16 (-38.46%)
Mutual labels:  blazor, blazor-webassembly
Ant Design Blazor
🌈A set of enterprise-class UI components based on Ant Design and Blazor WebAssembly.
Stars: ✭ 3,890 (+14861.54%)
Mutual labels:  blazor, blazor-webassembly
SyncfusionHelpDeskClient
Syncfusion Help Desk WebAssembly
Stars: ✭ 15 (-42.31%)
Mutual labels:  blazor, blazor-webassembly
blazorators
This project converts TypeScript type declarations into C# representations, and use C# source generators to expose automatic JavaScript interop functionality.
Stars: ✭ 225 (+765.38%)
Mutual labels:  blazor, blazor-webassembly
AutoSaveEditForm
A replacement for the default EditForm component which will auto save a form until it is successfully submitted
Stars: ✭ 44 (+69.23%)
Mutual labels:  blazor, blazor-webassembly
Blazor.BrowserExtension
A package for building Browser Extension with Blazor WebAssembly application.
Stars: ✭ 207 (+696.15%)
Mutual labels:  blazor, blazor-webassembly
BlazorPoint
Blazor (Client Side) on SharePoint
Stars: ✭ 40 (+53.85%)
Mutual labels:  blazor, blazor-webassembly
awesome-blazor-browser
A Blazor WebAssembly app for browsing the "Awesome Blazor" resources.
Stars: ✭ 155 (+496.15%)
Mutual labels:  blazor, blazor-webassembly

MetaMask.Blazor

Use MetaMask with Blazor WebAssembly

This library provides an easy helper to use MetaMask with Blazor WebAssembly.

Live Demo

Real world implementation, login with MetaMask: SkyDocs

How to use

See included Blazor sample app.

Install: MetaMask.Blazor on NuGet

Register in Program.cs:

builder.Services.AddMetaMaskBlazor();

Inject the MetaMaskService in your Razor page

@using MetaMask.Blazor
@inject MetaMaskService MetaMaskService

or class when using a .razor.cs file:

[Inject]
public MetaMaskService MetaMaskService { get; set; } = default!;

Use the MetaMaskService:

Check if the user has MetaMask installed:

bool hasMetaMask = await MetaMaskService.HasMetaMask();

Check if the user has previously connected to your site.

bool isSiteConnected = await MetaMaskService.IsSiteConnected();

Initialize a new connection with MetaMask

await MetaMaskService.ConnectMetaMask();

This can throw exceptions if the user decides to not allow the connection.

Once there is a connection, you can use other method calls like:

  • GetSelectedAddress
  • GetTransactionCount
  • SignTypedData
  • SendTransaction
  • or use the generic RPC method: GenericRpc

Events

Listen to events:
await MetaMaskService.ListenToEvents();

You can subscribe to two events:

  • MetaMaskService.AccountChangedEvent
  • MetaMaskService.NetworkChangedEvent

Reference

Acknowledgements

Development of MetaMask.Blazor has been made possible with a grant from The Graph.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].