📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

dev-wallet

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dev-wallet

This library provides an embedded Ethereum wallet that makes local development with a non-persistent environment extremely easy, compared to using an external wallet, such as MetaMask. It uses the default first account used by Hardhat (and Foundry / prett

1.1.0
latest
npm
Version published
Weekly downloads
75
92.31%
Maintainers
1
Weekly downloads
 
Created
Source

Dev Wallet

This library provides an embedded Ethereum wallet that makes local development with a non-persistent environment extremely easy, compared to using an external wallet, such as MetaMask. It uses the default first account used by Hardhat (and Foundry / pretty much all dev nodes), but this can be easily overriden. Using this library instead of MetaMask or another browser wallet eliminates the following painpoints:

  • Having to worry about funding your own dev wallet when restarting a node
  • Needing to switch networks to Localhost on your main wallet
  • Possibly forgetting to switch networks and accidentally running a transaction on Mainnet
  • Having to deal with an alternative routing to the local node (ie. if using dev container development, the local node might not be at "localhost")

Using the Dev Wallet within your project is extremely easy. All you have to do is import the library (at the earliest possible point), and it will override window.ethereum with Dev Wallet. You should make sure to only do this in local dev environments, or staging environments where you don't want to have the user use their own wallet.

import 'dev-wallet';

initializeDevWallet(provider);

or

<html>
  <head>
    <script type="module">
      import { initializeDevWallet } from 'https://unpkg.com/dev-wallet@^1.0.0';

      initializeDevWallet(provider);
    </script>
  </head>
</html>

License

This project is dual-licensed under MIT and Apache 2.0.

FAQs

Package last updated on 30 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts