Socket
Socket
Sign inDemoInstall

dev-wallet

Package Overview
Dependencies
240
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

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


Version published
Maintainers
1
Install size
47.1 MB
Created

Readme

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

Last updated on 30 Nov 2022

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc