chainlist-rpcs 0.3.3 → 0.3.5
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.
- package/README.md +14 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
# Unofficial chainlist RPC npm module
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/js/chainlist-rpcs)
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Wrapper around the rpcs as published by DefiLlama/chainlist.",
|
|
6
6
|
"main": "app.js",
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
"husky": "^9.1.6",
|
|
30
30
|
"vitest": "^2.1.5"
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
}
|