@wowok/skills 1.1.12 → 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 +180 -189
- 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-guard/SKILL.md +125 -19
|
@@ -109,8 +109,10 @@ Before starting, ensure you have:
|
|
|
109
109
|
```json
|
|
110
110
|
{
|
|
111
111
|
"transfer": {
|
|
112
|
-
"
|
|
113
|
-
"amount": 1000000000
|
|
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": "mainnet"
|
|
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": "mainnet"
|
|
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": "mainnet"
|
|
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": "mainnet"
|
|
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": "mainnet"
|
|
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": "mainnet"
|
|
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": "mainnet"
|
|
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
|
|
|
@@ -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": "mainnet"
|
|
676
|
+
"network": "mainnet",
|
|
677
|
+
"confirmed": true
|
|
710
678
|
}
|
|
711
679
|
}
|
|
712
680
|
```
|
|
@@ -718,7 +686,7 @@ 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
|
|
|
@@ -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": "mainnet"
|
|
716
|
+
"network": "mainnet",
|
|
717
|
+
"confirmed": true
|
|
749
718
|
}
|
|
750
719
|
}
|
|
751
720
|
```
|
|
@@ -778,8 +747,10 @@ Create a customer account:
|
|
|
778
747
|
```json
|
|
779
748
|
{
|
|
780
749
|
"transfer": {
|
|
781
|
-
"
|
|
782
|
-
"amount": 1000000000
|
|
750
|
+
"name_or_address_to": "myshop_customer",
|
|
751
|
+
"amount": 1000000000,
|
|
752
|
+
"network": "mainnet",
|
|
753
|
+
"confirmed": true
|
|
783
754
|
}
|
|
784
755
|
}
|
|
785
756
|
```
|
|
@@ -802,7 +773,7 @@ Customers can query the Service to see available products.
|
|
|
802
773
|
}
|
|
803
774
|
```
|
|
804
775
|
|
|
805
|
-
> **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`. 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.
|
|
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.
|
|
806
777
|
|
|
807
778
|
---
|
|
808
779
|
|
|
@@ -823,7 +794,7 @@ Customer creates an order by purchasing products from the Service.
|
|
|
823
794
|
{
|
|
824
795
|
"name": "Play Purse Set 35PCS",
|
|
825
796
|
"stock": 1,
|
|
826
|
-
"wip_hash": ""
|
|
797
|
+
"wip_hash": "03c18561efa8faf4d75480eb1f732c4a46ffde95599e92eca06167785fc07a5b"
|
|
827
798
|
}
|
|
828
799
|
],
|
|
829
800
|
"total_pay": {
|
|
@@ -846,7 +817,8 @@ Customer creates an order by purchasing products from the Service.
|
|
|
846
817
|
},
|
|
847
818
|
"env": {
|
|
848
819
|
"account": "myshop_customer",
|
|
849
|
-
"network": "mainnet"
|
|
820
|
+
"network": "mainnet",
|
|
821
|
+
"confirmed": true
|
|
850
822
|
}
|
|
851
823
|
}
|
|
852
824
|
```
|
|
@@ -1010,7 +982,8 @@ Merchant advances the order from initial state to "Order Confirmation" node.
|
|
|
1010
982
|
},
|
|
1011
983
|
"env": {
|
|
1012
984
|
"account": "myshop_merchant",
|
|
1013
|
-
"network": "mainnet"
|
|
985
|
+
"network": "mainnet",
|
|
986
|
+
"confirmed": true
|
|
1014
987
|
}
|
|
1015
988
|
}
|
|
1016
989
|
```
|
|
@@ -1039,7 +1012,8 @@ Merchant ships the order and advances from "Order Confirmation" to "Shipping".
|
|
|
1039
1012
|
},
|
|
1040
1013
|
"env": {
|
|
1041
1014
|
"account": "myshop_merchant",
|
|
1042
|
-
"network": "mainnet"
|
|
1015
|
+
"network": "mainnet",
|
|
1016
|
+
"confirmed": true
|
|
1043
1017
|
}
|
|
1044
1018
|
}
|
|
1045
1019
|
```
|
|
@@ -1068,7 +1042,8 @@ Merchant or delivery service confirms the order has been delivered.
|
|
|
1068
1042
|
},
|
|
1069
1043
|
"env": {
|
|
1070
1044
|
"account": "myshop_merchant",
|
|
1071
|
-
"network": "mainnet"
|
|
1045
|
+
"network": "mainnet",
|
|
1046
|
+
"confirmed": true
|
|
1072
1047
|
}
|
|
1073
1048
|
}
|
|
1074
1049
|
```
|
|
@@ -1097,7 +1072,8 @@ Customer confirms receipt and completes the order.
|
|
|
1097
1072
|
},
|
|
1098
1073
|
"env": {
|
|
1099
1074
|
"account": "myshop_customer",
|
|
1100
|
-
"network": "mainnet"
|
|
1075
|
+
"network": "mainnet",
|
|
1076
|
+
"confirmed": true
|
|
1101
1077
|
}
|
|
1102
1078
|
}
|
|
1103
1079
|
```
|
|
@@ -1110,7 +1086,7 @@ After order completion, the merchant needs to:
|
|
|
1110
1086
|
1. Activate the Allocation by verifying the Guard (order completion status)
|
|
1111
1087
|
2. Withdraw funds from the Service
|
|
1112
1088
|
|
|
1113
|
-
####
|
|
1089
|
+
#### 7.1 Activate Allocation (Guard Verification)
|
|
1114
1090
|
|
|
1115
1091
|
First, activate the Allocation by submitting the Guard verification with the Order ID.
|
|
1116
1092
|
|
|
@@ -1151,6 +1127,7 @@ First, activate the Allocation by submitting the Guard verification with the Ord
|
|
|
1151
1127
|
"env": {
|
|
1152
1128
|
"account": "myshop_merchant",
|
|
1153
1129
|
"network": "mainnet",
|
|
1130
|
+
"confirmed": true,
|
|
1154
1131
|
"no_cache": true
|
|
1155
1132
|
}
|
|
1156
1133
|
}
|
|
@@ -1158,7 +1135,7 @@ First, activate the Allocation by submitting the Guard verification with the Ord
|
|
|
1158
1135
|
|
|
1159
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.
|
|
1160
1137
|
|
|
1161
|
-
####
|
|
1138
|
+
#### 7.2 Withdraw Funds from Service
|
|
1162
1139
|
|
|
1163
1140
|
After the Allocation is activated, withdraw the funds from the Service.
|
|
1164
1141
|
|
|
@@ -1173,7 +1150,8 @@ After the Allocation is activated, withdraw the funds from the Service.
|
|
|
1173
1150
|
},
|
|
1174
1151
|
"env": {
|
|
1175
1152
|
"account": "myshop_merchant",
|
|
1176
|
-
"network": "mainnet"
|
|
1153
|
+
"network": "mainnet",
|
|
1154
|
+
"confirmed": true
|
|
1177
1155
|
}
|
|
1178
1156
|
}
|
|
1179
1157
|
```
|
|
@@ -1204,7 +1182,8 @@ Customer can cancel the order after the merchant confirms it. The "Cancel Order"
|
|
|
1204
1182
|
},
|
|
1205
1183
|
"env": {
|
|
1206
1184
|
"account": "myshop_merchant",
|
|
1207
|
-
"network": "mainnet"
|
|
1185
|
+
"network": "mainnet",
|
|
1186
|
+
"confirmed": true
|
|
1208
1187
|
}
|
|
1209
1188
|
}
|
|
1210
1189
|
```
|
|
@@ -1229,7 +1208,8 @@ Customer can cancel the order after the merchant confirms it. The "Cancel Order"
|
|
|
1229
1208
|
},
|
|
1230
1209
|
"env": {
|
|
1231
1210
|
"account": "myshop_customer",
|
|
1232
|
-
"network": "mainnet"
|
|
1211
|
+
"network": "mainnet",
|
|
1212
|
+
"confirmed": true
|
|
1233
1213
|
}
|
|
1234
1214
|
}
|
|
1235
1215
|
```
|
|
@@ -1273,6 +1253,7 @@ After the order is cancelled, the customer can activate the refund allocation us
|
|
|
1273
1253
|
"env": {
|
|
1274
1254
|
"account": "myshop_customer",
|
|
1275
1255
|
"network": "mainnet",
|
|
1256
|
+
"confirmed": true,
|
|
1276
1257
|
"no_cache": true
|
|
1277
1258
|
}
|
|
1278
1259
|
}
|
|
@@ -1308,7 +1289,8 @@ The Service must have a compensation fund balance ≥ the arbitration indemnity
|
|
|
1308
1289
|
},
|
|
1309
1290
|
"env": {
|
|
1310
1291
|
"account": "myshop_merchant",
|
|
1311
|
-
"network": "mainnet"
|
|
1292
|
+
"network": "mainnet",
|
|
1293
|
+
"confirmed": true
|
|
1312
1294
|
}
|
|
1313
1295
|
}
|
|
1314
1296
|
```
|
|
@@ -1336,7 +1318,8 @@ Create an Arbitration object for handling order disputes.
|
|
|
1336
1318
|
},
|
|
1337
1319
|
"env": {
|
|
1338
1320
|
"account": "myshop_merchant",
|
|
1339
|
-
"network": "mainnet"
|
|
1321
|
+
"network": "mainnet",
|
|
1322
|
+
"confirmed": true
|
|
1340
1323
|
}
|
|
1341
1324
|
}
|
|
1342
1325
|
```
|
|
@@ -1358,7 +1341,8 @@ The merchant unpauses the Arbitration object to enable dispute submissions.
|
|
|
1358
1341
|
},
|
|
1359
1342
|
"env": {
|
|
1360
1343
|
"account": "myshop_merchant",
|
|
1361
|
-
"network": "mainnet"
|
|
1344
|
+
"network": "mainnet",
|
|
1345
|
+
"confirmed": true
|
|
1362
1346
|
}
|
|
1363
1347
|
}
|
|
1364
1348
|
```
|
|
@@ -1379,7 +1363,8 @@ Create a new order for testing the arbitration flow (if you don't have one alrea
|
|
|
1379
1363
|
"items": [
|
|
1380
1364
|
{
|
|
1381
1365
|
"name": "Tree House Building Set",
|
|
1382
|
-
"stock": 1
|
|
1366
|
+
"stock": 1,
|
|
1367
|
+
"wip_hash": "03c18561efa8faf4d75480eb1f732c4a46ffde95599e92eca06167785fc07a5b"
|
|
1383
1368
|
}
|
|
1384
1369
|
],
|
|
1385
1370
|
"total_pay": {"balance": 30000000}
|
|
@@ -1391,12 +1376,13 @@ Create a new order for testing the arbitration flow (if you don't have one alrea
|
|
|
1391
1376
|
},
|
|
1392
1377
|
"env": {
|
|
1393
1378
|
"account": "myshop_customer",
|
|
1394
|
-
"network": "mainnet"
|
|
1379
|
+
"network": "mainnet",
|
|
1380
|
+
"confirmed": true
|
|
1395
1381
|
}
|
|
1396
1382
|
}
|
|
1397
1383
|
```
|
|
1398
1384
|
|
|
1399
|
-
> **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`.
|
|
1400
1386
|
|
|
1401
1387
|
### Step 5: Customer Submits Dispute
|
|
1402
1388
|
|
|
@@ -1419,7 +1405,8 @@ The customer submits a dispute against the order, creating an Arb object.
|
|
|
1419
1405
|
},
|
|
1420
1406
|
"env": {
|
|
1421
1407
|
"account": "myshop_customer",
|
|
1422
|
-
"network": "mainnet"
|
|
1408
|
+
"network": "mainnet",
|
|
1409
|
+
"confirmed": true
|
|
1423
1410
|
}
|
|
1424
1411
|
}
|
|
1425
1412
|
```
|
|
@@ -1444,7 +1431,8 @@ The merchant confirms the dispute materials are valid and sets the voting deadli
|
|
|
1444
1431
|
},
|
|
1445
1432
|
"env": {
|
|
1446
1433
|
"account": "myshop_merchant",
|
|
1447
|
-
"network": "mainnet"
|
|
1434
|
+
"network": "mainnet",
|
|
1435
|
+
"confirmed": true
|
|
1448
1436
|
}
|
|
1449
1437
|
}
|
|
1450
1438
|
```
|
|
@@ -1470,7 +1458,8 @@ The merchant provides the final arbitration result with feedback and indemnity a
|
|
|
1470
1458
|
},
|
|
1471
1459
|
"env": {
|
|
1472
1460
|
"account": "myshop_merchant",
|
|
1473
|
-
"network": "mainnet"
|
|
1461
|
+
"network": "mainnet",
|
|
1462
|
+
"confirmed": true
|
|
1474
1463
|
}
|
|
1475
1464
|
}
|
|
1476
1465
|
```
|
|
@@ -1494,7 +1483,8 @@ The customer claims the compensation from the Service's compensation fund.
|
|
|
1494
1483
|
},
|
|
1495
1484
|
"env": {
|
|
1496
1485
|
"account": "myshop_customer",
|
|
1497
|
-
"network": "mainnet"
|
|
1486
|
+
"network": "mainnet",
|
|
1487
|
+
"confirmed": true
|
|
1498
1488
|
}
|
|
1499
1489
|
}
|
|
1500
1490
|
```
|
|
@@ -1573,7 +1563,8 @@ When advancing order workflows, use `operation_type: "progress"` with the `opera
|
|
|
1573
1563
|
},
|
|
1574
1564
|
"env": {
|
|
1575
1565
|
"account": "operator_account",
|
|
1576
|
-
"network": "mainnet"
|
|
1566
|
+
"network": "mainnet",
|
|
1567
|
+
"confirmed": true
|
|
1577
1568
|
}
|
|
1578
1569
|
}
|
|
1579
1570
|
```
|