@beclab/olaresid 0.1.1 → 0.1.2

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 (87) hide show
  1. package/CLI.md +1300 -0
  2. package/README.md +37 -31
  3. package/TAG.md +589 -0
  4. package/dist/abi/RootResolver2ABI.d.ts +54 -0
  5. package/dist/abi/RootResolver2ABI.d.ts.map +1 -0
  6. package/dist/abi/RootResolver2ABI.js +240 -0
  7. package/dist/abi/RootResolver2ABI.js.map +1 -0
  8. package/dist/business/index.d.ts +302 -0
  9. package/dist/business/index.d.ts.map +1 -0
  10. package/dist/business/index.js +1209 -0
  11. package/dist/business/index.js.map +1 -0
  12. package/dist/business/tag-context.d.ts +219 -0
  13. package/dist/business/tag-context.d.ts.map +1 -0
  14. package/dist/business/tag-context.js +537 -0
  15. package/dist/business/tag-context.js.map +1 -0
  16. package/dist/cli.js +2085 -39
  17. package/dist/cli.js.map +1 -1
  18. package/dist/debug.d.ts.map +1 -1
  19. package/dist/debug.js +14 -2
  20. package/dist/debug.js.map +1 -1
  21. package/dist/index.d.ts +50 -2
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +229 -9
  24. package/dist/index.js.map +1 -1
  25. package/dist/utils/crypto-utils.d.ts +130 -0
  26. package/dist/utils/crypto-utils.d.ts.map +1 -0
  27. package/dist/utils/crypto-utils.js +402 -0
  28. package/dist/utils/crypto-utils.js.map +1 -0
  29. package/dist/utils/error-parser.d.ts +35 -0
  30. package/dist/utils/error-parser.d.ts.map +1 -0
  31. package/dist/utils/error-parser.js +202 -0
  32. package/dist/utils/error-parser.js.map +1 -0
  33. package/dist/utils/tag-abi-codec.d.ts +69 -0
  34. package/dist/utils/tag-abi-codec.d.ts.map +1 -0
  35. package/dist/utils/tag-abi-codec.js +144 -0
  36. package/dist/utils/tag-abi-codec.js.map +1 -0
  37. package/dist/utils/tag-type-builder.d.ts +158 -0
  38. package/dist/utils/tag-type-builder.d.ts.map +1 -0
  39. package/dist/utils/tag-type-builder.js +410 -0
  40. package/dist/utils/tag-type-builder.js.map +1 -0
  41. package/examples/crypto-utilities.ts +140 -0
  42. package/examples/domain-context.ts +80 -0
  43. package/examples/generate-mnemonic.ts +149 -0
  44. package/examples/index.ts +1 -1
  45. package/examples/ip.ts +171 -0
  46. package/examples/legacy.ts +10 -10
  47. package/examples/list-wallets.ts +81 -0
  48. package/examples/quasar-demo/.eslintrc.js +23 -0
  49. package/examples/quasar-demo/.quasar/app.js +43 -0
  50. package/examples/quasar-demo/.quasar/client-entry.js +38 -0
  51. package/examples/quasar-demo/.quasar/client-prefetch.js +130 -0
  52. package/examples/quasar-demo/.quasar/quasar-user-options.js +16 -0
  53. package/examples/quasar-demo/README.md +49 -0
  54. package/examples/quasar-demo/index.html +11 -0
  55. package/examples/quasar-demo/package-lock.json +6407 -0
  56. package/examples/quasar-demo/package.json +36 -0
  57. package/examples/quasar-demo/quasar.config.js +73 -0
  58. package/examples/quasar-demo/src/App.vue +13 -0
  59. package/examples/quasar-demo/src/css/app.scss +1 -0
  60. package/examples/quasar-demo/src/layouts/MainLayout.vue +21 -0
  61. package/examples/quasar-demo/src/pages/IndexPage.vue +905 -0
  62. package/examples/quasar-demo/src/router/index.ts +25 -0
  63. package/examples/quasar-demo/src/router/routes.ts +11 -0
  64. package/examples/quasar-demo/tsconfig.json +28 -0
  65. package/examples/register-subdomain.ts +152 -0
  66. package/examples/rsa-keypair.ts +148 -0
  67. package/examples/tag-builder.ts +235 -0
  68. package/examples/tag-management.ts +534 -0
  69. package/examples/tag-nested-tuple.ts +190 -0
  70. package/examples/tag-simple.ts +149 -0
  71. package/examples/tag-tagger.ts +217 -0
  72. package/examples/test-nested-tuple-conversion.ts +143 -0
  73. package/examples/test-type-bytes-parser.ts +70 -0
  74. package/examples/transfer-domain.ts +197 -0
  75. package/examples/wallet-management.ts +196 -0
  76. package/package.json +24 -15
  77. package/src/abi/RootResolver2ABI.ts +237 -0
  78. package/src/business/index.ts +1490 -0
  79. package/src/business/tag-context.ts +713 -0
  80. package/src/cli.ts +2755 -39
  81. package/src/debug.ts +17 -2
  82. package/src/index.ts +300 -14
  83. package/src/utils/crypto-utils.ts +459 -0
  84. package/src/utils/error-parser.ts +225 -0
  85. package/src/utils/tag-abi-codec.ts +158 -0
  86. package/src/utils/tag-type-builder.ts +469 -0
  87. package/tsconfig.json +1 -1
