@wowok/skills 1.1.11 → 1.1.13
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/examples/Insurance/Insurance.md +142 -23
- package/examples/MyShop/MyShop.md +216 -218
- package/examples/MyShop/myshop_machine_nodes.json +14 -8
- package/examples/MyShop_Advanced/MyShop_Advanced.md +57 -56
- package/examples/ThreeBody_Signature/ThreeBody_Signature.md +431 -111
- package/examples/Travel/Travel.md +64 -18
- package/package.json +1 -1
- package/wowok-arbitrator/APPENDIX.md +545 -0
- package/wowok-arbitrator/SKILL.md +8 -535
- package/wowok-auditor/APPENDIX.md +487 -0
- package/wowok-auditor/SKILL.md +9 -480
- package/wowok-guard/APPENDIX.md +428 -0
- package/wowok-guard/SKILL.md +117 -421
- package/wowok-machine/APPENDIX.md +407 -0
- package/wowok-machine/SKILL.md +9 -400
- package/wowok-messenger/APPENDIX.md +550 -0
- package/wowok-messenger/SKILL.md +9 -543
- package/wowok-onboard/APPENDIX.md +472 -0
- package/wowok-onboard/SKILL.md +10 -465
- package/wowok-order/APPENDIX.md +777 -0
- package/wowok-order/SKILL.md +110 -506
- package/wowok-output/APPENDIX.md +575 -0
- package/wowok-output/SKILL.md +9 -568
- package/wowok-planner/APPENDIX.md +700 -0
- package/wowok-planner/SKILL.md +9 -693
- package/wowok-provider/APPENDIX.md +425 -0
- package/wowok-provider/SKILL.md +8 -415
- package/wowok-safety/APPENDIX.md +561 -0
- package/wowok-safety/SKILL.md +9 -554
- package/wowok-scenario/APPENDIX.md +97 -0
- package/wowok-scenario/MODE-DETAILS.md +275 -0
- package/wowok-scenario/SKILL.md +20 -353
- package/wowok-tools/APPENDIX.md +388 -0
- package/wowok-tools/SKILL.md +9 -381
|
@@ -86,7 +86,7 @@ This section guides merchants through setting up their online store.
|
|
|
86
86
|
### Prerequisites
|
|
87
87
|
|
|
88
88
|
Before starting, ensure you have:
|
|
89
|
-
- A WoWok account with
|
|
89
|
+
- A WoWok account with mainnet WOW tokens (gas)
|
|
90
90
|
- Access to the WoWok MCP server
|
|
91
91
|
|
|
92
92
|
**Create merchant account:**
|
|
@@ -102,15 +102,17 @@ Before starting, ensure you have:
|
|
|
102
102
|
}
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
**Get
|
|
105
|
+
**Get mainnet tokens:**
|
|
106
106
|
|
|
107
|
-
**Prompt**:
|
|
107
|
+
**Prompt**: Transfer 1 WOW to account "myshop_merchant" from a funded account for gas fees.
|
|
108
108
|
|
|
109
109
|
```json
|
|
110
110
|
{
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
111
|
+
"transfer": {
|
|
112
|
+
"name_or_address_to": "myshop_merchant",
|
|
113
|
+
"amount": 1000000000,
|
|
114
|
+
"network": "mainnet",
|
|
115
|
+
"confirmed": true
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
```
|
|
@@ -137,18 +139,21 @@ First, create a Permission object to manage access control for your store operat
|
|
|
137
139
|
},
|
|
138
140
|
"env": {
|
|
139
141
|
"account": "myshop_merchant",
|
|
140
|
-
"network": "
|
|
142
|
+
"network": "mainnet",
|
|
143
|
+
"confirmed": true
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
```
|
|
144
147
|
|
|
145
148
|
---
|
|
146
149
|
|
|
147
|
-
### Step 2: Create Machine
|
|
150
|
+
### Step 2: Create Machine with Workflow Nodes
|
|
148
151
|
|
|
149
|
-
Create a Machine to define the order processing workflow. This includes nodes for order confirmation, shipping, delivery, and completion.
|
|
152
|
+
Create a Machine to define the order processing workflow. This includes nodes for order confirmation, shipping, delivery, and completion. The Machine must be created with all nodes and published in a single operation — the protocol requires at least one node when publishing a Machine.
|
|
150
153
|
|
|
151
|
-
**
|
|
154
|
+
> **Reference**: The complete node configuration is available in [`myshop_machine_nodes.json`](./myshop_machine_nodes.json). The JSON below mirrors that file's content wrapped in an on-chain operation.
|
|
155
|
+
|
|
156
|
+
**Prompt**: Create a Machine named "myshop_machine_v2" with permission "myshop_permission_v2", including all workflow nodes (Order Confirmation, Shipping, In Transit, Completed, Cancelled), and publish it immediately.
|
|
152
157
|
|
|
153
158
|
```json
|
|
154
159
|
{
|
|
@@ -159,15 +164,115 @@ Create a Machine to define the order processing workflow. This includes nodes fo
|
|
|
159
164
|
"permission": "myshop_permission_v2",
|
|
160
165
|
"replaceExistName": true
|
|
161
166
|
},
|
|
162
|
-
"description": "Order processing workflow for MyShop toy store"
|
|
167
|
+
"description": "Order processing workflow for MyShop toy store",
|
|
168
|
+
"node": {
|
|
169
|
+
"op": "add",
|
|
170
|
+
"nodes": [
|
|
171
|
+
{
|
|
172
|
+
"name": "Cancelled",
|
|
173
|
+
"pairs": [
|
|
174
|
+
{
|
|
175
|
+
"prev_node": "",
|
|
176
|
+
"threshold": 0,
|
|
177
|
+
"forwards": [
|
|
178
|
+
{
|
|
179
|
+
"name": "Cancel Order",
|
|
180
|
+
"weight": 1,
|
|
181
|
+
"namedOperator": ""
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"prev_node": "Order Confirmation",
|
|
187
|
+
"threshold": 1,
|
|
188
|
+
"forwards": [
|
|
189
|
+
{
|
|
190
|
+
"name": "Cancel Order",
|
|
191
|
+
"weight": 1,
|
|
192
|
+
"namedOperator": ""
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "Completed",
|
|
200
|
+
"pairs": [
|
|
201
|
+
{
|
|
202
|
+
"prev_node": "In Transit",
|
|
203
|
+
"threshold": 1,
|
|
204
|
+
"forwards": [
|
|
205
|
+
{
|
|
206
|
+
"name": "Complete Order",
|
|
207
|
+
"weight": 1,
|
|
208
|
+
"namedOperator": ""
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "In Transit",
|
|
216
|
+
"pairs": [
|
|
217
|
+
{
|
|
218
|
+
"prev_node": "Shipping",
|
|
219
|
+
"threshold": 1,
|
|
220
|
+
"forwards": [
|
|
221
|
+
{
|
|
222
|
+
"name": "Confirm Delivery",
|
|
223
|
+
"weight": 1,
|
|
224
|
+
"permissionIndex": 1002
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "Order Confirmation",
|
|
232
|
+
"pairs": [
|
|
233
|
+
{
|
|
234
|
+
"prev_node": "",
|
|
235
|
+
"threshold": 0,
|
|
236
|
+
"forwards": [
|
|
237
|
+
{
|
|
238
|
+
"name": "Confirm Order",
|
|
239
|
+
"weight": 1,
|
|
240
|
+
"permissionIndex": 1000
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"name": "Shipping",
|
|
248
|
+
"pairs": [
|
|
249
|
+
{
|
|
250
|
+
"prev_node": "Order Confirmation",
|
|
251
|
+
"threshold": 1,
|
|
252
|
+
"forwards": [
|
|
253
|
+
{
|
|
254
|
+
"name": "Ship Goods",
|
|
255
|
+
"weight": 1,
|
|
256
|
+
"permissionIndex": 1001
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
"publish": true
|
|
163
265
|
},
|
|
164
266
|
"env": {
|
|
165
267
|
"account": "myshop_merchant",
|
|
166
|
-
"network": "
|
|
268
|
+
"network": "mainnet",
|
|
269
|
+
"confirmed": true
|
|
167
270
|
}
|
|
168
271
|
}
|
|
169
272
|
```
|
|
170
273
|
|
|
274
|
+
> **Note**: The Machine must be created with nodes and published in a single operation. Creating an empty Machine and then adding nodes/publishing separately will be rejected by the protocol's constraint checker. The "Cancelled" node has two pairs: one with `prev_node: ""` (cancel from initial state) and one with `prev_node: "Order Confirmation"` (cancel after order confirmation).
|
|
275
|
+
|
|
171
276
|
---
|
|
172
277
|
|
|
173
278
|
### Step 3: Machine Workflow Design
|
|
@@ -279,152 +384,11 @@ Before adding nodes, let's understand the order processing workflow:
|
|
|
279
384
|
|
|
280
385
|
---
|
|
281
386
|
|
|
282
|
-
### Step 4:
|
|
283
|
-
|
|
284
|
-
Add the workflow nodes to the Machine for order processing. The initial pair (prev_node: "") defines transitions from the empty starting state.
|
|
285
|
-
|
|
286
|
-
**Prompt**: Add workflow nodes to "myshop_machine_v2" including Order Confirmation, Shipping, In Transit, Completed, and Cancelled nodes.
|
|
287
|
-
|
|
288
|
-
```json
|
|
289
|
-
{
|
|
290
|
-
"operation_type": "machine",
|
|
291
|
-
"data": {
|
|
292
|
-
"object": "myshop_machine_v2",
|
|
293
|
-
"node": {
|
|
294
|
-
"op": "add",
|
|
295
|
-
"nodes": [
|
|
296
|
-
{
|
|
297
|
-
"name": "Order Confirmation",
|
|
298
|
-
"pairs": [
|
|
299
|
-
{
|
|
300
|
-
"prev_node": "",
|
|
301
|
-
"threshold": 0,
|
|
302
|
-
"forwards": [
|
|
303
|
-
{
|
|
304
|
-
"name": "Confirm Order",
|
|
305
|
-
"permissionIndex": 1000,
|
|
306
|
-
"weight": 1
|
|
307
|
-
}
|
|
308
|
-
]
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
"prev_node": "Order Confirmation",
|
|
312
|
-
"threshold": 1,
|
|
313
|
-
"forwards": [
|
|
314
|
-
{
|
|
315
|
-
"name": "Ship Goods",
|
|
316
|
-
"permissionIndex": 1001,
|
|
317
|
-
"weight": 1
|
|
318
|
-
}
|
|
319
|
-
]
|
|
320
|
-
}
|
|
321
|
-
]
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
"name": "Shipping",
|
|
325
|
-
"pairs": [
|
|
326
|
-
{
|
|
327
|
-
"prev_node": "Order Confirmation",
|
|
328
|
-
"threshold": 1,
|
|
329
|
-
"forwards": [
|
|
330
|
-
{
|
|
331
|
-
"name": "Ship Goods",
|
|
332
|
-
"permissionIndex": 1001,
|
|
333
|
-
"weight": 1
|
|
334
|
-
}
|
|
335
|
-
]
|
|
336
|
-
}
|
|
337
|
-
]
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
"name": "In Transit",
|
|
341
|
-
"pairs": [
|
|
342
|
-
{
|
|
343
|
-
"prev_node": "Shipping",
|
|
344
|
-
"threshold": 1,
|
|
345
|
-
"forwards": [
|
|
346
|
-
{
|
|
347
|
-
"name": "Confirm Delivery",
|
|
348
|
-
"permissionIndex": 1002,
|
|
349
|
-
"weight": 1
|
|
350
|
-
}
|
|
351
|
-
]
|
|
352
|
-
}
|
|
353
|
-
]
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
"name": "Completed",
|
|
357
|
-
"pairs": [
|
|
358
|
-
{
|
|
359
|
-
"prev_node": "In Transit",
|
|
360
|
-
"threshold": 1,
|
|
361
|
-
"forwards": [
|
|
362
|
-
{
|
|
363
|
-
"name": "Complete Order",
|
|
364
|
-
"namedOperator": "",
|
|
365
|
-
"weight": 1
|
|
366
|
-
}
|
|
367
|
-
]
|
|
368
|
-
}
|
|
369
|
-
]
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
"name": "Cancelled",
|
|
373
|
-
"pairs": [
|
|
374
|
-
{
|
|
375
|
-
"prev_node": "Order Confirmation",
|
|
376
|
-
"threshold": 0,
|
|
377
|
-
"forwards": [
|
|
378
|
-
{
|
|
379
|
-
"name": "Cancel Order",
|
|
380
|
-
"namedOperator": "",
|
|
381
|
-
"weight": 1
|
|
382
|
-
}
|
|
383
|
-
]
|
|
384
|
-
}
|
|
385
|
-
]
|
|
386
|
-
}
|
|
387
|
-
]
|
|
388
|
-
}
|
|
389
|
-
},
|
|
390
|
-
"env": {
|
|
391
|
-
"account": "myshop_merchant",
|
|
392
|
-
"network": "testnet"
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
```
|
|
396
|
-
|
|
397
|
-
> **Note**: The "Cancel Order" forward is defined on the "Cancelled" node with `prev_node: "Order Confirmation"`. This means cancellation can only happen AFTER the merchant confirms the order (transitions from "Order Confirmation" to "Cancelled"). The "Cancelled" node is a terminal state with no further forwards.
|
|
398
|
-
|
|
399
|
-
---
|
|
400
|
-
|
|
401
|
-
### Step 5: Publish the Machine
|
|
402
|
-
|
|
403
|
-
Publish the Machine to make it available for creating orders.
|
|
404
|
-
|
|
405
|
-
**Prompt**: Publish the Machine "myshop_machine_v2" to enable order creation.
|
|
406
|
-
|
|
407
|
-
```json
|
|
408
|
-
{
|
|
409
|
-
"operation_type": "machine",
|
|
410
|
-
"data": {
|
|
411
|
-
"object": "myshop_machine_v2",
|
|
412
|
-
"publish": true
|
|
413
|
-
},
|
|
414
|
-
"env": {
|
|
415
|
-
"account": "myshop_merchant",
|
|
416
|
-
"network": "testnet"
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
---
|
|
422
|
-
|
|
423
|
-
### Step 6: Create Contact Object for Customer Service
|
|
387
|
+
### Step 4: Create Contact Object for Customer Service
|
|
424
388
|
|
|
425
389
|
Create a Contact object to enable encrypted communication between customers and the store for after-sales support.
|
|
426
390
|
|
|
427
|
-
####
|
|
391
|
+
#### 4.1 Enable Merchant Messenger
|
|
428
392
|
|
|
429
393
|
**Prompt**: Enable messenger for the merchant account.
|
|
430
394
|
|
|
@@ -437,7 +401,7 @@ Create a Contact object to enable encrypted communication between customers and
|
|
|
437
401
|
}
|
|
438
402
|
```
|
|
439
403
|
|
|
440
|
-
####
|
|
404
|
+
#### 4.2 Create After-Sales Contact Object
|
|
441
405
|
|
|
442
406
|
**Prompt**: Create a Contact object named "myshop_aftersales_contact_v2" with permission "myshop_permission_v2" for after-sales support.
|
|
443
407
|
|
|
@@ -463,7 +427,8 @@ Create a Contact object to enable encrypted communication between customers and
|
|
|
463
427
|
},
|
|
464
428
|
"env": {
|
|
465
429
|
"account": "myshop_merchant",
|
|
466
|
-
"network": "
|
|
430
|
+
"network": "mainnet",
|
|
431
|
+
"confirmed": true
|
|
467
432
|
}
|
|
468
433
|
}
|
|
469
434
|
```
|
|
@@ -472,11 +437,11 @@ Create a Contact object to enable encrypted communication between customers and
|
|
|
472
437
|
|
|
473
438
|
---
|
|
474
439
|
|
|
475
|
-
### Step
|
|
440
|
+
### Step 5: Create Guards for Fund Allocation
|
|
476
441
|
|
|
477
442
|
Before creating the Service, create Guards that validate fund allocation conditions. These Guards ensure funds are only released when specific conditions are met.
|
|
478
443
|
|
|
479
|
-
####
|
|
444
|
+
#### 5.1 Create Withdraw Guard (Merchant Withdrawal)
|
|
480
445
|
|
|
481
446
|
Create a Guard that validates the order's Progress has reached the "Completed" node. This Guard uses `convert_witness: 100` (TypeOrderProgress) to query the Order's associated Progress object.
|
|
482
447
|
|
|
@@ -529,7 +494,8 @@ Create a Guard that validates the order's Progress has reached the "Completed" n
|
|
|
529
494
|
},
|
|
530
495
|
"env": {
|
|
531
496
|
"account": "myshop_merchant",
|
|
532
|
-
"network": "
|
|
497
|
+
"network": "mainnet",
|
|
498
|
+
"confirmed": true
|
|
533
499
|
}
|
|
534
500
|
}
|
|
535
501
|
```
|
|
@@ -543,7 +509,7 @@ Create a Guard that validates the order's Progress has reached the "Completed" n
|
|
|
543
509
|
|
|
544
510
|
> **Note**: The Guard `root` field directly specifies the GuardNode (e.g., `type: "logic_equal"`), not wrapped in a `type: "node"` object.
|
|
545
511
|
|
|
546
|
-
####
|
|
512
|
+
#### 5.2 Create Refund Guard (Customer Refund)
|
|
547
513
|
|
|
548
514
|
Create a Guard for customer refunds when order is cancelled.
|
|
549
515
|
|
|
@@ -596,20 +562,21 @@ Create a Guard for customer refunds when order is cancelled.
|
|
|
596
562
|
},
|
|
597
563
|
"env": {
|
|
598
564
|
"account": "myshop_merchant",
|
|
599
|
-
"network": "
|
|
565
|
+
"network": "mainnet",
|
|
566
|
+
"confirmed": true
|
|
600
567
|
}
|
|
601
568
|
}
|
|
602
569
|
```
|
|
603
570
|
|
|
604
571
|
---
|
|
605
572
|
|
|
606
|
-
### Step
|
|
573
|
+
### Step 6: Create Service (Store)
|
|
607
574
|
|
|
608
575
|
Create the Service object that represents your online store with products. This step binds all previously created components together.
|
|
609
576
|
|
|
610
577
|
> **Important**: For Service creation, provide a complete configuration including machine, order_allocators with Guards, and products. The Service will be created and published in a single transaction.
|
|
611
578
|
|
|
612
|
-
####
|
|
579
|
+
#### 6.1 Understanding Order Allocators
|
|
613
580
|
|
|
614
581
|
The `order_allocators` configuration defines how order payments are distributed:
|
|
615
582
|
|
|
@@ -627,7 +594,7 @@ The `order_allocators` configuration defines how order payments are distributed:
|
|
|
627
594
|
|
|
628
595
|
> **Design Decision — Refund Recipient**: When using `{ "GuardIdentifier": 0 }` in the refund allocation, the refund is sent to the **Order object's on-chain address** (not the customer's wallet address). This is by design: the Order object acts as an escrow holding the refunded payment at its own address. The customer subsequently claims the refund from the Order object via a separate withdraw operation. This two-step design ensures the refund is traceable on-chain and tied to the specific order, providing better dispute resolution and audit trail.
|
|
629
596
|
|
|
630
|
-
####
|
|
597
|
+
#### 6.2 Create and Publish Service
|
|
631
598
|
|
|
632
599
|
**Prompt**: Create and publish a Service named "myshop_service_v2" with machine "myshop_machine_v2", order allocation using Guards, after-sales contact, and toy products.
|
|
633
600
|
|
|
@@ -677,7 +644,7 @@ The `order_allocators` configuration defines how order payments are distributed:
|
|
|
677
644
|
"sales": [
|
|
678
645
|
{
|
|
679
646
|
"name": "Play Purse Set 35PCS",
|
|
680
|
-
"price":
|
|
647
|
+
"price": 50000000,
|
|
681
648
|
"stock": 100,
|
|
682
649
|
"suspension": false,
|
|
683
650
|
"wip": "https://wowok.net/test/three_body.wip",
|
|
@@ -685,7 +652,7 @@ The `order_allocators` configuration defines how order payments are distributed:
|
|
|
685
652
|
},
|
|
686
653
|
{
|
|
687
654
|
"name": "Little Girls Purse with Accessories",
|
|
688
|
-
"price":
|
|
655
|
+
"price": 50000000,
|
|
689
656
|
"stock": 50,
|
|
690
657
|
"suspension": false,
|
|
691
658
|
"wip": "https://wowok.net/test/three_body.wip",
|
|
@@ -693,7 +660,7 @@ The `order_allocators` configuration defines how order payments are distributed:
|
|
|
693
660
|
},
|
|
694
661
|
{
|
|
695
662
|
"name": "Tree House Building Set",
|
|
696
|
-
"price":
|
|
663
|
+
"price": 30000000,
|
|
697
664
|
"stock": 75,
|
|
698
665
|
"suspension": false,
|
|
699
666
|
"wip": "https://wowok.net/test/three_body.wip",
|
|
@@ -706,7 +673,8 @@ The `order_allocators` configuration defines how order payments are distributed:
|
|
|
706
673
|
},
|
|
707
674
|
"env": {
|
|
708
675
|
"account": "myshop_merchant",
|
|
709
|
-
"network": "
|
|
676
|
+
"network": "mainnet",
|
|
677
|
+
"confirmed": true
|
|
710
678
|
}
|
|
711
679
|
}
|
|
712
680
|
```
|
|
@@ -718,11 +686,11 @@ The `order_allocators` configuration defines how order payments are distributed:
|
|
|
718
686
|
|
|
719
687
|
---
|
|
720
688
|
|
|
721
|
-
### Step
|
|
689
|
+
### Step 7: Update Product Pricing (Optional)
|
|
722
690
|
|
|
723
691
|
To offer promotional pricing, update product prices using the `sales` operation with `op: "set"`:
|
|
724
692
|
|
|
725
|
-
**Prompt**: Update the price of "Play Purse Set 35PCS" to
|
|
693
|
+
**Prompt**: Update the price of "Play Purse Set 35PCS" to 0.04 WOW for a promotion.
|
|
726
694
|
|
|
727
695
|
```json
|
|
728
696
|
{
|
|
@@ -734,7 +702,7 @@ To offer promotional pricing, update product prices using the `sales` operation
|
|
|
734
702
|
"sales": [
|
|
735
703
|
{
|
|
736
704
|
"name": "Play Purse Set 35PCS",
|
|
737
|
-
"price":
|
|
705
|
+
"price": 40000000,
|
|
738
706
|
"stock": 100,
|
|
739
707
|
"suspension": false,
|
|
740
708
|
"wip": "https://wowok.net/test/three_body.wip",
|
|
@@ -745,7 +713,8 @@ To offer promotional pricing, update product prices using the `sales` operation
|
|
|
745
713
|
},
|
|
746
714
|
"env": {
|
|
747
715
|
"account": "myshop_merchant",
|
|
748
|
-
"network": "
|
|
716
|
+
"network": "mainnet",
|
|
717
|
+
"confirmed": true
|
|
749
718
|
}
|
|
750
719
|
}
|
|
751
720
|
```
|
|
@@ -771,18 +740,22 @@ Create a customer account:
|
|
|
771
740
|
}
|
|
772
741
|
```
|
|
773
742
|
|
|
774
|
-
**Get
|
|
743
|
+
**Get mainnet tokens:**
|
|
744
|
+
|
|
745
|
+
**Prompt**: Transfer 1 WOW to account "myshop_customer" from a funded account for gas fees.
|
|
775
746
|
|
|
776
747
|
```json
|
|
777
748
|
{
|
|
778
|
-
"
|
|
779
|
-
"
|
|
780
|
-
"
|
|
749
|
+
"transfer": {
|
|
750
|
+
"name_or_address_to": "myshop_customer",
|
|
751
|
+
"amount": 1000000000,
|
|
752
|
+
"network": "mainnet",
|
|
753
|
+
"confirmed": true
|
|
781
754
|
}
|
|
782
755
|
}
|
|
783
756
|
```
|
|
784
757
|
|
|
785
|
-
> **Note**:
|
|
758
|
+
> **Note**: Ensure sufficient WOW balance for order payments plus gas fees. If needed, transfer additional tokens from a funded account.
|
|
786
759
|
|
|
787
760
|
---
|
|
788
761
|
|
|
@@ -800,13 +773,15 @@ Customers can query the Service to see available products.
|
|
|
800
773
|
}
|
|
801
774
|
```
|
|
802
775
|
|
|
776
|
+
> **AI Note**: Capture the `wip_hash` from the Service query result for each product. When the customer places an order, pass the captured `wip_hash` in `buy.items[].wip_hash`. **The `wip_hash` field cannot be an empty string** — it must match the hash stored in the Service. This is a dispute-prevention mechanism — the on-chain contract compares `item.wip_hash` against the Service's current `sale.wip_hash` to ensure the product hasn't been swapped between browse and purchase time.
|
|
777
|
+
|
|
803
778
|
---
|
|
804
779
|
|
|
805
780
|
### Step 2: Create Order (Customer Purchase)
|
|
806
781
|
|
|
807
782
|
Customer creates an order by purchasing products from the Service.
|
|
808
783
|
|
|
809
|
-
**Prompt**: Create an order for customer "myshop_customer" to purchase "Play Purse Set 35PCS" from "myshop_service_v2" with payment of
|
|
784
|
+
**Prompt**: Create an order for customer "myshop_customer" to purchase "Play Purse Set 35PCS" from "myshop_service_v2" with payment of 0.05 WOW.
|
|
810
785
|
|
|
811
786
|
```json
|
|
812
787
|
{
|
|
@@ -819,27 +794,31 @@ Customer creates an order by purchasing products from the Service.
|
|
|
819
794
|
{
|
|
820
795
|
"name": "Play Purse Set 35PCS",
|
|
821
796
|
"stock": 1,
|
|
822
|
-
"wip_hash": ""
|
|
797
|
+
"wip_hash": "03c18561efa8faf4d75480eb1f732c4a46ffde95599e92eca06167785fc07a5b"
|
|
823
798
|
}
|
|
824
799
|
],
|
|
825
800
|
"total_pay": {
|
|
826
|
-
"balance":
|
|
801
|
+
"balance": 50000000
|
|
827
802
|
}
|
|
828
803
|
},
|
|
829
804
|
"namedNewOrder": {
|
|
830
|
-
"name": "myshop_test_order"
|
|
805
|
+
"name": "myshop_test_order",
|
|
806
|
+
"replaceExistName": true
|
|
831
807
|
},
|
|
832
808
|
"namedNewProgress": {
|
|
833
|
-
"name": "myshop_test_progress"
|
|
809
|
+
"name": "myshop_test_progress",
|
|
810
|
+
"replaceExistName": true
|
|
834
811
|
},
|
|
835
812
|
"namedNewAllocation": {
|
|
836
|
-
"name": "myshop_test_allocation"
|
|
813
|
+
"name": "myshop_test_allocation",
|
|
814
|
+
"replaceExistName": true
|
|
837
815
|
}
|
|
838
816
|
}
|
|
839
817
|
},
|
|
840
818
|
"env": {
|
|
841
819
|
"account": "myshop_customer",
|
|
842
|
-
"network": "
|
|
820
|
+
"network": "mainnet",
|
|
821
|
+
"confirmed": true
|
|
843
822
|
}
|
|
844
823
|
}
|
|
845
824
|
```
|
|
@@ -1003,7 +982,8 @@ Merchant advances the order from initial state to "Order Confirmation" node.
|
|
|
1003
982
|
},
|
|
1004
983
|
"env": {
|
|
1005
984
|
"account": "myshop_merchant",
|
|
1006
|
-
"network": "
|
|
985
|
+
"network": "mainnet",
|
|
986
|
+
"confirmed": true
|
|
1007
987
|
}
|
|
1008
988
|
}
|
|
1009
989
|
```
|
|
@@ -1032,7 +1012,8 @@ Merchant ships the order and advances from "Order Confirmation" to "Shipping".
|
|
|
1032
1012
|
},
|
|
1033
1013
|
"env": {
|
|
1034
1014
|
"account": "myshop_merchant",
|
|
1035
|
-
"network": "
|
|
1015
|
+
"network": "mainnet",
|
|
1016
|
+
"confirmed": true
|
|
1036
1017
|
}
|
|
1037
1018
|
}
|
|
1038
1019
|
```
|
|
@@ -1061,7 +1042,8 @@ Merchant or delivery service confirms the order has been delivered.
|
|
|
1061
1042
|
},
|
|
1062
1043
|
"env": {
|
|
1063
1044
|
"account": "myshop_merchant",
|
|
1064
|
-
"network": "
|
|
1045
|
+
"network": "mainnet",
|
|
1046
|
+
"confirmed": true
|
|
1065
1047
|
}
|
|
1066
1048
|
}
|
|
1067
1049
|
```
|
|
@@ -1090,7 +1072,8 @@ Customer confirms receipt and completes the order.
|
|
|
1090
1072
|
},
|
|
1091
1073
|
"env": {
|
|
1092
1074
|
"account": "myshop_customer",
|
|
1093
|
-
"network": "
|
|
1075
|
+
"network": "mainnet",
|
|
1076
|
+
"confirmed": true
|
|
1094
1077
|
}
|
|
1095
1078
|
}
|
|
1096
1079
|
```
|
|
@@ -1103,7 +1086,7 @@ After order completion, the merchant needs to:
|
|
|
1103
1086
|
1. Activate the Allocation by verifying the Guard (order completion status)
|
|
1104
1087
|
2. Withdraw funds from the Service
|
|
1105
1088
|
|
|
1106
|
-
####
|
|
1089
|
+
#### 7.1 Activate Allocation (Guard Verification)
|
|
1107
1090
|
|
|
1108
1091
|
First, activate the Allocation by submitting the Guard verification with the Order ID.
|
|
1109
1092
|
|
|
@@ -1143,7 +1126,8 @@ First, activate the Allocation by submitting the Guard verification with the Ord
|
|
|
1143
1126
|
},
|
|
1144
1127
|
"env": {
|
|
1145
1128
|
"account": "myshop_merchant",
|
|
1146
|
-
"network": "
|
|
1129
|
+
"network": "mainnet",
|
|
1130
|
+
"confirmed": true,
|
|
1147
1131
|
"no_cache": true
|
|
1148
1132
|
}
|
|
1149
1133
|
}
|
|
@@ -1151,7 +1135,7 @@ First, activate the Allocation by submitting the Guard verification with the Ord
|
|
|
1151
1135
|
|
|
1152
1136
|
> **Note**: Replace the Guard address `0x5af9...1074` and Order address `0xa6db...3d5` with your actual object addresses. Use the full 64-character addresses in actual operations.
|
|
1153
1137
|
|
|
1154
|
-
####
|
|
1138
|
+
#### 7.2 Withdraw Funds from Service
|
|
1155
1139
|
|
|
1156
1140
|
After the Allocation is activated, withdraw the funds from the Service.
|
|
1157
1141
|
|
|
@@ -1166,7 +1150,8 @@ After the Allocation is activated, withdraw the funds from the Service.
|
|
|
1166
1150
|
},
|
|
1167
1151
|
"env": {
|
|
1168
1152
|
"account": "myshop_merchant",
|
|
1169
|
-
"network": "
|
|
1153
|
+
"network": "mainnet",
|
|
1154
|
+
"confirmed": true
|
|
1170
1155
|
}
|
|
1171
1156
|
}
|
|
1172
1157
|
```
|
|
@@ -1197,7 +1182,8 @@ Customer can cancel the order after the merchant confirms it. The "Cancel Order"
|
|
|
1197
1182
|
},
|
|
1198
1183
|
"env": {
|
|
1199
1184
|
"account": "myshop_merchant",
|
|
1200
|
-
"network": "
|
|
1185
|
+
"network": "mainnet",
|
|
1186
|
+
"confirmed": true
|
|
1201
1187
|
}
|
|
1202
1188
|
}
|
|
1203
1189
|
```
|
|
@@ -1222,7 +1208,8 @@ Customer can cancel the order after the merchant confirms it. The "Cancel Order"
|
|
|
1222
1208
|
},
|
|
1223
1209
|
"env": {
|
|
1224
1210
|
"account": "myshop_customer",
|
|
1225
|
-
"network": "
|
|
1211
|
+
"network": "mainnet",
|
|
1212
|
+
"confirmed": true
|
|
1226
1213
|
}
|
|
1227
1214
|
}
|
|
1228
1215
|
```
|
|
@@ -1265,7 +1252,8 @@ After the order is cancelled, the customer can activate the refund allocation us
|
|
|
1265
1252
|
},
|
|
1266
1253
|
"env": {
|
|
1267
1254
|
"account": "myshop_customer",
|
|
1268
|
-
"network": "
|
|
1255
|
+
"network": "mainnet",
|
|
1256
|
+
"confirmed": true,
|
|
1269
1257
|
"no_cache": true
|
|
1270
1258
|
}
|
|
1271
1259
|
}
|
|
@@ -1290,18 +1278,19 @@ This flow handles order disputes through a formal arbitration process. The arbit
|
|
|
1290
1278
|
|
|
1291
1279
|
The Service must have a compensation fund balance ≥ the arbitration indemnity amount. The merchant pre-funds this before any disputes.
|
|
1292
1280
|
|
|
1293
|
-
**Prompt**: Merchant adds
|
|
1281
|
+
**Prompt**: Merchant adds 0.05 WOW to the Service compensation fund.
|
|
1294
1282
|
|
|
1295
1283
|
```json
|
|
1296
1284
|
{
|
|
1297
1285
|
"operation_type": "service",
|
|
1298
1286
|
"data": {
|
|
1299
1287
|
"object": "myshop_service_v2",
|
|
1300
|
-
"compensation_fund_add": {"balance":
|
|
1288
|
+
"compensation_fund_add": {"balance": 50000000}
|
|
1301
1289
|
},
|
|
1302
1290
|
"env": {
|
|
1303
1291
|
"account": "myshop_merchant",
|
|
1304
|
-
"network": "
|
|
1292
|
+
"network": "mainnet",
|
|
1293
|
+
"confirmed": true
|
|
1305
1294
|
}
|
|
1306
1295
|
}
|
|
1307
1296
|
```
|
|
@@ -1325,11 +1314,12 @@ Create an Arbitration object for handling order disputes.
|
|
|
1325
1314
|
},
|
|
1326
1315
|
"description": "Arbitration system for MyShop toy store disputes",
|
|
1327
1316
|
"location": "Online arbitration system",
|
|
1328
|
-
"fee":
|
|
1317
|
+
"fee": 5000000
|
|
1329
1318
|
},
|
|
1330
1319
|
"env": {
|
|
1331
1320
|
"account": "myshop_merchant",
|
|
1332
|
-
"network": "
|
|
1321
|
+
"network": "mainnet",
|
|
1322
|
+
"confirmed": true
|
|
1333
1323
|
}
|
|
1334
1324
|
}
|
|
1335
1325
|
```
|
|
@@ -1351,7 +1341,8 @@ The merchant unpauses the Arbitration object to enable dispute submissions.
|
|
|
1351
1341
|
},
|
|
1352
1342
|
"env": {
|
|
1353
1343
|
"account": "myshop_merchant",
|
|
1354
|
-
"network": "
|
|
1344
|
+
"network": "mainnet",
|
|
1345
|
+
"confirmed": true
|
|
1355
1346
|
}
|
|
1356
1347
|
}
|
|
1357
1348
|
```
|
|
@@ -1372,10 +1363,11 @@ Create a new order for testing the arbitration flow (if you don't have one alrea
|
|
|
1372
1363
|
"items": [
|
|
1373
1364
|
{
|
|
1374
1365
|
"name": "Tree House Building Set",
|
|
1375
|
-
"stock": 1
|
|
1366
|
+
"stock": 1,
|
|
1367
|
+
"wip_hash": "03c18561efa8faf4d75480eb1f732c4a46ffde95599e92eca06167785fc07a5b"
|
|
1376
1368
|
}
|
|
1377
1369
|
],
|
|
1378
|
-
"total_pay": {"balance":
|
|
1370
|
+
"total_pay": {"balance": 30000000}
|
|
1379
1371
|
},
|
|
1380
1372
|
"namedNewOrder": {"name": "myshop_arb_order", "replaceExistName": true},
|
|
1381
1373
|
"namedNewProgress": {"name": "myshop_arb_progress", "replaceExistName": true},
|
|
@@ -1384,12 +1376,13 @@ Create a new order for testing the arbitration flow (if you don't have one alrea
|
|
|
1384
1376
|
},
|
|
1385
1377
|
"env": {
|
|
1386
1378
|
"account": "myshop_customer",
|
|
1387
|
-
"network": "
|
|
1379
|
+
"network": "mainnet",
|
|
1380
|
+
"confirmed": true
|
|
1388
1381
|
}
|
|
1389
1382
|
}
|
|
1390
1383
|
```
|
|
1391
1384
|
|
|
1392
|
-
> **Note**: The
|
|
1385
|
+
> **Note**: The `wip_hash` must be obtained from the Service query result (Step 1 of Part 2). It cannot be omitted or set to an empty string — the on-chain contract validates it against the Service's current `sale.wip_hash`.
|
|
1393
1386
|
|
|
1394
1387
|
### Step 5: Customer Submits Dispute
|
|
1395
1388
|
|
|
@@ -1406,18 +1399,19 @@ The customer submits a dispute against the order, creating an Arb object.
|
|
|
1406
1399
|
"order": "myshop_arb_order",
|
|
1407
1400
|
"description": "Product quality issue - the tree house set arrived damaged",
|
|
1408
1401
|
"proposition": ["Full refund to customer", "Partial refund 50%", "Replace with new product"],
|
|
1409
|
-
"fee": {"balance":
|
|
1402
|
+
"fee": {"balance": 5000000},
|
|
1410
1403
|
"namedArb": {"name": "myshop_arb_case", "replaceExistName": true}
|
|
1411
1404
|
}
|
|
1412
1405
|
},
|
|
1413
1406
|
"env": {
|
|
1414
1407
|
"account": "myshop_customer",
|
|
1415
|
-
"network": "
|
|
1408
|
+
"network": "mainnet",
|
|
1409
|
+
"confirmed": true
|
|
1416
1410
|
}
|
|
1417
1411
|
}
|
|
1418
1412
|
```
|
|
1419
1413
|
|
|
1420
|
-
> **Note**: The dispute fee (
|
|
1414
|
+
> **Note**: The dispute fee (5000000 = 0.005 WOW) must be ≥ the Arbitration object's fee setting. The Arb object is created with status=1 (Arbitrator_confirming).
|
|
1421
1415
|
|
|
1422
1416
|
### Step 6: Merchant Confirms Materials
|
|
1423
1417
|
|
|
@@ -1437,7 +1431,8 @@ The merchant confirms the dispute materials are valid and sets the voting deadli
|
|
|
1437
1431
|
},
|
|
1438
1432
|
"env": {
|
|
1439
1433
|
"account": "myshop_merchant",
|
|
1440
|
-
"network": "
|
|
1434
|
+
"network": "mainnet",
|
|
1435
|
+
"confirmed": true
|
|
1441
1436
|
}
|
|
1442
1437
|
}
|
|
1443
1438
|
```
|
|
@@ -1448,7 +1443,7 @@ The merchant confirms the dispute materials are valid and sets the voting deadli
|
|
|
1448
1443
|
|
|
1449
1444
|
The merchant provides the final arbitration result with feedback and indemnity amount.
|
|
1450
1445
|
|
|
1451
|
-
**Prompt**: Merchant "myshop_merchant" provides arbitration result for Arb "myshop_arb_case" with
|
|
1446
|
+
**Prompt**: Merchant "myshop_merchant" provides arbitration result for Arb "myshop_arb_case" with 0.03 WOW indemnity.
|
|
1452
1447
|
|
|
1453
1448
|
```json
|
|
1454
1449
|
{
|
|
@@ -1458,12 +1453,13 @@ The merchant provides the final arbitration result with feedback and indemnity a
|
|
|
1458
1453
|
"arbitration": {
|
|
1459
1454
|
"arb": "myshop_arb_case",
|
|
1460
1455
|
"feedback": "After investigation, the product quality issue is confirmed. Full refund to customer and return shipping cost covered by merchant.",
|
|
1461
|
-
"indemnity":
|
|
1456
|
+
"indemnity": 30000000
|
|
1462
1457
|
}
|
|
1463
1458
|
},
|
|
1464
1459
|
"env": {
|
|
1465
1460
|
"account": "myshop_merchant",
|
|
1466
|
-
"network": "
|
|
1461
|
+
"network": "mainnet",
|
|
1462
|
+
"confirmed": true
|
|
1467
1463
|
}
|
|
1468
1464
|
}
|
|
1469
1465
|
```
|
|
@@ -1487,12 +1483,13 @@ The customer claims the compensation from the Service's compensation fund.
|
|
|
1487
1483
|
},
|
|
1488
1484
|
"env": {
|
|
1489
1485
|
"account": "myshop_customer",
|
|
1490
|
-
"network": "
|
|
1486
|
+
"network": "mainnet",
|
|
1487
|
+
"confirmed": true
|
|
1491
1488
|
}
|
|
1492
1489
|
}
|
|
1493
1490
|
```
|
|
1494
1491
|
|
|
1495
|
-
> **Note**: The customer receives the indemnity amount (
|
|
1492
|
+
> **Note**: The customer receives the indemnity amount (0.03 WOW) from the Service's compensation fund. The Arb status changes to 5 (Finished). The Order's `claimed_by` field is updated with the Arb address.
|
|
1496
1493
|
|
|
1497
1494
|
### Step 9: Query Arbitration Status
|
|
1498
1495
|
|
|
@@ -1505,7 +1502,7 @@ Check the final status of the arbitration.
|
|
|
1505
1502
|
"query_type": "onchain_objects",
|
|
1506
1503
|
"objects": ["myshop_arb_case"],
|
|
1507
1504
|
"no_cache": true,
|
|
1508
|
-
"network": "
|
|
1505
|
+
"network": "mainnet"
|
|
1509
1506
|
}
|
|
1510
1507
|
```
|
|
1511
1508
|
|
|
@@ -1566,7 +1563,8 @@ When advancing order workflows, use `operation_type: "progress"` with the `opera
|
|
|
1566
1563
|
},
|
|
1567
1564
|
"env": {
|
|
1568
1565
|
"account": "operator_account",
|
|
1569
|
-
"network": "
|
|
1566
|
+
"network": "mainnet",
|
|
1567
|
+
"confirmed": true
|
|
1570
1568
|
}
|
|
1571
1569
|
}
|
|
1572
1570
|
```
|
|
@@ -1617,5 +1615,5 @@ The operator account depends on the forward definition:
|
|
|
1617
1615
|
|
|
1618
1616
|
- All addresses shown in examples are truncated for readability (format: 0xabcd...efgh)
|
|
1619
1617
|
- Use the full 64-character address in actual operations
|
|
1620
|
-
-
|
|
1618
|
+
- Deploy and run on mainnet
|
|
1621
1619
|
- Ensure sufficient WOW tokens for transaction fees
|