@wowok/skills 1.2.4 → 1.2.5
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.
- package/README.md +34 -16
- package/dist/cli.js +6 -2
- package/dist/cli.js.map +1 -1
- package/dist/skills.d.ts +32 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +63 -0
- package/dist/skills.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/examples/Insurance/Insurance.md +543 -475
- package/examples/MyShop/MyShop.md +865 -746
- package/examples/MyShop_Advanced/MyShop_Advanced.md +1520 -1376
- package/examples/ThreeBody_Signature/ThreeBody_Signature.md +891 -651
- package/examples/Travel/Travel.md +952 -848
- package/package.json +2 -2
- package/scripts/install.js +3 -17
- package/wowok-arbitrator/SKILL.md +18 -57
- package/wowok-auditor/SKILL.md +16 -12
- package/wowok-distill/SKILL.md +237 -0
- package/wowok-guard/SKILL.md +40 -354
- package/wowok-machine/SKILL.md +21 -127
- package/wowok-messenger/SKILL.md +14 -59
- package/wowok-onboard/SKILL.md +42 -12
- package/wowok-order/SKILL.md +20 -169
- package/wowok-output/SKILL.md +0 -10
- package/wowok-planner/SKILL.md +28 -9
- package/wowok-provider/SKILL.md +72 -32
- package/wowok-safety/SKILL.md +8 -80
- package/wowok-scenario/SKILL.md +63 -98
- package/wowok-tools/SKILL.md +68 -107
- package/references/glossary.ts +0 -297
- package/references/guard-scenario-ledger.md +0 -353
- package/references/guard-template-library.md +0 -481
- package/references/machine-design-reference.md +0 -398
- package/references/machine-scenario-ledger.md +0 -227
- package/references/machine-template-library.md +0 -522
- package/references/merchant-scenario-coordination.md +0 -383
- package/references/object-collaboration.md +0 -362
- package/references/onchain-constants.md +0 -81
- package/wowok-arbitrator/APPENDIX.md +0 -545
- package/wowok-auditor/APPENDIX.md +0 -487
- package/wowok-guard/APPENDIX.md +0 -430
- package/wowok-machine/APPENDIX.md +0 -407
- package/wowok-messenger/APPENDIX.md +0 -550
- package/wowok-onboard/APPENDIX.md +0 -502
- package/wowok-order/APPENDIX.md +0 -777
- package/wowok-output/APPENDIX.md +0 -575
- package/wowok-planner/APPENDIX.md +0 -726
- package/wowok-provider/APPENDIX.md +0 -455
- package/wowok-safety/APPENDIX.md +0 -565
- package/wowok-scenario/APPENDIX.md +0 -97
- package/wowok-scenario/MODE-DETAILS.md +0 -275
- package/wowok-tools/APPENDIX.md +0 -394
|
@@ -11,6 +11,8 @@ A complete e-commerce example demonstrating how to build an online store using W
|
|
|
11
11
|
- **Execution order**: Part 1 (Merchant Setup, Steps 1–7) → Part 2 (Customer Flow, Steps 1–9). Run all build steps in sequence before testing any customer flow. Do not skip steps — each depends on objects created by prior steps.
|
|
12
12
|
- **Prerequisites**: `myshop_merchant` with sufficient WOW for gas and order operations. All on-chain operations require `env.confirmed: true`.
|
|
13
13
|
|
|
14
|
+
> **💡 Call Format**: All WoWok operations go through a single unified `wowok` tool. The AI calls `wowok({ tool: "<sub-tool>", data: {<params>} })`. If parameters don't match the schema, the response includes the correct schema for self-correction. See [Response Format](../../docs/response-format.md) for details.
|
|
15
|
+
|
|
14
16
|
---
|
|
15
17
|
|
|
16
18
|
## Core Requirements & Features
|
|
@@ -104,9 +106,12 @@ Before starting, ensure you have:
|
|
|
104
106
|
|
|
105
107
|
```json
|
|
106
108
|
{
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
"
|
|
109
|
+
"tool": "account_operation",
|
|
110
|
+
"data": {
|
|
111
|
+
"gen": {
|
|
112
|
+
"name": "myshop_merchant",
|
|
113
|
+
"replaceExistName": true
|
|
114
|
+
}
|
|
110
115
|
}
|
|
111
116
|
}
|
|
112
117
|
```
|
|
@@ -117,11 +122,14 @@ Before starting, ensure you have:
|
|
|
117
122
|
|
|
118
123
|
```json
|
|
119
124
|
{
|
|
120
|
-
"
|
|
121
|
-
|
|
122
|
-
"
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
"tool": "account_operation",
|
|
126
|
+
"data": {
|
|
127
|
+
"transfer": {
|
|
128
|
+
"name_or_address_to": "myshop_merchant",
|
|
129
|
+
"amount": 1000000000,
|
|
130
|
+
"network": "mainnet",
|
|
131
|
+
"confirmed": true
|
|
132
|
+
}
|
|
125
133
|
}
|
|
126
134
|
}
|
|
127
135
|
```
|
|
@@ -136,20 +144,23 @@ First, create a Permission object to manage access control for your store operat
|
|
|
136
144
|
|
|
137
145
|
```json
|
|
138
146
|
{
|
|
139
|
-
"
|
|
147
|
+
"tool": "onchain_operations",
|
|
140
148
|
"data": {
|
|
141
|
-
"
|
|
142
|
-
|
|
143
|
-
"
|
|
144
|
-
|
|
145
|
-
|
|
149
|
+
"operation_type": "permission",
|
|
150
|
+
"data": {
|
|
151
|
+
"object": {
|
|
152
|
+
"name": "myshop_permission_v2",
|
|
153
|
+
"tags": ["ecommerce", "toys", "shop"],
|
|
154
|
+
"onChain": false,
|
|
155
|
+
"replaceExistName": true
|
|
156
|
+
},
|
|
157
|
+
"description": "Permission management for MyShop toy store"
|
|
146
158
|
},
|
|
147
|
-
"
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"confirmed": true
|
|
159
|
+
"env": {
|
|
160
|
+
"account": "myshop_merchant",
|
|
161
|
+
"network": "mainnet",
|
|
162
|
+
"confirmed": true
|
|
163
|
+
}
|
|
153
164
|
}
|
|
154
165
|
}
|
|
155
166
|
```
|
|
@@ -166,116 +177,119 @@ Create a Machine to define the order processing workflow. This includes nodes fo
|
|
|
166
177
|
|
|
167
178
|
```json
|
|
168
179
|
{
|
|
169
|
-
"
|
|
180
|
+
"tool": "onchain_operations",
|
|
170
181
|
"data": {
|
|
171
|
-
"
|
|
172
|
-
|
|
173
|
-
"
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
"
|
|
179
|
-
"
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
182
|
+
"operation_type": "machine",
|
|
183
|
+
"data": {
|
|
184
|
+
"object": {
|
|
185
|
+
"name": "myshop_machine_v2",
|
|
186
|
+
"permission": "myshop_permission_v2",
|
|
187
|
+
"replaceExistName": true
|
|
188
|
+
},
|
|
189
|
+
"description": "Order processing workflow for MyShop toy store",
|
|
190
|
+
"node": {
|
|
191
|
+
"op": "add",
|
|
192
|
+
"nodes": [
|
|
193
|
+
{
|
|
194
|
+
"name": "Cancelled",
|
|
195
|
+
"pairs": [
|
|
196
|
+
{
|
|
197
|
+
"prev_node": "",
|
|
198
|
+
"threshold": 0,
|
|
199
|
+
"forwards": [
|
|
200
|
+
{
|
|
201
|
+
"name": "Cancel Order",
|
|
202
|
+
"weight": 1,
|
|
203
|
+
"namedOperator": ""
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"prev_node": "Order Confirmation",
|
|
209
|
+
"threshold": 1,
|
|
210
|
+
"forwards": [
|
|
211
|
+
{
|
|
212
|
+
"name": "Cancel Order",
|
|
213
|
+
"weight": 1,
|
|
214
|
+
"namedOperator": ""
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "Completed",
|
|
222
|
+
"pairs": [
|
|
223
|
+
{
|
|
224
|
+
"prev_node": "In Transit",
|
|
225
|
+
"threshold": 1,
|
|
226
|
+
"forwards": [
|
|
227
|
+
{
|
|
228
|
+
"name": "Complete Order",
|
|
229
|
+
"weight": 1,
|
|
230
|
+
"namedOperator": ""
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"name": "In Transit",
|
|
238
|
+
"pairs": [
|
|
239
|
+
{
|
|
240
|
+
"prev_node": "Shipping",
|
|
241
|
+
"threshold": 1,
|
|
242
|
+
"forwards": [
|
|
243
|
+
{
|
|
244
|
+
"name": "Confirm Delivery",
|
|
245
|
+
"weight": 1,
|
|
246
|
+
"permissionIndex": 1002
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
]
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"name": "Order Confirmation",
|
|
254
|
+
"pairs": [
|
|
255
|
+
{
|
|
256
|
+
"prev_node": "",
|
|
257
|
+
"threshold": 0,
|
|
258
|
+
"forwards": [
|
|
259
|
+
{
|
|
260
|
+
"name": "Confirm Order",
|
|
261
|
+
"weight": 1,
|
|
262
|
+
"permissionIndex": 1000
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"name": "Shipping",
|
|
270
|
+
"pairs": [
|
|
271
|
+
{
|
|
272
|
+
"prev_node": "Order Confirmation",
|
|
273
|
+
"threshold": 1,
|
|
274
|
+
"forwards": [
|
|
275
|
+
{
|
|
276
|
+
"name": "Ship Goods",
|
|
277
|
+
"weight": 1,
|
|
278
|
+
"permissionIndex": 1001
|
|
279
|
+
}
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
"publish": true
|
|
272
287
|
},
|
|
273
|
-
"
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
"confirmed": true
|
|
288
|
+
"env": {
|
|
289
|
+
"account": "myshop_merchant",
|
|
290
|
+
"network": "mainnet",
|
|
291
|
+
"confirmed": true
|
|
292
|
+
}
|
|
279
293
|
}
|
|
280
294
|
}
|
|
281
295
|
```
|
|
@@ -403,9 +417,12 @@ Create a Contact object to enable encrypted communication between customers and
|
|
|
403
417
|
|
|
404
418
|
```json
|
|
405
419
|
{
|
|
406
|
-
"
|
|
407
|
-
|
|
408
|
-
"
|
|
420
|
+
"tool": "messenger_operation",
|
|
421
|
+
"data": {
|
|
422
|
+
"messenger": {
|
|
423
|
+
"m": "myshop_merchant_messenger",
|
|
424
|
+
"name_or_account": "myshop_merchant"
|
|
425
|
+
}
|
|
409
426
|
}
|
|
410
427
|
}
|
|
411
428
|
```
|
|
@@ -416,28 +433,31 @@ Create a Contact object to enable encrypted communication between customers and
|
|
|
416
433
|
|
|
417
434
|
```json
|
|
418
435
|
{
|
|
419
|
-
"
|
|
436
|
+
"tool": "onchain_operations",
|
|
420
437
|
"data": {
|
|
421
|
-
"
|
|
422
|
-
|
|
423
|
-
"
|
|
424
|
-
|
|
438
|
+
"operation_type": "contact",
|
|
439
|
+
"data": {
|
|
440
|
+
"object": {
|
|
441
|
+
"name": "myshop_aftersales_contact_v2",
|
|
442
|
+
"permission": "myshop_permission_v2",
|
|
443
|
+
"replaceExistName": true
|
|
444
|
+
},
|
|
445
|
+
"description": "MyShop after-sales support contact - we're here to help with orders, shipping, and returns",
|
|
446
|
+
"ims": {
|
|
447
|
+
"op": "add",
|
|
448
|
+
"im": [
|
|
449
|
+
{
|
|
450
|
+
"at": "myshop_merchant",
|
|
451
|
+
"description": "Primary after-sales support representative"
|
|
452
|
+
}
|
|
453
|
+
]
|
|
454
|
+
}
|
|
425
455
|
},
|
|
426
|
-
"
|
|
427
|
-
|
|
428
|
-
"
|
|
429
|
-
"
|
|
430
|
-
{
|
|
431
|
-
"at": "myshop_merchant",
|
|
432
|
-
"description": "Primary after-sales support representative"
|
|
433
|
-
}
|
|
434
|
-
]
|
|
456
|
+
"env": {
|
|
457
|
+
"account": "myshop_merchant",
|
|
458
|
+
"network": "mainnet",
|
|
459
|
+
"confirmed": true
|
|
435
460
|
}
|
|
436
|
-
},
|
|
437
|
-
"env": {
|
|
438
|
-
"account": "myshop_merchant",
|
|
439
|
-
"network": "mainnet",
|
|
440
|
-
"confirmed": true
|
|
441
461
|
}
|
|
442
462
|
}
|
|
443
463
|
```
|
|
@@ -458,103 +478,106 @@ Create a Guard that validates the order's Progress has reached the "Completed" n
|
|
|
458
478
|
|
|
459
479
|
```json
|
|
460
480
|
{
|
|
461
|
-
"
|
|
481
|
+
"tool": "onchain_operations",
|
|
462
482
|
"data": {
|
|
463
|
-
"
|
|
464
|
-
|
|
465
|
-
"
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
"table": [
|
|
471
|
-
{
|
|
472
|
-
"identifier": 0,
|
|
473
|
-
"b_submission": true,
|
|
474
|
-
"value_type": "Address",
|
|
475
|
-
"object_type": "Order",
|
|
476
|
-
"name": "order_address (Order object submitted at runtime)"
|
|
477
|
-
},
|
|
478
|
-
{
|
|
479
|
-
"identifier": 1,
|
|
480
|
-
"b_submission": false,
|
|
481
|
-
"value_type": "String",
|
|
482
|
-
"value": "Completed",
|
|
483
|
-
"name": "Expected Completed node name (case-sensitive)"
|
|
484
|
-
},
|
|
485
|
-
{
|
|
486
|
-
"identifier": 2,
|
|
487
|
-
"b_submission": false,
|
|
488
|
-
"value_type": "Address",
|
|
489
|
-
"value": "myshop_merchant",
|
|
490
|
-
"name": "Authorized merchant address (prevents fund theft by unauthorized callers)"
|
|
483
|
+
"operation_type": "guard",
|
|
484
|
+
"data": {
|
|
485
|
+
"namedNew": {
|
|
486
|
+
"name": "myshop_withdraw_guard_v2",
|
|
487
|
+
"tags": ["order", "completed", "withdraw", "signer-bound"],
|
|
488
|
+
"onChain": false,
|
|
489
|
+
"replaceExistName": true
|
|
491
490
|
},
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
"b_submission": false,
|
|
495
|
-
"value_type": "Address",
|
|
496
|
-
"value": "myshop_service_v2",
|
|
497
|
-
"name": "Expected service address (prevents cross-service fund theft)"
|
|
498
|
-
}
|
|
499
|
-
],
|
|
500
|
-
"root": {
|
|
501
|
-
"type": "logic_and",
|
|
502
|
-
"nodes": [
|
|
491
|
+
"description": "Verify order progress is at Completed node for merchant withdrawal. RISK ELIMINATION: Three-fold verification - (1) order at Completed node, (2) signer is myshop_merchant (prevents fund theft), (3) order belongs to myshop_service_v2 (prevents cross-service theft).",
|
|
492
|
+
"table": [
|
|
503
493
|
{
|
|
504
|
-
"
|
|
505
|
-
"
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
"object": {
|
|
510
|
-
"identifier": 0,
|
|
511
|
-
"convert_witness": "OrderProgress"
|
|
512
|
-
},
|
|
513
|
-
"parameters": []
|
|
514
|
-
},
|
|
515
|
-
{
|
|
516
|
-
"type": "identifier",
|
|
517
|
-
"identifier": 1
|
|
518
|
-
}
|
|
519
|
-
]
|
|
494
|
+
"identifier": 0,
|
|
495
|
+
"b_submission": true,
|
|
496
|
+
"value_type": "Address",
|
|
497
|
+
"object_type": "Order",
|
|
498
|
+
"name": "order_address (Order object submitted at runtime)"
|
|
520
499
|
},
|
|
521
500
|
{
|
|
522
|
-
"
|
|
523
|
-
"
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
"type": "identifier",
|
|
530
|
-
"identifier": 2
|
|
531
|
-
}
|
|
532
|
-
]
|
|
501
|
+
"identifier": 1,
|
|
502
|
+
"b_submission": false,
|
|
503
|
+
"value_type": "String",
|
|
504
|
+
"value": "Completed",
|
|
505
|
+
"name": "Expected Completed node name (case-sensitive)"
|
|
533
506
|
},
|
|
534
507
|
{
|
|
535
|
-
"
|
|
536
|
-
"
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
"identifier": 3
|
|
548
|
-
}
|
|
549
|
-
]
|
|
508
|
+
"identifier": 2,
|
|
509
|
+
"b_submission": false,
|
|
510
|
+
"value_type": "Address",
|
|
511
|
+
"value": "myshop_merchant",
|
|
512
|
+
"name": "Authorized merchant address (prevents fund theft by unauthorized callers)"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"identifier": 3,
|
|
516
|
+
"b_submission": false,
|
|
517
|
+
"value_type": "Address",
|
|
518
|
+
"value": "myshop_service_v2",
|
|
519
|
+
"name": "Expected service address (prevents cross-service fund theft)"
|
|
550
520
|
}
|
|
551
|
-
]
|
|
521
|
+
],
|
|
522
|
+
"root": {
|
|
523
|
+
"type": "logic_and",
|
|
524
|
+
"nodes": [
|
|
525
|
+
{
|
|
526
|
+
"type": "logic_equal",
|
|
527
|
+
"nodes": [
|
|
528
|
+
{
|
|
529
|
+
"type": "query",
|
|
530
|
+
"query": "progress.current",
|
|
531
|
+
"object": {
|
|
532
|
+
"identifier": 0,
|
|
533
|
+
"convert_witness": "OrderProgress"
|
|
534
|
+
},
|
|
535
|
+
"parameters": []
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"type": "identifier",
|
|
539
|
+
"identifier": 1
|
|
540
|
+
}
|
|
541
|
+
]
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
"type": "logic_equal",
|
|
545
|
+
"nodes": [
|
|
546
|
+
{
|
|
547
|
+
"type": "context",
|
|
548
|
+
"context": "Signer"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"type": "identifier",
|
|
552
|
+
"identifier": 2
|
|
553
|
+
}
|
|
554
|
+
]
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
"type": "logic_equal",
|
|
558
|
+
"nodes": [
|
|
559
|
+
{
|
|
560
|
+
"type": "query",
|
|
561
|
+
"query": "order.service",
|
|
562
|
+
"object": {
|
|
563
|
+
"identifier": 0
|
|
564
|
+
},
|
|
565
|
+
"parameters": []
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"type": "identifier",
|
|
569
|
+
"identifier": 3
|
|
570
|
+
}
|
|
571
|
+
]
|
|
572
|
+
}
|
|
573
|
+
]
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
"env": {
|
|
577
|
+
"account": "myshop_merchant",
|
|
578
|
+
"network": "mainnet",
|
|
579
|
+
"confirmed": true
|
|
552
580
|
}
|
|
553
|
-
},
|
|
554
|
-
"env": {
|
|
555
|
-
"account": "myshop_merchant",
|
|
556
|
-
"network": "mainnet",
|
|
557
|
-
"confirmed": true
|
|
558
581
|
}
|
|
559
582
|
}
|
|
560
583
|
```
|
|
@@ -581,100 +604,103 @@ Create a Guard for customer refunds when order is cancelled.
|
|
|
581
604
|
|
|
582
605
|
```json
|
|
583
606
|
{
|
|
584
|
-
"
|
|
607
|
+
"tool": "onchain_operations",
|
|
585
608
|
"data": {
|
|
586
|
-
"
|
|
587
|
-
|
|
588
|
-
"
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
"table": [
|
|
594
|
-
{
|
|
595
|
-
"identifier": 0,
|
|
596
|
-
"b_submission": true,
|
|
597
|
-
"value_type": "Address",
|
|
598
|
-
"object_type": "Order",
|
|
599
|
-
"name": "order_address (Order object submitted at runtime)"
|
|
600
|
-
},
|
|
601
|
-
{
|
|
602
|
-
"identifier": 1,
|
|
603
|
-
"b_submission": false,
|
|
604
|
-
"value_type": "String",
|
|
605
|
-
"value": "Cancelled",
|
|
606
|
-
"name": "Expected Cancelled node name (case-sensitive)"
|
|
609
|
+
"operation_type": "guard",
|
|
610
|
+
"data": {
|
|
611
|
+
"namedNew": {
|
|
612
|
+
"name": "myshop_refund_guard_v2",
|
|
613
|
+
"tags": ["order", "cancelled", "refund", "signer-bound"],
|
|
614
|
+
"onChain": false,
|
|
615
|
+
"replaceExistName": true
|
|
607
616
|
},
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
"b_submission": false,
|
|
611
|
-
"value_type": "Address",
|
|
612
|
-
"value": "myshop_service_v2",
|
|
613
|
-
"name": "Expected service address (prevents cross-service fund theft)"
|
|
614
|
-
}
|
|
615
|
-
],
|
|
616
|
-
"root": {
|
|
617
|
-
"type": "logic_and",
|
|
618
|
-
"nodes": [
|
|
617
|
+
"description": "Verify order progress is at Cancelled node for customer refund. RISK ELIMINATION: Three-fold verification - (1) order at Cancelled node, (2) signer is order.owner (dynamic query, prevents fund theft - only order owner can trigger their own refund), (3) order belongs to myshop_service_v2 (prevents cross-service theft).",
|
|
618
|
+
"table": [
|
|
619
619
|
{
|
|
620
|
-
"
|
|
621
|
-
"
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
"object": {
|
|
626
|
-
"identifier": 0,
|
|
627
|
-
"convert_witness": "OrderProgress"
|
|
628
|
-
},
|
|
629
|
-
"parameters": []
|
|
630
|
-
},
|
|
631
|
-
{
|
|
632
|
-
"type": "identifier",
|
|
633
|
-
"identifier": 1
|
|
634
|
-
}
|
|
635
|
-
]
|
|
620
|
+
"identifier": 0,
|
|
621
|
+
"b_submission": true,
|
|
622
|
+
"value_type": "Address",
|
|
623
|
+
"object_type": "Order",
|
|
624
|
+
"name": "order_address (Order object submitted at runtime)"
|
|
636
625
|
},
|
|
637
626
|
{
|
|
638
|
-
"
|
|
639
|
-
"
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
},
|
|
644
|
-
{
|
|
645
|
-
"type": "query",
|
|
646
|
-
"query": "order.owner",
|
|
647
|
-
"object": {
|
|
648
|
-
"identifier": 0
|
|
649
|
-
},
|
|
650
|
-
"parameters": []
|
|
651
|
-
}
|
|
652
|
-
]
|
|
627
|
+
"identifier": 1,
|
|
628
|
+
"b_submission": false,
|
|
629
|
+
"value_type": "String",
|
|
630
|
+
"value": "Cancelled",
|
|
631
|
+
"name": "Expected Cancelled node name (case-sensitive)"
|
|
653
632
|
},
|
|
654
633
|
{
|
|
655
|
-
"
|
|
656
|
-
"
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
"object": {
|
|
661
|
-
"identifier": 0
|
|
662
|
-
},
|
|
663
|
-
"parameters": []
|
|
664
|
-
},
|
|
665
|
-
{
|
|
666
|
-
"type": "identifier",
|
|
667
|
-
"identifier": 2
|
|
668
|
-
}
|
|
669
|
-
]
|
|
634
|
+
"identifier": 2,
|
|
635
|
+
"b_submission": false,
|
|
636
|
+
"value_type": "Address",
|
|
637
|
+
"value": "myshop_service_v2",
|
|
638
|
+
"name": "Expected service address (prevents cross-service fund theft)"
|
|
670
639
|
}
|
|
671
|
-
]
|
|
640
|
+
],
|
|
641
|
+
"root": {
|
|
642
|
+
"type": "logic_and",
|
|
643
|
+
"nodes": [
|
|
644
|
+
{
|
|
645
|
+
"type": "logic_equal",
|
|
646
|
+
"nodes": [
|
|
647
|
+
{
|
|
648
|
+
"type": "query",
|
|
649
|
+
"query": "progress.current",
|
|
650
|
+
"object": {
|
|
651
|
+
"identifier": 0,
|
|
652
|
+
"convert_witness": "OrderProgress"
|
|
653
|
+
},
|
|
654
|
+
"parameters": []
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
"type": "identifier",
|
|
658
|
+
"identifier": 1
|
|
659
|
+
}
|
|
660
|
+
]
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
"type": "logic_equal",
|
|
664
|
+
"nodes": [
|
|
665
|
+
{
|
|
666
|
+
"type": "context",
|
|
667
|
+
"context": "Signer"
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"type": "query",
|
|
671
|
+
"query": "order.owner",
|
|
672
|
+
"object": {
|
|
673
|
+
"identifier": 0
|
|
674
|
+
},
|
|
675
|
+
"parameters": []
|
|
676
|
+
}
|
|
677
|
+
]
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"type": "logic_equal",
|
|
681
|
+
"nodes": [
|
|
682
|
+
{
|
|
683
|
+
"type": "query",
|
|
684
|
+
"query": "order.service",
|
|
685
|
+
"object": {
|
|
686
|
+
"identifier": 0
|
|
687
|
+
},
|
|
688
|
+
"parameters": []
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
"type": "identifier",
|
|
692
|
+
"identifier": 2
|
|
693
|
+
}
|
|
694
|
+
]
|
|
695
|
+
}
|
|
696
|
+
]
|
|
697
|
+
}
|
|
698
|
+
},
|
|
699
|
+
"env": {
|
|
700
|
+
"account": "myshop_merchant",
|
|
701
|
+
"network": "mainnet",
|
|
702
|
+
"confirmed": true
|
|
672
703
|
}
|
|
673
|
-
},
|
|
674
|
-
"env": {
|
|
675
|
-
"account": "myshop_merchant",
|
|
676
|
-
"network": "mainnet",
|
|
677
|
-
"confirmed": true
|
|
678
704
|
}
|
|
679
705
|
}
|
|
680
706
|
```
|
|
@@ -730,81 +756,84 @@ The `order_allocators` configuration defines how order payments are distributed:
|
|
|
730
756
|
|
|
731
757
|
```json
|
|
732
758
|
{
|
|
733
|
-
"
|
|
759
|
+
"tool": "onchain_operations",
|
|
734
760
|
"data": {
|
|
735
|
-
"
|
|
736
|
-
|
|
737
|
-
"
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
"
|
|
748
|
-
"
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
"sales":
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
761
|
+
"operation_type": "service",
|
|
762
|
+
"data": {
|
|
763
|
+
"object": {
|
|
764
|
+
"name": "myshop_service_v2",
|
|
765
|
+
"type_parameter": "0x2::wow::WOW",
|
|
766
|
+
"permission": "myshop_permission_v2",
|
|
767
|
+
"tags": ["ecommerce", "toys", "store"],
|
|
768
|
+
"onChain": false,
|
|
769
|
+
"replaceExistName": true
|
|
770
|
+
},
|
|
771
|
+
"description": "MyShop - Top quality toys for children",
|
|
772
|
+
"location": "Online Store",
|
|
773
|
+
"machine": "myshop_machine_v2",
|
|
774
|
+
"order_allocators": {
|
|
775
|
+
"description": "Order revenue allocation - merchant withdraw after completion",
|
|
776
|
+
"threshold": 0,
|
|
777
|
+
"allocators": [
|
|
778
|
+
{
|
|
779
|
+
"guard": "myshop_withdraw_guard_v2",
|
|
780
|
+
"sharing": [
|
|
781
|
+
{
|
|
782
|
+
"who": { "Signer": "signer" },
|
|
783
|
+
"sharing": 10000,
|
|
784
|
+
"mode": "Rate"
|
|
785
|
+
}
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
"guard": "myshop_refund_guard_v2",
|
|
790
|
+
"sharing": [
|
|
791
|
+
{
|
|
792
|
+
"who": { "GuardIdentifier": 0 },
|
|
793
|
+
"sharing": 10000,
|
|
794
|
+
"mode": "Rate"
|
|
795
|
+
}
|
|
796
|
+
]
|
|
797
|
+
}
|
|
798
|
+
]
|
|
799
|
+
},
|
|
800
|
+
"sales": {
|
|
801
|
+
"op": "add",
|
|
802
|
+
"sales": [
|
|
803
|
+
{
|
|
804
|
+
"name": "Play Purse Set 35PCS",
|
|
805
|
+
"price": 50000000,
|
|
806
|
+
"stock": 100,
|
|
807
|
+
"suspension": false,
|
|
808
|
+
"wip": "https://wowok.net/test/three_body.wip",
|
|
809
|
+
"wip_hash": ""
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
"name": "Little Girls Purse with Accessories",
|
|
813
|
+
"price": 50000000,
|
|
814
|
+
"stock": 50,
|
|
815
|
+
"suspension": false,
|
|
816
|
+
"wip": "https://wowok.net/test/three_body.wip",
|
|
817
|
+
"wip_hash": ""
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"name": "Tree House Building Set",
|
|
821
|
+
"price": 30000000,
|
|
822
|
+
"stock": 75,
|
|
823
|
+
"suspension": false,
|
|
824
|
+
"wip": "https://wowok.net/test/three_body.wip",
|
|
825
|
+
"wip_hash": ""
|
|
826
|
+
}
|
|
827
|
+
]
|
|
828
|
+
},
|
|
829
|
+
"um": "myshop_aftersales_contact_v2",
|
|
830
|
+
"publish": true
|
|
800
831
|
},
|
|
801
|
-
"
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
"network": "mainnet",
|
|
807
|
-
"confirmed": true
|
|
832
|
+
"env": {
|
|
833
|
+
"account": "myshop_merchant",
|
|
834
|
+
"network": "mainnet",
|
|
835
|
+
"confirmed": true
|
|
836
|
+
}
|
|
808
837
|
}
|
|
809
838
|
}
|
|
810
839
|
```
|
|
@@ -824,27 +853,30 @@ To offer promotional pricing, update product prices using the `sales` operation
|
|
|
824
853
|
|
|
825
854
|
```json
|
|
826
855
|
{
|
|
827
|
-
"
|
|
856
|
+
"tool": "onchain_operations",
|
|
828
857
|
"data": {
|
|
829
|
-
"
|
|
830
|
-
"
|
|
831
|
-
"
|
|
832
|
-
"sales":
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
858
|
+
"operation_type": "service",
|
|
859
|
+
"data": {
|
|
860
|
+
"object": "myshop_service_v2",
|
|
861
|
+
"sales": {
|
|
862
|
+
"op": "set",
|
|
863
|
+
"sales": [
|
|
864
|
+
{
|
|
865
|
+
"name": "Play Purse Set 35PCS",
|
|
866
|
+
"price": 40000000,
|
|
867
|
+
"stock": 100,
|
|
868
|
+
"suspension": false,
|
|
869
|
+
"wip": "https://wowok.net/test/three_body.wip",
|
|
870
|
+
"wip_hash": ""
|
|
871
|
+
}
|
|
872
|
+
]
|
|
873
|
+
}
|
|
874
|
+
},
|
|
875
|
+
"env": {
|
|
876
|
+
"account": "myshop_merchant",
|
|
877
|
+
"network": "mainnet",
|
|
878
|
+
"confirmed": true
|
|
842
879
|
}
|
|
843
|
-
},
|
|
844
|
-
"env": {
|
|
845
|
-
"account": "myshop_merchant",
|
|
846
|
-
"network": "mainnet",
|
|
847
|
-
"confirmed": true
|
|
848
880
|
}
|
|
849
881
|
}
|
|
850
882
|
```
|
|
@@ -863,9 +895,12 @@ Create a customer account:
|
|
|
863
895
|
|
|
864
896
|
```json
|
|
865
897
|
{
|
|
866
|
-
"
|
|
867
|
-
|
|
868
|
-
"
|
|
898
|
+
"tool": "account_operation",
|
|
899
|
+
"data": {
|
|
900
|
+
"gen": {
|
|
901
|
+
"name": "myshop_customer",
|
|
902
|
+
"replaceExistName": true
|
|
903
|
+
}
|
|
869
904
|
}
|
|
870
905
|
}
|
|
871
906
|
```
|
|
@@ -876,11 +911,14 @@ Create a customer account:
|
|
|
876
911
|
|
|
877
912
|
```json
|
|
878
913
|
{
|
|
879
|
-
"
|
|
880
|
-
|
|
881
|
-
"
|
|
882
|
-
|
|
883
|
-
|
|
914
|
+
"tool": "account_operation",
|
|
915
|
+
"data": {
|
|
916
|
+
"transfer": {
|
|
917
|
+
"name_or_address_to": "myshop_customer",
|
|
918
|
+
"amount": 1000000000,
|
|
919
|
+
"network": "mainnet",
|
|
920
|
+
"confirmed": true
|
|
921
|
+
}
|
|
884
922
|
}
|
|
885
923
|
}
|
|
886
924
|
```
|
|
@@ -897,9 +935,12 @@ Customers can query the Service to see available products.
|
|
|
897
935
|
|
|
898
936
|
```json
|
|
899
937
|
{
|
|
900
|
-
"
|
|
901
|
-
"
|
|
902
|
-
|
|
938
|
+
"tool": "query_toolkit",
|
|
939
|
+
"data": {
|
|
940
|
+
"query_type": "onchain_objects",
|
|
941
|
+
"objects": ["myshop_service_v2"],
|
|
942
|
+
"no_cache": true
|
|
943
|
+
}
|
|
903
944
|
}
|
|
904
945
|
```
|
|
905
946
|
|
|
@@ -915,40 +956,43 @@ Customer creates an order by purchasing products from the Service.
|
|
|
915
956
|
|
|
916
957
|
```json
|
|
917
958
|
{
|
|
918
|
-
"
|
|
959
|
+
"tool": "onchain_operations",
|
|
919
960
|
"data": {
|
|
920
|
-
"
|
|
921
|
-
"
|
|
922
|
-
"
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
961
|
+
"operation_type": "service",
|
|
962
|
+
"data": {
|
|
963
|
+
"object": "myshop_service_v2",
|
|
964
|
+
"order_new": {
|
|
965
|
+
"buy": {
|
|
966
|
+
"items": [
|
|
967
|
+
{
|
|
968
|
+
"name": "Play Purse Set 35PCS",
|
|
969
|
+
"stock": 1,
|
|
970
|
+
"wip_hash": "03c18561efa8faf4d75480eb1f732c4a46ffde95599e92eca06167785fc07a5b"
|
|
971
|
+
}
|
|
972
|
+
],
|
|
973
|
+
"total_pay": {
|
|
974
|
+
"balance": 50000000
|
|
928
975
|
}
|
|
929
|
-
|
|
930
|
-
"
|
|
931
|
-
"
|
|
976
|
+
},
|
|
977
|
+
"namedNewOrder": {
|
|
978
|
+
"name": "myshop_test_order",
|
|
979
|
+
"replaceExistName": true
|
|
980
|
+
},
|
|
981
|
+
"namedNewProgress": {
|
|
982
|
+
"name": "myshop_test_progress",
|
|
983
|
+
"replaceExistName": true
|
|
984
|
+
},
|
|
985
|
+
"namedNewAllocation": {
|
|
986
|
+
"name": "myshop_test_allocation",
|
|
987
|
+
"replaceExistName": true
|
|
932
988
|
}
|
|
933
|
-
},
|
|
934
|
-
"namedNewOrder": {
|
|
935
|
-
"name": "myshop_test_order",
|
|
936
|
-
"replaceExistName": true
|
|
937
|
-
},
|
|
938
|
-
"namedNewProgress": {
|
|
939
|
-
"name": "myshop_test_progress",
|
|
940
|
-
"replaceExistName": true
|
|
941
|
-
},
|
|
942
|
-
"namedNewAllocation": {
|
|
943
|
-
"name": "myshop_test_allocation",
|
|
944
|
-
"replaceExistName": true
|
|
945
989
|
}
|
|
990
|
+
},
|
|
991
|
+
"env": {
|
|
992
|
+
"account": "myshop_customer",
|
|
993
|
+
"network": "mainnet",
|
|
994
|
+
"confirmed": true
|
|
946
995
|
}
|
|
947
|
-
},
|
|
948
|
-
"env": {
|
|
949
|
-
"account": "myshop_customer",
|
|
950
|
-
"network": "mainnet",
|
|
951
|
-
"confirmed": true
|
|
952
996
|
}
|
|
953
997
|
}
|
|
954
998
|
```
|
|
@@ -1003,9 +1047,12 @@ After creating the order, the customer sends their shipping address and contact
|
|
|
1003
1047
|
|
|
1004
1048
|
```json
|
|
1005
1049
|
{
|
|
1006
|
-
"
|
|
1007
|
-
|
|
1008
|
-
"
|
|
1050
|
+
"tool": "messenger_operation",
|
|
1051
|
+
"data": {
|
|
1052
|
+
"messenger": {
|
|
1053
|
+
"m": "customer_messenger",
|
|
1054
|
+
"name_or_account": "myshop_customer"
|
|
1055
|
+
}
|
|
1009
1056
|
}
|
|
1010
1057
|
}
|
|
1011
1058
|
```
|
|
@@ -1016,10 +1063,13 @@ After creating the order, the customer sends their shipping address and contact
|
|
|
1016
1063
|
|
|
1017
1064
|
```json
|
|
1018
1065
|
{
|
|
1019
|
-
"
|
|
1020
|
-
"
|
|
1021
|
-
|
|
1022
|
-
|
|
1066
|
+
"tool": "messenger_operation",
|
|
1067
|
+
"data": {
|
|
1068
|
+
"operation": "send_message",
|
|
1069
|
+
"from": "myshop_customer",
|
|
1070
|
+
"to": "myshop_merchant",
|
|
1071
|
+
"content": "Order Shipping Information:\n\nOrder ID: 0xa6db...3d5\nProduct: Play Purse Set 35PCS\n\nRecipient: Zhang San\nPhone: 138-0000-0000\nAddress: Building 123, Unit 456, Room 789\n Chaoyang District, Beijing\n China, 100000\n\nPlease confirm receipt of this information."
|
|
1072
|
+
}
|
|
1023
1073
|
}
|
|
1024
1074
|
```
|
|
1025
1075
|
|
|
@@ -1033,10 +1083,13 @@ After creating the order, the customer sends their shipping address and contact
|
|
|
1033
1083
|
|
|
1034
1084
|
```json
|
|
1035
1085
|
{
|
|
1036
|
-
"
|
|
1037
|
-
"
|
|
1038
|
-
|
|
1039
|
-
|
|
1086
|
+
"tool": "messenger_operation",
|
|
1087
|
+
"data": {
|
|
1088
|
+
"operation": "send_message",
|
|
1089
|
+
"from": "myshop_merchant",
|
|
1090
|
+
"to": "myshop_customer",
|
|
1091
|
+
"content": "Dear Customer,\n\nWe have received your shipping information:\n- Order ID: 0xa6db...3d5 confirmed\n- Shipping address verified\n- Contact phone: 138-0000-0000\n\nYour order will be processed within 24 hours. We'll send you the tracking number once shipped.\n\nThank you for shopping with MyShop!"
|
|
1092
|
+
}
|
|
1040
1093
|
}
|
|
1041
1094
|
```
|
|
1042
1095
|
|
|
@@ -1046,10 +1099,13 @@ After creating the order, the customer sends their shipping address and contact
|
|
|
1046
1099
|
|
|
1047
1100
|
```json
|
|
1048
1101
|
{
|
|
1049
|
-
"
|
|
1050
|
-
"
|
|
1051
|
-
"
|
|
1052
|
-
"
|
|
1102
|
+
"tool": "messenger_operation",
|
|
1103
|
+
"data": {
|
|
1104
|
+
"operation": "watch_messages",
|
|
1105
|
+
"filter": {
|
|
1106
|
+
"peerAddress": "myshop_merchant",
|
|
1107
|
+
"account": "myshop_customer"
|
|
1108
|
+
}
|
|
1053
1109
|
}
|
|
1054
1110
|
}
|
|
1055
1111
|
```
|
|
@@ -1064,9 +1120,12 @@ Customer can query the order status and progress.
|
|
|
1064
1120
|
|
|
1065
1121
|
```json
|
|
1066
1122
|
{
|
|
1067
|
-
"
|
|
1068
|
-
"
|
|
1069
|
-
|
|
1123
|
+
"tool": "query_toolkit",
|
|
1124
|
+
"data": {
|
|
1125
|
+
"query_type": "onchain_objects",
|
|
1126
|
+
"objects": ["myshop_test_order"],
|
|
1127
|
+
"no_cache": true
|
|
1128
|
+
}
|
|
1070
1129
|
}
|
|
1071
1130
|
```
|
|
1072
1131
|
|
|
@@ -1080,9 +1139,12 @@ Check the current workflow node of the order.
|
|
|
1080
1139
|
|
|
1081
1140
|
```json
|
|
1082
1141
|
{
|
|
1083
|
-
"
|
|
1084
|
-
"
|
|
1085
|
-
|
|
1142
|
+
"tool": "query_toolkit",
|
|
1143
|
+
"data": {
|
|
1144
|
+
"query_type": "onchain_objects",
|
|
1145
|
+
"objects": ["myshop_test_progress"],
|
|
1146
|
+
"no_cache": true
|
|
1147
|
+
}
|
|
1086
1148
|
}
|
|
1087
1149
|
```
|
|
1088
1150
|
|
|
@@ -1098,22 +1160,25 @@ Merchant advances the order from initial state to "Order Confirmation" node.
|
|
|
1098
1160
|
|
|
1099
1161
|
```json
|
|
1100
1162
|
{
|
|
1101
|
-
"
|
|
1163
|
+
"tool": "onchain_operations",
|
|
1102
1164
|
"data": {
|
|
1103
|
-
"
|
|
1104
|
-
"
|
|
1105
|
-
"
|
|
1106
|
-
|
|
1107
|
-
"
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1165
|
+
"operation_type": "progress",
|
|
1166
|
+
"data": {
|
|
1167
|
+
"object": "myshop_test_progress",
|
|
1168
|
+
"operate": {
|
|
1169
|
+
"operation": {
|
|
1170
|
+
"next_node_name": "Order Confirmation",
|
|
1171
|
+
"forward": "Confirm Order"
|
|
1172
|
+
},
|
|
1173
|
+
"hold": false,
|
|
1174
|
+
"message": "Order confirmed by merchant"
|
|
1175
|
+
}
|
|
1176
|
+
},
|
|
1177
|
+
"env": {
|
|
1178
|
+
"account": "myshop_merchant",
|
|
1179
|
+
"network": "mainnet",
|
|
1180
|
+
"confirmed": true
|
|
1111
1181
|
}
|
|
1112
|
-
},
|
|
1113
|
-
"env": {
|
|
1114
|
-
"account": "myshop_merchant",
|
|
1115
|
-
"network": "mainnet",
|
|
1116
|
-
"confirmed": true
|
|
1117
1182
|
}
|
|
1118
1183
|
}
|
|
1119
1184
|
```
|
|
@@ -1128,22 +1193,25 @@ Merchant ships the order and advances from "Order Confirmation" to "Shipping".
|
|
|
1128
1193
|
|
|
1129
1194
|
```json
|
|
1130
1195
|
{
|
|
1131
|
-
"
|
|
1196
|
+
"tool": "onchain_operations",
|
|
1132
1197
|
"data": {
|
|
1133
|
-
"
|
|
1134
|
-
"
|
|
1135
|
-
"
|
|
1136
|
-
|
|
1137
|
-
"
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1198
|
+
"operation_type": "progress",
|
|
1199
|
+
"data": {
|
|
1200
|
+
"object": "myshop_test_progress",
|
|
1201
|
+
"operate": {
|
|
1202
|
+
"operation": {
|
|
1203
|
+
"next_node_name": "Shipping",
|
|
1204
|
+
"forward": "Ship Goods"
|
|
1205
|
+
},
|
|
1206
|
+
"hold": false,
|
|
1207
|
+
"message": "Goods shipped via express delivery"
|
|
1208
|
+
}
|
|
1209
|
+
},
|
|
1210
|
+
"env": {
|
|
1211
|
+
"account": "myshop_merchant",
|
|
1212
|
+
"network": "mainnet",
|
|
1213
|
+
"confirmed": true
|
|
1141
1214
|
}
|
|
1142
|
-
},
|
|
1143
|
-
"env": {
|
|
1144
|
-
"account": "myshop_merchant",
|
|
1145
|
-
"network": "mainnet",
|
|
1146
|
-
"confirmed": true
|
|
1147
1215
|
}
|
|
1148
1216
|
}
|
|
1149
1217
|
```
|
|
@@ -1158,22 +1226,25 @@ Merchant or delivery service confirms the order has been delivered.
|
|
|
1158
1226
|
|
|
1159
1227
|
```json
|
|
1160
1228
|
{
|
|
1161
|
-
"
|
|
1229
|
+
"tool": "onchain_operations",
|
|
1162
1230
|
"data": {
|
|
1163
|
-
"
|
|
1164
|
-
"
|
|
1165
|
-
"
|
|
1166
|
-
|
|
1167
|
-
"
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1231
|
+
"operation_type": "progress",
|
|
1232
|
+
"data": {
|
|
1233
|
+
"object": "myshop_test_progress",
|
|
1234
|
+
"operate": {
|
|
1235
|
+
"operation": {
|
|
1236
|
+
"next_node_name": "In Transit",
|
|
1237
|
+
"forward": "Confirm Delivery"
|
|
1238
|
+
},
|
|
1239
|
+
"hold": false,
|
|
1240
|
+
"message": "Goods delivered successfully"
|
|
1241
|
+
}
|
|
1242
|
+
},
|
|
1243
|
+
"env": {
|
|
1244
|
+
"account": "myshop_merchant",
|
|
1245
|
+
"network": "mainnet",
|
|
1246
|
+
"confirmed": true
|
|
1171
1247
|
}
|
|
1172
|
-
},
|
|
1173
|
-
"env": {
|
|
1174
|
-
"account": "myshop_merchant",
|
|
1175
|
-
"network": "mainnet",
|
|
1176
|
-
"confirmed": true
|
|
1177
1248
|
}
|
|
1178
1249
|
}
|
|
1179
1250
|
```
|
|
@@ -1188,22 +1259,25 @@ Customer confirms receipt and completes the order.
|
|
|
1188
1259
|
|
|
1189
1260
|
```json
|
|
1190
1261
|
{
|
|
1191
|
-
"
|
|
1262
|
+
"tool": "onchain_operations",
|
|
1192
1263
|
"data": {
|
|
1193
|
-
"
|
|
1194
|
-
"
|
|
1195
|
-
"
|
|
1196
|
-
|
|
1197
|
-
"
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1264
|
+
"operation_type": "progress",
|
|
1265
|
+
"data": {
|
|
1266
|
+
"object": "myshop_test_progress",
|
|
1267
|
+
"operate": {
|
|
1268
|
+
"operation": {
|
|
1269
|
+
"next_node_name": "Completed",
|
|
1270
|
+
"forward": "Complete Order"
|
|
1271
|
+
},
|
|
1272
|
+
"hold": false,
|
|
1273
|
+
"message": "Order received and completed"
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
"env": {
|
|
1277
|
+
"account": "myshop_customer",
|
|
1278
|
+
"network": "mainnet",
|
|
1279
|
+
"confirmed": true
|
|
1201
1280
|
}
|
|
1202
|
-
},
|
|
1203
|
-
"env": {
|
|
1204
|
-
"account": "myshop_customer",
|
|
1205
|
-
"network": "mainnet",
|
|
1206
|
-
"confirmed": true
|
|
1207
1281
|
}
|
|
1208
1282
|
}
|
|
1209
1283
|
```
|
|
@@ -1226,39 +1300,42 @@ First, activate the Allocation by submitting the Guard verification with the Ord
|
|
|
1226
1300
|
|
|
1227
1301
|
```json
|
|
1228
1302
|
{
|
|
1229
|
-
"
|
|
1303
|
+
"tool": "onchain_operations",
|
|
1230
1304
|
"data": {
|
|
1231
|
-
"
|
|
1232
|
-
"
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
"
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
"
|
|
1260
|
-
|
|
1261
|
-
|
|
1305
|
+
"operation_type": "allocation",
|
|
1306
|
+
"data": {
|
|
1307
|
+
"object": "myshop_test_allocation",
|
|
1308
|
+
"alloc_by_guard": "0x5af9...1074"
|
|
1309
|
+
},
|
|
1310
|
+
"submission": {
|
|
1311
|
+
"type": "submission",
|
|
1312
|
+
"guard": [
|
|
1313
|
+
{
|
|
1314
|
+
"object": "0x5af9...1074",
|
|
1315
|
+
"impack": true
|
|
1316
|
+
}
|
|
1317
|
+
],
|
|
1318
|
+
"submission": [
|
|
1319
|
+
{
|
|
1320
|
+
"guard": "0x5af9...1074",
|
|
1321
|
+
"submission": [
|
|
1322
|
+
{
|
|
1323
|
+
"identifier": 0,
|
|
1324
|
+
"b_submission": true,
|
|
1325
|
+
"value_type": "Address",
|
|
1326
|
+
"value": "0xa6db...3d5",
|
|
1327
|
+
"name": "order_address"
|
|
1328
|
+
}
|
|
1329
|
+
]
|
|
1330
|
+
}
|
|
1331
|
+
]
|
|
1332
|
+
},
|
|
1333
|
+
"env": {
|
|
1334
|
+
"account": "myshop_merchant",
|
|
1335
|
+
"network": "mainnet",
|
|
1336
|
+
"confirmed": true,
|
|
1337
|
+
"no_cache": true
|
|
1338
|
+
}
|
|
1262
1339
|
}
|
|
1263
1340
|
}
|
|
1264
1341
|
```
|
|
@@ -1273,15 +1350,18 @@ After the Allocation is activated, withdraw the funds from the Service.
|
|
|
1273
1350
|
|
|
1274
1351
|
```json
|
|
1275
1352
|
{
|
|
1276
|
-
"
|
|
1353
|
+
"tool": "onchain_operations",
|
|
1277
1354
|
"data": {
|
|
1278
|
-
"
|
|
1279
|
-
"
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
"
|
|
1284
|
-
|
|
1355
|
+
"operation_type": "service",
|
|
1356
|
+
"data": {
|
|
1357
|
+
"object": "myshop_service_v2",
|
|
1358
|
+
"owner_receive": "recently"
|
|
1359
|
+
},
|
|
1360
|
+
"env": {
|
|
1361
|
+
"account": "myshop_merchant",
|
|
1362
|
+
"network": "mainnet",
|
|
1363
|
+
"confirmed": true
|
|
1364
|
+
}
|
|
1285
1365
|
}
|
|
1286
1366
|
}
|
|
1287
1367
|
```
|
|
@@ -1298,22 +1378,25 @@ Customer can cancel the order after the merchant confirms it. The "Cancel Order"
|
|
|
1298
1378
|
|
|
1299
1379
|
```json
|
|
1300
1380
|
{
|
|
1301
|
-
"
|
|
1381
|
+
"tool": "onchain_operations",
|
|
1302
1382
|
"data": {
|
|
1303
|
-
"
|
|
1304
|
-
"
|
|
1305
|
-
"
|
|
1306
|
-
|
|
1307
|
-
"
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1383
|
+
"operation_type": "progress",
|
|
1384
|
+
"data": {
|
|
1385
|
+
"object": "myshop_test_progress",
|
|
1386
|
+
"operate": {
|
|
1387
|
+
"operation": {
|
|
1388
|
+
"next_node_name": "Order Confirmation",
|
|
1389
|
+
"forward": "Confirm Order"
|
|
1390
|
+
},
|
|
1391
|
+
"hold": false,
|
|
1392
|
+
"message": "Order confirmed by merchant"
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1395
|
+
"env": {
|
|
1396
|
+
"account": "myshop_merchant",
|
|
1397
|
+
"network": "mainnet",
|
|
1398
|
+
"confirmed": true
|
|
1311
1399
|
}
|
|
1312
|
-
},
|
|
1313
|
-
"env": {
|
|
1314
|
-
"account": "myshop_merchant",
|
|
1315
|
-
"network": "mainnet",
|
|
1316
|
-
"confirmed": true
|
|
1317
1400
|
}
|
|
1318
1401
|
}
|
|
1319
1402
|
```
|
|
@@ -1324,22 +1407,25 @@ Customer can cancel the order after the merchant confirms it. The "Cancel Order"
|
|
|
1324
1407
|
|
|
1325
1408
|
```json
|
|
1326
1409
|
{
|
|
1327
|
-
"
|
|
1410
|
+
"tool": "onchain_operations",
|
|
1328
1411
|
"data": {
|
|
1329
|
-
"
|
|
1330
|
-
"
|
|
1331
|
-
"
|
|
1332
|
-
|
|
1333
|
-
"
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1412
|
+
"operation_type": "progress",
|
|
1413
|
+
"data": {
|
|
1414
|
+
"object": "myshop_test_progress",
|
|
1415
|
+
"operate": {
|
|
1416
|
+
"operation": {
|
|
1417
|
+
"next_node_name": "Cancelled",
|
|
1418
|
+
"forward": "Cancel Order"
|
|
1419
|
+
},
|
|
1420
|
+
"hold": false,
|
|
1421
|
+
"message": "Order cancelled by customer"
|
|
1422
|
+
}
|
|
1423
|
+
},
|
|
1424
|
+
"env": {
|
|
1425
|
+
"account": "myshop_customer",
|
|
1426
|
+
"network": "mainnet",
|
|
1427
|
+
"confirmed": true
|
|
1337
1428
|
}
|
|
1338
|
-
},
|
|
1339
|
-
"env": {
|
|
1340
|
-
"account": "myshop_customer",
|
|
1341
|
-
"network": "mainnet",
|
|
1342
|
-
"confirmed": true
|
|
1343
1429
|
}
|
|
1344
1430
|
}
|
|
1345
1431
|
```
|
|
@@ -1352,39 +1438,42 @@ After the order is cancelled, the customer can activate the refund allocation us
|
|
|
1352
1438
|
|
|
1353
1439
|
```json
|
|
1354
1440
|
{
|
|
1355
|
-
"
|
|
1441
|
+
"tool": "onchain_operations",
|
|
1356
1442
|
"data": {
|
|
1357
|
-
"
|
|
1358
|
-
"
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
"
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
"
|
|
1386
|
-
|
|
1387
|
-
|
|
1443
|
+
"operation_type": "allocation",
|
|
1444
|
+
"data": {
|
|
1445
|
+
"object": "myshop_test_allocation",
|
|
1446
|
+
"alloc_by_guard": "0x5792...5d2c"
|
|
1447
|
+
},
|
|
1448
|
+
"submission": {
|
|
1449
|
+
"type": "submission",
|
|
1450
|
+
"guard": [
|
|
1451
|
+
{
|
|
1452
|
+
"object": "0x5792...5d2c",
|
|
1453
|
+
"impack": true
|
|
1454
|
+
}
|
|
1455
|
+
],
|
|
1456
|
+
"submission": [
|
|
1457
|
+
{
|
|
1458
|
+
"guard": "0x5792...5d2c",
|
|
1459
|
+
"submission": [
|
|
1460
|
+
{
|
|
1461
|
+
"identifier": 0,
|
|
1462
|
+
"b_submission": true,
|
|
1463
|
+
"value_type": "Address",
|
|
1464
|
+
"value": "0xa6db...3d5",
|
|
1465
|
+
"name": "order_address"
|
|
1466
|
+
}
|
|
1467
|
+
]
|
|
1468
|
+
}
|
|
1469
|
+
]
|
|
1470
|
+
},
|
|
1471
|
+
"env": {
|
|
1472
|
+
"account": "myshop_customer",
|
|
1473
|
+
"network": "mainnet",
|
|
1474
|
+
"confirmed": true,
|
|
1475
|
+
"no_cache": true
|
|
1476
|
+
}
|
|
1388
1477
|
}
|
|
1389
1478
|
}
|
|
1390
1479
|
```
|
|
@@ -1412,15 +1501,18 @@ The Service must have a compensation fund balance ≥ the arbitration indemnity
|
|
|
1412
1501
|
|
|
1413
1502
|
```json
|
|
1414
1503
|
{
|
|
1415
|
-
"
|
|
1504
|
+
"tool": "onchain_operations",
|
|
1416
1505
|
"data": {
|
|
1417
|
-
"
|
|
1418
|
-
"
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
"
|
|
1423
|
-
|
|
1506
|
+
"operation_type": "service",
|
|
1507
|
+
"data": {
|
|
1508
|
+
"object": "myshop_service_v2",
|
|
1509
|
+
"compensation_fund_add": {"balance": 50000000}
|
|
1510
|
+
},
|
|
1511
|
+
"env": {
|
|
1512
|
+
"account": "myshop_merchant",
|
|
1513
|
+
"network": "mainnet",
|
|
1514
|
+
"confirmed": true
|
|
1515
|
+
}
|
|
1424
1516
|
}
|
|
1425
1517
|
}
|
|
1426
1518
|
```
|
|
@@ -1433,23 +1525,26 @@ Create an Arbitration object for handling order disputes.
|
|
|
1433
1525
|
|
|
1434
1526
|
```json
|
|
1435
1527
|
{
|
|
1436
|
-
"
|
|
1528
|
+
"tool": "onchain_operations",
|
|
1437
1529
|
"data": {
|
|
1438
|
-
"
|
|
1439
|
-
|
|
1440
|
-
"
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1530
|
+
"operation_type": "arbitration",
|
|
1531
|
+
"data": {
|
|
1532
|
+
"object": {
|
|
1533
|
+
"name": "myshop_arbitration_v2",
|
|
1534
|
+
"type_parameter": "0x2::wow::WOW",
|
|
1535
|
+
"permission": "myshop_permission_v2",
|
|
1536
|
+
"tags": ["ecommerce", "dispute", "toys"],
|
|
1537
|
+
"onChain": false
|
|
1538
|
+
},
|
|
1539
|
+
"description": "Arbitration system for MyShop toy store disputes",
|
|
1540
|
+
"location": "Online arbitration system",
|
|
1541
|
+
"fee": 5000000
|
|
1444
1542
|
},
|
|
1445
|
-
"
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
"account": "myshop_merchant",
|
|
1451
|
-
"network": "mainnet",
|
|
1452
|
-
"confirmed": true
|
|
1543
|
+
"env": {
|
|
1544
|
+
"account": "myshop_merchant",
|
|
1545
|
+
"network": "mainnet",
|
|
1546
|
+
"confirmed": true
|
|
1547
|
+
}
|
|
1453
1548
|
}
|
|
1454
1549
|
}
|
|
1455
1550
|
```
|
|
@@ -1464,15 +1559,18 @@ The merchant unpauses the Arbitration object to enable dispute submissions.
|
|
|
1464
1559
|
|
|
1465
1560
|
```json
|
|
1466
1561
|
{
|
|
1467
|
-
"
|
|
1562
|
+
"tool": "onchain_operations",
|
|
1468
1563
|
"data": {
|
|
1469
|
-
"
|
|
1470
|
-
"
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
"
|
|
1475
|
-
|
|
1564
|
+
"operation_type": "arbitration",
|
|
1565
|
+
"data": {
|
|
1566
|
+
"object": "myshop_arbitration_v2",
|
|
1567
|
+
"pause": false
|
|
1568
|
+
},
|
|
1569
|
+
"env": {
|
|
1570
|
+
"account": "myshop_merchant",
|
|
1571
|
+
"network": "mainnet",
|
|
1572
|
+
"confirmed": true
|
|
1573
|
+
}
|
|
1476
1574
|
}
|
|
1477
1575
|
}
|
|
1478
1576
|
```
|
|
@@ -1485,29 +1583,32 @@ Create a new order for testing the arbitration flow (if you don't have one alrea
|
|
|
1485
1583
|
|
|
1486
1584
|
```json
|
|
1487
1585
|
{
|
|
1488
|
-
"
|
|
1586
|
+
"tool": "onchain_operations",
|
|
1489
1587
|
"data": {
|
|
1490
|
-
"
|
|
1491
|
-
"
|
|
1492
|
-
"
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1588
|
+
"operation_type": "service",
|
|
1589
|
+
"data": {
|
|
1590
|
+
"object": "myshop_service_v2",
|
|
1591
|
+
"order_new": {
|
|
1592
|
+
"buy": {
|
|
1593
|
+
"items": [
|
|
1594
|
+
{
|
|
1595
|
+
"name": "Tree House Building Set",
|
|
1596
|
+
"stock": 1,
|
|
1597
|
+
"wip_hash": "03c18561efa8faf4d75480eb1f732c4a46ffde95599e92eca06167785fc07a5b"
|
|
1598
|
+
}
|
|
1599
|
+
],
|
|
1600
|
+
"total_pay": {"balance": 30000000}
|
|
1601
|
+
},
|
|
1602
|
+
"namedNewOrder": {"name": "myshop_arb_order", "replaceExistName": true},
|
|
1603
|
+
"namedNewProgress": {"name": "myshop_arb_progress", "replaceExistName": true},
|
|
1604
|
+
"namedNewAllocation": {"name": "myshop_arb_allocation", "replaceExistName": true}
|
|
1605
|
+
}
|
|
1606
|
+
},
|
|
1607
|
+
"env": {
|
|
1608
|
+
"account": "myshop_customer",
|
|
1609
|
+
"network": "mainnet",
|
|
1610
|
+
"confirmed": true
|
|
1505
1611
|
}
|
|
1506
|
-
},
|
|
1507
|
-
"env": {
|
|
1508
|
-
"account": "myshop_customer",
|
|
1509
|
-
"network": "mainnet",
|
|
1510
|
-
"confirmed": true
|
|
1511
1612
|
}
|
|
1512
1613
|
}
|
|
1513
1614
|
```
|
|
@@ -1522,21 +1623,24 @@ The customer submits a dispute against the order, creating an Arb object.
|
|
|
1522
1623
|
|
|
1523
1624
|
```json
|
|
1524
1625
|
{
|
|
1525
|
-
"
|
|
1626
|
+
"tool": "onchain_operations",
|
|
1526
1627
|
"data": {
|
|
1527
|
-
"
|
|
1528
|
-
"
|
|
1529
|
-
"
|
|
1530
|
-
"
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1628
|
+
"operation_type": "arbitration",
|
|
1629
|
+
"data": {
|
|
1630
|
+
"object": "myshop_arbitration_v2",
|
|
1631
|
+
"dispute": {
|
|
1632
|
+
"order": "myshop_arb_order",
|
|
1633
|
+
"description": "Product quality issue - the tree house set arrived damaged",
|
|
1634
|
+
"proposition": ["Full refund to customer", "Partial refund 50%", "Replace with new product"],
|
|
1635
|
+
"fee": {"balance": 5000000},
|
|
1636
|
+
"namedArb": {"name": "myshop_arb_case", "replaceExistName": true}
|
|
1637
|
+
}
|
|
1638
|
+
},
|
|
1639
|
+
"env": {
|
|
1640
|
+
"account": "myshop_customer",
|
|
1641
|
+
"network": "mainnet",
|
|
1642
|
+
"confirmed": true
|
|
1534
1643
|
}
|
|
1535
|
-
},
|
|
1536
|
-
"env": {
|
|
1537
|
-
"account": "myshop_customer",
|
|
1538
|
-
"network": "mainnet",
|
|
1539
|
-
"confirmed": true
|
|
1540
1644
|
}
|
|
1541
1645
|
}
|
|
1542
1646
|
```
|
|
@@ -1551,18 +1655,21 @@ The merchant confirms the dispute materials are valid and sets the voting deadli
|
|
|
1551
1655
|
|
|
1552
1656
|
```json
|
|
1553
1657
|
{
|
|
1554
|
-
"
|
|
1658
|
+
"tool": "onchain_operations",
|
|
1555
1659
|
"data": {
|
|
1556
|
-
"
|
|
1557
|
-
"
|
|
1558
|
-
"
|
|
1559
|
-
"
|
|
1660
|
+
"operation_type": "arbitration",
|
|
1661
|
+
"data": {
|
|
1662
|
+
"object": "myshop_arbitration_v2",
|
|
1663
|
+
"confirm": {
|
|
1664
|
+
"arb": "myshop_arb_case",
|
|
1665
|
+
"voting_deadline": 0
|
|
1666
|
+
}
|
|
1667
|
+
},
|
|
1668
|
+
"env": {
|
|
1669
|
+
"account": "myshop_merchant",
|
|
1670
|
+
"network": "mainnet",
|
|
1671
|
+
"confirmed": true
|
|
1560
1672
|
}
|
|
1561
|
-
},
|
|
1562
|
-
"env": {
|
|
1563
|
-
"account": "myshop_merchant",
|
|
1564
|
-
"network": "mainnet",
|
|
1565
|
-
"confirmed": true
|
|
1566
1673
|
}
|
|
1567
1674
|
}
|
|
1568
1675
|
```
|
|
@@ -1577,19 +1684,22 @@ The merchant provides the final arbitration result with feedback and indemnity a
|
|
|
1577
1684
|
|
|
1578
1685
|
```json
|
|
1579
1686
|
{
|
|
1580
|
-
"
|
|
1687
|
+
"tool": "onchain_operations",
|
|
1581
1688
|
"data": {
|
|
1582
|
-
"
|
|
1583
|
-
"
|
|
1584
|
-
"
|
|
1585
|
-
"
|
|
1586
|
-
|
|
1689
|
+
"operation_type": "arbitration",
|
|
1690
|
+
"data": {
|
|
1691
|
+
"object": "myshop_arbitration_v2",
|
|
1692
|
+
"arbitration": {
|
|
1693
|
+
"arb": "myshop_arb_case",
|
|
1694
|
+
"feedback": "After investigation, the product quality issue is confirmed. Full refund to customer and return shipping cost covered by merchant.",
|
|
1695
|
+
"indemnity": 30000000
|
|
1696
|
+
}
|
|
1697
|
+
},
|
|
1698
|
+
"env": {
|
|
1699
|
+
"account": "myshop_merchant",
|
|
1700
|
+
"network": "mainnet",
|
|
1701
|
+
"confirmed": true
|
|
1587
1702
|
}
|
|
1588
|
-
},
|
|
1589
|
-
"env": {
|
|
1590
|
-
"account": "myshop_merchant",
|
|
1591
|
-
"network": "mainnet",
|
|
1592
|
-
"confirmed": true
|
|
1593
1703
|
}
|
|
1594
1704
|
}
|
|
1595
1705
|
```
|
|
@@ -1604,17 +1714,20 @@ The customer claims the compensation from the Service's compensation fund.
|
|
|
1604
1714
|
|
|
1605
1715
|
```json
|
|
1606
1716
|
{
|
|
1607
|
-
"
|
|
1717
|
+
"tool": "onchain_operations",
|
|
1608
1718
|
"data": {
|
|
1609
|
-
"
|
|
1610
|
-
"
|
|
1611
|
-
"
|
|
1719
|
+
"operation_type": "order",
|
|
1720
|
+
"data": {
|
|
1721
|
+
"object": "myshop_arb_order",
|
|
1722
|
+
"arb_claim_compensation": {
|
|
1723
|
+
"arb": "myshop_arb_case"
|
|
1724
|
+
}
|
|
1725
|
+
},
|
|
1726
|
+
"env": {
|
|
1727
|
+
"account": "myshop_customer",
|
|
1728
|
+
"network": "mainnet",
|
|
1729
|
+
"confirmed": true
|
|
1612
1730
|
}
|
|
1613
|
-
},
|
|
1614
|
-
"env": {
|
|
1615
|
-
"account": "myshop_customer",
|
|
1616
|
-
"network": "mainnet",
|
|
1617
|
-
"confirmed": true
|
|
1618
1731
|
}
|
|
1619
1732
|
}
|
|
1620
1733
|
```
|
|
@@ -1629,10 +1742,13 @@ Check the final status of the arbitration.
|
|
|
1629
1742
|
|
|
1630
1743
|
```json
|
|
1631
1744
|
{
|
|
1632
|
-
"
|
|
1633
|
-
"
|
|
1634
|
-
|
|
1635
|
-
|
|
1745
|
+
"tool": "query_toolkit",
|
|
1746
|
+
"data": {
|
|
1747
|
+
"query_type": "onchain_objects",
|
|
1748
|
+
"objects": ["myshop_arb_case"],
|
|
1749
|
+
"no_cache": true,
|
|
1750
|
+
"network": "mainnet"
|
|
1751
|
+
}
|
|
1636
1752
|
}
|
|
1637
1753
|
```
|
|
1638
1754
|
|
|
@@ -1669,7 +1785,7 @@ This MyShop e-commerce example demonstrates:
|
|
|
1669
1785
|
- Dispute submission and arbitration process (7-step state machine)
|
|
1670
1786
|
- Compensation claim from Service compensation fund
|
|
1671
1787
|
|
|
1672
|
-
All operations use the WoWok SDK patterns with JSON-based tool calls, making it easy for AI agents to interact with the blockchain e-commerce system.
|
|
1788
|
+
All operations use the WoWok SDK patterns with JSON-based sub-tool calls, making it easy for AI agents to interact with the blockchain e-commerce system.
|
|
1673
1789
|
|
|
1674
1790
|
---
|
|
1675
1791
|
|
|
@@ -1679,22 +1795,25 @@ When advancing order workflows, use `operation_type: "progress"` with the `opera
|
|
|
1679
1795
|
|
|
1680
1796
|
```json
|
|
1681
1797
|
{
|
|
1682
|
-
"
|
|
1798
|
+
"tool": "onchain_operations",
|
|
1683
1799
|
"data": {
|
|
1684
|
-
"
|
|
1685
|
-
"
|
|
1686
|
-
"
|
|
1687
|
-
|
|
1688
|
-
"
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1800
|
+
"operation_type": "progress",
|
|
1801
|
+
"data": {
|
|
1802
|
+
"object": "myshop_test_progress",
|
|
1803
|
+
"operate": {
|
|
1804
|
+
"operation": {
|
|
1805
|
+
"next_node_name": "Target Node Name",
|
|
1806
|
+
"forward": "Forward Name"
|
|
1807
|
+
},
|
|
1808
|
+
"hold": false,
|
|
1809
|
+
"message": "Operation description"
|
|
1810
|
+
}
|
|
1811
|
+
},
|
|
1812
|
+
"env": {
|
|
1813
|
+
"account": "operator_account",
|
|
1814
|
+
"network": "mainnet",
|
|
1815
|
+
"confirmed": true
|
|
1692
1816
|
}
|
|
1693
|
-
},
|
|
1694
|
-
"env": {
|
|
1695
|
-
"account": "operator_account",
|
|
1696
|
-
"network": "mainnet",
|
|
1697
|
-
"confirmed": true
|
|
1698
1817
|
}
|
|
1699
1818
|
}
|
|
1700
1819
|
```
|