enables communication between command-line or desktop applications and browser-based Ethereum wallets such as Metamask.

Overview

@securerpc/walletbus

@securerpc/walletbus

pipeline turborepo - maintained with

Abstract

@securerpc/local-provider enables communication between command-line or desktop applications and browser-based Ethereum wallets such as Metamask.

One important use case is that it allows you to use your Metamask wallet with smart contract development tools such as Foundry or Hardhat.

Quickstart

To build the monorepo (>1m)

./exec.sh

To test transactions on Rinkeby Test Network (ChainId=4)

./run.sh

Installation

npm install @securerpc/local-provider
yarn add @securerpc/local-provider

Usage

The dashboard-provider can be used in place where you would use any other web3 provider. See the examples below for using it with Ethers.js and Web3.js.

Ethers.js

const { DashboardProvider } = require('@securerpc/local-provider');
const { providers } = require('ethers');

const dashboardProvider = new DashboardProvider();
const ethersProvider = new providers.Web3Provider(dashboardProvider);

const [account] = await ethersProvider.listAccounts();

Web3.js

const { DashboardProvider } = require('@securerpc/local-provider');
const Web3 = require('web3');

const dashboardProvider = new DashboardProvider();
const web3 = new Web3(dashboardProvider);

const [account] = await web3.eth.getAccounts();

Configuration options

The DashboardProvider constructor takes a config object with a number of options.

export interface DashboardProviderOptions {
  /** Host of the Dashboard (default: localhost) */
  dashboardHost?: string;

  /** Port of the Dashboard (default: 24012) */
  dashboardPort?: number;

  /** Number of seconds before a dashboard-provider request times out (default: 120) */
  timeoutSeconds?: number;

  /** Boolean indicating whether the connection to the dashboard is kept alive between requests (default: false) */
  keepAlive?: boolean;

  /** Boolean indicating whether debug output should be logged (default: false) */
  verbose?: boolean;

  /** Boolean indicating whether the dashboard should automatically get opened in the default browser (default: true) */
  autoOpen?: boolean;
}

Logging

When setting the dashboard-provider's verbose option to true, debug output is logged in the following "debug" namespaces

  • msgbus:connections - logs connections and disconnections of message bus publishers and subscribers
  • msgbus:requests - logs requests that get sent from publishers to subscribers
  • msgbus:responses - logs responses sent back from subscribers to publishers
  • msgbus:errors - logs errors that occur in the message bus

Development

The entire dashboard/local-provider stack consists of three separate packages:

  • @securerpc/local-provider contains the actual Provider interface that forwards requests to the dashboard.

  • @securerpc/dashboard package contains a React app that receives incoming requests, displays them to the user, and then forwards them to the browser's injected web3 wallet.

  • @securerpc/msgbus ties the two packages together with a message bus that relays requests and responses between the local-provider and the dashboard, using multiple WebSocket connections.

Automated testing

test/ contains a few very simple tests that test basic functioning of the DashboardProvider + Message Bus + Dashboard infrastructure. It uses a mocked "dashboard" that rather than opening a browser window just forwards all requests to Ganache.

License

MIT Licensed

Forked from Truffle/Dashboard

You might also like...

Desktop App for mdSilo: Tiny Knowledge silo on your desktop.

mdSilo A mind silo for storing ideas, thought, knowledge with a powerful writing tool. built with React and Tauri. Demo Discord This is desktop app, a

Dec 27, 2022

Webview is a tiny cross-platform library to make web-based GUIs for desktop applications.

Webview is a tiny cross-platform library to make web-based GUIs for desktop applications.

webview_deno deno bindings for webview Webview is a tiny cross-platform library to make web-based GUIs for desktop applications. ⚠️ This project is st

Jan 2, 2023

Inter Process Communication Module for node supporting Unix sockets, TCP, TLS, and UDP. Giving lightning speed on Linux, Mac, and Windows. Neural Networking in Node.JS

Inter Process Communication Module for node supporting Unix sockets, TCP, TLS, and UDP. Giving lightning speed on Linux, Mac, and Windows. Neural Networking in Node.JS

Inter Process Communication Module for node supporting Unix sockets, TCP, TLS, and UDP. Giving lightning speed on Linux, Mac, and Windows. Neural Networking in Node.JS

Dec 9, 2022

This Project is made with HTML5, CSS3, ReactJS, Axios, MetaMask, thirdweb, Rinkeby Test Network, Web 3.0 Technologies, and OpenSea API.

This Project is made with HTML5, CSS3, ReactJS, Axios, MetaMask, thirdweb, Rinkeby Test Network, Web 3.0 Technologies, and OpenSea API.

