@wowok/agent-mcp 2.6.3 → 2.6.6
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 +13 -9
- package/dist/customer/customer-advice.d.ts +31 -0
- package/dist/customer/customer-advice.js +129 -0
- package/dist/customer/index.d.ts +2 -0
- package/dist/customer/index.js +2 -0
- package/dist/customer/info-puzzle.d.ts +8 -1
- package/dist/customer/info-puzzle.js +30 -5
- package/dist/customer/order-monitor.d.ts +2 -0
- package/dist/customer/order-monitor.js +3 -2
- package/dist/customer/post-purchase.d.ts +2 -0
- package/dist/customer/post-purchase.js +6 -5
- package/dist/customer/preorder-compare.d.ts +24 -0
- package/dist/customer/preorder-compare.js +34 -0
- package/dist/customer/reminder-system.d.ts +2 -0
- package/dist/customer/reminder-system.js +2 -1
- package/dist/customer/risk-assessment.js +4 -3
- package/dist/customer/types.d.ts +5 -0
- package/dist/examples/arbitration-dispute-create.json +41 -0
- package/dist/examples/arbitration-vote-weighted.json +35 -0
- package/dist/examples/arbitration-voting-guard-add.json +38 -0
- package/dist/examples/demand-present-service.json +33 -0
- package/dist/examples/gen-passport-verify-guard.json +48 -0
- package/dist/examples/guard-template-balance-check.json +36 -15
- package/dist/examples/guard-template-time-lock.json +33 -12
- package/dist/examples/insurance-guard-claim-timelock.json +75 -0
- package/dist/examples/insurance-guard-withdraw-allocation.json +96 -0
- package/dist/examples/insurance-machine-create-publish.json +75 -0
- package/dist/examples/insurance-service-allocators-publish.json +56 -0
- package/dist/examples/machine-multisig-threshold.json +86 -0
- package/dist/examples/machine-template-7node-rental.json +99 -94
- package/dist/examples/payment-scenario-bound.json +45 -0
- package/dist/examples/rental-ziroom-machine-create.json +126 -114
- package/dist/examples/rental-ziroom-permission-create.json +10 -3
- package/dist/examples/rental-ziroom-service-create.json +27 -18
- package/dist/examples/retail-adv-guard-customer-win-create.json +80 -0
- package/dist/examples/retail-adv-guard-messenger-proof-create.json +65 -0
- package/dist/examples/retail-adv-guard-reward-timeout-create.json +92 -0
- package/dist/examples/retail-adv-reward-guard-add.json +51 -0
- package/dist/examples/retail-myshop-allocation-activate.json +55 -0
- package/dist/examples/retail-myshop-arbitration-create.json +40 -0
- package/dist/examples/retail-myshop-contact-create.json +43 -0
- package/dist/examples/retail-myshop-order-create.json +56 -0
- package/dist/examples/retail-myshop-progress-operate.json +38 -0
- package/dist/examples/retail-myshop-reward-create.json +35 -0
- package/dist/examples/service-discount-issue.json +46 -0
- package/dist/examples/threebody-guard-create.json +56 -0
- package/dist/examples/threebody-machine-create.json +72 -0
- package/dist/examples/threebody-permission-create.json +38 -0
- package/dist/examples/threebody-service-allocators.json +49 -0
- package/dist/examples/travel-guard-time-lock.json +69 -0
- package/dist/examples/travel-guard-weather-oracle.json +70 -0
- package/dist/examples/travel-machine-create.json +136 -0
- package/dist/examples/travel-repository-create.json +47 -0
- package/dist/examples/travel-service-create.json +102 -0
- package/dist/examples/travel-treasury-create.json +34 -0
- package/dist/examples/treasury-deposit.json +37 -0
- package/dist/examples/treasury-withdraw.json +38 -0
- package/dist/extensions/business-modules.d.ts +49 -0
- package/dist/extensions/business-modules.js +287 -0
- package/dist/extensions/capability-manifest.js +192 -5
- package/dist/extensions/constraint-registry.js +3 -1
- package/dist/extensions/modes.js +10 -4
- package/dist/extensions/registry.d.ts +14 -9
- package/dist/extensions/registry.js +69 -14
- package/dist/extensions/types.d.ts +1 -0
- package/dist/knowledge/fund-layer.d.ts +67 -1
- package/dist/knowledge/fund-layer.js +561 -12
- package/dist/knowledge/guard-templates.d.ts +10 -0
- package/dist/knowledge/guard-templates.js +50 -0
- package/dist/knowledge/index.d.ts +2 -2
- package/dist/knowledge/index.js +2 -2
- package/dist/knowledge/machine-risk.js +4 -1
- package/dist/knowledge/progress-context.js +1 -1
- package/dist/knowledge/progress-ledger.js +3 -3
- package/dist/knowledge/progress-templates.js +1 -1
- package/dist/knowledge/progress-translation.js +1 -1
- package/dist/knowledge/safety-rules.d.ts +83 -1
- package/dist/knowledge/safety-rules.js +166 -2
- package/dist/knowledge/scenario-modes.d.ts +1 -1
- package/dist/knowledge/scenario-modes.js +13 -11
- package/dist/knowledge/template-registry.d.ts +48 -0
- package/dist/knowledge/template-registry.js +341 -0
- package/dist/knowledge/tool-constraints.js +6 -6
- package/dist/knowledge/tools-reference.js +11 -8
- package/dist/participation/merchant-interest.d.ts +32 -0
- package/dist/participation/merchant-interest.js +100 -0
- package/dist/participation/radar-core.d.ts +104 -0
- package/dist/participation/radar-core.js +269 -0
- package/dist/project/context-assembly.js +8 -0
- package/dist/project/edit-planner.js +27 -56
- package/dist/project/evaluation.d.ts +36 -0
- package/dist/project/evaluation.js +422 -56
- package/dist/project/game-theory.d.ts +43 -0
- package/dist/project/game-theory.js +177 -0
- package/dist/project/graph-builder.js +1 -0
- package/dist/project/handlers.d.ts +38 -0
- package/dist/project/handlers.js +65 -35
- package/dist/project/intent-analyzer.d.ts +71 -0
- package/dist/project/intent-analyzer.js +149 -0
- package/dist/project/machine-nodes.d.ts +2 -0
- package/dist/project/machine-nodes.js +36 -0
- package/dist/project/merchant-guide.d.ts +165 -0
- package/dist/project/merchant-guide.js +264 -0
- package/dist/project/mode-actions.d.ts +199 -0
- package/dist/project/mode-actions.js +309 -0
- package/dist/project/participation-radar.d.ts +18 -0
- package/dist/project/participation-radar.js +428 -0
- package/dist/project/pipeline-actions.d.ts +101 -0
- package/dist/project/pipeline-actions.js +109 -0
- package/dist/project/semantic-graph.d.ts +95 -0
- package/dist/project/semantic-graph.js +245 -0
- package/dist/schema/call/allocation.d.ts +11 -11
- package/dist/schema/call/allocation.js +11 -1
- package/dist/schema/call/arbitration.d.ts +21 -21
- package/dist/schema/call/arbitration.js +17 -9
- package/dist/schema/call/base.d.ts +2 -2
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +127 -127
- package/dist/schema/call/bridge.js +12 -12
- package/dist/schema/call/contact.d.ts +3 -3
- package/dist/schema/call/demand.d.ts +3 -3
- package/dist/schema/call/guard.d.ts +11 -11
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/machine.d.ts +216 -21
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/order.d.ts +7 -7
- package/dist/schema/call/payment.d.ts +3 -3
- package/dist/schema/call/permission.d.ts +3 -3
- package/dist/schema/call/personal.d.ts +337 -3
- package/dist/schema/call/personal.js +10 -0
- package/dist/schema/call/progress.d.ts +177 -9
- package/dist/schema/call/progress.js +7 -3
- package/dist/schema/call/proof.d.ts +6 -6
- package/dist/schema/call/repository.d.ts +3 -3
- package/dist/schema/call/reward.d.ts +57 -57
- package/dist/schema/call/semantic.js +41 -1
- package/dist/schema/call/service.d.ts +114 -114
- package/dist/schema/call/service.js +11 -2
- package/dist/schema/call/treasury.d.ts +57 -57
- package/dist/schema/messenger/index.js +4 -1
- package/dist/schema/operations.d.ts +713 -291
- package/dist/schema/operations.js +33 -0
- package/dist/schema/project/index.d.ts +4635 -100
- package/dist/schema/project/index.js +868 -1
- package/dist/schema/query/index.d.ts +363 -19
- package/dist/schema/query/index.js +25 -3
- package/dist/schema/schema-query/index.d.ts +13 -7
- package/dist/schema/schema-query/index.js +29 -5
- package/dist/schema/trust/index.d.ts +1012 -6
- package/dist/schema/trust/index.js +212 -11
- package/dist/schema/utils/skills-recommendation.js +1 -0
- package/dist/schema-query/index.d.ts +4 -1
- package/dist/schema-query/index.js +255 -1
- package/dist/schemas/bridge_operation.schema.json +14 -7
- package/dist/schemas/guard2file.schema.json +2 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/machineNode2file.schema.json +2 -0
- package/dist/schemas/messenger_operation.schema.json +1 -1
- package/dist/schemas/onchain_operations.schema.json +143 -15
- package/dist/schemas/onchain_operations_allocation.schema.json +2 -1
- package/dist/schemas/onchain_operations_arbitration.schema.json +7 -5
- package/dist/schemas/onchain_operations_contact.schema.json +1 -0
- package/dist/schemas/onchain_operations_demand.schema.json +1 -0
- package/dist/schemas/onchain_operations_gen_passport.schema.json +2 -0
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -0
- package/dist/schemas/onchain_operations_guard.schema.json +578 -0
- package/dist/schemas/onchain_operations_machine.schema.json +1 -0
- package/dist/schemas/onchain_operations_order.schema.json +4 -3
- package/dist/schemas/onchain_operations_payment.schema.json +1 -0
- package/dist/schemas/onchain_operations_permission.schema.json +1 -0
- package/dist/schemas/onchain_operations_personal.schema.json +37 -0
- package/dist/schemas/onchain_operations_progress.schema.json +90 -3
- package/dist/schemas/onchain_operations_proof.schema.json +1 -0
- package/dist/schemas/onchain_operations_repository.schema.json +1 -0
- package/dist/schemas/onchain_operations_reward.schema.json +1 -0
- package/dist/schemas/onchain_operations_service.schema.json +4 -3
- package/dist/schemas/onchain_operations_treasury.schema.json +1 -0
- package/dist/schemas/project_operation.output.json +2243 -1
- package/dist/schemas/project_operation.schema.json +683 -1
- package/dist/schemas/query_toolkit.output.json +1 -1
- package/dist/schemas/query_toolkit.schema.json +37 -0
- package/dist/schemas/schema_query.output.json +1 -1
- package/dist/schemas/schema_query.schema.json +30 -5
- package/dist/schemas/trust_score.output.json +392 -1
- package/dist/schemas/trust_score.schema.json +275 -1
- package/dist/tools/handlers/onchain.js +73 -8
- package/dist/tools/handlers/project.js +46 -0
- package/dist/tools/handlers/query.js +117 -2
- package/dist/tools/handlers/schema-query.js +41 -0
- package/dist/tools/handlers/trust.js +192 -6
- package/dist/tools/index.js +52 -9
- package/dist/tools/wrap.js +194 -15
- package/package.json +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"title": "Create Service with 3-path Allocation (Ziroom Rental)",
|
|
3
|
-
"description": "Create a Service with machine, buy_guard, contact, and 3-path order_allocators (rent/refund/damage)",
|
|
3
|
+
"description": "Create a Service with machine, buy_guard, contact, and 3-path order_allocators (rent to operator / refund to customer signer / damage deduction to operator)",
|
|
4
4
|
"tags": ["service", "allocation", "rental", "order_allocators", "guard"],
|
|
5
5
|
"industry": "rental",
|
|
6
6
|
"operation_type": "service",
|
|
7
|
-
"source": "ziroom testnet deployment 2026-07-29",
|
|
7
|
+
"source": "ziroom testnet deployment 2026-07-29 (repaired to current schema)",
|
|
8
8
|
"verified": true,
|
|
9
9
|
"network": "testnet",
|
|
10
10
|
"call": {
|
|
@@ -14,21 +14,26 @@
|
|
|
14
14
|
"object": {
|
|
15
15
|
"name": "ziroom_service_v1",
|
|
16
16
|
"tags": ["project:ziroom", "type:service"],
|
|
17
|
-
"replaceExistName": true
|
|
17
|
+
"replaceExistName": true,
|
|
18
|
+
"permission": "ziroom_permission_v1",
|
|
19
|
+
"type_parameter": "0x2::wow::WOW"
|
|
18
20
|
},
|
|
19
|
-
"permission": "ziroom_permission_v1",
|
|
20
21
|
"machine": "ziroom_machine_v1",
|
|
21
22
|
"buy_guard": "ziroom_buy_guard_v1",
|
|
22
23
|
"um": "ziroom_contact_v1",
|
|
23
|
-
"sales":
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
"sales": {
|
|
25
|
+
"op": "add",
|
|
26
|
+
"sales": [
|
|
27
|
+
{
|
|
28
|
+
"name": "ziroom_apartment_v1",
|
|
29
|
+
"price": 2000000000,
|
|
30
|
+
"stock": 1,
|
|
31
|
+
"suspension": false,
|
|
32
|
+
"wip": "",
|
|
33
|
+
"wip_hash": ""
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
32
37
|
"order_allocators": {
|
|
33
38
|
"description": "3-path allocation: rent to operator, refund to customer, damage deductions",
|
|
34
39
|
"threshold": 1000000000,
|
|
@@ -37,7 +42,7 @@
|
|
|
37
42
|
"guard": "ziroom_buy_guard_v1",
|
|
38
43
|
"sharing": [
|
|
39
44
|
{
|
|
40
|
-
"who": { "Entity": { "name_or_address": "
|
|
45
|
+
"who": { "Entity": { "name_or_address": "ziroom_operator" } },
|
|
41
46
|
"sharing": 1000000000,
|
|
42
47
|
"mode": "Amount"
|
|
43
48
|
}
|
|
@@ -57,7 +62,7 @@
|
|
|
57
62
|
"guard": "ziroom_damage_guard_v1",
|
|
58
63
|
"sharing": [
|
|
59
64
|
{
|
|
60
|
-
"who": { "Entity": { "name_or_address": "
|
|
65
|
+
"who": { "Entity": { "name_or_address": "ziroom_operator" } },
|
|
61
66
|
"sharing": 1000000000,
|
|
62
67
|
"mode": "Amount"
|
|
63
68
|
}
|
|
@@ -73,8 +78,12 @@
|
|
|
73
78
|
}
|
|
74
79
|
},
|
|
75
80
|
"notes": [
|
|
76
|
-
"order_allocators is PERMANENTLY IMMUTABLE after publish (service.move:503)",
|
|
77
|
-
"Signer recipient means the tx sender at alloc() time — customer must call alloc_by_guard
|
|
78
|
-
"Amount mode: fixed amount, not percentage. Use Rate mode (10000=100%) for proportional splits"
|
|
81
|
+
"order_allocators is PERMANENTLY IMMUTABLE after publish (service.move:503) — set it BEFORE publish=true.",
|
|
82
|
+
"Signer recipient means the tx sender at alloc() time — the customer must call alloc_by_guard THEMSELVES for refunds (if the operator calls it, the operator receives the funds).",
|
|
83
|
+
"Amount mode: fixed amount in smallest unit, not percentage. Use Rate mode (10000=100%) for proportional splits; Rate items must sum to exactly 10000 when no Surplus item exists.",
|
|
84
|
+
"sales is an op discriminated union: {op:'add'|'set', sales:[...]} or {op:'remove', sales_name:[...]} or {op:'clear'} — never a bare array.",
|
|
85
|
+
"permission and type_parameter live INSIDE 'object' (TypeNamedObjectWithPermissionSchema). wip/wip_hash empty strings skip verification (TESTING ONLY — production must use real WIP URLs).",
|
|
86
|
+
"machine must be PUBLISHED before binding here; buy_guard may use a LocalMark NAME to break the Guard↔Service circular dependency (Phase-1 create without publish, then publish in Phase 2).",
|
|
87
|
+
"Entity recipient shown as local mark name 'ziroom_operator' (desensitization repair 2026-07-30): the original deployment used the operator's raw 0x address; Entity resolves names via LocalMark to a FIXED static address, so the name form is equivalent and recommended."
|
|
79
88
|
]
|
|
80
89
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Guard: Complete Multi-Condition Pattern (progress node + Signer==order.owner + order.service) — Customer-Win Allocator",
|
|
3
|
+
"description": "The 'complete pattern' allocation Guard: logic_and of (1) order at a customer-win node (Lost / Return Complete) via progress.current with convert_witness OrderProgress, (2) Level-2 dynamic identity binding Signer == query(order.owner), and (3) cross-service-theft prevention query(order.service) == this Service. Used as a Service order_allocators guard whose sharing.who is {Signer:'signer'} — the Signer binding is what makes Signer-recipient allocation safe (R-C3-06).",
|
|
4
|
+
"tags": ["guard", "allocation", "multi-condition", "logic_and", "level2-dynamic-binding", "retail"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "guard",
|
|
7
|
+
"source": "docs/examples/MyShop_Advanced — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "guard",
|
|
13
|
+
"data": {
|
|
14
|
+
"namedNew": {
|
|
15
|
+
"name": "service_customer_win_v2",
|
|
16
|
+
"tags": ["order", "customer-win", "level2-dynamic-binding"],
|
|
17
|
+
"replaceExistName": true
|
|
18
|
+
},
|
|
19
|
+
"description": "Verify order at customer win nodes (Lost, Return Complete) AND signer is the order owner AND order belongs to three_body_signature_service_v2. VERIFIER CONSTRAINT LEVEL 2 (dynamic identity binding): Signer bound to query('order.owner') — only the order's rightful owner can trigger the refund. Three-fold verification: (1) order at customer win node, (2) signer is order.owner (dynamic query, prevents fund theft), (3) order belongs to this service (prevents cross-service theft, R-C3-05).",
|
|
20
|
+
"table": [
|
|
21
|
+
{ "identifier": 0, "b_submission": true, "value_type": "Address", "name": "order_id" },
|
|
22
|
+
{ "identifier": 1, "b_submission": false, "value_type": "String", "value": "Lost" },
|
|
23
|
+
{ "identifier": 2, "b_submission": false, "value_type": "String", "value": "Return Complete" },
|
|
24
|
+
{ "identifier": 3, "b_submission": false, "value_type": "Address", "name": "service_address", "value": "three_body_signature_service_v2" }
|
|
25
|
+
],
|
|
26
|
+
"root": {
|
|
27
|
+
"type": "logic_and",
|
|
28
|
+
"nodes": [
|
|
29
|
+
{
|
|
30
|
+
"type": "logic_or",
|
|
31
|
+
"nodes": [
|
|
32
|
+
{
|
|
33
|
+
"type": "logic_string_nocase_equal",
|
|
34
|
+
"nodes": [
|
|
35
|
+
{ "type": "query", "query": "progress.current", "object": { "identifier": 0, "convert_witness": "OrderProgress" }, "parameters": [] },
|
|
36
|
+
{ "type": "identifier", "identifier": 1 }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "logic_string_nocase_equal",
|
|
41
|
+
"nodes": [
|
|
42
|
+
{ "type": "query", "query": "progress.current", "object": { "identifier": 0, "convert_witness": "OrderProgress" }, "parameters": [] },
|
|
43
|
+
{ "type": "identifier", "identifier": 2 }
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "logic_equal",
|
|
50
|
+
"nodes": [
|
|
51
|
+
{ "type": "query", "query": "order.owner", "object": { "identifier": 0 }, "parameters": [] },
|
|
52
|
+
{ "type": "context", "context": "Signer" }
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "logic_equal",
|
|
57
|
+
"nodes": [
|
|
58
|
+
{ "type": "query", "query": "order.service", "object": { "identifier": 0 }, "parameters": [] },
|
|
59
|
+
{ "type": "identifier", "identifier": 3 }
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"env": {
|
|
66
|
+
"network": "testnet",
|
|
67
|
+
"no_cache": true
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"notes": [
|
|
71
|
+
"COMPLETE PATTERN (BUG-01): root = logic_and of [node-set check via logic_or(logic_string_nocase_equal x2) on progress.current, Signer==order.owner, order.service==service]. All three conditions must pass; logic_and accepts 2-8 children (this uses 3).",
|
|
72
|
+
"Schema-verified: CallGuard_DataSchema (guard.ts) — creation uses namedNew (NOT 'object'); table items use GuardTableItemBaseSchema (common/index.ts) which REJECTS the output-only object_type field; root validated against GuardNodeSchema (query/index.ts) and must return Bool — logic_and is in the allowed root-type list.",
|
|
73
|
+
"Query names verified against knowledge/guard-templates.ts: progress.current (id 1253, String), order.owner (id 1562, Address), order.service (id 1563, Address). convert_witness 'OrderProgress' (id 100) is a valid WitnessTypeSchema string — the Order address submitted at runtime is converted to its Progress object before querying the current node.",
|
|
74
|
+
"Why the Signer binding matters: the paired allocator uses sharing.who = {Signer:'signer'} (funds go to the caller). Condition 2 binds the caller to query(order.owner), so only the customer who placed the order can receive the refund — without it anyone could steal 100% of the allocation (R-C3-06).",
|
|
75
|
+
"Shorthand variant (not used here): the logic_or of two logic_string_nocase_equal can collapse into one VecString constant + vec_contains_string_nocase — semantically equivalent per guard-examples-lint.spec.ts 'Semantic Equivalence' tests. Original form kept for clarity of the complete pattern.",
|
|
76
|
+
"Prerequisites: the Service 'three_body_signature_service_v2' must already exist (created unpublished) so the identifier-3 name resolves at transaction build time. Guard is IMMUTABLE after creation.",
|
|
77
|
+
"Desensitization: doc ran on mainnet with local-mark account myshop_merchant — network switched to testnet and account omitted (use your own default/local-mark account). Object names (service_customer_win_v2, three_body_signature_service_v2) are local marks, not real identities. No personal data or real 0x addresses present. replaceExistName:true kept from the doc's full-rerun convention — omit for one-off deployments.",
|
|
78
|
+
"Runtime use: bound as Service order_allocators[].guard; the customer triggers allocation.alloc_by_guard with submission of identifier 0 = their Order address (see the doc Part 4 'Customer Wins' example)."
|
|
79
|
+
]
|
|
80
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Guard: Strict-Mode Privacy Delivery via Messenger Chain Proof (Signer==proof.signer + proof.time>order.time + order.service)",
|
|
3
|
+
"description": "Machine forward Guard for privacy-preserving logistics: tracking numbers are exchanged via encrypted Messenger (off-chain); on-chain the verifier submits a Proof object address + the Order address. logic_and of (1) submitter accountability — context(Signer) == query(proof.signer), (2) freshness — query(proof.time) > query(order.time) via logic_as_u256_greater (prevents stale-proof replay), (3) project binding — query(order.service) == this Service (prevents cross-project bypass, R-C3-05).",
|
|
4
|
+
"tags": ["guard", "machine-forward", "messenger", "proof", "privacy", "multi-condition", "retail"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "guard",
|
|
7
|
+
"source": "docs/examples/MyShop_Advanced — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "guard",
|
|
13
|
+
"data": {
|
|
14
|
+
"namedNew": {
|
|
15
|
+
"name": "machine_messenger_proof_v2",
|
|
16
|
+
"replaceExistName": true
|
|
17
|
+
},
|
|
18
|
+
"description": "Strict-mode privacy delivery: verify Signer==proof.signer AND proof.time>order.time AND order.service==service (verifier submits Proof + Order object addresses)",
|
|
19
|
+
"table": [
|
|
20
|
+
{ "identifier": 0, "b_submission": true, "value_type": "Address", "name": "proof_id" },
|
|
21
|
+
{ "identifier": 1, "b_submission": true, "value_type": "Address", "name": "order_id" },
|
|
22
|
+
{ "identifier": 2, "b_submission": false, "value_type": "Address", "name": "service_address", "value": "three_body_signature_service_v2" }
|
|
23
|
+
],
|
|
24
|
+
"root": {
|
|
25
|
+
"type": "logic_and",
|
|
26
|
+
"nodes": [
|
|
27
|
+
{
|
|
28
|
+
"type": "logic_equal",
|
|
29
|
+
"nodes": [
|
|
30
|
+
{ "type": "context", "context": "Signer" },
|
|
31
|
+
{ "type": "query", "query": "proof.signer", "object": { "identifier": 0 }, "parameters": [] }
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"type": "logic_as_u256_greater",
|
|
36
|
+
"nodes": [
|
|
37
|
+
{ "type": "query", "query": "proof.time", "object": { "identifier": 0 }, "parameters": [] },
|
|
38
|
+
{ "type": "query", "query": "order.time", "object": { "identifier": 1 }, "parameters": [] }
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "logic_equal",
|
|
43
|
+
"nodes": [
|
|
44
|
+
{ "type": "query", "query": "order.service", "object": { "identifier": 1 }, "parameters": [] },
|
|
45
|
+
{ "type": "identifier", "identifier": 2 }
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"env": {
|
|
52
|
+
"network": "testnet",
|
|
53
|
+
"no_cache": true
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"notes": [
|
|
57
|
+
"Strict-mode alternative to the broad 'Merkle Root length == 66' Guard (machine_merkle_root_v2). Broad mode trusts submitter honesty; strict mode enforces WHO submitted (谁得利谁举证 — whoever benefits bears the burden of proof) without verifying message content on-chain.",
|
|
58
|
+
"Schema-verified: CallGuard_DataSchema (guard.ts) — namedNew creation form; table items carry no object_type (output-only); root logic_and returns Bool (allowed root type). logic_as_u256_greater compares first node > all subsequent nodes, so proof.time is listed before order.time.",
|
|
59
|
+
"Query names verified against knowledge/guard-templates.ts (tpl that uses proof.signer/proof.time/order.time): proof.signer (Proof object, Address), proof.time (U64, clock-derived, always > 0), order.time (U64), order.service (Address). context enum is exactly 'Signer' | 'Clock' | 'Guard'.",
|
|
60
|
+
"Proof generation (provider side, off-chain SDK): messenger submitChainProof(env, peerAddress, description) — about_address = the customer, order id embedded in description; returns proofAddress which is later submitted as identifier 0.",
|
|
61
|
+
"Runtime submission contract for the Machine forward: TWO Address identifiers — identifier 0 = Proof object address, identifier 1 = the Order object address. The same Guard can be reused across all forwards needing delivery proof (shipping, lost, returns) — choose broad vs strict mode BEFORE publishing the Machine (Forward.guard is immutable).",
|
|
62
|
+
"Prerequisites: Service 'three_body_signature_service_v2' must exist (identifier 2 name resolves at build time). Guard is IMMUTABLE after creation.",
|
|
63
|
+
"Desensitization: doc ran on mainnet as local-mark account myshop_merchant — network switched to testnet, account omitted. Table names shortened to proof_id/order_id for the 64-BCS-char name limit; all object references are local marks, no real addresses or personal data. replaceExistName:true kept from the doc's full-rerun convention."
|
|
64
|
+
]
|
|
65
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Guard: Reward Claim with Time Condition + Double-Claim Protection (5-condition logic_and)",
|
|
3
|
+
"description": "Advanced reward-claim Guard for shipping-timeout compensation: logic_and of FIVE conditions — (1) order still at 'Shipping' node (progress.current via OrderProgress witness), (2) Signer == order.owner (only the customer can claim their own compensation), (3) order.service == this Service (anti cross-service theft), (4) elapsed time on current node >= 2 days via Clock - query(progress.current_time) >= 172800000, (5) logic_not(query_reward_record_exists) — the same order has not claimed before (double-claim protection keyed by store_from_id).",
|
|
4
|
+
"tags": ["guard", "reward", "claim", "double-claim-protection", "time-lock", "multi-condition", "retail"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "guard",
|
|
7
|
+
"source": "docs/examples/MyShop_Advanced — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "guard",
|
|
13
|
+
"data": {
|
|
14
|
+
"namedNew": {
|
|
15
|
+
"name": "reward_shipping_timeout_v2",
|
|
16
|
+
"replaceExistName": true
|
|
17
|
+
},
|
|
18
|
+
"description": "Verify order at Shipping node for timeout compensation: signer must be order owner, order belongs to this service, not claimed before, AND the order has been at the Shipping node for >= 2 days (Clock - progress.current_time >= 172800000 ms, progress submitted as Address identifier 4)",
|
|
19
|
+
"table": [
|
|
20
|
+
{ "identifier": 0, "b_submission": true, "value_type": "Address", "name": "order_id" },
|
|
21
|
+
{ "identifier": 1, "b_submission": false, "value_type": "String", "value": "Shipping" },
|
|
22
|
+
{ "identifier": 2, "b_submission": false, "value_type": "Address", "value": "myshop_reward_v2", "name": "reward_object" },
|
|
23
|
+
{ "identifier": 3, "b_submission": false, "value_type": "Address", "value": "three_body_signature_service_v2", "name": "service_address" },
|
|
24
|
+
{ "identifier": 4, "b_submission": true, "value_type": "Address", "name": "progress_id" },
|
|
25
|
+
{ "identifier": 5, "b_submission": false, "value_type": "U64", "value": "172800000", "name": "timeout_ms" }
|
|
26
|
+
],
|
|
27
|
+
"root": {
|
|
28
|
+
"type": "logic_and",
|
|
29
|
+
"nodes": [
|
|
30
|
+
{
|
|
31
|
+
"type": "logic_string_nocase_equal",
|
|
32
|
+
"nodes": [
|
|
33
|
+
{ "type": "query", "query": "progress.current", "object": { "identifier": 0, "convert_witness": "OrderProgress" }, "parameters": [] },
|
|
34
|
+
{ "type": "identifier", "identifier": 1 }
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"type": "logic_equal",
|
|
39
|
+
"nodes": [
|
|
40
|
+
{ "type": "query", "query": "order.owner", "object": { "identifier": 0 }, "parameters": [] },
|
|
41
|
+
{ "type": "context", "context": "Signer" }
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "logic_equal",
|
|
46
|
+
"nodes": [
|
|
47
|
+
{ "type": "query", "query": "order.service", "object": { "identifier": 0 }, "parameters": [] },
|
|
48
|
+
{ "type": "identifier", "identifier": 3 }
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "logic_as_u256_greater_or_equal",
|
|
53
|
+
"nodes": [
|
|
54
|
+
{
|
|
55
|
+
"type": "calc_number_subtract",
|
|
56
|
+
"nodes": [
|
|
57
|
+
{ "type": "context", "context": "Clock" },
|
|
58
|
+
{ "type": "query", "query": "progress.current_time", "object": { "identifier": 4 }, "parameters": [] }
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{ "type": "identifier", "identifier": 5 }
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "logic_not",
|
|
66
|
+
"node": {
|
|
67
|
+
"type": "query_reward_record_exists",
|
|
68
|
+
"object": { "identifier": 2 },
|
|
69
|
+
"where": {
|
|
70
|
+
"storeFromId": { "identifier": 0 }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"env": {
|
|
78
|
+
"network": "testnet",
|
|
79
|
+
"no_cache": true
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"notes": [
|
|
83
|
+
"Most complex Guard in the MyShop_Advanced doc: 5-condition logic_and (schema allows 2-8 children) combining node check + Level-2 dynamic Signer binding + service binding + secure time-lock + one-claim-per-order record check.",
|
|
84
|
+
"Schema-verified: CallGuard_DataSchema (guard.ts) + GuardNodeSchema (query/index.ts). query_reward_record_exists node shape: {object:{identifier}, recipient?, where:{storeFromId:{identifier}}} — recipient omitted, so the transaction signer is matched; where.storeFromId points at identifier 0 (the order address) so one claim per ORDER, not per user.",
|
|
85
|
+
"SECURE TIME-LOCK PATTERN: the start time is NEVER a caller-submitted U64 (a submitter could pass 0 and bypass the lock). The Progress object is submitted at runtime (identifier 4, Address) and its current-node entry timestamp is read on-chain via query progress.current_time (id 1272); only the threshold (identifier 5, 172800000 ms = 2 days) is a creation-time constant.",
|
|
86
|
+
"Query names verified against knowledge/guard-templates.ts and guard-design-patterns.ts: progress.current (1253), order.owner (1562), order.service (1563), progress.current_time (1272). context enum: 'Clock' returns the on-chain timestamp (U64 ms).",
|
|
87
|
+
"Claim submission contract: claiming via reward.claim requires TWO submissions — identifier 0 = Order address AND identifier 4 = the order's Progress object address. The SDK auto-appends an internal VecU8 table entry (next free identifier) for the reward-record query parameters — only business identifiers 0-5 are defined here.",
|
|
88
|
+
"Prerequisites: Reward 'myshop_reward_v2' must exist EMPTY first (identifier 2 references it by name — circular-reference pattern: create Reward -> create this Guard -> reward.guard_add binds it with store_from_id: 0). Service must exist for identifier 3. Guard is IMMUTABLE after creation.",
|
|
89
|
+
"Desensitization: doc ran on mainnet as myshop_merchant — network switched to testnet, account omitted; all references are local marks; no personal data or real 0x addresses. replaceExistName:true kept from the doc's full-rerun convention.",
|
|
90
|
+
"Pair with: reward guard_add entry {guard: 'reward_shipping_timeout_v2', recipient: {Signer:'signer'}, amount: {type:'Fixed', value:'20000'}, store_from_id: 0} (see retail-adv-reward-guard-add example). Amount is a symbolic smallest-unit value (20000 = 0.00002 WOW at 9 decimals)."
|
|
91
|
+
]
|
|
92
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Reward: Bind Claim Guards with store_from_id (double-claim protection) — Wonderful / Lost / Shipping-Timeout",
|
|
3
|
+
"description": "Attach three claim Guards to an existing Reward pool in one call. Each entry pairs a Guard with a Fixed amount, recipient {Signer:'signer'}, and store_from_id: 0 — the value at Guard-table identifier 0 (the order address) is recorded per claim, enabling query_reward_record_exists-based double-claim protection. This is the bind step of the circular-reference pattern: (1) create empty Reward, (2) create Guards referencing the Reward by name, (3) guard_add binds them.",
|
|
4
|
+
"tags": ["reward", "guard_add", "claim", "double-claim-protection", "circular-reference", "retail"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "reward",
|
|
7
|
+
"source": "docs/examples/MyShop_Advanced — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "reward",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": "myshop_reward_v2",
|
|
15
|
+
"guard_add": [
|
|
16
|
+
{
|
|
17
|
+
"guard": "reward_wonderful_v2",
|
|
18
|
+
"recipient": { "Signer": "signer" },
|
|
19
|
+
"amount": { "type": "Fixed", "value": "10000" },
|
|
20
|
+
"store_from_id": 0
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"guard": "reward_lost_v2",
|
|
24
|
+
"recipient": { "Signer": "signer" },
|
|
25
|
+
"amount": { "type": "Fixed", "value": "20000" },
|
|
26
|
+
"store_from_id": 0
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"guard": "reward_shipping_timeout_v2",
|
|
30
|
+
"recipient": { "Signer": "signer" },
|
|
31
|
+
"amount": { "type": "Fixed", "value": "20000" },
|
|
32
|
+
"store_from_id": 0
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"env": {
|
|
37
|
+
"network": "testnet",
|
|
38
|
+
"no_cache": true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"notes": [
|
|
42
|
+
"Schema-verified against CallReward_DataSchema (call/reward.ts, strict): 'object' as STRING = operate on existing Reward (object form would CREATE). guard_add items validated against RewardGuardSchema (query/index.ts): {guard: NameOrAddress, recipient: RecipientSchema, amount: AmountSchema, expiration_time?, store_from_id?}.",
|
|
43
|
+
"recipient {Signer:'signer'} matches RecipientSchema's z.object({Signer: z.literal('signer')}) branch — the literal string 'signer' is required. Safe here because each claim Guard binds Signer == query(order.owner) (Level-2 dynamic binding), so funds always reach the order's rightful owner.",
|
|
44
|
+
"amount {type:'Fixed', value} — AmountSchema discriminated union ('Fixed' | 'GuardU64Identifier'). Values converted from the doc's numbers to STRINGS per smallest-unit convention (BalanceTypeSchema accepts both; string preserves precision). 10000/20000 are SYMBOLIC test values (0.00001/0.00002 WOW at 9 decimals) — far below gas; production should use e.g. '20000000000' (20 WOW) or display format '20WOW'.",
|
|
45
|
+
"store_from_id: 0 means the Guard-table identifier-0 value (the submitted order address) is stored with each claim record — the claim Guards' query_reward_record_exists(where.storeFromId={identifier:0}) then rejects repeat claims for the same order. GuardIdentifierSchema range 0-255.",
|
|
46
|
+
"Prerequisites (circular-reference order, DOC): (1) Reward 'myshop_reward_v2' created EMPTY; (2) the three Guards created (they reference the Reward by name in their tables); (3) THIS guard_add call binds them. Afterwards fund the pool via coin_add — claims fail on insufficient balance.",
|
|
47
|
+
"Optional lock: set guard_expiration_time (ms, or null to remove) to freeze the Guard list — after that point no new Guards/fund rules can be added.",
|
|
48
|
+
"Desensitization: doc ran on mainnet as myshop_merchant — network switched to testnet, account omitted; all object references are local marks; no personal data or real 0x addresses.",
|
|
49
|
+
"Claim flow after binding: customer calls reward.claim = '<guard_name>' with a submission carrying the Guard's b_submission identifiers (order address, plus progress address for the timeout guard)."
|
|
50
|
+
]
|
|
51
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Activate Allocation via Guard Verification (MyShop Retail)",
|
|
3
|
+
"description": "Activate a pending MyShop Allocation by verifying the withdraw Guard with alloc_by_guard, passing the Order address as a runtime submission. On Guard pass, funds are distributed per the allocator's sharing rules.",
|
|
4
|
+
"tags": ["allocation", "alloc_by_guard", "submission", "withdraw", "retail"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "allocation",
|
|
7
|
+
"source": "MyShop verified deployment walkthrough (docs/examples/MyShop) — adapted to current schema",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "allocation",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": "myshop_test_allocation",
|
|
15
|
+
"alloc_by_guard": "myshop_withdraw_guard"
|
|
16
|
+
},
|
|
17
|
+
"submission": {
|
|
18
|
+
"type": "submission",
|
|
19
|
+
"guard": [
|
|
20
|
+
{
|
|
21
|
+
"object": "myshop_withdraw_guard",
|
|
22
|
+
"impack": true
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"submission": [
|
|
26
|
+
{
|
|
27
|
+
"guard": "myshop_withdraw_guard",
|
|
28
|
+
"submission": [
|
|
29
|
+
{
|
|
30
|
+
"identifier": 0,
|
|
31
|
+
"b_submission": true,
|
|
32
|
+
"value_type": "Address",
|
|
33
|
+
"value": "myshop_order_v1",
|
|
34
|
+
"name": "order_address"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"env": {
|
|
41
|
+
"network": "testnet",
|
|
42
|
+
"no_cache": true,
|
|
43
|
+
"confirmed": true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"notes": [
|
|
47
|
+
"alloc_by_guard and the submission guard entries accept the Guard's LOCAL MARK NAME — the SDK resolves non-address values via LocalMark.get_address (allocation.ts L122-136), so names and 0x addresses both work. This example uses names (desensitization repair 2026-07-30: the original walkthrough recorded truncated real addresses, which are neither valid schema IDs nor reproducible).",
|
|
48
|
+
"submission sits at the request ROOT level — sibling of data/env (mirrored here as call.submission), NOT inside data.data. Shape (SubmissionCallSchema): {type:'submission', guard:[{object, impack}], submission:[{guard, submission:[GuardTableItem...]}]}, one submission entry per Guard in the guard array.",
|
|
49
|
+
"impack flag (per schema): whether this Guard's verification result participates in the final logic. true = the Guard must PASS for the allocation to execute; false = the Guard is still checked but does not block the operation.",
|
|
50
|
+
"b_submission:true table items are runtime values supplied by the caller at Guard trigger time (e.g. the order address to release funds for) — the static 'value' stored in the Guard definition is ignored and the value here is used instead.",
|
|
51
|
+
"After activation distributes funds per the allocator sharing rules, the merchant withdraws Service-side receipts via: {operation_type:'service', data:{object:'myshop_service_v2', owner_receive:'recently'}} (MyShop step 7.2).",
|
|
52
|
+
"object as a STRING targets an EXISTING Allocation (CallAllocation_OperateSchema). Allocation objects are normally created automatically by order payments through the Service's order_allocators config, then activated per allocator Guard.",
|
|
53
|
+
"Adaptations from doc: network changed mainnet->testnet; payload otherwise matches current schema (no drift found)."
|
|
54
|
+
]
|
|
55
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Arbitration with Independent Permission (MyShop Retail)",
|
|
3
|
+
"description": "Create an Arbitration object for MyShop retail order dispute resolution, using an independent Permission (myshop_arbitration_permission) separate from the Service's permission, with dispute fee, description, and location.",
|
|
4
|
+
"tags": ["arbitration", "dispute", "retail", "permission"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "arbitration",
|
|
7
|
+
"source": "MyShop verified deployment walkthrough (docs/examples/MyShop) — adapted to current schema",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "arbitration",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "myshop_arbitration_v2",
|
|
16
|
+
"type_parameter": "0x2::wow::WOW",
|
|
17
|
+
"permission": "myshop_arbitration_permission",
|
|
18
|
+
"tags": ["ecommerce", "dispute", "toys"],
|
|
19
|
+
"onChain": false,
|
|
20
|
+
"replaceExistName": true
|
|
21
|
+
},
|
|
22
|
+
"description": "Arbitration system for MyShop toy store disputes",
|
|
23
|
+
"location": "Online arbitration system",
|
|
24
|
+
"fee": 5000000
|
|
25
|
+
},
|
|
26
|
+
"env": {
|
|
27
|
+
"network": "testnet",
|
|
28
|
+
"no_cache": true,
|
|
29
|
+
"confirmed": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"notes": [
|
|
33
|
+
"CRITICAL FIX vs original doc: the walkthrough used permission 'myshop_permission_v2' — the SAME permission as the Service. This is now blocked at the contract layer: service.move arbitration_add_imp asserts arbitration.permission != service.permission and aborts with E_ARBITRATION_PERMISSION_CONFLICT (code 33), because a Service owner controlling its own Arbitration breaks dispute fairness. An Arbitration MUST use an independent Permission (here 'myshop_arbitration_permission').",
|
|
34
|
+
"New Arbitration objects are created PAUSED (bPaused=true) and cannot accept disputes until unpaused. Follow-up call after creation: {operation_type:'arbitration', data:{object:'myshop_arbitration_v2', pause:false}} (object as STRING references the existing object).",
|
|
35
|
+
"fee is in the SMALLEST unit of the type_parameter token: 5000000 = 0.005 WOW (WOW has 9 decimals). BalanceTypeSchema also accepts numeric strings for values above 2^53.",
|
|
36
|
+
"name/type_parameter/permission live INSIDE 'object' (TypeNamedObjectWithPermissionSchema), not at the data root. permission may reference an existing Permission by name/address (as here) or create a new one inline.",
|
|
37
|
+
"onChain:false keeps the local mark private (not published on-chain); replaceExistName:true force-rebinds the name if already taken — use deliberately, it unbinds the name from its previous object.",
|
|
38
|
+
"Adaptations from doc: permission renamed to an independent Permission (contract fix above), network changed mainnet->testnet, replaceExistName added for re-runnability."
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create After-Sales Contact Object (MyShop Retail)",
|
|
3
|
+
"description": "Create a named Contact object with a Permission reference and an initial IM entry pointing at the merchant's after-sales support account",
|
|
4
|
+
"tags": ["contact", "messenger", "ims", "retail"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "contact",
|
|
7
|
+
"source": "MyShop verified deployment walkthrough (docs/examples/MyShop) — adapted to current schema",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "contact",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "myshop_aftersales_contact_v2",
|
|
16
|
+
"permission": "myshop_permission_v2",
|
|
17
|
+
"replaceExistName": true
|
|
18
|
+
},
|
|
19
|
+
"description": "MyShop after-sales support contact - we're here to help with orders, shipping, and returns",
|
|
20
|
+
"ims": {
|
|
21
|
+
"op": "add",
|
|
22
|
+
"im": [
|
|
23
|
+
{
|
|
24
|
+
"at": "myshop_merchant",
|
|
25
|
+
"description": "Primary after-sales support representative"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"env": {
|
|
31
|
+
"network": "testnet",
|
|
32
|
+
"no_cache": true,
|
|
33
|
+
"confirmed": true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"notes": [
|
|
37
|
+
"ims.im[].at accepts an ACCOUNT NAME (resolved to the account's address at transaction build time) or a full 0x address directly — 'myshop_merchant' here is an account name, not a messenger name.",
|
|
38
|
+
"ims is an op discriminated union, never a bare array: {op:'add', im:[{at, description?}...]} / {op:'set', im:[...]} replaces the whole list / {op:'remove', im:[...]} takes plain names-or-addresses (NOT {at, description} entries) / {op:'clear'} empties the list.",
|
|
39
|
+
"'object' uses the OBJECT creation form {name, permission, replaceExistName} — 'name' goes INSIDE 'object', and 'permission' references the pre-created myshop_permission_v2 (or inline-create a new Permission, or omit for an auto-created unnamed one). To operate an existing Contact, pass a string name/ID instead.",
|
|
40
|
+
"Bind this Contact to a Service via the service call's 'um' field so customers can reach after-sales support; Messenger communication itself is end-to-end encrypted and never stored on-chain.",
|
|
41
|
+
"Adapted from the doc's mainnet env to testnet + no_cache; env.account omitted because Contact creation is not bound to a specific signer — any account can create it."
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Order with Named Order/Progress/Allocation (MyShop Retail)",
|
|
3
|
+
"description": "Customer purchases a product from a published Service via order_new: buy.items + total_pay, while simultaneously naming the newly created Order, Progress, and Allocation objects so later steps can reference them by name",
|
|
4
|
+
"tags": ["order", "order_new", "retail", "buy", "named_objects"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "service",
|
|
7
|
+
"source": "MyShop verified deployment walkthrough (docs/examples/MyShop) — adapted to current schema",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "service",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": "myshop_service_v2",
|
|
15
|
+
"order_new": {
|
|
16
|
+
"buy": {
|
|
17
|
+
"items": [
|
|
18
|
+
{
|
|
19
|
+
"name": "Play Purse Set 35PCS",
|
|
20
|
+
"stock": 1,
|
|
21
|
+
"wip_hash": "03c18561efa8faf4d75480eb1f732c4a46ffde95599e92eca06167785fc07a5b"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"total_pay": {
|
|
25
|
+
"balance": 50000000
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"namedNewOrder": {
|
|
29
|
+
"name": "myshop_test_order",
|
|
30
|
+
"replaceExistName": true
|
|
31
|
+
},
|
|
32
|
+
"namedNewProgress": {
|
|
33
|
+
"name": "myshop_test_progress",
|
|
34
|
+
"replaceExistName": true
|
|
35
|
+
},
|
|
36
|
+
"namedNewAllocation": {
|
|
37
|
+
"name": "myshop_test_allocation",
|
|
38
|
+
"replaceExistName": true
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"env": {
|
|
43
|
+
"account": "myshop_customer",
|
|
44
|
+
"network": "testnet",
|
|
45
|
+
"no_cache": true,
|
|
46
|
+
"confirmed": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"notes": [
|
|
50
|
+
"A single order_new call creates THREE objects at once — Order, Progress, and Allocation — and namedNewOrder / namedNewProgress / namedNewAllocation name all three in the same call, so subsequent steps (progress operate, alloc_by_guard) can reference them by name instead of raw on-chain addresses. All three are optional but strongly RECOMMENDED.",
|
|
51
|
+
"buy.items[].wip_hash is a dispute-prevention mechanism: the on-chain contract compares it against the Service's current sale.wip_hash to ensure the product WIP file was not swapped between browse time and purchase time. Capture it from the Service query result right before ordering. Empty string \"\" only verifies WIP file integrity without comparing to a specific hash — NOT recommended for real purchases.",
|
|
52
|
+
"total_pay.balance is denominated in the SMALLEST unit of the Service's type_parameter token — WOW has 9 decimals, so 50000000 = 0.05 WOW. Alternative format: {coin: '<coin_object_id_or_name>'} to pay with a specific Coin object.",
|
|
53
|
+
"'object' is a STRING here (reference to an existing, published Service), not the object-creation form. order_new is an optional field of the service call, alongside sales / order_allocators / buy_guard / etc.",
|
|
54
|
+
"env.account is the customer and is CRITICAL here: the signer pays total_pay and becomes the Order owner. Adapted from the doc's mainnet env to testnet + no_cache per example conventions."
|
|
55
|
+
]
|
|
56
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Advance Order Progress via Forward (MyShop Retail)",
|
|
3
|
+
"description": "Merchant advances an order's Progress from the empty initial node to the 'Order Confirmation' node using the 'Confirm Order' forward — the canonical progress operate shape",
|
|
4
|
+
"tags": ["progress", "operate", "forward", "retail", "workflow"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "progress",
|
|
7
|
+
"source": "MyShop verified deployment walkthrough (docs/examples/MyShop) — adapted to current schema",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "progress",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": "myshop_test_progress",
|
|
15
|
+
"operate": {
|
|
16
|
+
"operation": {
|
|
17
|
+
"next_node_name": "Order Confirmation",
|
|
18
|
+
"forward": "Confirm Order"
|
|
19
|
+
},
|
|
20
|
+
"op": "next",
|
|
21
|
+
"message": "Order confirmed by merchant"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"env": {
|
|
25
|
+
"account": "myshop_merchant",
|
|
26
|
+
"network": "testnet",
|
|
27
|
+
"no_cache": true,
|
|
28
|
+
"confirmed": true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"notes": [
|
|
32
|
+
"Orders are created sitting at the EMPTY initial node \"\" — the first operate call transitions from \"\" to the first real workflow node, so next_node_name names the TARGET node, not the current one.",
|
|
33
|
+
"next_node_name + forward must TOGETHER match a Pair (prior_node → next_node) defined in the Service's published Machine, with 'forward' naming the specific forward on that pair. A mismatched node or forward name fails on-chain; the launcher's permission/guard for that forward is also enforced by the Machine.",
|
|
34
|
+
"SCHEMA ADAPTATION (schema wins): the walkthrough used the legacy form {hold: false}; the current canonical schema uses the op enum — hold:false maps to op:'next' (the MCP layer still auto-migrates hold:boolean via preprocess, but new code should use op directly). op semantics: 'next' = advance/accomplish the forward; 'hold' = set hold to BLOCK the forward; 'unhold' = self-release your own hold (no 224 permission needed); 'adminUnhold' = force-release a hold via permission 224 (PROGRESS_UNHOLD).",
|
|
35
|
+
"This is the canonical progress operate shape: {object, operate: {operation: {next_node_name, forward}, op, message?}} — 'object' is the Progress object name/address (here the namedNewProgress name from order creation).",
|
|
36
|
+
"env.account is the merchant and is CRITICAL here: launching the 'Confirm Order' forward requires the merchant-side permission configured on the Machine node. Adapted from the doc's mainnet env to testnet + no_cache per example conventions."
|
|
37
|
+
]
|
|
38
|
+
}
|