@wowok/agent-mcp 2.7.0 → 2.7.2
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/config/index.js +1 -1
- package/dist/config/runtime.js +1 -238
- package/dist/customer/customer-advice.js +1 -130
- package/dist/customer/index.js +1 -11
- package/dist/customer/industry-risks.js +1 -438
- package/dist/customer/info-puzzle.js +1 -681
- package/dist/customer/order-monitor.js +1 -328
- package/dist/customer/order-strategy.js +1 -373
- package/dist/customer/post-purchase.js +1 -351
- package/dist/customer/preorder-compare.js +1 -34
- package/dist/customer/reminder-system.js +1 -316
- package/dist/customer/risk-assessment.d.ts +5 -1
- package/dist/customer/risk-assessment.js +1 -397
- package/dist/customer/types.js +1 -13
- package/dist/customer/user-preferences.js +1 -460
- package/dist/evaluation/arbitration-game.d.ts +23 -0
- package/dist/evaluation/arbitration-game.js +1 -0
- package/dist/evaluation/builtins/demand-match.d.ts +15 -0
- package/dist/evaluation/builtins/demand-match.js +1 -0
- package/dist/evaluation/builtins/index.d.ts +3 -0
- package/dist/evaluation/builtins/index.js +1 -0
- package/dist/evaluation/builtins/service-risk.d.ts +6 -0
- package/dist/evaluation/builtins/service-risk.js +1 -0
- package/dist/evaluation/capability.d.ts +50 -0
- package/dist/evaluation/capability.js +1 -0
- package/dist/evaluation/composer.d.ts +13 -0
- package/dist/evaluation/composer.js +1 -0
- package/dist/evaluation/engine.d.ts +18 -0
- package/dist/evaluation/engine.js +1 -0
- package/dist/evaluation/extract.d.ts +30 -0
- package/dist/evaluation/extract.js +1 -0
- package/dist/evaluation/game-strategy.d.ts +27 -0
- package/dist/evaluation/game-strategy.js +1 -0
- package/dist/evaluation/gap.d.ts +2 -0
- package/dist/evaluation/gap.js +1 -0
- package/dist/evaluation/index.d.ts +12 -0
- package/dist/evaluation/index.js +1 -0
- package/dist/evaluation/node-game.d.ts +62 -0
- package/dist/evaluation/node-game.js +1 -0
- package/dist/evaluation/region.d.ts +10 -0
- package/dist/evaluation/region.js +1 -0
- package/dist/evaluation/types.d.ts +77 -0
- package/dist/evaluation/types.js +1 -0
- package/dist/evaluation/user-injection.d.ts +6 -0
- package/dist/evaluation/user-injection.js +1 -0
- package/dist/examples/education-contact-create.json +40 -0
- package/dist/examples/freelance-contact-create.json +40 -0
- package/dist/examples/insurance-machine-create.json +1 -1
- package/dist/examples/insurance-service-allocators.json +1 -1
- package/dist/examples/machine-publish.json +1 -1
- package/dist/examples/rental-ziroom-service-create.json +1 -1
- package/dist/examples/retail-adv-guard-messenger-proof-create.json +1 -1
- package/dist/examples/retail-myshop-service-create.json +1 -1
- package/dist/examples/retail-myshop-service-customer-required.json +1 -1
- package/dist/examples/subscription-contact-create.json +40 -0
- package/dist/examples/threebody-machine-create.json +1 -1
- package/dist/examples/travel-machine-create.json +1 -1
- package/dist/examples/travel-service-create.json +1 -1
- package/dist/experience/experience-reuse.js +1 -103
- package/dist/experience/index.js +1 -5
- package/dist/experience/intent-distill.js +1 -83
- package/dist/experience/realtime-feedback.js +1 -94
- package/dist/experience/types.js +1 -1
- package/dist/experience/user-profile.js +1 -171
- package/dist/extensions/business-modules.js +1 -287
- package/dist/extensions/capability-manifest.js +1 -781
- package/dist/extensions/constraint-registry.js +1 -198
- package/dist/extensions/index.js +1 -6
- package/dist/extensions/metric-registry.js +1 -257
- package/dist/extensions/mode-evaluator.js +1 -170
- package/dist/extensions/modes.js +1 -499
- package/dist/extensions/registry.js +1 -717
- package/dist/extensions/types.js +1 -1
- package/dist/harness/auto-escalation.js +1 -68
- package/dist/harness/checkpoint.js +1 -129
- package/dist/harness/index.js +1 -78
- package/dist/harness/plan.js +1 -276
- package/dist/harness/recover.js +1 -139
- package/dist/harness/types.js +1 -1
- package/dist/harness/verify.js +1 -237
- package/dist/index.js +1 -273
- package/dist/intent/enrich.d.ts +1 -0
- package/dist/intent/enrich.js +1 -0
- package/dist/intent/index.d.ts +23 -0
- package/dist/intent/index.js +1 -0
- package/dist/intent/matcher.d.ts +2 -0
- package/dist/intent/matcher.js +1 -0
- package/dist/intent/store.d.ts +19 -0
- package/dist/intent/store.js +1 -0
- package/dist/intent/types.d.ts +33 -0
- package/dist/intent/types.js +1 -0
- package/dist/knowledge/acquisition-flywheel.js +1 -192
- package/dist/knowledge/allocation-confirm.js +1 -534
- package/dist/knowledge/allocation-context.js +1 -249
- package/dist/knowledge/allocation-ledger.js +1 -463
- package/dist/knowledge/allocation-puzzle.js +1 -298
- package/dist/knowledge/allocation-risk.js +1 -568
- package/dist/knowledge/allocation-templates.js +1 -970
- package/dist/knowledge/allocation-translation.js +1 -585
- package/dist/knowledge/arb-risk.js +1 -210
- package/dist/knowledge/arbitration-confirm.js +1 -559
- package/dist/knowledge/arbitration-context.js +1 -505
- package/dist/knowledge/arbitration-ledger.js +1 -521
- package/dist/knowledge/arbitration-puzzle.js +1 -304
- package/dist/knowledge/arbitration-risk.js +1 -433
- package/dist/knowledge/arbitration-templates.js +1 -276
- package/dist/knowledge/arbitration-translation.js +1 -487
- package/dist/knowledge/arbitration-trust.js +1 -117
- package/dist/knowledge/audit-rules.js +1 -141
- package/dist/knowledge/bridge-risk.js +1 -263
- package/dist/knowledge/contact-risk.js +1 -200
- package/dist/knowledge/contact-templates.d.ts +27 -0
- package/dist/knowledge/contact-templates.js +1 -0
- package/dist/knowledge/demand-confirm.js +1 -206
- package/dist/knowledge/demand-matching.js +1 -132
- package/dist/knowledge/demand-risk.js +1 -240
- package/dist/knowledge/demand-translation.js +1 -354
- package/dist/knowledge/deployment-scanner.js +1 -823
- package/dist/knowledge/dynamic-pricing.js +1 -87
- package/dist/knowledge/examples-scanner-cli.js +1 -26
- package/dist/knowledge/examples-scanner.js +1 -825
- package/dist/knowledge/flywheel-loop.js +1 -404
- package/dist/knowledge/fund-layer.js +1 -973
- package/dist/knowledge/glossary.js +1 -211
- package/dist/knowledge/guard-confirm.js +1 -406
- package/dist/knowledge/guard-context.js +1 -287
- package/dist/knowledge/guard-design-patterns.js +1 -360
- package/dist/knowledge/guard-ledger.js +1 -260
- package/dist/knowledge/guard-lint.js +1 -670
- package/dist/knowledge/guard-migration.js +1 -228
- package/dist/knowledge/guard-puzzle.js +1 -805
- package/dist/knowledge/guard-render.js +1 -700
- package/dist/knowledge/guard-risk.js +1 -1879
- package/dist/knowledge/guard-submission-prompt.js +1 -171
- package/dist/knowledge/guard-templates.js +1 -1105
- package/dist/knowledge/guard-translation.js +1 -1119
- package/dist/knowledge/index.js +1 -436
- package/dist/knowledge/industry-evolution.js +1 -323
- package/dist/knowledge/industry-generalizer.js +1 -381
- package/dist/knowledge/industry-registry.js +1 -174
- package/dist/knowledge/intent-metrics.d.ts +4 -3
- package/dist/knowledge/intent-metrics.js +1 -566
- package/dist/knowledge/machine-confirm.js +1 -559
- package/dist/knowledge/machine-context.js +1 -833
- package/dist/knowledge/machine-ledger.js +1 -338
- package/dist/knowledge/machine-puzzle.js +1 -494
- package/dist/knowledge/machine-render.js +1 -565
- package/dist/knowledge/machine-risk.js +1 -670
- package/dist/knowledge/machine-templates.js +1 -1597
- package/dist/knowledge/machine-topology.js +1 -234
- package/dist/knowledge/machine-translation.js +1 -513
- package/dist/knowledge/mcp-schema-audit-cli.js +1 -45
- package/dist/knowledge/mcp-schema-audit.d.ts +1 -1
- package/dist/knowledge/mcp-schema-audit.js +1 -773
- package/dist/knowledge/onchain-constants.js +1 -35
- package/dist/knowledge/order-confirm.js +1 -573
- package/dist/knowledge/order-context.js +1 -390
- package/dist/knowledge/order-ledger.js +1 -341
- package/dist/knowledge/order-puzzle.js +1 -255
- package/dist/knowledge/order-risk.js +1 -653
- package/dist/knowledge/order-templates.js +1 -368
- package/dist/knowledge/order-translation.js +1 -550
- package/dist/knowledge/overrides-loader.js +1 -65
- package/dist/knowledge/passport-confirm.js +1 -531
- package/dist/knowledge/passport-context.js +1 -306
- package/dist/knowledge/passport-ledger.js +1 -282
- package/dist/knowledge/passport-puzzle.js +1 -333
- package/dist/knowledge/passport-risk.js +1 -450
- package/dist/knowledge/passport-templates.js +1 -568
- package/dist/knowledge/passport-translation.js +1 -516
- package/dist/knowledge/payment-risk.js +1 -249
- package/dist/knowledge/permission-confirm.js +1 -426
- package/dist/knowledge/permission-context.js +1 -224
- package/dist/knowledge/permission-ledger.js +1 -403
- package/dist/knowledge/permission-puzzle.js +1 -173
- package/dist/knowledge/permission-risk.js +1 -411
- package/dist/knowledge/permission-templates.js +1 -234
- package/dist/knowledge/permission-translation.js +1 -350
- package/dist/knowledge/personal-risk.js +1 -212
- package/dist/knowledge/process-model.js +1 -160
- package/dist/knowledge/progress-confirm.js +1 -456
- package/dist/knowledge/progress-context.js +1 -452
- package/dist/knowledge/progress-ledger.js +1 -330
- package/dist/knowledge/progress-puzzle.js +1 -219
- package/dist/knowledge/progress-risk.js +1 -461
- package/dist/knowledge/progress-templates.js +1 -228
- package/dist/knowledge/progress-translation.js +1 -405
- package/dist/knowledge/proof-confirm.js +1 -187
- package/dist/knowledge/proof-risk.js +1 -207
- package/dist/knowledge/proof-translation.js +1 -283
- package/dist/knowledge/registrar-risk.js +1 -217
- package/dist/knowledge/repository-confirm.js +1 -286
- package/dist/knowledge/repository-risk.js +1 -373
- package/dist/knowledge/repository-translation.js +1 -445
- package/dist/knowledge/reputation-rules.js +1 -99
- package/dist/knowledge/resource-risk.js +1 -157
- package/dist/knowledge/reward-confirm.js +1 -526
- package/dist/knowledge/reward-context.js +1 -504
- package/dist/knowledge/reward-ledger.js +1 -502
- package/dist/knowledge/reward-puzzle.js +1 -300
- package/dist/knowledge/reward-risk.js +1 -627
- package/dist/knowledge/reward-templates.js +1 -197
- package/dist/knowledge/reward-translation.js +1 -501
- package/dist/knowledge/safety-rules.js +1 -404
- package/dist/knowledge/scenario-modes.js +1 -321
- package/dist/knowledge/service-confirm.js +1 -807
- package/dist/knowledge/service-context.js +1 -403
- package/dist/knowledge/service-ledger.js +1 -609
- package/dist/knowledge/service-puzzle.js +1 -236
- package/dist/knowledge/service-risk.js +1 -615
- package/dist/knowledge/service-templates.js +1 -456
- package/dist/knowledge/service-translation.js +1 -622
- package/dist/knowledge/template-registry.d.ts +1 -1
- package/dist/knowledge/template-registry.js +1 -341
- package/dist/knowledge/tool-constraints.js +1 -195
- package/dist/knowledge/tools-reference.js +1 -155
- package/dist/knowledge/treasury-confirm.js +1 -512
- package/dist/knowledge/treasury-context.js +1 -363
- package/dist/knowledge/treasury-ledger.js +1 -300
- package/dist/knowledge/treasury-puzzle.js +1 -216
- package/dist/knowledge/treasury-risk.js +1 -440
- package/dist/knowledge/treasury-templates.js +1 -358
- package/dist/knowledge/treasury-translation.js +1 -498
- package/dist/knowledge/trust-metrics.js +1 -198
- package/dist/knowledge/util-risk.js +1 -135
- package/dist/loop-engineering/aggregate.js +1 -132
- package/dist/loop-engineering/context-collect.js +1 -83
- package/dist/loop-engineering/diagnose.js +1 -273
- package/dist/loop-engineering/improve.js +1 -405
- package/dist/loop-engineering/index.js +1 -4
- package/dist/loop-engineering/pipeline.js +1 -56
- package/dist/mode-market/index.js +1 -3
- package/dist/mode-market/registry.js +1 -124
- package/dist/mode-market/review.js +1 -214
- package/dist/mode-market/submission.js +1 -85
- package/dist/participation/collaborator-interest.d.ts +23 -0
- package/dist/participation/collaborator-interest.js +1 -0
- package/dist/participation/customer-interest.d.ts +25 -0
- package/dist/participation/customer-interest.js +1 -0
- package/dist/participation/merchant-interest.js +1 -100
- package/dist/participation/radar-core.d.ts +13 -3
- package/dist/participation/radar-core.js +1 -269
- package/dist/participation/supplier-interest.d.ts +25 -0
- package/dist/participation/supplier-interest.js +1 -0
- package/dist/persona/analyzer.d.ts +16 -0
- package/dist/persona/analyzer.js +1 -0
- package/dist/persona/bridge.d.ts +5 -0
- package/dist/persona/bridge.js +1 -0
- package/dist/persona/defaults.d.ts +4 -0
- package/dist/persona/defaults.js +1 -0
- package/dist/persona/experience-bridge.d.ts +3 -0
- package/dist/persona/experience-bridge.js +1 -0
- package/dist/persona/index.d.ts +18 -0
- package/dist/persona/index.js +1 -0
- package/dist/persona/model.d.ts +7 -0
- package/dist/persona/model.js +1 -0
- package/dist/persona/store.d.ts +19 -0
- package/dist/persona/store.js +1 -0
- package/dist/persona/types.d.ts +45 -0
- package/dist/persona/types.js +1 -0
- package/dist/project/business-puzzle.js +1 -383
- package/dist/project/context-assembly.js +1 -254
- package/dist/project/deployment-bridge.js +1 -120
- package/dist/project/deployment-doc.js +1 -1126
- package/dist/project/edit-planner.js +1 -1342
- package/dist/project/evaluation.js +1 -2011
- package/dist/project/game-theory.js +1 -177
- package/dist/project/graph-builder.js +1 -656
- package/dist/project/graph.js +1 -340
- package/dist/project/handlers.d.ts +5 -0
- package/dist/project/handlers.js +1 -1762
- package/dist/project/index.d.ts +1 -0
- package/dist/project/index.js +1 -301
- package/dist/project/intent-analyzer.js +1 -149
- package/dist/project/machine-nodes.js +1 -36
- package/dist/project/merchant-guide.js +1 -264
- package/dist/project/migration.js +1 -125
- package/dist/project/mode-actions.js +1 -309
- package/dist/project/namespace.js +1 -206
- package/dist/project/participation-radar.js +1 -428
- package/dist/project/pipeline-actions.js +1 -109
- package/dist/project/project-store.js +1 -422
- package/dist/project/query.js +1 -153
- package/dist/project/reverse-mapping.d.ts +34 -0
- package/dist/project/reverse-mapping.js +1 -0
- package/dist/project/risk-aggregator.js +1 -295
- package/dist/project/rollback-policy.js +1 -290
- package/dist/project/semantic-assembler.js +1 -345
- package/dist/project/semantic-graph.js +1 -245
- package/dist/project/stage-gate.js +1 -369
- package/dist/project/substep-trace.js +1 -332
- package/dist/project/task-tracker.js +1 -78
- package/dist/role/derivation.d.ts +18 -0
- package/dist/role/derivation.js +1 -0
- package/dist/role/index.d.ts +5 -0
- package/dist/role/index.js +1 -0
- package/dist/role/model.d.ts +8 -0
- package/dist/role/model.js +1 -0
- package/dist/role/resolution.d.ts +11 -0
- package/dist/role/resolution.js +1 -0
- package/dist/role/types.d.ts +11 -0
- package/dist/role/types.js +1 -0
- package/dist/rules.d.ts +2 -0
- package/dist/rules.js +1 -9
- package/dist/safety/confirm-gate.js +1 -88
- package/dist/safety/index.js +1 -3
- package/dist/safety/preview.js +1 -52
- package/dist/schema/call/allocation.js +1 -34
- package/dist/schema/call/arbitration.js +1 -113
- package/dist/schema/call/base.d.ts +15 -15
- package/dist/schema/call/base.js +1 -370
- package/dist/schema/call/bridge-handler.js +1 -265
- package/dist/schema/call/bridge.d.ts +7 -7
- package/dist/schema/call/bridge.js +1 -458
- package/dist/schema/call/contact.js +1 -37
- package/dist/schema/call/demand.js +1 -47
- package/dist/schema/call/guard.js +1 -161
- package/dist/schema/call/handler.js +1 -322
- package/dist/schema/call/index.js +1 -20
- package/dist/schema/call/machine.js +1 -193
- package/dist/schema/call/order.js +1 -35
- package/dist/schema/call/payment.js +1 -37
- package/dist/schema/call/permission-handler.js +1 -54
- package/dist/schema/call/permission.js +1 -105
- package/dist/schema/call/personal.js +1 -78
- package/dist/schema/call/progress.js +1 -47
- package/dist/schema/call/proof.js +1 -33
- package/dist/schema/call/repository.js +1 -77
- package/dist/schema/call/reward.js +1 -30
- package/dist/schema/call/semantic.js +1 -1657
- package/dist/schema/call/service.js +1 -178
- package/dist/schema/call/treasury.js +1 -71
- package/dist/schema/common/index.js +1 -407
- package/dist/schema/config/index.js +1 -68
- package/dist/schema/evaluation/index.d.ts +4436 -0
- package/dist/schema/evaluation/index.js +1 -0
- package/dist/schema/index.d.ts +4 -0
- package/dist/schema/index.js +1 -13
- package/dist/schema/intent-radar/index.d.ts +284 -0
- package/dist/schema/intent-radar/index.js +1 -0
- package/dist/schema/local/index.d.ts +21 -21
- package/dist/schema/local/index.js +1 -927
- package/dist/schema/local/wip.js +1 -187
- package/dist/schema/messenger/index.d.ts +7 -7
- package/dist/schema/messenger/index.js +1 -475
- package/dist/schema/operations.d.ts +7 -7
- package/dist/schema/operations.js +1 -520
- package/dist/schema/persona/index.d.ts +1985 -0
- package/dist/schema/persona/index.js +1 -0
- package/dist/schema/project/index.d.ts +96 -50
- package/dist/schema/project/index.js +1 -2057
- package/dist/schema/query/index.d.ts +423 -7
- package/dist/schema/query/index.js +1 -1640
- package/dist/schema/schema-query/index.js +1 -104
- package/dist/schema/schema-version.js +1 -76
- package/dist/schema/sync-layer4.d.ts +1 -1
- package/dist/schema/sync-layer4.js +1 -282
- package/dist/schema/task-status.d.ts +168 -0
- package/dist/schema/task-status.js +1 -0
- package/dist/schema/trust/index.js +1 -314
- package/dist/schema/utils/guard-parser.js +1 -419
- package/dist/schema/utils/guard-query-utils.js +1 -46
- package/dist/schema/utils/node-parser.js +1 -369
- package/dist/schema/utils/object-type-utils.js +1 -35
- package/dist/schema/utils/permission-index-utils.js +1 -7
- package/dist/schema/utils/permission-machine-check.js +1 -121
- package/dist/schema/utils/skills-recommendation.js +1 -77
- package/dist/schema-query/index.js +1 -810
- package/dist/schemas/account_operation.output.json +5 -2
- package/dist/schemas/bridge_operation.output.json +5 -2
- package/dist/schemas/evaluation_operation.output.json +782 -0
- package/dist/schemas/evaluation_operation.schema.json +990 -0
- package/dist/schemas/index.json +25 -1
- package/dist/schemas/intent_radar.output.json +232 -0
- package/dist/schemas/intent_radar.schema.json +138 -0
- package/dist/schemas/local_info_operation.output.json +5 -2
- package/dist/schemas/local_mark_operation.output.json +5 -2
- package/dist/schemas/messenger_operation.output.json +5 -2
- package/dist/schemas/onchain_events.output.json +5 -2
- package/dist/schemas/onchain_operations.output.json +5 -2
- package/dist/schemas/onchain_operations.schema.json +6 -6
- package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
- package/dist/schemas/onchain_operations_machine.schema.json +2 -2
- package/dist/schemas/onchain_operations_service.schema.json +3 -3
- package/dist/schemas/onchain_table_data.output.json +6 -3
- package/dist/schemas/persona_operation.output.json +392 -0
- package/dist/schemas/persona_operation.schema.json +250 -0
- package/dist/schemas/project_operation.output.json +28 -8
- package/dist/schemas/query_task_status.output.json +115 -0
- package/dist/schemas/query_task_status.schema.json +24 -0
- package/dist/schemas/query_toolkit.output.json +9 -6
- package/dist/schemas/trust_score.schema.json +1 -1
- package/dist/schemas/wowok_buildin_info.output.json +132 -0
- package/dist/schemas/wowok_buildin_info.schema.json +14 -0
- package/dist/telemetry/index.js +1 -112
- package/dist/telemetry/redact.js +1 -23
- package/dist/telemetry/storage.js +1 -80
- package/dist/tools/handlers/bridge.js +1 -1
- package/dist/tools/handlers/config.js +1 -74
- package/dist/tools/handlers/evaluation.d.ts +2 -0
- package/dist/tools/handlers/evaluation.js +1 -0
- package/dist/tools/handlers/file-export.js +1 -90
- package/dist/tools/handlers/intent-radar.d.ts +2 -0
- package/dist/tools/handlers/intent-radar.js +1 -0
- package/dist/tools/handlers/local.js +1 -53
- package/dist/tools/handlers/messenger.js +1 -188
- package/dist/tools/handlers/onchain.js +1 -1082
- package/dist/tools/handlers/persona.d.ts +4 -0
- package/dist/tools/handlers/persona.js +1 -0
- package/dist/tools/handlers/project.js +1 -211
- package/dist/tools/handlers/query.js +1 -434
- package/dist/tools/handlers/schema-query.js +1 -176
- package/dist/tools/handlers/task-status.d.ts +0 -168
- package/dist/tools/handlers/task-status.js +1 -55
- package/dist/tools/handlers/trust.js +1 -380
- package/dist/tools/handlers/wip.js +1 -90
- package/dist/tools/index.js +1 -1306
- package/dist/tools/retry.js +1 -85
- package/dist/tools/rules-hook.js +1 -23
- package/dist/tools/shared.js +1 -130
- package/dist/tools/types.js +1 -1
- package/dist/tools/upgrade-check.d.ts +19 -0
- package/dist/tools/upgrade-check.js +1 -0
- package/dist/tools/wip-deploy-assist.d.ts +1 -1
- package/dist/tools/wip-deploy-assist.js +1 -278
- package/dist/tools/wrap.js +1 -500
- package/package.json +5 -3
|
@@ -1,178 +1 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { TypedPermissionObjectSchema, CoinParamSchema, NamedObjectSchema, ObjectsSchema, CallEnvSchema, SubmissionCallSchema } from "./base.js";
|
|
3
|
-
import { AllocatorsSchema, DiscountTypeSchema, ServiceSaleSchema, PaymentInfoSchema } from "../query/index.js";
|
|
4
|
-
import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, ManyAccountOrMark_AddressSchema, NameOrAddressSchema, NotEmptyNameSchema, ReceivedBalanceOrRecentlySchema, ReceivedObjectsOrRecentlySchema, RECEIVE_FORMAT_BLOCK_OBJECTS, RECEIVE_FORMAT_BLOCK_BALANCE } from "../common/index.js";
|
|
5
|
-
import { BalanceTypeSchema } from "../common/index.js";
|
|
6
|
-
export const ServiceBuyItemSchema = z.object({
|
|
7
|
-
name: LongNameSchema.describe("Name of the product or service to purchase"),
|
|
8
|
-
stock: BalanceTypeSchema.describe("Quantity of the product or service to purchase"),
|
|
9
|
-
wip_hash: z.string().describe(`WIP file hash of the item. EMPTY string "" means only verify the WIP file integrity without comparing to a specific hash (the hash within the wip file will be used). For purchases, it is STRONGLY RECOMMENDED to fill in the hash you saw when viewing the product info (from the Service sale's wip_hash field) to prevent the merchant from replacing the WIP file before your order is placed (a legitimate update operation), which would cause inconsistency between what you saw and what you received.`),
|
|
10
|
-
}).strict();
|
|
11
|
-
export const BuySchema = z.object({
|
|
12
|
-
items: z.array(ServiceBuyItemSchema).describe("List of products or services to purchase"),
|
|
13
|
-
total_pay: CoinParamSchema.describe("Actual payment amount. FORMAT: {balance: <amount_in_smallest_unit>} or {coin: <coin_object_id>}. " +
|
|
14
|
-
"The token type and precision are determined by the Service object's type_parameter (the generic type set when the Service was created). " +
|
|
15
|
-
"For WOW (9 decimals): {balance: 1000000000} = 1 WOW. For SUI (9 decimals): {balance: 1000000000} = 1 SUI."),
|
|
16
|
-
discount: z.string().optional().describe("Discount object ID or name"),
|
|
17
|
-
payment_remark: z.string().optional().describe("Payment remark"),
|
|
18
|
-
payment_index: z.number().optional().describe("Payment index"),
|
|
19
|
-
}).strict();
|
|
20
|
-
export const DiscountSchema = z.object({
|
|
21
|
-
name: z.string().describe("Discount name"),
|
|
22
|
-
discount_type: DiscountTypeSchema.describe("Discount type"),
|
|
23
|
-
discount_value: BalanceTypeSchema.describe("Discount value"),
|
|
24
|
-
benchmark: z.union([z.number(), z.string()]).optional().describe("Discount benchmark value. Discount is only applied if the amount exceeds this value"),
|
|
25
|
-
time_ms_start: z.number().optional().describe("Discount start time (milliseconds)"),
|
|
26
|
-
time_ms_end: z.number().describe("Discount end time (milliseconds)"),
|
|
27
|
-
count: z.number().describe("Discount usage count"),
|
|
28
|
-
recipient: ManyAccountOrMark_AddressSchema.describe("Discount recipient"),
|
|
29
|
-
transferable: z.boolean().describe("Whether the discount object recipient can transfer the discount object"),
|
|
30
|
-
}).strict();
|
|
31
|
-
export const OrderNewSchema = z.object({
|
|
32
|
-
buy: BuySchema,
|
|
33
|
-
agents: ManyAccountOrMark_AddressSchema.optional().describe("Order agents. Agents can operate the order, such as canceling the order, modifying the order status, etc.; but cannot receive the funds received by the order."),
|
|
34
|
-
order_required_info: z.string().optional().describe("Contact object ID or WTS Proof object, recorded on the Order as proof that the order holder " +
|
|
35
|
-
"delivered the required private information (service.customer_required) to the merchant. " +
|
|
36
|
-
"FLOW: when a Service declares customer_required (e.g. phone/email/shipping_address), the order holder " +
|
|
37
|
-
"MUST send that private information to the Service's Contact (um) via end-to-end encrypted Messenger, " +
|
|
38
|
-
"then pass the Contact object ID or the generated WTS Proof here so the delivery is verifiable on-chain."),
|
|
39
|
-
transfer: AccountOrMark_AddressSchema.optional().describe("Set the new owner of the order. Requires order owner permission to set."),
|
|
40
|
-
namedNewOrder: NamedObjectSchema.optional().describe("RECOMMENDED: Set a local name for the newly created Order object. " +
|
|
41
|
-
"Without this, the Order is only referenceable by its on-chain address. " +
|
|
42
|
-
"Example: {name: 'my_order_v1'} allows subsequent operations to use 'my_order_v1' instead of the address."),
|
|
43
|
-
namedNewAllocation: NamedObjectSchema.optional().describe("RECOMMENDED: Set a local name for the order's Allocation object. " +
|
|
44
|
-
"Without this, the Allocation is only referenceable by its address. " +
|
|
45
|
-
"Example: {name: 'my_allocation_v1'} allows alloc_by_guard to reference 'my_allocation_v1'."),
|
|
46
|
-
namedNewProgress: NamedObjectSchema.optional().describe("RECOMMENDED: Set a local name for the order's Progress object. " +
|
|
47
|
-
"Without this, the Progress is only referenceable by its address. " +
|
|
48
|
-
"Example: {name: 'my_progress_v1'} allows progress operations to use 'my_progress_v1'."),
|
|
49
|
-
}).strict();
|
|
50
|
-
export const SalesSchema = z.discriminatedUnion("op", [
|
|
51
|
-
z.object({
|
|
52
|
-
op: z.literal("add"),
|
|
53
|
-
sales: z.array(ServiceSaleSchema),
|
|
54
|
-
}).strict().describe("Add new sales products or services."),
|
|
55
|
-
z.object({
|
|
56
|
-
op: z.literal("set"),
|
|
57
|
-
sales: z.array(ServiceSaleSchema),
|
|
58
|
-
}).strict().describe("Set sales products or services."),
|
|
59
|
-
z.object({
|
|
60
|
-
op: z.literal("remove"),
|
|
61
|
-
sales_name: z.array(LongNameSchema.describe("Sales name")),
|
|
62
|
-
}).strict().describe("Remove existing sales products or services."),
|
|
63
|
-
z.object({
|
|
64
|
-
op: z.literal("clear"),
|
|
65
|
-
}).strict().describe("Clear all sales products or services."),
|
|
66
|
-
]);
|
|
67
|
-
export const CallService_DataSchema = z.object({
|
|
68
|
-
object: TypedPermissionObjectSchema,
|
|
69
|
-
order_new: OrderNewSchema.optional().describe("Create new order."),
|
|
70
|
-
description: DescriptionSchema.optional(),
|
|
71
|
-
location: LongNameSchema.optional().describe("Location of the Service"),
|
|
72
|
-
sales: SalesSchema.optional().describe("Service sales products or services list."),
|
|
73
|
-
repositories: ObjectsSchema.optional().describe("Service Repository object list."),
|
|
74
|
-
rewards: ObjectsSchema.optional().describe("Service Reward object list. " +
|
|
75
|
-
"May share the Service's Permission (no conflict check — intentional: rewards are the provider's own " +
|
|
76
|
-
"incentive tool; only Arbitration requires a different Permission for neutrality)."),
|
|
77
|
-
arbitrations: ObjectsSchema.optional().describe("Service Arbitration object list. " +
|
|
78
|
-
"FORMAT: same as repositories — use the `objects` field name inside the operation data. " +
|
|
79
|
-
"Example: {arbitrations: [{name: 'my_arb_1'}, {name: 'my_arb_2'}]}. " +
|
|
80
|
-
"Each item is a NameOrAddress (object ID or local mark name). " +
|
|
81
|
-
"⚠️ PERMISSION RULE (contract-enforced, service.move arbitration_add_imp): every Arbitration bound here " +
|
|
82
|
-
"MUST use a Permission object DIFFERENT from THIS Service's permission — binding an Arbitration that shares " +
|
|
83
|
-
"the Service's Permission aborts with E_ARBITRATION_PERMISSION_CONFLICT (error 33). " +
|
|
84
|
-
"Create a dedicated Permission for each Arbitration BEFORE binding. " +
|
|
85
|
-
"DESIGN RATIONALE (confirmed intentional): dispute resolution requires NEUTRALITY — an Arbitration controlled " +
|
|
86
|
-
"by the same Permission admins as the Service it judges would be a conflict of interest. ONLY Arbitration has " +
|
|
87
|
-
"this check: Reward and Treasury objects MAY share the Service's Permission (they are the provider's own tools)."),
|
|
88
|
-
machine: z.union([NameOrAddressSchema, z.null()]).optional().describe("Service Machine object ID or name. The Machine object must be in published state."),
|
|
89
|
-
discount: DiscountSchema.optional().describe("Issue discount."),
|
|
90
|
-
discount_destroy: z.array(NameOrAddressSchema).optional().describe("Destroy existing discount object ID list."),
|
|
91
|
-
customer_required: z.array(NotEmptyNameSchema).optional().describe("Customer required information labels. Such as phone, email, shipping_address, etc. " +
|
|
92
|
-
"⚠️ HARD LINKAGE (SDK-enforced): if customer_required is set (non-empty), the Service MUST also bind a " +
|
|
93
|
-
"Contact via `um` — otherwise the customer's private information cannot be delivered through end-to-end " +
|
|
94
|
-
"encrypted Messenger (which routes to the Contact bound as um). Set `um` together with customer_required."),
|
|
95
|
-
order_allocators: z.union([AllocatorsSchema, z.null()]).optional().describe("Order fund allocator. Max 100 allocators (MAX_ALLOCATOR_COUNT). " +
|
|
96
|
-
"Each allocator has a guard (first matching guard wins) and a sharing list. " +
|
|
97
|
-
"Set to null to clear. " +
|
|
98
|
-
"⚠️ PERMANENTLY IMMUTABLE after publish: order_allocators can ONLY be set BEFORE publish=true " +
|
|
99
|
-
"(Move service.move:503: assert!(!self.bPublished, E_ALREADY_PUBLISHED)). " +
|
|
100
|
-
"After publish, the ONLY way to change allocation rules is to create a NEW Service object. " +
|
|
101
|
-
"There is NO pause+lock exception for order_allocators (unlike arbitrations/rewards which have time-lock removal). " +
|
|
102
|
-
"PRE-PUBLISH CHECKLIST: verify all guard names resolve, all sharing amounts are correct, " +
|
|
103
|
-
"threshold is set, and recipient types (Entity/Signer/GuardIdentifier) are intended before calling publish=true. " +
|
|
104
|
-
"GuardIdentifier sharing mode: {who: {GuardIdentifier: <u8>}, sharing: <rate>, mode: 'Rate'} — " +
|
|
105
|
-
"resolves recipient from Guard table submission at allocation time (e.g., refund to customer). " +
|
|
106
|
-
"MULTI-CALL ALLOCATION: Allocation.alloc() can be called MULTIPLE times (no consumed flag in contract). " +
|
|
107
|
-
"Use Amount mode (not Surplus) for recurring allocations — Surplus calls balance::withdraw_all which drains the balance. " +
|
|
108
|
-
"For monthly payment scenarios, create multiple Allocators with time-based Guards + Amount mode sharing items."),
|
|
109
|
-
buy_guard: z.union([NameOrAddressSchema, z.null()]).optional().describe("Buy guard object ID or name."),
|
|
110
|
-
compensation_fund_add: CoinParamSchema.optional().describe("Deposit funds into the Service compensation_fund. Used to pay indemnity when arbitration resolves in customer's favor. " +
|
|
111
|
-
"FORMAT: {balance: <amount_in_smallest_unit>} — the field name is 'balance' (NOT 'amount'). " +
|
|
112
|
-
"The token type and precision are determined by the Service object's type_parameter (the generic type set when the Service was created). " +
|
|
113
|
-
"For WOW (9 decimals): {balance: 1000000000} = 1 WOW. For SUI (9 decimals): {balance: 1000000000} = 1 SUI. " +
|
|
114
|
-
"For tokens with different decimals, adjust accordingly (e.g. USDC has 6 decimals, so {balance: 1000000} = 1 USDC). " +
|
|
115
|
-
"REQUIRES: Permission index 315 (SERVICE_COMPENSATION_FUND_DEPOSIT) must be granted to the calling account first. " +
|
|
116
|
-
"COMMON MISTAKE: using {amount: ...} or {amount: ..., type: 'WOW'} — these will fail. The correct field is 'balance'."),
|
|
117
|
-
compensation_fund_withdraw: z.object({
|
|
118
|
-
receipt: AccountOrMark_AddressSchema.describe("Receipt address that will receive the withdrawn funds (as a new Payment object)"),
|
|
119
|
-
payment_info: PaymentInfoSchema.describe("Payment info for the new Payment object created to hold the withdrawn funds"),
|
|
120
|
-
}).strict().optional().describe("Withdraw ALL funds from the compensation_fund to a new Payment object owned by `receipt`. " +
|
|
121
|
-
"Move layer: service::compensation_fund_withdraw (service.move L383-390). " +
|
|
122
|
-
"REQUIRES: Service must be paused AND setting_lock_duration must have elapsed since pause (assert_not_published at L384-385). " +
|
|
123
|
-
"Withdraws the ENTIRE compensation_fund balance via balance::withdraw_all. " +
|
|
124
|
-
"DIFFERENT from compensation_claim (order-side, for arbitration-winning users, no pause+lock required)."),
|
|
125
|
-
setting_lock_duration_add: z.number().optional().describe("Additional lock duration to ADD to 'setting_lock_duration' (Move field name). " +
|
|
126
|
-
"UNIT: milliseconds (ms). Example: 2592000000 = 30 days, 7776000000 = 90 days, 86400000 = 1 day. " +
|
|
127
|
-
"DEFAULT: 2592000000 (30 days, DEFAULT_LOCK_DURATION). This is the initial value when a Service is created. " +
|
|
128
|
-
"Behavior: additive (safe_add) — only increases, never decreases. " +
|
|
129
|
-
"Move entry: service::setting_lock_duration_add / setting_lock_duration_add_with_passport. " +
|
|
130
|
-
"Can be called BEFORE or AFTER publish (no publish check). " +
|
|
131
|
-
"Affects the waiting time required by: compensation_fund_withdraw, arbitrations remove/clear, rewards remove/clear " +
|
|
132
|
-
"(all require pause + setting_lock_duration elapsed since pause)."),
|
|
133
|
-
compensation_fund_receive: ReceivedBalanceOrRecentlySchema.optional().describe("Receive order compensation funds from this Service object." + RECEIVE_FORMAT_BLOCK_BALANCE),
|
|
134
|
-
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects and other objects received by this Service object and send them to the owner of its Permission object." + RECEIVE_FORMAT_BLOCK_OBJECTS),
|
|
135
|
-
um: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object ID or name — the Service's customer-service channel. " +
|
|
136
|
-
"This is the object that Messenger routes encrypted messages to for pre-order negotiation, " +
|
|
137
|
-
"private-info delivery (see customer_required), and post-sale support. " +
|
|
138
|
-
"⚠️ REQUIRED whenever customer_required is set: without um, the customer's private information " +
|
|
139
|
-
"has no channel to reach the merchant."),
|
|
140
|
-
pause: z.boolean().optional().describe("Whether to pause accepting new orders."),
|
|
141
|
-
publish: z.boolean().optional().describe("Whether to publish the Service. After publishing, customers can place orders. " +
|
|
142
|
-
"VERIFIED against Move source service.move + SDK service.ts (4-level immutability matrix):\n" +
|
|
143
|
-
" L1 — PERMANENTLY LOCKED after publish (assert!(!bPublished), no pause+lock exception):\n" +
|
|
144
|
-
" • machine (service.move L633/L653 — workflow template)\n" +
|
|
145
|
-
" • order_allocators (service.move L503 — fund distribution rules)\n" +
|
|
146
|
-
" L2 — TIME-LOCKED after publish (assert_not_published — requires pause + setting_lock_duration elapsed):\n" +
|
|
147
|
-
" • arbitrations remove/clear (service.move L433/L445 — dispute resolution objects)\n" +
|
|
148
|
-
" • rewards remove/clear (service.move L402/L414 — reward objects)\n" +
|
|
149
|
-
" • compensation_fund_withdraw (service.move L384-385 — withdraw ALL funds)\n" +
|
|
150
|
-
" L3 — REMAIN MUTABLE after publish (no SDK check, no Move check):\n" +
|
|
151
|
-
" • arbitrations add, rewards add (no assert — can add after publish)\n" +
|
|
152
|
-
" • buy_guard, sales, discount, description, location, pause, repositories,\n" +
|
|
153
|
-
" • compensation_fund_add, setting_lock_duration_add, customer_required, um (Contact)\n" +
|
|
154
|
-
"These 2 L1-LOCKED fields (machine/order_allocators) MUST be set BEFORE publish=true.\n" +
|
|
155
|
-
"arbitrations/rewards can be ADDED after publish but remove/clear requires pause+lock.\n" +
|
|
156
|
-
"\n" +
|
|
157
|
-
"⚠️ COMPENSATION_FUND + ARBITRATION LINKAGE (service.move:494-499):\n" +
|
|
158
|
-
" At publish time, if compensation_fund > 0, Arbitration MUST be bound:\n" +
|
|
159
|
-
" if (balance::value(&self.compensation_fund) > 0) {\n" +
|
|
160
|
-
" assert!(arbitration_count > 0, E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND);\n" +
|
|
161
|
-
" }\n" +
|
|
162
|
-
" The MCP handler enforces this as a HARD PRE-CHECK: if publish=true AND compensation_fund_add " +
|
|
163
|
-
" is set in the same call AND arbitrations is empty, the call is REJECTED before submission. " +
|
|
164
|
-
" If compensation_fund was deposited in a prior call, a SOFT WARNING is issued.\n" +
|
|
165
|
-
"\n" +
|
|
166
|
-
"SCHEMA-03 / P0-01 fix — DEPLOYMENT WORKFLOW (two-phase, avoids circular dependency):\n" +
|
|
167
|
-
" Phase 1 — CREATE (no publish): object={name:'my-service', type_parameter, permission} + machine + order_allocators + arbitrations.\n" +
|
|
168
|
-
" NOTE: buy_guard can use a LocalMark NAME (not address) to break the Guard→Service circular dependency.\n" +
|
|
169
|
-
" The name is resolved to an address at transaction build time.\n" +
|
|
170
|
-
" Phase 2 — PUBLISH: object='my-service' (string ref) + publish=true.\n" +
|
|
171
|
-
" All L1-LOCKED fields must be set in Phase 1; Phase 2 only flips the publish flag.\n" +
|
|
172
|
-
" Post-publish updates: buy_guard, sales, description, repositories (add), rewards (add), arbitrations (add), etc."),
|
|
173
|
-
}).strict().describe("On-chain Service operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, type_parameter, permission, ...} to create a Service. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with STRING format (object ID or name). The 'object' field is CRITICAL and REQUIRED in both cases. STRING for existing, OBJECT for new creation.");
|
|
174
|
-
export const CallService_InputSchema = z.object({
|
|
175
|
-
data: CallService_DataSchema,
|
|
176
|
-
env: CallEnvSchema.optional(),
|
|
177
|
-
submission: SubmissionCallSchema.optional(),
|
|
178
|
-
}).strict();
|
|
1
|
+
import{z}from'zod';import{TypedPermissionObjectSchema,CoinParamSchema,NamedObjectSchema,ObjectsSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{AllocatorsSchema,DiscountTypeSchema,ServiceSaleSchema,PaymentInfoSchema}from'../query/index.js';import{AccountOrMark_AddressSchema,DescriptionSchema,LongNameSchema,ManyAccountOrMark_AddressSchema,NameOrAddressSchema,NotEmptyNameSchema,ReceivedBalanceOrRecentlySchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS,RECEIVE_FORMAT_BLOCK_BALANCE}from'../common/index.js';import{BalanceTypeSchema}from'../common/index.js';export const ServiceBuyItemSchema=z['object']({'name':LongNameSchema['describe']('Name\x20of\x20the\x20product\x20or\x20service\x20to\x20purchase'),'stock':BalanceTypeSchema['describe']('Quantity\x20of\x20the\x20product\x20or\x20service\x20to\x20purchase'),'wip_hash':z['string']()['describe']('WIP\x20file\x20hash\x20of\x20the\x20item.\x20EMPTY\x20string\x20\x22\x22\x20means\x20only\x20verify\x20the\x20WIP\x20file\x20integrity\x20without\x20comparing\x20to\x20a\x20specific\x20hash\x20(the\x20hash\x20within\x20the\x20wip\x20file\x20will\x20be\x20used).\x20For\x20purchases,\x20it\x20is\x20STRONGLY\x20RECOMMENDED\x20to\x20fill\x20in\x20the\x20hash\x20you\x20saw\x20when\x20viewing\x20the\x20product\x20info\x20(from\x20the\x20Service\x20sale\x27s\x20wip_hash\x20field)\x20to\x20prevent\x20the\x20merchant\x20from\x20replacing\x20the\x20WIP\x20file\x20before\x20your\x20order\x20is\x20placed\x20(a\x20legitimate\x20update\x20operation),\x20which\x20would\x20cause\x20inconsistency\x20between\x20what\x20you\x20saw\x20and\x20what\x20you\x20received.')})['strict']();export const BuySchema=z['object']({'items':z['array'](ServiceBuyItemSchema)['describe']('List\x20of\x20products\x20or\x20services\x20to\x20purchase'),'total_pay':CoinParamSchema['describe']('Actual\x20payment\x20amount.\x20FORMAT:\x20{balance:\x20<amount_in_smallest_unit>}\x20or\x20{coin:\x20<coin_object_id>}.\x20'+'The\x20token\x20type\x20and\x20precision\x20are\x20determined\x20by\x20the\x20Service\x20object\x27s\x20type_parameter\x20(the\x20generic\x20type\x20set\x20when\x20the\x20Service\x20was\x20created).\x20'+'For\x20WOW\x20(9\x20decimals):\x20{balance:\x201000000000}\x20=\x201\x20WOW.\x20For\x20SUI\x20(9\x20decimals):\x20{balance:\x201000000000}\x20=\x201\x20SUI.'),'discount':z['string']()['optional']()['describe']('Discount\x20object\x20ID\x20or\x20name'),'payment_remark':z['string']()['optional']()['describe']('Payment\x20remark'),'payment_index':z['number']()['optional']()['describe']('Payment\x20index')})['strict']();export const DiscountSchema=z['object']({'name':z['string']()['describe']('Discount\x20name'),'discount_type':DiscountTypeSchema['describe']('Discount\x20type'),'discount_value':BalanceTypeSchema['describe']('Discount\x20value'),'benchmark':z['union']([z['number'](),z['string']()])['optional']()['describe']('Discount\x20benchmark\x20value.\x20Discount\x20is\x20only\x20applied\x20if\x20the\x20amount\x20exceeds\x20this\x20value'),'time_ms_start':z['number']()['optional']()['describe']('Discount\x20start\x20time\x20(milliseconds)'),'time_ms_end':z['number']()['describe']('Discount\x20end\x20time\x20(milliseconds)'),'count':z['number']()['describe']('Discount\x20usage\x20count'),'recipient':ManyAccountOrMark_AddressSchema['describe']('Discount\x20recipient'),'transferable':z['boolean']()['describe']('Whether\x20the\x20discount\x20object\x20recipient\x20can\x20transfer\x20the\x20discount\x20object')})['strict']();export const OrderNewSchema=z['object']({'buy':BuySchema,'agents':ManyAccountOrMark_AddressSchema['optional']()['describe']('Order\x20agents.\x20Agents\x20can\x20operate\x20the\x20order,\x20such\x20as\x20canceling\x20the\x20order,\x20modifying\x20the\x20order\x20status,\x20etc.;\x20but\x20cannot\x20receive\x20the\x20funds\x20received\x20by\x20the\x20order.'),'order_required_info':z['string']()['optional']()['describe']('Contact\x20object\x20ID\x20or\x20WTS\x20Proof\x20object,\x20recorded\x20on\x20the\x20Order\x20as\x20proof\x20that\x20the\x20order\x20holder\x20'+'delivered\x20the\x20required\x20private\x20information\x20(service.customer_required)\x20to\x20the\x20merchant.\x20'+'FLOW:\x20when\x20a\x20Service\x20declares\x20customer_required\x20(e.g.\x20phone/email/shipping_address),\x20the\x20order\x20holder\x20'+'MUST\x20send\x20that\x20private\x20information\x20to\x20the\x20Service\x27s\x20Contact\x20(um)\x20via\x20end-to-end\x20encrypted\x20Messenger,\x20'+'then\x20pass\x20the\x20Contact\x20object\x20ID\x20or\x20the\x20generated\x20WTS\x20Proof\x20here\x20so\x20the\x20delivery\x20is\x20verifiable\x20on-chain.'),'transfer':AccountOrMark_AddressSchema['optional']()['describe']('Set\x20the\x20new\x20owner\x20of\x20the\x20order.\x20Requires\x20order\x20owner\x20permission\x20to\x20set.'),'namedNewOrder':NamedObjectSchema['optional']()['describe']('RECOMMENDED:\x20Set\x20a\x20local\x20name\x20for\x20the\x20newly\x20created\x20Order\x20object.\x20'+'Without\x20this,\x20the\x20Order\x20is\x20only\x20referenceable\x20by\x20its\x20on-chain\x20address.\x20'+'Example:\x20{name:\x20\x27my_order_v1\x27}\x20allows\x20subsequent\x20operations\x20to\x20use\x20\x27my_order_v1\x27\x20instead\x20of\x20the\x20address.'),'namedNewAllocation':NamedObjectSchema['optional']()['describe']('RECOMMENDED:\x20Set\x20a\x20local\x20name\x20for\x20the\x20order\x27s\x20Allocation\x20object.\x20'+'Without\x20this,\x20the\x20Allocation\x20is\x20only\x20referenceable\x20by\x20its\x20address.\x20'+'Example:\x20{name:\x20\x27my_allocation_v1\x27}\x20allows\x20alloc_by_guard\x20to\x20reference\x20\x27my_allocation_v1\x27.'),'namedNewProgress':NamedObjectSchema['optional']()['describe']('RECOMMENDED:\x20Set\x20a\x20local\x20name\x20for\x20the\x20order\x27s\x20Progress\x20object.\x20'+'Without\x20this,\x20the\x20Progress\x20is\x20only\x20referenceable\x20by\x20its\x20address.\x20'+'Example:\x20{name:\x20\x27my_progress_v1\x27}\x20allows\x20progress\x20operations\x20to\x20use\x20\x27my_progress_v1\x27.')})['strict']();export const SalesSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add'),'sales':z['array'](ServiceSaleSchema)})['strict']()['describe']('Add\x20new\x20sales\x20products\x20or\x20services.'),z['object']({'op':z['literal']('set'),'sales':z['array'](ServiceSaleSchema)})['strict']()['describe']('Set\x20sales\x20products\x20or\x20services.'),z['object']({'op':z['literal']('remove'),'sales_name':z['array'](LongNameSchema['describe']('Sales\x20name'))})['strict']()['describe']('Remove\x20existing\x20sales\x20products\x20or\x20services.'),z['object']({'op':z['literal']('clear')})['strict']()['describe']('Clear\x20all\x20sales\x20products\x20or\x20services.')]);export const CallService_DataSchema=z['object']({'object':TypedPermissionObjectSchema,'order_new':OrderNewSchema['optional']()['describe']('Create\x20new\x20order.'),'description':DescriptionSchema['optional'](),'location':LongNameSchema['optional']()['describe']('Location\x20of\x20the\x20Service'),'sales':SalesSchema['optional']()['describe']('Service\x20sales\x20products\x20or\x20services\x20list.\x20'+'⚠️\x20WIP\x20NETWORK-DEPLOYMENT\x20RULE:\x20a\x20non-empty\x20sale.wip\x20MUST\x20be\x20a\x20publicly\x20reachable\x20URL\x20'+'(GitHub\x20Pages\x20/\x20IPFS\x20/\x20your\x20own\x20website).\x20The\x20URL\x20is\x20stored\x20ON-CHAIN\x20and\x20every\x20customer\x20'+'fetches\x20it\x20at\x20order\x20time\x20—\x20a\x20local\x20file\x20path,\x20localhost/loopback\x20URL,\x20or\x20LAN\x20private-IP\x20URL\x20'+'is\x20unreachable\x20by\x20customers\x20on\x20other\x20machines\x20and\x20aborts\x20order_new\x20100%.\x20Local-network\x20URLs\x20'+'are\x20INTERNAL\x20TEST\x20USE\x20ONLY\x20(env.network\x20=\x20localnet).\x20Leave\x20sale.wip\x20empty\x20(\x22\x22)\x20to\x20skip\x20'+'WIP\x20verification\x20(TESTING\x20ONLY).'),'repositories':ObjectsSchema['optional']()['describe']('Service\x20Repository\x20object\x20list.'),'rewards':ObjectsSchema['optional']()['describe']('Service\x20Reward\x20object\x20list.\x20'+'May\x20share\x20the\x20Service\x27s\x20Permission\x20(no\x20conflict\x20check\x20—\x20intentional:\x20rewards\x20are\x20the\x20provider\x27s\x20own\x20'+'incentive\x20tool;\x20only\x20Arbitration\x20requires\x20a\x20different\x20Permission\x20for\x20neutrality).'),'arbitrations':ObjectsSchema['optional']()['describe']('Service\x20Arbitration\x20object\x20list.\x20'+'FORMAT:\x20same\x20as\x20repositories\x20—\x20use\x20the\x20`objects`\x20field\x20name\x20inside\x20the\x20operation\x20data.\x20'+'Example:\x20{arbitrations:\x20[{name:\x20\x27my_arb_1\x27},\x20{name:\x20\x27my_arb_2\x27}]}.\x20'+'Each\x20item\x20is\x20a\x20NameOrAddress\x20(object\x20ID\x20or\x20local\x20mark\x20name).\x20'+'⚠️\x20PERMISSION\x20RULE\x20(contract-enforced,\x20service.move\x20arbitration_add_imp):\x20every\x20Arbitration\x20bound\x20here\x20'+'MUST\x20use\x20a\x20Permission\x20object\x20DIFFERENT\x20from\x20THIS\x20Service\x27s\x20permission\x20—\x20binding\x20an\x20Arbitration\x20that\x20shares\x20'+'the\x20Service\x27s\x20Permission\x20aborts\x20with\x20E_ARBITRATION_PERMISSION_CONFLICT\x20(error\x2033).\x20'+'Create\x20a\x20dedicated\x20Permission\x20for\x20each\x20Arbitration\x20BEFORE\x20binding.\x20'+'DESIGN\x20RATIONALE\x20(confirmed\x20intentional):\x20dispute\x20resolution\x20requires\x20NEUTRALITY\x20—\x20an\x20Arbitration\x20controlled\x20'+'by\x20the\x20same\x20Permission\x20admins\x20as\x20the\x20Service\x20it\x20judges\x20would\x20be\x20a\x20conflict\x20of\x20interest.\x20ONLY\x20Arbitration\x20has\x20'+'this\x20check:\x20Reward\x20and\x20Treasury\x20objects\x20MAY\x20share\x20the\x20Service\x27s\x20Permission\x20(they\x20are\x20the\x20provider\x27s\x20own\x20tools).'),'machine':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Service\x20Machine\x20object\x20ID\x20or\x20name.\x20The\x20Machine\x20object\x20must\x20be\x20in\x20published\x20state.'),'discount':DiscountSchema['optional']()['describe']('Issue\x20discount.'),'discount_destroy':z['array'](NameOrAddressSchema)['optional']()['describe']('Destroy\x20existing\x20discount\x20object\x20ID\x20list.'),'customer_required':z['array'](NotEmptyNameSchema)['optional']()['describe']('Customer\x20required\x20information\x20labels.\x20Such\x20as\x20phone,\x20email,\x20shipping_address,\x20etc.\x20'+'⚠️\x20HARD\x20LINKAGE\x20(SDK-enforced):\x20if\x20customer_required\x20is\x20set\x20(non-empty),\x20the\x20Service\x20MUST\x20also\x20bind\x20a\x20'+'Contact\x20via\x20`um`\x20—\x20otherwise\x20the\x20customer\x27s\x20private\x20information\x20cannot\x20be\x20delivered\x20through\x20end-to-end\x20'+'encrypted\x20Messenger\x20(which\x20routes\x20to\x20the\x20Contact\x20bound\x20as\x20um).\x20Set\x20`um`\x20together\x20with\x20customer_required.'),'order_allocators':z['union']([AllocatorsSchema,z['null']()])['optional']()['describe']('Order\x20fund\x20allocator.\x20Max\x20100\x20allocators\x20(MAX_ALLOCATOR_COUNT).\x20'+'Each\x20allocator\x20has\x20a\x20guard\x20(first\x20matching\x20guard\x20wins)\x20and\x20a\x20sharing\x20list.\x20'+'Set\x20to\x20null\x20to\x20clear.\x20'+'⚠️\x20PERMANENTLY\x20IMMUTABLE\x20after\x20publish:\x20order_allocators\x20can\x20ONLY\x20be\x20set\x20BEFORE\x20publish=true\x20'+'(Move\x20service.move:503:\x20assert!(!self.bPublished,\x20E_ALREADY_PUBLISHED)).\x20'+'After\x20publish,\x20the\x20ONLY\x20way\x20to\x20change\x20allocation\x20rules\x20is\x20to\x20create\x20a\x20NEW\x20Service\x20object.\x20'+'There\x20is\x20NO\x20pause+lock\x20exception\x20for\x20order_allocators\x20(unlike\x20arbitrations/rewards\x20which\x20have\x20time-lock\x20removal).\x20'+'PRE-PUBLISH\x20CHECKLIST:\x20verify\x20all\x20guard\x20names\x20resolve,\x20all\x20sharing\x20amounts\x20are\x20correct,\x20'+'threshold\x20is\x20set,\x20and\x20recipient\x20types\x20(Entity/Signer/GuardIdentifier)\x20are\x20intended\x20before\x20calling\x20publish=true.\x20'+'GuardIdentifier\x20sharing\x20mode:\x20{who:\x20{GuardIdentifier:\x20<u8>},\x20sharing:\x20<rate>,\x20mode:\x20\x27Rate\x27}\x20—\x20'+'resolves\x20recipient\x20from\x20Guard\x20table\x20submission\x20at\x20allocation\x20time\x20(e.g.,\x20refund\x20to\x20customer).\x20'+'MULTI-CALL\x20ALLOCATION:\x20Allocation.alloc()\x20can\x20be\x20called\x20MULTIPLE\x20times\x20(no\x20consumed\x20flag\x20in\x20contract).\x20'+'Use\x20Amount\x20mode\x20(not\x20Surplus)\x20for\x20recurring\x20allocations\x20—\x20Surplus\x20calls\x20balance::withdraw_all\x20which\x20drains\x20the\x20balance.\x20'+'For\x20monthly\x20payment\x20scenarios,\x20create\x20multiple\x20Allocators\x20with\x20time-based\x20Guards\x20+\x20Amount\x20mode\x20sharing\x20items.'),'buy_guard':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Buy\x20guard\x20object\x20ID\x20or\x20name.'),'compensation_fund_add':CoinParamSchema['optional']()['describe']('Deposit\x20funds\x20into\x20the\x20Service\x20compensation_fund.\x20Used\x20to\x20pay\x20indemnity\x20when\x20arbitration\x20resolves\x20in\x20customer\x27s\x20favor.\x20'+'FORMAT:\x20{balance:\x20<amount_in_smallest_unit>}\x20—\x20the\x20field\x20name\x20is\x20\x27balance\x27\x20(NOT\x20\x27amount\x27).\x20'+'The\x20token\x20type\x20and\x20precision\x20are\x20determined\x20by\x20the\x20Service\x20object\x27s\x20type_parameter\x20(the\x20generic\x20type\x20set\x20when\x20the\x20Service\x20was\x20created).\x20'+'For\x20WOW\x20(9\x20decimals):\x20{balance:\x201000000000}\x20=\x201\x20WOW.\x20For\x20SUI\x20(9\x20decimals):\x20{balance:\x201000000000}\x20=\x201\x20SUI.\x20'+'For\x20tokens\x20with\x20different\x20decimals,\x20adjust\x20accordingly\x20(e.g.\x20USDC\x20has\x206\x20decimals,\x20so\x20{balance:\x201000000}\x20=\x201\x20USDC).\x20'+'REQUIRES:\x20Permission\x20index\x20315\x20(SERVICE_COMPENSATION_FUND_DEPOSIT)\x20must\x20be\x20granted\x20to\x20the\x20calling\x20account\x20first.\x20'+'COMMON\x20MISTAKE:\x20using\x20{amount:\x20...}\x20or\x20{amount:\x20...,\x20type:\x20\x27WOW\x27}\x20—\x20these\x20will\x20fail.\x20The\x20correct\x20field\x20is\x20\x27balance\x27.'),'compensation_fund_withdraw':z['object']({'receipt':AccountOrMark_AddressSchema['describe']('Receipt\x20address\x20that\x20will\x20receive\x20the\x20withdrawn\x20funds\x20(as\x20a\x20new\x20Payment\x20object)'),'payment_info':PaymentInfoSchema['describe']('Payment\x20info\x20for\x20the\x20new\x20Payment\x20object\x20created\x20to\x20hold\x20the\x20withdrawn\x20funds')})['strict']()['optional']()['describe']('Withdraw\x20ALL\x20funds\x20from\x20the\x20compensation_fund\x20to\x20a\x20new\x20Payment\x20object\x20owned\x20by\x20`receipt`.\x20'+'Move\x20layer:\x20service::compensation_fund_withdraw\x20(service.move\x20L383-390).\x20'+'REQUIRES:\x20Service\x20must\x20be\x20paused\x20AND\x20setting_lock_duration\x20must\x20have\x20elapsed\x20since\x20pause\x20(assert_not_published\x20at\x20L384-385).\x20'+'Withdraws\x20the\x20ENTIRE\x20compensation_fund\x20balance\x20via\x20balance::withdraw_all.\x20'+'DIFFERENT\x20from\x20compensation_claim\x20(order-side,\x20for\x20arbitration-winning\x20users,\x20no\x20pause+lock\x20required).'),'setting_lock_duration_add':z['number']()['optional']()['describe']('Additional\x20lock\x20duration\x20to\x20ADD\x20to\x20\x27setting_lock_duration\x27\x20(Move\x20field\x20name).\x20'+'UNIT:\x20milliseconds\x20(ms).\x20Example:\x202592000000\x20=\x2030\x20days,\x207776000000\x20=\x2090\x20days,\x2086400000\x20=\x201\x20day.\x20'+'DEFAULT:\x202592000000\x20(30\x20days,\x20DEFAULT_LOCK_DURATION).\x20This\x20is\x20the\x20initial\x20value\x20when\x20a\x20Service\x20is\x20created.\x20'+'Behavior:\x20additive\x20(safe_add)\x20—\x20only\x20increases,\x20never\x20decreases.\x20'+'Move\x20entry:\x20service::setting_lock_duration_add\x20/\x20setting_lock_duration_add_with_passport.\x20'+'Can\x20be\x20called\x20BEFORE\x20or\x20AFTER\x20publish\x20(no\x20publish\x20check).\x20'+'Affects\x20the\x20waiting\x20time\x20required\x20by:\x20compensation_fund_withdraw,\x20arbitrations\x20remove/clear,\x20rewards\x20remove/clear\x20'+'(all\x20require\x20pause\x20+\x20setting_lock_duration\x20elapsed\x20since\x20pause).'),'compensation_fund_receive':ReceivedBalanceOrRecentlySchema['optional']()['describe']('Receive\x20order\x20compensation\x20funds\x20from\x20this\x20Service\x20object.'+RECEIVE_FORMAT_BLOCK_BALANCE),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Service\x20object\x20and\x20send\x20them\x20to\x20the\x20owner\x20of\x20its\x20Permission\x20object.'+RECEIVE_FORMAT_BLOCK_OBJECTS),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20or\x20name\x20—\x20the\x20Service\x27s\x20customer-service\x20channel.\x20'+'This\x20is\x20the\x20object\x20that\x20Messenger\x20routes\x20encrypted\x20messages\x20to\x20for\x20pre-order\x20negotiation,\x20'+'private-info\x20delivery\x20(see\x20customer_required),\x20and\x20post-sale\x20support.\x20'+'⚠️\x20REQUIRED\x20whenever\x20customer_required\x20is\x20set:\x20without\x20um,\x20the\x20customer\x27s\x20private\x20information\x20'+'has\x20no\x20channel\x20to\x20reach\x20the\x20merchant.'),'pause':z['boolean']()['optional']()['describe']('Whether\x20to\x20pause\x20accepting\x20new\x20orders.'),'publish':z['boolean']()['optional']()['describe']('Whether\x20to\x20publish\x20the\x20Service.\x20After\x20publishing,\x20customers\x20can\x20place\x20orders.\x20'+'VERIFIED\x20against\x20Move\x20source\x20service.move\x20+\x20SDK\x20service.ts\x20(4-level\x20immutability\x20matrix):\x0a'+'\x20\x20L1\x20—\x20PERMANENTLY\x20LOCKED\x20after\x20publish\x20(assert!(!bPublished),\x20no\x20pause+lock\x20exception):\x0a'+'\x20\x20\x20\x20•\x20machine\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(service.move\x20L633/L653\x20—\x20workflow\x20template)\x0a'+'\x20\x20\x20\x20•\x20order_allocators\x20(service.move\x20L503\x20—\x20fund\x20distribution\x20rules)\x0a'+'\x20\x20L2\x20—\x20TIME-LOCKED\x20after\x20publish\x20(assert_not_published\x20—\x20requires\x20pause\x20+\x20setting_lock_duration\x20elapsed):\x0a'+'\x20\x20\x20\x20•\x20arbitrations\x20remove/clear\x20(service.move\x20L433/L445\x20—\x20dispute\x20resolution\x20objects)\x0a'+'\x20\x20\x20\x20•\x20rewards\x20remove/clear\x20\x20\x20\x20\x20\x20\x20(service.move\x20L402/L414\x20—\x20reward\x20objects)\x0a'+'\x20\x20\x20\x20•\x20compensation_fund_withdraw\x20(service.move\x20L384-385\x20—\x20withdraw\x20ALL\x20funds)\x0a'+'\x20\x20L3\x20—\x20REMAIN\x20MUTABLE\x20after\x20publish\x20(no\x20SDK\x20check,\x20no\x20Move\x20check):\x0a'+'\x20\x20\x20\x20•\x20arbitrations\x20add,\x20rewards\x20add\x20(no\x20assert\x20—\x20can\x20add\x20after\x20publish)\x0a'+'\x20\x20\x20\x20•\x20buy_guard,\x20sales,\x20discount,\x20description,\x20location,\x20pause,\x20repositories,\x0a'+'\x20\x20\x20\x20•\x20compensation_fund_add,\x20setting_lock_duration_add,\x20customer_required,\x20um\x20(Contact)\x0a'+'These\x202\x20L1-LOCKED\x20fields\x20(machine/order_allocators)\x20MUST\x20be\x20set\x20BEFORE\x20publish=true.\x0a'+'arbitrations/rewards\x20can\x20be\x20ADDED\x20after\x20publish\x20but\x20remove/clear\x20requires\x20pause+lock.\x0a'+'\x0a'+'⚠️\x20COMPENSATION_FUND\x20+\x20ARBITRATION\x20LINKAGE\x20(service.move:494-499):\x0a'+'\x20\x20At\x20publish\x20time,\x20if\x20compensation_fund\x20>\x200,\x20Arbitration\x20MUST\x20be\x20bound:\x0a'+'\x20\x20\x20\x20if\x20(balance::value(&self.compensation_fund)\x20>\x200)\x20{\x0a'+'\x20\x20\x20\x20\x20\x20\x20\x20assert!(arbitration_count\x20>\x200,\x20E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND);\x0a'+'\x20\x20\x20\x20}\x0a'+'\x20\x20The\x20MCP\x20handler\x20enforces\x20this\x20as\x20a\x20HARD\x20PRE-CHECK:\x20if\x20publish=true\x20AND\x20compensation_fund_add\x20'+'\x20\x20is\x20set\x20in\x20the\x20same\x20call\x20AND\x20arbitrations\x20is\x20empty,\x20the\x20call\x20is\x20REJECTED\x20before\x20submission.\x20'+'\x20\x20If\x20compensation_fund\x20was\x20deposited\x20in\x20a\x20prior\x20call,\x20a\x20SOFT\x20WARNING\x20is\x20issued.\x0a'+'\x0a'+'SCHEMA-03\x20/\x20P0-01\x20fix\x20—\x20DEPLOYMENT\x20WORKFLOW\x20(two-phase,\x20avoids\x20circular\x20dependency):\x0a'+'\x20\x20Phase\x201\x20—\x20CREATE\x20(no\x20publish):\x20object={name:\x27my-service\x27,\x20type_parameter,\x20permission}\x20+\x20machine\x20+\x20order_allocators\x20+\x20arbitrations.\x0a'+'\x20\x20\x20\x20NOTE:\x20buy_guard\x20can\x20use\x20a\x20LocalMark\x20NAME\x20(not\x20address)\x20to\x20break\x20the\x20Guard→Service\x20circular\x20dependency.\x0a'+'\x20\x20\x20\x20The\x20name\x20is\x20resolved\x20to\x20an\x20address\x20at\x20transaction\x20build\x20time.\x0a'+'\x20\x20Phase\x202\x20—\x20PUBLISH:\x20object=\x27my-service\x27\x20(string\x20ref)\x20+\x20publish=true.\x0a'+'\x20\x20\x20\x20All\x20L1-LOCKED\x20fields\x20must\x20be\x20set\x20in\x20Phase\x201;\x20Phase\x202\x20only\x20flips\x20the\x20publish\x20flag.\x0a'+'\x20\x20Post-publish\x20updates:\x20buy_guard,\x20sales,\x20description,\x20repositories\x20(add),\x20rewards\x20(add),\x20arbitrations\x20(add),\x20etc.')})['strict']()['describe']('On-chain\x20Service\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20type_parameter,\x20permission,\x20...}\x20to\x20create\x20a\x20Service.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x20\x27permission\x27\x20can\x20be\x20a\x20new\x20Permission\x20object\x20or\x20reference\x20an\x20existing\x20one\x20-\x20check\x20\x27object\x27\x20field\x20description\x20for\x20details.\x20(2)\x20OPERATE\x20EXISTING:\x20Set\x20\x27object\x27\x20field\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20STRING\x20for\x20existing,\x20OBJECT\x20for\x20new\x20creation.');export const CallService_InputSchema=z['object']({'data':CallService_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
|
|
@@ -1,71 +1 @@
|
|
|
1
|
-
import { z }
|
|
2
|
-
import { TypedPermissionObjectSchema, CoinParamSchema, NamedObjectSchema, SubmissionCallSchema, CallEnvSchema } from "./base.js";
|
|
3
|
-
import { AmountFromDepositGuardSchema, AmountFromWithdrawGuardSchema, PaymentInfoSchema } from "../query/index.js";
|
|
4
|
-
import { AccountOrMark_AddressSchema, DescriptionSchema, ReceivedBalanceOrRecentlySchema, ReceivedObjectsOrRecentlySchema, NameOrAddressSchema, RECEIVE_FORMAT_BLOCK_OBJECTS, RECEIVE_FORMAT_BLOCK_BALANCE } from "../common/index.js";
|
|
5
|
-
import { BalanceTypeSchema } from "../common/index.js";
|
|
6
|
-
export const DepositSchema = z.object({
|
|
7
|
-
coin: CoinParamSchema.describe("Asset to deposit"),
|
|
8
|
-
by_external_deposit_guard: z.string().optional().describe("Deposit by verifying the specified Guard object ID or name; if not specified, deposit through Permission"),
|
|
9
|
-
payment_info: PaymentInfoSchema,
|
|
10
|
-
namedNewPayment: NamedObjectSchema.optional().describe("After deposit, create a new Payment object. You can specify a name for this object"),
|
|
11
|
-
}).strict();
|
|
12
|
-
export const WithdrawSchema = z.object({
|
|
13
|
-
amount: z.union([
|
|
14
|
-
z.object({ fixed: BalanceTypeSchema
|
|
15
|
-
}).strict().describe("Fixed withdrawal amount, this method can only withdraw through Permission"),
|
|
16
|
-
z.object({ by_external_withdraw_guard: z.string().describe("Withdraw by verifying the specified Guard object ID or name (the amount is the value of the index number corresponding to the Guard object); if not specified, withdraw through Permission") }).strict(),
|
|
17
|
-
]).describe("Withdrawal amount"),
|
|
18
|
-
recipient: AccountOrMark_AddressSchema.describe("ID or account to receive assets"),
|
|
19
|
-
payment_info: PaymentInfoSchema,
|
|
20
|
-
namedNewPayment: NamedObjectSchema.optional().describe("After withdrawal, create a new Payment object. You can specify a name for this object"),
|
|
21
|
-
}).strict();
|
|
22
|
-
export const ExternalDepositGuardSchema = z.discriminatedUnion("op", [
|
|
23
|
-
z.object({
|
|
24
|
-
op: z.literal("add"),
|
|
25
|
-
guards: z.array(AmountFromDepositGuardSchema),
|
|
26
|
-
}).strict(),
|
|
27
|
-
z.object({
|
|
28
|
-
op: z.literal("set"),
|
|
29
|
-
guards: z.array(AmountFromDepositGuardSchema),
|
|
30
|
-
}).strict(),
|
|
31
|
-
z.object({
|
|
32
|
-
op: z.literal("remove"),
|
|
33
|
-
guards: z.array(NameOrAddressSchema).describe("List of Guard object IDs or names to remove"),
|
|
34
|
-
}).strict(),
|
|
35
|
-
z.object({
|
|
36
|
-
op: z.literal("clear"),
|
|
37
|
-
}).strict(),
|
|
38
|
-
]);
|
|
39
|
-
export const ExternalWithdrawGuardSchema = z.discriminatedUnion("op", [
|
|
40
|
-
z.object({
|
|
41
|
-
op: z.literal("add"),
|
|
42
|
-
guards: z.array(AmountFromWithdrawGuardSchema),
|
|
43
|
-
}).strict(),
|
|
44
|
-
z.object({
|
|
45
|
-
op: z.literal("set"),
|
|
46
|
-
guards: z.array(AmountFromWithdrawGuardSchema),
|
|
47
|
-
}).strict(),
|
|
48
|
-
z.object({
|
|
49
|
-
op: z.literal("remove"),
|
|
50
|
-
guards: z.array(NameOrAddressSchema).describe("List of Guard object IDs or names to remove"),
|
|
51
|
-
}).strict(),
|
|
52
|
-
z.object({
|
|
53
|
-
op: z.literal("clear"),
|
|
54
|
-
}).strict(),
|
|
55
|
-
]);
|
|
56
|
-
export const CallTreasury_DataSchema = z.object({
|
|
57
|
-
object: TypedPermissionObjectSchema,
|
|
58
|
-
description: DescriptionSchema.optional(),
|
|
59
|
-
receive: ReceivedBalanceOrRecentlySchema.optional().describe("Receive CoinWrapper objects received by this Treasury object and deposit them into its balance." + RECEIVE_FORMAT_BLOCK_BALANCE),
|
|
60
|
-
deposit: DepositSchema.optional().describe("Deposit to Treasury object"),
|
|
61
|
-
withdraw: WithdrawSchema.optional().describe("Withdraw from Treasury object"),
|
|
62
|
-
external_deposit_guard: ExternalDepositGuardSchema.optional().describe("Set external deposit Guard for Treasury object"),
|
|
63
|
-
external_withdraw_guard: ExternalWithdrawGuardSchema.optional().describe("Set external withdrawal Guard for Treasury object"),
|
|
64
|
-
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects and other objects received by this Treasury object and send them to the owner of its Permission object." + RECEIVE_FORMAT_BLOCK_OBJECTS),
|
|
65
|
-
um: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object ID or name."),
|
|
66
|
-
}).strict().describe("On-chain Treasury operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, type_parameter, permission, ...} to create a Treasury. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with STRING format (object ID or name). The 'object' field is CRITICAL and REQUIRED in both cases. STRING for existing, OBJECT for new creation.");
|
|
67
|
-
export const CallTreasury_InputSchema = z.object({
|
|
68
|
-
data: CallTreasury_DataSchema,
|
|
69
|
-
env: CallEnvSchema.optional(),
|
|
70
|
-
submission: SubmissionCallSchema.optional(),
|
|
71
|
-
}).strict();
|
|
1
|
+
import{z}from'zod';import{TypedPermissionObjectSchema,CoinParamSchema,NamedObjectSchema,SubmissionCallSchema,CallEnvSchema}from'./base.js';import{AmountFromDepositGuardSchema,AmountFromWithdrawGuardSchema,PaymentInfoSchema}from'../query/index.js';import{AccountOrMark_AddressSchema,DescriptionSchema,ReceivedBalanceOrRecentlySchema,ReceivedObjectsOrRecentlySchema,NameOrAddressSchema,RECEIVE_FORMAT_BLOCK_OBJECTS,RECEIVE_FORMAT_BLOCK_BALANCE}from'../common/index.js';import{BalanceTypeSchema}from'../common/index.js';export const DepositSchema=z['object']({'coin':CoinParamSchema['describe']('Asset\x20to\x20deposit'),'by_external_deposit_guard':z['string']()['optional']()['describe']('Deposit\x20by\x20verifying\x20the\x20specified\x20Guard\x20object\x20ID\x20or\x20name;\x20if\x20not\x20specified,\x20deposit\x20through\x20Permission'),'payment_info':PaymentInfoSchema,'namedNewPayment':NamedObjectSchema['optional']()['describe']('After\x20deposit,\x20create\x20a\x20new\x20Payment\x20object.\x20You\x20can\x20specify\x20a\x20name\x20for\x20this\x20object')})['strict']();export const WithdrawSchema=z['object']({'amount':z['union']([z['object']({'fixed':BalanceTypeSchema})['strict']()['describe']('Fixed\x20withdrawal\x20amount,\x20this\x20method\x20can\x20only\x20withdraw\x20through\x20Permission'),z['object']({'by_external_withdraw_guard':z['string']()['describe']('Withdraw\x20by\x20verifying\x20the\x20specified\x20Guard\x20object\x20ID\x20or\x20name\x20(the\x20amount\x20is\x20the\x20value\x20of\x20the\x20index\x20number\x20corresponding\x20to\x20the\x20Guard\x20object);\x20if\x20not\x20specified,\x20withdraw\x20through\x20Permission')})['strict']()])['describe']('Withdrawal\x20amount'),'recipient':AccountOrMark_AddressSchema['describe']('ID\x20or\x20account\x20to\x20receive\x20assets'),'payment_info':PaymentInfoSchema,'namedNewPayment':NamedObjectSchema['optional']()['describe']('After\x20withdrawal,\x20create\x20a\x20new\x20Payment\x20object.\x20You\x20can\x20specify\x20a\x20name\x20for\x20this\x20object')})['strict']();export const ExternalDepositGuardSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add'),'guards':z['array'](AmountFromDepositGuardSchema)})['strict'](),z['object']({'op':z['literal']('set'),'guards':z['array'](AmountFromDepositGuardSchema)})['strict'](),z['object']({'op':z['literal']('remove'),'guards':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20Guard\x20object\x20IDs\x20or\x20names\x20to\x20remove')})['strict'](),z['object']({'op':z['literal']('clear')})['strict']()]);export const ExternalWithdrawGuardSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add'),'guards':z['array'](AmountFromWithdrawGuardSchema)})['strict'](),z['object']({'op':z['literal']('set'),'guards':z['array'](AmountFromWithdrawGuardSchema)})['strict'](),z['object']({'op':z['literal']('remove'),'guards':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20Guard\x20object\x20IDs\x20or\x20names\x20to\x20remove')})['strict'](),z['object']({'op':z['literal']('clear')})['strict']()]);export const CallTreasury_DataSchema=z['object']({'object':TypedPermissionObjectSchema,'description':DescriptionSchema['optional'](),'receive':ReceivedBalanceOrRecentlySchema['optional']()['describe']('Receive\x20CoinWrapper\x20objects\x20received\x20by\x20this\x20Treasury\x20object\x20and\x20deposit\x20them\x20into\x20its\x20balance.'+RECEIVE_FORMAT_BLOCK_BALANCE),'deposit':DepositSchema['optional']()['describe']('Deposit\x20to\x20Treasury\x20object'),'withdraw':WithdrawSchema['optional']()['describe']('Withdraw\x20from\x20Treasury\x20object'),'external_deposit_guard':ExternalDepositGuardSchema['optional']()['describe']('Set\x20external\x20deposit\x20Guard\x20for\x20Treasury\x20object'),'external_withdraw_guard':ExternalWithdrawGuardSchema['optional']()['describe']('Set\x20external\x20withdrawal\x20Guard\x20for\x20Treasury\x20object'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Treasury\x20object\x20and\x20send\x20them\x20to\x20the\x20owner\x20of\x20its\x20Permission\x20object.'+RECEIVE_FORMAT_BLOCK_OBJECTS),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20or\x20name.')})['strict']()['describe']('On-chain\x20Treasury\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20type_parameter,\x20permission,\x20...}\x20to\x20create\x20a\x20Treasury.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x20\x27permission\x27\x20can\x20be\x20a\x20new\x20Permission\x20object\x20or\x20reference\x20an\x20existing\x20one\x20-\x20check\x20\x27object\x27\x20field\x20description\x20for\x20details.\x20(2)\x20OPERATE\x20EXISTING:\x20Set\x20\x27object\x27\x20field\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20STRING\x20for\x20existing,\x20OBJECT\x20for\x20new\x20creation.');export const CallTreasury_InputSchema=z['object']({'data':CallTreasury_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
|