@wowok/agent-mcp 2.2.13 → 2.2.15

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 (126) hide show
  1. package/README.md +19 -11
  2. package/dist/index.js +44 -100
  3. package/dist/schema/query/index.js +1 -1
  4. package/dist/schema-query/index.d.ts +29 -0
  5. package/dist/schema-query/index.js +149 -0
  6. package/dist/schemas/account_operation.schema.json +255 -0
  7. package/dist/schemas/guard2file.schema.json +71 -0
  8. package/dist/schemas/index.json +139 -0
  9. package/dist/schemas/local_info_operation.schema.json +142 -0
  10. package/dist/schemas/local_mark_operation.schema.json +119 -0
  11. package/dist/schemas/machineNode2file.schema.json +71 -0
  12. package/dist/schemas/messenger_operation.schema.json +1393 -0
  13. package/dist/schemas/onchain_events.schema.json +113 -0
  14. package/dist/schemas/onchain_operations.schema.json +376 -0
  15. package/dist/schemas/onchain_operations_allocation.schema.json +914 -0
  16. package/dist/schemas/onchain_operations_arbitration.schema.json +1166 -0
  17. package/dist/schemas/onchain_operations_contact.schema.json +853 -0
  18. package/dist/schemas/onchain_operations_demand.schema.json +984 -0
  19. package/dist/schemas/onchain_operations_gen_passport.schema.json +1141 -0
  20. package/dist/schemas/onchain_operations_guard.schema.json +713 -0
  21. package/dist/schemas/onchain_operations_machine.schema.json +1347 -0
  22. package/dist/schemas/onchain_operations_order.schema.json +830 -0
  23. package/dist/schemas/onchain_operations_payment.schema.json +717 -0
  24. package/dist/schemas/onchain_operations_permission.schema.json +1088 -0
  25. package/dist/schemas/onchain_operations_personal.schema.json +1282 -0
  26. package/dist/schemas/onchain_operations_progress.schema.json +751 -0
  27. package/dist/schemas/onchain_operations_repository.schema.json +1572 -0
  28. package/dist/schemas/onchain_operations_reward.schema.json +955 -0
  29. package/dist/schemas/onchain_operations_service.schema.json +1411 -0
  30. package/dist/schemas/onchain_operations_treasury.schema.json +1155 -0
  31. package/dist/schemas/onchain_table_data.schema.json +35 -0
  32. package/dist/schemas/query_toolkit.schema.json +32 -0
  33. package/dist/schemas/schema_query.schema.json +33 -0
  34. package/dist/schemas/wip_file.schema.json +27 -0
  35. package/dist/schemas/wowok_buildin_info.schema.json +487 -0
  36. package/package.json +7 -5
  37. package/dist/docs/index.d.ts +0 -3
  38. package/dist/docs/index.js +0 -2
  39. package/dist/docs/loader.d.ts +0 -12
  40. package/dist/docs/loader.js +0 -177
  41. package/dist/docs/search.d.ts +0 -17
  42. package/dist/docs/search.js +0 -325
  43. package/dist/docs/types.d.ts +0 -55
  44. package/dist/docs/types.js +0 -1
  45. package/docs/README.md +0 -249
  46. package/docs/WIP.md +0 -388
  47. package/docs/WTS.md +0 -536
  48. package/docs/docs/account.md +0 -914
  49. package/docs/docs/allocation.md +0 -635
  50. package/docs/docs/arbitration.md +0 -1804
  51. package/docs/docs/arbitration_state_machine.md +0 -270
  52. package/docs/docs/contact.md +0 -709
  53. package/docs/docs/demand.md +0 -948
  54. package/docs/docs/guard.md +0 -1465
  55. package/docs/docs/localinfo.md +0 -432
  56. package/docs/docs/localmark.md +0 -583
  57. package/docs/docs/machine.md +0 -2490
  58. package/docs/docs/messenger.md +0 -2098
  59. package/docs/docs/onchain_events.md +0 -267
  60. package/docs/docs/order.md +0 -1001
  61. package/docs/docs/payment.md +0 -512
  62. package/docs/docs/permission.md +0 -1438
  63. package/docs/docs/personal.md +0 -742
  64. package/docs/docs/progress.md +0 -1748
  65. package/docs/docs/query.md +0 -467
  66. package/docs/docs/repository.md +0 -1043
  67. package/docs/docs/reward.md +0 -833
  68. package/docs/docs/service.md +0 -2130
  69. package/docs/docs/stage-01-introduction.md +0 -243
  70. package/docs/docs/stage-02-trust.md +0 -302
  71. package/docs/docs/stage-03-collaboration.md +0 -337
  72. package/docs/docs/stage-04-transaction.md +0 -277
  73. package/docs/docs/stage-05-business.md +0 -151
  74. package/docs/docs/stage-06-personal.md +0 -203
  75. package/docs/docs/stage-07-query.md +0 -572
  76. package/docs/docs/stage-08-examples.md +0 -184
  77. package/docs/docs/treasury.md +0 -1149
  78. package/docs/docs/wowok_buildin_info.md +0 -740
  79. package/docs/examples/Insurance/Insurance.md +0 -594
  80. package/docs/examples/Insurance/Insurance_TestResults.md +0 -481
  81. package/docs/examples/Insurance/insurance_complete_guard_v1.json +0 -50
  82. package/docs/examples/MyShop/MyShop.md +0 -1353
  83. package/docs/examples/MyShop/MyShop_TestResults.md +0 -1003
  84. package/docs/examples/MyShop_Advanced/MyShop_Advanced.md +0 -1898
  85. package/docs/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +0 -1297
  86. package/docs/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +0 -743
  87. package/docs/examples/MyShop_Advanced/machine_nodes.json +0 -222
  88. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature.md +0 -776
  89. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +0 -599
  90. package/docs/examples/Travel/Travel.md +0 -1157
  91. package/docs/examples/Travel/Travel_TestResults.md +0 -743
  92. package/docs/examples/Travel/calc-weather-timestamps.js +0 -8
  93. package/docs/examples/Travel/travel_machine_v2_export.json +0 -104
  94. package/docs/examples/Travel/weather_check_guard_v1.json +0 -51
  95. package/docs/skills/WOWOK.md +0 -650
  96. package/docs/skills/onchain_operations/_common.md +0 -406
  97. package/docs/skills/onchain_operations/_index.md +0 -196
  98. package/docs/skills/onchain_operations/allocation.md +0 -28
  99. package/docs/skills/onchain_operations/arbitration.md +0 -106
  100. package/docs/skills/onchain_operations/contact.md +0 -40
  101. package/docs/skills/onchain_operations/demand.md +0 -53
  102. package/docs/skills/onchain_operations/gen_passport.md +0 -23
  103. package/docs/skills/onchain_operations/guard.md +0 -56
  104. package/docs/skills/onchain_operations/machine.md +0 -89
  105. package/docs/skills/onchain_operations/order.md +0 -56
  106. package/docs/skills/onchain_operations/payment.md +0 -24
  107. package/docs/skills/onchain_operations/permission.md +0 -68
  108. package/docs/skills/onchain_operations/personal.md +0 -58
  109. package/docs/skills/onchain_operations/progress.md +0 -38
  110. package/docs/skills/onchain_operations/repository.md +0 -70
  111. package/docs/skills/onchain_operations/reward.md +0 -38
  112. package/docs/skills/onchain_operations/service.md +0 -78
  113. package/docs/skills/onchain_operations/treasury.md +0 -68
  114. package/docs/skills/schema-account_operation.md +0 -402
  115. package/docs/skills/schema-guard2file.md +0 -153
  116. package/docs/skills/schema-local_info_operation.md +0 -160
  117. package/docs/skills/schema-local_mark_operation.md +0 -148
  118. package/docs/skills/schema-machineNode2file.md +0 -155
  119. package/docs/skills/schema-messenger_operation.md +0 -547
  120. package/docs/skills/schema-onchain_events.md +0 -201
  121. package/docs/skills/schema-onchain_table_data.md +0 -334
  122. package/docs/skills/schema-query_toolkit.md +0 -395
  123. package/docs/skills/schema-wip_file.md +0 -240
  124. package/docs/skills/schema-wowok_buildin_info.md +0 -296
  125. package/docs/wip-examples/three_body.html +0 -57
  126. package/docs/wip-examples/three_body.wip +0 -30
