@wowok/agent-mcp 3.2.1 → 3.2.3
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/chain-semantics/field-capability.d.ts +11 -0
- package/dist/chain-semantics/field-capability.js +1 -0
- package/dist/chain-semantics/freeze-map.d.ts +11 -0
- package/dist/chain-semantics/freeze-map.js +1 -0
- package/dist/chain-semantics/fund-flow.d.ts +10 -0
- package/dist/chain-semantics/fund-flow.js +1 -0
- package/dist/chain-semantics/guard-verbs.d.ts +22 -0
- package/dist/chain-semantics/guard-verbs.js +1 -0
- package/dist/chain-semantics/index.d.ts +10 -0
- package/dist/chain-semantics/index.js +1 -0
- package/dist/chain-semantics/object-graph.d.ts +18 -0
- package/dist/chain-semantics/object-graph.js +1 -0
- package/dist/communication/wts-attestation.d.ts +34 -0
- package/dist/communication/wts-attestation.js +1 -0
- package/dist/composition/audit.d.ts +10 -0
- package/dist/composition/audit.js +1 -0
- package/dist/composition/compile.d.ts +38 -0
- package/dist/composition/compile.js +1 -0
- package/dist/composition/materialize.d.ts +64 -0
- package/dist/composition/materialize.js +1 -0
- package/dist/composition/plan.d.ts +92 -0
- package/dist/composition/plan.js +1 -0
- package/dist/composition/reflux.d.ts +28 -0
- package/dist/composition/reflux.js +1 -0
- package/dist/config/judgment.d.ts +25 -0
- package/dist/config/rule-engine.d.ts +10 -0
- package/dist/config/rule-engine.js +1 -1
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/business-modules.js +1 -1
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/graph/onchain/facts.js +1 -1
- package/dist/keeper/detectors.d.ts +7 -0
- package/dist/keeper/detectors.js +1 -1
- package/dist/keeper/types.d.ts +1 -1
- package/dist/keeper/types.js +1 -1
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocation-puzzle.js +1 -1
- package/dist/knowledge/allocation-risk.d.ts +2 -1
- package/dist/knowledge/allocation-risk.js +1 -1
- package/dist/knowledge/allocation-templates.js +1 -1
- package/dist/knowledge/arb-fund-facts.d.ts +31 -0
- package/dist/knowledge/arb-fund-facts.js +1 -0
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/allocation.json +75 -16
- package/dist/knowledge/baselines/rules/guard.json +27 -8
- package/dist/knowledge/baselines/rules/plan.json +161 -0
- package/dist/knowledge/baselines/semantic-facts.d.ts +12 -0
- package/dist/knowledge/baselines/semantic-facts.js +1 -0
- package/dist/knowledge/builtin-templates.d.ts +3 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/entity-recipient-guard.d.ts +21 -0
- package/dist/knowledge/entity-recipient-guard.js +1 -0
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-ledger.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-topology.d.ts +34 -0
- package/dist/knowledge/machine-topology.js +1 -1
- package/dist/knowledge/onchain-constants.d.ts +2 -2
- package/dist/knowledge/onchain-constants.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +13 -0
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/service-allocation-semantics.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-templates.js +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-loader.d.ts +37 -1
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/tool-constraints.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +4 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/radar-core.d.ts +6 -0
- package/dist/participation/radar-core.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/index.d.ts +1 -0
- package/dist/playbooks/service-build/intent-analyzer.d.ts +1 -0
- package/dist/playbooks/service-build/intent-analyzer.js +1 -1
- package/dist/playbooks/service-build/machine-nodes.d.ts +1 -1
- package/dist/playbooks/service-build/machine-nodes.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/object-panorama.d.ts +27 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/pipeline-actions.d.ts +4 -0
- package/dist/playbooks/service-build/pipeline-actions.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/semantic-graph.d.ts +1 -0
- package/dist/playbooks/service-build/semantic-graph.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/call/machine.d.ts +1 -0
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/order.d.ts +60 -0
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +56 -0
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/goal/planning.d.ts +7 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +26 -0
- package/dist/schema/industry-pack/index.js +1 -1
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +20 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +50 -0
- package/dist/schema/persona/index.d.ts +110 -0
- package/dist/schema/query/bi.d.ts +2 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/service-clone/index.d.ts +46 -0
- package/dist/schema/service-clone/index.js +1 -0
- package/dist/schema/utils/node-parser.js +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/index.json +7 -1
- package/dist/schemas/industry_pack_operation.output.json +113 -0
- package/dist/schemas/industry_pack_operation.schema.json +7 -1
- package/dist/schemas/messenger_operation.output.json +42 -4
- package/dist/schemas/onchain_operations.output.json +1 -1
- package/dist/schemas/onchain_operations.schema.json +409 -98
- package/dist/schemas/onchain_operations_allocation.schema.json +5 -5
- package/dist/schemas/onchain_operations_arbitration.schema.json +2 -2
- package/dist/schemas/onchain_operations_contact.schema.json +1 -1
- package/dist/schemas/onchain_operations_demand.schema.json +3 -3
- package/dist/schemas/onchain_operations_gen_passport.schema.json +1 -1
- package/dist/schemas/onchain_operations_guard.schema.json +59 -59
- package/dist/schemas/onchain_operations_machine.schema.json +3 -3
- package/dist/schemas/onchain_operations_order.schema.json +133 -1
- package/dist/schemas/onchain_operations_progress.schema.json +1 -1
- package/dist/schemas/onchain_operations_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_repository.schema.json +1 -1
- package/dist/schemas/onchain_operations_reward.schema.json +4 -4
- package/dist/schemas/onchain_operations_service.schema.json +188 -9
- package/dist/schemas/onchain_operations_treasury.schema.json +7 -7
- package/dist/schemas/onchain_table_data.output.json +5 -1
- package/dist/schemas/persona_operation.output.json +266 -0
- package/dist/schemas/persona_operation.schema.json +42 -0
- package/dist/schemas/query_toolkit.output.json +46 -46
- package/dist/schemas/query_toolkit.schema.json +5 -1
- package/dist/schemas/service_clone_operation.output.json +168 -0
- package/dist/schemas/service_clone_operation.schema.json +49 -0
- package/dist/schemas/workflow_operation.schema.json +1 -1
- package/dist/tools/handlers/benchmark-migration.d.ts +17 -0
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/service-clone.d.ts +2 -0
- package/dist/tools/handlers/service-clone.js +1 -0
- package/dist/tools/index.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/wrap.d.ts +6 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +4 -3
|
@@ -302,6 +302,138 @@
|
|
|
302
302
|
}
|
|
303
303
|
},
|
|
304
304
|
"additionalProperties": false
|
|
305
|
+
},
|
|
306
|
+
"order_renew": {
|
|
307
|
+
"description": "Renewal in ONE transaction: pays into the order's allocation and advances the renew forward atomically (fund + record + advance in a single step). Replaces the legacy 3-transaction renewal split. The new Payment's sole recipient is the allocation object itself (enforced on-chain).",
|
|
308
|
+
"type": "object",
|
|
309
|
+
"properties": {
|
|
310
|
+
"allocation": {
|
|
311
|
+
"type": "string",
|
|
312
|
+
"description": "Allocation object ID or name receiving the renewal funds."
|
|
313
|
+
},
|
|
314
|
+
"type_parameter": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"description": "Coin type, e.g. \"0x2::wow::WOW\"."
|
|
317
|
+
},
|
|
318
|
+
"amount": {
|
|
319
|
+
"anyOf": [
|
|
320
|
+
{
|
|
321
|
+
"type": "object",
|
|
322
|
+
"properties": {
|
|
323
|
+
"balance": {
|
|
324
|
+
"anyOf": [
|
|
325
|
+
{
|
|
326
|
+
"type": "number"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"type": "string"
|
|
330
|
+
}
|
|
331
|
+
],
|
|
332
|
+
"description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is only within the safe integer range (±2^53); numbers outside it are REJECTED, use a numeric string instead. PRECISION RULE: for values exceeding 2^53 (9007199254740991), ALWAYS use format (1) or (2) — JS numbers lose integer precision silently and such inputs are blocked. Raw amounts must be plain non-negative integers; a decimal value without a token symbol (e.g. \"2.5\") is rejected — append the symbol (\"2.5WOW\") so the Fund Processing Layer converts it. WARNING — BARE INTEGER MEANS SMALLEST UNIT, NOT TOKENS: formats (2)/(3) are NEVER interpreted as display tokens. For example amount=\"5\" or 5 means 5 raw units = 0.000000005 WOW (9 decimals) — NOT 5 WOW. When the user asks for a token amount, you MUST use display format (\"5WOW\", \"2USDC\"); a bare integer is only correct for unitless counts (e.g. stock quantity) or when you computed exact raw units yourself. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer, where the token's FULL type, decimals and raw amount are always visible. MULTIPLE ISSUERS: several on-chain tokens may legally share the same symbol (e.g. multiple \"USDT\" coins). When a bare symbol matches more than one token, the operation is BLOCKED and every candidate is listed with full details (type, name, decimals, verified tag) — present the list to the USER and let them choose (they may answer by number), then re-issue with the chosen token's FULL type string in type_parameter; never guess an issuer from the bare symbol. MISSING TOKEN INFO: when a token's precision cannot be resolved, the operation is REFUSED (raw u64 included — amount magnitude could not be verified). Recovery: provide the token's FULL type in package::module::Name form in type_parameter (a bare symbol like \"USDT\" cannot be resolved), and verify the WOW network is correct. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: service sale prices, compensation fund balances, Treasury deposits, arbitration fees, reward amounts, stock quantities."
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"required": [
|
|
336
|
+
"balance"
|
|
337
|
+
],
|
|
338
|
+
"additionalProperties": false,
|
|
339
|
+
"description": "Specify an amount value."
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"type": "object",
|
|
343
|
+
"properties": {
|
|
344
|
+
"coin": {
|
|
345
|
+
"type": "string",
|
|
346
|
+
"description": "Coin object ID or name(local mark). WHOLE-COIN TRANSFER: the ENTIRE Coin object is moved to the recipient — the 'amount' is NOT taken from it (testnet lesson: passing your main gas coin transfers its full balance, leaving you unable to pay for anything). Use only for coins whose whole balance is exactly what you intend to send; prefer {balance: <smallest-unit number>} for partial amounts."
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
"required": [
|
|
350
|
+
"coin"
|
|
351
|
+
],
|
|
352
|
+
"additionalProperties": false
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
"description": "Renewal payment."
|
|
356
|
+
},
|
|
357
|
+
"info": {
|
|
358
|
+
"type": "object",
|
|
359
|
+
"properties": {
|
|
360
|
+
"for_object": {
|
|
361
|
+
"description": "Binding anchor for this distribution. On an Allocation a SET for_object is ENFORCED at alloc(): every GuardIdentifier recipient submission must equal this address or the whole tx aborts (ERECIPIENT_NOT_FOR_OBJECT, code 15) — verify the anchor matches the intended recipient flow BEFORE create; payment_info is immutable afterwards. NULL/omitted = no anchor: nothing is enforced on-chain, recipient routing is entirely the creator's design. Also recorded at creation for auditors to query the distribution's business context.",
|
|
362
|
+
"anyOf": [
|
|
363
|
+
{
|
|
364
|
+
"type": "string"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"type": "null"
|
|
368
|
+
}
|
|
369
|
+
]
|
|
370
|
+
},
|
|
371
|
+
"for_guard": {
|
|
372
|
+
"description": "Payment to satisfy verification of a Guard object",
|
|
373
|
+
"anyOf": [
|
|
374
|
+
{
|
|
375
|
+
"type": "string"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"type": "null"
|
|
379
|
+
}
|
|
380
|
+
]
|
|
381
|
+
},
|
|
382
|
+
"remark": {
|
|
383
|
+
"type": "string",
|
|
384
|
+
"description": "Payment record remark"
|
|
385
|
+
},
|
|
386
|
+
"index": {
|
|
387
|
+
"anyOf": [
|
|
388
|
+
{
|
|
389
|
+
"type": "number"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"type": "string"
|
|
393
|
+
}
|
|
394
|
+
],
|
|
395
|
+
"description": "Payment record index"
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"required": [
|
|
399
|
+
"remark",
|
|
400
|
+
"index"
|
|
401
|
+
],
|
|
402
|
+
"additionalProperties": false,
|
|
403
|
+
"description": "PaymentInfo for the new Payment object (remark/index, optional for_object/for_guard)."
|
|
404
|
+
},
|
|
405
|
+
"operation": {
|
|
406
|
+
"type": "object",
|
|
407
|
+
"properties": {
|
|
408
|
+
"next_node_name": {
|
|
409
|
+
"type": "string",
|
|
410
|
+
"description": "Next node name."
|
|
411
|
+
},
|
|
412
|
+
"forward": {
|
|
413
|
+
"type": "string",
|
|
414
|
+
"description": "Next forward name."
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
"required": [
|
|
418
|
+
"next_node_name",
|
|
419
|
+
"forward"
|
|
420
|
+
],
|
|
421
|
+
"additionalProperties": false,
|
|
422
|
+
"description": "Renew forward to advance after the funding lands."
|
|
423
|
+
},
|
|
424
|
+
"message": {
|
|
425
|
+
"description": "Message attached to the forward advance.",
|
|
426
|
+
"type": "string"
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
"required": [
|
|
430
|
+
"allocation",
|
|
431
|
+
"type_parameter",
|
|
432
|
+
"amount",
|
|
433
|
+
"info",
|
|
434
|
+
"operation"
|
|
435
|
+
],
|
|
436
|
+
"additionalProperties": false
|
|
305
437
|
}
|
|
306
438
|
},
|
|
307
439
|
"required": [
|
|
@@ -448,7 +580,7 @@
|
|
|
448
580
|
"type": "integer",
|
|
449
581
|
"minimum": 0,
|
|
450
582
|
"maximum": 255,
|
|
451
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
583
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
452
584
|
},
|
|
453
585
|
"b_submission": {
|
|
454
586
|
"type": "boolean",
|
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
"type": "integer",
|
|
465
465
|
"minimum": 0,
|
|
466
466
|
"maximum": 255,
|
|
467
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
467
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
468
468
|
},
|
|
469
469
|
"b_submission": {
|
|
470
470
|
"type": "boolean",
|
|
@@ -248,7 +248,7 @@
|
|
|
248
248
|
"type": "integer",
|
|
249
249
|
"minimum": 0,
|
|
250
250
|
"maximum": 255,
|
|
251
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
251
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
252
252
|
},
|
|
253
253
|
"b_submission": {
|
|
254
254
|
"type": "boolean",
|
|
@@ -1089,7 +1089,7 @@
|
|
|
1089
1089
|
"type": "integer",
|
|
1090
1090
|
"minimum": 0,
|
|
1091
1091
|
"maximum": 255,
|
|
1092
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
1092
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
1093
1093
|
},
|
|
1094
1094
|
"b_submission": {
|
|
1095
1095
|
"type": "boolean",
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
"type": "integer",
|
|
244
244
|
"minimum": 0,
|
|
245
245
|
"maximum": 255,
|
|
246
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
246
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
247
247
|
}
|
|
248
248
|
},
|
|
249
249
|
"required": [
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
"type": "integer",
|
|
308
308
|
"minimum": 0,
|
|
309
309
|
"maximum": 255,
|
|
310
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
310
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
311
311
|
}
|
|
312
312
|
},
|
|
313
313
|
"required": [
|
|
@@ -357,7 +357,7 @@
|
|
|
357
357
|
"type": "integer",
|
|
358
358
|
"minimum": 0,
|
|
359
359
|
"maximum": 255,
|
|
360
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
360
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
361
361
|
},
|
|
362
362
|
{
|
|
363
363
|
"type": "null"
|
|
@@ -666,7 +666,7 @@
|
|
|
666
666
|
"type": "integer",
|
|
667
667
|
"minimum": 0,
|
|
668
668
|
"maximum": 255,
|
|
669
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
669
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
670
670
|
},
|
|
671
671
|
"b_submission": {
|
|
672
672
|
"type": "boolean",
|
|
@@ -248,7 +248,7 @@
|
|
|
248
248
|
"additionalProperties": false
|
|
249
249
|
},
|
|
250
250
|
"namedNewOrder": {
|
|
251
|
-
"description": "RECOMMENDED: Set a local name for the newly created Order object. Without this, the Order is only referenceable by its on-chain address. Example: {name: 'my_order_v1'} allows subsequent operations to use 'my_order_v1' instead of the address. PLACEMENT: this field MUST be inside data.order_new (it is an OrderNew field) — putting namedNewOrder at the data root fails schema validation with 'Unrecognized key'. MIGRATION TIP: for batch/migration order creation, always auto-generate readable names (e.g. '<source>_<service>_<seq>' like '
|
|
251
|
+
"description": "RECOMMENDED: Set a local name for the newly created Order object. Without this, the Order is only referenceable by its on-chain address. Example: {name: 'my_order_v1'} allows subsequent operations to use 'my_order_v1' instead of the address. PLACEMENT: this field MUST be inside data.order_new (it is an OrderNew field) — putting namedNewOrder at the data root fails schema validation with 'Unrecognized key'. MIGRATION TIP: for batch/migration order creation, always auto-generate readable names (e.g. '<source>_<service>_<seq>' like 'my_shop_svc_v1_0001') — unnamed orders (head.name = null) are only address-referenceable, which breaks downstream queries, displays and audits (E-8).",
|
|
252
252
|
"type": "object",
|
|
253
253
|
"properties": {
|
|
254
254
|
"name": {
|
|
@@ -666,7 +666,7 @@
|
|
|
666
666
|
"suspension"
|
|
667
667
|
],
|
|
668
668
|
"additionalProperties": false,
|
|
669
|
-
"description": "Suspend or resume ONE product without removing it (keeps price/stock/WIP binding). The
|
|
669
|
+
"description": "Suspend or resume ONE product without removing it (keeps price/stock/WIP binding). The retail-style 'out of stock / listing inactive' state. Only the named product is touched; an unknown sale_name is silently ignored on-chain (verify with query_toolkit afterwards)."
|
|
670
670
|
}
|
|
671
671
|
]
|
|
672
672
|
},
|
|
@@ -1012,7 +1012,7 @@
|
|
|
1012
1012
|
}
|
|
1013
1013
|
},
|
|
1014
1014
|
"order_allocators": {
|
|
1015
|
-
"description": "Order fund allocator. Max 100 allocators (MAX_ALLOCATOR_COUNT). ✅ EACH allocator has a guard, and EVERY allocator whose guard address matches the supplied guard RUNS — they are NOT mutually exclusive and NOT first-match-wins. One guard may legitimately authorize several distribution rules (different fix / rate / cap); each contributes its own Payment and consumes its own once-slot (keyed by the allocator index). Allocators are evaluated in vector order against the SHRINKING pool, so a later allocator only sees the balance left by the earlier ones — which is exactly how a waterfall (e.g. Amount fee + net Rate split) is built. On-chain truth: wow::allocation (allocation.move:
|
|
1015
|
+
"description": "Order fund allocator. Max 100 allocators (MAX_ALLOCATOR_COUNT). ✅ EACH allocator has a guard, and EVERY allocator whose guard address matches the supplied guard RUNS — they are NOT mutually exclusive and NOT first-match-wins. One guard may legitimately authorize several distribution rules (different fix / rate / cap); each contributes its own Payment and consumes its own once-slot (keyed by the allocator index). Allocators are evaluated in vector order against the SHRINKING pool, so a later allocator only sees the balance left by the earlier ones — which is exactly how a waterfall (e.g. Amount fee + net Rate split) is built. On-chain truth: wow::allocation (allocation.move:429-431, `while` loop over all allocators, `if (guard address == alloc.guard)`). ⚠️ If you WANT mutual exclusion you must express it inside the Guard itself (make the conditions logically exclusive). Set to null to clear. ⚠️ IMMUTABLE after publish except APPEND: order_allocators full replacement can ONLY be done BEFORE publish=true (on-chain check rejects after publish — E_ALREADY_PUBLISHED). After publish, the ONLY mutation is order_allocators_append (prefix-frozen extension — see that field). There is NO pause+lock exception for order_allocators (unlike arbitrations/rewards which have time-lock removal). PRE-PUBLISH CHECKLIST: verify all guard names resolve, all sharing amounts are correct, threshold is set, and recipient types (Entity/Signer/GuardIdentifier) are intended before calling publish=true. GuardIdentifier sharing mode: {who: {GuardIdentifier: <u8>}, sharing: <rate>, mode: 'Rate'} — resolves recipient from the Guard table submission at allocation time. BINDING SEMANTICS (contract-enforced, abort code 15): in a Service-created Allocation EVERY GuardIdentifier submission must equal the PAYING order — it is always 'the order', never a third party whose address is supplied at trigger time; use {who:{Entity:...}} for named parties. Canonical order pattern: the recipient slot is the single submitted Order (constrained by the Guard — service binding, qualifying node, signer==order.owner); funds land at that order object and are receivable only by its owner (object receipt = owner receipt). Safety is determined by constraint sufficiency — run the recipient constraint audit before publish. Fixed recipients should use {who:{Entity:...}}; unbound Signer recipients are a CRITICAL theft risk. MULTI-CALL ALLOCATION: an allocation can be executed MULTIPLE times (no consumed flag in contract). Use Amount mode (not Surplus) for recurring allocations — an uncapped Surplus sweeps the entire remaining balance on first run. For monthly payment scenarios, create multiple Allocators with time-based Guards + Amount mode sharing items.",
|
|
1016
1016
|
"anyOf": [
|
|
1017
1017
|
{
|
|
1018
1018
|
"type": "object",
|
|
@@ -1040,7 +1040,7 @@
|
|
|
1040
1040
|
"properties": {
|
|
1041
1041
|
"guard": {
|
|
1042
1042
|
"type": "string",
|
|
1043
|
-
"description": "Guard object ID or name.
|
|
1043
|
+
"description": "Guard object ID or name. A distribution call submits ONE guard; EVERY Allocator bound to that guard fires — in vector order, each against the balance left by the previous (allocation.move:366-368: the loop matches the submitted guard address, it does NOT evaluate guards competitively). NOT first-match-wins: Allocators with different guards are alternative distribution paths selected by the caller's choice of guard (e.g., a refund guard vs a damage guard), and mutual exclusion must be expressed inside the Guard conditions themselves, never assumed from ordering."
|
|
1044
1044
|
},
|
|
1045
1045
|
"sharing": {
|
|
1046
1046
|
"type": "array",
|
|
@@ -1056,7 +1056,7 @@
|
|
|
1056
1056
|
"type": "integer",
|
|
1057
1057
|
"minimum": 0,
|
|
1058
1058
|
"maximum": 255,
|
|
1059
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
1059
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
1060
1060
|
}
|
|
1061
1061
|
},
|
|
1062
1062
|
"required": [
|
|
@@ -1182,7 +1182,7 @@
|
|
|
1182
1182
|
"additionalProperties": false,
|
|
1183
1183
|
"description": "Fund allocator — a complete allocation strategy triggered by a Guard. Contains a sharing[] array where items can mix Amount/Rate/RateGross/Surplus modes. When the Guard passes, the contract allocates funds in strict order: Amount → Rate/RateGross → Surplus."
|
|
1184
1184
|
},
|
|
1185
|
-
"description": "Fund allocator list.
|
|
1185
|
+
"description": "Fund allocator list. NOT first-match-wins: a distribution call submits ONE guard and EVERY allocator bound to that guard fires, in vector order, each against the shrinking pool left by the previous (this is how a waterfall like Amount fee + net Rate split is built). Alternative paths (e.g., refund / damage-deduct / arbitrate) are expressed as allocators bound to DIFFERENT guards; the caller's submitted guard selects the path."
|
|
1186
1186
|
}
|
|
1187
1187
|
},
|
|
1188
1188
|
"required": [
|
|
@@ -1191,13 +1191,192 @@
|
|
|
1191
1191
|
"allocators"
|
|
1192
1192
|
],
|
|
1193
1193
|
"additionalProperties": false,
|
|
1194
|
-
"description": "Fund allocator list — the top-level allocation configuration attached to an Order. Contains a threshold and a list of Allocators.
|
|
1194
|
+
"description": "Fund allocator list — the top-level allocation configuration attached to an Order. Contains a threshold and a list of Allocators. A distribution call submits ONE guard; every Allocator bound to that guard executes its sharing[] in strict order (Amount → Rate/RateGross → Surplus) against the shrinking pool. MULTI-TIER ALLOCATION (DOC-04): Each Order binds ONE Allocators template (set on Service.order_allocators before publish). For multi-tier distribution (e.g., customer→agency→suppliers), use a two-phase approach: (1) Tier-1 Allocators on the customer's Order (allocates to agency + refund fund); (2) Tier-2 Allocators on a NEW Order created by the agency (allocates agency's received funds to suppliers). Each tier's NET Rate-mode sharing[] must independently sum to 10000 (or <= 10000 with Surplus); RateGross-mode sharing[] must sum to <= 10000."
|
|
1195
1195
|
},
|
|
1196
1196
|
{
|
|
1197
1197
|
"type": "null"
|
|
1198
1198
|
}
|
|
1199
1199
|
]
|
|
1200
1200
|
},
|
|
1201
|
+
"order_allocators_append": {
|
|
1202
|
+
"description": "Append-only correction window for order_allocators — the ONLY allocator mutation allowed AFTER publish (J1). REQUIREMENTS (chain-enforced, allocation abort code 20 EALLOCATORS_NOT_EXTENSION): the supplied Allocators must be a pure EXTENSION of the current on-chain plan — every existing allocator appears VERBATIM as a prefix (same guard, same sharing, same fix/max), threshold must be UNCHANGED; only description may change freely. New allocators are appended after the prefix. WHY: rewriting an existing allocator or changing the threshold would retroactively alter payout rules for orders already escrowed against the old plan. Clearing the plan (null) is NOT possible here — that would strand in-flight orders. Permission: same index 313 as order_allocators. USE CASE: you forgot one allocator guard (e.g. the refund exit for a review node) and the Service is already published — instead of abandoning the Service, append the missing allocator. ⚠️ Appended allocators are evaluated AFTER the existing ones against the shrinking pool (vector order), so they see the balance left by earlier allocators — design appended waterfall tails accordingly. ⚠️ Once appended, an allocator can NEVER be edited or removed — same permanence as the original plan.",
|
|
1203
|
+
"type": "object",
|
|
1204
|
+
"properties": {
|
|
1205
|
+
"description": {
|
|
1206
|
+
"type": "string",
|
|
1207
|
+
"description": "Description of fund allocator list"
|
|
1208
|
+
},
|
|
1209
|
+
"threshold": {
|
|
1210
|
+
"default": 0,
|
|
1211
|
+
"description": "Minimum balance required for allocation to fire. When the Allocation object's balance < threshold, allocation aborts with EINSUFFICIENT_BALANCE=7. Also: when an Allocator has only Amount items (no Rate, no Surplus), the sum of Amount items must be >= threshold (EAMOUNT_BELOW_THRESHOLD=12). Set to 0 (default) to allow any balance.",
|
|
1212
|
+
"anyOf": [
|
|
1213
|
+
{
|
|
1214
|
+
"type": "number"
|
|
1215
|
+
},
|
|
1216
|
+
{
|
|
1217
|
+
"type": "string"
|
|
1218
|
+
}
|
|
1219
|
+
]
|
|
1220
|
+
},
|
|
1221
|
+
"allocators": {
|
|
1222
|
+
"type": "array",
|
|
1223
|
+
"items": {
|
|
1224
|
+
"type": "object",
|
|
1225
|
+
"properties": {
|
|
1226
|
+
"guard": {
|
|
1227
|
+
"type": "string",
|
|
1228
|
+
"description": "Guard object ID or name. A distribution call submits ONE guard; EVERY Allocator bound to that guard fires — in vector order, each against the balance left by the previous (allocation.move:366-368: the loop matches the submitted guard address, it does NOT evaluate guards competitively). NOT first-match-wins: Allocators with different guards are alternative distribution paths selected by the caller's choice of guard (e.g., a refund guard vs a damage guard), and mutual exclusion must be expressed inside the Guard conditions themselves, never assumed from ordering."
|
|
1229
|
+
},
|
|
1230
|
+
"sharing": {
|
|
1231
|
+
"type": "array",
|
|
1232
|
+
"items": {
|
|
1233
|
+
"type": "object",
|
|
1234
|
+
"properties": {
|
|
1235
|
+
"who": {
|
|
1236
|
+
"anyOf": [
|
|
1237
|
+
{
|
|
1238
|
+
"type": "object",
|
|
1239
|
+
"properties": {
|
|
1240
|
+
"GuardIdentifier": {
|
|
1241
|
+
"type": "integer",
|
|
1242
|
+
"minimum": 0,
|
|
1243
|
+
"maximum": 255,
|
|
1244
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
1245
|
+
}
|
|
1246
|
+
},
|
|
1247
|
+
"required": [
|
|
1248
|
+
"GuardIdentifier"
|
|
1249
|
+
],
|
|
1250
|
+
"additionalProperties": false,
|
|
1251
|
+
"description": "Guard verified recipient ID. Get recipient ID from specified data index in Guard table. The ID must be of address type."
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
"type": "object",
|
|
1255
|
+
"properties": {
|
|
1256
|
+
"Entity": {
|
|
1257
|
+
"type": "object",
|
|
1258
|
+
"properties": {
|
|
1259
|
+
"name_or_address": {
|
|
1260
|
+
"type": "string",
|
|
1261
|
+
"description": "Account/Object name or ID. If specifying an account, use empty string '' for the default account. If it starts with '0x', it will be treated as an ID. Otherwise, it will be treated as a name (max 64 bcs characters)."
|
|
1262
|
+
},
|
|
1263
|
+
"local_mark_first": {
|
|
1264
|
+
"description": "Whether to prioritize local marks, if true, prioritize local marks, otherwise prioritize global marks",
|
|
1265
|
+
"type": "boolean"
|
|
1266
|
+
}
|
|
1267
|
+
},
|
|
1268
|
+
"additionalProperties": false,
|
|
1269
|
+
"description": "Account or address lookup object. Use this to specify which account to use for an operation. EXAMPLE: { name_or_address: 'testor2' } - looks up account by name; EXAMPLE: { name_or_address: '0x1234...' } - uses address directly; If name_or_address is empty string '', uses the default local account."
|
|
1270
|
+
}
|
|
1271
|
+
},
|
|
1272
|
+
"required": [
|
|
1273
|
+
"Entity"
|
|
1274
|
+
],
|
|
1275
|
+
"additionalProperties": false,
|
|
1276
|
+
"description": "Static address resolved via LocalMark. Format: {Entity: {name_or_address: 'mark_name'}} — NOTE: Entity is an OBJECT with name_or_address field, NOT a bare string."
|
|
1277
|
+
},
|
|
1278
|
+
{
|
|
1279
|
+
"type": "object",
|
|
1280
|
+
"properties": {
|
|
1281
|
+
"Signer": {
|
|
1282
|
+
"type": "string",
|
|
1283
|
+
"const": "signer"
|
|
1284
|
+
}
|
|
1285
|
+
},
|
|
1286
|
+
"required": [
|
|
1287
|
+
"Signer"
|
|
1288
|
+
],
|
|
1289
|
+
"additionalProperties": false,
|
|
1290
|
+
"description": "Current transaction signer (tx_context::sender) at the time of the alloc() call. For refunds, the Order owner must call alloc_by_guard themselves to receive the funds."
|
|
1291
|
+
}
|
|
1292
|
+
],
|
|
1293
|
+
"description": "Recipient of this allocation. Three forms — each resolves the address at a DIFFERENT time:\n• { GuardIdentifier: u8 } — DYNAMIC address resolved from Passport at alloc() time (from the passport's submission record). Use 0 for Order owner in Service-integrated mode (Customer who created the Order). The identifier must match a Guard table entry with b_submission=true. If Passport has no matching submission, contract aborts with E_VERIFY_FAILED. Use when the recipient address is not known at config time and must be supplied via Guard submission data.\n• { Entity: { name_or_address: '...' } } — FIXED address resolved via LocalMark at SDK build time (passed to contract as a literal address). Use for known recipients (e.g., 'turo_host', or a Treasury object address). Use when the recipient is a stable, known address (e.g., operator receives rent, platform fee to treasury).\n• 'Signer' — the transaction sender at the time of the alloc() call (tx_context::sender). RESOLVED AT EXECUTION TIME, not at config time. For refunds: the customer (Order owner) must call alloc_by_guard THEMSELVES so that tx_context::sender resolves to THEIR address — if the operator calls alloc_by_guard, the operator becomes the recipient (Signer = operator), NOT the customer. Use when the recipient is whoever submits the allocation transaction (e.g., customer receives refund)."
|
|
1294
|
+
},
|
|
1295
|
+
"sharing": {
|
|
1296
|
+
"anyOf": [
|
|
1297
|
+
{
|
|
1298
|
+
"type": "number"
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
"type": "string"
|
|
1302
|
+
}
|
|
1303
|
+
],
|
|
1304
|
+
"description": "Allocation value. SEMANTICS DEPEND ON `mode`:\n• mode='Amount': absolute amount in smallest unit (e.g., '750000000' for 0.75 WOW, '250000000' for 0.25 WOW). Allocated first; sum of Amount items cached as `fix`.\n• mode='Rate' (NET): basis-points rate off the post-fix base (balance - fix, or max - fix), 10000 = 100% (e.g., '7500' for 75%, '2500' for 25%). When no Surplus in same Allocator, sum MUST == 10000; when Surplus present, sum MUST <= 10000.\n• mode='RateGross': basis-points rate off the FULL pool (balance) or the `max` cap — the fixed Amount total is NOT subtracted, 10000 = 100%. sum MUST <= 10000 (and, with `max` set, fix×10000 + sum×max <= max×10000). Cannot be mixed with mode='Rate' in the same Allocator while a fixed Amount total is present.\n• mode='Surplus': IGNORED (contract forces to 0). Set to '0' for clarity. Receives remaining balance after Amount + Rate/RateGross allocations.\n⚠️ T1 LOSSY POINT (B-2): the value is PRE-CONFIGURED and STATIC. A continuous/conditional amount (e.g. 'pay exactly the assessed loss amount') CANNOT be expressed — there is no runtime formula field. Model variable payouts as (a) a fixed-tier Allocator list guarded by distinct Guards, or (b) an Amount with a `max` cap — both are finite configurations, not free-form formulas."
|
|
1305
|
+
},
|
|
1306
|
+
"mode": {
|
|
1307
|
+
"anyOf": [
|
|
1308
|
+
{
|
|
1309
|
+
"type": "string",
|
|
1310
|
+
"enum": [
|
|
1311
|
+
"Amount",
|
|
1312
|
+
"Rate",
|
|
1313
|
+
"Surplus",
|
|
1314
|
+
"RateGross"
|
|
1315
|
+
]
|
|
1316
|
+
},
|
|
1317
|
+
{}
|
|
1318
|
+
],
|
|
1319
|
+
"description": "Allocation mode — determines how the `sharing` field is interpreted. Four modes can be used individually OR combined within a single Allocator; when combined, allocation order is strictly: Amount first, then Rate/RateGross, then Surplus. Understanding these modes allows modeling almost any fund distribution pattern.\n• Amount (0): `sharing` is a FIXED amount in smallest unit (e.g., '750000000' = 0.75 WOW). Allocated FIRST; sum of all Amount items is cached as `fix` by the contract. Validation: when no Rate and no Surplus items exist, sum of Amount items must be >= allocators.threshold (EAMOUNT_BELOW_THRESHOLD=12); when `max` is set, sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13).\n• Rate (1): `sharing` is a NET basis-points rate (10000 = 100%). Allocated AFTER Amount; formula: allocated = (sharing × total_rates) / 10000, where total_rates = balance - fix (or max - fix if `max` is set) — the cached fixed Amount total IS subtracted. Validation: when no Surplus items exist, sum of all Rate items must be EXACTLY 10000 (ERATE_NOT_10000=4); when Surplus items exist, sum of all Rate items must be <= 10000 (ERATE_EXCEEDS_10000=6).\n• RateGross (3): `sharing` is a GROSS basis-points rate (10000 = 100%). Allocated AFTER Amount; formula: allocated = (sharing × total_rates) / 10000, where total_rates = balance (the full pool) or the `max` cap when set — the fixed Amount total is NOT subtracted, so fixed Amount entries and percentage-of-total rates coexist exactly. Validation: sum of all RateGross items must be <= 10000 (ERATE_EXCEEDS_10000=6); when `max` is set, fix×10000 + sum(rate)×max <= max×10000 must hold (6); with no `max` and a fixed total > 0, sum of RateGross items must be < 10000 (6). RateGross cannot be mixed with NET Rate entries in the same Allocator while a fixed Amount total is present (EMIXED_RATE_BASES=17).\n• Surplus (2): `sharing` is IGNORED (contract forces it to 0). Allocated LAST; receives the remaining balance after Amount + Rate allocations. Validation: MAX ONE Surplus item per Allocator (EMULTIPLE_SURPLUS=5). When Surplus exists, Rate sum constraint relaxes from == 10000 to <= 10000.\nALLOCATION ORDER (strict): Amount items (fixed, cached as fix) → Rate/RateGross items → Surplus item (remaining).\nRECOMMENDATION: Use Amount mode for known fixed amounts (clearer, no sum constraint). Use Rate mode for proportional splits off the post-fix remainder (requires sum == 10000 unless Surplus present). Use RateGross mode for a percentage of the FULL pool/`max` that must coexist with fixed Amount entries. Use Surplus to capture remainder (e.g., platform fee + host gets rest). Accepts string ('Amount'/'Rate'/'Surplus'/'RateGross', recommended) or number (0/1/2/3)."
|
|
1320
|
+
}
|
|
1321
|
+
},
|
|
1322
|
+
"required": [
|
|
1323
|
+
"who",
|
|
1324
|
+
"sharing",
|
|
1325
|
+
"mode"
|
|
1326
|
+
],
|
|
1327
|
+
"additionalProperties": false,
|
|
1328
|
+
"description": "Fund allocation item — one recipient's share of the Allocation balance. The `sharing` value's meaning depends on `mode` (see AllocationModeSchema). Multiple items in the same Allocator are evaluated together: Amount items first, Rate/RateGross items second, Surplus last."
|
|
1329
|
+
},
|
|
1330
|
+
"description": "Fund allocation item list. Each item specifies a recipient (who), a value (sharing), and a mode. Items can mix modes (Amount + Rate/RateGross + Surplus) within the same Allocator. RECIPIENT SEMANTICS: the Guard constrains what each submission slot may be; a recipient's safety follows from the sufficiency of those constraints (run the recipient constraint audit). Canonical order pattern: recipient = the single submitted Order — funds land at that object and are receivable only by its owner. ALLOCATION ORDER: Amount items first (cached as fix) → Rate items (proportional to balance - fix; RateGross proportional to the full pool) → Surplus item (remaining). CONSTRAINTS: max ONE Surplus item per Allocator; NET Rate sum must == 10000 (no Surplus) or <= 10000 (with Surplus); RateGross sum must <= 10000 (never mixed with NET Rate while a fixed total is present); Amount sum must >= threshold (no Rate and no Surplus) and <= max (if max set)."
|
|
1331
|
+
},
|
|
1332
|
+
"fix": {
|
|
1333
|
+
"description": "OUTPUT-ONLY (query result). Cached sum of all Amount-mode `sharing` values in this Allocator. Computed by the contract when the allocator is added — DO NOT set this field at creation. Used internally to compute `total_rates = balance - fix` for NET Rate allocation (RateGross ignores fix and uses the full pool/`max`).",
|
|
1334
|
+
"anyOf": [
|
|
1335
|
+
{
|
|
1336
|
+
"type": "number"
|
|
1337
|
+
},
|
|
1338
|
+
{
|
|
1339
|
+
"type": "string"
|
|
1340
|
+
}
|
|
1341
|
+
]
|
|
1342
|
+
},
|
|
1343
|
+
"max": {
|
|
1344
|
+
"description": "Maximum allocation cap (OPTIONAL — omit the field or set to null to disable the cap; do NOT set to 0 as that means a cap of zero). Passed through to the contract as Option<u64> when the allocator is added: when null/omitted the contract treats it as `none` (no cap); when set, the contract enforces it. Has THREE effects when set:\n1. Construction: sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13)\n2. Rate execution: NET Rate total_rates = max - fix; RateGross total_rates = max (fix NOT subtracted)\n3. Surplus execution: surplus_amount = max - alloced_amount (instead of balance - alloced_amount)\nUse when you want to cap total allocation regardless of Order balance (e.g., cap payout to declared amount). SDK pre-validates Amount sum <= max at build time to give actionable error messages before on-chain abort.",
|
|
1345
|
+
"anyOf": [
|
|
1346
|
+
{
|
|
1347
|
+
"anyOf": [
|
|
1348
|
+
{
|
|
1349
|
+
"type": "number"
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
"type": "string"
|
|
1353
|
+
}
|
|
1354
|
+
],
|
|
1355
|
+
"description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is only within the safe integer range (±2^53); numbers outside it are REJECTED, use a numeric string instead. PRECISION RULE: for values exceeding 2^53 (9007199254740991), ALWAYS use format (1) or (2) — JS numbers lose integer precision silently and such inputs are blocked. Raw amounts must be plain non-negative integers; a decimal value without a token symbol (e.g. \"2.5\") is rejected — append the symbol (\"2.5WOW\") so the Fund Processing Layer converts it. WARNING — BARE INTEGER MEANS SMALLEST UNIT, NOT TOKENS: formats (2)/(3) are NEVER interpreted as display tokens. For example amount=\"5\" or 5 means 5 raw units = 0.000000005 WOW (9 decimals) — NOT 5 WOW. When the user asks for a token amount, you MUST use display format (\"5WOW\", \"2USDC\"); a bare integer is only correct for unitless counts (e.g. stock quantity) or when you computed exact raw units yourself. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer, where the token's FULL type, decimals and raw amount are always visible. MULTIPLE ISSUERS: several on-chain tokens may legally share the same symbol (e.g. multiple \"USDT\" coins). When a bare symbol matches more than one token, the operation is BLOCKED and every candidate is listed with full details (type, name, decimals, verified tag) — present the list to the USER and let them choose (they may answer by number), then re-issue with the chosen token's FULL type string in type_parameter; never guess an issuer from the bare symbol. MISSING TOKEN INFO: when a token's precision cannot be resolved, the operation is REFUSED (raw u64 included — amount magnitude could not be verified). Recovery: provide the token's FULL type in package::module::Name form in type_parameter (a bare symbol like \"USDT\" cannot be resolved), and verify the WOW network is correct. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: service sale prices, compensation fund balances, Treasury deposits, arbitration fees, reward amounts, stock quantities."
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
"type": "null"
|
|
1359
|
+
}
|
|
1360
|
+
]
|
|
1361
|
+
}
|
|
1362
|
+
},
|
|
1363
|
+
"required": [
|
|
1364
|
+
"guard",
|
|
1365
|
+
"sharing"
|
|
1366
|
+
],
|
|
1367
|
+
"additionalProperties": false,
|
|
1368
|
+
"description": "Fund allocator — a complete allocation strategy triggered by a Guard. Contains a sharing[] array where items can mix Amount/Rate/RateGross/Surplus modes. When the Guard passes, the contract allocates funds in strict order: Amount → Rate/RateGross → Surplus."
|
|
1369
|
+
},
|
|
1370
|
+
"description": "Fund allocator list. NOT first-match-wins: a distribution call submits ONE guard and EVERY allocator bound to that guard fires, in vector order, each against the shrinking pool left by the previous (this is how a waterfall like Amount fee + net Rate split is built). Alternative paths (e.g., refund / damage-deduct / arbitrate) are expressed as allocators bound to DIFFERENT guards; the caller's submitted guard selects the path."
|
|
1371
|
+
}
|
|
1372
|
+
},
|
|
1373
|
+
"required": [
|
|
1374
|
+
"description",
|
|
1375
|
+
"threshold",
|
|
1376
|
+
"allocators"
|
|
1377
|
+
],
|
|
1378
|
+
"additionalProperties": false
|
|
1379
|
+
},
|
|
1201
1380
|
"buy_guard": {
|
|
1202
1381
|
"description": "Buy guard object ID or name.",
|
|
1203
1382
|
"anyOf": [
|
|
@@ -1570,7 +1749,7 @@
|
|
|
1570
1749
|
"type": "boolean"
|
|
1571
1750
|
},
|
|
1572
1751
|
"publish": {
|
|
1573
|
-
"description": "Whether to publish the Service. After publishing, customers can place orders. ⚠️ PRE-PUBLISH EVALUATION (mandatory, stop-node fund-exit coverage): service.allocators MUST cover EVERY stop node of the bound Machine — every node where an order can rest (terminal nodes AND waiting states: review windows, handovers, open disputes) needs BOTH a withdrawal (release) AND a refund allocation rule, and each mapping guard must be satisfiable in BOTH directions. An uncovered stop node strands escrowed funds permanently (order_allocators is L1-immutable). Review-gated release is a TIME VARIANT inside ONE exit guard ('reviewed OR unreviewed after T'), never parallel outgoing edges (race deadlock). See pattern.fund_flow_stop_node_coverage + rules R-M5-03 / R-M5-09. VERIFIED against Move source + SDK (4-level immutability matrix):\n L1 — PERMANENTLY LOCKED after publish (assert!(!bPublished), no pause+lock exception):\n • machine (workflow template)\n • order_allocators (fund distribution rules)\n L2 — TIME-LOCKED after publish (unpublished-state check — requires pause + setting_lock_duration elapsed):\n • arbitrations remove/clear (dispute resolution objects)\n • rewards remove/clear (reward objects)\n • compensation_fund_withdraw (withdraw ALL funds)\n L3 — REMAIN MUTABLE after publish (no SDK check, no Move check):\n • arbitrations add, rewards add (no assert — can add after publish)\n • buy_guard, sales, discount, description, location, pause, repositories,\n • compensation_fund_add, setting_lock_duration_add, customer_required, um (Contact)\nThese 2 L1-LOCKED fields (machine/order_allocators) MUST be set BEFORE publish=true.\narbitrations/rewards can be ADDED after publish but remove/clear requires pause+lock.\n\n⚠️ COMPENSATION_FUND + ARBITRATION LINKAGE:\n At publish time, if compensation_fund > 0, Arbitration MUST be bound:\n if (balance::value(&self.compensation_fund) > 0) {\n assert!(arbitration_count > 0, E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND);\n }\n The MCP handler enforces this as a HARD PRE-CHECK: if publish=true AND compensation_fund_add is set in the same call AND arbitrations is empty, the call is REJECTED before submission. If compensation_fund was deposited in a prior call, a SOFT WARNING is issued.\n\nSCHEMA-03 / P0-01 fix — DEPLOYMENT WORKFLOW (two-phase, avoids circular dependency):\n Phase 1 — CREATE (no publish): object={name:'my-service', type_parameter, permission} + machine + order_allocators + arbitrations.\n NOTE: buy_guard can use a LocalMark NAME (not address) to break the Guard→Service circular dependency.\n The name is resolved to an address at transaction build time.\n Phase 2 — PUBLISH: object='my-service' (string ref) + publish=true.\n All L1-LOCKED fields must be set in Phase 1; Phase 2 only flips the publish flag.\n Post-publish updates: buy_guard, sales, description, repositories (add), rewards (add), arbitrations (add), etc.",
|
|
1752
|
+
"description": "Whether to publish the Service. After publishing, customers can place orders. ⚠️ PRE-PUBLISH EVALUATION (mandatory, stop-node fund-exit coverage): service.allocators MUST cover EVERY stop node of the bound Machine — every node where an order can rest (terminal nodes AND waiting states: review windows, handovers, open disputes) needs BOTH a withdrawal (release) AND a refund allocation rule, and each mapping guard must be satisfiable in BOTH directions. An uncovered stop node strands escrowed funds permanently (order_allocators is L1-immutable). Review-gated release is a TIME VARIANT inside ONE exit guard ('reviewed OR unreviewed after T'), never parallel outgoing edges (race deadlock). See pattern.fund_flow_stop_node_coverage + rules R-M5-03 / R-M5-09. VERIFIED against Move source + SDK (4-level immutability matrix):\n L1 — PERMANENTLY LOCKED after publish (assert!(!bPublished), no pause+lock exception):\n • machine (workflow template)\n • order_allocators (fund distribution rules — full replacement locked; APPEND-ONLY additions remain possible via order_allocators_append, prefix/threshold frozen)\n L2 — TIME-LOCKED after publish (unpublished-state check — requires pause + setting_lock_duration elapsed):\n • arbitrations remove/clear (dispute resolution objects)\n • rewards remove/clear (reward objects)\n • compensation_fund_withdraw (withdraw ALL funds)\n L3 — REMAIN MUTABLE after publish (no SDK check, no Move check):\n • arbitrations add, rewards add (no assert — can add after publish)\n • buy_guard, sales, discount, description, location, pause, repositories,\n • compensation_fund_add, setting_lock_duration_add, customer_required, um (Contact)\nThese 2 L1-LOCKED fields (machine/order_allocators) MUST be set BEFORE publish=true.\narbitrations/rewards can be ADDED after publish but remove/clear requires pause+lock.\n\n⚠️ COMPENSATION_FUND + ARBITRATION LINKAGE:\n At publish time, if compensation_fund > 0, Arbitration MUST be bound:\n if (balance::value(&self.compensation_fund) > 0) {\n assert!(arbitration_count > 0, E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND);\n }\n The MCP handler enforces this as a HARD PRE-CHECK: if publish=true AND compensation_fund_add is set in the same call AND arbitrations is empty, the call is REJECTED before submission. If compensation_fund was deposited in a prior call, a SOFT WARNING is issued.\n\nSCHEMA-03 / P0-01 fix — DEPLOYMENT WORKFLOW (two-phase, avoids circular dependency):\n Phase 1 — CREATE (no publish): object={name:'my-service', type_parameter, permission} + machine + order_allocators + arbitrations.\n NOTE: buy_guard can use a LocalMark NAME (not address) to break the Guard→Service circular dependency.\n The name is resolved to an address at transaction build time.\n Phase 2 — PUBLISH: object='my-service' (string ref) + publish=true.\n All L1-LOCKED fields must be set in Phase 1; Phase 2 only flips the publish flag.\n Post-publish updates: buy_guard, sales, description, repositories (add), rewards (add), arbitrations (add), etc.",
|
|
1574
1753
|
"type": "boolean"
|
|
1575
1754
|
}
|
|
1576
1755
|
},
|
|
@@ -1718,7 +1897,7 @@
|
|
|
1718
1897
|
"type": "integer",
|
|
1719
1898
|
"minimum": 0,
|
|
1720
1899
|
"maximum": 255,
|
|
1721
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
1900
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
1722
1901
|
},
|
|
1723
1902
|
"b_submission": {
|
|
1724
1903
|
"type": "boolean",
|
|
@@ -475,7 +475,7 @@
|
|
|
475
475
|
"type": "integer",
|
|
476
476
|
"minimum": 0,
|
|
477
477
|
"maximum": 255,
|
|
478
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
478
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
479
479
|
},
|
|
480
480
|
{
|
|
481
481
|
"type": "null"
|
|
@@ -489,7 +489,7 @@
|
|
|
489
489
|
"type": "integer",
|
|
490
490
|
"minimum": 0,
|
|
491
491
|
"maximum": 255,
|
|
492
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
492
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
493
493
|
},
|
|
494
494
|
{
|
|
495
495
|
"type": "null"
|
|
@@ -534,7 +534,7 @@
|
|
|
534
534
|
"type": "integer",
|
|
535
535
|
"minimum": 0,
|
|
536
536
|
"maximum": 255,
|
|
537
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
537
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
538
538
|
},
|
|
539
539
|
{
|
|
540
540
|
"type": "null"
|
|
@@ -548,7 +548,7 @@
|
|
|
548
548
|
"type": "integer",
|
|
549
549
|
"minimum": 0,
|
|
550
550
|
"maximum": 255,
|
|
551
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
551
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
552
552
|
},
|
|
553
553
|
{
|
|
554
554
|
"type": "null"
|
|
@@ -637,7 +637,7 @@
|
|
|
637
637
|
"type": "integer",
|
|
638
638
|
"minimum": 0,
|
|
639
639
|
"maximum": 255,
|
|
640
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
640
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
641
641
|
},
|
|
642
642
|
{
|
|
643
643
|
"type": "null"
|
|
@@ -687,7 +687,7 @@
|
|
|
687
687
|
"type": "integer",
|
|
688
688
|
"minimum": 0,
|
|
689
689
|
"maximum": 255,
|
|
690
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
690
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
691
691
|
},
|
|
692
692
|
{
|
|
693
693
|
"type": "null"
|
|
@@ -1022,7 +1022,7 @@
|
|
|
1022
1022
|
"type": "integer",
|
|
1023
1023
|
"minimum": 0,
|
|
1024
1024
|
"maximum": 255,
|
|
1025
|
-
"description": "Identifier (0-255) for data lookup in Guard table."
|
|
1025
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds)."
|
|
1026
1026
|
},
|
|
1027
1027
|
"b_submission": {
|
|
1028
1028
|
"type": "boolean",
|