@ethernauta/chain 0.0.42 → 0.0.43

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 +27 -21
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![bundlejs](https://deno.bundlejs.com/badge?q=@ethernauta/chain@0.0.10&treeshake=[*])](https://deno.bundlejs.com/badge?q=@ethernauta/chain@0.0.10&treeshake=[*])
1
+ [![bundlejs](https://deno.bundlejs.com/badge?q=@ethernauta/chain&treeshake=[*])](https://deno.bundlejs.com/?q=@ethernauta/chain&treeshake=[*])
2
2
 
3
3
  ## Philosophy
4
4
 
@@ -7,33 +7,39 @@ This module aims to be an un-opinionated representation of the defined:
7
7
  - [Ethereum chains](https://github.com/ethereum-lists/chains/tree/master/_data/chains)
8
8
  - [chain schema](https://github.com/ethereum-lists/chains/blob/master/tools/schema/chainSchema.json)
9
9
 
10
- ## Modules
11
-
12
- - [abi](https://github.com/niconiahi/ethernauta/blob/main/packages/abi) [[NPM](https://www.npmjs.com/package/@ethernauta/abi)]
13
- - [chain](https://github.com/niconiahi/ethernauta/blob/main/packages/chain) [[NPM](https://www.npmjs.com/package/@ethernauta/chain)]
14
- - [cli](https://github.com/niconiahi/ethernauta/blob/main/packages/cli) [[NPM](https://www.npmjs.com/package/@ethernauta/cli)]
15
- - [erc](https://github.com/niconiahi/ethernauta/blob/main/packages/erc) [[NPM](https://www.npmjs.com/package/@ethernauta/erc)]
16
- - [eth](https://github.com/niconiahi/ethernauta/blob/main/packages/eth) [[NPM](https://www.npmjs.com/package/@ethernauta/eth)]
17
- - [transaction](https://github.com/niconiahi/ethernauta/blob/main/packages/transaction) [[NPM](https://www.npmjs.com/package/@ethernauta/transaction)]
18
- - [utils](https://github.com/niconiahi/ethernauta/blob/main/packages/utils) [[NPM](https://www.npmjs.com/package/@ethernauta/utils)]
19
- - [wallet](https://github.com/niconiahi/ethernauta/blob/main/packages/wallet)
10
+ Each chain is exported as a const that you can pair with `encode_chain_id` (from `@ethernauta/transport`) to produce a [CAIP-2](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-2.md) identifier.
20
11
 
21
- ## Table of contents
12
+ ## Modules
22
13
 
23
- 1. [chain](#chain)
14
+ - [abi](https://github.com/niconiahi/ethernauta/tree/main/packages/abi) [[NPM](https://www.npmjs.com/package/@ethernauta/abi)]
15
+ - [chain](https://github.com/niconiahi/ethernauta/tree/main/packages/chain) [[NPM](https://www.npmjs.com/package/@ethernauta/chain)]
16
+ - [cli](https://github.com/niconiahi/ethernauta/tree/main/packages/cli) [[NPM](https://www.npmjs.com/package/@ethernauta/cli)]
17
+ - [eip](https://github.com/niconiahi/ethernauta/tree/main/packages/eip) [[NPM](https://www.npmjs.com/package/@ethernauta/eip)]
18
+ - [erc](https://github.com/niconiahi/ethernauta/tree/main/packages/erc) [[NPM](https://www.npmjs.com/package/@ethernauta/erc)]
19
+ - [eth](https://github.com/niconiahi/ethernauta/tree/main/packages/eth) [[NPM](https://www.npmjs.com/package/@ethernauta/eth)]
20
+ - [transaction](https://github.com/niconiahi/ethernauta/tree/main/packages/transaction) [[NPM](https://www.npmjs.com/package/@ethernauta/transaction)]
21
+ - [transport](https://github.com/niconiahi/ethernauta/tree/main/packages/transport) [[NPM](https://www.npmjs.com/package/@ethernauta/transport)]
22
+ - [utils](https://github.com/niconiahi/ethernauta/tree/main/packages/utils) [[NPM](https://www.npmjs.com/package/@ethernauta/utils)]
23
+ - [wallet](https://github.com/niconiahi/ethernauta/tree/main/packages/wallet)
24
24
 
25
25
  ## API
26
26
 
27
- ```tsx
28
- import { eip155_1, encode_chain_id, decode_chain_id } from "@ethernauta/chain"
27
+ ```ts
28
+ import { eip155_11155111 } from "@ethernauta/chain"
29
+ import {
30
+ decode_chain_id,
31
+ encode_chain_id,
32
+ } from "@ethernauta/transport"
33
+
29
34
  const chain_id = encode_chain_id({
30
35
  namespace: "eip155",
31
- reference: eip155_1.chainId,
32
- })
33
- console.log(chain_id)// eip155:11155111
36
+ reference: eip155_11155111.chainId,
37
+ })
38
+ console.log(chain_id) // eip155:11155111
39
+
34
40
  const { namespace, reference } = decode_chain_id(chain_id)
35
- console.log(namespace)// eip155
36
- console.log(reference)// 11155111
41
+ console.log(namespace) // eip155
42
+ console.log(reference) // 11155111
37
43
  ```
38
44
 
39
45
  ## Files to pay attention
@@ -43,4 +49,4 @@ console.log(reference)// 11155111
43
49
  ### chain
44
50
 
45
51
  - [chain/shared.ts](https://github.com/niconiahi/ethernauta/blob/main/packages/chain/src/chain/shared.ts)
46
- - [chain/eip155/eip155-1.tsx](https://github.com/niconiahi/ethernauta/blob/main/packages/chain/src/chain/eip155/eip155-1.ts)
52
+ - [chain/eip155](https://github.com/niconiahi/ethernauta/tree/main/packages/chain/src/chain/eip155) (500+ chain definitions)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@ethernauta/chain",
4
4
  "type": "module",
5
- "version": "0.0.42",
5
+ "version": "0.0.43",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },