@ethernauta/chain 0.0.3

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 +32 -0
  2. package/package.json +36 -0
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ ## Philosophy
2
+
3
+ This module aims to be an un-opinionated representation of the defined:
4
+
5
+ - [Ethereum chains](https://github.com/ethereum-lists/chains/tree/master/_data/chains)
6
+ - [chain schema](https://github.com/ethereum-lists/chains/blob/master/tools/schema/chainSchema.json)
7
+
8
+ ## Table of contents
9
+
10
+ 1. [chain](#chain)
11
+
12
+ ## API
13
+
14
+ ```tsx
15
+ import { eip155_1, encodeChainId, decodeChainId } from "@ethernauta/chain"
16
+ const chainId = encodeChainId({
17
+ namespace: "eip155",
18
+ reference: eip155_1.chainId,
19
+ })
20
+ console.log(chainId)// eip155:11155111
21
+ const { namespace, reference } = decodeChainId(chainId)
22
+ console.log(namespace)// eip155
23
+ console.log(reference)// 11155111
24
+ ```
25
+
26
+ ## Files to pay attention
27
+
28
+ ### chain
29
+
30
+ - [indexer.tsx](src/chain/indexer/indexer.ts)
31
+ - [shared.tsx](src/chain/shared/shared.ts)
32
+ - [eip155-1](src/chain/eip155/eip155-1/eip155-1.ts)
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@ethernauta/chain",
3
+ "type": "module",
4
+ "version": "0.0.3",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/niconiahi/cryptoman"
11
+ },
12
+ "sideEffects": false,
13
+ "main": "./dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "dependencies": {
19
+ "valibot": "1.1.0"
20
+ },
21
+ "devDependencies": {
22
+ "@types/node": "^24.1.0",
23
+ "simple-git": "^3.21.0",
24
+ "tsm": "^2.3.0",
25
+ "tsup": "^8.5.0",
26
+ "vitest": "^3.2.4"
27
+ },
28
+ "scripts": {
29
+ "build": "tsup",
30
+ "lint": "biome check .",
31
+ "lint:fix": "biome check --write .",
32
+ "format": "biome format --write .",
33
+ "test:unit": "vitest",
34
+ "indexer": "node --loader tsm src/chain/indexer.ts"
35
+ }
36
+ }