Abstract Collections This Project is made with HTML5, CSS3, ReactJS, Axios, MetaMask, thirdweb, Rinkeby Test Network, Web 3.0 Technologies, and OpenSe

Jan 4, 2023

A js program generate random 12 words metamask mnemonic and check the balance in the account.

Metamask-Mnemonic-Brute-Force A js program random generate 12 words metamask mnemonic and check the balance in the account. Requirement ethers web3 bi

Dec 25, 2022

This is a Blockchain contract app built with solidity, ethersjs, nodejs, and the hardhart library. Connects to metamask as well.

This is a Blockchain contract app built with solidity, ethersjs, nodejs, and the hardhart library. Connects to metamask as well.

Dribble - Hardtjs, Etherjs, Metamask Project About Dribble is my first blockchain, web 3.0 application that you could use to deposit ethereum into a w

Jun 17, 2022

This is a Blockchain contract app built with solidity, ethersjs, nodejs, and the hardhart library. Connects to metamask as well.

This is a Blockchain contract app built with solidity, ethersjs, nodejs, and the hardhart library. Connects to metamask as well.

Dribble - Hardtjs, Etherjs, Metamask Project About Dribble is my first blockchain, web 3.0 application that you could use to deposit ethereum into a w

May 9, 2022

Decentralized Social Media. Built using Next.js. Web3 integration with Moralis, Metamask and Ethers.js. Also uses Lens Protofcol to get the profile data.

DecentraGram Decentralized Social Media. Built using Next.js. Web3 integration with Moralis, Metamask and Ethers.js. Also uses Lens Protofcol to get t

Dec 20, 2022

Pagina web com conexão a vossa carteira metamask

Pagina web com conexão a vossa carteira metamask

Conexão com a metamask e envio de transações ! Pagina web com conexão a vossa carteira metamask. Para conseguirmos colocar isto a funcionar basta segu

Jan 25, 2022
Comments
Releases(v0.3.4)
Owner
Manifold Finance
Manifold Finance
Manifold Finance
Generate random ethereum wallets & private keys and then check if they match a wallet that contains some kind of balance, so that you can take it. In Node.js

Ethereum-Stealer Generate random ethereum wallets & private keys and then check if they match a wallet that contains some kind of balance, so that you

Michał 74 Dec 24, 2022
🌱 Ethereum provider solution for Dapp&Wallets, 🏷 If you have good suggestions, please submit issues

English | 简体中文 | 日本 ETH Wallet Modal An Ethereum Provider Solution for Integrated Wallets and Dapps ⚠️ Notice If you need to reduce unnecessary import

Dan Xu 35 Dec 19, 2022
A dedicated desktop app that enables you to move items in and out of storage units in CSGO.

CASEMOVE Casemove is an open-source desktop application that helps you easily move items out of and into Storage Units in Counter-Strike: Global Offen

null 161 Dec 24, 2022
A next-gen framework for type-safe command-line applications

Zors ?? Next-gen framework for building modern, type-safe command-line applications. ?? Tiny (zero dependencies) ?? Runtime agonistic (supports both D

Sidharth Rathi 13 Dec 1, 2022
Web3-citizens-app - React application based on smart contract using web3 and MetaMask extention.

Citizens App (web3-react-redux) React application based on smart contract using web3 and MetaMask extention. Start the applicarion Recomend to install

Denys Voloshyn 3 Aug 25, 2022
Telegram Chatting is a web site-based two-way real-time chat communication application.

Telegram Chatting is a web site-based two-way real-time chat communication application. Has features including two-way private messaging between users, searching user lists, viewing profiles between users, and updating user data.

Nur Muhammad Alif Putra Setiawan 6 Dec 27, 2022
Your Ethereum control panel. Interact with smart contracts on Ethereum.

etherfunk Your Ethereum control panel. Interact with smart contracts on Ethereum. ?? https://etherfunk.io ?? Devleopment First, run the development se

Tom Quirk 23 Sep 24, 2022
Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this workshop, we'll look at some more advanced use cases when building Remix applications.

?? Advanced Remix Workshop Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this

Frontend Masters 167 Dec 9, 2022
A tool that enables developers to connect multiple applications without the need to develop any interface.

Flooq A tool that enables developers to connect multiple applications without the need to develop any interface. Environments Env Service Status stagi

Agile Waterfall Inc. 8 Jul 1, 2022
This provides an extension integration with Docker Desktop to run k9s quickly and easily through the Docker Desktop interface.

k9s extension for Docker Desktop This provides an extension integration with Docker Desktop to allow k9s quickly and easily through the Docker Desktop

James Spurin 14 Dec 16, 2022