@@ -1,337 +0,0 @@
1
- # Stage 3: Open Collaboration 🤝
2
-
3
- ---
4
-
5
- **[← Stage 2: Trust Management](stage-02-trust.md) | [Stage 4: Transaction Execution →](stage-04-transaction.md)**
6
-
7
- ---
8
-
9
- ## 🎯 Stage Objectives
10
-
11
- In this stage, you will learn about open collaboration mechanisms in WoWok, including:
12
-
13
- - How to use Machine and Progress to define and execute workflows
14
- - How to use Messenger for secure private communication
15
- - How to use Contact to manage public contact information
16
-
17
- ---
18
-
19
- ## 📚 Learning Content
20
-
21
- ### 3.1 Machine + Progress (Workflow Engine ⚙️)
22
-
23
- **Why do we need Machine and Progress?**
24
-
25
- Collaboration needs to be process-oriented. Machine is the workflow template (defining what to do), and Progress is the workflow instance (tracking execution progress).
26
-
27
- **Core Concepts:**
28
- - 📋 **Machine** - Workflow template, defines nodes and transition rules
29
- - 🔄 **Progress** - Workflow instance, tracks execution status
30
- - 🎯 **Nodes** - Steps in the workflow (states)
31
- - 🔗 **Transitions** - Operation rules from one node to another
32
-
33
- **Core Features:**
34
-
35
- **Machine Features:**
36
- - ✅ Create Machine (define nodes and transition rules)
37
- - ✅ Add/Modify nodes (modifiable before publishing)
38
- - ✅ Publish Machine (lock nodes, ready for use)
39
- - ✅ Create Progress (launch workflow instance)
40
- - ✅ Manage Repository (bind data storage)
41
-
42
- **Progress Features:**
43
- - ✅ Advance Progress (execute node transitions)
44
- - ✅ Manage named operators (dynamic permission assignment)
45
- - ✅ Set Task ID (associate objects)
46
- - ✅ Manage context Repository
47
-
48
- **→ [View Machine Detailed Documentation →](machine.md)**
49
- **→ [View Progress Detailed Documentation →](progress.md)**
50
-
51
- ---
52
-
53
- ### 3.2 Messenger (Private Communication 🔒)
54
-
55
- **Why do we need Messenger?**
56
-
57
- Collaboration requires communication. Messenger provides end-to-end encrypted secure communication, supporting WTS verifiable chat records.
58
-
59
- **Core Concepts:**
60
- - 🔒 **End-to-End Encryption** - Only communication parties can see the content
61
- - 📝 **WTS** - Witness Timestamped Signature, verifiable chat records (can be used as legal evidence)
62
- - 📎 **File Transfer** - Securely send files
63
- - ⏰ **On-Chain Proof** - Generate on-chain timestamp proof for messages
64
-
65
- **Core Features:**
66
- - ✅ View conversation list
67
- - ✅ Send text messages (end-to-end encrypted)
68
- - ✅ Send files
69
- - ✅ View message history
70
- - ✅ Generate WTS proof
71
- - ✅ Verify WTS signature
72
- - ✅ On-chain proof messages
73
- - ✅ Manage blacklist/friends list/Guard list
74
-
75
- **→ [View Messenger Detailed Documentation →](messenger.md)**
76
-
77
- ---
78
-
79
- ### 3.3 Contact (Service Window 📇)
80
-
81
- **Why do we need Contact?**
82
-
83
- Collaboration requires contact information. Contact manages public contact information and can be bound to Service.
84
-
85
- **Core Features:**
86
- - ✅ Create Contact (set name, description, location)
87
- - ✅ Manage IM contact list (add/remove/clear)
88
- - ✅ Set personal status
89
- - ✅ Receive objects sent to Contact
90
- - ✅ Bind to Service and other objects (as service contact)
91
-
92
- **Important Notes:**
93
- - ⚠️ It is recommended to only place public contact information
94
-
95
- **→ [View Contact Detailed Documentation →](contact.md)**
96
-
97
- ---
98
-
99
- ## 🎓 Practice Exercises
100
-
101
- ### Exercise 1: Create a Simple Workflow Machine
102
-
103
- **💬 You**: Create a Machine named "design_workflow" for design service process.
104
-
105
- **🤖 AI Generated Request:**
106
-
107
- ```json
108
- {
109
- "operation_type": "machine",
110
- "data": {
111
- "object": {
112
- "name": "design_workflow"
113
- },
114
- "description": "Design service workflow - complete process from order creation to delivery"
115
- }
116
- }
117
- ```
118
-
119
- **✅ After successful execution, add nodes:**
120
-
121
- **💬 You**: Add three nodes to "design_workflow": created (initial node), designing, completed (terminal node).
122
-
123
- **🤖 AI Generated Request:**
124
-
125
- ```json
126
- {
127
- "operation_type": "machine",
128
- "data": {
129
- "object": "design_workflow",
130
- "node": {
131
- "op": "add",
132
- "nodes": [
133
- {
134
- "name": "created",
135
- "pairs": []
136
- },
137
- {
138
- "name": "designing",
139
- "pairs": [
140
- {
141
- "prev_node": "created",
142
- "threshold": 1,
143
- "forwards": [
144
- {
145
- "name": "start_design",
146
- "permissionIndex": 1000,
147
- "weight": 1
148
- }
149
- ]
150
- }
151
- ]
152
- },
153
- {
154
- "name": "completed",
155
- "pairs": [
156
- {
157
- "prev_node": "designing",
158
- "threshold": 1,
159
- "forwards": [
160
- {
161
- "name": "complete_design",
162
- "permissionIndex": 1001,
163
- "weight": 1
164
- }
165
- ]
166
- }
167
- ]
168
- }
169
- ]
170
- }
171
- }
172
- }
173
- ```
174
-
175
- **✅ After successful execution, publish Machine:**
176
-
177
- **💬 You**: Publish "design_workflow" Machine.
178
-
179
- **🤖 AI Generated Request:**
180
-
181
- ```json
182
- {
183
- "operation_type": "machine",
184
- "data": {
185
- "object": "design_workflow",
186
- "publish": true
187
- }
188
- }
189
- ```
190
-
191
- ---
192
-
193
- ### Exercise 2: Create and Advance Progress
194
-
195
- **💬 You**: Create a Progress based on "design_workflow", named "my_first_progress".
196
-
197
- **🤖 AI Generated Request:**
198
-
199
- ```json
200
- {
201
- "operation_type": "machine",
202
- "data": {
203
- "object": "design_workflow",
204
- "progress_new": {
205
- "namedNew": {
206
- "name": "my_first_progress"
207
- }
208
- }
209
- }
210
- }
211
- ```
212
-
213
- **✅ After successful execution, advance Progress:**
214
-
215
- **💬 You**: Advance "my_first_progress" from created node to designing node by executing "start_design" operation.
216
-
217
- **🤖 AI Generated Request:**
218
-
219
- ```json
220
- {
221
- "operation_type": "progress",
222
- "data": {
223
- "object": "my_first_progress",
224
- "operate": {
225
- "operation": {
226
- "next_node_name": "designing",
227
- "forward": "start_design"
228
- },
229
- "hold": false,
230
- "message": "Start design work"
231
- }
232
- }
233
- }
234
- ```
235
-
236
- ---
237
-
238
- ### Exercise 3: Send Encrypted Message
239
-
240
- **💬 You**: Send an encrypted message "Hello, I would like to inquire about design services" to "alice".
241
-
242
- **🤖 AI Generated Request:**
243
-
244
- ```json
245
- {
246
- "operation": "send_message",
247
- "to": {
248
- "name_or_address": "alice"
249
- },
250
- "content": "Hello, I would like to inquire about design services"
251
- }
252
- ```
253
-
254
- ---
255
-
256
- ### Exercise 4: View Conversation List
257
-
258
- **💬 You**: View all my conversation lists.
259
-
260
- **🤖 AI Generated Request:**
261
-
262
- ```json
263
- {
264
- "operation": "watch_conversations"
265
- }
266
- ```
267
-
268
- ---
269
-
270
- ### Exercise 5: Create Contact
271
-
272
- **💬 You**: Create a Contact named "design_service_contact" with description "Design service contact information".
273
-
274
- **🤖 AI Generated Request:**
275
-
276
- ```json
277
- {
278
- "operation_type": "contact",
279
- "data": {
280
- "object": {
281
- "name": "design_service_contact"
282
- },
283
- "description": "Design service contact - 24/7 online support",
284
- "location": "Online service",
285
- "ims": {
286
- "op": "clear"
287
- }
288
- }
289
- }
290
- ```
291
-
292
- ---
293
-
294
- ### Exercise 6: Manage Messenger Blacklist
295
-
296
- **💬 You**: Add address "0x1234...abcd" to my blacklist.
297
-
298
- **🤖 AI Generated Request:**
299
-
300
- ```json
301
- {
302
- "operation": "blacklist",
303
- "blacklist": {
304
- "op": "add",
305
- "users": ["0x1234abcd5678efgh9012ijkl3456mnop7890qrst"]
306
- }
307
- }
308
- ```
309
-
310
- ---
311
-
312
- ## 🏆 Stage Checklist
313
-
314
- Before moving to the next stage, please confirm that you have:
315
-
316
- - [ ] Understood the difference between Machine and Progress
317
- - [ ] Created at least one Machine
318
- - [ ] Added nodes and transition rules to Machine
319
- - [ ] Published Machine
320
- - [ ] Created at least one Progress
321
- - [ ] Advanced Progress nodes
322
- - [ ] Sent encrypted messages
323
- - [ ] Viewed conversation list
324
- - [ ] Created Contact
325
- - [ ] Managed IM contacts
326
-
327
- ---
328
-
329
- ## 🎉 Congratulations!
330
-
331
- You have completed Stage 3! Now you have mastered WoWok's open collaboration mechanisms and can move on to the next stage to learn about transaction execution!
332
-
333
- **[→ Go to Stage 4: Transaction Execution 💼 →](stage-04-transaction.md)**
334
-
335
- ---
336
-
337
- **[← Return to Main Directory](../README.md)**
@@ -1,277 +0,0 @@
1
- # Stage 4: Transaction Execution 💼
2
-
3
- ---
4
-
5
- **[← Stage 3: Open Collaboration](stage-03-collaboration.md) | [Stage 5: Business Components →](stage-05-business.md)**
6
-
7
- ---
8
-
9
- ## 🎯 Stage Objectives
10
-
11
- In this stage, you will learn the transaction mechanisms in WoWok, including:
12
-
13
- - How to use Allocation for automatic fund distribution
14
- - How to use WIP to describe products and services
15
- - How to use Service and Order for service sales and order management
16
- - How to use Arbitration for dispute resolution
17
-
18
- ---
19
-
20
- ## 📚 Learning Content
21
-
22
- ### 4.1 WIP for Product and Service Description (📄 WIP)
23
-
24
- **Why use WIP for Products and Services?**
25
-
26
- WIP (Witness Immutable Promise) provides immutable, verifiable product and service descriptions. By deploying WIP files to the network and using their URLs and hashes as product details, both sellers and buyers can establish deterministic commitments.
27
-
28
- **Core Concepts:**
29
- - 📄 **Immutable Content** - Product descriptions cannot be altered after creation
30
- - 🔗 **URL + Hash Verification** - Combines network accessibility with cryptographic integrity
31
- - ✍️ **Multi-signature Support** - Sellers can sign to establish authenticity
32
- - ✅ **Verifiable** - Anyone can verify the content matches the promised hash
33
-
34
- **How WIP Integrates with Service:**
35
-
36
- ```
37
- ┌─────────────────────────────────────────────────────────────┐
38
- │ Service Object │
39
- │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐ │
40
- │ │ Product URL │───▶│ WIP File │───▶│ Hash + Signers │ │
41
- │ │ (Network) │ │ (Immutable)│ │ (Verified) │ │
42
- │ └─────────────┘ └─────────────┘ └─────────────────┘ │
43
- │ │ │ │
44
- │ ▼ ▼ │
45
- │ User views via URL User verifies integrity │
46
- │ and trusted content and signers │
47
- └─────────────────────────────────────────────────────────────┘
48
- ```
49
-
50
- **Core Workflow:**
51
-
52
- 1. **Generate WIP** - Create a WIP file describing the product/service with detailed specifications
53
- 2. **Sign WIP** - Sign with the seller's account to establish authenticity
54
- 3. **Deploy to Network** - Upload the signed WIP file to a network location
55
- 4. **Create Service** - Use the WIP URL and hash as the product details in the Service object
56
- 5. **Buyer Verification** - Buyers can view the content via URL and verify hash and signers
57
-
58
- **Core Features:**
59
- - ✅ Generate WIP with Markdown text and images
60
- - ✅ Sign WIP to establish seller identity
61
- - ✅ Verify hash integrity and signature authenticity
62
- - ✅ Convert to HTML for display
63
-
64
- **Important Notes:**
65
- - ⚠️ **Hash Immutability** - Once a WIP is deployed and its hash is recorded on-chain, the content cannot be changed without changing the hash
66
- - ⚠️ **Signature Trust** - Only signatures from trusted accounts should be considered valid
67
- - ⚠️ **URL Accessibility** - The WIP file must remain accessible at the specified URL
68
-
69
- **→ [View WIP Detailed Documentation →](../WIP.md)**
70
-
71
- ---
72
-
73
- ### 4.2 Allocation (Automatic Fund Distribution ⚖️)
74
-
75
- **Why do we need Allocation?**
76
-
77
- Transactions require profit sharing. Allocation allows you to preset fund distribution rules and automatically distribute to multiple recipients.
78
-
79
- **Core Concepts:**
80
- - 👥 **Multiple Recipients** - Support distribution to multiple addresses
81
- - 📊 **Ratio or Fixed Amount** - Distribute by ratio or fixed amount
82
- - 🎯 **Auto-execution** - Automatically distribute when triggered
83
-
84
- **Core Features:**
85
- - ✅ Add/remove recipients
86
- - ✅ Set ratio or amount
87
- - ✅ Set Guard verification
88
- - ✅ Bind to Service or other objects
89
-
90
- **→ [View Allocation Detailed Documentation →](allocation.md)**
91
-
92
- ---
93
-
94
- ### 4.3 Service + Order (Service Sales and Orders 🛒📋)
95
-
96
- **Why do we need Service and Order?**
97
-
98
- These are the core transaction components in WoWok! Service is what is sold, and Order is the purchase order.
99
-
100
- **Core Concepts:**
101
- - 🛒 **Service** - Service marketplace, publish products or services
102
- - 📋 **Order** - Order management, handle purchase process
103
- - 💰 **Price** - Pricing for services
104
- - 🔗 **Binding Components** - Can bind Machine, Progress, Allocation, Guard, and more
105
-
106
- **Core Features:**
107
- - ✅ Create Service (publish product)
108
- - ✅ Create Order (purchase product)
109
- - ✅ Manage order status
110
- - ✅ Bind various components
111
-
112
- **Important Notes:**
113
- - ⚠️ Service can bind components such as Machine, Guard, Allocation, Contact, Treasury, Reward, and **WIP**!
114
-
115
- **Integration with WIP:**
116
- - The Service object can store the WIP URL and hash as product details
117
- - Buyers can verify the WIP file to ensure the product matches the promised description
118
-
119
- **→ [View Service Detailed Documentation →](service.md)**
120
- **→ [View Order Detailed Documentation →](order.md)**
121
-
122
- ---
123
-
124
- ### 4.4 Arbitration (Dispute Resolution ⚖️)
125
-
126
- **Why do we need Arbitration?**
127
-
128
- Transactions may have disputes. Arbitration provides a fair dispute resolution mechanism.
129
-
130
- **Core Concepts:**
131
- - 👨‍⚖️ **Arbitrator** - Neutral third party
132
- - 💵 **Compensation Ratio** - Compensation ratio for buyer and seller
133
- - ⚖️ **Fair Ruling** - Arbitrators can adjust compensation ratio
134
-
135
- **Core Features:**
136
- - ✅ Create arbitration object
137
- - ✅ Add/remove arbitrators
138
- - ✅ Set compensation ratio
139
- - ✅ Submit and rule on disputes
140
-
141
- **→ [View Arbitration Detailed Documentation →](arbitration.md)**
142
-
143
- ---
144
-
145
- ## 🎓 Practice Exercises
146
-
147
- ### Exercise 1: Create a WIP for Product Description
148
-
149
- Create a WIP file describing a product and sign it with your account
150
-
151
- ```json
152
- {
153
- "type": "generate",
154
- "options": {
155
- "markdown_text": "# Premium Software License\n\n## Product Details\n\n- License Type: Annual Subscription\n- Features: Full access to all modules\n- Support: 24/7 technical support\n- Duration: 12 months\n\n## Terms of Service\n\n1. Non-transferable license\n2. Single user account\n3. Auto-renewal unless cancelled",
156
- "account": "my_seller_account"
157
- },
158
- "outputPath": "./software_license.wip"
159
- }
160
- ```
161
-
162
- After generating, deploy to network and use the URL and hash when creating Service.
163
-
164
- ---
165
-
166
- ### Exercise 2: Create a Service with WIP Product Details
167
-
168
- Create a Service with sales products that include WIP URL and hash as product details. Each product in the sales list can have its own WIP file for detailed description.
169
-
170
- ```json
171
- {
172
- "operation_type": "service",
173
- "data": {
174
- "object": {
175
- "name": "software_license_service"
176
- },
177
- "sales": {
178
- "op": "add",
179
- "sales": [
180
- {
181
- "name": "Premium Software License",
182
- "price": "1000000000",
183
- "stock": "100",
184
- "suspension": false,
185
- "wip": "https://example.com/products/software_license.wip",
186
- "wip_hash": "sha256:abcdef1234567890..."
187
- }
188
- ]
189
- }
190
- }
191
- }
192
- ```
193
-
194
- **Note:** The `wip` and `wip_hash` fields are part of each product in the `sales` array, allowing each product to have its own immutable description file.
195
-
196
- ---
197
-
198
- ### Exercise 3: Create an Allocation with Profit Sharing
199
-
200
- Create a distribution rule that splits profits between two recipients
201
-
202
- ```json
203
- {
204
- "operation_type": "allocation",
205
- "data": {
206
- "object": {
207
- "name": "profit_sharing"
208
- },
209
- "allocators": {
210
- "description": "Profit sharing between two partners",
211
- "threshold": "0",
212
- "allocators": [
213
- {
214
- "guard": "simple_guard",
215
- "sharing": [
216
- {
217
- "who": {
218
- "Entity": {
219
- "name_or_address": "partner1_address"
220
- }
221
- },
222
- "sharing": "5000",
223
- "mode": "Rate"
224
- },
225
- {
226
- "who": {
227
- "Entity": {
228
- "name_or_address": "partner2_address"
229
- }
230
- },
231
- "sharing": "5000",
232
- "mode": "Rate"
233
- }
234
- ]
235
- }
236
- ]
237
- },
238
- "coin": {
239
- "balance": "0"
240
- },
241
- "payment_info": {
242
- "remark": "Profit sharing payment",
243
- "index": "0"
244
- }
245
- }
246
- }
247
- ```
248
-
249
- ---
250
-
251
- ## 🏆 Stage Checklist
252
-
253
- Before moving to the next stage, please confirm that you have:
254
-
255
- - [ ] Understood the relationship between WIP and Service
256
- - [ ] Created a WIP file for product/service description
257
- - [ ] Signed a WIP file to establish authenticity
258
- - [ ] Understood how to use WIP URL and hash as product details
259
- - [ ] Understood the relationship between Service and Order
260
- - [ ] Created at least one Service
261
- - [ ] Created at least one Order
262
- - [ ] Understood Allocation's profit-sharing mechanism
263
- - [ ] Created at least one Allocation
264
- - [ ] Understood the role of Arbitration
265
- - [ ] Know how to combine these components
266
-
267
- ---
268
-
269
- ## 🎉 Congratulations!
270
-
271
- You have completed Stage 4! Now you have mastered WoWok's transaction mechanisms and are ready to move on to the next stage to learn about business components!
272
-
273
- **[→ Go to Stage 5: Business Components 🏪 →](stage-05-business.md)**
274
-
275
- ---
276
-
277
- **[← Return to Main Directory](../README.md)**