Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
chore: Add deprecation notice
Browse files Browse the repository at this point in the history
Add a deprecation notice, and an example of how to build a basic
provider using the newer packages we have replaced this with.
  • Loading branch information
Gudahtt committed Mar 27, 2024
1 parent 2b354fd commit b139d92
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,34 @@

Web3 ProviderEngine is a tool for composing your own [web3 providers](https://github.com/ethereum/wiki/wiki/JavaScript-API#web3).

<table><tr><td><p align="center"><b>⚠️ PLEASE READ ⚠️</b></p><div align="center">This package was originally created for MetaMask and is being phased out in favor of <a href="https://www.npmjs.com/package/@metamask/json-rpc-engine"><code>@metamask/json-rpc-engine</code></a> and <a href="https://www.npmjs.com/package/@metamask/eth-json-rpc-middleware"><code>@metamask/eth-json-rpc-middleware</code></a>. As such, we will no longer be accepting changes to this package except those which address security issues.</div></td></tr></table>
> [!CAUTION]
> This package has been deprecated.
>
> This package was originally created for MetaMask, but has been replaced by `@metamask/json-rpc-engine`, `@metamask/eth-json-rpc-middleware`, and `@metamask/eth-json-rpc-provider`.
>
>Here is an example of how to create a provider using those packages:
>
> ```typescript
>import { providerFromMiddleware } from '@metamask/eth-json-rpc-provider';
>import { createFetchMiddleware } from '@metamask/eth-json-rpc-middleware';
>
>const rpcUrl = '[insert RPC URL here]';
>
>const fetchMiddleware = createFetchMiddleware({ rpcUrl });
>const provider = providerFromMiddleware(fetchMiddleware);
>
>provider.sendAsync(
> { id: 1, jsonrpc: '2.0', method: 'eth_chainId' },
> (error, response) => {
> if (error) {
> console.error(error);
> } else {
> console.log(response.result);
> }
> }
>);
>```
### Composable
Expand Down

0 comments on commit b139d92

Please sign in to comment.