open-index/open-npm huggingface dataset:
npm package: @metamask/inpage-provider
Description: A JavaScript Ethereum provider that connects to the wallet over a stream.
Author: MetaMask
Latest version: 8.1.0
Deprecated: Package renamed to @metamask/providers

# MetaMask Inpage Provider

The inpage Ethereum provider object injected by MetaMask into web pages.
Contains a lot of implementation details specific to MetaMask, and is probably
not suitable for out-of-the-box use with other wallets.

Implements the Ethereum JavaScript provider specification, [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193).

## Installation

`yarn add @metamask/inpage-provider`

## Usage

```javascript
import { initializeProvider } from '@metamask/inpage-provider';

// Create a stream to a remote provider:
const metamaskStream = new LocalMessageDuplexStream({
  name: 'inpage',
  target: 'contentscript',
});

// this will initialize the provider and set it as window.ethereum
initializeProvider({
  connectionStream: metamaskStream,
});

const { ethereum } = window;
```

### Types

Types are exposed at `index.d.ts`.
They require Node.js `EventEmitter` and `Duplex` stream types, which you can grab from e.g. [`@types/node`](https://npmjs.com/package/@types/node).

### Do Not Modify the Provider

The Provider object should not be mutated by consumers under any circumstances.
The maintainers of this package will neither fix nor take responsbility for bugs caused by third parties mutating the provider object.

## Running tests

```bash
yarn test
```
npm package: @metamask/legacy-web3
Description: MetaMask's legacy window.web3.
Author: Erik Marks
Latest version: 2.0.0

# @metamask/legacy-web3

MetaMask's legacy `window.web3`.

## Motivation

_MetaMask **strongly** recommends that you [read our migration guide](https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3) before using this package._
_You should only rely on this package if you need a temporary fix or are no longer actively developing your web3 site._

In the near future, MetaMask will stop injecting `window.web3` into web pages.
**When we do this, if your website relies on MetaMask's `window.web3` to function, it will break on that date unless you take action.**
Please refer to [the original announcement](https://medium.com/metamask/no-longer-injecting-web3-js-4a899ad6e59e) if you want to know why we're doing this.

If you do not wish to take either of the recommended migration paths, we provide this library as a drop-in replacement for our injected `window.web3`.
Simply add it to your site using one of the methods outlined below, and your Ethereum functionality will continue to work after we stop injecting `window.web3`.

You can add this package before we stop injecting `window.web3`, without disrupting the Ethereum functionality of your website.

## Disclaimer

This package is designed to emulate the functionality of our injected `window.web3`.
That said, we do not guarantee complete functional parity, and you may have to fix some bugs yourself.
We also make no guarantees about future maintenance of this package, and it is unlikely to support any new features added to [the MetaMask provider API](https://docs.metamask.io/guide/ethereum-provider.html).

## Usage

As a `<script>` in your web page:

```html
<html>
  <head>
    <!-- The legacy-web3 script must run BEFORE your other scripts. -->
    <script src="https://unpkg.com/@metamask/legacy-web3@latest/dist/metamask.web3.min.js"></script>
    <!-- Or: -->
    <script src="https://unpkg.com/@metamask/legacy-web3@latest/dist/metamask.web3.js"></script>
    ...
  </head>
  <body>
    ...
  </body>
</html>
```

Or add as a Node dependency:

```shell
yarn add @metamask/legacy-web3

# or

npm install @metamask/legacy-web3
```

```javascript
import '@metamask/legacy-web3'

// or

require('@metamask/legacy-web3')

const { web3 } = window
const selectedAddress = web3.eth.defaultAccount
```

### Initialization Criteria

This package will only initialize `window.web3` under the following circumstances:

- It detects an existing `window.ethereum`
- It does **not** detect an existing `window.web3`

`window.ethereum.isMetaMask` can be `true` or falsy.
If it is falsy and there is no existing `window.web3`, this package will initialize its `window.web3`, but there are no guarantees that it will work with non-MetaMask providers.
npm package: @metamask/metamask-airgapped-keyring
Description: airgapped eth keyring for metamask
Author: aaronisme
Latest version: 0.15.0

# `metamask-airgapped-keyring`

## This package is still Working in Progress.

This package is the Keystone implementation of `MetaMaskKeyring` which used in MetaMask Extension.

## Install

```bash
yarn add @keystonehq/metamask-airgapped-keyring
```

```base
npm install --save @keystonehq/metamask-airgapped-keyring
```
npm package: @metamask/multichain
Description: Provides types, helpers, adapters, and wrappers for facilitating CAIP Multichain sessions
Latest version: 4.1.0
Deprecated: This package has been split up into multiple packages and is no longer being maintained. Please use @metamask/chain-agnostic-permission, @metamask/eip1193-permission-middleware, and/or @metamask/multichain-api-middleware instead. (For more info on what each package does, see their respective READMEs.)
npm package: @metamask/number-to-bn
Description: A simple method that will convert numbers, hex, BN or bignumber.js object into a BN.js object.
Author: Nick Dodson
Latest version: 1.7.1

## number-to-bn

<div>
  <!-- NPM Version -->
  <a href="https://www.npmjs.org/package/@metamask/number-to-bn">
    <img src="http://img.shields.io/npm/v/@metamask/number-to-bn.svg"
    alt="NPM version" />
  </a>
</div>

<br />

A simple method to convert integer or hex integer numbers to BN.js object instances. Does not support decimal numbers.

## Install

```
npm install --save @metamask/number-to-bn
```

## Usage

```js
const numberToBN = require('@metamask/number-to-bn');

console.log(numberToBN('-1'));

// result <BN ...> -1

console.log(numberToBN(1));

// result <BN ...> 1

console.log(numberToBN(new BN(100)));

// result <BN ...> 100

console.log(numberToBN(new BigNumber(10000)));

// result <BN ...> 10000

console.log(numberToBN('0x0a'));

// result <BN ...> 10

console.log(numberToBN('-0x0a'));

// result <BN ...> -10

console.log(numberToBN('0.9')); // or {}, [], undefined, 9.9

// throws new Error(...)

console.log(numberToBN(null)); // or {}, [], undefined, 9.9

// throws new Error(...)
```

## Important documents

- [Changelog](CHANGELOG.md)
- [License](https://raw.githubusercontent.com/MetaMask/number-to-bn/main/LICENSE)

## Licence

This project is licensed under the MIT license, Copyright (c) 2016 Nick Dodson. For more information see LICENSE.md.

```
The MIT License

Copyright (c) 2016 Nick Dodson. nickdodson.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```