chainlist-rpcs 0.3.4 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +14 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,10 +1,15 @@
1
1
  # Unofficial chainlist RPC npm module
2
2
 
3
- Installation: `npm install -S chainlist-rpcs`. See [npm package](https://www.npmjs.com/package/chainlist-rpcs).
3
+ [![npm version](https://badge.fury.io/js/chainlist-rpcs.svg)](https://badge.fury.io/js/chainlist-rpcs)
4
4
 
5
- NOTE: This module is unofficial and not maintained by Chainlist. If you want to add RPC urls, please refer to the [DefiLlama/chainlist](https://github.com/DefiLlama/chainlist) repository.
5
+ This package is a developer-friendly way to access the public RPCs as presented on [chainlist.org](https://chainlist.org/). The RPC endpoint list is maintained by the DefiLlama team at [DefiLlama/chainlist](https://github.com/DefiLlama/chainlist). Keep in mind that these RPC urls are public and do not come with any uptime or performance guarantees.
6
6
 
7
- NOTE 2: Keep in mind these RPCs are public and may have rate limits and imperfect uptime. Use them at your own risk.
7
+ Installation:
8
+ ```shell
9
+ npm install -S chainlist-rpcs
10
+ ```
11
+
12
+ Note that the RPC list is updated once a day automatically, and that every RPC list bump results in a `patch` semver update of this package. You can see the npm deployment history [here](https://github.com/actuallymentor/chainlist-rpcs/actions/workflows/deploy-to-npm.yml).
8
13
 
9
14
  ## Usage of constants
10
15
 
@@ -13,9 +18,15 @@ The module exports constants that are objects you can access. The `rpcs` and `ch
13
18
  ```js
14
19
  import { rpcs, chains_by_id, chains_by_name } from 'chainlist-rpcs'
15
20
 
21
+ // You can access chain names by their chain id. Chain id 1 is Ethereum mainnet.
16
22
  console.log( chains[1] ) // Output: "ethereum". Note that this is by chain id and not by index. 1 here refers to chain id 1.
23
+
24
+ // You can access the RPCs for a chain by its chain id.
17
25
  console.log( rpcs[1] ) // [ { url: String, tracking: String, trackingDetails: String } ].
26
+
27
+ // You can access the chain id by its name.
18
28
  console.log( chains_by_name["ethereum"] ) // Output: 1
29
+
19
30
  ```
20
31
 
21
32
  ## Usage of helper functions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chainlist-rpcs",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "type": "module",
5
5
  "description": "Wrapper around the rpcs as published by DefiLlama/chainlist.",
6
6
  "main": "app.js",