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