@wowok/agent-mcp 2.6.1 → 2.6.4
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/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 +9 -2
- package/dist/customer/info-puzzle.js +34 -7
- 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 +30 -7
- package/dist/customer/types.d.ts +7 -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 +59 -0
- package/dist/examples/guard-template-time-lock.json +60 -0
- 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 +119 -0
- package/dist/examples/payment-scenario-bound.json +45 -0
- package/dist/examples/rental-ziroom-machine-create.json +149 -0
- package/dist/examples/rental-ziroom-permission-create.json +42 -0
- package/dist/examples/rental-ziroom-service-create.json +89 -0
- 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/retail-myshop-service-create.json +88 -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 +216 -29
- package/dist/extensions/constraint-registry.js +21 -19
- package/dist/extensions/metric-registry.js +14 -14
- package/dist/extensions/mode-evaluator.js +16 -16
- package/dist/extensions/modes.js +141 -49
- package/dist/extensions/registry.d.ts +16 -9
- package/dist/extensions/registry.js +132 -44
- package/dist/extensions/types.d.ts +2 -0
- package/dist/index.js +50 -0
- package/dist/knowledge/deployment-scanner.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +138 -0
- package/dist/knowledge/fund-layer.js +969 -0
- package/dist/knowledge/guard-render.d.ts +57 -0
- package/dist/knowledge/guard-render.js +700 -0
- package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
- package/dist/knowledge/guard-submission-prompt.js +171 -0
- 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-ledger.js +1 -1
- package/dist/knowledge/machine-render.d.ts +41 -0
- package/dist/knowledge/machine-render.js +565 -0
- package/dist/knowledge/machine-risk.js +4 -1
- package/dist/knowledge/machine-templates.js +4 -4
- 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/reward-confirm.js +2 -2
- package/dist/knowledge/reward-puzzle.js +1 -1
- package/dist/knowledge/reward-risk.js +9 -9
- package/dist/knowledge/reward-templates.js +2 -2
- 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/service-confirm.d.ts +1 -1
- package/dist/knowledge/service-confirm.js +3 -3
- package/dist/knowledge/service-context.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-risk.d.ts +1 -1
- package/dist/knowledge/service-risk.js +3 -3
- package/dist/knowledge/service-templates.js +2 -2
- package/dist/knowledge/service-translation.d.ts +1 -1
- package/dist/knowledge/service-translation.js +7 -7
- 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/deployment-bridge.js +6 -5
- package/dist/project/deployment-doc.js +5 -5
- package/dist/project/edit-planner.d.ts +123 -0
- package/dist/project/edit-planner.js +1342 -0
- package/dist/project/evaluation.d.ts +36 -0
- package/dist/project/evaluation.js +734 -68
- package/dist/project/game-theory.d.ts +43 -0
- package/dist/project/game-theory.js +177 -0
- package/dist/project/graph-builder.js +7 -1
- package/dist/project/handlers.d.ts +137 -2
- package/dist/project/handlers.js +423 -51
- 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/project/stage-gate.js +4 -4
- package/dist/schema/call/allocation.d.ts +11 -11
- package/dist/schema/call/allocation.js +13 -3
- package/dist/schema/call/arbitration.d.ts +21 -21
- package/dist/schema/call/arbitration.js +30 -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/contact.js +2 -2
- package/dist/schema/call/demand.d.ts +3 -3
- package/dist/schema/call/demand.js +2 -2
- package/dist/schema/call/guard.d.ts +11 -11
- package/dist/schema/call/guard.js +2 -2
- package/dist/schema/call/machine.d.ts +2072 -679
- package/dist/schema/call/machine.js +51 -5
- package/dist/schema/call/order.d.ts +7 -7
- package/dist/schema/call/order.js +3 -6
- package/dist/schema/call/payment.d.ts +3 -3
- package/dist/schema/call/permission.d.ts +3 -3
- package/dist/schema/call/permission.js +2 -2
- 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/repository.js +2 -2
- package/dist/schema/call/reward.d.ts +57 -57
- package/dist/schema/call/reward.js +3 -3
- package/dist/schema/call/semantic.js +48 -2
- package/dist/schema/call/service.d.ts +285 -113
- package/dist/schema/call/service.js +92 -28
- package/dist/schema/call/treasury.d.ts +57 -57
- package/dist/schema/call/treasury.js +3 -3
- package/dist/schema/common/index.d.ts +2 -0
- package/dist/schema/common/index.js +46 -10
- package/dist/schema/local/index.js +5 -1
- package/dist/schema/messenger/index.js +4 -1
- package/dist/schema/operations.d.ts +1318 -317
- package/dist/schema/operations.js +76 -7
- package/dist/schema/project/index.d.ts +5662 -164
- package/dist/schema/project/index.js +1136 -5
- package/dist/schema/query/index.d.ts +580 -19
- package/dist/schema/query/index.js +88 -36
- package/dist/schema/schema-query/index.d.ts +59 -3
- package/dist/schema/schema-query/index.js +45 -6
- package/dist/schema/trust/index.d.ts +1012 -6
- package/dist/schema/trust/index.js +212 -11
- package/dist/schema/utils/node-parser.js +13 -0
- package/dist/schema/utils/object-type-utils.d.ts +12 -0
- package/dist/schema/utils/object-type-utils.js +35 -0
- package/dist/schema/utils/permission-machine-check.d.ts +49 -0
- package/dist/schema/utils/permission-machine-check.js +121 -0
- package/dist/schema/utils/skills-recommendation.d.ts +2 -0
- package/dist/schema/utils/skills-recommendation.js +77 -0
- package/dist/schema-query/index.d.ts +17 -1
- package/dist/schema-query/index.js +359 -3
- package/dist/schemas/account_operation.schema.json +1 -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_events.output.json +1 -1
- package/dist/schemas/onchain_operations.output.json +2820 -0
- package/dist/schemas/onchain_operations.schema.json +255 -65
- package/dist/schemas/onchain_operations_allocation.schema.json +7 -6
- package/dist/schemas/onchain_operations_arbitration.schema.json +14 -10
- package/dist/schemas/onchain_operations_contact.schema.json +4 -3
- package/dist/schemas/onchain_operations_demand.schema.json +4 -3
- package/dist/schemas/onchain_operations_gen_passport.schema.json +4 -2
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -0
- package/dist/schemas/onchain_operations_guard.schema.json +579 -1
- package/dist/schemas/onchain_operations_machine.schema.json +5 -4
- package/dist/schemas/onchain_operations_order.schema.json +7 -6
- package/dist/schemas/onchain_operations_payment.schema.json +2 -1
- package/dist/schemas/onchain_operations_permission.schema.json +3 -2
- package/dist/schemas/onchain_operations_personal.schema.json +37 -0
- package/dist/schemas/onchain_operations_progress.schema.json +91 -4
- package/dist/schemas/onchain_operations_proof.schema.json +2 -1
- package/dist/schemas/onchain_operations_repository.schema.json +4 -3
- package/dist/schemas/onchain_operations_reward.schema.json +7 -6
- package/dist/schemas/onchain_operations_service.schema.json +80 -19
- package/dist/schemas/onchain_operations_treasury.schema.json +5 -4
- package/dist/schemas/onchain_table_data.output.json +1 -1
- package/dist/schemas/onchain_table_data.schema.json +10 -9
- package/dist/schemas/project_operation.output.json +3318 -57
- package/dist/schemas/project_operation.schema.json +728 -4
- package/dist/schemas/query_toolkit.output.json +16 -16
- package/dist/schemas/query_toolkit.schema.json +40 -3
- package/dist/schemas/schema_query.output.json +65 -2
- package/dist/schemas/schema_query.schema.json +31 -5
- package/dist/schemas/trust_score.output.json +392 -1
- package/dist/schemas/trust_score.schema.json +275 -1
- package/dist/schemas/wowok_buildin_info.output.json +81 -8
- package/dist/schemas/wowok_buildin_info.schema.json +46 -2
- package/dist/tools/handlers/onchain.js +636 -6
- package/dist/tools/handlers/project.js +71 -2
- package/dist/tools/handlers/query.js +117 -2
- package/dist/tools/handlers/schema-query.js +65 -1
- package/dist/tools/handlers/trust.js +192 -6
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +229 -15
- package/dist/tools/wrap.js +194 -15
- package/package.json +2 -2
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Reward Pool Object (MyShop Retail)",
|
|
3
|
+
"description": "Create an empty Reward object for MyShop service-quality rewards and compensation. The Reward is later referenced by claim Guards that prevent double-claiming, and funded via coin_add.",
|
|
4
|
+
"tags": ["reward", "claim", "retail"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "reward",
|
|
7
|
+
"source": "MyShop verified deployment walkthrough (docs/examples/MyShop_Advanced) — adapted to current schema",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "reward",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "myshop_reward_v2",
|
|
16
|
+
"type_parameter": "0x2::wow::WOW",
|
|
17
|
+
"permission": "myshop_perm_v2",
|
|
18
|
+
"replaceExistName": true
|
|
19
|
+
},
|
|
20
|
+
"description": "MyShop reward pool for wonderful service and compensation"
|
|
21
|
+
},
|
|
22
|
+
"env": {
|
|
23
|
+
"network": "testnet",
|
|
24
|
+
"no_cache": true,
|
|
25
|
+
"confirmed": true
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"notes": [
|
|
29
|
+
"Create the Reward EMPTY first (no coin_add, no guard_add): claim Guards are then built to reference this Reward object and use the query_reward_record_exists query instruction for double-claim protection — the Reward object must exist before the Guards that query it can be created.",
|
|
30
|
+
"Reward MAY share the Service's Permission (here myshop_perm_v2) for unified governance — service.move reward_add_imp has NO permission-conflict check. This is the opposite of Arbitration, which MUST use an independent Permission (E_ARBITRATION_PERMISSION_CONFLICT).",
|
|
31
|
+
"Adaptation: the doc omitted type_parameter — schema-valid because TokenTypeWithDefaultSchema defaults to '0x2::wow::WOW'; shown explicitly here for clarity.",
|
|
32
|
+
"Fund the pool later with coin_add; claimants trigger distribution by passing their claim Guard address in the 'claim' field. guard_add registers which Guards may claim from this Reward.",
|
|
33
|
+
"name/permission live INSIDE 'object' (TypeNamedObjectWithPermissionSchema). replaceExistName:true force-rebinds the local name if already taken — use deliberately."
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Retail Service with 2-path Allocation (MyShop E-Commerce)",
|
|
3
|
+
"description": "Simple e-commerce Service with machine, withdraw/refund guards, contact, and toy products. 2-path order_allocators: merchant withdraw after completion, customer refund after cancellation.",
|
|
4
|
+
"tags": ["service", "allocation", "retail", "ecommerce", "guard", "order_allocators"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "service",
|
|
7
|
+
"source": "myshop mainnet deployment 2026-07-29",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "mainnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "service",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "myshop_service_v2",
|
|
16
|
+
"type_parameter": "0x2::wow::WOW",
|
|
17
|
+
"permission": "myshop_permission_v2",
|
|
18
|
+
"tags": ["ecommerce", "toys", "store"],
|
|
19
|
+
"onChain": false,
|
|
20
|
+
"replaceExistName": true
|
|
21
|
+
},
|
|
22
|
+
"description": "MyShop - Top quality toys for children",
|
|
23
|
+
"location": "Online Store",
|
|
24
|
+
"machine": "myshop_machine_v2",
|
|
25
|
+
"order_allocators": {
|
|
26
|
+
"description": "Order revenue allocation - merchant withdraw after completion",
|
|
27
|
+
"threshold": 0,
|
|
28
|
+
"allocators": [
|
|
29
|
+
{
|
|
30
|
+
"guard": "myshop_withdraw_guard_v2",
|
|
31
|
+
"sharing": [
|
|
32
|
+
{
|
|
33
|
+
"who": { "Signer": "signer" },
|
|
34
|
+
"sharing": 10000,
|
|
35
|
+
"mode": "Rate"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"guard": "myshop_refund_guard_v2",
|
|
41
|
+
"sharing": [
|
|
42
|
+
{
|
|
43
|
+
"who": { "GuardIdentifier": 0 },
|
|
44
|
+
"sharing": 10000,
|
|
45
|
+
"mode": "Rate"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"sales": {
|
|
52
|
+
"op": "add",
|
|
53
|
+
"sales": [
|
|
54
|
+
{
|
|
55
|
+
"name": "Play Purse Set 35PCS",
|
|
56
|
+
"price": 50000000,
|
|
57
|
+
"stock": 100,
|
|
58
|
+
"suspension": false,
|
|
59
|
+
"wip": "https://wowok.net/test/three_body.wip",
|
|
60
|
+
"wip_hash": ""
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "Tree House Building Set",
|
|
64
|
+
"price": 30000000,
|
|
65
|
+
"stock": 75,
|
|
66
|
+
"suspension": false,
|
|
67
|
+
"wip": "https://wowok.net/test/three_body.wip",
|
|
68
|
+
"wip_hash": ""
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"um": "myshop_aftersales_contact_v2",
|
|
73
|
+
"publish": true
|
|
74
|
+
},
|
|
75
|
+
"env": {
|
|
76
|
+
"account": "myshop_merchant",
|
|
77
|
+
"network": "mainnet",
|
|
78
|
+
"confirmed": true
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"notes": [
|
|
82
|
+
"order_allocators is PERMANENTLY IMMUTABLE after publish (service.move:503)",
|
|
83
|
+
"Withdraw allocator uses Signer recipient — safe ONLY because withdraw_guard binds Signer to myshop_merchant",
|
|
84
|
+
"Refund allocator uses GuardIdentifier 0 (Order object address) as escrow — customer claims separately",
|
|
85
|
+
"Rate mode uses 0-10000 scale (10000 = 100%)",
|
|
86
|
+
"Machine, order_allocators, and arbitrations become immutable after publish"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Issue Discount Coupons to Customers (Service)",
|
|
3
|
+
"description": "Issue 100 transferable=false 10%-off RATES discount coupons named summer_2026_10pct for myshop_service_v2, targeted at a specific customer, valid until end of 2026.",
|
|
4
|
+
"tags": ["service", "discount", "coupon", "marketing", "retail"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "service",
|
|
7
|
+
"source": "constructed under T-09 authorization; grounded in DiscountSchema + DiscountTypeSchema + service.ts SDK — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "service",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": "myshop_service_v2",
|
|
15
|
+
"discount": {
|
|
16
|
+
"name": "summer_2026_10pct",
|
|
17
|
+
"discount_type": "RATES",
|
|
18
|
+
"discount_value": 1000,
|
|
19
|
+
"benchmark": 100000000,
|
|
20
|
+
"time_ms_start": 1782864000000,
|
|
21
|
+
"time_ms_end": 1798761599000,
|
|
22
|
+
"count": 100,
|
|
23
|
+
"recipient": {
|
|
24
|
+
"entities": [
|
|
25
|
+
{ "name_or_address": "alice" }
|
|
26
|
+
],
|
|
27
|
+
"check_all_founded": false
|
|
28
|
+
},
|
|
29
|
+
"transferable": false
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"env": {
|
|
33
|
+
"network": "testnet",
|
|
34
|
+
"no_cache": true,
|
|
35
|
+
"confirmed": true
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"notes": [
|
|
39
|
+
"discount_type 'RATES' means discount_value is a RATIO in ten-thousandths: 1000 = 1000/10000 = 10% off. 'FIXED' (numeric 1) means discount_value is a fixed deduction in the token's smallest unit. String form ('RATES'/'FIXED') is recommended over numeric 0/1.",
|
|
40
|
+
"benchmark (optional): the discount only applies when the order amount EXCEEDS this value (smallest unit; 100000000 = 0.1 WOW). Omit for unconditional discounts.",
|
|
41
|
+
"time_ms_start/time_ms_end are Unix MILLISECONDS (not seconds). time_ms_end is REQUIRED; time_ms_start optional (starts immediately if omitted). 1782864000000 = 2026-07-01T00:00:00Z, 1798761599000 = 2026-12-31T15:59:59Z.",
|
|
42
|
+
"count = total usage count across all issued coupon objects; recipient.entities lists the receiving accounts (object form {name_or_address}); check_all_founded:false tolerates unresolved names instead of aborting.",
|
|
43
|
+
"transferable:false locks the coupon to the recipient (cannot be sold/gifted). Each issued coupon is a separate on-chain Discount object owned by the recipient; customers attach it at order time via order_new buy.discount (discount object ID or name).",
|
|
44
|
+
"Cleanup: issued discounts can be destroyed later via discount_destroy: ['<discount_object_id_or_name>']. Issuing discounts is an L3 operation on a live Service — no pause required."
|
|
45
|
+
]
|
|
46
|
+
}
|