package/README.md CHANGED
@@ -1,93 +1,99 @@
1
- # DID Contract Developer Components
1
+ # OlaresID SDK & CLI
2
2
 
3
- ## 介绍
3
+ ## Introduction
4
4
 
5
- `olaresid` 是一个用来和 Olares ID 合约交互的 SDK 库和 CLI 工具.
5
+ `olaresid` is an SDK library and CLI tool for interacting with Olares ID contracts.
6
6
 
7
- ## 快速开始
7
+ ## Quick Start
8
8
 
9
- ### 作为 CLI 工具
9
+ ### As a CLI Tool
10
10
 
11
11
  ```bash
12
12
  npm install -g @beclab/olaresid
13
13
 
14
- ## 在测试网查询 olares id 信息
15
- did-cli fetch tw7613781.olares.com
14
+ # Query Olares ID information on testnet
15
+ did-cli info example.olares.com
16
16
 
17
- ## 在主网查询 olares id 信息
18
- did-cli fetch pengpeng8.olares.com --network mainnet
17
+ # Query Olares ID information on mainnet
18
+ did-cli info example.olares.com --network mainnet
19
19
  ```
20
20
 
21
- ### 作为 SDK 使用
21
+ For detailed CLI usage, see [CLI.md](./CLI.md).
22
+
23
+ ### As an SDK
22
24
 
23
25
  ```bash
24
26
  npm install @beclab/olaresid
25
27
  ```
26
28
 
27
- 参考 [`examples`](./examples) 目录
29
+ Refer to the [examples](./examples) directory.
30
+
31
+ For Tag System usage, see [TAG.md](./TAG.md).
28
32
 
29
33
  ---
30
34
 
31
- ## 贡献指南
35
+ ## Contribution Guide
32
36
 
33
- 欢迎为本项目贡献代码!在提交 PR 之前,你可以通过以下方式在本地测试你的修改:
37
+ Contributions are welcome! Before submitting a PR, you can test your changes locally in the following ways:
34
38
 
35
- ### 环境准备
39
+ ### Environment Setup
36
40
 
37
41
  ```bash
38
- # 克隆仓库并安装依赖
42
+ # Clone the repository and install dependencies
39
43
  git clone https://github.com/beclab/did-system.git
40
44
  cd did-system/packages/olaresid
41
45
  npm install
42
46
  ```
43
47
 
44
- ### 测试方式 1:通过 CLI 调试
48
+ ### Testing Method 1: Debug via CLI
45
49
 
46
- 修改代码后,可以通过 CLI 工具测试你的改动:
50
+ After modifying the code, you can test your changes through the CLI tool:
47
51
 
48
52
  ```bash
49
- # 编译代码
53
+ # Compile the code
50
54
  npm run build
51
55
 
52
- # 将本地版本链接到全局
56
+ # Link the local version globally
53
57
  npm link
54
58
 
55
- # 测试 CLI 功能
56
- did-cli fetch tw7613781.olares.com
57
- did-cli fetch pengpeng8.olares.com --network mainnet
59
+ # Test CLI functionality
60
+ did-cli info tw7613781.olares.com
61
+ did-cli info pengpeng8.olares.com --network mainnet
58
62
  ```
59
63
 
60
- ### 测试方式 2:通过示例代码调试
64
+ ### Testing Method 2: Debug via Example Code
61
65
 
62
- 也可以通过运行 [`examples`](./examples) 目录中的示例代码来测试:
66
+ You can also test by running example code in the [`examples`](./examples) directory:
63
67
 
64
68
  ```bash
65
- # 编译代码
69
+ # Compile the code
66
70
  npm run build
67
71
 
68
- # 运行示例
72
+ # Run examples
69
73
  npx ts-node ./examples/index.ts
70
74
 
71
- # 或运行其他示例
75
+ # Or run other examples
72
76
  npx ts-node ./examples/legacy.ts
73
77
  ```
74
78
 
75
- 完成测试后,欢迎提交 Pull Request
79
+ After testing, feel free to submit a Pull Request!
76
80
 
77
81
  ---
78
82
 
79
- ## 网络配置
83
+ ## Network Configuration
80
84
 
81
- #### Sepolia 测试网(默认)
85
+ #### Sepolia Testnet (Default)
82
86
 
83
87
  - **RPC:** https://sepolia.optimism.io
84
88
  - **DID Contract:** 0xe2D7c3a9013960E04d4E9F5F9B63fff37eEd97A8
85
89
  - **Root Resolver:** 0xeF727cb066Fee98F88Db84555830063b4A24ddfc
90
+ - **Root Resolver2:** 0xcbC02aa08c77a374eC0D5A0403E108b7573d96e8
86
91
  - **ABI Type:** 0x7386fCBae6Ad4CCE1499d9153D99bc950B589718
87
92
 
88
- #### 主网
93
+ #### Mainnet
89
94
 
90
95
  - **RPC:** https://optimism-rpc.publicnode.com
91
96
  - **DID Contract:** 0x5DA4Fa8E567d86e52Ef8Da860de1be8f54cae97D
92
97
  - **Root Resolver:** 0xE2EABA0979277A90511F8873ae1e8cA26B54E740
98
+ - **Root Resolver2:** 0x7e7961aB771cA942CE4DB6e79579e016a33Dc95B
93
99
  - **ABI Type:** 0x9ae3F16bD99294Af1784beB1a0A5C84bf2636365