@wowok/agent-mcp 2.7.1 → 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.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 +9 -2
- package/dist/evaluation/arbitration-game.js +1 -48
- package/dist/evaluation/builtins/demand-match.js +1 -153
- package/dist/evaluation/builtins/index.js +1 -10
- package/dist/evaluation/builtins/service-risk.js +1 -55
- package/dist/evaluation/capability.js +1 -13
- package/dist/evaluation/composer.js +1 -40
- package/dist/evaluation/engine.js +1 -175
- package/dist/evaluation/extract.js +1 -115
- package/dist/evaluation/game-strategy.d.ts +27 -0
- package/dist/evaluation/game-strategy.js +1 -0
- package/dist/evaluation/gap.js +1 -100
- package/dist/evaluation/index.d.ts +1 -0
- package/dist/evaluation/index.js +1 -11
- package/dist/evaluation/node-game.d.ts +31 -3
- package/dist/evaluation/node-game.js +1 -57
- package/dist/evaluation/region.js +1 -36
- package/dist/evaluation/types.d.ts +1 -0
- package/dist/evaluation/types.js +1 -1
- package/dist/evaluation/user-injection.js +1 -27
- 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 -315
- 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.js +1 -67
- package/dist/intent/index.js +1 -60
- package/dist/intent/matcher.js +1 -81
- package/dist/intent/store.js +1 -55
- package/dist/intent/types.js +1 -10
- 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 -423
- 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.js +1 -60
- 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 -843
- 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 -669
- 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.js +1 -777
- 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 -651
- package/dist/knowledge/service-templates.js +1 -456
- package/dist/knowledge/service-translation.js +1 -622
- package/dist/knowledge/template-registry.js +1 -353
- package/dist/knowledge/tool-constraints.js +1 -195
- package/dist/knowledge/tools-reference.js +1 -178
- 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.js +1 -66
- package/dist/persona/bridge.js +1 -86
- package/dist/persona/defaults.js +1 -195
- package/dist/persona/experience-bridge.js +1 -23
- package/dist/persona/index.js +1 -71
- package/dist/persona/model.js +1 -111
- package/dist/persona/store.js +1 -62
- package/dist/persona/types.d.ts +3 -1
- package/dist/persona/types.js +1 -5
- 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.js +1 -1784
- 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 -292
- 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.js +1 -52
- 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 -1679
- package/dist/schema/call/service.js +1 -184
- 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 +213 -16
- package/dist/schema/evaluation/index.js +1 -356
- package/dist/schema/index.js +1 -17
- package/dist/schema/intent-radar/index.d.ts +13 -13
- package/dist/schema/intent-radar/index.js +1 -89
- 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 +54 -54
- package/dist/schema/persona/index.js +1 -148
- package/dist/schema/project/index.d.ts +94 -48
- package/dist/schema/project/index.js +1 -2057
- package/dist/schema/query/index.d.ts +423 -7
- package/dist/schema/query/index.js +1 -1646
- package/dist/schema/schema-query/index.js +1 -104
- package/dist/schema/schema-version.js +1 -76
- package/dist/schema/sync-layer4.js +1 -286
- package/dist/schema/task-status.js +1 -36
- 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 +112 -7
- package/dist/schemas/evaluation_operation.schema.json +93 -6
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/intent_radar.output.json +4 -1
- package/dist/schemas/intent_radar.schema.json +4 -1
- 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 +4 -4
- 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 +1 -1
- package/dist/schemas/onchain_table_data.output.json +6 -3
- package/dist/schemas/persona_operation.output.json +4 -1
- package/dist/schemas/persona_operation.schema.json +4 -1
- package/dist/schemas/project_operation.output.json +28 -8
- package/dist/schemas/query_toolkit.output.json +8 -5
- 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.js +1 -123
- package/dist/tools/handlers/file-export.js +1 -90
- package/dist/tools/handlers/intent-radar.js +1 -76
- package/dist/tools/handlers/local.js +1 -53
- package/dist/tools/handlers/messenger.js +1 -188
- package/dist/tools/handlers/onchain.js +1 -1180
- package/dist/tools/handlers/persona.js +1 -89
- 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.js +1 -26
- package/dist/tools/handlers/trust.js +1 -380
- package/dist/tools/handlers/wip.js +1 -90
- package/dist/tools/index.js +1 -1382
- 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.js +1 -306
- package/dist/tools/wrap.js +1 -500
- package/package.json +4 -2
|
@@ -1,1646 +1 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { TokenTypeInfoSchema, QueryLocalMarkListResultSchema, QueryAccountListResultSchema, QueryLocalInfoListResultSchema, QueryLocalTokenListResultSchema, QueryAccountResultSchema } from "../local/index.js";
|
|
3
|
-
import { AccountOrMark_AddressSchema, BalanceTypeSchema, CacheExpireTypeSchema, EntrypointSchema, GuardIdentifierSchema, GuardTableItemSchema, NameOrAddressSchema, ObjectBaseSchema, ObjectTypeSchema, QueryIdSchema, SupportedValueSchema, ValueTypeSchema, QueryReceivedResultSchema, LongNameSchema, DescriptionSchema } from "../common/index.js";
|
|
4
|
-
import { SemanticSummarySchema } from "../call/index.js";
|
|
5
|
-
import { isValidPermissionIndex } from '../utils/permission-index-utils.js';
|
|
6
|
-
import { isValidGuardQueryId, isValidGuardQueryIdOrName, isValidWitnessType } from '../utils/guard-query-utils.js';
|
|
7
|
-
import { ENTITY_LINKER_ADDRESS, ENTITY_REGISTRAR_ADDRESS, isWitnessType, } from "@wowok/wowok";
|
|
8
|
-
import { QueryEnvSchema } from "../common/index.js";
|
|
9
|
-
const MAX_MULTI_OPERANDS = 8;
|
|
10
|
-
const VALUE_TYPE_DESCRIPTION = "Value type: can be specified as a string name (e.g., 'U64', 'Address', 'String') or a number (0-18). Supported types: Bool=0/'Bool', Address=1/'Address', String=2/'String', U8=3/'U8', U16=4/'U16', U32=5/'U32', U64=6/'U64', U128=7/'U128', U256=8/'U256', VecBool=9/'VecBool', VecAddress=10/'VecAddress', VecString=11/'VecString', VecU8=12/'VecU8', VecU16=13/'VecU16', VecU32=14/'VecU32', VecU64=15/'VecU64', VecU128=16/'VecU128', VecU256=17/'VecU256', VecVecU8=18/'VecVecU8'. Note: Value=19 is an INTERNAL type for wowok system use only and should NOT be used directly by users. String format is recommended for better readability.";
|
|
11
|
-
const tolerantNumber = z.union([z.number(), z.string()]);
|
|
12
|
-
const tolerantStringNullable = z.union([z.string(), z.null(), z.undefined()]);
|
|
13
|
-
const tolerantNumberNullable = z.union([z.number(), z.string(), z.null(), z.undefined()]);
|
|
14
|
-
export const AmountTypeSchema = z.union([
|
|
15
|
-
z.enum(["GuardU64Identifier", "Fixed"]),
|
|
16
|
-
z.number().int().min(0).max(1).transform((n) => n === 0 ? "GuardU64Identifier" :
|
|
17
|
-
n === 1 ? "Fixed" :
|
|
18
|
-
"GuardU64Identifier"),
|
|
19
|
-
]).describe("Amount type — determines how a payment amount is resolved. " +
|
|
20
|
-
"Accepts string ('GuardU64Identifier' or 'Fixed') or number (0='GuardU64Identifier', 1='Fixed'). String form is recommended for readability. " +
|
|
21
|
-
"• 'GuardU64Identifier' (0): the amount is NOT fixed — it is dynamically read from a U64 value stored in the Guard table at the specified Identifier index. Use this when the amount varies per order (e.g. milestone-based pricing, negotiated price). The Guard must have a matching U64 entry. " +
|
|
22
|
-
"• 'Fixed' (1): the amount is a fixed value set in the sale/price field. Use this for products with a static price (e.g. service fee = 50 SUI). " +
|
|
23
|
-
"Example: {price: 50000000000, stock: 100, amount_type: 'Fixed'} → fixed 50 SUI price. " +
|
|
24
|
-
"Example: {price: 0, stock: 100, amount_type: 'GuardU64Identifier'} → price read from Guard table U64 entry.");
|
|
25
|
-
export const GuardQuerySchema = z.object({
|
|
26
|
-
id: QueryIdSchema,
|
|
27
|
-
name: z.string().describe("Name of the query instruction."),
|
|
28
|
-
objectType: ObjectTypeSchema.describe("Type of the Object that the query instruction operates on."),
|
|
29
|
-
parameters: z.array(ValueTypeSchema).describe("List of parameter types for the query instruction."),
|
|
30
|
-
return: ValueTypeSchema.describe("Return value type of the query instruction."),
|
|
31
|
-
description: z.string().describe("Detailed description of the query instruction."),
|
|
32
|
-
parameters_description: z.array(z.string()).describe("Detailed descriptions of the query instruction parameters."),
|
|
33
|
-
});
|
|
34
|
-
export const GuardSubmissionSchema = z.object({
|
|
35
|
-
identifier: GuardIdentifierSchema.describe("Identifier"),
|
|
36
|
-
value_type: ValueTypeSchema.describe("Value type"),
|
|
37
|
-
value: SupportedValueSchema.describe("Value"),
|
|
38
|
-
}).describe("Guard submission");
|
|
39
|
-
export const RecipientSchema = z.union([
|
|
40
|
-
z.object({ GuardIdentifier: GuardIdentifierSchema }).describe("Guard verified recipient ID. Get recipient ID from specified data index in Guard table. The ID must be of address type."),
|
|
41
|
-
z.object({ Entity: AccountOrMark_AddressSchema }).describe("Static address resolved via LocalMark. " +
|
|
42
|
-
"Format: {Entity: {name_or_address: 'mark_name'}} — NOTE: Entity is an OBJECT with name_or_address field, NOT a bare string."),
|
|
43
|
-
z.object({ Signer: z.literal("signer") }).describe("Current transaction signer (tx_context::sender) at the time of the alloc() call. " +
|
|
44
|
-
"For refunds, the Order owner must call alloc_by_guard themselves to receive the funds."),
|
|
45
|
-
]).describe("Recipient ID. Three forms:\n" +
|
|
46
|
-
" - {GuardIdentifier: u8} — DYNAMIC address resolved from Passport at alloc() time\n" +
|
|
47
|
-
" - {Entity: {name_or_address: 'mark_name'}} — FIXED static address via LocalMark (recommended)\n" +
|
|
48
|
-
" - {Signer: 'signer'} — transaction sender at alloc() time (e.g. self-refund; customer must call alloc_by_guard themselves)");
|
|
49
|
-
export const RecordsInEntitySchema = z.object({
|
|
50
|
-
name: z.string().describe("Record name"),
|
|
51
|
-
value_type: ValueTypeSchema.describe("Value type"),
|
|
52
|
-
value: SupportedValueSchema.describe("Value"),
|
|
53
|
-
}).describe("Information record");
|
|
54
|
-
export const PermissionIndexTypeSchema = z.number().int().refine((value) => {
|
|
55
|
-
return isValidPermissionIndex(value);
|
|
56
|
-
}, {
|
|
57
|
-
message: "Permission index must be a valid BuiltinPermissionIndex value or user defined between 1000 and 65535"
|
|
58
|
-
}).describe("Permission index type");
|
|
59
|
-
export const VoteInEntityLinkerSchema = z.object({
|
|
60
|
-
address: z.string().describe("Account or object ID"),
|
|
61
|
-
like: z.boolean().optional().describe("Whether liked"),
|
|
62
|
-
dislike: z.boolean().optional().describe("Whether disliked"),
|
|
63
|
-
affiliation: z.boolean().optional().describe("Whether affiliated"),
|
|
64
|
-
time: tolerantNumber.describe("Time"),
|
|
65
|
-
}).describe("Follow record");
|
|
66
|
-
export const ObjectEntityRegistrarSchema = ObjectBaseSchema.extend({
|
|
67
|
-
entity_count: z.number().describe("Entity count. Number of entities registered in the entity registrar table. Use 'query_table' or 'query_table_item' to get 'EntityRegistrar' table items."),
|
|
68
|
-
}).describe("On-chain entity registrar");
|
|
69
|
-
export const ObjectEntityLinkerSchema = ObjectBaseSchema.extend({
|
|
70
|
-
entity_count: z.number().describe("Entity count. Number of entities registered in the entity linker table. Use 'query_table' or 'query_table_item' to get 'EntityLinker' table items."),
|
|
71
|
-
}).describe("On-chain entity linker");
|
|
72
|
-
export const ObjectResourceSchema = ObjectBaseSchema.extend({
|
|
73
|
-
entity_count: z.number().describe("Entity count. Number of entities registered in the address mark table. Use 'query_table' or 'query_table_item' to get 'AddressMark' table items."),
|
|
74
|
-
}).describe("On-chain address tag manager");
|
|
75
|
-
export const TableItem_EntityLinkerSchema = ObjectBaseSchema.extend({
|
|
76
|
-
address: z.string().describe("Followed ID"),
|
|
77
|
-
pos: tolerantNumber.describe("Current follow information position"),
|
|
78
|
-
count: tolerantNumber.describe("Follower count. Number of entities who have been followed others. Use 'query_table' or 'query_table_item' to get 'EntityLinker' table items."),
|
|
79
|
-
votes: z.array(VoteInEntityLinkerSchema).describe("Follow records"),
|
|
80
|
-
}).describe("On-chain followed object data");
|
|
81
|
-
export const TableItem_EntityRegistrarSchema = ObjectBaseSchema.extend({
|
|
82
|
-
address: z.string().describe("Entity ID"),
|
|
83
|
-
description: z.string().describe("Entity description"),
|
|
84
|
-
time: tolerantNumber.describe("On-chain registration time"),
|
|
85
|
-
referrer: tolerantStringNullable.describe("Referrer"),
|
|
86
|
-
mark_object: tolerantStringNullable.describe("Your on-chain address mark object by entity ID"),
|
|
87
|
-
records: z.array(RecordsInEntitySchema).describe("Information records"),
|
|
88
|
-
}).describe("On-chain entity data");
|
|
89
|
-
export const TableItem_AddressMarkSchema = ObjectBaseSchema.extend({
|
|
90
|
-
entity: z.string().describe("Entity ID"),
|
|
91
|
-
name: z.string().describe("Tag name"),
|
|
92
|
-
tags: z.array(z.string()).describe("Tag list"),
|
|
93
|
-
}).describe("On-chain ID mark data");
|
|
94
|
-
export const ServiceGuardSchema = z.object({
|
|
95
|
-
guard: z.string().describe("Service guard"),
|
|
96
|
-
service_identifier: z.union([GuardIdentifierSchema, z.null()]).optional().describe("Service identifier. Used to determine the service verified in Guard"),
|
|
97
|
-
}).describe("Service guard");
|
|
98
|
-
export const ObjectDemandSchema = ObjectBaseSchema.extend({
|
|
99
|
-
description: z.string().describe("Demand description"),
|
|
100
|
-
location: z.string().describe("Demand location"),
|
|
101
|
-
rewards: z.array(z.string()).describe("Reward list. Used to incentivize qualified Presenters to claim rewards"),
|
|
102
|
-
guards: z.array(ServiceGuardSchema).describe("Service Guard list"),
|
|
103
|
-
presenters_count: z.number().describe("Presenter count. Number of Presenters who have submitted their demand. Use 'query_table' or 'query_table_item' to get 'DemandPresenter' table items."),
|
|
104
|
-
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
105
|
-
permission: z.string().describe("Permission"),
|
|
106
|
-
}).describe("Demand object");
|
|
107
|
-
export const ObjectMachineSchema = ObjectBaseSchema.extend({
|
|
108
|
-
description: z.string().describe("Machine description"),
|
|
109
|
-
node_count: z.number().describe("Node count. Nodes are used to determine each step and state of Machine operation. Use 'query_table' or 'query_table_item' to get 'MachineNode' table items."),
|
|
110
|
-
consensus_repositories: z.array(z.string()).describe("Consensus repository list. Used to determine consensus data storage during Machine operation."),
|
|
111
|
-
bPaused: z.boolean().describe("Whether paused"),
|
|
112
|
-
bPublished: z.boolean().describe("Whether published"),
|
|
113
|
-
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
114
|
-
permission: z.string().describe("Permission object ID. Used to modify operation permission settings for Machine settings."),
|
|
115
|
-
}).describe("Machine object");
|
|
116
|
-
export const ServiceSaleSchema = z.object({
|
|
117
|
-
name: LongNameSchema.describe("Name of the product or service for sale"),
|
|
118
|
-
price: BalanceTypeSchema.describe("Price of the product or service"),
|
|
119
|
-
stock: BalanceTypeSchema.describe("Stock of the product or service"),
|
|
120
|
-
suspension: z.boolean().describe("Whether sale is suspended"),
|
|
121
|
-
wip: z.string().describe("WIP file URL. EMPTY string \"\" skips verification (TESTING ONLY). " +
|
|
122
|
-
"Production MUST use a real HTTP URL pointing to a .wip file generated by the wip_file tool. " +
|
|
123
|
-
"⚠️ NETWORK DEPLOYMENT REQUIRED: the URL is stored ON-CHAIN and every customer fetches it " +
|
|
124
|
-
"when placing an order. A local file path (C:\\..., /path/file.wip), a localhost/loopback URL " +
|
|
125
|
-
"or a LAN private-IP URL is unreachable by customers on other machines — it passes the " +
|
|
126
|
-
"merchant-side set-time verification but makes order_new abort 100% for customers. " +
|
|
127
|
-
"Either deploy the .wip file to a public endpoint (GitHub Pages / IPFS / your own website) " +
|
|
128
|
-
"and set this to the public URL, or leave it empty (\"\") to skip WIP verification (TESTING ONLY). " +
|
|
129
|
-
"Example: \"https://cdn.example.com/products/phone_v1.wip\""),
|
|
130
|
-
wip_hash: z.string().describe("SHA-256 hash (hex string) of the sale's WIP file, committed on-chain by the merchant. " +
|
|
131
|
-
"BUY RULE: if this is NON-EMPTY, the buyer MUST pass this exact value as wip_hash when creating an order " +
|
|
132
|
-
"(ServiceBuyItem.wip_hash) — NEVER use \"\". Pinning the on-chain hash prevents the merchant from replacing " +
|
|
133
|
-
"the WIP file (a legitimate update) between the buyer's view and order placement, ensuring 'what you see is " +
|
|
134
|
-
"what you get'. EMPTY means no hash was committed (TESTING ONLY, no delivery-integrity guarantee)."),
|
|
135
|
-
}).describe("Service sale");
|
|
136
|
-
export const PurchasedItemSchema = z.object({
|
|
137
|
-
name: LongNameSchema.describe("Name of the product or service"),
|
|
138
|
-
price: BalanceTypeSchema.describe("Service price"),
|
|
139
|
-
quantity: BalanceTypeSchema.describe("Service quantity"),
|
|
140
|
-
wip_hash: z.string().describe("WIP file hash of the item"),
|
|
141
|
-
});
|
|
142
|
-
export const ObjectOrderSchema = ObjectBaseSchema.extend({
|
|
143
|
-
items: z.array(PurchasedItemSchema).describe("Purchased service list"),
|
|
144
|
-
discount: z.union([z.string(), z.null()]).describe("Used discount object ID"),
|
|
145
|
-
progress: z.union([z.string(), z.null()]).describe("Order progress object ID"),
|
|
146
|
-
machine: z.union([z.string(), z.null()]).describe("Machine ID that progress belongs to"),
|
|
147
|
-
amount: BalanceTypeSchema.describe("Order amount"),
|
|
148
|
-
builder: z.string().describe("Purchaser ID"),
|
|
149
|
-
service: z.string().describe("Service ID"),
|
|
150
|
-
dispute: z.array(z.string()).describe("Arb object ID list. When unsatisfied with order delivery, dispute objects can be created."),
|
|
151
|
-
agent: z.array(z.string()).describe("Agent ID list. Agents handle all order operations except payment collection."),
|
|
152
|
-
allocation: z.union([z.string(), z.null()]).describe("Order amount allocation object ID"),
|
|
153
|
-
claimed_by: z.union([z.string(), z.null()]).describe("Order dispute object ID that has claimed order arbitration amount."),
|
|
154
|
-
required_info: z.union([z.string(), z.null()]).describe("Contact object ID (recipient) or WTS Proof object (delivery proof) that information has been delivered via Wowok Messenger."),
|
|
155
|
-
time: z.union([z.string(), z.number()]).describe("Order creation time"),
|
|
156
|
-
});
|
|
157
|
-
export const NamedOperatorSchema = z.object({
|
|
158
|
-
name: z.string().describe("Namespace name"),
|
|
159
|
-
operators: z.array(z.string()).describe("Operator ID list"),
|
|
160
|
-
}).describe("Namespace operator. Namespace is a permission identifier defined in Machine, allowing different Progress to bind different operators to exercise unified permission definitions.");
|
|
161
|
-
export const ProgressSessionHolderSchema = z.object({
|
|
162
|
-
forward: z.string().describe("An operation name"),
|
|
163
|
-
who: z.union([z.string(), z.null()]).describe("Operator ID"),
|
|
164
|
-
retained_submission: z.array(GuardSubmissionSchema).describe("Used to define submitted data after Guard verification"),
|
|
165
|
-
msg: z.string().describe("Information submitted to complete operation"),
|
|
166
|
-
accomplished: z.boolean().describe("Whether completed"),
|
|
167
|
-
time: tolerantNumber.describe("Session creation time"),
|
|
168
|
-
}).describe("An operation in Progress session");
|
|
169
|
-
export const ProgressSessionSchema = z.object({
|
|
170
|
-
next_node: z.string().describe("Next node ID"),
|
|
171
|
-
forwards: z.array(ProgressSessionHolderSchema).describe("Operation list in Progress session"),
|
|
172
|
-
weights: tolerantNumber.describe("Total operation weight"),
|
|
173
|
-
threshold: tolerantNumber.default(0).describe("Operation threshold. When total operation weight exceeds threshold, session is considered completed and Progress moves from current node to next node."),
|
|
174
|
-
}).describe("Progress session");
|
|
175
|
-
export const ObjectProgressSchema = ObjectBaseSchema.extend({
|
|
176
|
-
machine: z.string().describe("Machine ID that Progress object belongs to"),
|
|
177
|
-
context_repositories: z.array(z.string()).describe("Context repository list. Used to store context data during Progress operation."),
|
|
178
|
-
current: z.string().describe("Current node name"),
|
|
179
|
-
task: z.union([z.string(), z.null()]).describe("Target task ID executed by Progress (e.g., Order ID)"),
|
|
180
|
-
namedOperator: z.array(NamedOperatorSchema).describe("Namespace operator list. Each process can independently maintain operators for permissions represented by its namespace."),
|
|
181
|
-
session: z.array(ProgressSessionSchema).describe("Progress session list"),
|
|
182
|
-
history_count: z.number().describe("Number of historical sessions for completed nodes in Progress. Use 'query_table' or 'query_table_item' to get 'ProgressHistory' table items."),
|
|
183
|
-
current_time: z.number().describe("Current node entry timestamp"),
|
|
184
|
-
}).describe("Progress object");
|
|
185
|
-
export const AmountSchema = z.discriminatedUnion("type", [
|
|
186
|
-
z.object({
|
|
187
|
-
type: z.literal("GuardU64Identifier"),
|
|
188
|
-
value: GuardIdentifierSchema,
|
|
189
|
-
}).describe("Guard verified amount. Get amount value from specified data index in Guard table. The value type must be u64."),
|
|
190
|
-
z.object({
|
|
191
|
-
type: z.literal("Fixed"),
|
|
192
|
-
value: BalanceTypeSchema,
|
|
193
|
-
}).describe("Fixed amount"),
|
|
194
|
-
]).describe("Amount");
|
|
195
|
-
export const RewardGuardSchema = z.object({
|
|
196
|
-
guard: NameOrAddressSchema.describe("Guard object ID or name."),
|
|
197
|
-
recipient: RecipientSchema,
|
|
198
|
-
amount: AmountSchema.describe("Reward amount"),
|
|
199
|
-
expiration_time: z.number().optional().describe("Reward Guard expiration time. If set, the reward cannot be claimed by this guard after the expiration time. If not specified, Reward Guard is permanently valid."),
|
|
200
|
-
store_from_id: z.union([GuardIdentifierSchema, z.null()]).optional().describe("Guard table data index for record storage. The value at this index (address or number, including submitted values) will be stored in the record for Guard verification purposes, such as controlling operation frequency."),
|
|
201
|
-
}).describe("Reward Guard type");
|
|
202
|
-
export const ObjectRewardSchema = ObjectBaseSchema.extend({
|
|
203
|
-
description: z.string().describe("Reward object description"),
|
|
204
|
-
guards: z.array(RewardGuardSchema).describe("Reward Guard list. When one of the Guards is successfully verified in a transaction, the relevant recipient will receive the reward amount."),
|
|
205
|
-
balance: BalanceTypeSchema.describe("Current balance of reward object"),
|
|
206
|
-
guard_not_added_expiration_time: z.union([z.string(), z.number(), z.null()]).describe("Used to lock whether new Reward Guards can be added. If not specified, new Reward Guards can be added at any time; if expiration time is specified, new Reward Guards cannot be added before expiration."),
|
|
207
|
-
record_count: z.number().describe("Number of reward claimer records. Use 'query_table' or 'query_table_item' to get 'RewardRecord' table items."),
|
|
208
|
-
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
209
|
-
permission: z.string().describe("Permission object ID"),
|
|
210
|
-
}).describe("Reward object");
|
|
211
|
-
export const AllocationModeSchema = z.union([
|
|
212
|
-
z.enum(["Amount", "Rate", "Surplus"]),
|
|
213
|
-
z.number().int().min(0).max(2).transform((n) => n === 0 ? "Amount" :
|
|
214
|
-
n === 1 ? "Rate" :
|
|
215
|
-
n === 2 ? "Surplus" :
|
|
216
|
-
"Amount"),
|
|
217
|
-
]).describe("Allocation mode — determines how the `sharing` field is interpreted. " +
|
|
218
|
-
"Three modes can be used individually OR combined within a single Allocator; " +
|
|
219
|
-
"when combined, allocation order is strictly: Amount first, then Rate, then Surplus. " +
|
|
220
|
-
"Understanding these modes allows modeling almost any fund distribution pattern.\n" +
|
|
221
|
-
"• Amount (0): `sharing` is a FIXED amount in smallest unit (e.g., '750000000' = 0.75 WOW). " +
|
|
222
|
-
"Allocated FIRST; sum of all Amount items is cached as `fix` by the contract. " +
|
|
223
|
-
"Validation: when no Rate and no Surplus items exist, sum of Amount items must be >= allocators.threshold (EAMOUNT_BELOW_THRESHOLD=12); " +
|
|
224
|
-
"when `max` is set, sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13).\n" +
|
|
225
|
-
"• Rate (1): `sharing` is a basis-points rate (10000 = 100%). " +
|
|
226
|
-
"Allocated AFTER Amount; formula: allocated = (sharing × total_rates) / 10000, " +
|
|
227
|
-
"where total_rates = balance - fix (or max - fix if `max` is set). " +
|
|
228
|
-
"Validation: when no Surplus items exist, sum of all Rate items must be EXACTLY 10000 (ERATE_NOT_10000=4); " +
|
|
229
|
-
"when Surplus items exist, sum of all Rate items must be <= 10000 (ERATE_EXCEEDS_10000=6).\n" +
|
|
230
|
-
"• Surplus (2): `sharing` is IGNORED (contract forces it to 0). " +
|
|
231
|
-
"Allocated LAST; receives the remaining balance after Amount + Rate allocations. " +
|
|
232
|
-
"Validation: MAX ONE Surplus item per Allocator (EMULTIPLE_SURPLUS=5). " +
|
|
233
|
-
"When Surplus exists, Rate sum constraint relaxes from == 10000 to <= 10000.\n" +
|
|
234
|
-
"ALLOCATION ORDER (strict): Amount items (fixed, cached as fix) → Rate items (proportional to balance-fix) → Surplus item (remaining).\n" +
|
|
235
|
-
"RECOMMENDATION: Use Amount mode for known fixed amounts (clearer, no sum constraint). " +
|
|
236
|
-
"Use Rate mode for proportional splits (requires sum == 10000 unless Surplus present). " +
|
|
237
|
-
"Use Surplus to capture remainder (e.g., platform fee + host gets rest). " +
|
|
238
|
-
"Accepts string ('Amount'/'Rate'/'Surplus', recommended) or number (0/1/2).");
|
|
239
|
-
export const AllocationSharingSchema = z.object({
|
|
240
|
-
who: RecipientSchema.describe("Recipient of this allocation. Three forms — each resolves the address at a DIFFERENT time:\n" +
|
|
241
|
-
"• { GuardIdentifier: u8 } — DYNAMIC address resolved from Passport at alloc() time (contract calls passport::submission_get). " +
|
|
242
|
-
"Use 0 for Order owner in Service-integrated mode (Customer who created the Order). " +
|
|
243
|
-
"The identifier must match a Guard table entry with b_submission=true. " +
|
|
244
|
-
"If Passport has no matching submission, contract aborts with E_VERIFY_FAILED. " +
|
|
245
|
-
"Use when the recipient address is not known at config time and must be supplied via Guard submission data.\n" +
|
|
246
|
-
"• { Entity: { name_or_address: '...' } } — FIXED address resolved via LocalMark at SDK build time (passed to contract as a literal address). " +
|
|
247
|
-
"Use for known recipients (e.g., 'turo_host', or a Treasury object address). " +
|
|
248
|
-
"Use when the recipient is a stable, known address (e.g., operator receives rent, platform fee to treasury).\n" +
|
|
249
|
-
"• 'Signer' — the transaction sender at the time of the alloc() call (tx_context::sender). " +
|
|
250
|
-
"RESOLVED AT EXECUTION TIME, not at config time. " +
|
|
251
|
-
"For refunds: the customer (Order owner) must call alloc_by_guard THEMSELVES so that tx_context::sender resolves to THEIR address — " +
|
|
252
|
-
"if the operator calls alloc_by_guard, the operator becomes the recipient (Signer = operator), NOT the customer. " +
|
|
253
|
-
"Use when the recipient is whoever submits the allocation transaction (e.g., customer receives refund)."),
|
|
254
|
-
sharing: BalanceTypeSchema.describe("Allocation value. SEMANTICS DEPEND ON `mode`:\n" +
|
|
255
|
-
"• mode='Amount': absolute amount in smallest unit (e.g., '750000000' for 0.75 WOW, '250000000' for 0.25 WOW). " +
|
|
256
|
-
"Allocated first; sum of Amount items cached as `fix`.\n" +
|
|
257
|
-
"• mode='Rate': basis-points rate, 10000 = 100% (e.g., '7500' for 75%, '2500' for 25%). " +
|
|
258
|
-
"When no Surplus in same Allocator, sum MUST == 10000; when Surplus present, sum MUST <= 10000.\n" +
|
|
259
|
-
"• mode='Surplus': IGNORED (contract forces to 0). Set to '0' for clarity. " +
|
|
260
|
-
"Receives remaining balance after Amount + Rate allocations."),
|
|
261
|
-
mode: AllocationModeSchema,
|
|
262
|
-
}).describe("Fund allocation item — one recipient's share of the Allocation balance. " +
|
|
263
|
-
"The `sharing` value's meaning depends on `mode` (see AllocationModeSchema). " +
|
|
264
|
-
"Multiple items in the same Allocator are evaluated together: Amount items first, Rate items second, Surplus last.");
|
|
265
|
-
export const AllocatorSchema = z.object({
|
|
266
|
-
guard: NameOrAddressSchema.describe("Guard object ID or name. If Guard verification passes (via Passport), fund allocation for THIS Allocator fires. " +
|
|
267
|
-
"Each Allocator in an Allocators list can have a different Guard — the first Allocator whose Guard returns true wins. " +
|
|
268
|
-
"This enables mutually exclusive allocation paths (e.g., refund Guard on 'return_approved' node vs damage Guard on 'damage_confirmed' node)."),
|
|
269
|
-
sharing: z.array(AllocationSharingSchema).describe("Fund allocation item list. Each item specifies a recipient (who), a value (sharing), and a mode. " +
|
|
270
|
-
"Items can mix modes (Amount + Rate + Surplus) within the same Allocator. " +
|
|
271
|
-
"ALLOCATION ORDER: Amount items first (cached as fix) → Rate items (proportional to balance - fix) → Surplus item (remaining). " +
|
|
272
|
-
"CONSTRAINTS: max ONE Surplus item per Allocator; Rate sum must == 10000 (no Surplus) or <= 10000 (with Surplus); " +
|
|
273
|
-
"Amount sum must >= threshold (no Rate and no Surplus) and <= max (if max set)."),
|
|
274
|
-
fix: BalanceTypeSchema.optional().describe("OUTPUT-ONLY (query result). Cached sum of all Amount-mode `sharing` values in this Allocator. " +
|
|
275
|
-
"Computed by the contract during `allocator_add` — DO NOT set this field at creation. " +
|
|
276
|
-
"Used internally to compute `total_rates = balance - fix` for Rate allocation."),
|
|
277
|
-
max: z.union([BalanceTypeSchema, z.null()]).optional().describe("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). " +
|
|
278
|
-
"Passed through to the contract as Option<u64> via allocator_add(): when null/omitted the contract treats it as `none` (no cap); " +
|
|
279
|
-
"when set, the contract enforces it. Has THREE effects when set:\n" +
|
|
280
|
-
"1. Construction: sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13)\n" +
|
|
281
|
-
"2. Rate execution: total_rates = max - fix (instead of balance - fix)\n" +
|
|
282
|
-
"3. Surplus execution: surplus_amount = max - alloced_amount (instead of balance - alloced_amount)\n" +
|
|
283
|
-
"Use when you want to cap total allocation regardless of Order balance (e.g., cap payout to declared amount). " +
|
|
284
|
-
"SDK pre-validates Amount sum <= max at build time to give actionable error messages before on-chain abort."),
|
|
285
|
-
}).describe("Fund allocator — a complete allocation strategy triggered by a Guard. " +
|
|
286
|
-
"Contains a sharing[] array where items can mix Amount/Rate/Surplus modes. " +
|
|
287
|
-
"When the Guard passes, the contract allocates funds in strict order: Amount → Rate → Surplus.");
|
|
288
|
-
export const AllocatorsSchema = z.object({
|
|
289
|
-
description: DescriptionSchema.describe("Description of fund allocator list"),
|
|
290
|
-
threshold: BalanceTypeSchema.default(0).describe("Minimum balance required for allocation to fire. " +
|
|
291
|
-
"When the Allocation object's balance < threshold, allocation aborts with EINSUFFICIENT_BALANCE=7. " +
|
|
292
|
-
"Also: when an Allocator has only Amount items (no Rate, no Surplus), the sum of Amount items must be >= threshold (EAMOUNT_BELOW_THRESHOLD=12). " +
|
|
293
|
-
"Set to 0 (default) to allow any balance."),
|
|
294
|
-
allocators: z.array(AllocatorSchema).describe("Fund allocator list. Each allocator is evaluated in order; the FIRST allocator whose Guard passes wins. " +
|
|
295
|
-
"This enables mutually exclusive allocation paths (e.g., 3 allocators for 3 forward paths: refund / damage-deduct / arbitrate)."),
|
|
296
|
-
}).describe("Fund allocator list — the top-level allocation configuration attached to an Order. " +
|
|
297
|
-
"Contains a threshold and a list of Allocators. When funds arrive at the Order, " +
|
|
298
|
-
"the first Allocator whose Guard passes executes its sharing[] in strict order: Amount → Rate → Surplus. " +
|
|
299
|
-
"MULTI-TIER ALLOCATION (DOC-04): Each Order binds ONE Allocators template (set on Service.order_allocators before publish). " +
|
|
300
|
-
"For multi-tier distribution (e.g., customer→agency→suppliers), use a two-phase approach: " +
|
|
301
|
-
"(1) Tier-1 Allocators on the customer's Order (allocates to agency + refund fund); " +
|
|
302
|
-
"(2) Tier-2 Allocators on a NEW Order created by the agency (allocates agency's received funds to suppliers). " +
|
|
303
|
-
"Each tier's Rate-mode sharing[] must independently sum to 10000 (or <= 10000 with Surplus).");
|
|
304
|
-
export const ObjectServiceSchema = ObjectBaseSchema.extend({
|
|
305
|
-
description: z.string().describe("Service object description"),
|
|
306
|
-
location: z.string().describe("Service object location"),
|
|
307
|
-
sales: z.array(ServiceSaleSchema).describe("Service sale list."),
|
|
308
|
-
repositories: z.array(z.string()).describe("Repository object list for service object's shared data"),
|
|
309
|
-
buy_guard: z.union([z.string(), z.null()]).describe("Purchase Guard object ID. If defined, service can only be purchased if Guard verification passes."),
|
|
310
|
-
machine: z.union([z.string(), z.null()]).describe("Machine object ID for each order's processing flow. The Machine must be in published state."),
|
|
311
|
-
bPublished: z.boolean().describe("Whether service is published. If service is published, customers can purchase it; and related settings like Machine, arbitrations, order_allocators will be immutable."),
|
|
312
|
-
bPaused: z.boolean().describe("Whether service purchase is paused"),
|
|
313
|
-
customer_required: z.array(z.string()).describe("Information required from customer. Such as phone, email, etc."),
|
|
314
|
-
arbitrations: z.array(z.string()).describe("List of Arbitration objects supported by service. When order user needs arbitration, they can apply for arbitration with any Arbitration object in the list."),
|
|
315
|
-
compensation_fund: BalanceTypeSchema.describe("Compensation fund BALANCE (NOT a Treasury address). " +
|
|
316
|
-
"This field reports the total amount of funds currently held in the Service's compensation pool. " +
|
|
317
|
-
"To ADD funds, use `service.compensation_fund_add`. To RECEIVE funds (as order owner after arbitration), use `service.compensation_fund_receive`. " +
|
|
318
|
-
"P2-03 clarification: this is a balance value (e.g. {balance: '1000000000', token_type: '0x2::wow::WOW'}), NOT the Treasury object address. " +
|
|
319
|
-
"The Treasury address (if bound) is queried separately via the Service's `repositories` or `order_allocators` configuration."),
|
|
320
|
-
paused_time: z.union([z.number(), z.null()]).describe("Service purchase pause time. If not paused, it is null."),
|
|
321
|
-
setting_lock_duration: z.union([z.string(), z.number(), z.bigint()]).describe("Lock duration for critical settings. After Service is published, modifications to 'order_allocators', 'rewards', 'arbitrations', 'machine', and withdrawal from 'compensation_fund' must exceed the 'setting_lock_duration' lock time."),
|
|
322
|
-
order_allocators: z.union([AllocatorsSchema, z.null()]).describe("Order fund allocator list."),
|
|
323
|
-
rewards: z.array(z.string()).describe("Reward object list"),
|
|
324
|
-
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
325
|
-
permission: z.string().describe("Permission object ID"),
|
|
326
|
-
}).describe("Service object");
|
|
327
|
-
export const ArbVotedSchema = z.object({
|
|
328
|
-
voter: z.string().describe("Voter ID"),
|
|
329
|
-
agrees: z.array(z.number().min(0).max(255)).describe("List of supported Proposition indices"),
|
|
330
|
-
weight: z.number().describe("Voting weight"),
|
|
331
|
-
time: z.number().describe("Voting time"),
|
|
332
|
-
}).describe("Voting record");
|
|
333
|
-
export const ArbPropositionSchema = z.object({
|
|
334
|
-
name: z.string().describe("Proposal name"),
|
|
335
|
-
votes: z.number().describe("Number of votes supporting this proposal"),
|
|
336
|
-
}).describe("Proposal");
|
|
337
|
-
export const ArbIndemnitySchema = z.object({
|
|
338
|
-
amount: BalanceTypeSchema.describe("Compensation amount"),
|
|
339
|
-
time: z.number().describe("Arbitration time"),
|
|
340
|
-
}).describe("Arbitration compensation");
|
|
341
|
-
export const ArbStatusSchema = z.enum([
|
|
342
|
-
"Principal_confirming",
|
|
343
|
-
"Arbitrator_confirming",
|
|
344
|
-
"Voting",
|
|
345
|
-
"Arbitrated",
|
|
346
|
-
"Objectionable",
|
|
347
|
-
"Finished",
|
|
348
|
-
"Withdrawn",
|
|
349
|
-
]).describe("Arb object status");
|
|
350
|
-
export const ObjectArbSchema = ObjectBaseSchema.extend({
|
|
351
|
-
description: z.string().describe("Arb object statement"),
|
|
352
|
-
arbitration: z.string().describe("Parent arbitration object ID"),
|
|
353
|
-
order: z.string().describe("Order object ID"),
|
|
354
|
-
voted: z.array(ArbVotedSchema).describe("Voting record list"),
|
|
355
|
-
proposition: z.array(ArbPropositionSchema).describe("Claim/proposal list"),
|
|
356
|
-
fee: BalanceTypeSchema.describe("Arbitration fee"),
|
|
357
|
-
feedback: z.string().describe("Arbitration feedback"),
|
|
358
|
-
indemnity: z.union([ArbIndemnitySchema, z.null()]).optional().describe("Arbitration compensation"),
|
|
359
|
-
voting_deadline: z.union([z.number(), z.string()]).optional().describe("Voting deadline"),
|
|
360
|
-
objection: z.string().describe("Arbitration objection"),
|
|
361
|
-
status: ArbStatusSchema,
|
|
362
|
-
compensation_time: z.union([z.number(), z.null()]).describe("Compensation claim time"),
|
|
363
|
-
time: z.number().describe("Arbitration time"),
|
|
364
|
-
}).describe("Arb object");
|
|
365
|
-
export const DiscountTypeSchema = z.union([
|
|
366
|
-
z.enum(["RATES", "FIXED"]),
|
|
367
|
-
z.number().int().min(0).max(1).transform((n) => n === 0 ? "RATES" :
|
|
368
|
-
n === 1 ? "FIXED" :
|
|
369
|
-
"RATES"),
|
|
370
|
-
]).describe("Discount type. Accepts string ('RATES' or 'FIXED') or number (0='RATES', 1='FIXED'). If rate(0/RATES), discount is based on proportion of product amount (e.g., 1000 means 10% discount); if fixed(1/FIXED), discount is based on fixed value of product amount (e.g., 100 means 100 yuan discount). String form is recommended.");
|
|
371
|
-
export const ObjectDiscountSchema = ObjectBaseSchema.extend({
|
|
372
|
-
name: z.string().describe("Discount name"),
|
|
373
|
-
discount_type: DiscountTypeSchema.describe("Discount type. If rate(0), discount is based on proportion of product amount (e.g., 1000 means 10% discount); if fixed(1), discount is based on fixed value of product amount (e.g., 100 means 100 yuan discount)."),
|
|
374
|
-
benchmark: z.union([BalanceTypeSchema, z.null()]).describe("Discount benchmark amount. If RATES, discount is based on proportion of this amount; if MINUS, discount is based on fixed value of this amount."),
|
|
375
|
-
off: BalanceTypeSchema.describe("Discount value. If RATES, discount is based on proportion of product amount (e.g., 1000 means 10% discount); if MINUS, discount is based on fixed value of product amount (e.g., 100 means maximum 100 yuan discount)."),
|
|
376
|
-
time_start: z.union([z.string(), z.number()]).describe("Discount effective start time"),
|
|
377
|
-
time_end: z.union([z.string(), z.number()]).describe("Discount effective end time"),
|
|
378
|
-
service: z.string().describe("Parent service object ID"),
|
|
379
|
-
transferable: z.boolean().describe("Whether discount is transferable to other users"),
|
|
380
|
-
}).describe("Discount object");
|
|
381
|
-
export const AmountFromDepositGuardSchema = z.object({
|
|
382
|
-
guard: z.string().describe("Guard object ID or name"),
|
|
383
|
-
identifier: z.union([GuardIdentifierSchema, z.null()]).optional().describe("Guard Table data index, whose corresponding value is the storable amount. If null, deposit amount is unlimited."),
|
|
384
|
-
store_from_id: z.union([GuardIdentifierSchema, z.null()]).optional().describe("Guard table data index for record storage. The value at this index (address or number, including submitted values) will be stored in the record for Guard verification purposes, such as controlling operation frequency."),
|
|
385
|
-
}).describe("Guard object that needs verification during deposit");
|
|
386
|
-
export const AmountFromWithdrawGuardSchema = z.object({
|
|
387
|
-
guard: z.string().describe("Guard object ID or name"),
|
|
388
|
-
identifier: z.number().describe("Guard Table data index, whose corresponding value is the withdrawable amount."),
|
|
389
|
-
store_from_id: z.union([GuardIdentifierSchema, z.null()]).optional().describe("Guard table data index for record storage. The value at this index (address or number, including submitted values) will be stored in the record for Guard verification purposes, such as controlling operation frequency."),
|
|
390
|
-
}).describe("Guard object that needs verification during withdrawal");
|
|
391
|
-
export const ObjectTreasurySchema = ObjectBaseSchema.extend({
|
|
392
|
-
description: z.string().describe("Treasury object description"),
|
|
393
|
-
balance: BalanceTypeSchema.describe("Current balance"),
|
|
394
|
-
history_count: z.number().describe("Transaction record count. Use 'query_table' or 'query_table_item' to get 'TreasuryRecord' table items."),
|
|
395
|
-
external_deposit_guard: z.array(AmountFromDepositGuardSchema).describe("Guard object list that can be verified for non-permissioned users during deposit"),
|
|
396
|
-
external_withdraw_guard: z.array(AmountFromWithdrawGuardSchema).describe("Guard object list that can be verified for non-permissioned users during withdrawal"),
|
|
397
|
-
inflow: BalanceTypeSchema.describe("Inflow amount"),
|
|
398
|
-
outflow: BalanceTypeSchema.describe("Outflow amount"),
|
|
399
|
-
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
400
|
-
permission: z.string().describe("Permission object ID"),
|
|
401
|
-
}).describe("Treasury object");
|
|
402
|
-
export const TreasuryOpSchema = z.enum(["Withdraw", "Deposit", "Receive"]).describe("Treasury object operation type");
|
|
403
|
-
export const TreasuryRecordSchema = z.object({
|
|
404
|
-
op: TreasuryOpSchema.describe("Treasury object operation type"),
|
|
405
|
-
signer: z.string().describe("Operator user ID"),
|
|
406
|
-
external_guard: z.union([z.string(), z.null()]).describe("External Guard object ID. If null, operation was completed through Permission object permissions."),
|
|
407
|
-
amount: BalanceTypeSchema.describe("Operation amount"),
|
|
408
|
-
time: z.union([z.number(), z.string()]).describe("Operation time"),
|
|
409
|
-
store_from_id: z.union([z.string(), z.null()]).describe("Stored value from Guard table. This stores the value (address or number converted to address, including submitted values) from the Guard table at the specified index for Guard verification purposes."),
|
|
410
|
-
}).describe("Treasury object transaction record");
|
|
411
|
-
export const PolicyWriteGuardSchema = z.object({
|
|
412
|
-
guard: z.string().describe("Guard object ID"),
|
|
413
|
-
id_from_submission: GuardIdentifierSchema.optional().describe("Guard Table data index, whose corresponding value (or address) is the ID of the data to be written. If null, user must specify the ID separately."),
|
|
414
|
-
data_from_submission: GuardIdentifierSchema.optional().describe("Guard Table data index, whose corresponding value is the data to be written. If null, user must specify the data separately."),
|
|
415
|
-
}).describe("Guard object that needs verification when writing policy");
|
|
416
|
-
export const IdFromSchema = z.union([
|
|
417
|
-
z.literal(0).describe("None (0)"),
|
|
418
|
-
z.literal(1).describe("Clock (1)"),
|
|
419
|
-
z.literal(2).describe("Signer (2)"),
|
|
420
|
-
z.literal("None").describe("None"),
|
|
421
|
-
z.literal("Clock").describe("Clock"),
|
|
422
|
-
z.literal("Signer").describe("Signer"),
|
|
423
|
-
z.literal("none").describe("none"),
|
|
424
|
-
z.literal("clock").describe("clock"),
|
|
425
|
-
z.literal("signer").describe("signer"),
|
|
426
|
-
]).describe("Source of data ID when writing data. Can be specified as a string name (e.g., 'Clock', 'clock', 'Signer', 'signer') or a number (0-2). Supported values: None=0/'None'/'none', Clock=1/'Clock'/'clock', Signer=2/'Signer'/'signer'. If None, user must specify the ID separately; if Clock, data ID is current timestamp; if Signer, data ID is user ID.");
|
|
427
|
-
export const PolicyRuleSchema = z.object({
|
|
428
|
-
name: z.string().describe("Policy rule name"),
|
|
429
|
-
description: z.string().describe("Policy rule description"),
|
|
430
|
-
write_guard: z.array(PolicyWriteGuardSchema).describe("Guard object list that can be verified when writing data"),
|
|
431
|
-
quote_guard: z.union([z.string(), z.null()]).optional().describe("Guard object ID that needs verification when referencing this policy data on-chain (e.g., verifying if user has paid subscription). If null, no verification is needed for on-chain references. The Guard must have empty 'relies' field and 'rep' field true."),
|
|
432
|
-
id_from: IdFromSchema.describe("Source of data ID when writing data. If None, user must specify the ID separately; if Clock, data ID is current timestamp; if Signer, data ID is user ID."),
|
|
433
|
-
value_type: ValueTypeSchema.describe("Type of data value when writing data."),
|
|
434
|
-
});
|
|
435
|
-
export const TableItem_RepositoryDataSchema = ObjectBaseSchema.extend({
|
|
436
|
-
entity: z.string().describe("Object or user ID"),
|
|
437
|
-
name: z.string().describe("Data item name (Policy Name)"),
|
|
438
|
-
value: z.array(z.number()).describe("Raw data value (first byte is value type, remaining bytes are Bcs formatted value)"),
|
|
439
|
-
data: z.object({
|
|
440
|
-
value_type: ValueTypeSchema.describe("Type of data value."),
|
|
441
|
-
value: SupportedValueSchema.describe("Data value."),
|
|
442
|
-
}),
|
|
443
|
-
}).describe("Storage data item owned by Repository object");
|
|
444
|
-
export const TableItem_RewardRecordSchema = ObjectBaseSchema.extend({
|
|
445
|
-
recipient: z.string().describe("Reward recipient ID"),
|
|
446
|
-
guard: z.string().describe("Guard object ID"),
|
|
447
|
-
total: BalanceTypeSchema.describe("Total reward amount"),
|
|
448
|
-
record: z.array(z.object({
|
|
449
|
-
amount: BalanceTypeSchema.describe("Reward amount"),
|
|
450
|
-
time: tolerantNumber.describe("Reward time"),
|
|
451
|
-
store_from_id: tolerantStringNullable.describe("Stored value from Guard table. This stores the value (address or number converted to address, including submitted values) from the Guard table at the specified index for Guard verification purposes."),
|
|
452
|
-
})).describe("Reward record list"),
|
|
453
|
-
}).describe("Reward object's reward record");
|
|
454
|
-
export const ObjectRepositorySchema = ObjectBaseSchema.extend({
|
|
455
|
-
description: z.string().describe("Repository object description"),
|
|
456
|
-
policies: z.array(PolicyRuleSchema).describe("Repository object policy rule list"),
|
|
457
|
-
data_count: z.number().describe("Number of data items stored in Repository object. Use 'query_table' or 'query_table_item' to get 'RepositoryData' table items."),
|
|
458
|
-
rewards: z.array(z.string()).describe("Reward object list"),
|
|
459
|
-
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
460
|
-
permission: z.string().describe("Permission object ID"),
|
|
461
|
-
}).describe("Repository object");
|
|
462
|
-
export const ImSchema = z.object({
|
|
463
|
-
at: z.string().describe("Contact's account address for instant messaging"),
|
|
464
|
-
status: z.string().describe("Contact's current status message"),
|
|
465
|
-
join_time: z.number().describe("Timestamp when contact joined (milliseconds since epoch)"),
|
|
466
|
-
description: z.string().describe("Description or note about this contact"),
|
|
467
|
-
}).describe("Instant Messaging contact entry with address, status, and metadata");
|
|
468
|
-
export const ObjectContactSchema = ObjectBaseSchema.extend({
|
|
469
|
-
description: z.string().describe("Contact object description or public information"),
|
|
470
|
-
permission: z.string().describe("Permission object ID that controls who can modify this contact"),
|
|
471
|
-
location: z.string().describe("Physical or virtual location information for this contact"),
|
|
472
|
-
ims: z.array(ImSchema).describe("List of instant messaging contacts. Each entry contains an address for encrypted real-time communication via Wowok Messenger"),
|
|
473
|
-
}).describe("Contact object storing on-chain instant messaging addresses for real-time encrypted communication between object managers and users");
|
|
474
|
-
export const ObjectPersonalSchema = ObjectBaseSchema.extend({
|
|
475
|
-
address: z.string().describe("User's address"),
|
|
476
|
-
like: z.number().describe("User's like count"),
|
|
477
|
-
dislike: z.number().describe("User's dislike count"),
|
|
478
|
-
info: z.array(RecordsInEntitySchema).describe("User's personal information record list"),
|
|
479
|
-
description: z.string().describe("User's personal description"),
|
|
480
|
-
referrer: z.union([z.string(), z.null()]).describe("User's referrer ID"),
|
|
481
|
-
mark_object: z.union([z.string(), z.null()]).describe("On-chain address mark object ID"),
|
|
482
|
-
details: z.array(VoteInEntityLinkerSchema).describe("User's voting record list in EntityLinker"),
|
|
483
|
-
active_tx: z.union([z.string(), z.null()]).describe("User's recent active transaction ID"),
|
|
484
|
-
passive_tx: z.union([z.string(), z.null()]).describe("Recent transaction ID interacting with user"),
|
|
485
|
-
time: z.number().describe("User object creation time"),
|
|
486
|
-
}).describe("Personal object");
|
|
487
|
-
export const ObjectProofSchema = ObjectBaseSchema.extend({
|
|
488
|
-
description: z.string().describe("Proof description"),
|
|
489
|
-
proof: z.string().describe("Proof content. e.g., merkle tree root"),
|
|
490
|
-
server_pubkey: z.string().describe("Server public key"),
|
|
491
|
-
server_signature: z.string().describe("Server signature"),
|
|
492
|
-
proof_type: z.union([z.number(), z.string()]).describe("Proof type. 1: WTS proof; 1-100 reserved."),
|
|
493
|
-
item_count: z.union([z.number(), z.string(), z.null()]).describe("Item count. e.g., number of items in the merkle tree"),
|
|
494
|
-
about_address: z.union([z.string(), z.null()]).describe("About address. e.g., address of the entity being proved"),
|
|
495
|
-
signer: z.string().describe("Signer address"),
|
|
496
|
-
time: z.number().describe("Proof creation time"),
|
|
497
|
-
}).describe("Proof object");
|
|
498
|
-
export const WReceivedObjectSchema = ObjectBaseSchema.extend({
|
|
499
|
-
balance: BalanceTypeSchema.describe("Amount contained in object"),
|
|
500
|
-
payment: z.string().describe("Payment object ID"),
|
|
501
|
-
}).describe("Amount object received by on-chain object");
|
|
502
|
-
export const ObjectPermissionSchema = ObjectBaseSchema.extend({
|
|
503
|
-
builder: z.string().describe("Permission object owner ID (highest permission user)"),
|
|
504
|
-
admin: z.array(z.string()).describe("Admin user ID list"),
|
|
505
|
-
description: z.string().describe("Permission object description"),
|
|
506
|
-
entity_count: z.number().describe("Number of user IDs and Guard IDs granted permissions. Use 'query_table' or 'query_table_item' to get 'PermissionPerm' table items."),
|
|
507
|
-
perm_remark: z.array(z.object({
|
|
508
|
-
index: PermissionIndexTypeSchema,
|
|
509
|
-
remark: z.string().describe("Permission item remark"),
|
|
510
|
-
})).describe("Permission item remark list"),
|
|
511
|
-
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
512
|
-
}).describe("Permission object");
|
|
513
|
-
export const WitnessTypeSchema = z.union([
|
|
514
|
-
z.number()
|
|
515
|
-
.int()
|
|
516
|
-
.refine(isWitnessType, {
|
|
517
|
-
message: 'Invalid WitnessType numeric value. Valid range: 100-108.',
|
|
518
|
-
}),
|
|
519
|
-
z.string()
|
|
520
|
-
.refine((name) => isValidWitnessType(name), {
|
|
521
|
-
message: 'Invalid WitnessType string name. Valid names: OrderProgress (100), OrderMachine (101), OrderService (102), ProgressMachine (103), ArbOrder (104), ArbArbitration (105), ArbProgress (106), ArbMachine (107), ArbService (108). Case-insensitive; "Type" prefix is optional.',
|
|
522
|
-
})
|
|
523
|
-
]).describe("When specified, the query retrieves data from the associated (witness) object instead of the queried object itself. This enables cross-object queries within Guard validation logic. Can be a numeric ID (100-108) or a string name (case-insensitive, with or without the 'Type' prefix). String format is recommended for readability.\n\nAvailable WitnessTypes:\n- OrderProgress / TypeOrderProgress (100): Query an Order's associated Progress object. Use case: Check if order has reached a specific workflow node (e.g., 'complete') before allowing reward claims.\n- OrderMachine / TypeOrderMachine (101): Query an Order's associated Machine (workflow definition). Use case: Verify the workflow structure or check node configurations.\n- OrderService / TypeOrderService (102): Query an Order's parent Service object. Use case: Validate the service offering details or check service-level configurations.\n- ProgressMachine / TypeProgressMachine (103): Query a Progress's associated Machine. Use case: Access workflow definition from a Progress context.\n- ArbOrder / TypeArbOrder (104): Query an Arb's associated Order. Use case: In arbitration voting guards, verify order details like payment amount or service ID.\n- ArbArbitration / TypeArbArbitration (105): Query an Arb's parent Arbitration service. Use case: Access arbitration configuration or fee settings from within an Arb case.\n- ArbProgress / TypeArbProgress (106): Query an Arb's associated Progress. Use case: Check order workflow state during arbitration validation.\n- ArbMachine / TypeArbMachine (107): Query an Arb's associated Machine. Use case: Access workflow definition for dispute context analysis.\n- ArbService / TypeArbService (108): Query an Arb's associated Service. Use case: Verify service terms or compensation fund status during arbitration.\n\nExample: To validate that an order has reached the 'complete' node, query the Order with convert_witness='OrderProgress' and check the Progress's current_node field.");
|
|
524
|
-
export const GuardQueryIdSchema = z.number().int().min(0).refine((id) => isValidGuardQueryId(id), { message: "Invalid guard query ID. ID not found in GUARDQUERY array." }).describe("ID of the data query instruction for the Object.");
|
|
525
|
-
export const GuardNodeSchema = z.lazy(() => z.discriminatedUnion('type', [
|
|
526
|
-
z.object({
|
|
527
|
-
type: z.literal('identifier'),
|
|
528
|
-
identifier: GuardIdentifierSchema,
|
|
529
|
-
}).strict().describe('Returns the constant value stored at the specified identifier in the Guard table.'),
|
|
530
|
-
z.object({
|
|
531
|
-
type: z.literal('query'),
|
|
532
|
-
query: z.union([
|
|
533
|
-
z.number().int().refine((id) => isValidGuardQueryId(id), { message: "Invalid guard query ID. ID not found in GUARDQUERY array." }),
|
|
534
|
-
z.string().refine((name) => isValidGuardQueryIdOrName(name), { message: "Invalid guard query name. Name not found in GUARDQUERY array (case-insensitive)." })
|
|
535
|
-
]).describe("ID or name of the wowok object data query instruction. Can be a numeric ID (e.g., 1001) or a name string (e.g., 'permission.description'). Name matching is case-insensitive."),
|
|
536
|
-
object: z.object({
|
|
537
|
-
identifier: GuardIdentifierSchema,
|
|
538
|
-
convert_witness: WitnessTypeSchema.optional(),
|
|
539
|
-
}).strict().describe("The object to query from the Guard table."),
|
|
540
|
-
parameters: z.array(GuardNodeSchema).optional().describe("Parameters required by the query. Optional — defaults to empty array []. Many queries (e.g. progress.current, order.service) take no parameters; for those, this field can be omitted."),
|
|
541
|
-
}).strict().describe(`Returns the result of executing a data query instruction on the specified object. The return type depends on the query being executed. SPECIAL NOTE for EntityLinker/EntityRegistrar queries: Use system addresses in the Guard table -${ENTITY_LINKER_ADDRESS} for EntityLinker queries, ${ENTITY_REGISTRAR_ADDRESS} for EntityRegistrar queries.`),
|
|
542
|
-
z.object({
|
|
543
|
-
type: z.literal('logic_as_u256_greater_or_equal'),
|
|
544
|
-
nodes: z.array(GuardNodeSchema),
|
|
545
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} numeric nodes (U8, U16, U32, U64, U128, U256). Computed by comparing the first node value with all subsequent node values. Returns true if first >= all others, otherwise false.`),
|
|
546
|
-
z.object({
|
|
547
|
-
type: z.literal('logic_as_u256_lesser_or_equal'),
|
|
548
|
-
nodes: z.array(GuardNodeSchema),
|
|
549
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} numeric nodes (U8, U16, U32, U64, U128, U256). Computed by comparing the first node value with all subsequent node values. Returns true if first <= all others, otherwise false.`),
|
|
550
|
-
z.object({
|
|
551
|
-
type: z.literal('logic_as_u256_greater'),
|
|
552
|
-
nodes: z.array(GuardNodeSchema),
|
|
553
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} numeric nodes (U8, U16, U32, U64, U128, U256). Computed by comparing the first node value with all subsequent node values. Returns true if first > all others, otherwise false.`),
|
|
554
|
-
z.object({
|
|
555
|
-
type: z.literal('logic_as_u256_lesser'),
|
|
556
|
-
nodes: z.array(GuardNodeSchema),
|
|
557
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} numeric nodes (U8, U16, U32, U64, U128, U256). Computed by comparing the first node value with all subsequent node values. Returns true if first < all others, otherwise false.`),
|
|
558
|
-
z.object({
|
|
559
|
-
type: z.literal('logic_as_u256_equal'),
|
|
560
|
-
nodes: z.array(GuardNodeSchema),
|
|
561
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} numeric nodes (U8, U16, U32, U64, U128, U256). Computed by comparing the first node value with all subsequent node values. Returns true if first equals all others, otherwise false.`),
|
|
562
|
-
z.object({
|
|
563
|
-
type: z.literal('logic_equal'),
|
|
564
|
-
nodes: z.array(GuardNodeSchema),
|
|
565
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} nodes of any type. Computed by comparing the first node with all subsequent nodes in both type and value. Returns true if type and value match for all, otherwise false.`),
|
|
566
|
-
z.object({
|
|
567
|
-
type: z.literal('logic_not'),
|
|
568
|
-
node: GuardNodeSchema,
|
|
569
|
-
}).strict().describe("Returns Bool. Computed by inverting the boolean value of the child node (true -> false, false -> true)."),
|
|
570
|
-
z.object({
|
|
571
|
-
type: z.literal('logic_and'),
|
|
572
|
-
nodes: z.array(GuardNodeSchema).min(2, `logic_and requires at least 2 child nodes. For a single condition, use the comparison node directly as root (e.g. logic_equal), do NOT wrap with logic_and.`).max(MAX_MULTI_OPERANDS, `logic_and allows at most ${MAX_MULTI_OPERANDS} child nodes.`),
|
|
573
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} boolean nodes. Computed by performing logical AND on all child node values. Returns true if ALL are true, otherwise false.`),
|
|
574
|
-
z.object({
|
|
575
|
-
type: z.literal('logic_or'),
|
|
576
|
-
nodes: z.array(GuardNodeSchema).min(2, `logic_or requires at least 2 child nodes. For a single condition, use the comparison node directly as root (e.g. logic_equal), do NOT wrap with logic_or.`).max(MAX_MULTI_OPERANDS, `logic_or allows at most ${MAX_MULTI_OPERANDS} child nodes.`),
|
|
577
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} boolean nodes. Computed by performing logical OR on all child node values. Returns true if ANY is true, otherwise false.`),
|
|
578
|
-
z.object({
|
|
579
|
-
type: z.literal('logic_string_contains'),
|
|
580
|
-
nodes: z.array(GuardNodeSchema),
|
|
581
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} string nodes. The first node is the haystack, all subsequent nodes are needles. Returns true if all needles are substrings of the haystack, otherwise false. Case-sensitive.`),
|
|
582
|
-
z.object({
|
|
583
|
-
type: z.literal('logic_string_nocase_contains'),
|
|
584
|
-
nodes: z.array(GuardNodeSchema),
|
|
585
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} string nodes. The first node is the haystack, all subsequent nodes are needles. Returns true if all needles are substrings of the haystack, otherwise false. Case-insensitive.`),
|
|
586
|
-
z.object({
|
|
587
|
-
type: z.literal('logic_string_nocase_equal'),
|
|
588
|
-
nodes: z.array(GuardNodeSchema),
|
|
589
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} string nodes. Computed by comparing the first node with all subsequent nodes as strings, ignoring case. Returns true if all are equal, otherwise false.`),
|
|
590
|
-
z.object({
|
|
591
|
-
type: z.literal('calc_number_add'),
|
|
592
|
-
nodes: z.array(GuardNodeSchema),
|
|
593
|
-
}).strict().describe(`Returns U256. Requires 2-${MAX_MULTI_OPERANDS} numeric nodes (U8, U16, U32, U64, U128, U256). Computed by adding the first node value with all subsequent node values in sequence (first + second + third + ...).`),
|
|
594
|
-
z.object({
|
|
595
|
-
type: z.literal('calc_number_multiply'),
|
|
596
|
-
nodes: z.array(GuardNodeSchema),
|
|
597
|
-
}).strict().describe(`Returns U256. Requires 2-${MAX_MULTI_OPERANDS} numeric nodes (U8, U16, U32, U64, U128, U256). Computed by multiplying the first node value with all subsequent node values in sequence (first * second * third * ...).`),
|
|
598
|
-
z.object({
|
|
599
|
-
type: z.literal('calc_number_subtract'),
|
|
600
|
-
nodes: z.array(GuardNodeSchema),
|
|
601
|
-
}).strict().describe(`Returns U256. Requires 2-${MAX_MULTI_OPERANDS} numeric nodes (U8, U16, U32, U64, U128, U256). Computed by subtracting the second node value from the first node value in sequence, then continuing with each subsequent node (first - second - third - ...).`),
|
|
602
|
-
z.object({
|
|
603
|
-
type: z.literal('calc_number_divide'),
|
|
604
|
-
nodes: z.array(GuardNodeSchema),
|
|
605
|
-
}).strict().describe(`Returns U256. Requires 2-${MAX_MULTI_OPERANDS} numeric nodes (U8, U16, U32, U64, U128, U256). Computed by dividing the first node value by the second node value in sequence, then continuing with each subsequent node ((first / second) / third / ...). Throws exception if any divisor is zero.`),
|
|
606
|
-
z.object({
|
|
607
|
-
type: z.literal('calc_number_mod'),
|
|
608
|
-
nodes: z.array(GuardNodeSchema),
|
|
609
|
-
}).strict().describe(`Returns U256. Requires 2-${MAX_MULTI_OPERANDS} numeric nodes (U8, U16, U32, U64, U128, U256). Computed by taking the remainder of dividing the first node value by the second node value in sequence, then continuing with each subsequent node ((first % second) % third % ...). Throws exception if any divisor is zero.`),
|
|
610
|
-
z.object({
|
|
611
|
-
type: z.literal('calc_string_length'),
|
|
612
|
-
node: GuardNodeSchema,
|
|
613
|
-
}).strict().describe("Returns U64. Computed by getting the length (number of UTF-8 bytes) of the child node value."),
|
|
614
|
-
z.object({
|
|
615
|
-
type: z.literal('calc_string_nocase_contains'),
|
|
616
|
-
nodes: z.array(GuardNodeSchema),
|
|
617
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} string nodes. The first node is the haystack, all subsequent nodes are needles. Returns true if all needles are substrings of the haystack, otherwise false. Case-insensitive.`),
|
|
618
|
-
z.object({
|
|
619
|
-
type: z.literal('calc_string_nocase_equal'),
|
|
620
|
-
nodes: z.array(GuardNodeSchema),
|
|
621
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} string nodes. Computed by comparing the first node with all subsequent nodes as strings, ignoring case. Returns true if all are equal, otherwise false.`),
|
|
622
|
-
z.object({
|
|
623
|
-
type: z.literal('calc_string_contains'),
|
|
624
|
-
nodes: z.array(GuardNodeSchema),
|
|
625
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} string nodes. The first node is the haystack, all subsequent nodes are needles. Returns true if all needles are substrings of the haystack, otherwise false. Case-sensitive.`),
|
|
626
|
-
z.object({
|
|
627
|
-
type: z.literal('calc_string_indexof'),
|
|
628
|
-
nodeLeft: GuardNodeSchema,
|
|
629
|
-
nodeRight: GuardNodeSchema,
|
|
630
|
-
order: z.enum(['forward', 'backward']).describe("'forward' searches from start to end, 'backward' searches from end to start."),
|
|
631
|
-
}).strict().describe("Returns U64. Computed by searching for the second node (needle) in the first node (haystack). Returns index of first occurrence in the specified direction. If not found, returns u64::MAX (18446744073709551615)."),
|
|
632
|
-
z.object({
|
|
633
|
-
type: z.literal('calc_string_nocase_indexof'),
|
|
634
|
-
nodeLeft: GuardNodeSchema,
|
|
635
|
-
nodeRight: GuardNodeSchema,
|
|
636
|
-
order: z.enum(['forward', 'backward']).describe("'forward' searches from start to end, 'backward' searches from end to start."),
|
|
637
|
-
}).strict().describe("Returns U64. Computed by searching for the second node (needle) in the first node (haystack), ignoring case. Returns index of first occurrence in the specified direction. If not found, returns u64::MAX (18446744073709551615)."),
|
|
638
|
-
z.object({
|
|
639
|
-
type: z.literal('convert_number_address'),
|
|
640
|
-
node: GuardNodeSchema,
|
|
641
|
-
}).strict().describe("Returns Address. Computed by converting the child node value from number type to Address type."),
|
|
642
|
-
z.object({
|
|
643
|
-
type: z.literal('convert_address_number'),
|
|
644
|
-
node: GuardNodeSchema,
|
|
645
|
-
}).strict().describe("Returns U256. Computed by converting the child node value from Address type to number type."),
|
|
646
|
-
z.object({
|
|
647
|
-
type: z.literal('convert_number_string'),
|
|
648
|
-
node: GuardNodeSchema,
|
|
649
|
-
}).strict().describe("Returns String. Computed by converting the child node value from number type to string type."),
|
|
650
|
-
z.object({
|
|
651
|
-
type: z.literal('convert_string_number'),
|
|
652
|
-
node: GuardNodeSchema,
|
|
653
|
-
}).strict().describe("Returns U256. Computed by parsing the child node value as a number. Throws exception if the string is not a valid number."),
|
|
654
|
-
z.object({
|
|
655
|
-
type: z.literal('convert_safe_u8'),
|
|
656
|
-
node: GuardNodeSchema,
|
|
657
|
-
}).strict().describe("Returns U8. Computed by converting the child node value to U8. Throws exception if value is out of U8 range (0-255)."),
|
|
658
|
-
z.object({
|
|
659
|
-
type: z.literal('convert_safe_u16'),
|
|
660
|
-
node: GuardNodeSchema,
|
|
661
|
-
}).strict().describe("Returns U16. Computed by converting the child node value to U16. Throws exception if value is out of U16 range (0-65535)."),
|
|
662
|
-
z.object({
|
|
663
|
-
type: z.literal('convert_safe_u32'),
|
|
664
|
-
node: GuardNodeSchema,
|
|
665
|
-
}).strict().describe("Returns U32. Computed by converting the child node value to U32. Throws exception if value is out of U32 range."),
|
|
666
|
-
z.object({
|
|
667
|
-
type: z.literal('convert_safe_u64'),
|
|
668
|
-
node: GuardNodeSchema,
|
|
669
|
-
}).strict().describe("Returns U64. Computed by converting the child node value to U64. Throws exception if value is out of U64 range."),
|
|
670
|
-
z.object({
|
|
671
|
-
type: z.literal('convert_safe_u128'),
|
|
672
|
-
node: GuardNodeSchema,
|
|
673
|
-
}).strict().describe("Returns U128. Computed by converting the child node value to U128. Throws exception if value is out of U128 range."),
|
|
674
|
-
z.object({
|
|
675
|
-
type: z.literal('convert_safe_u256'),
|
|
676
|
-
node: GuardNodeSchema,
|
|
677
|
-
}).strict().describe("Returns U256. Computed by converting the child node value to U256."),
|
|
678
|
-
z.object({
|
|
679
|
-
type: z.literal('value_type'),
|
|
680
|
-
node: GuardNodeSchema,
|
|
681
|
-
}).strict().describe(`Returns U8. Computed by getting the type identifier (ValueType) of the child node value. ${VALUE_TYPE_DESCRIPTION}`),
|
|
682
|
-
z.object({
|
|
683
|
-
type: z.literal('vec_length'),
|
|
684
|
-
node: GuardNodeSchema,
|
|
685
|
-
}).strict().describe(`Returns U64. Computed by getting the length of the vector in the child node value. Child node must be one of Vec types: VecBool=9, VecAddress=10, VecString=11, VecU8=12, VecU16=13, VecU32=14, VecU64=15, VecU128=16, VecU256=17, VecVecU8=18, Value=19.`),
|
|
686
|
-
z.object({
|
|
687
|
-
type: z.literal('vec_contains_bool'),
|
|
688
|
-
nodes: z.array(GuardNodeSchema).describe(`2 to ${MAX_MULTI_OPERANDS} nodes required. First node must be VecBool (ValueType=9) or Value (ValueType=19), remaining nodes must be Bool (ValueType=0) or Value (ValueType=19).`),
|
|
689
|
-
}).strict().describe("Returns Bool. Computed by checking if the vector (first node) contains ALL boolean values (subsequent nodes)."),
|
|
690
|
-
z.object({
|
|
691
|
-
type: z.literal('vec_contains_address'),
|
|
692
|
-
nodes: z.array(GuardNodeSchema).describe(`2 to ${MAX_MULTI_OPERANDS} nodes required. First node must be VecAddress (ValueType=10) or Value (ValueType=19), remaining nodes must be Address (ValueType=1) or Value (ValueType=19).`),
|
|
693
|
-
}).strict().describe("Returns Bool. Computed by checking if the vector (first node) contains ALL address values (subsequent nodes)."),
|
|
694
|
-
z.object({
|
|
695
|
-
type: z.literal('vec_contains_string'),
|
|
696
|
-
nodes: z.array(GuardNodeSchema).describe(`2 to ${MAX_MULTI_OPERANDS} nodes required. First node must be VecString (ValueType=11) or Value (ValueType=19), remaining nodes must be String (ValueType=2) or Value (ValueType=19).`),
|
|
697
|
-
}).strict().describe("Returns Bool. Computed by checking if the vector (first node) contains ALL string values (subsequent nodes)."),
|
|
698
|
-
z.object({
|
|
699
|
-
type: z.literal('vec_contains_string_nocase'),
|
|
700
|
-
nodes: z.array(GuardNodeSchema).describe(`2 to ${MAX_MULTI_OPERANDS} nodes required. First node must be VecString (ValueType=11) or Value (ValueType=19), remaining nodes must be String (ValueType=2) or Value (ValueType=19).`),
|
|
701
|
-
}).strict().describe("Returns Bool. Computed by checking if the vector (first node) contains ALL string values (subsequent nodes), using case-insensitive comparison."),
|
|
702
|
-
z.object({
|
|
703
|
-
type: z.literal('vec_contains_number'),
|
|
704
|
-
nodes: z.array(GuardNodeSchema).describe(`2 to ${MAX_MULTI_OPERANDS} nodes required. First node must be VecU8 (12), VecU16 (13), VecU32 (14), VecU64 (15), VecU128 (16), VecU256 (17) or Value (ValueType=19), remaining nodes must be U8 (3), U16 (4), U32 (5), U64 (6), U128 (7), U256 (8) or Value (ValueType=19).`),
|
|
705
|
-
}).strict().describe("Returns Bool. Computed by checking if the vector (first node) contains ALL number values (subsequent nodes)."),
|
|
706
|
-
z.object({
|
|
707
|
-
type: z.literal('vec_indexof_bool'),
|
|
708
|
-
nodeLeft: GuardNodeSchema,
|
|
709
|
-
nodeRight: GuardNodeSchema,
|
|
710
|
-
order: z.enum(['forward', 'backward']).describe("'forward' searches from index 0, 'backward' searches from last index."),
|
|
711
|
-
}).strict().describe("Returns U64. Computed by searching for the second node value in the vector (first node). nodeLeft must be VecBool (ValueType=9) or Value (ValueType=19) type, nodeRight must be Bool (ValueType=0) or Value (ValueType=19) type. Returns index of first occurrence in the specified direction. If not found, returns u64::MAX (18446744073709551615)."),
|
|
712
|
-
z.object({
|
|
713
|
-
type: z.literal('vec_indexof_address'),
|
|
714
|
-
nodeLeft: GuardNodeSchema,
|
|
715
|
-
nodeRight: GuardNodeSchema,
|
|
716
|
-
order: z.enum(['forward', 'backward']).describe("'forward' searches from index 0, 'backward' searches from last index."),
|
|
717
|
-
}).strict().describe("Returns U64. Computed by searching for the second node value in the vector (first node). nodeLeft must be VecAddress (ValueType=10) or Value (ValueType=19) type, nodeRight must be Address (ValueType=1) or Value (ValueType=19) type. Returns index of first occurrence in the specified direction. If not found, returns u64::MAX (18446744073709551615)."),
|
|
718
|
-
z.object({
|
|
719
|
-
type: z.literal('vec_indexof_string'),
|
|
720
|
-
nodeLeft: GuardNodeSchema,
|
|
721
|
-
nodeRight: GuardNodeSchema,
|
|
722
|
-
order: z.enum(['forward', 'backward']).describe("'forward' searches from index 0, 'backward' searches from last index."),
|
|
723
|
-
}).strict().describe("Returns U64. Computed by searching for the second node value in the vector (first node). nodeLeft must be VecString (ValueType=11) or Value (ValueType=19) type, nodeRight must be String (ValueType=2) or Value (ValueType=19) type. Returns index of first occurrence in the specified direction. If not found, returns u64::MAX (18446744073709551615)."),
|
|
724
|
-
z.object({
|
|
725
|
-
type: z.literal('vec_indexof_string_nocase'),
|
|
726
|
-
nodeLeft: GuardNodeSchema,
|
|
727
|
-
nodeRight: GuardNodeSchema,
|
|
728
|
-
order: z.enum(['forward', 'backward']).describe("'forward' searches from index 0, 'backward' searches from last index."),
|
|
729
|
-
}).strict().describe("Returns U64. Computed by searching for the second node value in the vector (first node), using case-insensitive comparison. nodeLeft must be VecString (ValueType=11) or Value (ValueType=19) type, nodeRight must be String (ValueType=2) or Value (ValueType=19) type. Returns index of first occurrence in the specified direction. If not found, returns u64::MAX (18446744073709551615)."),
|
|
730
|
-
z.object({
|
|
731
|
-
type: z.literal('vec_indexof_number'),
|
|
732
|
-
nodeLeft: GuardNodeSchema,
|
|
733
|
-
nodeRight: GuardNodeSchema,
|
|
734
|
-
order: z.enum(['forward', 'backward']).describe("'forward' searches from index 0, 'backward' searches from last index."),
|
|
735
|
-
}).strict().describe("Returns U64. Computed by searching for the second node value in the vector (first node). nodeLeft must be VecU8 (12), VecU16 (13), VecU32 (14), VecU64 (15), VecU128 (16), VecU256 (17) or Value (ValueType=19) type, nodeRight must be U8 (3), U16 (4), U32 (5), U64 (6), U128 (7), U256 (8) or Value (ValueType=19) type. Returns index of first occurrence in the specified direction. If not found, returns u64::MAX (18446744073709551615)."),
|
|
736
|
-
z.object({
|
|
737
|
-
type: z.literal('context'),
|
|
738
|
-
context: z.enum(['Signer', 'Clock', 'Guard']).describe("System context type: Signer returns transaction sender address (Address), Clock returns current on-chain timestamp (U64), Guard returns current Guard object ID (Address)."),
|
|
739
|
-
}).strict().describe("Signer returns transaction sender address (Address), Clock returns current on-chain timestamp (U64), Guard returns current Guard object ID (Address)."),
|
|
740
|
-
z.object({
|
|
741
|
-
type: z.literal('query_reward_record_find'),
|
|
742
|
-
object: z.object({
|
|
743
|
-
identifier: GuardIdentifierSchema,
|
|
744
|
-
}).strict().describe("Reference to the Reward object in the Guard table (must be Address type)."),
|
|
745
|
-
find: z.enum(['first', 'last']).describe("'first' finds the earliest matching record, 'last' finds the most recent matching record."),
|
|
746
|
-
recipient: z.object({
|
|
747
|
-
identifier: GuardIdentifierSchema,
|
|
748
|
-
}).strict().optional().describe("Optional: Identifier reference to the recipient address in the Guard table (must be Address type). If not specified, uses the transaction signer address."),
|
|
749
|
-
where: z.object({
|
|
750
|
-
guard: z.string().optional().describe("Optional filter: Guard object address constant to match."),
|
|
751
|
-
timeMin: z.string().optional().describe("Optional filter: minimum timestamp (inclusive) for record creation time. Use string to represent U64 value."),
|
|
752
|
-
timeMax: z.string().optional().describe("Optional filter: maximum timestamp (inclusive) for record creation time. Use string to represent U64 value."),
|
|
753
|
-
amountMin: z.string().optional().describe("Optional filter: minimum reward amount (inclusive). Use string to represent U64 value."),
|
|
754
|
-
amountMax: z.string().optional().describe("Optional filter: maximum reward amount (inclusive). Use string to represent U64 value."),
|
|
755
|
-
storeFromId: z.object({
|
|
756
|
-
identifier: GuardIdentifierSchema,
|
|
757
|
-
}).strict().optional().describe("Optional filter: identifier reference to the store_from_id address in the Guard table (must be Address type). If not specified, the store_from_id field is ignored during matching. The server resolves this identifier to the actual address from the Guard table constants."),
|
|
758
|
-
}).strict().describe("Filter conditions for the reward record query."),
|
|
759
|
-
}).strict().describe("Returns U64. Finds the index of the first or last reward record matching the specified recipient and filter conditions. Returns the record index (U64) if found. Throws error if no matching record is found (Guard validation fails). If recipient is not specified, uses the transaction signer address."),
|
|
760
|
-
z.object({
|
|
761
|
-
type: z.literal('query_reward_record_count'),
|
|
762
|
-
object: z.object({
|
|
763
|
-
identifier: GuardIdentifierSchema,
|
|
764
|
-
}).strict().describe("Reference to the Reward object in the Guard table (must be Address type)."),
|
|
765
|
-
recipient: z.object({
|
|
766
|
-
identifier: GuardIdentifierSchema,
|
|
767
|
-
}).strict().optional().describe("Optional: Identifier reference to the recipient address in the Guard table (must be Address type). If not specified, uses the transaction signer address."),
|
|
768
|
-
where: z.object({
|
|
769
|
-
guard: z.string().optional().describe("Optional filter: Guard object address constant to match."),
|
|
770
|
-
timeMin: z.string().optional().describe("Optional filter: minimum timestamp (inclusive) for record creation time. Use string to represent U64 value."),
|
|
771
|
-
timeMax: z.string().optional().describe("Optional filter: maximum timestamp (inclusive) for record creation time. Use string to represent U64 value."),
|
|
772
|
-
amountMin: z.string().optional().describe("Optional filter: minimum reward amount (inclusive). Use string to represent U64 value."),
|
|
773
|
-
amountMax: z.string().optional().describe("Optional filter: maximum reward amount (inclusive). Use string to represent U64 value."),
|
|
774
|
-
storeFromId: z.object({
|
|
775
|
-
identifier: GuardIdentifierSchema,
|
|
776
|
-
}).strict().optional().describe("Optional filter: identifier reference to the store_from_id address in the Guard table (must be Address type). If not specified, the store_from_id field is ignored during matching. The server resolves this identifier to the actual address from the Guard table constants."),
|
|
777
|
-
}).strict().describe("Filter conditions for the reward record count query."),
|
|
778
|
-
}).strict().describe("Returns U64. Counts the number of reward records matching the specified recipient and filter conditions. If recipient is not specified, uses the transaction signer address."),
|
|
779
|
-
z.object({
|
|
780
|
-
type: z.literal('query_reward_record_exists'),
|
|
781
|
-
object: z.object({
|
|
782
|
-
identifier: GuardIdentifierSchema,
|
|
783
|
-
}).strict().describe("Reference to the Reward object in the Guard table (must be Address type)."),
|
|
784
|
-
recipient: z.object({
|
|
785
|
-
identifier: GuardIdentifierSchema,
|
|
786
|
-
}).strict().optional().describe("Optional: Identifier reference to the recipient address in the Guard table (must be Address type). If not specified, uses the transaction signer address."),
|
|
787
|
-
where: z.object({
|
|
788
|
-
guard: z.string().optional().describe("Optional filter: Guard object address constant to match."),
|
|
789
|
-
timeMin: z.string().optional().describe("Optional filter: minimum timestamp (inclusive) for record creation time. Use string to represent U64 value."),
|
|
790
|
-
timeMax: z.string().optional().describe("Optional filter: maximum timestamp (inclusive) for record creation time. Use string to represent U64 value."),
|
|
791
|
-
amountMin: z.string().optional().describe("Optional filter: minimum reward amount (inclusive). Use string to represent U64 value."),
|
|
792
|
-
amountMax: z.string().optional().describe("Optional filter: maximum reward amount (inclusive). Use string to represent U64 value."),
|
|
793
|
-
storeFromId: z.object({
|
|
794
|
-
identifier: GuardIdentifierSchema,
|
|
795
|
-
}).strict().optional().describe("Optional filter: identifier reference to the store_from_id address in the Guard table (must be Address type). If not specified, the store_from_id field is ignored during matching. The server resolves this identifier to the actual address from the Guard table constants."),
|
|
796
|
-
}).strict().describe("Filter conditions for the reward record existence query."),
|
|
797
|
-
}).strict().describe("Returns Bool. Returns true if at least one reward record exists matching the specified recipient and filter conditions, otherwise false. If recipient is not specified, uses the transaction signer address."),
|
|
798
|
-
z.object({
|
|
799
|
-
type: z.literal('query_progress_history_find'),
|
|
800
|
-
object: z.object({
|
|
801
|
-
identifier: GuardIdentifierSchema,
|
|
802
|
-
}).strict().describe("Reference to the Progress object in the Guard table (must be Address type)."),
|
|
803
|
-
where: z.object({
|
|
804
|
-
node: z.string().optional().describe("Optional filter: node name string to match."),
|
|
805
|
-
nextNode: z.string().optional().describe("Optional filter: next node name string to match."),
|
|
806
|
-
timeMin: z.string().optional().describe("Optional filter: minimum timestamp (inclusive) for history entry time. Use string to represent U64 value."),
|
|
807
|
-
timeMax: z.string().optional().describe("Optional filter: maximum timestamp (inclusive) for history entry time. Use string to represent U64 value."),
|
|
808
|
-
indexMin: z.string().optional().describe("Optional filter: minimum history index (inclusive) to search within. Use string to represent U64 value."),
|
|
809
|
-
indexMax: z.string().optional().describe("Optional filter: maximum history index (inclusive) to search within. Use string to represent U64 value."),
|
|
810
|
-
}).strict().describe("Filter conditions for the progress history query."),
|
|
811
|
-
find: z.enum(['first', 'last']).describe("'first' finds the earliest matching history entry, 'last' finds the most recent matching history entry."),
|
|
812
|
-
}).strict().describe("Returns U64. Finds the index of the first or last history entry matching the filter conditions. Returns the history index (U64) if found. Throws error if no matching entry is found (Guard validation fails)."),
|
|
813
|
-
z.object({
|
|
814
|
-
type: z.literal('query_progress_history_session_find'),
|
|
815
|
-
object: z.object({
|
|
816
|
-
identifier: GuardIdentifierSchema,
|
|
817
|
-
}).strict().describe("Reference to the Progress object in the Guard table (must be Address type)."),
|
|
818
|
-
historyIdx: GuardNodeSchema.describe("GuardNode that returns the history index (U64 type) to search within. Typically an 'identifier' node referencing a U64 value from the Guard table."),
|
|
819
|
-
where: z.object({
|
|
820
|
-
nextNode: z.string().optional().describe("Optional filter: next node name string to match."),
|
|
821
|
-
}).strict().describe("Filter conditions for the progress history session query."),
|
|
822
|
-
find: z.enum(['first', 'last']).describe("'first' finds the earliest matching session, 'last' finds the most recent matching session."),
|
|
823
|
-
}).strict().describe("Returns U64. Finds the index of the first or last session within the specified history entry matching the filter conditions. Returns the session index (U64) if found. Throws error if no matching session is found (Guard validation fails)."),
|
|
824
|
-
z.object({
|
|
825
|
-
type: z.literal('query_progress_history_session_forward_find'),
|
|
826
|
-
object: z.object({
|
|
827
|
-
identifier: GuardIdentifierSchema,
|
|
828
|
-
}).strict().describe("Reference to the Progress object in the Guard table (must be Address type)."),
|
|
829
|
-
historyIdx: GuardNodeSchema.describe("GuardNode that returns the history index (U64 type). Typically an 'identifier' node referencing a U64 value from the Guard table."),
|
|
830
|
-
sessionIdx: GuardNodeSchema.describe("GuardNode that returns the session index (U64 type) within the history entry. Typically an 'identifier' node referencing a U64 value from the Guard table."),
|
|
831
|
-
where: z.object({
|
|
832
|
-
who: z.string().optional().describe("Optional filter: operator address string to match."),
|
|
833
|
-
operation: z.string().optional().describe("Optional filter: operation name string to match."),
|
|
834
|
-
accomplished: z.boolean().optional().describe("Optional filter: whether the forward operation was accomplished."),
|
|
835
|
-
timeMin: z.string().optional().describe("Optional filter: minimum timestamp (inclusive) for forward operation time. Use string to represent U64 value."),
|
|
836
|
-
timeMax: z.string().optional().describe("Optional filter: maximum timestamp (inclusive) for forward operation time. Use string to represent U64 value."),
|
|
837
|
-
}).strict().describe("Filter conditions for the progress history session forward query."),
|
|
838
|
-
find: z.enum(['first', 'last']).describe("'first' finds the earliest matching forward operation, 'last' finds the most recent matching forward operation."),
|
|
839
|
-
}).strict().describe("Returns U64. Finds the index of the first or last forward operation within the specified history session matching the filter conditions. Returns the forward index (U64) if found. Throws error if no matching forward operation is found (Guard validation fails)."),
|
|
840
|
-
z.object({
|
|
841
|
-
type: z.literal('query_progress_history_session_count'),
|
|
842
|
-
object: z.object({
|
|
843
|
-
identifier: GuardIdentifierSchema,
|
|
844
|
-
}).strict().describe("Reference to the Progress object in the Guard table (must be Address type)."),
|
|
845
|
-
historyIdx: GuardNodeSchema.describe("GuardNode that returns the history index (U64 type) to count sessions for. Typically an 'identifier' node referencing a U64 value from the Guard table."),
|
|
846
|
-
}).strict().describe("Returns U64. Counts the number of sessions within the specified history entry."),
|
|
847
|
-
z.object({
|
|
848
|
-
type: z.literal('query_progress_history_session_forward_count'),
|
|
849
|
-
object: z.object({
|
|
850
|
-
identifier: GuardIdentifierSchema,
|
|
851
|
-
}).strict().describe("Reference to the Progress object in the Guard table (must be Address type)."),
|
|
852
|
-
historyIdx: GuardNodeSchema.describe("GuardNode that returns the history index (U64 type). Typically an 'identifier' node referencing a U64 value from the Guard table."),
|
|
853
|
-
sessionIdx: GuardNodeSchema.describe("GuardNode that returns the session index (U64 type) within the history entry. Typically an 'identifier' node referencing a U64 value from the Guard table."),
|
|
854
|
-
}).strict().describe("Returns U64. Counts the number of forward operations within the specified history session."),
|
|
855
|
-
z.object({
|
|
856
|
-
type: z.literal('query_progress_history_session_forward_retained_submission_count'),
|
|
857
|
-
object: z.object({
|
|
858
|
-
identifier: GuardIdentifierSchema,
|
|
859
|
-
}).strict().describe("Reference to the Progress object in the Guard table (must be Address type)."),
|
|
860
|
-
historyIdx: GuardNodeSchema.describe("GuardNode that returns the history index (U64 type). Typically an 'identifier' node referencing a U64 value from the Guard table."),
|
|
861
|
-
sessionIdx: GuardNodeSchema.describe("GuardNode that returns the session index (U64 type) within the history entry. Typically an 'identifier' node referencing a U64 value from the Guard table."),
|
|
862
|
-
forwardIdx: GuardNodeSchema.describe("GuardNode that returns the forward operation index (U64 type) within the session. Typically an 'identifier' node referencing a U64 value from the Guard table."),
|
|
863
|
-
}).strict().describe("Returns U64. Counts the number of retained submissions within the specified forward operation.")
|
|
864
|
-
])).describe("Guard node: represents an operation instruction in Guard. Each node returns a value of a specific type, computed from its child nodes or context.");
|
|
865
|
-
export const ObjectGuardSchema = ObjectBaseSchema.extend({
|
|
866
|
-
description: z.string().describe("Guard object description"),
|
|
867
|
-
table: z.array(GuardTableItemSchema).describe("Guard object table item list"),
|
|
868
|
-
input: z.array(z.number()).describe("Guard object instruction sequence"),
|
|
869
|
-
root: GuardNodeSchema.describe("Guard object root node"),
|
|
870
|
-
rep_quote: z.record(z.string().describe("Repository object ID"), z.array(z.string()).describe("Repository policy list")).describe("Depends on Repository policy quote"),
|
|
871
|
-
relies: z.array(z.string()).describe("List of other Guard object IDs that this Guard object depends on"),
|
|
872
|
-
relies_logic_and: z.boolean().describe("Whether the logical relationship between this Guard object and its dependencies is AND; if true, validation result is AND of this Guard and all dependencies, if false, it's OR"),
|
|
873
|
-
rep: z.boolean().describe("If false, has complex Repository quote dependencies and cannot be used as an independent Guard"),
|
|
874
|
-
}).describe("Guard object");
|
|
875
|
-
export const PaymentInfoSchema = z.object({
|
|
876
|
-
for_object: z.union([z.string(), z.null()]).optional().describe("Payment for a specific object ID"),
|
|
877
|
-
for_guard: z.union([z.string(), z.null()]).optional().describe("Payment to satisfy verification of a Guard object"),
|
|
878
|
-
remark: z.string().describe("Payment record remark"),
|
|
879
|
-
index: z.union([z.number(), z.string()]).describe("Payment record index"),
|
|
880
|
-
}).describe("Payment information");
|
|
881
|
-
export const ObjectPaymentSchema = ObjectBaseSchema.extend({
|
|
882
|
-
record: z.array(z.object({
|
|
883
|
-
recipient: RecipientSchema,
|
|
884
|
-
amount: BalanceTypeSchema,
|
|
885
|
-
})).describe("Payment record list"),
|
|
886
|
-
amount: BalanceTypeSchema.describe("Payment amount"),
|
|
887
|
-
time: z.union([z.string(), z.number()]).describe("Payment time"),
|
|
888
|
-
from_object: z.union([z.string(), z.null()]).optional().describe("Payment source object ID"),
|
|
889
|
-
signer: z.string().describe("Payment signer ID"),
|
|
890
|
-
info: PaymentInfoSchema,
|
|
891
|
-
}).describe("Payment object");
|
|
892
|
-
export const ObjectAllocationSchema = ObjectBaseSchema.extend({
|
|
893
|
-
description: z.string().describe("Fund allocation object description"),
|
|
894
|
-
allocators: z.array(AllocatorSchema).describe("Fund allocation object allocator list"),
|
|
895
|
-
balance: BalanceTypeSchema.describe("Fund allocation object balance"),
|
|
896
|
-
payment_info: PaymentInfoSchema.optional().describe("Payment information"),
|
|
897
|
-
payment: z.array(z.string()).describe("Payment object ID list. Each fund allocation automatically generates a payment object to record fund flow"),
|
|
898
|
-
}).describe("Fund allocation object");
|
|
899
|
-
export const VoteWeightSchema = z.union([
|
|
900
|
-
z.object({
|
|
901
|
-
GuardIdentifier: GuardIdentifierSchema,
|
|
902
|
-
}).describe("Use value corresponding to Guard object's Table index as voting weight"),
|
|
903
|
-
z.object({
|
|
904
|
-
FixedValue: z.number().int().min(0).max(65535).describe("Fixed voting weight value"),
|
|
905
|
-
}).describe("Fixed voting weight"),
|
|
906
|
-
]).describe("Voting weight");
|
|
907
|
-
export const VotingGuardSchema = z.object({
|
|
908
|
-
guard: z.string().describe("Voting Guard object ID"),
|
|
909
|
-
vote_weight: VoteWeightSchema,
|
|
910
|
-
}).describe("Voting Guard object");
|
|
911
|
-
export const ObjectArbitrationSchema = ObjectBaseSchema.extend({
|
|
912
|
-
description: z.string().describe("Arbitration object description"),
|
|
913
|
-
location: z.string().describe("Arbitration object location"),
|
|
914
|
-
voting_guard: z.array(VotingGuardSchema).describe("Voting Guard object list"),
|
|
915
|
-
usage_guard: z.union([z.string(), z.null()]).optional().describe("Guard object ID that needs verification when submitting arbitration"),
|
|
916
|
-
fee: BalanceTypeSchema.describe("Single arbitration fee"),
|
|
917
|
-
balance: BalanceTypeSchema.describe("Arbitration object balance"),
|
|
918
|
-
bPaused: z.boolean().describe("Whether arbitration object is paused"),
|
|
919
|
-
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
920
|
-
permission: z.string().describe("Arbitration object permission"),
|
|
921
|
-
}).describe("Arbitration object");
|
|
922
|
-
export const GuardInPassportSchema = z.object({
|
|
923
|
-
guard: z.string().describe("Guard object ID"),
|
|
924
|
-
result: z.boolean().describe("Guard object verification result"),
|
|
925
|
-
impack: z.boolean().describe("Whether Guard object verification result participates in final result determination (AND logic)"),
|
|
926
|
-
relies: z.array(z.string()).describe("List of other Guard object IDs that this Guard object depends on"),
|
|
927
|
-
relies_logic_and: z.boolean().describe("Whether the logical relationship between this Guard object and its dependencies is AND; if true, validation result is AND of this Guard and all dependencies, if false, it's OR"),
|
|
928
|
-
submission: GuardSubmissionSchema.describe("Data submitted by user during Guard object verification"),
|
|
929
|
-
}).describe("Record of Guard object in Passport object");
|
|
930
|
-
export const ObjectPassportSchema = ObjectBaseSchema.extend({
|
|
931
|
-
info: z.array(GuardInPassportSchema).describe("List of Guard object records in Passport object"),
|
|
932
|
-
result: z.boolean().describe("Passport object final verification result"),
|
|
933
|
-
tx_hash: z.string().describe("Transaction hash where verification occurred"),
|
|
934
|
-
impack_guard: z.array(z.string()).describe("List of Guard object IDs participating in final result determination"),
|
|
935
|
-
time: z.number().describe("Creation time of the Passport object"),
|
|
936
|
-
signer: z.string().describe("Signer address of the Passport object"),
|
|
937
|
-
has_verified: z.boolean().describe("Whether the Passport object has been verified"),
|
|
938
|
-
}).describe("Passport object");
|
|
939
|
-
export const TableItem_PermissionPermSchema = ObjectBaseSchema.extend({
|
|
940
|
-
address: z.string().describe("User ID or Guard ID"),
|
|
941
|
-
perm: z.array(PermissionIndexTypeSchema.nullable().or(z.number())).describe("Permission list obtained after user or Guard object verification"),
|
|
942
|
-
}).describe("Permission object's permission record");
|
|
943
|
-
export const TableItem_DemandPresenterSchema = ObjectBaseSchema.extend({
|
|
944
|
-
address: z.string().describe("Referrer ID"),
|
|
945
|
-
recommend: z.string().describe("Recommendation letter"),
|
|
946
|
-
service: tolerantStringNullable.describe("Recommended service object ID"),
|
|
947
|
-
update_time: tolerantNumber.describe("Last update time"),
|
|
948
|
-
acceptance_score: tolerantNumberNullable.describe("Demand object feedback score"),
|
|
949
|
-
feedback: z.string().describe("Demand object feedback information"),
|
|
950
|
-
feedback_time: tolerantNumber.describe("Demand object feedback time"),
|
|
951
|
-
}).describe("Demand object's Service recommendation record");
|
|
952
|
-
export const MachineForwardGuardSchema = z.object({
|
|
953
|
-
guard: z.string().describe("Guard object name or address (string). Example: 'my_attendance_guard' or '0x1234...'"),
|
|
954
|
-
retained_submission: z.array(tolerantNumber).nullable().optional().describe("Data submitted by user during Guard object verification"),
|
|
955
|
-
}).strict().describe("Record of Guard object in MachineForwardGuard object. ALWAYS an OBJECT {guard: string, retained_submission?: number[]} — never a plain string. The inner 'guard' field is the Guard's name or address as a string.");
|
|
956
|
-
export const MachineForwardSchema = z.object({
|
|
957
|
-
name: z.string().describe("Forward name"),
|
|
958
|
-
namedOperator: tolerantStringNullable.describe("Forward operation permission 1: Namespace (one of the two must be specified); recommended if Progress object operators are different (e.g., different delivery personnel for different orders)."),
|
|
959
|
-
permissionIndex: tolerantNumberNullable.describe("Forward operation permission 2: Permission index (one of the two must be specified); recommended if all Progress object operators are the same (e.g., same reward reviewers for all orders)."),
|
|
960
|
-
weight: tolerantNumber.describe("Forward weight"),
|
|
961
|
-
guard: z.preprocess((val) => {
|
|
962
|
-
if (typeof val === "string") {
|
|
963
|
-
return { guard: val };
|
|
964
|
-
}
|
|
965
|
-
return val;
|
|
966
|
-
}, z.union([
|
|
967
|
-
MachineForwardGuardSchema.describe("OBJECT form: {guard: '<guard_name_or_address>', retained_submission?: number[]}. " +
|
|
968
|
-
"Use this form when you need to pass retained_submission data alongside the Guard reference."),
|
|
969
|
-
z.string().describe("STRING form (shorthand): the Guard object's name or address as a plain string. " +
|
|
970
|
-
"Auto-wrapped to {guard: <string>} at runtime. Use this when you only need to reference a Guard without retained_submission."),
|
|
971
|
-
]).nullable().optional()).describe("Guard reference for this forward. Accepts TWO formats:\n" +
|
|
972
|
-
"• STRING (preferred): \"my_guard_name\" — the Guard's name or address as a plain string.\n" +
|
|
973
|
-
"• OBJECT (only when retained_submission is needed): {guard: \"my_guard_name\", retained_submission: [1,2,3]}.\n" +
|
|
974
|
-
"FOLLOW THE SCHEMA FIELD STRUCTURE: A Guard reference is fundamentally a STRING (the Guard object's name or address). " +
|
|
975
|
-
"Provide a string when you only need to reference a Guard — do NOT wrap a bare string in an object structure. " +
|
|
976
|
-
"The OBJECT form {guard: \"...\", retained_submission: [...]} exists ONLY to carry additional `retained_submission` data " +
|
|
977
|
-
"alongside the string reference; inside the object, the `guard` field is STILL a string. " +
|
|
978
|
-
"In short: string-in for a string reference, object-in only when you need to pass extra data.\n" +
|
|
979
|
-
"COGNITIVE PRINCIPLE: Guard validation ALWAYS occurs BEFORE the forward operation. " +
|
|
980
|
-
"A Guard that queries state of the SAME Progress object this forward operates on " +
|
|
981
|
-
"(e.g. progress.current) will see the PRE-transition value (source node), NOT the target node. " +
|
|
982
|
-
"If the Guard checks progress.current == target_node, it will ALWAYS FAIL. " +
|
|
983
|
-
"Querying a DIFFERENT Progress object (cross-machine) is safe and reasonable — " +
|
|
984
|
-
"that progress is not modified by this forward. " +
|
|
985
|
-
"For target-node verification after transition, bind the Guard to the Allocator instead " +
|
|
986
|
-
"(allocation.alloc runs AFTER the state transition completes)."),
|
|
987
|
-
}).strict().refine((f) => (f.namedOperator !== null && f.namedOperator !== undefined) ||
|
|
988
|
-
(f.permissionIndex !== null && f.permissionIndex !== undefined), {
|
|
989
|
-
message: "One of 'namedOperator' or 'permissionIndex' must be provided for each forward. " +
|
|
990
|
-
"Use namedOperator:'' (empty string) when the ORDER OWNER operates this forward; " +
|
|
991
|
-
"use a permissionIndex (e.g. 1000) when the same operator acts for all orders.",
|
|
992
|
-
}).describe("Forward in Machine object");
|
|
993
|
-
export const MachineNodePairSchema = z.object({
|
|
994
|
-
prev_node: z.string().describe("Previous node name. Empty string '' means initial entry node (the first node in the workflow)."),
|
|
995
|
-
threshold: tolerantNumber.default(0).describe("Threshold to trigger node advancement. If total Forward weight is greater than or equal to threshold, node advancement is triggered."),
|
|
996
|
-
forwards: z.array(MachineForwardSchema).describe("Forward list — operations to ENTER THIS NODE from prev_node. " +
|
|
997
|
-
"SEMANTIC CLARIFICATION: forwards describe INCOMING transitions (how to ARRIVE at this node), " +
|
|
998
|
-
"NOT outgoing transitions. Think of each forward as an 'entry door' to this node. " +
|
|
999
|
-
"Example: pair {prev_node:'A', forwards:[{name:'Go'}]} means 'use Go to advance FROM A TO THIS NODE'. " +
|
|
1000
|
-
"For initial node (prev_node=''), forwards are operations to enter this node from the start state. " +
|
|
1001
|
-
"DIAGRAM: A --[Go]--> B means the pair belongs to node B (destination), with prev_node='A'. " +
|
|
1002
|
-
"WARNING: forwards belong to the DESTINATION node's pair, NOT the source node. " +
|
|
1003
|
-
"Placing a forward on the wrong pair will cause Progress to get stuck."),
|
|
1004
|
-
}).strict().describe("Node pair in Machine object")
|
|
1005
|
-
.refine((pair) => {
|
|
1006
|
-
if (pair.prev_node === "" && pair.forwards.length === 0) {
|
|
1007
|
-
return false;
|
|
1008
|
-
}
|
|
1009
|
-
return true;
|
|
1010
|
-
}, {
|
|
1011
|
-
message: "Initial node (prev_node='') must have at least one forward. Without a forward, Progress cannot advance from '' to this node, causing the order workflow to be permanently stuck.",
|
|
1012
|
-
});
|
|
1013
|
-
export const MachineNodeSchema = z.object({
|
|
1014
|
-
name: z.string().describe("Node name"),
|
|
1015
|
-
pairs: z.array(MachineNodePairSchema).describe("Node pair list"),
|
|
1016
|
-
}).strict().describe("Node in Machine object");
|
|
1017
|
-
export const TableItem_MachineNodeSchema = ObjectBaseSchema.extend({
|
|
1018
|
-
name: z.string().describe("Node name"),
|
|
1019
|
-
value: z.array(MachineNodePairSchema).describe("Node pair list"),
|
|
1020
|
-
}).describe("Node record in Machine object");
|
|
1021
|
-
export const TableItem_ProgressHistorySchema = ObjectBaseSchema.extend({
|
|
1022
|
-
index: tolerantNumber.describe("Progress record index (starting from 0)"),
|
|
1023
|
-
node: z.string().describe("Previous node name"),
|
|
1024
|
-
next_node: z.string().describe("Next node name"),
|
|
1025
|
-
session: z.array(ProgressSessionSchema).describe("Progress session list"),
|
|
1026
|
-
time: tolerantNumberNullable.describe("Progress record completion time (Unix timestamp)"),
|
|
1027
|
-
}).describe("Completed progress record in Progress object");
|
|
1028
|
-
export const TableItem_TreasuryHistorySchema = ObjectBaseSchema.extend({
|
|
1029
|
-
payment: NameOrAddressSchema.describe("Payment object ID"),
|
|
1030
|
-
op: TreasuryOpSchema.describe("Operation type"),
|
|
1031
|
-
signer: z.string().describe("Operator ID"),
|
|
1032
|
-
external_guard: tolerantStringNullable.describe("Guard object ID verified during operation (none if operated through Permission)"),
|
|
1033
|
-
amount: BalanceTypeSchema.describe("Payment amount"),
|
|
1034
|
-
time: tolerantNumber.describe("Payment time (Unix timestamp)"),
|
|
1035
|
-
store_from_id: tolerantStringNullable.describe("Stored value from Guard table. This stores the value (address or number converted to address, including submitted values) from the Guard table at the specified index for Guard verification purposes."),
|
|
1036
|
-
}).describe("Payment record in Treasury object");
|
|
1037
|
-
export const ObjectsQuerySchema = QueryEnvSchema.extend({
|
|
1038
|
-
objects: z.array(NameOrAddressSchema).describe("List of object IDs to query"),
|
|
1039
|
-
}).describe("Request parameters for querying objects");
|
|
1040
|
-
export const ObjectUnionSchema = z.union([
|
|
1041
|
-
ObjectTreasurySchema,
|
|
1042
|
-
ObjectPermissionSchema,
|
|
1043
|
-
ObjectMachineSchema,
|
|
1044
|
-
ObjectServiceSchema,
|
|
1045
|
-
ObjectOrderSchema,
|
|
1046
|
-
ObjectProgressSchema,
|
|
1047
|
-
ObjectDemandSchema,
|
|
1048
|
-
ObjectArbitrationSchema,
|
|
1049
|
-
ObjectAllocationSchema,
|
|
1050
|
-
ObjectRewardSchema,
|
|
1051
|
-
ObjectRepositorySchema,
|
|
1052
|
-
ObjectGuardSchema,
|
|
1053
|
-
ObjectPaymentSchema,
|
|
1054
|
-
ObjectPassportSchema,
|
|
1055
|
-
ObjectEntityRegistrarSchema,
|
|
1056
|
-
ObjectEntityLinkerSchema,
|
|
1057
|
-
ObjectResourceSchema,
|
|
1058
|
-
ObjectArbSchema,
|
|
1059
|
-
ObjectDiscountSchema,
|
|
1060
|
-
ObjectContactSchema,
|
|
1061
|
-
ObjectPersonalSchema,
|
|
1062
|
-
ObjectBaseSchema,
|
|
1063
|
-
ObjectProofSchema,
|
|
1064
|
-
]).describe("Union of all wowok on-chain object types");
|
|
1065
|
-
export const ObjectsAnswerSchema = z.object({
|
|
1066
|
-
objects: z.array(ObjectUnionSchema).optional().describe("List of queried objects"),
|
|
1067
|
-
}).describe("Response for querying objects");
|
|
1068
|
-
export const PersonalQuerySchema = QueryEnvSchema.extend({
|
|
1069
|
-
account: NameOrAddressSchema.optional().describe("Account name or ID to query. Use empty string '' for the default account. "),
|
|
1070
|
-
}).describe("Query PUBLIC on-chain personal profile for any account. Returns publicly published information (social accounts, websites, professional info) that users have intentionally shared on the blockchain.");
|
|
1071
|
-
export const TableQuerySchema = QueryEnvSchema.extend({
|
|
1072
|
-
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1073
|
-
cursor: z.union([z.string(), z.null()]).optional().describe("Pagination cursor"),
|
|
1074
|
-
limit: z.union([z.number(), z.null()]).optional().describe("Number of records returned per page"),
|
|
1075
|
-
}).describe("Request parameters for querying object's data table");
|
|
1076
|
-
export const TableAnswerItemSchema = z.object({
|
|
1077
|
-
key: z.object({
|
|
1078
|
-
type: z.string().describe("Key type"),
|
|
1079
|
-
value: z.union([z.string(), z.number()]).describe("Key value"),
|
|
1080
|
-
}).describe("Query key and its type"),
|
|
1081
|
-
type: z.string().describe("Table item object type"),
|
|
1082
|
-
object: z.string().describe("Table item object ID"),
|
|
1083
|
-
version: z.union([z.string(), z.number()]).describe("Table item object version"),
|
|
1084
|
-
}).describe("Result item of object's data table query");
|
|
1085
|
-
export const TableAnswerSchema = z.object({
|
|
1086
|
-
items: z.array(TableAnswerItemSchema),
|
|
1087
|
-
nextCursor: z.union([z.string(), z.null()]),
|
|
1088
|
-
hasNextPage: z.boolean(),
|
|
1089
|
-
cache_expire: CacheExpireTypeSchema.optional(),
|
|
1090
|
-
});
|
|
1091
|
-
export const QueryTableItem_byAddressSchema = QueryEnvSchema.extend({
|
|
1092
|
-
parent: z.string().describe("Parent object ID of the data table to query"),
|
|
1093
|
-
address: z.union([AccountOrMark_AddressSchema, z.string()]).describe("ID of the record to query"),
|
|
1094
|
-
}).describe("Request parameters for querying records by ID in object's data table");
|
|
1095
|
-
export const QueryTableItem_byU64Schema = QueryEnvSchema.extend({
|
|
1096
|
-
parent: z.string().describe("Parent object ID of the data table to query"),
|
|
1097
|
-
u64: z.union([z.number(), z.string()]).describe("U64 value of the record to query"),
|
|
1098
|
-
}).describe("Request parameters for querying records by U64 in object's data table");
|
|
1099
|
-
export const QueryTableItem_byStringSchema = QueryEnvSchema.extend({
|
|
1100
|
-
parent: z.string().describe("Parent object ID of the data table to query"),
|
|
1101
|
-
key: z.string().describe("String key of the record to query"),
|
|
1102
|
-
}).describe("Request parameters for querying records by string key in object's data table");
|
|
1103
|
-
export const QueryTableItem_byNameAddressSchema = QueryEnvSchema.extend({
|
|
1104
|
-
parent: z.string().describe("Parent object ID of the data table to query"),
|
|
1105
|
-
name: z.string().describe("Name of the record to query"),
|
|
1106
|
-
entity: z.union([AccountOrMark_AddressSchema, z.number()]).describe("ID of the record to query"),
|
|
1107
|
-
}).describe("Request parameters for querying records by name and ID in object's data table");
|
|
1108
|
-
export const QueryTableItem_Registrar_EntitySchema = QueryEnvSchema.extend({
|
|
1109
|
-
address: z.union([AccountOrMark_AddressSchema, z.string()]).describe("ID of the record to query"),
|
|
1110
|
-
}).describe("Request parameters for querying records by ID in Registrar object's data table");
|
|
1111
|
-
export const EventTypeSchema = z.union([
|
|
1112
|
-
z.literal("ArbEvent"),
|
|
1113
|
-
z.literal("NewOrderEvent"),
|
|
1114
|
-
z.literal("ProgressEvent"),
|
|
1115
|
-
z.literal("DemandPresentEvent"),
|
|
1116
|
-
z.literal("DemandFeedbackEvent"),
|
|
1117
|
-
z.literal("NewEntityEvent"),
|
|
1118
|
-
z.string(),
|
|
1119
|
-
]).describe("Event type. Supports Wowok built-in types (ArbEvent, NewOrderEvent, ProgressEvent, DemandPresentEvent, DemandFeedbackEvent, NewEntityEvent) or any string for generic MoveEventType (e.g., '0x2::coin::CoinEvent')");
|
|
1120
|
-
export const EventCursorSchema = z.object({
|
|
1121
|
-
eventSeq: z.union([z.string(), z.number()]).describe("Event sequence number"),
|
|
1122
|
-
txDigest: z.string().describe("Transaction digest"),
|
|
1123
|
-
}).describe("Event cursor");
|
|
1124
|
-
export const EventBaseSchema = z.object({
|
|
1125
|
-
id: EventCursorSchema,
|
|
1126
|
-
sender: z.string().describe("Event sender ID"),
|
|
1127
|
-
type: EventTypeSchema,
|
|
1128
|
-
type_raw: z.string().describe("Raw event type"),
|
|
1129
|
-
time: z.union([z.string(), z.number()]).describe("Event occurrence time"),
|
|
1130
|
-
parsedJson_raw: z.any().optional().describe("Raw parsed JSON data from the event"),
|
|
1131
|
-
}).describe("Event base information");
|
|
1132
|
-
export const ArbEventSchema = EventBaseSchema.extend({
|
|
1133
|
-
arb: z.string().describe("Arbitration object ID"),
|
|
1134
|
-
arbitration: z.string().describe("Arbitration object ID"),
|
|
1135
|
-
order: z.string().describe("Order object ID"),
|
|
1136
|
-
status: ArbStatusSchema,
|
|
1137
|
-
}).describe("Arbitration event");
|
|
1138
|
-
export const NewOrderEventSchema = EventBaseSchema.extend({
|
|
1139
|
-
order: z.string().describe("Order object ID"),
|
|
1140
|
-
service: z.string().describe("Service object ID"),
|
|
1141
|
-
progress: z.union([z.string(), z.null()]).optional().describe("Progress object ID"),
|
|
1142
|
-
discount: z.union([z.string(), z.null()]).optional().describe("Discount object ID"),
|
|
1143
|
-
allocation: z.union([z.string(), z.null()]).optional().describe("Allocation object ID"),
|
|
1144
|
-
amount: BalanceTypeSchema,
|
|
1145
|
-
}).describe("New order event");
|
|
1146
|
-
export const ProgressEventSchema = EventBaseSchema.extend({
|
|
1147
|
-
progress: z.string().describe("Progress object ID"),
|
|
1148
|
-
machine: z.string().describe("Machine object ID"),
|
|
1149
|
-
task: z.union([z.string(), z.null()]).optional().describe("Task object ID"),
|
|
1150
|
-
node: z.string().describe("Current node name"),
|
|
1151
|
-
forward: z.union([z.string(), z.null()]).optional().describe("Forward operation name"),
|
|
1152
|
-
hold: z.union([z.boolean(), z.null()]).optional().describe("Whether it is a hold operation"),
|
|
1153
|
-
}).describe("Progress event");
|
|
1154
|
-
export const DemandPresentEventSchema = EventBaseSchema.extend({
|
|
1155
|
-
demand: z.string().describe("Demand object ID"),
|
|
1156
|
-
service: z.union([z.string(), z.null()]).optional().describe("Service object ID"),
|
|
1157
|
-
recommend: z.string().describe("Recommendation letter"),
|
|
1158
|
-
}).describe("Event of recommending service to Demand object");
|
|
1159
|
-
export const DemandFeedbackEventSchema = EventBaseSchema.extend({
|
|
1160
|
-
demand: z.string().describe("Demand object ID"),
|
|
1161
|
-
service: z.union([z.string(), z.null()]).optional().describe("Service object ID"),
|
|
1162
|
-
feedback: z.string().describe("Feedback content"),
|
|
1163
|
-
acceptance_score: z.union([z.number(), z.null()]).optional().describe("Acceptance score"),
|
|
1164
|
-
}).describe("Event of Demand object feedback to referrer");
|
|
1165
|
-
export const NewEntityEventSchema = EventBaseSchema.extend({
|
|
1166
|
-
address: z.string().describe("User ID"),
|
|
1167
|
-
resource: z.string().describe("ID mark object ID owned by user"),
|
|
1168
|
-
referrer: z.union([z.string(), z.null()]).optional().describe("Referrer ID"),
|
|
1169
|
-
}).describe("New user event");
|
|
1170
|
-
export const EventAnswerSchema = z.object({
|
|
1171
|
-
data: z.array(z.union([
|
|
1172
|
-
EventBaseSchema,
|
|
1173
|
-
ArbEventSchema,
|
|
1174
|
-
NewOrderEventSchema,
|
|
1175
|
-
ProgressEventSchema,
|
|
1176
|
-
DemandPresentEventSchema,
|
|
1177
|
-
DemandFeedbackEventSchema,
|
|
1178
|
-
NewEntityEventSchema,
|
|
1179
|
-
])).describe("Event object data"),
|
|
1180
|
-
hasNextPage: z.boolean().describe("Whether there is a next page"),
|
|
1181
|
-
nextCursor: z.union([EventCursorSchema, z.null()]).optional().describe("Next page cursor"),
|
|
1182
|
-
cache_expire: CacheExpireTypeSchema.optional().describe("Cache expiration time"),
|
|
1183
|
-
}).describe("Event query result");
|
|
1184
|
-
export const EventQuerySchema = QueryEnvSchema.extend({
|
|
1185
|
-
type: EventTypeSchema.describe("Event type"),
|
|
1186
|
-
cursor: z.union([EventCursorSchema, z.null()]).optional().describe("Event cursor"),
|
|
1187
|
-
limit: z.union([z.number(), z.null()]).optional().describe("Query count limit"),
|
|
1188
|
-
order: z.union([z.literal("ascending"), z.literal("descending"), z.null()]).optional().describe("Sort order"),
|
|
1189
|
-
}).describe("Event query parameters");
|
|
1190
|
-
export const OnchainEventsInputSchema = z.object({
|
|
1191
|
-
type: EventTypeSchema.describe("Event type to query. Supported types: ArbEvent (arbitration events), NewOrderEvent (new order events), ProgressEvent (progress events), DemandPresentEvent (demand presentation events), DemandFeedbackEvent (demand feedback events), NewEntityEvent (new entity registration events)"),
|
|
1192
|
-
cursor: z.union([EventCursorSchema, z.null()]).optional().describe("Optional pagination cursor for fetching next page of results. Use null for first query, then use nextCursor from response for subsequent queries"),
|
|
1193
|
-
limit: z.union([z.number(), z.null()]).optional().describe("Maximum number of events to return per query. Use null for default limit"),
|
|
1194
|
-
order: z.union([z.literal("ascending"), z.literal("descending"), z.null()]).optional().describe("Sort order for results: 'ascending' (oldest first) or 'descending' (newest first). Use null for default order"),
|
|
1195
|
-
no_cache: z.boolean().optional().describe("Whether to bypass cache and fetch fresh data from the blockchain"),
|
|
1196
|
-
network: EntrypointSchema.optional().describe("Network to query: 'mainnet' or 'testnet'. Uses default network if not specified"),
|
|
1197
|
-
}).strict().describe("Input parameters for querying on-chain WOWOK events");
|
|
1198
|
-
export const OnchainEventsResultSchema = z.object({
|
|
1199
|
-
result: z.union([EventAnswerSchema, z.null()]).describe("Event query result containing list of events and pagination info, or null if no data found"),
|
|
1200
|
-
semantic: SemanticSummarySchema.optional().describe("Business semantic summary for the event query"),
|
|
1201
|
-
}).describe("Result of on-chain events query");
|
|
1202
|
-
export const TableItem_RepositoryDataOrUndefinedSchema = z.union([TableItem_RepositoryDataSchema, z.null()]).describe("Repository data item or null");
|
|
1203
|
-
export const TableItem_PermissionPermOrUndefinedSchema = z.union([TableItem_PermissionPermSchema, z.null()]).describe("Permission permission item or null");
|
|
1204
|
-
export const TableItem_EntityRegistrarOrUndefinedSchema = z.union([TableItem_EntityRegistrarSchema, z.null()]).describe("Entity registrar item or null");
|
|
1205
|
-
export const TableItem_EntityLinkerOrUndefinedSchema = z.union([TableItem_EntityLinkerSchema, z.null()]).describe("Entity linker item or null");
|
|
1206
|
-
export const TableItem_RewardRecordOrUndefinedSchema = z.union([TableItem_RewardRecordSchema, z.null()]).describe("Reward record item or null");
|
|
1207
|
-
export const TableItem_DemandPresenterOrUndefinedSchema = z.union([TableItem_DemandPresenterSchema, z.null()]).describe("Demand presenter item or null");
|
|
1208
|
-
export const TableItem_TreasuryHistoryOrUndefinedSchema = z.union([TableItem_TreasuryHistorySchema, z.null()]).describe("Treasury history item or null");
|
|
1209
|
-
export const TableItem_MachineNodeOrUndefinedSchema = z.union([TableItem_MachineNodeSchema, z.null()]).describe("Machine node item or null");
|
|
1210
|
-
export const TableItem_ProgressHistoryOrUndefinedSchema = z.union([TableItem_ProgressHistorySchema, z.null()]).describe("Progress history item or null");
|
|
1211
|
-
export const TableItem_AddressMarkOrUndefinedSchema = z.union([TableItem_AddressMarkSchema, z.null()]).describe("Address mark item or null");
|
|
1212
|
-
export const ObjectPersonalOrUndefinedSchema = z.object({
|
|
1213
|
-
result: z.union([ObjectPersonalSchema, z.null()]).describe("Personal object or null")
|
|
1214
|
-
}).describe("Personal object or null");
|
|
1215
|
-
export const TokenTypeInfoOrUndefinedSchema = z.object({
|
|
1216
|
-
result: z.union([TokenTypeInfoSchema, z.null()]).describe("Token type info or null")
|
|
1217
|
-
}).describe("Token type info or null");
|
|
1218
|
-
export const EventAnswerOrUndefinedSchema = z.object({
|
|
1219
|
-
result: z.union([EventAnswerSchema, z.null()]).describe("Event answer or null")
|
|
1220
|
-
}).describe("Event answer or null");
|
|
1221
|
-
export const TableAnswerOrUndefinedSchema = z.object({
|
|
1222
|
-
result: z.union([TableAnswerSchema, z.null()]).describe("Table answer or null")
|
|
1223
|
-
}).describe("Table answer or null");
|
|
1224
|
-
export const QueryTableItemSchema = z.discriminatedUnion("type", [
|
|
1225
|
-
z.object({
|
|
1226
|
-
type: z.literal("RepositoryData"),
|
|
1227
|
-
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1228
|
-
name: z.string().describe("Name of the record to query"),
|
|
1229
|
-
entity: z.union([AccountOrMark_AddressSchema, z.number()]).describe("ID or address of the entity; or address that number is casted to"),
|
|
1230
|
-
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1231
|
-
network: EntrypointSchema.optional(),
|
|
1232
|
-
}).describe("Request parameters for querying repository data table item"),
|
|
1233
|
-
z.object({
|
|
1234
|
-
type: z.literal("PermissionPerm"),
|
|
1235
|
-
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1236
|
-
address: z.union([AccountOrMark_AddressSchema, z.string()]).describe("User ID or address, or Guard ID in the permission perm table"),
|
|
1237
|
-
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1238
|
-
network: EntrypointSchema.optional(),
|
|
1239
|
-
}).describe("Request parameters for querying permission perm table item"),
|
|
1240
|
-
z.object({
|
|
1241
|
-
type: z.literal("EntityRegistrar"),
|
|
1242
|
-
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1243
|
-
address: AccountOrMark_AddressSchema.describe("User ID or address of the entity"),
|
|
1244
|
-
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1245
|
-
network: EntrypointSchema.optional(),
|
|
1246
|
-
}).describe("Request parameters for querying entity registrar table item"),
|
|
1247
|
-
z.object({
|
|
1248
|
-
type: z.literal("EntityLinker"),
|
|
1249
|
-
address: z.union([AccountOrMark_AddressSchema, z.string()]).describe("ID or address that the registrar votes are attached to"),
|
|
1250
|
-
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1251
|
-
network: EntrypointSchema.optional(),
|
|
1252
|
-
}).describe("Request parameters for querying entity linker table item"),
|
|
1253
|
-
z.object({
|
|
1254
|
-
type: z.literal("RewardRecord"),
|
|
1255
|
-
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1256
|
-
address: AccountOrMark_AddressSchema.describe("User ID or address that claims the reward"),
|
|
1257
|
-
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1258
|
-
network: EntrypointSchema.optional(),
|
|
1259
|
-
}).describe("Request parameters for querying reward record table item"),
|
|
1260
|
-
z.object({
|
|
1261
|
-
type: z.literal("DemandPresenter"),
|
|
1262
|
-
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1263
|
-
address: AccountOrMark_AddressSchema.describe("User ID or address of the Demand presenter"),
|
|
1264
|
-
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1265
|
-
network: EntrypointSchema.optional(),
|
|
1266
|
-
}).describe("Request parameters for querying demand presenter table item"),
|
|
1267
|
-
z.object({
|
|
1268
|
-
type: z.literal("TreasuryRecord"),
|
|
1269
|
-
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1270
|
-
address: AccountOrMark_AddressSchema.describe("ID of the payment that the treasury record is attached to"),
|
|
1271
|
-
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1272
|
-
network: EntrypointSchema.optional(),
|
|
1273
|
-
}).describe("Request parameters for querying treasury record table item"),
|
|
1274
|
-
z.object({
|
|
1275
|
-
type: z.literal("MachineNode"),
|
|
1276
|
-
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1277
|
-
key: z.string().describe("String key of the node name to query"),
|
|
1278
|
-
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1279
|
-
network: EntrypointSchema.optional(),
|
|
1280
|
-
}).describe("Request parameters for querying machine node table item"),
|
|
1281
|
-
z.object({
|
|
1282
|
-
type: z.literal("ProgressHistory"),
|
|
1283
|
-
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1284
|
-
u64: z.union([z.number(), z.string()]).describe("U64 value of the record to query"),
|
|
1285
|
-
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1286
|
-
network: EntrypointSchema.optional(),
|
|
1287
|
-
}).describe("Request parameters for querying progress history table item"),
|
|
1288
|
-
z.object({
|
|
1289
|
-
type: z.literal("AddressMark"),
|
|
1290
|
-
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1291
|
-
address: AccountOrMark_AddressSchema.describe("ID or address that the mark name and tags are attached to"),
|
|
1292
|
-
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1293
|
-
network: EntrypointSchema.optional(),
|
|
1294
|
-
}).describe("Request parameters for querying address mark table item"),
|
|
1295
|
-
]).describe("Request parameters for querying table items");
|
|
1296
|
-
export const TableItemUnionOrUndefinedSchema = z.object({
|
|
1297
|
-
result: z.union([
|
|
1298
|
-
TableItem_RepositoryDataSchema,
|
|
1299
|
-
TableItem_PermissionPermSchema,
|
|
1300
|
-
TableItem_EntityRegistrarSchema,
|
|
1301
|
-
TableItem_EntityLinkerSchema,
|
|
1302
|
-
TableItem_RewardRecordSchema,
|
|
1303
|
-
TableItem_DemandPresenterSchema,
|
|
1304
|
-
TableItem_TreasuryHistorySchema,
|
|
1305
|
-
TableItem_MachineNodeSchema,
|
|
1306
|
-
TableItem_ProgressHistorySchema,
|
|
1307
|
-
TableItem_AddressMarkSchema,
|
|
1308
|
-
z.null()
|
|
1309
|
-
]).describe("Table item or null")
|
|
1310
|
-
}).describe("Table item or null");
|
|
1311
|
-
export const ConstantItemSchema = z.object({
|
|
1312
|
-
name: z.string().describe('Name'),
|
|
1313
|
-
value: z.union([z.string(), z.number()]).describe('Value'),
|
|
1314
|
-
description: z.string().describe('Description')
|
|
1315
|
-
}).describe('Constant item');
|
|
1316
|
-
export const PermissionInfoTypeSchema = z.object({
|
|
1317
|
-
index: z.number().describe('Permission index (e.g. 315 for service.compensation_fund_deposit)'),
|
|
1318
|
-
name: z.string().describe('Permission name (e.g. "service.compensation_fund_deposit")'),
|
|
1319
|
-
description: z.string().describe('Description of what this permission allows'),
|
|
1320
|
-
object_type: z.string().describe('Object type this permission belongs to (e.g. "Service", "Arbitration")'),
|
|
1321
|
-
operation: z.optional(z.string()).describe('The SDK/MCP operation field name that triggers this permission check (e.g. "compensation_fund_add", "publish", "pause"). Undefined for permissions with no direct Call*_Data field (e.g. "*.new" permissions). Use this to answer: "What permission does operation X require?" by filtering with {operation: "compensation_fund_add"}.')
|
|
1322
|
-
}).describe('Permission info type — includes the operation field name that maps to this permission, so AI can look up required permissions by operation name.');
|
|
1323
|
-
export const GuardInstructSchema = z.object({
|
|
1324
|
-
name: z.string().describe('Name of the guard instruction'),
|
|
1325
|
-
id: z.number().int().describe('ID of the guard instruction (OperatorType or ContextType)'),
|
|
1326
|
-
description: z.string().describe('Description of the guard instruction'),
|
|
1327
|
-
returnType: z.optional(ValueTypeSchema).describe('Return type of the guard instruction')
|
|
1328
|
-
}).describe('Guard instruction info');
|
|
1329
|
-
export const GuardItemSchema = z.object({
|
|
1330
|
-
name: z.string().describe('Name of the guard instruction or query'),
|
|
1331
|
-
id: z.union([z.number().int(), QueryIdSchema]).describe('ID of the guard instruction or query'),
|
|
1332
|
-
description: z.string().describe('Description'),
|
|
1333
|
-
returnType: z.optional(ValueTypeSchema).describe('Return type for guard instruction'),
|
|
1334
|
-
objectType: z.optional(ObjectTypeSchema).describe('Object type for guard query'),
|
|
1335
|
-
parameters: z.optional(z.array(ValueTypeSchema)).describe('Parameters for guard query'),
|
|
1336
|
-
return: z.optional(ValueTypeSchema).describe('Return type for guard query'),
|
|
1337
|
-
parameters_description: z.optional(z.array(z.string())).describe('Parameter descriptions for guard query'),
|
|
1338
|
-
}).describe('Guard item - either a guard instruction or a guard query');
|
|
1339
|
-
export const GuardInstructFilterOptionsSchema = z.object({
|
|
1340
|
-
name: z.optional(z.string()).describe('Name filter (case-insensitive partial match)'),
|
|
1341
|
-
id: z.optional(z.array(z.number().int())).describe('ID array filter (OperatorType | ContextType | number)'),
|
|
1342
|
-
returnType: z.optional(ValueTypeSchema).describe('Return type filter'),
|
|
1343
|
-
paramCount: z.optional(z.number().int()).describe('Parameter count filter'),
|
|
1344
|
-
scope: z.optional(z.enum(['instruct', 'object query', 'all'])).describe('Scope filter: instruct, object query, or all').default("all"),
|
|
1345
|
-
objectType: z.optional(ObjectTypeSchema).describe('Object type filter (only for object query scope)')
|
|
1346
|
-
}).describe('Guard instruction filter options');
|
|
1347
|
-
export const PermissionFilterSchema = z.object({
|
|
1348
|
-
objectType: z.optional(ObjectTypeSchema).describe('Object type filter'),
|
|
1349
|
-
name: z.optional(z.string()).describe('Name filter'),
|
|
1350
|
-
index: z.optional(PermissionIndexTypeSchema).describe('Index filter'),
|
|
1351
|
-
description: z.optional(z.string()).describe('Description filter'),
|
|
1352
|
-
operation: z.optional(z.string()).describe('Filter by SDK/MCP operation field name (e.g. "compensation_fund_add"). Returns only permissions triggered by this operation. Use this to answer: "What permission does operation X require?"')
|
|
1353
|
-
}).describe('Permission filter');
|
|
1354
|
-
export const CommonMistakeInfoSchema = z.object({
|
|
1355
|
-
object_type: z.string().describe('The object type this mistake applies to (e.g. "Service", "Arbitration")'),
|
|
1356
|
-
operation: z.string().describe('The operation field name this mistake applies to (e.g. "compensation_fund_add", "voting_deadline")'),
|
|
1357
|
-
category: z.enum(['field_name', 'unit', 'value_range', 'workflow', 'timing']).describe('Category of the mistake: field_name (wrong field name), unit (wrong unit like seconds vs ms), value_range (wrong expected value), workflow (wrong operation order), timing (wrong time constraint)'),
|
|
1358
|
-
mistake: z.string().describe('Short description of the mistake'),
|
|
1359
|
-
correct_usage: z.string().describe('The correct usage pattern'),
|
|
1360
|
-
wrong_example: z.string().describe('Example of the wrong usage'),
|
|
1361
|
-
correct_example: z.string().describe('Example of the correct usage')
|
|
1362
|
-
}).describe('A known common mistake for an on-chain operation. Use this to proactively warn users before they submit a transaction.');
|
|
1363
|
-
export const CommonMistakeFilterSchema = z.object({
|
|
1364
|
-
object_type: z.optional(z.string()).describe('Filter by object type (e.g. "Service")'),
|
|
1365
|
-
operation: z.optional(z.string()).describe('Filter by operation field name (e.g. "compensation_fund_add")'),
|
|
1366
|
-
category: z.optional(z.enum(['field_name', 'unit', 'value_range', 'workflow', 'timing'])).describe('Filter by category (e.g. "field_name" for field-name mistakes, "unit" for unit mistakes)')
|
|
1367
|
-
}).describe('Filter for common mistakes. Use operation:"compensation_fund_add" to find mistakes for a specific operation.');
|
|
1368
|
-
export const BridgeTokenInfoSchema = z.object({
|
|
1369
|
-
tokenId: z.number().describe('On-chain token ID (mainnet: WBTC=1, ETH/WETH=2, USDC=3, USDT=4)'),
|
|
1370
|
-
symbol: z.string().describe('Token symbol/abbreviation (ETH, WETH, WBTC, USDC, USDT)'),
|
|
1371
|
-
wowTypeTag: z.string().describe('WOW-side token type tag (format: {address}::{module}::{struct}, e.g. "0x2::wow::WOW", "0x...::usdt::USDT"). IMPORTANT: This value can be used directly as the `type_parameter` for Service / Treasury / Reward / Allocation objects to set their payment token. e.g. use USDT\'s wowTypeTag to create a Service that accepts USDT payments. To discover all available tokens, query this info type.'),
|
|
1372
|
-
evmAddress: z.string().describe('EVM-side contract address (0x000...000 for native ETH; ERC20 contract address otherwise)'),
|
|
1373
|
-
evmDecimals: z.number().describe('EVM-side decimals (ETH/WETH=18, WBTC=8, USDC/USDT=6)'),
|
|
1374
|
-
wowDecimals: z.number().describe('WOW-side decimals (ETH/WBTC=8, USDC/USDT=6)'),
|
|
1375
|
-
evmChains: z.array(z.number()).optional().describe('Bridge protocol chain IDs where this token is available (e.g. 10 = ETH mainnet)'),
|
|
1376
|
-
description: z.string().optional().describe('Token description'),
|
|
1377
|
-
}).describe('Mainnet Bridge token info');
|
|
1378
|
-
export const FundingGuidanceSchema = z.object({
|
|
1379
|
-
overview: z.string().describe('Overview of how to obtain WOW gas and payment tokens'),
|
|
1380
|
-
testnet: z.object({
|
|
1381
|
-
token: z.string().describe('Testnet token (WOW)'),
|
|
1382
|
-
method: z.literal('faucet').describe('Testnet funding method (faucet)'),
|
|
1383
|
-
faucet_url: z.string().describe('Testnet faucet URL'),
|
|
1384
|
-
note: z.string().describe('Testnet funding note: all merchant/order testing can use WOW'),
|
|
1385
|
-
}),
|
|
1386
|
-
mainnet: z.object({
|
|
1387
|
-
method: z.literal('eth_bridge').describe('Mainnet funding method (ETH mainnet cross-chain bridge)'),
|
|
1388
|
-
supported_tokens: z.array(z.string()).describe('Tokens supported by the mainnet bridge (ETH/USDT/USDC/WBTC)'),
|
|
1389
|
-
steps: z.array(z.string()).describe('Step-by-step mainnet funding flow: query active EVM account → transfer from external wallet → confirm balance → cross-chain to WOW'),
|
|
1390
|
-
}),
|
|
1391
|
-
airdrop: z.object({
|
|
1392
|
-
url: z.string().describe('WOW mainnet airdrop URL'),
|
|
1393
|
-
status: z.string().describe('Airdrop status (under construction)'),
|
|
1394
|
-
}),
|
|
1395
|
-
payment_token: z.object({
|
|
1396
|
-
testnet_default: z.string().describe('Default testnet payment token (WOW)'),
|
|
1397
|
-
mainnet_option: z.string().describe('Mainnet payment token option (USDT and other stablecoins)'),
|
|
1398
|
-
migration_note: z.string().describe('Guidance: ask whether to switch payment token when migrating testnet → mainnet'),
|
|
1399
|
-
}),
|
|
1400
|
-
}).describe('Funding guidance — how to obtain WOW gas and payment tokens (testnet faucet / mainnet bridge / airdrop). This is the first-step guidance for new users.');
|
|
1401
|
-
export const ProtocolInfoQuerySchema = z.discriminatedUnion('info', [
|
|
1402
|
-
z.object({
|
|
1403
|
-
info: z.literal('constants')
|
|
1404
|
-
}).strict().describe('Constants query'),
|
|
1405
|
-
z.object({
|
|
1406
|
-
info: z.literal('built-in permissions'),
|
|
1407
|
-
filter: z.optional(PermissionFilterSchema).describe('Filter for built-in permissions. Use operation:"compensation_fund_add" to find which permission a specific operation requires.')
|
|
1408
|
-
}).strict().describe('Built-in permissions query. Each permission includes an optional "operation" field that maps to the SDK/MCP Call*_Data field name triggering it. Use this to answer: "What permission does operation X require?" — e.g. filter operation:"compensation_fund_add" returns permission index 315 (service.compensation_fund_deposit).'),
|
|
1409
|
-
z.object({
|
|
1410
|
-
info: z.literal('common mistakes'),
|
|
1411
|
-
filter: z.optional(CommonMistakeFilterSchema).describe('Filter for common mistakes. Use operation:"compensation_fund_add" to find mistakes for a specific operation, or category:"field_name" for all field-name mistakes.')
|
|
1412
|
-
}).strict().describe('Common mistakes query. Returns known field-name, unit, value-range, workflow, and timing pitfalls for on-chain operations. Use this to proactively warn users before submitting a transaction. Example: query operation:"compensation_fund_add" to learn about the {amount} vs {balance} field name mistake.'),
|
|
1413
|
-
z.object({
|
|
1414
|
-
info: z.literal('guard instructions'),
|
|
1415
|
-
filter: z.optional(GuardInstructFilterOptionsSchema).describe('Filter for guard instructions')
|
|
1416
|
-
}).strict().describe('Guard instructions and wowok object queries'),
|
|
1417
|
-
z.object({
|
|
1418
|
-
info: z.literal('current network')
|
|
1419
|
-
}).strict().describe('Current network entrypoint'),
|
|
1420
|
-
z.object({
|
|
1421
|
-
info: z.literal('value types')
|
|
1422
|
-
}).strict().describe('Value types query - returns all supported value types with their numeric and string representations'),
|
|
1423
|
-
z.object({
|
|
1424
|
-
info: z.literal('mainnet bridge tokens')
|
|
1425
|
-
}).strict().describe('Mainnet Bridge tokens query - returns all tokens deployed on the mainnet bridge with their symbol, WOW-side type tag, EVM address, decimals, and description'),
|
|
1426
|
-
z.object({
|
|
1427
|
-
info: z.literal('funding guidance')
|
|
1428
|
-
}).strict().describe('Funding guidance query - how to obtain WOW gas and payment tokens. Returns testnet faucet info, mainnet ETH cross-chain bridge flow, and the WOW mainnet airdrop link. Use this when a user asks how to obtain tokens/gas/funds, or as a proactive first-use reminder.')
|
|
1429
|
-
]).describe('WoWok Build-in infomation query');
|
|
1430
|
-
export const BuiltinPermissionSchema = z.object({
|
|
1431
|
-
result: z.array(PermissionInfoTypeSchema).describe('Built-in permissions result')
|
|
1432
|
-
}).describe('Built-in permissions query result');
|
|
1433
|
-
export const ProtocolInfoResultWrappedSchema = z.discriminatedUnion('info', [
|
|
1434
|
-
z.object({
|
|
1435
|
-
info: z.literal('constants'),
|
|
1436
|
-
result: z.array(ConstantItemSchema).describe('Constants result')
|
|
1437
|
-
}),
|
|
1438
|
-
z.object({
|
|
1439
|
-
info: z.literal('built-in permissions'),
|
|
1440
|
-
result: z.array(PermissionInfoTypeSchema).describe('Built-in permissions result. Each item includes an optional "operation" field mapping to the SDK/MCP field name that triggers this permission.')
|
|
1441
|
-
}),
|
|
1442
|
-
z.object({
|
|
1443
|
-
info: z.literal('common mistakes'),
|
|
1444
|
-
result: z.array(CommonMistakeInfoSchema).describe('Common mistakes result. Each item documents a known pitfall (wrong field name, wrong unit, wrong workflow order, etc.) with wrong/correct examples.')
|
|
1445
|
-
}),
|
|
1446
|
-
z.object({
|
|
1447
|
-
info: z.literal('guard instructions'),
|
|
1448
|
-
result: z.array(GuardItemSchema).describe('Guard instructions result')
|
|
1449
|
-
}),
|
|
1450
|
-
z.object({
|
|
1451
|
-
info: z.literal('current network'),
|
|
1452
|
-
result: EntrypointSchema.describe('Current network entrypoint')
|
|
1453
|
-
}),
|
|
1454
|
-
z.object({
|
|
1455
|
-
info: z.literal('value types'),
|
|
1456
|
-
result: z.array(ConstantItemSchema).describe('Value types result - each item contains name (string), value (string), and description showing the numeric mapping')
|
|
1457
|
-
}),
|
|
1458
|
-
z.object({
|
|
1459
|
-
info: z.literal('mainnet bridge tokens'),
|
|
1460
|
-
result: z.array(BridgeTokenInfoSchema).describe('Mainnet Bridge tokens result - each item contains tokenId, symbol, wowTypeTag, evmAddress, evmDecimals, wowDecimals, evmChains, and description')
|
|
1461
|
-
}),
|
|
1462
|
-
z.object({
|
|
1463
|
-
info: z.literal('funding guidance'),
|
|
1464
|
-
result: FundingGuidanceSchema.describe('Funding guidance result - testnet faucet / mainnet bridge / airdrop / payment-token guidance')
|
|
1465
|
-
})
|
|
1466
|
-
]).describe('Protocol info result');
|
|
1467
|
-
export const ProtocolInfoResultSchema = z.object({
|
|
1468
|
-
result: ProtocolInfoResultWrappedSchema
|
|
1469
|
-
}).describe('Protocol info result');
|
|
1470
|
-
export const LocalQueryResultSchema = z.union([
|
|
1471
|
-
z.object({
|
|
1472
|
-
query_type: z.literal("local_mark_list"),
|
|
1473
|
-
result: QueryLocalMarkListResultSchema.shape.result,
|
|
1474
|
-
}),
|
|
1475
|
-
z.object({
|
|
1476
|
-
query_type: z.literal("account_list"),
|
|
1477
|
-
result: QueryAccountListResultSchema.shape.result,
|
|
1478
|
-
}),
|
|
1479
|
-
z.object({
|
|
1480
|
-
query_type: z.literal("local_info_list"),
|
|
1481
|
-
result: QueryLocalInfoListResultSchema.shape.result,
|
|
1482
|
-
}),
|
|
1483
|
-
z.object({
|
|
1484
|
-
query_type: z.literal("token_list"),
|
|
1485
|
-
result: QueryLocalTokenListResultSchema.shape.result,
|
|
1486
|
-
}),
|
|
1487
|
-
z.object({
|
|
1488
|
-
query_type: z.literal("account_balance"),
|
|
1489
|
-
result: QueryAccountResultSchema,
|
|
1490
|
-
}),
|
|
1491
|
-
]);
|
|
1492
|
-
export const TxObjectChangeSchema = z.object({
|
|
1493
|
-
id: z.string().describe("Object ID affected by the transaction"),
|
|
1494
|
-
type: z.enum(["created", "mutated", "deleted", "wrapped", "unwrapped"]).describe("Type of object change"),
|
|
1495
|
-
object_type: z.string().optional().describe("Full Move type of the object"),
|
|
1496
|
-
sender: z.string().optional().describe("Sender who caused this object change"),
|
|
1497
|
-
version: z.string().optional().describe("Object version after the change"),
|
|
1498
|
-
previous_version: z.string().optional().describe("Previous object version (for mutations)"),
|
|
1499
|
-
digest: z.string().optional().describe("Transaction digest that caused this change"),
|
|
1500
|
-
}).strict().describe("Object change within a transaction");
|
|
1501
|
-
export const TxBalanceChangeSchema = z.object({
|
|
1502
|
-
owner: z.string().describe("Owner address of the balance change"),
|
|
1503
|
-
coin_type: z.string().describe("Coin type (e.g. 0x2::wow::WOW)"),
|
|
1504
|
-
amount: z.string().describe("Amount changed (signed string, positive=incoming, negative=outgoing)"),
|
|
1505
|
-
}).strict().describe("Balance change within a transaction");
|
|
1506
|
-
export const TxEventSchema = z.object({
|
|
1507
|
-
type: z.string().describe("Fully-qualified event type (e.g. 0x2::progress::ProgressEvent)"),
|
|
1508
|
-
package_id: z.string().optional().describe("Package that declared the event module"),
|
|
1509
|
-
module: z.string().optional().describe("Module name that emitted the event"),
|
|
1510
|
-
sender: z.string().optional().describe("Sender of the emitting transaction"),
|
|
1511
|
-
parsed_json: z.unknown().optional().describe("Parsed JSON payload of the event (Move struct fields)"),
|
|
1512
|
-
bcs: z.string().optional().describe("Raw BCS bytes of the event (base64)"),
|
|
1513
|
-
}).strict().describe("Event emitted by a transaction");
|
|
1514
|
-
export const TransactionDetailSchema = z.object({
|
|
1515
|
-
digest: z.string().describe("Transaction digest (0x...)"),
|
|
1516
|
-
status: z.enum(["success", "failed"]).describe("Transaction execution status"),
|
|
1517
|
-
error: z.string().optional().describe("Error message if the transaction failed"),
|
|
1518
|
-
timestamp_ms: z.string().optional().describe("Unix timestamp in milliseconds (string)"),
|
|
1519
|
-
sender: z.string().optional().describe("Transaction sender address"),
|
|
1520
|
-
gas_used: z.string().optional().describe("Total gas used (string, BigInt)"),
|
|
1521
|
-
gas_budget: z.string().optional().describe("Gas budget set by the sender (string)"),
|
|
1522
|
-
kind: z.string().optional().describe("Transaction kind (e.g. ProgrammableTransaction)"),
|
|
1523
|
-
object_changes: z.array(TxObjectChangeSchema).describe("Object changes (created/mutated/deleted)"),
|
|
1524
|
-
balance_changes: z.array(TxBalanceChangeSchema).describe("Balance changes for all involved owners"),
|
|
1525
|
-
event_count: z.number().describe("Number of events emitted by this transaction"),
|
|
1526
|
-
events: z.array(TxEventSchema).describe("Events emitted by the transaction. Always populated by query_transaction (showEvents=true). " +
|
|
1527
|
-
"Each event carries its Move struct payload (parsed_json) so callers can inspect " +
|
|
1528
|
-
"ProgressEvent, NewOrderEvent, ArbEvent, etc. without an extra query."),
|
|
1529
|
-
epoch: z.string().optional().describe("Epoch number when the transaction was executed"),
|
|
1530
|
-
is_system_tx: z.boolean().optional().describe("Whether this was a system transaction"),
|
|
1531
|
-
cache_expire: z.union([z.number(), z.literal("INFINITE")]).optional().describe("Cache expiration timestamp"),
|
|
1532
|
-
}).strict().describe("Full transaction detail — verifiable proof of an on-chain operation");
|
|
1533
|
-
export const TransactionHistoryItemSchema = z.object({
|
|
1534
|
-
digest: z.string().describe("Transaction digest"),
|
|
1535
|
-
status: z.enum(["success", "failed"]).describe("Transaction execution status"),
|
|
1536
|
-
timestamp_ms: z.string().optional().describe("Unix timestamp in milliseconds"),
|
|
1537
|
-
sender: z.string().optional().describe("Transaction sender address"),
|
|
1538
|
-
kind: z.string().optional().describe("Transaction kind"),
|
|
1539
|
-
gas_used: z.string().optional().describe("Gas used (string)"),
|
|
1540
|
-
objects_touched: z.array(z.string()).describe("Object IDs touched by this transaction"),
|
|
1541
|
-
has_object_changes: z.boolean().describe("Whether this tx created/mutated/deleted objects"),
|
|
1542
|
-
}).strict().describe("Transaction history summary item");
|
|
1543
|
-
export const TransactionHistoryAnswerSchema = z.object({
|
|
1544
|
-
transactions: z.array(TransactionHistoryItemSchema).describe("Transaction history items"),
|
|
1545
|
-
next_cursor: z.union([z.string(), z.null()]).describe("Cursor for the next page (null if no more pages)"),
|
|
1546
|
-
has_next_page: z.boolean().describe("Whether more pages are available"),
|
|
1547
|
-
cache_expire: z.union([z.number(), z.literal("INFINITE")]).optional().describe("Cache expiration timestamp"),
|
|
1548
|
-
}).strict().describe("Paginated transaction history answer");
|
|
1549
|
-
export const OnchainQueryResultSchema_Part1 = z.union([
|
|
1550
|
-
z.object({
|
|
1551
|
-
query_type: z.literal("onchain_personal_profile"),
|
|
1552
|
-
result: z.union([ObjectPersonalSchema, z.undefined()]),
|
|
1553
|
-
}),
|
|
1554
|
-
z.object({
|
|
1555
|
-
query_type: z.literal("onchain_objects"),
|
|
1556
|
-
result: ObjectsAnswerSchema,
|
|
1557
|
-
}),
|
|
1558
|
-
z.object({
|
|
1559
|
-
query_type: z.literal("onchain_table"),
|
|
1560
|
-
result: z.union([TableAnswerSchema, z.undefined()]),
|
|
1561
|
-
}),
|
|
1562
|
-
z.object({
|
|
1563
|
-
query_type: z.literal("onchain_table_item_repository_data"),
|
|
1564
|
-
result: z.union([TableItem_RepositoryDataSchema, z.undefined()]),
|
|
1565
|
-
}),
|
|
1566
|
-
z.object({
|
|
1567
|
-
query_type: z.literal("onchain_table_item_permission_perm"),
|
|
1568
|
-
result: z.union([TableItem_PermissionPermSchema, z.undefined()]),
|
|
1569
|
-
}),
|
|
1570
|
-
z.object({
|
|
1571
|
-
query_type: z.literal("onchain_table_item_entity_registrar"),
|
|
1572
|
-
result: z.union([TableItem_EntityRegistrarSchema, z.undefined()]),
|
|
1573
|
-
}),
|
|
1574
|
-
z.object({
|
|
1575
|
-
query_type: z.literal("onchain_table_item_entity_linker"),
|
|
1576
|
-
result: z.union([TableItem_EntityLinkerSchema, z.undefined()]),
|
|
1577
|
-
}),
|
|
1578
|
-
]);
|
|
1579
|
-
export const OnchainQueryResultSchema_Part2 = z.union([
|
|
1580
|
-
z.object({
|
|
1581
|
-
query_type: z.literal("onchain_table_item_reward_record"),
|
|
1582
|
-
result: z.union([TableItem_RewardRecordSchema, z.undefined()]),
|
|
1583
|
-
}),
|
|
1584
|
-
z.object({
|
|
1585
|
-
query_type: z.literal("onchain_table_item_demand_presenter"),
|
|
1586
|
-
result: z.union([TableItem_DemandPresenterSchema, z.undefined()]),
|
|
1587
|
-
}),
|
|
1588
|
-
z.object({
|
|
1589
|
-
query_type: z.literal("onchain_table_item_treasury_history"),
|
|
1590
|
-
result: z.union([TableItem_TreasuryHistorySchema, z.undefined()]),
|
|
1591
|
-
}),
|
|
1592
|
-
z.object({
|
|
1593
|
-
query_type: z.literal("onchain_table_item_machine_node"),
|
|
1594
|
-
result: z.union([TableItem_MachineNodeSchema, z.undefined()]),
|
|
1595
|
-
}),
|
|
1596
|
-
z.object({
|
|
1597
|
-
query_type: z.literal("onchain_table_item_progress_history"),
|
|
1598
|
-
result: z.union([TableItem_ProgressHistorySchema, z.undefined()]),
|
|
1599
|
-
}),
|
|
1600
|
-
z.object({
|
|
1601
|
-
query_type: z.literal("onchain_table_item_address_mark"),
|
|
1602
|
-
result: z.union([TableItem_AddressMarkSchema, z.undefined()]),
|
|
1603
|
-
}),
|
|
1604
|
-
z.object({
|
|
1605
|
-
query_type: z.literal("onchain_received"),
|
|
1606
|
-
result: QueryReceivedResultSchema.shape.result,
|
|
1607
|
-
}),
|
|
1608
|
-
]);
|
|
1609
|
-
export const OnchainQueryResultSchema_Part3 = z.union([
|
|
1610
|
-
z.object({
|
|
1611
|
-
query_type: z.literal("onchain_transaction"),
|
|
1612
|
-
result: z.union([TransactionDetailSchema, z.undefined()]),
|
|
1613
|
-
}).strict(),
|
|
1614
|
-
z.object({
|
|
1615
|
-
query_type: z.literal("onchain_object_history"),
|
|
1616
|
-
result: z.union([TransactionHistoryAnswerSchema, z.undefined()]),
|
|
1617
|
-
}).strict(),
|
|
1618
|
-
z.object({
|
|
1619
|
-
query_type: z.literal("onchain_address_activity"),
|
|
1620
|
-
result: z.union([TransactionHistoryAnswerSchema, z.undefined()]),
|
|
1621
|
-
}).strict(),
|
|
1622
|
-
z.object({
|
|
1623
|
-
query_type: z.literal("token_value_convert"),
|
|
1624
|
-
result: z.object({
|
|
1625
|
-
token_type: z.string().describe("Full token type used for conversion"),
|
|
1626
|
-
symbol: z.string().optional().describe("Resolved token symbol"),
|
|
1627
|
-
decimals: z.number().optional().describe("Resolved decimals N — the precision reminder"),
|
|
1628
|
-
precision_known: z.boolean().describe("false → precision unavailable; conversion may have been impossible"),
|
|
1629
|
-
direction: z.union([z.literal("raw_to_unit"), z.literal("unit_to_raw")]),
|
|
1630
|
-
input: z.string().describe("Input value as provided"),
|
|
1631
|
-
output: z.string().describe("Converted value (empty string when conversion was impossible)"),
|
|
1632
|
-
error: z.string().optional().describe("Hard failure reason (e.g. unit→raw without known precision)"),
|
|
1633
|
-
text: z.string().describe("One-line human text with the decimals reminder"),
|
|
1634
|
-
}).strict().describe("Bidirectional token value conversion result — see Fund Processing Layer"),
|
|
1635
|
-
}).strict(),
|
|
1636
|
-
]);
|
|
1637
|
-
export const AllQueryResultsSchema = z.union([
|
|
1638
|
-
LocalQueryResultSchema,
|
|
1639
|
-
OnchainQueryResultSchema_Part1,
|
|
1640
|
-
OnchainQueryResultSchema_Part2,
|
|
1641
|
-
OnchainQueryResultSchema_Part3,
|
|
1642
|
-
]);
|
|
1643
|
-
export const WatchQueryOperationsResultSchema = z.object({
|
|
1644
|
-
result: AllQueryResultsSchema,
|
|
1645
|
-
semantic: SemanticSummarySchema.optional().describe("Business semantic summary for the query operation"),
|
|
1646
|
-
}).describe("Watch query operations result schema");
|
|
1
|
+
import{z}from'zod';import{TokenTypeInfoSchema,QueryLocalMarkListResultSchema,QueryAccountListResultSchema,QueryLocalInfoListResultSchema,QueryLocalTokenListResultSchema,QueryAccountResultSchema}from'../local/index.js';import{AccountOrMark_AddressSchema,BalanceTypeSchema,CacheExpireTypeSchema,EntrypointSchema,GuardIdentifierSchema,GuardTableItemSchema,NameOrAddressSchema,ObjectBaseSchema,ObjectTypeSchema,QueryIdSchema,SupportedValueSchema,ValueTypeSchema,QueryReceivedResultSchema,LongNameSchema,DescriptionSchema}from'../common/index.js';import{SemanticSummarySchema}from'../call/index.js';import{isValidPermissionIndex}from'../utils/permission-index-utils.js';import{isValidGuardQueryId,isValidGuardQueryIdOrName,isValidWitnessType}from'../utils/guard-query-utils.js';import{ENTITY_LINKER_ADDRESS,ENTITY_REGISTRAR_ADDRESS,isWitnessType}from'@wowok/wowok';import{QueryEnvSchema}from'../common/index.js';const MAX_MULTI_OPERANDS=0x8,VALUE_TYPE_DESCRIPTION='Value\x20type:\x20can\x20be\x20specified\x20as\x20a\x20string\x20name\x20(e.g.,\x20\x27U64\x27,\x20\x27Address\x27,\x20\x27String\x27)\x20or\x20a\x20number\x20(0-18).\x20Supported\x20types:\x20Bool=0/\x27Bool\x27,\x20Address=1/\x27Address\x27,\x20String=2/\x27String\x27,\x20U8=3/\x27U8\x27,\x20U16=4/\x27U16\x27,\x20U32=5/\x27U32\x27,\x20U64=6/\x27U64\x27,\x20U128=7/\x27U128\x27,\x20U256=8/\x27U256\x27,\x20VecBool=9/\x27VecBool\x27,\x20VecAddress=10/\x27VecAddress\x27,\x20VecString=11/\x27VecString\x27,\x20VecU8=12/\x27VecU8\x27,\x20VecU16=13/\x27VecU16\x27,\x20VecU32=14/\x27VecU32\x27,\x20VecU64=15/\x27VecU64\x27,\x20VecU128=16/\x27VecU128\x27,\x20VecU256=17/\x27VecU256\x27,\x20VecVecU8=18/\x27VecVecU8\x27.\x20Note:\x20Value=19\x20is\x20an\x20INTERNAL\x20type\x20for\x20wowok\x20system\x20use\x20only\x20and\x20should\x20NOT\x20be\x20used\x20directly\x20by\x20users.\x20String\x20format\x20is\x20recommended\x20for\x20better\x20readability.',tolerantNumber=z['union']([z['number'](),z['string']()]),tolerantStringNullable=z['union']([z['string'](),z['null'](),z['undefined']()]),tolerantNumberNullable=z['union']([z['number'](),z['string'](),z['null'](),z['undefined']()]);export const AmountTypeSchema=z['union']([z['enum'](['GuardU64Identifier','Fixed']),z['number']()['int']()['min'](0x0)['max'](0x1)['transform'](a=>a===0x0?'GuardU64Identifier':a===0x1?'Fixed':'GuardU64Identifier')])['describe']('Amount\x20type\x20—\x20determines\x20how\x20a\x20payment\x20amount\x20is\x20resolved.\x20'+'Accepts\x20string\x20(\x27GuardU64Identifier\x27\x20or\x20\x27Fixed\x27)\x20or\x20number\x20(0=\x27GuardU64Identifier\x27,\x201=\x27Fixed\x27).\x20String\x20form\x20is\x20recommended\x20for\x20readability.\x20'+'•\x20\x27GuardU64Identifier\x27\x20(0):\x20the\x20amount\x20is\x20NOT\x20fixed\x20—\x20it\x20is\x20dynamically\x20read\x20from\x20a\x20U64\x20value\x20stored\x20in\x20the\x20Guard\x20table\x20at\x20the\x20specified\x20Identifier\x20index.\x20Use\x20this\x20when\x20the\x20amount\x20varies\x20per\x20order\x20(e.g.\x20milestone-based\x20pricing,\x20negotiated\x20price).\x20The\x20Guard\x20must\x20have\x20a\x20matching\x20U64\x20entry.\x20'+'•\x20\x27Fixed\x27\x20(1):\x20the\x20amount\x20is\x20a\x20fixed\x20value\x20set\x20in\x20the\x20sale/price\x20field.\x20Use\x20this\x20for\x20products\x20with\x20a\x20static\x20price\x20(e.g.\x20service\x20fee\x20=\x2050\x20SUI).\x20'+'Example:\x20{price:\x2050000000000,\x20stock:\x20100,\x20amount_type:\x20\x27Fixed\x27}\x20→\x20fixed\x2050\x20SUI\x20price.\x20'+'Example:\x20{price:\x200,\x20stock:\x20100,\x20amount_type:\x20\x27GuardU64Identifier\x27}\x20→\x20price\x20read\x20from\x20Guard\x20table\x20U64\x20entry.');export const GuardQuerySchema=z['object']({'id':QueryIdSchema,'name':z['string']()['describe']('Name\x20of\x20the\x20query\x20instruction.'),'objectType':ObjectTypeSchema['describe']('Type\x20of\x20the\x20Object\x20that\x20the\x20query\x20instruction\x20operates\x20on.'),'parameters':z['array'](ValueTypeSchema)['describe']('List\x20of\x20parameter\x20types\x20for\x20the\x20query\x20instruction.'),'return':ValueTypeSchema['describe']('Return\x20value\x20type\x20of\x20the\x20query\x20instruction.'),'description':z['string']()['describe']('Detailed\x20description\x20of\x20the\x20query\x20instruction.'),'parameters_description':z['array'](z['string']())['describe']('Detailed\x20descriptions\x20of\x20the\x20query\x20instruction\x20parameters.')});export const GuardSubmissionSchema=z['object']({'identifier':GuardIdentifierSchema['describe']('Identifier'),'value_type':ValueTypeSchema['describe']('Value\x20type'),'value':SupportedValueSchema['describe']('Value')})['describe']('Guard\x20submission');export const RecipientSchema=z['union']([z['object']({'GuardIdentifier':GuardIdentifierSchema})['describe']('Guard\x20verified\x20recipient\x20ID.\x20Get\x20recipient\x20ID\x20from\x20specified\x20data\x20index\x20in\x20Guard\x20table.\x20The\x20ID\x20must\x20be\x20of\x20address\x20type.'),z['object']({'Entity':AccountOrMark_AddressSchema})['describe']('Static\x20address\x20resolved\x20via\x20LocalMark.\x20'+'Format:\x20{Entity:\x20{name_or_address:\x20\x27mark_name\x27}}\x20—\x20NOTE:\x20Entity\x20is\x20an\x20OBJECT\x20with\x20name_or_address\x20field,\x20NOT\x20a\x20bare\x20string.'),z['object']({'Signer':z['literal']('signer')})['describe']('Current\x20transaction\x20signer\x20(tx_context::sender)\x20at\x20the\x20time\x20of\x20the\x20alloc()\x20call.\x20'+'For\x20refunds,\x20the\x20Order\x20owner\x20must\x20call\x20alloc_by_guard\x20themselves\x20to\x20receive\x20the\x20funds.')])['describe']('Recipient\x20ID.\x20Three\x20forms:\x0a'+'\x20\x20-\x20{GuardIdentifier:\x20u8}\x20\x20—\x20DYNAMIC\x20address\x20resolved\x20from\x20Passport\x20at\x20alloc()\x20time\x0a'+'\x20\x20-\x20{Entity:\x20{name_or_address:\x20\x27mark_name\x27}}\x20\x20—\x20FIXED\x20static\x20address\x20via\x20LocalMark\x20(recommended)\x0a'+'\x20\x20-\x20{Signer:\x20\x27signer\x27}\x20\x20—\x20transaction\x20sender\x20at\x20alloc()\x20time\x20(e.g.\x20self-refund;\x20customer\x20must\x20call\x20alloc_by_guard\x20themselves)');export const RecordsInEntitySchema=z['object']({'name':z['string']()['describe']('Record\x20name'),'value_type':ValueTypeSchema['describe']('Value\x20type'),'value':SupportedValueSchema['describe']('Value')})['describe']('Information\x20record');export const PermissionIndexTypeSchema=z['number']()['int']()['refine'](a=>{return isValidPermissionIndex(a);},{'message':'Permission\x20index\x20must\x20be\x20a\x20valid\x20BuiltinPermissionIndex\x20value\x20or\x20user\x20defined\x20between\x201000\x20and\x2065535'})['describe']('Permission\x20index\x20type');export const VoteInEntityLinkerSchema=z['object']({'address':z['string']()['describe']('Account\x20or\x20object\x20ID'),'like':z['boolean']()['optional']()['describe']('Whether\x20liked'),'dislike':z['boolean']()['optional']()['describe']('Whether\x20disliked'),'affiliation':z['boolean']()['optional']()['describe']('Whether\x20affiliated'),'time':tolerantNumber['describe']('Time')})['describe']('Follow\x20record');export const ObjectEntityRegistrarSchema=ObjectBaseSchema['extend']({'entity_count':z['number']()['describe']('Entity\x20count.\x20Number\x20of\x20entities\x20registered\x20in\x20the\x20entity\x20registrar\x20table.\x20Use\x20\x27query_table\x27\x20or\x20\x27query_table_item\x27\x20to\x20get\x20\x27EntityRegistrar\x27\x20table\x20items.')})['describe']('On-chain\x20entity\x20registrar');export const ObjectEntityLinkerSchema=ObjectBaseSchema['extend']({'entity_count':z['number']()['describe']('Entity\x20count.\x20Number\x20of\x20entities\x20registered\x20in\x20the\x20entity\x20linker\x20table.\x20Use\x20\x27query_table\x27\x20or\x20\x27query_table_item\x27\x20to\x20get\x20\x27EntityLinker\x27\x20table\x20items.')})['describe']('On-chain\x20entity\x20linker');export const ObjectResourceSchema=ObjectBaseSchema['extend']({'entity_count':z['number']()['describe']('Entity\x20count.\x20Number\x20of\x20entities\x20registered\x20in\x20the\x20address\x20mark\x20table.\x20Use\x20\x27query_table\x27\x20or\x20\x27query_table_item\x27\x20to\x20get\x20\x27AddressMark\x27\x20table\x20items.')})['describe']('On-chain\x20address\x20tag\x20manager');export const TableItem_EntityLinkerSchema=ObjectBaseSchema['extend']({'address':z['string']()['describe']('Followed\x20ID'),'pos':tolerantNumber['describe']('Current\x20follow\x20information\x20position'),'count':tolerantNumber['describe']('Follower\x20count.\x20Number\x20of\x20entities\x20who\x20have\x20been\x20followed\x20others.\x20Use\x20\x27query_table\x27\x20or\x20\x27query_table_item\x27\x20to\x20get\x20\x27EntityLinker\x27\x20table\x20items.'),'votes':z['array'](VoteInEntityLinkerSchema)['describe']('Follow\x20records')})['describe']('On-chain\x20followed\x20object\x20data');export const TableItem_EntityRegistrarSchema=ObjectBaseSchema['extend']({'address':z['string']()['describe']('Entity\x20ID'),'description':z['string']()['describe']('Entity\x20description'),'time':tolerantNumber['describe']('On-chain\x20registration\x20time'),'referrer':tolerantStringNullable['describe']('Referrer'),'mark_object':tolerantStringNullable['describe']('Your\x20on-chain\x20address\x20mark\x20object\x20by\x20entity\x20ID'),'records':z['array'](RecordsInEntitySchema)['describe']('Information\x20records')})['describe']('On-chain\x20entity\x20data');export const TableItem_AddressMarkSchema=ObjectBaseSchema['extend']({'entity':z['string']()['describe']('Entity\x20ID'),'name':z['string']()['describe']('Tag\x20name'),'tags':z['array'](z['string']())['describe']('Tag\x20list')})['describe']('On-chain\x20ID\x20mark\x20data');export const ServiceGuardSchema=z['object']({'guard':z['string']()['describe']('Service\x20guard'),'service_identifier':z['union']([GuardIdentifierSchema,z['null']()])['optional']()['describe']('Service\x20identifier.\x20Used\x20to\x20determine\x20the\x20service\x20verified\x20in\x20Guard')})['describe']('Service\x20guard');export const ObjectDemandSchema=ObjectBaseSchema['extend']({'description':z['string']()['describe']('Demand\x20description'),'location':z['string']()['describe']('Demand\x20location'),'rewards':z['array'](z['string']())['describe']('Reward\x20list.\x20Used\x20to\x20incentivize\x20qualified\x20Presenters\x20to\x20claim\x20rewards'),'guards':z['array'](ServiceGuardSchema)['describe']('Service\x20Guard\x20list'),'presenters_count':z['number']()['describe']('Presenter\x20count.\x20Number\x20of\x20Presenters\x20who\x20have\x20submitted\x20their\x20demand.\x20Use\x20\x27query_table\x27\x20or\x20\x27query_table_item\x27\x20to\x20get\x20\x27DemandPresenter\x27\x20table\x20items.'),'um':z['union']([z['string'](),z['null']()])['describe']('Contact\x20object'),'permission':z['string']()['describe']('Permission')})['describe']('Demand\x20object');export const ObjectMachineSchema=ObjectBaseSchema['extend']({'description':z['string']()['describe']('Machine\x20description'),'node_count':z['number']()['describe']('Node\x20count.\x20Nodes\x20are\x20used\x20to\x20determine\x20each\x20step\x20and\x20state\x20of\x20Machine\x20operation.\x20Use\x20\x27query_table\x27\x20or\x20\x27query_table_item\x27\x20to\x20get\x20\x27MachineNode\x27\x20table\x20items.'),'consensus_repositories':z['array'](z['string']())['describe']('Consensus\x20repository\x20list.\x20Used\x20to\x20determine\x20consensus\x20data\x20storage\x20during\x20Machine\x20operation.'),'bPaused':z['boolean']()['describe']('Whether\x20paused'),'bPublished':z['boolean']()['describe']('Whether\x20published'),'um':z['union']([z['string'](),z['null']()])['describe']('Contact\x20object'),'permission':z['string']()['describe']('Permission\x20object\x20ID.\x20Used\x20to\x20modify\x20operation\x20permission\x20settings\x20for\x20Machine\x20settings.')})['describe']('Machine\x20object');export const ServiceSaleSchema=z['object']({'name':LongNameSchema['describe']('Name\x20of\x20the\x20product\x20or\x20service\x20for\x20sale'),'price':BalanceTypeSchema['describe']('Price\x20of\x20the\x20product\x20or\x20service'),'stock':BalanceTypeSchema['describe']('Stock\x20of\x20the\x20product\x20or\x20service'),'suspension':z['boolean']()['describe']('Whether\x20sale\x20is\x20suspended'),'wip':z['string']()['describe']('WIP\x20file\x20URL.\x20EMPTY\x20string\x20\x22\x22\x20skips\x20verification\x20(TESTING\x20ONLY).\x20'+'Production\x20MUST\x20use\x20a\x20real\x20HTTP\x20URL\x20pointing\x20to\x20a\x20.wip\x20file\x20generated\x20by\x20the\x20wip_file\x20tool.\x20'+'⚠️\x20NETWORK\x20DEPLOYMENT\x20REQUIRED:\x20the\x20URL\x20is\x20stored\x20ON-CHAIN\x20and\x20every\x20customer\x20fetches\x20it\x20'+'when\x20placing\x20an\x20order.\x20A\x20local\x20file\x20path\x20(C:\x5c...,\x20/path/file.wip),\x20a\x20localhost/loopback\x20URL\x20'+'or\x20a\x20LAN\x20private-IP\x20URL\x20is\x20unreachable\x20by\x20customers\x20on\x20other\x20machines\x20—\x20it\x20passes\x20the\x20'+'merchant-side\x20set-time\x20verification\x20but\x20makes\x20order_new\x20abort\x20100%\x20for\x20customers.\x20'+'Either\x20deploy\x20the\x20.wip\x20file\x20to\x20a\x20public\x20endpoint\x20(GitHub\x20Pages\x20/\x20IPFS\x20/\x20your\x20own\x20website)\x20'+'and\x20set\x20this\x20to\x20the\x20public\x20URL,\x20or\x20leave\x20it\x20empty\x20(\x22\x22)\x20to\x20skip\x20WIP\x20verification\x20(TESTING\x20ONLY).\x20'+'Example:\x20\x22https://cdn.example.com/products/phone_v1.wip\x22'),'wip_hash':z['string']()['describe']('SHA-256\x20hash\x20(hex\x20string)\x20of\x20the\x20sale\x27s\x20WIP\x20file,\x20committed\x20on-chain\x20by\x20the\x20merchant.\x20'+'BUY\x20RULE:\x20if\x20this\x20is\x20NON-EMPTY,\x20the\x20buyer\x20MUST\x20pass\x20this\x20exact\x20value\x20as\x20wip_hash\x20when\x20creating\x20an\x20order\x20'+'(ServiceBuyItem.wip_hash)\x20—\x20NEVER\x20use\x20\x22\x22.\x20Pinning\x20the\x20on-chain\x20hash\x20prevents\x20the\x20merchant\x20from\x20replacing\x20'+'the\x20WIP\x20file\x20(a\x20legitimate\x20update)\x20between\x20the\x20buyer\x27s\x20view\x20and\x20order\x20placement,\x20ensuring\x20\x27what\x20you\x20see\x20is\x20'+'what\x20you\x20get\x27.\x20EMPTY\x20means\x20no\x20hash\x20was\x20committed\x20(TESTING\x20ONLY,\x20no\x20delivery-integrity\x20guarantee).')})['describe']('Service\x20sale');export const PurchasedItemSchema=z['object']({'name':LongNameSchema['describe']('Name\x20of\x20the\x20product\x20or\x20service'),'price':BalanceTypeSchema['describe']('Service\x20price'),'quantity':BalanceTypeSchema['describe']('Service\x20quantity'),'wip_hash':z['string']()['describe']('WIP\x20file\x20hash\x20of\x20the\x20item')});export const ObjectOrderSchema=ObjectBaseSchema['extend']({'items':z['array'](PurchasedItemSchema)['describe']('Purchased\x20service\x20list'),'discount':z['union']([z['string'](),z['null']()])['describe']('Used\x20discount\x20object\x20ID'),'progress':z['union']([z['string'](),z['null']()])['describe']('Order\x20progress\x20object\x20ID'),'machine':z['union']([z['string'](),z['null']()])['describe']('Machine\x20ID\x20that\x20progress\x20belongs\x20to'),'amount':BalanceTypeSchema['describe']('Order\x20amount'),'builder':z['string']()['describe']('Purchaser\x20ID'),'service':z['string']()['describe']('Service\x20ID'),'dispute':z['array'](z['string']())['describe']('Arb\x20object\x20ID\x20list.\x20When\x20unsatisfied\x20with\x20order\x20delivery,\x20dispute\x20objects\x20can\x20be\x20created.'),'agent':z['array'](z['string']())['describe']('Agent\x20ID\x20list.\x20Agents\x20handle\x20all\x20order\x20operations\x20except\x20payment\x20collection.'),'allocation':z['union']([z['string'](),z['null']()])['describe']('Order\x20amount\x20allocation\x20object\x20ID'),'claimed_by':z['union']([z['string'](),z['null']()])['describe']('Order\x20dispute\x20object\x20ID\x20that\x20has\x20claimed\x20order\x20arbitration\x20amount.'),'required_info':z['union']([z['string'](),z['null']()])['describe']('Contact\x20object\x20ID\x20(recipient)\x20or\x20WTS\x20Proof\x20object\x20(delivery\x20proof)\x20that\x20information\x20has\x20been\x20delivered\x20via\x20Wowok\x20Messenger.'),'time':z['union']([z['string'](),z['number']()])['describe']('Order\x20creation\x20time')});export const NamedOperatorSchema=z['object']({'name':z['string']()['describe']('Namespace\x20name'),'operators':z['array'](z['string']())['describe']('Operator\x20ID\x20list')})['describe']('Namespace\x20operator.\x20Namespace\x20is\x20a\x20permission\x20identifier\x20defined\x20in\x20Machine,\x20allowing\x20different\x20Progress\x20to\x20bind\x20different\x20operators\x20to\x20exercise\x20unified\x20permission\x20definitions.');export const ProgressSessionHolderSchema=z['object']({'forward':z['string']()['describe']('An\x20operation\x20name'),'who':z['union']([z['string'](),z['null']()])['describe']('Operator\x20ID'),'retained_submission':z['array'](GuardSubmissionSchema)['describe']('Used\x20to\x20define\x20submitted\x20data\x20after\x20Guard\x20verification'),'msg':z['string']()['describe']('Information\x20submitted\x20to\x20complete\x20operation'),'accomplished':z['boolean']()['describe']('Whether\x20completed'),'time':tolerantNumber['describe']('Session\x20creation\x20time')})['describe']('An\x20operation\x20in\x20Progress\x20session');export const ProgressSessionSchema=z['object']({'next_node':z['string']()['describe']('Next\x20node\x20ID'),'forwards':z['array'](ProgressSessionHolderSchema)['describe']('Operation\x20list\x20in\x20Progress\x20session'),'weights':tolerantNumber['describe']('Total\x20operation\x20weight'),'threshold':tolerantNumber['default'](0x0)['describe']('Operation\x20threshold.\x20When\x20total\x20operation\x20weight\x20exceeds\x20threshold,\x20session\x20is\x20considered\x20completed\x20and\x20Progress\x20moves\x20from\x20current\x20node\x20to\x20next\x20node.')})['describe']('Progress\x20session');export const ObjectProgressSchema=ObjectBaseSchema['extend']({'machine':z['string']()['describe']('Machine\x20ID\x20that\x20Progress\x20object\x20belongs\x20to'),'context_repositories':z['array'](z['string']())['describe']('Context\x20repository\x20list.\x20Used\x20to\x20store\x20context\x20data\x20during\x20Progress\x20operation.'),'current':z['string']()['describe']('Current\x20node\x20name'),'task':z['union']([z['string'](),z['null']()])['describe']('Target\x20task\x20ID\x20executed\x20by\x20Progress\x20(e.g.,\x20Order\x20ID)'),'namedOperator':z['array'](NamedOperatorSchema)['describe']('Namespace\x20operator\x20list.\x20Each\x20process\x20can\x20independently\x20maintain\x20operators\x20for\x20permissions\x20represented\x20by\x20its\x20namespace.'),'session':z['array'](ProgressSessionSchema)['describe']('Progress\x20session\x20list'),'history_count':z['number']()['describe']('Number\x20of\x20historical\x20sessions\x20for\x20completed\x20nodes\x20in\x20Progress.\x20Use\x20\x27query_table\x27\x20or\x20\x27query_table_item\x27\x20to\x20get\x20\x27ProgressHistory\x27\x20table\x20items.'),'current_time':z['number']()['describe']('Current\x20node\x20entry\x20timestamp')})['describe']('Progress\x20object');export const AmountSchema=z['discriminatedUnion']('type',[z['object']({'type':z['literal']('GuardU64Identifier'),'value':GuardIdentifierSchema})['describe']('Guard\x20verified\x20amount.\x20Get\x20amount\x20value\x20from\x20specified\x20data\x20index\x20in\x20Guard\x20table.\x20The\x20value\x20type\x20must\x20be\x20u64.'),z['object']({'type':z['literal']('Fixed'),'value':BalanceTypeSchema})['describe']('Fixed\x20amount')])['describe']('Amount');export const RewardGuardSchema=z['object']({'guard':NameOrAddressSchema['describe']('Guard\x20object\x20ID\x20or\x20name.'),'recipient':RecipientSchema,'amount':AmountSchema['describe']('Reward\x20amount'),'expiration_time':z['number']()['optional']()['describe']('Reward\x20Guard\x20expiration\x20time.\x20If\x20set,\x20the\x20reward\x20cannot\x20be\x20claimed\x20by\x20this\x20guard\x20after\x20the\x20expiration\x20time.\x20If\x20not\x20specified,\x20Reward\x20Guard\x20is\x20permanently\x20valid.'),'store_from_id':z['union']([GuardIdentifierSchema,z['null']()])['optional']()['describe']('Guard\x20table\x20data\x20index\x20for\x20record\x20storage.\x20The\x20value\x20at\x20this\x20index\x20(address\x20or\x20number,\x20including\x20submitted\x20values)\x20will\x20be\x20stored\x20in\x20the\x20record\x20for\x20Guard\x20verification\x20purposes,\x20such\x20as\x20controlling\x20operation\x20frequency.')})['describe']('Reward\x20Guard\x20type');export const ObjectRewardSchema=ObjectBaseSchema['extend']({'description':z['string']()['describe']('Reward\x20object\x20description'),'guards':z['array'](RewardGuardSchema)['describe']('Reward\x20Guard\x20list.\x20When\x20one\x20of\x20the\x20Guards\x20is\x20successfully\x20verified\x20in\x20a\x20transaction,\x20the\x20relevant\x20recipient\x20will\x20receive\x20the\x20reward\x20amount.'),'balance':BalanceTypeSchema['describe']('Current\x20balance\x20of\x20reward\x20object'),'guard_not_added_expiration_time':z['union']([z['string'](),z['number'](),z['null']()])['describe']('Used\x20to\x20lock\x20whether\x20new\x20Reward\x20Guards\x20can\x20be\x20added.\x20If\x20not\x20specified,\x20new\x20Reward\x20Guards\x20can\x20be\x20added\x20at\x20any\x20time;\x20if\x20expiration\x20time\x20is\x20specified,\x20new\x20Reward\x20Guards\x20cannot\x20be\x20added\x20before\x20expiration.'),'record_count':z['number']()['describe']('Number\x20of\x20reward\x20claimer\x20records.\x20Use\x20\x27query_table\x27\x20or\x20\x27query_table_item\x27\x20to\x20get\x20\x27RewardRecord\x27\x20table\x20items.'),'um':z['union']([z['string'](),z['null']()])['describe']('Contact\x20object'),'permission':z['string']()['describe']('Permission\x20object\x20ID')})['describe']('Reward\x20object');export const AllocationModeSchema=z['union']([z['enum'](['Amount','Rate','Surplus']),z['number']()['int']()['min'](0x0)['max'](0x2)['transform'](a=>a===0x0?'Amount':a===0x1?'Rate':a===0x2?'Surplus':'Amount')])['describe']('Allocation\x20mode\x20—\x20determines\x20how\x20the\x20`sharing`\x20field\x20is\x20interpreted.\x20'+'Three\x20modes\x20can\x20be\x20used\x20individually\x20OR\x20combined\x20within\x20a\x20single\x20Allocator;\x20'+'when\x20combined,\x20allocation\x20order\x20is\x20strictly:\x20Amount\x20first,\x20then\x20Rate,\x20then\x20Surplus.\x20'+'Understanding\x20these\x20modes\x20allows\x20modeling\x20almost\x20any\x20fund\x20distribution\x20pattern.\x0a'+'•\x20Amount\x20(0):\x20`sharing`\x20is\x20a\x20FIXED\x20amount\x20in\x20smallest\x20unit\x20(e.g.,\x20\x27750000000\x27\x20=\x200.75\x20WOW).\x20'+'Allocated\x20FIRST;\x20sum\x20of\x20all\x20Amount\x20items\x20is\x20cached\x20as\x20`fix`\x20by\x20the\x20contract.\x20'+'Validation:\x20when\x20no\x20Rate\x20and\x20no\x20Surplus\x20items\x20exist,\x20sum\x20of\x20Amount\x20items\x20must\x20be\x20>=\x20allocators.threshold\x20(EAMOUNT_BELOW_THRESHOLD=12);\x20'+'when\x20`max`\x20is\x20set,\x20sum\x20of\x20Amount\x20items\x20must\x20be\x20<=\x20max\x20(EAMOUNT_EXCEEDS_MAX=13).\x0a'+'•\x20Rate\x20(1):\x20`sharing`\x20is\x20a\x20basis-points\x20rate\x20(10000\x20=\x20100%).\x20'+'Allocated\x20AFTER\x20Amount;\x20formula:\x20allocated\x20=\x20(sharing\x20×\x20total_rates)\x20/\x2010000,\x20'+'where\x20total_rates\x20=\x20balance\x20-\x20fix\x20(or\x20max\x20-\x20fix\x20if\x20`max`\x20is\x20set).\x20'+'Validation:\x20when\x20no\x20Surplus\x20items\x20exist,\x20sum\x20of\x20all\x20Rate\x20items\x20must\x20be\x20EXACTLY\x2010000\x20(ERATE_NOT_10000=4);\x20'+'when\x20Surplus\x20items\x20exist,\x20sum\x20of\x20all\x20Rate\x20items\x20must\x20be\x20<=\x2010000\x20(ERATE_EXCEEDS_10000=6).\x0a'+'•\x20Surplus\x20(2):\x20`sharing`\x20is\x20IGNORED\x20(contract\x20forces\x20it\x20to\x200).\x20'+'Allocated\x20LAST;\x20receives\x20the\x20remaining\x20balance\x20after\x20Amount\x20+\x20Rate\x20allocations.\x20'+'Validation:\x20MAX\x20ONE\x20Surplus\x20item\x20per\x20Allocator\x20(EMULTIPLE_SURPLUS=5).\x20'+'When\x20Surplus\x20exists,\x20Rate\x20sum\x20constraint\x20relaxes\x20from\x20==\x2010000\x20to\x20<=\x2010000.\x0a'+'ALLOCATION\x20ORDER\x20(strict):\x20Amount\x20items\x20(fixed,\x20cached\x20as\x20fix)\x20→\x20Rate\x20items\x20(proportional\x20to\x20balance-fix)\x20→\x20Surplus\x20item\x20(remaining).\x0a'+'RECOMMENDATION:\x20Use\x20Amount\x20mode\x20for\x20known\x20fixed\x20amounts\x20(clearer,\x20no\x20sum\x20constraint).\x20'+'Use\x20Rate\x20mode\x20for\x20proportional\x20splits\x20(requires\x20sum\x20==\x2010000\x20unless\x20Surplus\x20present).\x20'+'Use\x20Surplus\x20to\x20capture\x20remainder\x20(e.g.,\x20platform\x20fee\x20+\x20host\x20gets\x20rest).\x20'+'Accepts\x20string\x20(\x27Amount\x27/\x27Rate\x27/\x27Surplus\x27,\x20recommended)\x20or\x20number\x20(0/1/2).');export const AllocationSharingSchema=z['object']({'who':RecipientSchema['describe']('Recipient\x20of\x20this\x20allocation.\x20Three\x20forms\x20—\x20each\x20resolves\x20the\x20address\x20at\x20a\x20DIFFERENT\x20time:\x0a'+'•\x20{\x20GuardIdentifier:\x20u8\x20}\x20—\x20DYNAMIC\x20address\x20resolved\x20from\x20Passport\x20at\x20alloc()\x20time\x20(contract\x20calls\x20passport::submission_get).\x20'+'Use\x200\x20for\x20Order\x20owner\x20in\x20Service-integrated\x20mode\x20(Customer\x20who\x20created\x20the\x20Order).\x20'+'The\x20identifier\x20must\x20match\x20a\x20Guard\x20table\x20entry\x20with\x20b_submission=true.\x20'+'If\x20Passport\x20has\x20no\x20matching\x20submission,\x20contract\x20aborts\x20with\x20E_VERIFY_FAILED.\x20'+'Use\x20when\x20the\x20recipient\x20address\x20is\x20not\x20known\x20at\x20config\x20time\x20and\x20must\x20be\x20supplied\x20via\x20Guard\x20submission\x20data.\x0a'+'•\x20{\x20Entity:\x20{\x20name_or_address:\x20\x27...\x27\x20}\x20}\x20—\x20FIXED\x20address\x20resolved\x20via\x20LocalMark\x20at\x20SDK\x20build\x20time\x20(passed\x20to\x20contract\x20as\x20a\x20literal\x20address).\x20'+'Use\x20for\x20known\x20recipients\x20(e.g.,\x20\x27turo_host\x27,\x20or\x20a\x20Treasury\x20object\x20address).\x20'+'Use\x20when\x20the\x20recipient\x20is\x20a\x20stable,\x20known\x20address\x20(e.g.,\x20operator\x20receives\x20rent,\x20platform\x20fee\x20to\x20treasury).\x0a'+'•\x20\x27Signer\x27\x20—\x20the\x20transaction\x20sender\x20at\x20the\x20time\x20of\x20the\x20alloc()\x20call\x20(tx_context::sender).\x20'+'RESOLVED\x20AT\x20EXECUTION\x20TIME,\x20not\x20at\x20config\x20time.\x20'+'For\x20refunds:\x20the\x20customer\x20(Order\x20owner)\x20must\x20call\x20alloc_by_guard\x20THEMSELVES\x20so\x20that\x20tx_context::sender\x20resolves\x20to\x20THEIR\x20address\x20—\x20'+'if\x20the\x20operator\x20calls\x20alloc_by_guard,\x20the\x20operator\x20becomes\x20the\x20recipient\x20(Signer\x20=\x20operator),\x20NOT\x20the\x20customer.\x20'+'Use\x20when\x20the\x20recipient\x20is\x20whoever\x20submits\x20the\x20allocation\x20transaction\x20(e.g.,\x20customer\x20receives\x20refund).'),'sharing':BalanceTypeSchema['describe']('Allocation\x20value.\x20SEMANTICS\x20DEPEND\x20ON\x20`mode`:\x0a'+'•\x20mode=\x27Amount\x27:\x20absolute\x20amount\x20in\x20smallest\x20unit\x20(e.g.,\x20\x27750000000\x27\x20for\x200.75\x20WOW,\x20\x27250000000\x27\x20for\x200.25\x20WOW).\x20'+'Allocated\x20first;\x20sum\x20of\x20Amount\x20items\x20cached\x20as\x20`fix`.\x0a'+'•\x20mode=\x27Rate\x27:\x20basis-points\x20rate,\x2010000\x20=\x20100%\x20(e.g.,\x20\x277500\x27\x20for\x2075%,\x20\x272500\x27\x20for\x2025%).\x20'+'When\x20no\x20Surplus\x20in\x20same\x20Allocator,\x20sum\x20MUST\x20==\x2010000;\x20when\x20Surplus\x20present,\x20sum\x20MUST\x20<=\x2010000.\x0a'+'•\x20mode=\x27Surplus\x27:\x20IGNORED\x20(contract\x20forces\x20to\x200).\x20Set\x20to\x20\x270\x27\x20for\x20clarity.\x20'+'Receives\x20remaining\x20balance\x20after\x20Amount\x20+\x20Rate\x20allocations.\x0a'+'⚠️\x20T1\x20LOSSY\x20POINT\x20(B-2):\x20the\x20value\x20is\x20PRE-CONFIGURED\x20and\x20STATIC.\x20A\x20continuous/conditional\x20amount\x20'+'(e.g.\x20\x27pay\x20exactly\x20the\x20assessed\x20loss\x20amount\x27)\x20CANNOT\x20be\x20expressed\x20—\x20there\x20is\x20no\x20runtime\x20formula\x20field.\x20'+'Model\x20variable\x20payouts\x20as\x20(a)\x20a\x20fixed-tier\x20Allocator\x20list\x20guarded\x20by\x20distinct\x20Guards,\x20or\x20(b)\x20an\x20Amount\x20'+'with\x20a\x20`max`\x20cap\x20—\x20both\x20are\x20finite\x20configurations,\x20not\x20free-form\x20formulas.'),'mode':AllocationModeSchema})['describe']('Fund\x20allocation\x20item\x20—\x20one\x20recipient\x27s\x20share\x20of\x20the\x20Allocation\x20balance.\x20'+'The\x20`sharing`\x20value\x27s\x20meaning\x20depends\x20on\x20`mode`\x20(see\x20AllocationModeSchema).\x20'+'Multiple\x20items\x20in\x20the\x20same\x20Allocator\x20are\x20evaluated\x20together:\x20Amount\x20items\x20first,\x20Rate\x20items\x20second,\x20Surplus\x20last.');export const AllocatorSchema=z['object']({'guard':NameOrAddressSchema['describe']('Guard\x20object\x20ID\x20or\x20name.\x20If\x20Guard\x20verification\x20passes\x20(via\x20Passport),\x20fund\x20allocation\x20for\x20THIS\x20Allocator\x20fires.\x20'+'Each\x20Allocator\x20in\x20an\x20Allocators\x20list\x20can\x20have\x20a\x20different\x20Guard\x20—\x20the\x20first\x20Allocator\x20whose\x20Guard\x20returns\x20true\x20wins.\x20'+'This\x20enables\x20mutually\x20exclusive\x20allocation\x20paths\x20(e.g.,\x20refund\x20Guard\x20on\x20\x27return_approved\x27\x20node\x20vs\x20damage\x20Guard\x20on\x20\x27damage_confirmed\x27\x20node).'),'sharing':z['array'](AllocationSharingSchema)['describe']('Fund\x20allocation\x20item\x20list.\x20Each\x20item\x20specifies\x20a\x20recipient\x20(who),\x20a\x20value\x20(sharing),\x20and\x20a\x20mode.\x20'+'Items\x20can\x20mix\x20modes\x20(Amount\x20+\x20Rate\x20+\x20Surplus)\x20within\x20the\x20same\x20Allocator.\x20'+'ALLOCATION\x20ORDER:\x20Amount\x20items\x20first\x20(cached\x20as\x20fix)\x20→\x20Rate\x20items\x20(proportional\x20to\x20balance\x20-\x20fix)\x20→\x20Surplus\x20item\x20(remaining).\x20'+'CONSTRAINTS:\x20max\x20ONE\x20Surplus\x20item\x20per\x20Allocator;\x20Rate\x20sum\x20must\x20==\x2010000\x20(no\x20Surplus)\x20or\x20<=\x2010000\x20(with\x20Surplus);\x20'+'Amount\x20sum\x20must\x20>=\x20threshold\x20(no\x20Rate\x20and\x20no\x20Surplus)\x20and\x20<=\x20max\x20(if\x20max\x20set).'),'fix':BalanceTypeSchema['optional']()['describe']('OUTPUT-ONLY\x20(query\x20result).\x20Cached\x20sum\x20of\x20all\x20Amount-mode\x20`sharing`\x20values\x20in\x20this\x20Allocator.\x20'+'Computed\x20by\x20the\x20contract\x20during\x20`allocator_add`\x20—\x20DO\x20NOT\x20set\x20this\x20field\x20at\x20creation.\x20'+'Used\x20internally\x20to\x20compute\x20`total_rates\x20=\x20balance\x20-\x20fix`\x20for\x20Rate\x20allocation.'),'max':z['union']([BalanceTypeSchema,z['null']()])['optional']()['describe']('Maximum\x20allocation\x20cap\x20(OPTIONAL\x20—\x20omit\x20the\x20field\x20or\x20set\x20to\x20null\x20to\x20disable\x20the\x20cap;\x20do\x20NOT\x20set\x20to\x200\x20as\x20that\x20means\x20a\x20cap\x20of\x20zero).\x20'+'Passed\x20through\x20to\x20the\x20contract\x20as\x20Option<u64>\x20via\x20allocator_add():\x20when\x20null/omitted\x20the\x20contract\x20treats\x20it\x20as\x20`none`\x20(no\x20cap);\x20'+'when\x20set,\x20the\x20contract\x20enforces\x20it.\x20Has\x20THREE\x20effects\x20when\x20set:\x0a'+'1.\x20Construction:\x20sum\x20of\x20Amount\x20items\x20must\x20be\x20<=\x20max\x20(EAMOUNT_EXCEEDS_MAX=13)\x0a'+'2.\x20Rate\x20execution:\x20total_rates\x20=\x20max\x20-\x20fix\x20(instead\x20of\x20balance\x20-\x20fix)\x0a'+'3.\x20Surplus\x20execution:\x20surplus_amount\x20=\x20max\x20-\x20alloced_amount\x20(instead\x20of\x20balance\x20-\x20alloced_amount)\x0a'+'Use\x20when\x20you\x20want\x20to\x20cap\x20total\x20allocation\x20regardless\x20of\x20Order\x20balance\x20(e.g.,\x20cap\x20payout\x20to\x20declared\x20amount).\x20'+'SDK\x20pre-validates\x20Amount\x20sum\x20<=\x20max\x20at\x20build\x20time\x20to\x20give\x20actionable\x20error\x20messages\x20before\x20on-chain\x20abort.')})['describe']('Fund\x20allocator\x20—\x20a\x20complete\x20allocation\x20strategy\x20triggered\x20by\x20a\x20Guard.\x20'+'Contains\x20a\x20sharing[]\x20array\x20where\x20items\x20can\x20mix\x20Amount/Rate/Surplus\x20modes.\x20'+'When\x20the\x20Guard\x20passes,\x20the\x20contract\x20allocates\x20funds\x20in\x20strict\x20order:\x20Amount\x20→\x20Rate\x20→\x20Surplus.');export const AllocatorsSchema=z['object']({'description':DescriptionSchema['describe']('Description\x20of\x20fund\x20allocator\x20list'),'threshold':BalanceTypeSchema['default'](0x0)['describe']('Minimum\x20balance\x20required\x20for\x20allocation\x20to\x20fire.\x20'+'When\x20the\x20Allocation\x20object\x27s\x20balance\x20<\x20threshold,\x20allocation\x20aborts\x20with\x20EINSUFFICIENT_BALANCE=7.\x20'+'Also:\x20when\x20an\x20Allocator\x20has\x20only\x20Amount\x20items\x20(no\x20Rate,\x20no\x20Surplus),\x20the\x20sum\x20of\x20Amount\x20items\x20must\x20be\x20>=\x20threshold\x20(EAMOUNT_BELOW_THRESHOLD=12).\x20'+'Set\x20to\x200\x20(default)\x20to\x20allow\x20any\x20balance.'),'allocators':z['array'](AllocatorSchema)['describe']('Fund\x20allocator\x20list.\x20Each\x20allocator\x20is\x20evaluated\x20in\x20order;\x20the\x20FIRST\x20allocator\x20whose\x20Guard\x20passes\x20wins.\x20'+'This\x20enables\x20mutually\x20exclusive\x20allocation\x20paths\x20(e.g.,\x203\x20allocators\x20for\x203\x20forward\x20paths:\x20refund\x20/\x20damage-deduct\x20/\x20arbitrate).')})['describe']('Fund\x20allocator\x20list\x20—\x20the\x20top-level\x20allocation\x20configuration\x20attached\x20to\x20an\x20Order.\x20'+'Contains\x20a\x20threshold\x20and\x20a\x20list\x20of\x20Allocators.\x20When\x20funds\x20arrive\x20at\x20the\x20Order,\x20'+'the\x20first\x20Allocator\x20whose\x20Guard\x20passes\x20executes\x20its\x20sharing[]\x20in\x20strict\x20order:\x20Amount\x20→\x20Rate\x20→\x20Surplus.\x20'+'MULTI-TIER\x20ALLOCATION\x20(DOC-04):\x20Each\x20Order\x20binds\x20ONE\x20Allocators\x20template\x20(set\x20on\x20Service.order_allocators\x20before\x20publish).\x20'+'For\x20multi-tier\x20distribution\x20(e.g.,\x20customer→agency→suppliers),\x20use\x20a\x20two-phase\x20approach:\x20'+'(1)\x20Tier-1\x20Allocators\x20on\x20the\x20customer\x27s\x20Order\x20(allocates\x20to\x20agency\x20+\x20refund\x20fund);\x20'+'(2)\x20Tier-2\x20Allocators\x20on\x20a\x20NEW\x20Order\x20created\x20by\x20the\x20agency\x20(allocates\x20agency\x27s\x20received\x20funds\x20to\x20suppliers).\x20'+'Each\x20tier\x27s\x20Rate-mode\x20sharing[]\x20must\x20independently\x20sum\x20to\x2010000\x20(or\x20<=\x2010000\x20with\x20Surplus).');export const ObjectServiceSchema=ObjectBaseSchema['extend']({'description':z['string']()['describe']('Service\x20object\x20description'),'location':z['string']()['describe']('Service\x20object\x20location'),'sales':z['array'](ServiceSaleSchema)['describe']('Service\x20sale\x20list.'),'repositories':z['array'](z['string']())['describe']('Repository\x20object\x20list\x20for\x20service\x20object\x27s\x20shared\x20data'),'buy_guard':z['union']([z['string'](),z['null']()])['describe']('Purchase\x20Guard\x20object\x20ID.\x20If\x20defined,\x20service\x20can\x20only\x20be\x20purchased\x20if\x20Guard\x20verification\x20passes.'),'machine':z['union']([z['string'](),z['null']()])['describe']('Machine\x20object\x20ID\x20for\x20each\x20order\x27s\x20processing\x20flow.\x20The\x20Machine\x20must\x20be\x20in\x20published\x20state.'),'bPublished':z['boolean']()['describe']('Whether\x20service\x20is\x20published.\x20If\x20service\x20is\x20published,\x20customers\x20can\x20purchase\x20it;\x20and\x20related\x20settings\x20like\x20Machine,\x20arbitrations,\x20order_allocators\x20will\x20be\x20immutable.'),'bPaused':z['boolean']()['describe']('Whether\x20service\x20purchase\x20is\x20paused'),'customer_required':z['array'](z['string']())['describe']('Information\x20required\x20from\x20customer.\x20Such\x20as\x20phone,\x20email,\x20etc.'),'arbitrations':z['array'](z['string']())['describe']('List\x20of\x20Arbitration\x20objects\x20supported\x20by\x20service.\x20When\x20order\x20user\x20needs\x20arbitration,\x20they\x20can\x20apply\x20for\x20arbitration\x20with\x20any\x20Arbitration\x20object\x20in\x20the\x20list.'),'compensation_fund':BalanceTypeSchema['describe']('Compensation\x20fund\x20BALANCE\x20(NOT\x20a\x20Treasury\x20address).\x20'+'This\x20field\x20reports\x20the\x20total\x20amount\x20of\x20funds\x20currently\x20held\x20in\x20the\x20Service\x27s\x20compensation\x20pool.\x20'+'To\x20ADD\x20funds,\x20use\x20`service.compensation_fund_add`.\x20To\x20RECEIVE\x20funds\x20(as\x20order\x20owner\x20after\x20arbitration),\x20use\x20`service.compensation_fund_receive`.\x20'+'P2-03\x20clarification:\x20this\x20is\x20a\x20balance\x20value\x20(e.g.\x20{balance:\x20\x271000000000\x27,\x20token_type:\x20\x270x2::wow::WOW\x27}),\x20NOT\x20the\x20Treasury\x20object\x20address.\x20'+'The\x20Treasury\x20address\x20(if\x20bound)\x20is\x20queried\x20separately\x20via\x20the\x20Service\x27s\x20`repositories`\x20or\x20`order_allocators`\x20configuration.'),'paused_time':z['union']([z['number'](),z['null']()])['describe']('Service\x20purchase\x20pause\x20time.\x20If\x20not\x20paused,\x20it\x20is\x20null.'),'setting_lock_duration':z['union']([z['string'](),z['number'](),z['bigint']()])['describe']('Lock\x20duration\x20for\x20critical\x20settings.\x20After\x20Service\x20is\x20published,\x20modifications\x20to\x20\x27order_allocators\x27,\x20\x27rewards\x27,\x20\x27arbitrations\x27,\x20\x27machine\x27,\x20and\x20withdrawal\x20from\x20\x27compensation_fund\x27\x20must\x20exceed\x20the\x20\x27setting_lock_duration\x27\x20lock\x20time.'),'order_allocators':z['union']([AllocatorsSchema,z['null']()])['describe']('Order\x20fund\x20allocator\x20list.'),'rewards':z['array'](z['string']())['describe']('Reward\x20object\x20list'),'um':z['union']([z['string'](),z['null']()])['describe']('Contact\x20object'),'permission':z['string']()['describe']('Permission\x20object\x20ID')})['describe']('Service\x20object');export const ArbVotedSchema=z['object']({'voter':z['string']()['describe']('Voter\x20ID'),'agrees':z['array'](z['number']()['min'](0x0)['max'](0xff))['describe']('List\x20of\x20supported\x20Proposition\x20indices'),'weight':z['number']()['describe']('Voting\x20weight'),'time':z['number']()['describe']('Voting\x20time')})['describe']('Voting\x20record');export const ArbPropositionSchema=z['object']({'name':z['string']()['describe']('Proposal\x20name'),'votes':z['number']()['describe']('Number\x20of\x20votes\x20supporting\x20this\x20proposal')})['describe']('Proposal');export const ArbIndemnitySchema=z['object']({'amount':BalanceTypeSchema['describe']('Compensation\x20amount'),'time':z['number']()['describe']('Arbitration\x20time')})['describe']('Arbitration\x20compensation');export const ArbStatusSchema=z['enum'](['Principal_confirming','Arbitrator_confirming','Voting','Arbitrated','Objectionable','Finished','Withdrawn'])['describe']('Arb\x20object\x20status');export const ObjectArbSchema=ObjectBaseSchema['extend']({'description':z['string']()['describe']('Arb\x20object\x20statement'),'arbitration':z['string']()['describe']('Parent\x20arbitration\x20object\x20ID'),'order':z['string']()['describe']('Order\x20object\x20ID'),'voted':z['array'](ArbVotedSchema)['describe']('Voting\x20record\x20list'),'proposition':z['array'](ArbPropositionSchema)['describe']('Claim/proposal\x20list'),'fee':BalanceTypeSchema['describe']('Arbitration\x20fee'),'feedback':z['string']()['describe']('Arbitration\x20feedback'),'indemnity':z['union']([ArbIndemnitySchema,z['null']()])['optional']()['describe']('Arbitration\x20compensation'),'voting_deadline':z['union']([z['number'](),z['string']()])['optional']()['describe']('Voting\x20deadline'),'objection':z['string']()['describe']('Arbitration\x20objection'),'status':ArbStatusSchema,'compensation_time':z['union']([z['number'](),z['null']()])['describe']('Compensation\x20claim\x20time'),'time':z['number']()['describe']('Arbitration\x20time')})['describe']('Arb\x20object');export const DiscountTypeSchema=z['union']([z['enum'](['RATES','FIXED']),z['number']()['int']()['min'](0x0)['max'](0x1)['transform'](a=>a===0x0?'RATES':a===0x1?'FIXED':'RATES')])['describe']('Discount\x20type.\x20Accepts\x20string\x20(\x27RATES\x27\x20or\x20\x27FIXED\x27)\x20or\x20number\x20(0=\x27RATES\x27,\x201=\x27FIXED\x27).\x20If\x20rate(0/RATES),\x20discount\x20is\x20based\x20on\x20proportion\x20of\x20product\x20amount\x20(e.g.,\x201000\x20means\x2010%\x20discount);\x20if\x20fixed(1/FIXED),\x20discount\x20is\x20based\x20on\x20fixed\x20value\x20of\x20product\x20amount\x20(e.g.,\x20100\x20means\x20100\x20yuan\x20discount).\x20String\x20form\x20is\x20recommended.');export const ObjectDiscountSchema=ObjectBaseSchema['extend']({'name':z['string']()['describe']('Discount\x20name'),'discount_type':DiscountTypeSchema['describe']('Discount\x20type.\x20If\x20rate(0),\x20discount\x20is\x20based\x20on\x20proportion\x20of\x20product\x20amount\x20(e.g.,\x201000\x20means\x2010%\x20discount);\x20if\x20fixed(1),\x20discount\x20is\x20based\x20on\x20fixed\x20value\x20of\x20product\x20amount\x20(e.g.,\x20100\x20means\x20100\x20yuan\x20discount).'),'benchmark':z['union']([BalanceTypeSchema,z['null']()])['describe']('Discount\x20benchmark\x20amount.\x20If\x20RATES,\x20discount\x20is\x20based\x20on\x20proportion\x20of\x20this\x20amount;\x20if\x20MINUS,\x20discount\x20is\x20based\x20on\x20fixed\x20value\x20of\x20this\x20amount.'),'off':BalanceTypeSchema['describe']('Discount\x20value.\x20If\x20RATES,\x20discount\x20is\x20based\x20on\x20proportion\x20of\x20product\x20amount\x20(e.g.,\x201000\x20means\x2010%\x20discount);\x20if\x20MINUS,\x20discount\x20is\x20based\x20on\x20fixed\x20value\x20of\x20product\x20amount\x20(e.g.,\x20100\x20means\x20maximum\x20100\x20yuan\x20discount).'),'time_start':z['union']([z['string'](),z['number']()])['describe']('Discount\x20effective\x20start\x20time'),'time_end':z['union']([z['string'](),z['number']()])['describe']('Discount\x20effective\x20end\x20time'),'service':z['string']()['describe']('Parent\x20service\x20object\x20ID'),'transferable':z['boolean']()['describe']('Whether\x20discount\x20is\x20transferable\x20to\x20other\x20users')})['describe']('Discount\x20object');export const AmountFromDepositGuardSchema=z['object']({'guard':z['string']()['describe']('Guard\x20object\x20ID\x20or\x20name'),'identifier':z['union']([GuardIdentifierSchema,z['null']()])['optional']()['describe']('Guard\x20Table\x20data\x20index,\x20whose\x20corresponding\x20value\x20is\x20the\x20storable\x20amount.\x20If\x20null,\x20deposit\x20amount\x20is\x20unlimited.'),'store_from_id':z['union']([GuardIdentifierSchema,z['null']()])['optional']()['describe']('Guard\x20table\x20data\x20index\x20for\x20record\x20storage.\x20The\x20value\x20at\x20this\x20index\x20(address\x20or\x20number,\x20including\x20submitted\x20values)\x20will\x20be\x20stored\x20in\x20the\x20record\x20for\x20Guard\x20verification\x20purposes,\x20such\x20as\x20controlling\x20operation\x20frequency.')})['describe']('Guard\x20object\x20that\x20needs\x20verification\x20during\x20deposit');export const AmountFromWithdrawGuardSchema=z['object']({'guard':z['string']()['describe']('Guard\x20object\x20ID\x20or\x20name'),'identifier':z['number']()['describe']('Guard\x20Table\x20data\x20index,\x20whose\x20corresponding\x20value\x20is\x20the\x20withdrawable\x20amount.'),'store_from_id':z['union']([GuardIdentifierSchema,z['null']()])['optional']()['describe']('Guard\x20table\x20data\x20index\x20for\x20record\x20storage.\x20The\x20value\x20at\x20this\x20index\x20(address\x20or\x20number,\x20including\x20submitted\x20values)\x20will\x20be\x20stored\x20in\x20the\x20record\x20for\x20Guard\x20verification\x20purposes,\x20such\x20as\x20controlling\x20operation\x20frequency.')})['describe']('Guard\x20object\x20that\x20needs\x20verification\x20during\x20withdrawal');export const ObjectTreasurySchema=ObjectBaseSchema['extend']({'description':z['string']()['describe']('Treasury\x20object\x20description'),'balance':BalanceTypeSchema['describe']('Current\x20balance'),'history_count':z['number']()['describe']('Transaction\x20record\x20count.\x20Use\x20\x27query_table\x27\x20or\x20\x27query_table_item\x27\x20to\x20get\x20\x27TreasuryRecord\x27\x20table\x20items.'),'external_deposit_guard':z['array'](AmountFromDepositGuardSchema)['describe']('Guard\x20object\x20list\x20that\x20can\x20be\x20verified\x20for\x20non-permissioned\x20users\x20during\x20deposit'),'external_withdraw_guard':z['array'](AmountFromWithdrawGuardSchema)['describe']('Guard\x20object\x20list\x20that\x20can\x20be\x20verified\x20for\x20non-permissioned\x20users\x20during\x20withdrawal'),'inflow':BalanceTypeSchema['describe']('Inflow\x20amount'),'outflow':BalanceTypeSchema['describe']('Outflow\x20amount'),'um':z['union']([z['string'](),z['null']()])['describe']('Contact\x20object'),'permission':z['string']()['describe']('Permission\x20object\x20ID')})['describe']('Treasury\x20object');export const TreasuryOpSchema=z['enum'](['Withdraw','Deposit','Receive'])['describe']('Treasury\x20object\x20operation\x20type');export const TreasuryRecordSchema=z['object']({'op':TreasuryOpSchema['describe']('Treasury\x20object\x20operation\x20type'),'signer':z['string']()['describe']('Operator\x20user\x20ID'),'external_guard':z['union']([z['string'](),z['null']()])['describe']('External\x20Guard\x20object\x20ID.\x20If\x20null,\x20operation\x20was\x20completed\x20through\x20Permission\x20object\x20permissions.'),'amount':BalanceTypeSchema['describe']('Operation\x20amount'),'time':z['union']([z['number'](),z['string']()])['describe']('Operation\x20time'),'store_from_id':z['union']([z['string'](),z['null']()])['describe']('Stored\x20value\x20from\x20Guard\x20table.\x20This\x20stores\x20the\x20value\x20(address\x20or\x20number\x20converted\x20to\x20address,\x20including\x20submitted\x20values)\x20from\x20the\x20Guard\x20table\x20at\x20the\x20specified\x20index\x20for\x20Guard\x20verification\x20purposes.')})['describe']('Treasury\x20object\x20transaction\x20record');export const PolicyWriteGuardSchema=z['object']({'guard':z['string']()['describe']('Guard\x20object\x20ID'),'id_from_submission':GuardIdentifierSchema['optional']()['describe']('Guard\x20Table\x20data\x20index,\x20whose\x20corresponding\x20value\x20(or\x20address)\x20is\x20the\x20ID\x20of\x20the\x20data\x20to\x20be\x20written.\x20If\x20null,\x20user\x20must\x20specify\x20the\x20ID\x20separately.'),'data_from_submission':GuardIdentifierSchema['optional']()['describe']('Guard\x20Table\x20data\x20index,\x20whose\x20corresponding\x20value\x20is\x20the\x20data\x20to\x20be\x20written.\x20If\x20null,\x20user\x20must\x20specify\x20the\x20data\x20separately.')})['describe']('Guard\x20object\x20that\x20needs\x20verification\x20when\x20writing\x20policy');export const IdFromSchema=z['union']([z['literal'](0x0)['describe']('None\x20(0)'),z['literal'](0x1)['describe']('Clock\x20(1)'),z['literal'](0x2)['describe']('Signer\x20(2)'),z['literal']('None')['describe']('None'),z['literal']('Clock')['describe']('Clock'),z['literal']('Signer')['describe']('Signer'),z['literal']('none')['describe']('none'),z['literal']('clock')['describe']('clock'),z['literal']('signer')['describe']('signer')])['describe']('Source\x20of\x20data\x20ID\x20when\x20writing\x20data.\x20Can\x20be\x20specified\x20as\x20a\x20string\x20name\x20(e.g.,\x20\x27Clock\x27,\x20\x27clock\x27,\x20\x27Signer\x27,\x20\x27signer\x27)\x20or\x20a\x20number\x20(0-2).\x20Supported\x20values:\x20None=0/\x27None\x27/\x27none\x27,\x20Clock=1/\x27Clock\x27/\x27clock\x27,\x20Signer=2/\x27Signer\x27/\x27signer\x27.\x20If\x20None,\x20user\x20must\x20specify\x20the\x20ID\x20separately;\x20if\x20Clock,\x20data\x20ID\x20is\x20current\x20timestamp;\x20if\x20Signer,\x20data\x20ID\x20is\x20user\x20ID.');export const PolicyRuleSchema=z['object']({'name':z['string']()['describe']('Policy\x20rule\x20name'),'description':z['string']()['describe']('Policy\x20rule\x20description'),'write_guard':z['array'](PolicyWriteGuardSchema)['describe']('Guard\x20object\x20list\x20that\x20can\x20be\x20verified\x20when\x20writing\x20data'),'quote_guard':z['union']([z['string'](),z['null']()])['optional']()['describe']('Guard\x20object\x20ID\x20that\x20needs\x20verification\x20when\x20referencing\x20this\x20policy\x20data\x20on-chain\x20(e.g.,\x20verifying\x20if\x20user\x20has\x20paid\x20subscription).\x20If\x20null,\x20no\x20verification\x20is\x20needed\x20for\x20on-chain\x20references.\x20The\x20Guard\x20must\x20have\x20empty\x20\x27relies\x27\x20field\x20and\x20\x27rep\x27\x20field\x20true.'),'id_from':IdFromSchema['describe']('Source\x20of\x20data\x20ID\x20when\x20writing\x20data.\x20If\x20None,\x20user\x20must\x20specify\x20the\x20ID\x20separately;\x20if\x20Clock,\x20data\x20ID\x20is\x20current\x20timestamp;\x20if\x20Signer,\x20data\x20ID\x20is\x20user\x20ID.'),'value_type':ValueTypeSchema['describe']('Type\x20of\x20data\x20value\x20when\x20writing\x20data.')});export const TableItem_RepositoryDataSchema=ObjectBaseSchema['extend']({'entity':z['string']()['describe']('Object\x20or\x20user\x20ID'),'name':z['string']()['describe']('Data\x20item\x20name\x20(Policy\x20Name)'),'value':z['array'](z['number']())['describe']('Raw\x20data\x20value\x20(first\x20byte\x20is\x20value\x20type,\x20remaining\x20bytes\x20are\x20Bcs\x20formatted\x20value)'),'data':z['object']({'value_type':ValueTypeSchema['describe']('Type\x20of\x20data\x20value.'),'value':SupportedValueSchema['describe']('Data\x20value.')})})['describe']('Storage\x20data\x20item\x20owned\x20by\x20Repository\x20object');export const TableItem_RewardRecordSchema=ObjectBaseSchema['extend']({'recipient':z['string']()['describe']('Reward\x20recipient\x20ID'),'guard':z['string']()['describe']('Guard\x20object\x20ID'),'total':BalanceTypeSchema['describe']('Total\x20reward\x20amount'),'record':z['array'](z['object']({'amount':BalanceTypeSchema['describe']('Reward\x20amount'),'time':tolerantNumber['describe']('Reward\x20time'),'store_from_id':tolerantStringNullable['describe']('Stored\x20value\x20from\x20Guard\x20table.\x20This\x20stores\x20the\x20value\x20(address\x20or\x20number\x20converted\x20to\x20address,\x20including\x20submitted\x20values)\x20from\x20the\x20Guard\x20table\x20at\x20the\x20specified\x20index\x20for\x20Guard\x20verification\x20purposes.')}))['describe']('Reward\x20record\x20list')})['describe']('Reward\x20object\x27s\x20reward\x20record');export const ObjectRepositorySchema=ObjectBaseSchema['extend']({'description':z['string']()['describe']('Repository\x20object\x20description'),'policies':z['array'](PolicyRuleSchema)['describe']('Repository\x20object\x20policy\x20rule\x20list'),'data_count':z['number']()['describe']('Number\x20of\x20data\x20items\x20stored\x20in\x20Repository\x20object.\x20Use\x20\x27query_table\x27\x20or\x20\x27query_table_item\x27\x20to\x20get\x20\x27RepositoryData\x27\x20table\x20items.'),'rewards':z['array'](z['string']())['describe']('Reward\x20object\x20list'),'um':z['union']([z['string'](),z['null']()])['describe']('Contact\x20object'),'permission':z['string']()['describe']('Permission\x20object\x20ID')})['describe']('Repository\x20object');export const ImSchema=z['object']({'at':z['string']()['describe']('Contact\x27s\x20account\x20address\x20for\x20instant\x20messaging'),'status':z['string']()['describe']('Contact\x27s\x20current\x20status\x20message'),'join_time':z['number']()['describe']('Timestamp\x20when\x20contact\x20joined\x20(milliseconds\x20since\x20epoch)'),'description':z['string']()['describe']('Description\x20or\x20note\x20about\x20this\x20contact')})['describe']('Instant\x20Messaging\x20contact\x20entry\x20with\x20address,\x20status,\x20and\x20metadata');export const ObjectContactSchema=ObjectBaseSchema['extend']({'description':z['string']()['describe']('Contact\x20object\x20description\x20or\x20public\x20information'),'permission':z['string']()['describe']('Permission\x20object\x20ID\x20that\x20controls\x20who\x20can\x20modify\x20this\x20contact'),'location':z['string']()['describe']('Physical\x20or\x20virtual\x20location\x20information\x20for\x20this\x20contact'),'ims':z['array'](ImSchema)['describe']('List\x20of\x20instant\x20messaging\x20contacts.\x20Each\x20entry\x20contains\x20an\x20address\x20for\x20encrypted\x20real-time\x20communication\x20via\x20Wowok\x20Messenger')})['describe']('Contact\x20object\x20storing\x20on-chain\x20instant\x20messaging\x20addresses\x20for\x20real-time\x20encrypted\x20communication\x20between\x20object\x20managers\x20and\x20users');export const ObjectPersonalSchema=ObjectBaseSchema['extend']({'address':z['string']()['describe']('User\x27s\x20address'),'like':z['number']()['describe']('User\x27s\x20like\x20count'),'dislike':z['number']()['describe']('User\x27s\x20dislike\x20count'),'info':z['array'](RecordsInEntitySchema)['describe']('User\x27s\x20personal\x20information\x20record\x20list'),'description':z['string']()['describe']('User\x27s\x20personal\x20description'),'referrer':z['union']([z['string'](),z['null']()])['describe']('User\x27s\x20referrer\x20ID'),'mark_object':z['union']([z['string'](),z['null']()])['describe']('On-chain\x20address\x20mark\x20object\x20ID'),'details':z['array'](VoteInEntityLinkerSchema)['describe']('User\x27s\x20voting\x20record\x20list\x20in\x20EntityLinker'),'active_tx':z['union']([z['string'](),z['null']()])['describe']('User\x27s\x20recent\x20active\x20transaction\x20ID'),'passive_tx':z['union']([z['string'](),z['null']()])['describe']('Recent\x20transaction\x20ID\x20interacting\x20with\x20user'),'time':z['number']()['describe']('User\x20object\x20creation\x20time')})['describe']('Personal\x20object');export const ObjectProofSchema=ObjectBaseSchema['extend']({'description':z['string']()['describe']('Proof\x20description'),'proof':z['string']()['describe']('Proof\x20content.\x20e.g.,\x20merkle\x20tree\x20root'),'server_pubkey':z['string']()['describe']('Server\x20public\x20key'),'server_signature':z['string']()['describe']('Server\x20signature'),'proof_type':z['union']([z['number'](),z['string']()])['describe']('Proof\x20type.\x201:\x20WTS\x20proof;\x201-100\x20reserved.'),'item_count':z['union']([z['number'](),z['string'](),z['null']()])['describe']('Item\x20count.\x20e.g.,\x20number\x20of\x20items\x20in\x20the\x20merkle\x20tree'),'about_address':z['union']([z['string'](),z['null']()])['describe']('About\x20address.\x20e.g.,\x20address\x20of\x20the\x20entity\x20being\x20proved'),'signer':z['string']()['describe']('Signer\x20address'),'time':z['number']()['describe']('Proof\x20creation\x20time')})['describe']('Proof\x20object');export const WReceivedObjectSchema=ObjectBaseSchema['extend']({'balance':BalanceTypeSchema['describe']('Amount\x20contained\x20in\x20object'),'payment':z['string']()['describe']('Payment\x20object\x20ID')})['describe']('Amount\x20object\x20received\x20by\x20on-chain\x20object');export const ObjectPermissionSchema=ObjectBaseSchema['extend']({'builder':z['string']()['describe']('Permission\x20object\x20owner\x20ID\x20(highest\x20permission\x20user)'),'admin':z['array'](z['string']())['describe']('Admin\x20user\x20ID\x20list'),'description':z['string']()['describe']('Permission\x20object\x20description'),'entity_count':z['number']()['describe']('Number\x20of\x20user\x20IDs\x20and\x20Guard\x20IDs\x20granted\x20permissions.\x20Use\x20\x27query_table\x27\x20or\x20\x27query_table_item\x27\x20to\x20get\x20\x27PermissionPerm\x27\x20table\x20items.'),'perm_remark':z['array'](z['object']({'index':PermissionIndexTypeSchema,'remark':z['string']()['describe']('Permission\x20item\x20remark')}))['describe']('Permission\x20item\x20remark\x20list'),'um':z['union']([z['string'](),z['null']()])['describe']('Contact\x20object')})['describe']('Permission\x20object');export const WitnessTypeSchema=z['union']([z['number']()['int']()['refine'](isWitnessType,{'message':'Invalid\x20WitnessType\x20numeric\x20value.\x20Valid\x20range:\x20100-108.'}),z['string']()['refine'](a=>isValidWitnessType(a),{'message':'Invalid\x20WitnessType\x20string\x20name.\x20Valid\x20names:\x20OrderProgress\x20(100),\x20OrderMachine\x20(101),\x20OrderService\x20(102),\x20ProgressMachine\x20(103),\x20ArbOrder\x20(104),\x20ArbArbitration\x20(105),\x20ArbProgress\x20(106),\x20ArbMachine\x20(107),\x20ArbService\x20(108).\x20Case-insensitive;\x20\x22Type\x22\x20prefix\x20is\x20optional.'})])['describe']('When\x20specified,\x20the\x20query\x20retrieves\x20data\x20from\x20the\x20associated\x20(witness)\x20object\x20instead\x20of\x20the\x20queried\x20object\x20itself.\x20This\x20enables\x20cross-object\x20queries\x20within\x20Guard\x20validation\x20logic.\x20Can\x20be\x20a\x20numeric\x20ID\x20(100-108)\x20or\x20a\x20string\x20name\x20(case-insensitive,\x20with\x20or\x20without\x20the\x20\x27Type\x27\x20prefix).\x20String\x20format\x20is\x20recommended\x20for\x20readability.\x0a\x0aAvailable\x20WitnessTypes:\x0a-\x20OrderProgress\x20/\x20TypeOrderProgress\x20(100):\x20Query\x20an\x20Order\x27s\x20associated\x20Progress\x20object.\x20Use\x20case:\x20Check\x20if\x20order\x20has\x20reached\x20a\x20specific\x20workflow\x20node\x20(e.g.,\x20\x27complete\x27)\x20before\x20allowing\x20reward\x20claims.\x0a-\x20OrderMachine\x20/\x20TypeOrderMachine\x20(101):\x20Query\x20an\x20Order\x27s\x20associated\x20Machine\x20(workflow\x20definition).\x20Use\x20case:\x20Verify\x20the\x20workflow\x20structure\x20or\x20check\x20node\x20configurations.\x0a-\x20OrderService\x20/\x20TypeOrderService\x20(102):\x20Query\x20an\x20Order\x27s\x20parent\x20Service\x20object.\x20Use\x20case:\x20Validate\x20the\x20service\x20offering\x20details\x20or\x20check\x20service-level\x20configurations.\x0a-\x20ProgressMachine\x20/\x20TypeProgressMachine\x20(103):\x20Query\x20a\x20Progress\x27s\x20associated\x20Machine.\x20Use\x20case:\x20Access\x20workflow\x20definition\x20from\x20a\x20Progress\x20context.\x0a-\x20ArbOrder\x20/\x20TypeArbOrder\x20(104):\x20Query\x20an\x20Arb\x27s\x20associated\x20Order.\x20Use\x20case:\x20In\x20arbitration\x20voting\x20guards,\x20verify\x20order\x20details\x20like\x20payment\x20amount\x20or\x20service\x20ID.\x0a-\x20ArbArbitration\x20/\x20TypeArbArbitration\x20(105):\x20Query\x20an\x20Arb\x27s\x20parent\x20Arbitration\x20service.\x20Use\x20case:\x20Access\x20arbitration\x20configuration\x20or\x20fee\x20settings\x20from\x20within\x20an\x20Arb\x20case.\x0a-\x20ArbProgress\x20/\x20TypeArbProgress\x20(106):\x20Query\x20an\x20Arb\x27s\x20associated\x20Progress.\x20Use\x20case:\x20Check\x20order\x20workflow\x20state\x20during\x20arbitration\x20validation.\x0a-\x20ArbMachine\x20/\x20TypeArbMachine\x20(107):\x20Query\x20an\x20Arb\x27s\x20associated\x20Machine.\x20Use\x20case:\x20Access\x20workflow\x20definition\x20for\x20dispute\x20context\x20analysis.\x0a-\x20ArbService\x20/\x20TypeArbService\x20(108):\x20Query\x20an\x20Arb\x27s\x20associated\x20Service.\x20Use\x20case:\x20Verify\x20service\x20terms\x20or\x20compensation\x20fund\x20status\x20during\x20arbitration.\x0a\x0aExample:\x20To\x20validate\x20that\x20an\x20order\x20has\x20reached\x20the\x20\x27complete\x27\x20node,\x20query\x20the\x20Order\x20with\x20convert_witness=\x27OrderProgress\x27\x20and\x20check\x20the\x20Progress\x27s\x20current_node\x20field.');export const GuardQueryIdSchema=z['number']()['int']()['min'](0x0)['refine'](a=>isValidGuardQueryId(a),{'message':'Invalid\x20guard\x20query\x20ID.\x20ID\x20not\x20found\x20in\x20GUARDQUERY\x20array.'})['describe']('ID\x20of\x20the\x20data\x20query\x20instruction\x20for\x20the\x20Object.');export const GuardNodeSchema=z['lazy'](()=>z['discriminatedUnion']('type',[z['object']({'type':z['literal']('identifier'),'identifier':GuardIdentifierSchema})['strict']()['describe']('Returns\x20the\x20constant\x20value\x20stored\x20at\x20the\x20specified\x20identifier\x20in\x20the\x20Guard\x20table.'),z['object']({'type':z['literal']('query'),'query':z['union']([z['number']()['int']()['refine'](a=>isValidGuardQueryId(a),{'message':'Invalid\x20guard\x20query\x20ID.\x20ID\x20not\x20found\x20in\x20GUARDQUERY\x20array.'}),z['string']()['refine'](a=>isValidGuardQueryIdOrName(a),{'message':'Invalid\x20guard\x20query\x20name.\x20Name\x20not\x20found\x20in\x20GUARDQUERY\x20array\x20(case-insensitive).'})])['describe']('ID\x20or\x20name\x20of\x20the\x20wowok\x20object\x20data\x20query\x20instruction.\x20Can\x20be\x20a\x20numeric\x20ID\x20(e.g.,\x201001)\x20or\x20a\x20name\x20string\x20(e.g.,\x20\x27permission.description\x27).\x20Name\x20matching\x20is\x20case-insensitive.'),'object':z['object']({'identifier':GuardIdentifierSchema,'convert_witness':WitnessTypeSchema['optional']()})['strict']()['describe']('The\x20object\x20to\x20query\x20from\x20the\x20Guard\x20table.'),'parameters':z['array'](GuardNodeSchema)['optional']()['describe']('Parameters\x20required\x20by\x20the\x20query.\x20Optional\x20—\x20defaults\x20to\x20empty\x20array\x20[].\x20Many\x20queries\x20(e.g.\x20progress.current,\x20order.service)\x20take\x20no\x20parameters;\x20for\x20those,\x20this\x20field\x20can\x20be\x20omitted.')})['strict']()['describe']('Returns\x20the\x20result\x20of\x20executing\x20a\x20data\x20query\x20instruction\x20on\x20the\x20specified\x20object.\x20The\x20return\x20type\x20depends\x20on\x20the\x20query\x20being\x20executed.\x20SPECIAL\x20NOTE\x20for\x20EntityLinker/EntityRegistrar\x20queries:\x20Use\x20system\x20addresses\x20in\x20the\x20Guard\x20table\x20-'+ENTITY_LINKER_ADDRESS+'\x20for\x20EntityLinker\x20queries,\x20'+ENTITY_REGISTRAR_ADDRESS+'\x20for\x20EntityRegistrar\x20queries.'),z['object']({'type':z['literal']('logic_as_u256_greater_or_equal'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20numeric\x20nodes\x20(U8,\x20U16,\x20U32,\x20U64,\x20U128,\x20U256).\x20Computed\x20by\x20comparing\x20the\x20first\x20node\x20value\x20with\x20all\x20subsequent\x20node\x20values.\x20Returns\x20true\x20if\x20first\x20>=\x20all\x20others,\x20otherwise\x20false.'),z['object']({'type':z['literal']('logic_as_u256_lesser_or_equal'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20numeric\x20nodes\x20(U8,\x20U16,\x20U32,\x20U64,\x20U128,\x20U256).\x20Computed\x20by\x20comparing\x20the\x20first\x20node\x20value\x20with\x20all\x20subsequent\x20node\x20values.\x20Returns\x20true\x20if\x20first\x20<=\x20all\x20others,\x20otherwise\x20false.'),z['object']({'type':z['literal']('logic_as_u256_greater'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20numeric\x20nodes\x20(U8,\x20U16,\x20U32,\x20U64,\x20U128,\x20U256).\x20Computed\x20by\x20comparing\x20the\x20first\x20node\x20value\x20with\x20all\x20subsequent\x20node\x20values.\x20Returns\x20true\x20if\x20first\x20>\x20all\x20others,\x20otherwise\x20false.'),z['object']({'type':z['literal']('logic_as_u256_lesser'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20numeric\x20nodes\x20(U8,\x20U16,\x20U32,\x20U64,\x20U128,\x20U256).\x20Computed\x20by\x20comparing\x20the\x20first\x20node\x20value\x20with\x20all\x20subsequent\x20node\x20values.\x20Returns\x20true\x20if\x20first\x20<\x20all\x20others,\x20otherwise\x20false.'),z['object']({'type':z['literal']('logic_as_u256_equal'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20numeric\x20nodes\x20(U8,\x20U16,\x20U32,\x20U64,\x20U128,\x20U256).\x20Computed\x20by\x20comparing\x20the\x20first\x20node\x20value\x20with\x20all\x20subsequent\x20node\x20values.\x20Returns\x20true\x20if\x20first\x20equals\x20all\x20others,\x20otherwise\x20false.'),z['object']({'type':z['literal']('logic_equal'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20nodes\x20of\x20any\x20type.\x20Computed\x20by\x20comparing\x20the\x20first\x20node\x20with\x20all\x20subsequent\x20nodes\x20in\x20both\x20type\x20and\x20value.\x20Returns\x20true\x20if\x20type\x20and\x20value\x20match\x20for\x20all,\x20otherwise\x20false.'),z['object']({'type':z['literal']('logic_not'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20Bool.\x20Computed\x20by\x20inverting\x20the\x20boolean\x20value\x20of\x20the\x20child\x20node\x20(true\x20->\x20false,\x20false\x20->\x20true).'),z['object']({'type':z['literal']('logic_and'),'nodes':z['array'](GuardNodeSchema)['min'](0x2,'logic_and\x20requires\x20at\x20least\x202\x20child\x20nodes.\x20For\x20a\x20single\x20condition,\x20use\x20the\x20comparison\x20node\x20directly\x20as\x20root\x20(e.g.\x20logic_equal),\x20do\x20NOT\x20wrap\x20with\x20logic_and.')['max'](MAX_MULTI_OPERANDS,'logic_and\x20allows\x20at\x20most\x20'+MAX_MULTI_OPERANDS+'\x20child\x20nodes.')})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20boolean\x20nodes.\x20Computed\x20by\x20performing\x20logical\x20AND\x20on\x20all\x20child\x20node\x20values.\x20Returns\x20true\x20if\x20ALL\x20are\x20true,\x20otherwise\x20false.'),z['object']({'type':z['literal']('logic_or'),'nodes':z['array'](GuardNodeSchema)['min'](0x2,'logic_or\x20requires\x20at\x20least\x202\x20child\x20nodes.\x20For\x20a\x20single\x20condition,\x20use\x20the\x20comparison\x20node\x20directly\x20as\x20root\x20(e.g.\x20logic_equal),\x20do\x20NOT\x20wrap\x20with\x20logic_or.')['max'](MAX_MULTI_OPERANDS,'logic_or\x20allows\x20at\x20most\x20'+MAX_MULTI_OPERANDS+'\x20child\x20nodes.')})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20boolean\x20nodes.\x20Computed\x20by\x20performing\x20logical\x20OR\x20on\x20all\x20child\x20node\x20values.\x20Returns\x20true\x20if\x20ANY\x20is\x20true,\x20otherwise\x20false.'),z['object']({'type':z['literal']('logic_string_contains'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20string\x20nodes.\x20The\x20first\x20node\x20is\x20the\x20haystack,\x20all\x20subsequent\x20nodes\x20are\x20needles.\x20Returns\x20true\x20if\x20all\x20needles\x20are\x20substrings\x20of\x20the\x20haystack,\x20otherwise\x20false.\x20Case-sensitive.'),z['object']({'type':z['literal']('logic_string_nocase_contains'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20string\x20nodes.\x20The\x20first\x20node\x20is\x20the\x20haystack,\x20all\x20subsequent\x20nodes\x20are\x20needles.\x20Returns\x20true\x20if\x20all\x20needles\x20are\x20substrings\x20of\x20the\x20haystack,\x20otherwise\x20false.\x20Case-insensitive.'),z['object']({'type':z['literal']('logic_string_nocase_equal'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20string\x20nodes.\x20Computed\x20by\x20comparing\x20the\x20first\x20node\x20with\x20all\x20subsequent\x20nodes\x20as\x20strings,\x20ignoring\x20case.\x20Returns\x20true\x20if\x20all\x20are\x20equal,\x20otherwise\x20false.'),z['object']({'type':z['literal']('calc_number_add'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20U256.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20numeric\x20nodes\x20(U8,\x20U16,\x20U32,\x20U64,\x20U128,\x20U256).\x20Computed\x20by\x20adding\x20the\x20first\x20node\x20value\x20with\x20all\x20subsequent\x20node\x20values\x20in\x20sequence\x20(first\x20+\x20second\x20+\x20third\x20+\x20...).'),z['object']({'type':z['literal']('calc_number_multiply'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20U256.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20numeric\x20nodes\x20(U8,\x20U16,\x20U32,\x20U64,\x20U128,\x20U256).\x20Computed\x20by\x20multiplying\x20the\x20first\x20node\x20value\x20with\x20all\x20subsequent\x20node\x20values\x20in\x20sequence\x20(first\x20*\x20second\x20*\x20third\x20*\x20...).'),z['object']({'type':z['literal']('calc_number_subtract'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20U256.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20numeric\x20nodes\x20(U8,\x20U16,\x20U32,\x20U64,\x20U128,\x20U256).\x20Computed\x20by\x20subtracting\x20the\x20second\x20node\x20value\x20from\x20the\x20first\x20node\x20value\x20in\x20sequence,\x20then\x20continuing\x20with\x20each\x20subsequent\x20node\x20(first\x20-\x20second\x20-\x20third\x20-\x20...).'),z['object']({'type':z['literal']('calc_number_divide'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20U256.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20numeric\x20nodes\x20(U8,\x20U16,\x20U32,\x20U64,\x20U128,\x20U256).\x20Computed\x20by\x20dividing\x20the\x20first\x20node\x20value\x20by\x20the\x20second\x20node\x20value\x20in\x20sequence,\x20then\x20continuing\x20with\x20each\x20subsequent\x20node\x20((first\x20/\x20second)\x20/\x20third\x20/\x20...).\x20Throws\x20exception\x20if\x20any\x20divisor\x20is\x20zero.'),z['object']({'type':z['literal']('calc_number_mod'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20U256.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20numeric\x20nodes\x20(U8,\x20U16,\x20U32,\x20U64,\x20U128,\x20U256).\x20Computed\x20by\x20taking\x20the\x20remainder\x20of\x20dividing\x20the\x20first\x20node\x20value\x20by\x20the\x20second\x20node\x20value\x20in\x20sequence,\x20then\x20continuing\x20with\x20each\x20subsequent\x20node\x20((first\x20%\x20second)\x20%\x20third\x20%\x20...).\x20Throws\x20exception\x20if\x20any\x20divisor\x20is\x20zero.'),z['object']({'type':z['literal']('calc_string_length'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20U64.\x20Computed\x20by\x20getting\x20the\x20length\x20(number\x20of\x20UTF-8\x20bytes)\x20of\x20the\x20child\x20node\x20value.'),z['object']({'type':z['literal']('calc_string_nocase_contains'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20string\x20nodes.\x20The\x20first\x20node\x20is\x20the\x20haystack,\x20all\x20subsequent\x20nodes\x20are\x20needles.\x20Returns\x20true\x20if\x20all\x20needles\x20are\x20substrings\x20of\x20the\x20haystack,\x20otherwise\x20false.\x20Case-insensitive.'),z['object']({'type':z['literal']('calc_string_nocase_equal'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20string\x20nodes.\x20Computed\x20by\x20comparing\x20the\x20first\x20node\x20with\x20all\x20subsequent\x20nodes\x20as\x20strings,\x20ignoring\x20case.\x20Returns\x20true\x20if\x20all\x20are\x20equal,\x20otherwise\x20false.'),z['object']({'type':z['literal']('calc_string_contains'),'nodes':z['array'](GuardNodeSchema)})['strict']()['describe']('Returns\x20Bool.\x20Requires\x202-'+MAX_MULTI_OPERANDS+'\x20string\x20nodes.\x20The\x20first\x20node\x20is\x20the\x20haystack,\x20all\x20subsequent\x20nodes\x20are\x20needles.\x20Returns\x20true\x20if\x20all\x20needles\x20are\x20substrings\x20of\x20the\x20haystack,\x20otherwise\x20false.\x20Case-sensitive.'),z['object']({'type':z['literal']('calc_string_indexof'),'nodeLeft':GuardNodeSchema,'nodeRight':GuardNodeSchema,'order':z['enum'](['forward','backward'])['describe']('\x27forward\x27\x20searches\x20from\x20start\x20to\x20end,\x20\x27backward\x27\x20searches\x20from\x20end\x20to\x20start.')})['strict']()['describe']('Returns\x20U64.\x20Computed\x20by\x20searching\x20for\x20the\x20second\x20node\x20(needle)\x20in\x20the\x20first\x20node\x20(haystack).\x20Returns\x20index\x20of\x20first\x20occurrence\x20in\x20the\x20specified\x20direction.\x20If\x20not\x20found,\x20returns\x20u64::MAX\x20(18446744073709551615).'),z['object']({'type':z['literal']('calc_string_nocase_indexof'),'nodeLeft':GuardNodeSchema,'nodeRight':GuardNodeSchema,'order':z['enum'](['forward','backward'])['describe']('\x27forward\x27\x20searches\x20from\x20start\x20to\x20end,\x20\x27backward\x27\x20searches\x20from\x20end\x20to\x20start.')})['strict']()['describe']('Returns\x20U64.\x20Computed\x20by\x20searching\x20for\x20the\x20second\x20node\x20(needle)\x20in\x20the\x20first\x20node\x20(haystack),\x20ignoring\x20case.\x20Returns\x20index\x20of\x20first\x20occurrence\x20in\x20the\x20specified\x20direction.\x20If\x20not\x20found,\x20returns\x20u64::MAX\x20(18446744073709551615).'),z['object']({'type':z['literal']('convert_number_address'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20Address.\x20Computed\x20by\x20converting\x20the\x20child\x20node\x20value\x20from\x20number\x20type\x20to\x20Address\x20type.'),z['object']({'type':z['literal']('convert_address_number'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20U256.\x20Computed\x20by\x20converting\x20the\x20child\x20node\x20value\x20from\x20Address\x20type\x20to\x20number\x20type.'),z['object']({'type':z['literal']('convert_number_string'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20String.\x20Computed\x20by\x20converting\x20the\x20child\x20node\x20value\x20from\x20number\x20type\x20to\x20string\x20type.'),z['object']({'type':z['literal']('convert_string_number'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20U256.\x20Computed\x20by\x20parsing\x20the\x20child\x20node\x20value\x20as\x20a\x20number.\x20Throws\x20exception\x20if\x20the\x20string\x20is\x20not\x20a\x20valid\x20number.'),z['object']({'type':z['literal']('convert_safe_u8'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20U8.\x20Computed\x20by\x20converting\x20the\x20child\x20node\x20value\x20to\x20U8.\x20Throws\x20exception\x20if\x20value\x20is\x20out\x20of\x20U8\x20range\x20(0-255).'),z['object']({'type':z['literal']('convert_safe_u16'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20U16.\x20Computed\x20by\x20converting\x20the\x20child\x20node\x20value\x20to\x20U16.\x20Throws\x20exception\x20if\x20value\x20is\x20out\x20of\x20U16\x20range\x20(0-65535).'),z['object']({'type':z['literal']('convert_safe_u32'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20U32.\x20Computed\x20by\x20converting\x20the\x20child\x20node\x20value\x20to\x20U32.\x20Throws\x20exception\x20if\x20value\x20is\x20out\x20of\x20U32\x20range.'),z['object']({'type':z['literal']('convert_safe_u64'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20U64.\x20Computed\x20by\x20converting\x20the\x20child\x20node\x20value\x20to\x20U64.\x20Throws\x20exception\x20if\x20value\x20is\x20out\x20of\x20U64\x20range.'),z['object']({'type':z['literal']('convert_safe_u128'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20U128.\x20Computed\x20by\x20converting\x20the\x20child\x20node\x20value\x20to\x20U128.\x20Throws\x20exception\x20if\x20value\x20is\x20out\x20of\x20U128\x20range.'),z['object']({'type':z['literal']('convert_safe_u256'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20U256.\x20Computed\x20by\x20converting\x20the\x20child\x20node\x20value\x20to\x20U256.'),z['object']({'type':z['literal']('value_type'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20U8.\x20Computed\x20by\x20getting\x20the\x20type\x20identifier\x20(ValueType)\x20of\x20the\x20child\x20node\x20value.\x20'+VALUE_TYPE_DESCRIPTION),z['object']({'type':z['literal']('vec_length'),'node':GuardNodeSchema})['strict']()['describe']('Returns\x20U64.\x20Computed\x20by\x20getting\x20the\x20length\x20of\x20the\x20vector\x20in\x20the\x20child\x20node\x20value.\x20Child\x20node\x20must\x20be\x20one\x20of\x20Vec\x20types:\x20VecBool=9,\x20VecAddress=10,\x20VecString=11,\x20VecU8=12,\x20VecU16=13,\x20VecU32=14,\x20VecU64=15,\x20VecU128=16,\x20VecU256=17,\x20VecVecU8=18,\x20Value=19.'),z['object']({'type':z['literal']('vec_contains_bool'),'nodes':z['array'](GuardNodeSchema)['describe']('2\x20to\x20'+MAX_MULTI_OPERANDS+'\x20nodes\x20required.\x20First\x20node\x20must\x20be\x20VecBool\x20(ValueType=9)\x20or\x20Value\x20(ValueType=19),\x20remaining\x20nodes\x20must\x20be\x20Bool\x20(ValueType=0)\x20or\x20Value\x20(ValueType=19).')})['strict']()['describe']('Returns\x20Bool.\x20Computed\x20by\x20checking\x20if\x20the\x20vector\x20(first\x20node)\x20contains\x20ALL\x20boolean\x20values\x20(subsequent\x20nodes).'),z['object']({'type':z['literal']('vec_contains_address'),'nodes':z['array'](GuardNodeSchema)['describe']('2\x20to\x20'+MAX_MULTI_OPERANDS+'\x20nodes\x20required.\x20First\x20node\x20must\x20be\x20VecAddress\x20(ValueType=10)\x20or\x20Value\x20(ValueType=19),\x20remaining\x20nodes\x20must\x20be\x20Address\x20(ValueType=1)\x20or\x20Value\x20(ValueType=19).')})['strict']()['describe']('Returns\x20Bool.\x20Computed\x20by\x20checking\x20if\x20the\x20vector\x20(first\x20node)\x20contains\x20ALL\x20address\x20values\x20(subsequent\x20nodes).'),z['object']({'type':z['literal']('vec_contains_string'),'nodes':z['array'](GuardNodeSchema)['describe']('2\x20to\x20'+MAX_MULTI_OPERANDS+'\x20nodes\x20required.\x20First\x20node\x20must\x20be\x20VecString\x20(ValueType=11)\x20or\x20Value\x20(ValueType=19),\x20remaining\x20nodes\x20must\x20be\x20String\x20(ValueType=2)\x20or\x20Value\x20(ValueType=19).')})['strict']()['describe']('Returns\x20Bool.\x20Computed\x20by\x20checking\x20if\x20the\x20vector\x20(first\x20node)\x20contains\x20ALL\x20string\x20values\x20(subsequent\x20nodes).'),z['object']({'type':z['literal']('vec_contains_string_nocase'),'nodes':z['array'](GuardNodeSchema)['describe']('2\x20to\x20'+MAX_MULTI_OPERANDS+'\x20nodes\x20required.\x20First\x20node\x20must\x20be\x20VecString\x20(ValueType=11)\x20or\x20Value\x20(ValueType=19),\x20remaining\x20nodes\x20must\x20be\x20String\x20(ValueType=2)\x20or\x20Value\x20(ValueType=19).')})['strict']()['describe']('Returns\x20Bool.\x20Computed\x20by\x20checking\x20if\x20the\x20vector\x20(first\x20node)\x20contains\x20ALL\x20string\x20values\x20(subsequent\x20nodes),\x20using\x20case-insensitive\x20comparison.'),z['object']({'type':z['literal']('vec_contains_number'),'nodes':z['array'](GuardNodeSchema)['describe']('2\x20to\x20'+MAX_MULTI_OPERANDS+'\x20nodes\x20required.\x20First\x20node\x20must\x20be\x20VecU8\x20(12),\x20VecU16\x20(13),\x20VecU32\x20(14),\x20VecU64\x20(15),\x20VecU128\x20(16),\x20VecU256\x20(17)\x20or\x20Value\x20(ValueType=19),\x20remaining\x20nodes\x20must\x20be\x20U8\x20(3),\x20U16\x20(4),\x20U32\x20(5),\x20U64\x20(6),\x20U128\x20(7),\x20U256\x20(8)\x20or\x20Value\x20(ValueType=19).')})['strict']()['describe']('Returns\x20Bool.\x20Computed\x20by\x20checking\x20if\x20the\x20vector\x20(first\x20node)\x20contains\x20ALL\x20number\x20values\x20(subsequent\x20nodes).'),z['object']({'type':z['literal']('vec_indexof_bool'),'nodeLeft':GuardNodeSchema,'nodeRight':GuardNodeSchema,'order':z['enum'](['forward','backward'])['describe']('\x27forward\x27\x20searches\x20from\x20index\x200,\x20\x27backward\x27\x20searches\x20from\x20last\x20index.')})['strict']()['describe']('Returns\x20U64.\x20Computed\x20by\x20searching\x20for\x20the\x20second\x20node\x20value\x20in\x20the\x20vector\x20(first\x20node).\x20nodeLeft\x20must\x20be\x20VecBool\x20(ValueType=9)\x20or\x20Value\x20(ValueType=19)\x20type,\x20nodeRight\x20must\x20be\x20Bool\x20(ValueType=0)\x20or\x20Value\x20(ValueType=19)\x20type.\x20Returns\x20index\x20of\x20first\x20occurrence\x20in\x20the\x20specified\x20direction.\x20If\x20not\x20found,\x20returns\x20u64::MAX\x20(18446744073709551615).'),z['object']({'type':z['literal']('vec_indexof_address'),'nodeLeft':GuardNodeSchema,'nodeRight':GuardNodeSchema,'order':z['enum'](['forward','backward'])['describe']('\x27forward\x27\x20searches\x20from\x20index\x200,\x20\x27backward\x27\x20searches\x20from\x20last\x20index.')})['strict']()['describe']('Returns\x20U64.\x20Computed\x20by\x20searching\x20for\x20the\x20second\x20node\x20value\x20in\x20the\x20vector\x20(first\x20node).\x20nodeLeft\x20must\x20be\x20VecAddress\x20(ValueType=10)\x20or\x20Value\x20(ValueType=19)\x20type,\x20nodeRight\x20must\x20be\x20Address\x20(ValueType=1)\x20or\x20Value\x20(ValueType=19)\x20type.\x20Returns\x20index\x20of\x20first\x20occurrence\x20in\x20the\x20specified\x20direction.\x20If\x20not\x20found,\x20returns\x20u64::MAX\x20(18446744073709551615).'),z['object']({'type':z['literal']('vec_indexof_string'),'nodeLeft':GuardNodeSchema,'nodeRight':GuardNodeSchema,'order':z['enum'](['forward','backward'])['describe']('\x27forward\x27\x20searches\x20from\x20index\x200,\x20\x27backward\x27\x20searches\x20from\x20last\x20index.')})['strict']()['describe']('Returns\x20U64.\x20Computed\x20by\x20searching\x20for\x20the\x20second\x20node\x20value\x20in\x20the\x20vector\x20(first\x20node).\x20nodeLeft\x20must\x20be\x20VecString\x20(ValueType=11)\x20or\x20Value\x20(ValueType=19)\x20type,\x20nodeRight\x20must\x20be\x20String\x20(ValueType=2)\x20or\x20Value\x20(ValueType=19)\x20type.\x20Returns\x20index\x20of\x20first\x20occurrence\x20in\x20the\x20specified\x20direction.\x20If\x20not\x20found,\x20returns\x20u64::MAX\x20(18446744073709551615).'),z['object']({'type':z['literal']('vec_indexof_string_nocase'),'nodeLeft':GuardNodeSchema,'nodeRight':GuardNodeSchema,'order':z['enum'](['forward','backward'])['describe']('\x27forward\x27\x20searches\x20from\x20index\x200,\x20\x27backward\x27\x20searches\x20from\x20last\x20index.')})['strict']()['describe']('Returns\x20U64.\x20Computed\x20by\x20searching\x20for\x20the\x20second\x20node\x20value\x20in\x20the\x20vector\x20(first\x20node),\x20using\x20case-insensitive\x20comparison.\x20nodeLeft\x20must\x20be\x20VecString\x20(ValueType=11)\x20or\x20Value\x20(ValueType=19)\x20type,\x20nodeRight\x20must\x20be\x20String\x20(ValueType=2)\x20or\x20Value\x20(ValueType=19)\x20type.\x20Returns\x20index\x20of\x20first\x20occurrence\x20in\x20the\x20specified\x20direction.\x20If\x20not\x20found,\x20returns\x20u64::MAX\x20(18446744073709551615).'),z['object']({'type':z['literal']('vec_indexof_number'),'nodeLeft':GuardNodeSchema,'nodeRight':GuardNodeSchema,'order':z['enum'](['forward','backward'])['describe']('\x27forward\x27\x20searches\x20from\x20index\x200,\x20\x27backward\x27\x20searches\x20from\x20last\x20index.')})['strict']()['describe']('Returns\x20U64.\x20Computed\x20by\x20searching\x20for\x20the\x20second\x20node\x20value\x20in\x20the\x20vector\x20(first\x20node).\x20nodeLeft\x20must\x20be\x20VecU8\x20(12),\x20VecU16\x20(13),\x20VecU32\x20(14),\x20VecU64\x20(15),\x20VecU128\x20(16),\x20VecU256\x20(17)\x20or\x20Value\x20(ValueType=19)\x20type,\x20nodeRight\x20must\x20be\x20U8\x20(3),\x20U16\x20(4),\x20U32\x20(5),\x20U64\x20(6),\x20U128\x20(7),\x20U256\x20(8)\x20or\x20Value\x20(ValueType=19)\x20type.\x20Returns\x20index\x20of\x20first\x20occurrence\x20in\x20the\x20specified\x20direction.\x20If\x20not\x20found,\x20returns\x20u64::MAX\x20(18446744073709551615).'),z['object']({'type':z['literal']('context'),'context':z['enum'](['Signer','Clock','Guard'])['describe']('System\x20context\x20type:\x20Signer\x20returns\x20transaction\x20sender\x20address\x20(Address),\x20Clock\x20returns\x20current\x20on-chain\x20timestamp\x20(U64),\x20Guard\x20returns\x20current\x20Guard\x20object\x20ID\x20(Address).')})['strict']()['describe']('Signer\x20returns\x20transaction\x20sender\x20address\x20(Address),\x20Clock\x20returns\x20current\x20on-chain\x20timestamp\x20(U64),\x20Guard\x20returns\x20current\x20Guard\x20object\x20ID\x20(Address).'),z['object']({'type':z['literal']('query_reward_record_find'),'object':z['object']({'identifier':GuardIdentifierSchema})['strict']()['describe']('Reference\x20to\x20the\x20Reward\x20object\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).'),'find':z['enum'](['first','last'])['describe']('\x27first\x27\x20finds\x20the\x20earliest\x20matching\x20record,\x20\x27last\x27\x20finds\x20the\x20most\x20recent\x20matching\x20record.'),'recipient':z['object']({'identifier':GuardIdentifierSchema})['strict']()['optional']()['describe']('Optional:\x20Identifier\x20reference\x20to\x20the\x20recipient\x20address\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).\x20If\x20not\x20specified,\x20uses\x20the\x20transaction\x20signer\x20address.'),'where':z['object']({'guard':z['string']()['optional']()['describe']('Optional\x20filter:\x20Guard\x20object\x20address\x20constant\x20to\x20match.'),'timeMin':z['string']()['optional']()['describe']('Optional\x20filter:\x20minimum\x20timestamp\x20(inclusive)\x20for\x20record\x20creation\x20time.\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'timeMax':z['string']()['optional']()['describe']('Optional\x20filter:\x20maximum\x20timestamp\x20(inclusive)\x20for\x20record\x20creation\x20time.\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'amountMin':z['string']()['optional']()['describe']('Optional\x20filter:\x20minimum\x20reward\x20amount\x20(inclusive).\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'amountMax':z['string']()['optional']()['describe']('Optional\x20filter:\x20maximum\x20reward\x20amount\x20(inclusive).\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'storeFromId':z['object']({'identifier':GuardIdentifierSchema})['strict']()['optional']()['describe']('Optional\x20filter:\x20identifier\x20reference\x20to\x20the\x20store_from_id\x20address\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).\x20If\x20not\x20specified,\x20the\x20store_from_id\x20field\x20is\x20ignored\x20during\x20matching.\x20The\x20server\x20resolves\x20this\x20identifier\x20to\x20the\x20actual\x20address\x20from\x20the\x20Guard\x20table\x20constants.')})['strict']()['describe']('Filter\x20conditions\x20for\x20the\x20reward\x20record\x20query.')})['strict']()['describe']('Returns\x20U64.\x20Finds\x20the\x20index\x20of\x20the\x20first\x20or\x20last\x20reward\x20record\x20matching\x20the\x20specified\x20recipient\x20and\x20filter\x20conditions.\x20Returns\x20the\x20record\x20index\x20(U64)\x20if\x20found.\x20Throws\x20error\x20if\x20no\x20matching\x20record\x20is\x20found\x20(Guard\x20validation\x20fails).\x20If\x20recipient\x20is\x20not\x20specified,\x20uses\x20the\x20transaction\x20signer\x20address.'),z['object']({'type':z['literal']('query_reward_record_count'),'object':z['object']({'identifier':GuardIdentifierSchema})['strict']()['describe']('Reference\x20to\x20the\x20Reward\x20object\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).'),'recipient':z['object']({'identifier':GuardIdentifierSchema})['strict']()['optional']()['describe']('Optional:\x20Identifier\x20reference\x20to\x20the\x20recipient\x20address\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).\x20If\x20not\x20specified,\x20uses\x20the\x20transaction\x20signer\x20address.'),'where':z['object']({'guard':z['string']()['optional']()['describe']('Optional\x20filter:\x20Guard\x20object\x20address\x20constant\x20to\x20match.'),'timeMin':z['string']()['optional']()['describe']('Optional\x20filter:\x20minimum\x20timestamp\x20(inclusive)\x20for\x20record\x20creation\x20time.\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'timeMax':z['string']()['optional']()['describe']('Optional\x20filter:\x20maximum\x20timestamp\x20(inclusive)\x20for\x20record\x20creation\x20time.\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'amountMin':z['string']()['optional']()['describe']('Optional\x20filter:\x20minimum\x20reward\x20amount\x20(inclusive).\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'amountMax':z['string']()['optional']()['describe']('Optional\x20filter:\x20maximum\x20reward\x20amount\x20(inclusive).\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'storeFromId':z['object']({'identifier':GuardIdentifierSchema})['strict']()['optional']()['describe']('Optional\x20filter:\x20identifier\x20reference\x20to\x20the\x20store_from_id\x20address\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).\x20If\x20not\x20specified,\x20the\x20store_from_id\x20field\x20is\x20ignored\x20during\x20matching.\x20The\x20server\x20resolves\x20this\x20identifier\x20to\x20the\x20actual\x20address\x20from\x20the\x20Guard\x20table\x20constants.')})['strict']()['describe']('Filter\x20conditions\x20for\x20the\x20reward\x20record\x20count\x20query.')})['strict']()['describe']('Returns\x20U64.\x20Counts\x20the\x20number\x20of\x20reward\x20records\x20matching\x20the\x20specified\x20recipient\x20and\x20filter\x20conditions.\x20If\x20recipient\x20is\x20not\x20specified,\x20uses\x20the\x20transaction\x20signer\x20address.'),z['object']({'type':z['literal']('query_reward_record_exists'),'object':z['object']({'identifier':GuardIdentifierSchema})['strict']()['describe']('Reference\x20to\x20the\x20Reward\x20object\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).'),'recipient':z['object']({'identifier':GuardIdentifierSchema})['strict']()['optional']()['describe']('Optional:\x20Identifier\x20reference\x20to\x20the\x20recipient\x20address\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).\x20If\x20not\x20specified,\x20uses\x20the\x20transaction\x20signer\x20address.'),'where':z['object']({'guard':z['string']()['optional']()['describe']('Optional\x20filter:\x20Guard\x20object\x20address\x20constant\x20to\x20match.'),'timeMin':z['string']()['optional']()['describe']('Optional\x20filter:\x20minimum\x20timestamp\x20(inclusive)\x20for\x20record\x20creation\x20time.\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'timeMax':z['string']()['optional']()['describe']('Optional\x20filter:\x20maximum\x20timestamp\x20(inclusive)\x20for\x20record\x20creation\x20time.\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'amountMin':z['string']()['optional']()['describe']('Optional\x20filter:\x20minimum\x20reward\x20amount\x20(inclusive).\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'amountMax':z['string']()['optional']()['describe']('Optional\x20filter:\x20maximum\x20reward\x20amount\x20(inclusive).\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'storeFromId':z['object']({'identifier':GuardIdentifierSchema})['strict']()['optional']()['describe']('Optional\x20filter:\x20identifier\x20reference\x20to\x20the\x20store_from_id\x20address\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).\x20If\x20not\x20specified,\x20the\x20store_from_id\x20field\x20is\x20ignored\x20during\x20matching.\x20The\x20server\x20resolves\x20this\x20identifier\x20to\x20the\x20actual\x20address\x20from\x20the\x20Guard\x20table\x20constants.')})['strict']()['describe']('Filter\x20conditions\x20for\x20the\x20reward\x20record\x20existence\x20query.')})['strict']()['describe']('Returns\x20Bool.\x20Returns\x20true\x20if\x20at\x20least\x20one\x20reward\x20record\x20exists\x20matching\x20the\x20specified\x20recipient\x20and\x20filter\x20conditions,\x20otherwise\x20false.\x20If\x20recipient\x20is\x20not\x20specified,\x20uses\x20the\x20transaction\x20signer\x20address.'),z['object']({'type':z['literal']('query_progress_history_find'),'object':z['object']({'identifier':GuardIdentifierSchema})['strict']()['describe']('Reference\x20to\x20the\x20Progress\x20object\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).'),'where':z['object']({'node':z['string']()['optional']()['describe']('Optional\x20filter:\x20node\x20name\x20string\x20to\x20match.'),'nextNode':z['string']()['optional']()['describe']('Optional\x20filter:\x20next\x20node\x20name\x20string\x20to\x20match.'),'timeMin':z['string']()['optional']()['describe']('Optional\x20filter:\x20minimum\x20timestamp\x20(inclusive)\x20for\x20history\x20entry\x20time.\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'timeMax':z['string']()['optional']()['describe']('Optional\x20filter:\x20maximum\x20timestamp\x20(inclusive)\x20for\x20history\x20entry\x20time.\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'indexMin':z['string']()['optional']()['describe']('Optional\x20filter:\x20minimum\x20history\x20index\x20(inclusive)\x20to\x20search\x20within.\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'indexMax':z['string']()['optional']()['describe']('Optional\x20filter:\x20maximum\x20history\x20index\x20(inclusive)\x20to\x20search\x20within.\x20Use\x20string\x20to\x20represent\x20U64\x20value.')})['strict']()['describe']('Filter\x20conditions\x20for\x20the\x20progress\x20history\x20query.'),'find':z['enum'](['first','last'])['describe']('\x27first\x27\x20finds\x20the\x20earliest\x20matching\x20history\x20entry,\x20\x27last\x27\x20finds\x20the\x20most\x20recent\x20matching\x20history\x20entry.')})['strict']()['describe']('Returns\x20U64.\x20Finds\x20the\x20index\x20of\x20the\x20first\x20or\x20last\x20history\x20entry\x20matching\x20the\x20filter\x20conditions.\x20Returns\x20the\x20history\x20index\x20(U64)\x20if\x20found.\x20Throws\x20error\x20if\x20no\x20matching\x20entry\x20is\x20found\x20(Guard\x20validation\x20fails).'),z['object']({'type':z['literal']('query_progress_history_session_find'),'object':z['object']({'identifier':GuardIdentifierSchema})['strict']()['describe']('Reference\x20to\x20the\x20Progress\x20object\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).'),'historyIdx':GuardNodeSchema['describe']('GuardNode\x20that\x20returns\x20the\x20history\x20index\x20(U64\x20type)\x20to\x20search\x20within.\x20Typically\x20an\x20\x27identifier\x27\x20node\x20referencing\x20a\x20U64\x20value\x20from\x20the\x20Guard\x20table.'),'where':z['object']({'nextNode':z['string']()['optional']()['describe']('Optional\x20filter:\x20next\x20node\x20name\x20string\x20to\x20match.')})['strict']()['describe']('Filter\x20conditions\x20for\x20the\x20progress\x20history\x20session\x20query.'),'find':z['enum'](['first','last'])['describe']('\x27first\x27\x20finds\x20the\x20earliest\x20matching\x20session,\x20\x27last\x27\x20finds\x20the\x20most\x20recent\x20matching\x20session.')})['strict']()['describe']('Returns\x20U64.\x20Finds\x20the\x20index\x20of\x20the\x20first\x20or\x20last\x20session\x20within\x20the\x20specified\x20history\x20entry\x20matching\x20the\x20filter\x20conditions.\x20Returns\x20the\x20session\x20index\x20(U64)\x20if\x20found.\x20Throws\x20error\x20if\x20no\x20matching\x20session\x20is\x20found\x20(Guard\x20validation\x20fails).'),z['object']({'type':z['literal']('query_progress_history_session_forward_find'),'object':z['object']({'identifier':GuardIdentifierSchema})['strict']()['describe']('Reference\x20to\x20the\x20Progress\x20object\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).'),'historyIdx':GuardNodeSchema['describe']('GuardNode\x20that\x20returns\x20the\x20history\x20index\x20(U64\x20type).\x20Typically\x20an\x20\x27identifier\x27\x20node\x20referencing\x20a\x20U64\x20value\x20from\x20the\x20Guard\x20table.'),'sessionIdx':GuardNodeSchema['describe']('GuardNode\x20that\x20returns\x20the\x20session\x20index\x20(U64\x20type)\x20within\x20the\x20history\x20entry.\x20Typically\x20an\x20\x27identifier\x27\x20node\x20referencing\x20a\x20U64\x20value\x20from\x20the\x20Guard\x20table.'),'where':z['object']({'who':z['string']()['optional']()['describe']('Optional\x20filter:\x20operator\x20address\x20string\x20to\x20match.'),'operation':z['string']()['optional']()['describe']('Optional\x20filter:\x20operation\x20name\x20string\x20to\x20match.'),'accomplished':z['boolean']()['optional']()['describe']('Optional\x20filter:\x20whether\x20the\x20forward\x20operation\x20was\x20accomplished.'),'timeMin':z['string']()['optional']()['describe']('Optional\x20filter:\x20minimum\x20timestamp\x20(inclusive)\x20for\x20forward\x20operation\x20time.\x20Use\x20string\x20to\x20represent\x20U64\x20value.'),'timeMax':z['string']()['optional']()['describe']('Optional\x20filter:\x20maximum\x20timestamp\x20(inclusive)\x20for\x20forward\x20operation\x20time.\x20Use\x20string\x20to\x20represent\x20U64\x20value.')})['strict']()['describe']('Filter\x20conditions\x20for\x20the\x20progress\x20history\x20session\x20forward\x20query.'),'find':z['enum'](['first','last'])['describe']('\x27first\x27\x20finds\x20the\x20earliest\x20matching\x20forward\x20operation,\x20\x27last\x27\x20finds\x20the\x20most\x20recent\x20matching\x20forward\x20operation.')})['strict']()['describe']('Returns\x20U64.\x20Finds\x20the\x20index\x20of\x20the\x20first\x20or\x20last\x20forward\x20operation\x20within\x20the\x20specified\x20history\x20session\x20matching\x20the\x20filter\x20conditions.\x20Returns\x20the\x20forward\x20index\x20(U64)\x20if\x20found.\x20Throws\x20error\x20if\x20no\x20matching\x20forward\x20operation\x20is\x20found\x20(Guard\x20validation\x20fails).'),z['object']({'type':z['literal']('query_progress_history_session_count'),'object':z['object']({'identifier':GuardIdentifierSchema})['strict']()['describe']('Reference\x20to\x20the\x20Progress\x20object\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).'),'historyIdx':GuardNodeSchema['describe']('GuardNode\x20that\x20returns\x20the\x20history\x20index\x20(U64\x20type)\x20to\x20count\x20sessions\x20for.\x20Typically\x20an\x20\x27identifier\x27\x20node\x20referencing\x20a\x20U64\x20value\x20from\x20the\x20Guard\x20table.')})['strict']()['describe']('Returns\x20U64.\x20Counts\x20the\x20number\x20of\x20sessions\x20within\x20the\x20specified\x20history\x20entry.'),z['object']({'type':z['literal']('query_progress_history_session_forward_count'),'object':z['object']({'identifier':GuardIdentifierSchema})['strict']()['describe']('Reference\x20to\x20the\x20Progress\x20object\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).'),'historyIdx':GuardNodeSchema['describe']('GuardNode\x20that\x20returns\x20the\x20history\x20index\x20(U64\x20type).\x20Typically\x20an\x20\x27identifier\x27\x20node\x20referencing\x20a\x20U64\x20value\x20from\x20the\x20Guard\x20table.'),'sessionIdx':GuardNodeSchema['describe']('GuardNode\x20that\x20returns\x20the\x20session\x20index\x20(U64\x20type)\x20within\x20the\x20history\x20entry.\x20Typically\x20an\x20\x27identifier\x27\x20node\x20referencing\x20a\x20U64\x20value\x20from\x20the\x20Guard\x20table.')})['strict']()['describe']('Returns\x20U64.\x20Counts\x20the\x20number\x20of\x20forward\x20operations\x20within\x20the\x20specified\x20history\x20session.'),z['object']({'type':z['literal']('query_progress_history_session_forward_retained_submission_count'),'object':z['object']({'identifier':GuardIdentifierSchema})['strict']()['describe']('Reference\x20to\x20the\x20Progress\x20object\x20in\x20the\x20Guard\x20table\x20(must\x20be\x20Address\x20type).'),'historyIdx':GuardNodeSchema['describe']('GuardNode\x20that\x20returns\x20the\x20history\x20index\x20(U64\x20type).\x20Typically\x20an\x20\x27identifier\x27\x20node\x20referencing\x20a\x20U64\x20value\x20from\x20the\x20Guard\x20table.'),'sessionIdx':GuardNodeSchema['describe']('GuardNode\x20that\x20returns\x20the\x20session\x20index\x20(U64\x20type)\x20within\x20the\x20history\x20entry.\x20Typically\x20an\x20\x27identifier\x27\x20node\x20referencing\x20a\x20U64\x20value\x20from\x20the\x20Guard\x20table.'),'forwardIdx':GuardNodeSchema['describe']('GuardNode\x20that\x20returns\x20the\x20forward\x20operation\x20index\x20(U64\x20type)\x20within\x20the\x20session.\x20Typically\x20an\x20\x27identifier\x27\x20node\x20referencing\x20a\x20U64\x20value\x20from\x20the\x20Guard\x20table.')})['strict']()['describe']('Returns\x20U64.\x20Counts\x20the\x20number\x20of\x20retained\x20submissions\x20within\x20the\x20specified\x20forward\x20operation.')]))['describe']('Guard\x20node:\x20represents\x20an\x20operation\x20instruction\x20in\x20Guard.\x20Each\x20node\x20returns\x20a\x20value\x20of\x20a\x20specific\x20type,\x20computed\x20from\x20its\x20child\x20nodes\x20or\x20context.');export const ObjectGuardSchema=ObjectBaseSchema['extend']({'description':z['string']()['describe']('Guard\x20object\x20description'),'table':z['array'](GuardTableItemSchema)['describe']('Guard\x20object\x20table\x20item\x20list'),'input':z['array'](z['number']())['describe']('Guard\x20object\x20instruction\x20sequence'),'root':GuardNodeSchema['describe']('Guard\x20object\x20root\x20node'),'rep_quote':z['record'](z['string']()['describe']('Repository\x20object\x20ID'),z['array'](z['string']())['describe']('Repository\x20policy\x20list'))['describe']('Depends\x20on\x20Repository\x20policy\x20quote'),'relies':z['array'](z['string']())['describe']('List\x20of\x20other\x20Guard\x20object\x20IDs\x20that\x20this\x20Guard\x20object\x20depends\x20on'),'relies_logic_and':z['boolean']()['describe']('Whether\x20the\x20logical\x20relationship\x20between\x20this\x20Guard\x20object\x20and\x20its\x20dependencies\x20is\x20AND;\x20if\x20true,\x20validation\x20result\x20is\x20AND\x20of\x20this\x20Guard\x20and\x20all\x20dependencies,\x20if\x20false,\x20it\x27s\x20OR'),'rep':z['boolean']()['describe']('If\x20false,\x20has\x20complex\x20Repository\x20quote\x20dependencies\x20and\x20cannot\x20be\x20used\x20as\x20an\x20independent\x20Guard')})['describe']('Guard\x20object');export const PaymentInfoSchema=z['object']({'for_object':z['union']([z['string'](),z['null']()])['optional']()['describe']('Payment\x20for\x20a\x20specific\x20object\x20ID'),'for_guard':z['union']([z['string'](),z['null']()])['optional']()['describe']('Payment\x20to\x20satisfy\x20verification\x20of\x20a\x20Guard\x20object'),'remark':z['string']()['describe']('Payment\x20record\x20remark'),'index':z['union']([z['number'](),z['string']()])['describe']('Payment\x20record\x20index')})['describe']('Payment\x20information');export const ObjectPaymentSchema=ObjectBaseSchema['extend']({'record':z['array'](z['object']({'recipient':RecipientSchema,'amount':BalanceTypeSchema}))['describe']('Payment\x20record\x20list'),'amount':BalanceTypeSchema['describe']('Payment\x20amount'),'time':z['union']([z['string'](),z['number']()])['describe']('Payment\x20time'),'from_object':z['union']([z['string'](),z['null']()])['optional']()['describe']('Payment\x20source\x20object\x20ID'),'signer':z['string']()['describe']('Payment\x20signer\x20ID'),'info':PaymentInfoSchema})['describe']('Payment\x20object');export const ObjectAllocationSchema=ObjectBaseSchema['extend']({'description':z['string']()['describe']('Fund\x20allocation\x20object\x20description'),'allocators':z['array'](AllocatorSchema)['describe']('Fund\x20allocation\x20object\x20allocator\x20list'),'balance':BalanceTypeSchema['describe']('Fund\x20allocation\x20object\x20balance'),'payment_info':PaymentInfoSchema['optional']()['describe']('Payment\x20information'),'payment':z['array'](z['string']())['describe']('Payment\x20object\x20ID\x20list.\x20Each\x20fund\x20allocation\x20automatically\x20generates\x20a\x20payment\x20object\x20to\x20record\x20fund\x20flow')})['describe']('Fund\x20allocation\x20object');export const VoteWeightSchema=z['union']([z['object']({'GuardIdentifier':GuardIdentifierSchema})['describe']('Use\x20value\x20corresponding\x20to\x20Guard\x20object\x27s\x20Table\x20index\x20as\x20voting\x20weight'),z['object']({'FixedValue':z['number']()['int']()['min'](0x0)['max'](0xffff)['describe']('Fixed\x20voting\x20weight\x20value')})['describe']('Fixed\x20voting\x20weight')])['describe']('Voting\x20weight');export const VotingGuardSchema=z['object']({'guard':z['string']()['describe']('Voting\x20Guard\x20object\x20ID'),'vote_weight':VoteWeightSchema})['describe']('Voting\x20Guard\x20object');export const ObjectArbitrationSchema=ObjectBaseSchema['extend']({'description':z['string']()['describe']('Arbitration\x20object\x20description'),'location':z['string']()['describe']('Arbitration\x20object\x20location'),'voting_guard':z['array'](VotingGuardSchema)['describe']('Voting\x20Guard\x20object\x20list'),'usage_guard':z['union']([z['string'](),z['null']()])['optional']()['describe']('Guard\x20object\x20ID\x20that\x20needs\x20verification\x20when\x20submitting\x20arbitration'),'fee':BalanceTypeSchema['describe']('Single\x20arbitration\x20fee'),'balance':BalanceTypeSchema['describe']('Arbitration\x20object\x20balance'),'bPaused':z['boolean']()['describe']('Whether\x20arbitration\x20object\x20is\x20paused'),'um':z['union']([z['string'](),z['null']()])['describe']('Contact\x20object'),'permission':z['string']()['describe']('Arbitration\x20object\x20permission')})['describe']('Arbitration\x20object');export const GuardInPassportSchema=z['object']({'guard':z['string']()['describe']('Guard\x20object\x20ID'),'result':z['boolean']()['describe']('Guard\x20object\x20verification\x20result'),'impack':z['boolean']()['describe']('Whether\x20Guard\x20object\x20verification\x20result\x20participates\x20in\x20final\x20result\x20determination\x20(AND\x20logic)'),'relies':z['array'](z['string']())['describe']('List\x20of\x20other\x20Guard\x20object\x20IDs\x20that\x20this\x20Guard\x20object\x20depends\x20on'),'relies_logic_and':z['boolean']()['describe']('Whether\x20the\x20logical\x20relationship\x20between\x20this\x20Guard\x20object\x20and\x20its\x20dependencies\x20is\x20AND;\x20if\x20true,\x20validation\x20result\x20is\x20AND\x20of\x20this\x20Guard\x20and\x20all\x20dependencies,\x20if\x20false,\x20it\x27s\x20OR'),'submission':GuardSubmissionSchema['describe']('Data\x20submitted\x20by\x20user\x20during\x20Guard\x20object\x20verification')})['describe']('Record\x20of\x20Guard\x20object\x20in\x20Passport\x20object');export const ObjectPassportSchema=ObjectBaseSchema['extend']({'info':z['array'](GuardInPassportSchema)['describe']('List\x20of\x20Guard\x20object\x20records\x20in\x20Passport\x20object'),'result':z['boolean']()['describe']('Passport\x20object\x20final\x20verification\x20result'),'tx_hash':z['string']()['describe']('Transaction\x20hash\x20where\x20verification\x20occurred'),'impack_guard':z['array'](z['string']())['describe']('List\x20of\x20Guard\x20object\x20IDs\x20participating\x20in\x20final\x20result\x20determination'),'time':z['number']()['describe']('Creation\x20time\x20of\x20the\x20Passport\x20object'),'signer':z['string']()['describe']('Signer\x20address\x20of\x20the\x20Passport\x20object'),'has_verified':z['boolean']()['describe']('Whether\x20the\x20Passport\x20object\x20has\x20been\x20verified')})['describe']('Passport\x20object');export const TableItem_PermissionPermSchema=ObjectBaseSchema['extend']({'address':z['string']()['describe']('User\x20ID\x20or\x20Guard\x20ID'),'perm':z['array'](PermissionIndexTypeSchema['nullable']()['or'](z['number']()))['describe']('Permission\x20list\x20obtained\x20after\x20user\x20or\x20Guard\x20object\x20verification')})['describe']('Permission\x20object\x27s\x20permission\x20record');export const TableItem_DemandPresenterSchema=ObjectBaseSchema['extend']({'address':z['string']()['describe']('Referrer\x20ID'),'recommend':z['string']()['describe']('Recommendation\x20letter'),'service':tolerantStringNullable['describe']('Recommended\x20service\x20object\x20ID'),'update_time':tolerantNumber['describe']('Last\x20update\x20time'),'acceptance_score':tolerantNumberNullable['describe']('Demand\x20object\x20feedback\x20score'),'feedback':z['string']()['describe']('Demand\x20object\x20feedback\x20information'),'feedback_time':tolerantNumber['describe']('Demand\x20object\x20feedback\x20time')})['describe']('Demand\x20object\x27s\x20Service\x20recommendation\x20record');export const MachineForwardGuardSchema=z['object']({'guard':z['string']()['describe']('Guard\x20object\x20name\x20or\x20address\x20(string).\x20Example:\x20\x27my_attendance_guard\x27\x20or\x20\x270x1234...\x27'),'retained_submission':z['array'](tolerantNumber)['nullable']()['optional']()['describe']('Data\x20submitted\x20by\x20user\x20during\x20Guard\x20object\x20verification')})['strict']()['describe']('Record\x20of\x20Guard\x20object\x20in\x20MachineForwardGuard\x20object.\x20ALWAYS\x20an\x20OBJECT\x20{guard:\x20string,\x20retained_submission?:\x20number[]}\x20—\x20never\x20a\x20plain\x20string.\x20The\x20inner\x20\x27guard\x27\x20field\x20is\x20the\x20Guard\x27s\x20name\x20or\x20address\x20as\x20a\x20string.');export const MachineForwardSchema=z['object']({'name':z['string']()['describe']('Forward\x20name'),'namedOperator':tolerantStringNullable['describe']('Forward\x20operation\x20permission\x201:\x20Namespace\x20(one\x20of\x20the\x20two\x20must\x20be\x20specified);\x20recommended\x20if\x20Progress\x20object\x20operators\x20are\x20different\x20(e.g.,\x20different\x20delivery\x20personnel\x20for\x20different\x20orders).'),'permissionIndex':tolerantNumberNullable['describe']('Forward\x20operation\x20permission\x202:\x20Permission\x20index\x20(one\x20of\x20the\x20two\x20must\x20be\x20specified);\x20recommended\x20if\x20all\x20Progress\x20object\x20operators\x20are\x20the\x20same\x20(e.g.,\x20same\x20reward\x20reviewers\x20for\x20all\x20orders).'),'weight':tolerantNumber['describe']('Forward\x20weight'),'guard':z['preprocess'](a=>{if(typeof a==='string')return{'guard':a};return a;},z['union']([MachineForwardGuardSchema['describe']('OBJECT\x20form:\x20{guard:\x20\x27<guard_name_or_address>\x27,\x20retained_submission?:\x20number[]}.\x20'+'Use\x20this\x20form\x20when\x20you\x20need\x20to\x20pass\x20retained_submission\x20data\x20alongside\x20the\x20Guard\x20reference.'),z['string']()['describe']('STRING\x20form\x20(shorthand):\x20the\x20Guard\x20object\x27s\x20name\x20or\x20address\x20as\x20a\x20plain\x20string.\x20'+'Auto-wrapped\x20to\x20{guard:\x20<string>}\x20at\x20runtime.\x20Use\x20this\x20when\x20you\x20only\x20need\x20to\x20reference\x20a\x20Guard\x20without\x20retained_submission.')])['nullable']()['optional']())['describe']('Guard\x20reference\x20for\x20this\x20forward.\x20Accepts\x20TWO\x20formats:\x0a'+'•\x20STRING\x20(preferred):\x20\x22my_guard_name\x22\x20—\x20the\x20Guard\x27s\x20name\x20or\x20address\x20as\x20a\x20plain\x20string.\x0a'+'•\x20OBJECT\x20(only\x20when\x20retained_submission\x20is\x20needed):\x20{guard:\x20\x22my_guard_name\x22,\x20retained_submission:\x20[1,2,3]}.\x0a'+'FOLLOW\x20THE\x20SCHEMA\x20FIELD\x20STRUCTURE:\x20A\x20Guard\x20reference\x20is\x20fundamentally\x20a\x20STRING\x20(the\x20Guard\x20object\x27s\x20name\x20or\x20address).\x20'+'Provide\x20a\x20string\x20when\x20you\x20only\x20need\x20to\x20reference\x20a\x20Guard\x20—\x20do\x20NOT\x20wrap\x20a\x20bare\x20string\x20in\x20an\x20object\x20structure.\x20'+'The\x20OBJECT\x20form\x20{guard:\x20\x22...\x22,\x20retained_submission:\x20[...]}\x20exists\x20ONLY\x20to\x20carry\x20additional\x20`retained_submission`\x20data\x20'+'alongside\x20the\x20string\x20reference;\x20inside\x20the\x20object,\x20the\x20`guard`\x20field\x20is\x20STILL\x20a\x20string.\x20'+'In\x20short:\x20string-in\x20for\x20a\x20string\x20reference,\x20object-in\x20only\x20when\x20you\x20need\x20to\x20pass\x20extra\x20data.\x0a'+'COGNITIVE\x20PRINCIPLE:\x20Guard\x20validation\x20ALWAYS\x20occurs\x20BEFORE\x20the\x20forward\x20operation.\x20'+'A\x20Guard\x20that\x20queries\x20state\x20of\x20the\x20SAME\x20Progress\x20object\x20this\x20forward\x20operates\x20on\x20'+'(e.g.\x20progress.current)\x20will\x20see\x20the\x20PRE-transition\x20value\x20(source\x20node),\x20NOT\x20the\x20target\x20node.\x20'+'If\x20the\x20Guard\x20checks\x20progress.current\x20==\x20target_node,\x20it\x20will\x20ALWAYS\x20FAIL.\x20'+'Querying\x20a\x20DIFFERENT\x20Progress\x20object\x20(cross-machine)\x20is\x20safe\x20and\x20reasonable\x20—\x20'+'that\x20progress\x20is\x20not\x20modified\x20by\x20this\x20forward.\x20'+'For\x20target-node\x20verification\x20after\x20transition,\x20bind\x20the\x20Guard\x20to\x20the\x20Allocator\x20instead\x20'+'(allocation.alloc\x20runs\x20AFTER\x20the\x20state\x20transition\x20completes).\x0a'+'⚠️\x20T1\x20LOSSY\x20POINT\x20(B-3):\x20WoWok\x20has\x20NO\x20on-chain\x20cron.\x20A\x20business\x20phrase\x20like\x20\x27after\x20N\x20days,\x20auto-X\x27\x20'+'is\x20NOT\x20an\x20automatic\x20trigger\x20—\x20it\x20decomposes\x20into\x20(1)\x20a\x20time_guard\x20that\x20checks\x20elapsed\x20time,\x20and\x20'+'(2)\x20an\x20OFF-CHAIN\x20keeper\x20that\x20must\x20submit\x20the\x20forward\x20when\x20the\x20guard\x20passes.\x20'+'Configuring\x20a\x20time_guard\x20WITHOUT\x20a\x20keeper\x20means\x20nothing\x20ever\x20fires.')})['strict']()['refine'](a=>a['namedOperator']!==null&&a['namedOperator']!==undefined||a['permissionIndex']!==null&&a['permissionIndex']!==undefined,{'message':'One\x20of\x20\x27namedOperator\x27\x20or\x20\x27permissionIndex\x27\x20must\x20be\x20provided\x20for\x20each\x20forward.\x20'+'Use\x20namedOperator:\x27\x27\x20(empty\x20string)\x20when\x20the\x20ORDER\x20OWNER\x20operates\x20this\x20forward;\x20'+'use\x20a\x20permissionIndex\x20(e.g.\x201000)\x20when\x20the\x20same\x20operator\x20acts\x20for\x20all\x20orders.'})['describe']('Forward\x20in\x20Machine\x20object');export const MachineNodePairSchema=z['object']({'prev_node':z['string']()['describe']('Previous\x20node\x20name.\x20Empty\x20string\x20\x27\x27\x20means\x20initial\x20entry\x20node\x20(the\x20first\x20node\x20in\x20the\x20workflow).'),'threshold':tolerantNumber['default'](0x0)['describe']('Threshold\x20to\x20trigger\x20node\x20advancement.\x20If\x20total\x20Forward\x20weight\x20is\x20greater\x20than\x20or\x20equal\x20to\x20threshold,\x20node\x20advancement\x20is\x20triggered.'),'forwards':z['array'](MachineForwardSchema)['describe']('Forward\x20list\x20—\x20operations\x20to\x20ENTER\x20THIS\x20NODE\x20from\x20prev_node.\x20'+'SEMANTIC\x20CLARIFICATION:\x20forwards\x20describe\x20INCOMING\x20transitions\x20(how\x20to\x20ARRIVE\x20at\x20this\x20node),\x20'+'NOT\x20outgoing\x20transitions.\x20Think\x20of\x20each\x20forward\x20as\x20an\x20\x27entry\x20door\x27\x20to\x20this\x20node.\x20'+'Example:\x20pair\x20{prev_node:\x27A\x27,\x20forwards:[{name:\x27Go\x27}]}\x20means\x20\x27use\x20Go\x20to\x20advance\x20FROM\x20A\x20TO\x20THIS\x20NODE\x27.\x20'+'For\x20initial\x20node\x20(prev_node=\x27\x27),\x20forwards\x20are\x20operations\x20to\x20enter\x20this\x20node\x20from\x20the\x20start\x20state.\x20'+'DIAGRAM:\x20A\x20--[Go]-->\x20B\x20means\x20the\x20pair\x20belongs\x20to\x20node\x20B\x20(destination),\x20with\x20prev_node=\x27A\x27.\x20'+'WARNING:\x20forwards\x20belong\x20to\x20the\x20DESTINATION\x20node\x27s\x20pair,\x20NOT\x20the\x20source\x20node.\x20'+'Placing\x20a\x20forward\x20on\x20the\x20wrong\x20pair\x20will\x20cause\x20Progress\x20to\x20get\x20stuck.')})['strict']()['describe']('Node\x20pair\x20in\x20Machine\x20object')['refine'](a=>{if(a['prev_node']===''&&a['forwards']['length']===0x0)return![];return!![];},{'message':'Initial\x20node\x20(prev_node=\x27\x27)\x20must\x20have\x20at\x20least\x20one\x20forward.\x20Without\x20a\x20forward,\x20Progress\x20cannot\x20advance\x20from\x20\x27\x27\x20to\x20this\x20node,\x20causing\x20the\x20order\x20workflow\x20to\x20be\x20permanently\x20stuck.'});export const MachineNodeSchema=z['object']({'name':z['string']()['describe']('Node\x20name.\x20⚠️\x20T1\x20LOSSY\x20POINT\x20(B-1):\x20do\x20NOT\x20name\x20a\x20node\x20\x27refund\x27/\x27refunded\x27/\x27disputed\x27/\x27cancelled\x27\x20'+'to\x20model\x20fund\x20return\x20or\x20dispute\x20—\x20funds\x20MUST\x20move\x20through\x20the\x20Allocation\x20waterfall\x20(order_allocators),\x20'+'NOT\x20through\x20Machine\x20terminal\x20nodes\x20(R-M1-11).\x20A\x20node\x20named\x20\x27refund\x27\x20is\x20a\x20semantic\x20lie:\x20reaching\x20it\x20does\x20'+'not\x20move\x20funds\x20by\x20itself.\x20Model\x20refund\x20as\x20a\x20refund-to-Order\x20Allocator\x20slot\x20(a\x20{\x20Signer\x20}\x20or\x20Order-owner\x20'+'recipient),\x20and\x20model\x20dispute\x20as\x20the\x20bound\x20Arbitration,\x20not\x20a\x20Machine\x20node.'),'pairs':z['array'](MachineNodePairSchema)['describe']('Node\x20pair\x20list')})['strict']()['describe']('Node\x20in\x20Machine\x20object');export const TableItem_MachineNodeSchema=ObjectBaseSchema['extend']({'name':z['string']()['describe']('Node\x20name'),'value':z['array'](MachineNodePairSchema)['describe']('Node\x20pair\x20list')})['describe']('Node\x20record\x20in\x20Machine\x20object');export const TableItem_ProgressHistorySchema=ObjectBaseSchema['extend']({'index':tolerantNumber['describe']('Progress\x20record\x20index\x20(starting\x20from\x200)'),'node':z['string']()['describe']('Previous\x20node\x20name'),'next_node':z['string']()['describe']('Next\x20node\x20name'),'session':z['array'](ProgressSessionSchema)['describe']('Progress\x20session\x20list'),'time':tolerantNumberNullable['describe']('Progress\x20record\x20completion\x20time\x20(Unix\x20timestamp)')})['describe']('Completed\x20progress\x20record\x20in\x20Progress\x20object');export const TableItem_TreasuryHistorySchema=ObjectBaseSchema['extend']({'payment':NameOrAddressSchema['describe']('Payment\x20object\x20ID'),'op':TreasuryOpSchema['describe']('Operation\x20type'),'signer':z['string']()['describe']('Operator\x20ID'),'external_guard':tolerantStringNullable['describe']('Guard\x20object\x20ID\x20verified\x20during\x20operation\x20(none\x20if\x20operated\x20through\x20Permission)'),'amount':BalanceTypeSchema['describe']('Payment\x20amount'),'time':tolerantNumber['describe']('Payment\x20time\x20(Unix\x20timestamp)'),'store_from_id':tolerantStringNullable['describe']('Stored\x20value\x20from\x20Guard\x20table.\x20This\x20stores\x20the\x20value\x20(address\x20or\x20number\x20converted\x20to\x20address,\x20including\x20submitted\x20values)\x20from\x20the\x20Guard\x20table\x20at\x20the\x20specified\x20index\x20for\x20Guard\x20verification\x20purposes.')})['describe']('Payment\x20record\x20in\x20Treasury\x20object');export const ObjectsQuerySchema=QueryEnvSchema['extend']({'objects':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20object\x20IDs\x20to\x20query')})['describe']('Request\x20parameters\x20for\x20querying\x20objects');export const ObjectUnionSchema=z['union']([ObjectTreasurySchema,ObjectPermissionSchema,ObjectMachineSchema,ObjectServiceSchema,ObjectOrderSchema,ObjectProgressSchema,ObjectDemandSchema,ObjectArbitrationSchema,ObjectAllocationSchema,ObjectRewardSchema,ObjectRepositorySchema,ObjectGuardSchema,ObjectPaymentSchema,ObjectPassportSchema,ObjectEntityRegistrarSchema,ObjectEntityLinkerSchema,ObjectResourceSchema,ObjectArbSchema,ObjectDiscountSchema,ObjectContactSchema,ObjectPersonalSchema,ObjectBaseSchema,ObjectProofSchema])['describe']('Union\x20of\x20all\x20wowok\x20on-chain\x20object\x20types');export const ObjectsAnswerSchema=z['object']({'objects':z['array'](ObjectUnionSchema)['optional']()['describe']('List\x20of\x20queried\x20objects')})['describe']('Response\x20for\x20querying\x20objects');export const PersonalQuerySchema=QueryEnvSchema['extend']({'account':NameOrAddressSchema['optional']()['describe']('Account\x20name\x20or\x20ID\x20to\x20query.\x20Use\x20empty\x20string\x20\x27\x27\x20for\x20the\x20default\x20account.\x20')})['describe']('Query\x20PUBLIC\x20on-chain\x20personal\x20profile\x20for\x20any\x20account.\x20Returns\x20publicly\x20published\x20information\x20(social\x20accounts,\x20websites,\x20professional\x20info)\x20that\x20users\x20have\x20intentionally\x20shared\x20on\x20the\x20blockchain.');export const TableQuerySchema=QueryEnvSchema['extend']({'parent':NameOrAddressSchema['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'cursor':z['union']([z['string'](),z['null']()])['optional']()['describe']('Pagination\x20cursor'),'limit':z['union']([z['number'](),z['null']()])['optional']()['describe']('Number\x20of\x20records\x20returned\x20per\x20page')})['describe']('Request\x20parameters\x20for\x20querying\x20object\x27s\x20data\x20table');export const TableAnswerItemSchema=z['object']({'key':z['object']({'type':z['string']()['describe']('Key\x20type'),'value':z['union']([z['string'](),z['number']()])['describe']('Key\x20value')})['describe']('Query\x20key\x20and\x20its\x20type'),'type':z['string']()['describe']('Table\x20item\x20object\x20type'),'object':z['string']()['describe']('Table\x20item\x20object\x20ID'),'version':z['union']([z['string'](),z['number']()])['describe']('Table\x20item\x20object\x20version')})['describe']('Result\x20item\x20of\x20object\x27s\x20data\x20table\x20query');export const TableAnswerSchema=z['object']({'items':z['array'](TableAnswerItemSchema),'nextCursor':z['union']([z['string'](),z['null']()]),'hasNextPage':z['boolean'](),'cache_expire':CacheExpireTypeSchema['optional']()});export const QueryTableItem_byAddressSchema=QueryEnvSchema['extend']({'parent':z['string']()['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'address':z['union']([AccountOrMark_AddressSchema,z['string']()])['describe']('ID\x20of\x20the\x20record\x20to\x20query')})['describe']('Request\x20parameters\x20for\x20querying\x20records\x20by\x20ID\x20in\x20object\x27s\x20data\x20table');export const QueryTableItem_byU64Schema=QueryEnvSchema['extend']({'parent':z['string']()['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'u64':z['union']([z['number'](),z['string']()])['describe']('U64\x20value\x20of\x20the\x20record\x20to\x20query')})['describe']('Request\x20parameters\x20for\x20querying\x20records\x20by\x20U64\x20in\x20object\x27s\x20data\x20table');export const QueryTableItem_byStringSchema=QueryEnvSchema['extend']({'parent':z['string']()['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'key':z['string']()['describe']('String\x20key\x20of\x20the\x20record\x20to\x20query')})['describe']('Request\x20parameters\x20for\x20querying\x20records\x20by\x20string\x20key\x20in\x20object\x27s\x20data\x20table');export const QueryTableItem_byNameAddressSchema=QueryEnvSchema['extend']({'parent':z['string']()['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'name':z['string']()['describe']('Name\x20of\x20the\x20record\x20to\x20query'),'entity':z['union']([AccountOrMark_AddressSchema,z['number']()])['describe']('ID\x20of\x20the\x20record\x20to\x20query')})['describe']('Request\x20parameters\x20for\x20querying\x20records\x20by\x20name\x20and\x20ID\x20in\x20object\x27s\x20data\x20table');export const QueryTableItem_Registrar_EntitySchema=QueryEnvSchema['extend']({'address':z['union']([AccountOrMark_AddressSchema,z['string']()])['describe']('ID\x20of\x20the\x20record\x20to\x20query')})['describe']('Request\x20parameters\x20for\x20querying\x20records\x20by\x20ID\x20in\x20Registrar\x20object\x27s\x20data\x20table');export const EventTypeSchema=z['union']([z['literal']('ArbEvent'),z['literal']('NewOrderEvent'),z['literal']('ProgressEvent'),z['literal']('DemandPresentEvent'),z['literal']('DemandFeedbackEvent'),z['literal']('NewEntityEvent'),z['string']()])['describe']('Event\x20type.\x20Supports\x20Wowok\x20built-in\x20types\x20(ArbEvent,\x20NewOrderEvent,\x20ProgressEvent,\x20DemandPresentEvent,\x20DemandFeedbackEvent,\x20NewEntityEvent)\x20or\x20any\x20string\x20for\x20generic\x20MoveEventType\x20(e.g.,\x20\x270x2::coin::CoinEvent\x27)');export const EventCursorSchema=z['object']({'eventSeq':z['union']([z['string'](),z['number']()])['describe']('Event\x20sequence\x20number'),'txDigest':z['string']()['describe']('Transaction\x20digest')})['describe']('Event\x20cursor');export const EventBaseSchema=z['object']({'id':EventCursorSchema,'sender':z['string']()['describe']('Event\x20sender\x20ID'),'type':EventTypeSchema,'type_raw':z['string']()['describe']('Raw\x20event\x20type'),'time':z['union']([z['string'](),z['number']()])['describe']('Event\x20occurrence\x20time'),'parsedJson_raw':z['any']()['optional']()['describe']('Raw\x20parsed\x20JSON\x20data\x20from\x20the\x20event')})['describe']('Event\x20base\x20information');export const ArbEventSchema=EventBaseSchema['extend']({'arb':z['string']()['describe']('Arbitration\x20object\x20ID'),'arbitration':z['string']()['describe']('Arbitration\x20object\x20ID'),'order':z['string']()['describe']('Order\x20object\x20ID'),'status':ArbStatusSchema})['describe']('Arbitration\x20event');export const NewOrderEventSchema=EventBaseSchema['extend']({'order':z['string']()['describe']('Order\x20object\x20ID'),'service':z['string']()['describe']('Service\x20object\x20ID'),'progress':z['union']([z['string'](),z['null']()])['optional']()['describe']('Progress\x20object\x20ID'),'discount':z['union']([z['string'](),z['null']()])['optional']()['describe']('Discount\x20object\x20ID'),'allocation':z['union']([z['string'](),z['null']()])['optional']()['describe']('Allocation\x20object\x20ID'),'amount':BalanceTypeSchema})['describe']('New\x20order\x20event');export const ProgressEventSchema=EventBaseSchema['extend']({'progress':z['string']()['describe']('Progress\x20object\x20ID'),'machine':z['string']()['describe']('Machine\x20object\x20ID'),'task':z['union']([z['string'](),z['null']()])['optional']()['describe']('Task\x20object\x20ID'),'node':z['string']()['describe']('Current\x20node\x20name'),'forward':z['union']([z['string'](),z['null']()])['optional']()['describe']('Forward\x20operation\x20name'),'hold':z['union']([z['boolean'](),z['null']()])['optional']()['describe']('Whether\x20it\x20is\x20a\x20hold\x20operation')})['describe']('Progress\x20event');export const DemandPresentEventSchema=EventBaseSchema['extend']({'demand':z['string']()['describe']('Demand\x20object\x20ID'),'service':z['union']([z['string'](),z['null']()])['optional']()['describe']('Service\x20object\x20ID'),'recommend':z['string']()['describe']('Recommendation\x20letter')})['describe']('Event\x20of\x20recommending\x20service\x20to\x20Demand\x20object');export const DemandFeedbackEventSchema=EventBaseSchema['extend']({'demand':z['string']()['describe']('Demand\x20object\x20ID'),'service':z['union']([z['string'](),z['null']()])['optional']()['describe']('Service\x20object\x20ID'),'feedback':z['string']()['describe']('Feedback\x20content'),'acceptance_score':z['union']([z['number'](),z['null']()])['optional']()['describe']('Acceptance\x20score')})['describe']('Event\x20of\x20Demand\x20object\x20feedback\x20to\x20referrer');export const NewEntityEventSchema=EventBaseSchema['extend']({'address':z['string']()['describe']('User\x20ID'),'resource':z['string']()['describe']('ID\x20mark\x20object\x20ID\x20owned\x20by\x20user'),'referrer':z['union']([z['string'](),z['null']()])['optional']()['describe']('Referrer\x20ID')})['describe']('New\x20user\x20event');export const EventAnswerSchema=z['object']({'data':z['array'](z['union']([EventBaseSchema,ArbEventSchema,NewOrderEventSchema,ProgressEventSchema,DemandPresentEventSchema,DemandFeedbackEventSchema,NewEntityEventSchema]))['describe']('Event\x20object\x20data'),'hasNextPage':z['boolean']()['describe']('Whether\x20there\x20is\x20a\x20next\x20page'),'nextCursor':z['union']([EventCursorSchema,z['null']()])['optional']()['describe']('Next\x20page\x20cursor'),'cache_expire':CacheExpireTypeSchema['optional']()['describe']('Cache\x20expiration\x20time')})['describe']('Event\x20query\x20result');export const EventQuerySchema=QueryEnvSchema['extend']({'type':EventTypeSchema['describe']('Event\x20type'),'cursor':z['union']([EventCursorSchema,z['null']()])['optional']()['describe']('Event\x20cursor'),'limit':z['union']([z['number'](),z['null']()])['optional']()['describe']('Query\x20count\x20limit'),'order':z['union']([z['literal']('ascending'),z['literal']('descending'),z['null']()])['optional']()['describe']('Sort\x20order')})['describe']('Event\x20query\x20parameters');export const OnchainEventsInputSchema=z['object']({'type':EventTypeSchema['describe']('Event\x20type\x20to\x20query.\x20Supported\x20types:\x20ArbEvent\x20(arbitration\x20events),\x20NewOrderEvent\x20(new\x20order\x20events),\x20ProgressEvent\x20(progress\x20events),\x20DemandPresentEvent\x20(demand\x20presentation\x20events),\x20DemandFeedbackEvent\x20(demand\x20feedback\x20events),\x20NewEntityEvent\x20(new\x20entity\x20registration\x20events)'),'cursor':z['union']([EventCursorSchema,z['null']()])['optional']()['describe']('Optional\x20pagination\x20cursor\x20for\x20fetching\x20next\x20page\x20of\x20results.\x20Use\x20null\x20for\x20first\x20query,\x20then\x20use\x20nextCursor\x20from\x20response\x20for\x20subsequent\x20queries'),'limit':z['union']([z['number'](),z['null']()])['optional']()['describe']('Maximum\x20number\x20of\x20events\x20to\x20return\x20per\x20query.\x20Use\x20null\x20for\x20default\x20limit'),'order':z['union']([z['literal']('ascending'),z['literal']('descending'),z['null']()])['optional']()['describe']('Sort\x20order\x20for\x20results:\x20\x27ascending\x27\x20(oldest\x20first)\x20or\x20\x27descending\x27\x20(newest\x20first).\x20Use\x20null\x20for\x20default\x20order'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20bypass\x20cache\x20and\x20fetch\x20fresh\x20data\x20from\x20the\x20blockchain'),'network':EntrypointSchema['optional']()['describe']('Network\x20to\x20query:\x20\x27mainnet\x27\x20or\x20\x27testnet\x27.\x20Uses\x20default\x20network\x20if\x20not\x20specified')})['strict']()['describe']('Input\x20parameters\x20for\x20querying\x20on-chain\x20WOWOK\x20events');export const OnchainEventsResultSchema=z['object']({'result':z['union']([EventAnswerSchema,z['null']()])['describe']('Event\x20query\x20result\x20containing\x20list\x20of\x20events\x20and\x20pagination\x20info,\x20or\x20null\x20if\x20no\x20data\x20found'),'semantic':SemanticSummarySchema['optional']()['describe']('Business\x20semantic\x20summary\x20for\x20the\x20event\x20query')})['describe']('Result\x20of\x20on-chain\x20events\x20query');export const TableItem_RepositoryDataOrUndefinedSchema=z['union']([TableItem_RepositoryDataSchema,z['null']()])['describe']('Repository\x20data\x20item\x20or\x20null');export const TableItem_PermissionPermOrUndefinedSchema=z['union']([TableItem_PermissionPermSchema,z['null']()])['describe']('Permission\x20permission\x20item\x20or\x20null');export const TableItem_EntityRegistrarOrUndefinedSchema=z['union']([TableItem_EntityRegistrarSchema,z['null']()])['describe']('Entity\x20registrar\x20item\x20or\x20null');export const TableItem_EntityLinkerOrUndefinedSchema=z['union']([TableItem_EntityLinkerSchema,z['null']()])['describe']('Entity\x20linker\x20item\x20or\x20null');export const TableItem_RewardRecordOrUndefinedSchema=z['union']([TableItem_RewardRecordSchema,z['null']()])['describe']('Reward\x20record\x20item\x20or\x20null');export const TableItem_DemandPresenterOrUndefinedSchema=z['union']([TableItem_DemandPresenterSchema,z['null']()])['describe']('Demand\x20presenter\x20item\x20or\x20null');export const TableItem_TreasuryHistoryOrUndefinedSchema=z['union']([TableItem_TreasuryHistorySchema,z['null']()])['describe']('Treasury\x20history\x20item\x20or\x20null');export const TableItem_MachineNodeOrUndefinedSchema=z['union']([TableItem_MachineNodeSchema,z['null']()])['describe']('Machine\x20node\x20item\x20or\x20null');export const TableItem_ProgressHistoryOrUndefinedSchema=z['union']([TableItem_ProgressHistorySchema,z['null']()])['describe']('Progress\x20history\x20item\x20or\x20null');export const TableItem_AddressMarkOrUndefinedSchema=z['union']([TableItem_AddressMarkSchema,z['null']()])['describe']('Address\x20mark\x20item\x20or\x20null');export const ObjectPersonalOrUndefinedSchema=z['object']({'result':z['union']([ObjectPersonalSchema,z['null']()])['describe']('Personal\x20object\x20or\x20null')})['describe']('Personal\x20object\x20or\x20null');export const TokenTypeInfoOrUndefinedSchema=z['object']({'result':z['union']([TokenTypeInfoSchema,z['null']()])['describe']('Token\x20type\x20info\x20or\x20null')})['describe']('Token\x20type\x20info\x20or\x20null');export const EventAnswerOrUndefinedSchema=z['object']({'result':z['union']([EventAnswerSchema,z['null']()])['describe']('Event\x20answer\x20or\x20null')})['describe']('Event\x20answer\x20or\x20null');export const TableAnswerOrUndefinedSchema=z['object']({'result':z['union']([TableAnswerSchema,z['null']()])['describe']('Table\x20answer\x20or\x20null')})['describe']('Table\x20answer\x20or\x20null');export const QueryTableItemSchema=z['discriminatedUnion']('type',[z['object']({'type':z['literal']('RepositoryData'),'parent':NameOrAddressSchema['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'name':z['string']()['describe']('Name\x20of\x20the\x20record\x20to\x20query'),'entity':z['union']([AccountOrMark_AddressSchema,z['number']()])['describe']('ID\x20or\x20address\x20of\x20the\x20entity;\x20or\x20address\x20that\x20number\x20is\x20casted\x20to'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20cache'),'network':EntrypointSchema['optional']()})['describe']('Request\x20parameters\x20for\x20querying\x20repository\x20data\x20table\x20item'),z['object']({'type':z['literal']('PermissionPerm'),'parent':NameOrAddressSchema['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'address':z['union']([AccountOrMark_AddressSchema,z['string']()])['describe']('User\x20ID\x20or\x20address,\x20or\x20Guard\x20ID\x20in\x20the\x20permission\x20perm\x20table'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20cache'),'network':EntrypointSchema['optional']()})['describe']('Request\x20parameters\x20for\x20querying\x20permission\x20perm\x20table\x20item'),z['object']({'type':z['literal']('EntityRegistrar'),'parent':NameOrAddressSchema['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'address':AccountOrMark_AddressSchema['describe']('User\x20ID\x20or\x20address\x20of\x20the\x20entity'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20cache'),'network':EntrypointSchema['optional']()})['describe']('Request\x20parameters\x20for\x20querying\x20entity\x20registrar\x20table\x20item'),z['object']({'type':z['literal']('EntityLinker'),'address':z['union']([AccountOrMark_AddressSchema,z['string']()])['describe']('ID\x20or\x20address\x20that\x20the\x20registrar\x20votes\x20are\x20attached\x20to'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20cache'),'network':EntrypointSchema['optional']()})['describe']('Request\x20parameters\x20for\x20querying\x20entity\x20linker\x20table\x20item'),z['object']({'type':z['literal']('RewardRecord'),'parent':NameOrAddressSchema['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'address':AccountOrMark_AddressSchema['describe']('User\x20ID\x20or\x20address\x20that\x20claims\x20the\x20reward'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20cache'),'network':EntrypointSchema['optional']()})['describe']('Request\x20parameters\x20for\x20querying\x20reward\x20record\x20table\x20item'),z['object']({'type':z['literal']('DemandPresenter'),'parent':NameOrAddressSchema['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'address':AccountOrMark_AddressSchema['describe']('User\x20ID\x20or\x20address\x20of\x20the\x20Demand\x20presenter'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20cache'),'network':EntrypointSchema['optional']()})['describe']('Request\x20parameters\x20for\x20querying\x20demand\x20presenter\x20table\x20item'),z['object']({'type':z['literal']('TreasuryRecord'),'parent':NameOrAddressSchema['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'address':AccountOrMark_AddressSchema['describe']('ID\x20of\x20the\x20payment\x20that\x20the\x20treasury\x20record\x20is\x20attached\x20to'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20cache'),'network':EntrypointSchema['optional']()})['describe']('Request\x20parameters\x20for\x20querying\x20treasury\x20record\x20table\x20item'),z['object']({'type':z['literal']('MachineNode'),'parent':NameOrAddressSchema['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'key':z['string']()['describe']('String\x20key\x20of\x20the\x20node\x20name\x20to\x20query'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20cache'),'network':EntrypointSchema['optional']()})['describe']('Request\x20parameters\x20for\x20querying\x20machine\x20node\x20table\x20item'),z['object']({'type':z['literal']('ProgressHistory'),'parent':NameOrAddressSchema['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'u64':z['union']([z['number'](),z['string']()])['describe']('U64\x20value\x20of\x20the\x20record\x20to\x20query'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20cache'),'network':EntrypointSchema['optional']()})['describe']('Request\x20parameters\x20for\x20querying\x20progress\x20history\x20table\x20item'),z['object']({'type':z['literal']('AddressMark'),'parent':NameOrAddressSchema['describe']('Parent\x20object\x20ID\x20of\x20the\x20data\x20table\x20to\x20query'),'address':AccountOrMark_AddressSchema['describe']('ID\x20or\x20address\x20that\x20the\x20mark\x20name\x20and\x20tags\x20are\x20attached\x20to'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20cache'),'network':EntrypointSchema['optional']()})['describe']('Request\x20parameters\x20for\x20querying\x20address\x20mark\x20table\x20item')])['describe']('Request\x20parameters\x20for\x20querying\x20table\x20items');export const TableItemUnionOrUndefinedSchema=z['object']({'result':z['union']([TableItem_RepositoryDataSchema,TableItem_PermissionPermSchema,TableItem_EntityRegistrarSchema,TableItem_EntityLinkerSchema,TableItem_RewardRecordSchema,TableItem_DemandPresenterSchema,TableItem_TreasuryHistorySchema,TableItem_MachineNodeSchema,TableItem_ProgressHistorySchema,TableItem_AddressMarkSchema,z['null']()])['describe']('Table\x20item\x20or\x20null')})['describe']('Table\x20item\x20or\x20null');export const ConstantItemSchema=z['object']({'name':z['string']()['describe']('Name'),'value':z['union']([z['string'](),z['number']()])['describe']('Value'),'description':z['string']()['describe']('Description')})['describe']('Constant\x20item');export const PermissionInfoTypeSchema=z['object']({'index':z['number']()['describe']('Permission\x20index\x20(e.g.\x20315\x20for\x20service.compensation_fund_deposit)'),'name':z['string']()['describe']('Permission\x20name\x20(e.g.\x20\x22service.compensation_fund_deposit\x22)'),'description':z['string']()['describe']('Description\x20of\x20what\x20this\x20permission\x20allows'),'object_type':z['string']()['describe']('Object\x20type\x20this\x20permission\x20belongs\x20to\x20(e.g.\x20\x22Service\x22,\x20\x22Arbitration\x22)'),'operation':z['optional'](z['string']())['describe']('The\x20SDK/MCP\x20operation\x20field\x20name\x20that\x20triggers\x20this\x20permission\x20check\x20(e.g.\x20\x22compensation_fund_add\x22,\x20\x22publish\x22,\x20\x22pause\x22).\x20Undefined\x20for\x20permissions\x20with\x20no\x20direct\x20Call*_Data\x20field\x20(e.g.\x20\x22*.new\x22\x20permissions).\x20Use\x20this\x20to\x20answer:\x20\x22What\x20permission\x20does\x20operation\x20X\x20require?\x22\x20by\x20filtering\x20with\x20{operation:\x20\x22compensation_fund_add\x22}.')})['describe']('Permission\x20info\x20type\x20—\x20includes\x20the\x20operation\x20field\x20name\x20that\x20maps\x20to\x20this\x20permission,\x20so\x20AI\x20can\x20look\x20up\x20required\x20permissions\x20by\x20operation\x20name.');export const GuardInstructSchema=z['object']({'name':z['string']()['describe']('Name\x20of\x20the\x20guard\x20instruction'),'id':z['number']()['int']()['describe']('ID\x20of\x20the\x20guard\x20instruction\x20(OperatorType\x20or\x20ContextType)'),'description':z['string']()['describe']('Description\x20of\x20the\x20guard\x20instruction'),'returnType':z['optional'](ValueTypeSchema)['describe']('Return\x20type\x20of\x20the\x20guard\x20instruction')})['describe']('Guard\x20instruction\x20info');export const GuardItemSchema=z['object']({'name':z['string']()['describe']('Name\x20of\x20the\x20guard\x20instruction\x20or\x20query'),'id':z['union']([z['number']()['int'](),QueryIdSchema])['describe']('ID\x20of\x20the\x20guard\x20instruction\x20or\x20query'),'description':z['string']()['describe']('Description'),'returnType':z['optional'](ValueTypeSchema)['describe']('Return\x20type\x20for\x20guard\x20instruction'),'objectType':z['optional'](ObjectTypeSchema)['describe']('Object\x20type\x20for\x20guard\x20query'),'parameters':z['optional'](z['array'](ValueTypeSchema))['describe']('Parameters\x20for\x20guard\x20query'),'return':z['optional'](ValueTypeSchema)['describe']('Return\x20type\x20for\x20guard\x20query'),'parameters_description':z['optional'](z['array'](z['string']()))['describe']('Parameter\x20descriptions\x20for\x20guard\x20query')})['describe']('Guard\x20item\x20-\x20either\x20a\x20guard\x20instruction\x20or\x20a\x20guard\x20query');export const GuardInstructFilterOptionsSchema=z['object']({'name':z['optional'](z['string']())['describe']('Name\x20filter\x20(case-insensitive\x20partial\x20match)'),'id':z['optional'](z['array'](z['number']()['int']()))['describe']('ID\x20array\x20filter\x20(OperatorType\x20|\x20ContextType\x20|\x20number)'),'returnType':z['optional'](ValueTypeSchema)['describe']('Return\x20type\x20filter'),'paramCount':z['optional'](z['number']()['int']())['describe']('Parameter\x20count\x20filter'),'scope':z['optional'](z['enum'](['instruct','object\x20query','all']))['describe']('Scope\x20filter:\x20instruct,\x20object\x20query,\x20or\x20all')['default']('all'),'objectType':z['optional'](ObjectTypeSchema)['describe']('Object\x20type\x20filter\x20(only\x20for\x20object\x20query\x20scope)')})['describe']('Guard\x20instruction\x20filter\x20options');export const PermissionFilterSchema=z['object']({'objectType':z['optional'](ObjectTypeSchema)['describe']('Object\x20type\x20filter'),'name':z['optional'](z['string']())['describe']('Name\x20filter'),'index':z['optional'](PermissionIndexTypeSchema)['describe']('Index\x20filter'),'description':z['optional'](z['string']())['describe']('Description\x20filter'),'operation':z['optional'](z['string']())['describe']('Filter\x20by\x20SDK/MCP\x20operation\x20field\x20name\x20(e.g.\x20\x22compensation_fund_add\x22).\x20Returns\x20only\x20permissions\x20triggered\x20by\x20this\x20operation.\x20Use\x20this\x20to\x20answer:\x20\x22What\x20permission\x20does\x20operation\x20X\x20require?\x22')})['describe']('Permission\x20filter');export const CommonMistakeInfoSchema=z['object']({'object_type':z['string']()['describe']('The\x20object\x20type\x20this\x20mistake\x20applies\x20to\x20(e.g.\x20\x22Service\x22,\x20\x22Arbitration\x22)'),'operation':z['string']()['describe']('The\x20operation\x20field\x20name\x20this\x20mistake\x20applies\x20to\x20(e.g.\x20\x22compensation_fund_add\x22,\x20\x22voting_deadline\x22)'),'category':z['enum'](['field_name','unit','value_range','workflow','timing'])['describe']('Category\x20of\x20the\x20mistake:\x20field_name\x20(wrong\x20field\x20name),\x20unit\x20(wrong\x20unit\x20like\x20seconds\x20vs\x20ms),\x20value_range\x20(wrong\x20expected\x20value),\x20workflow\x20(wrong\x20operation\x20order),\x20timing\x20(wrong\x20time\x20constraint)'),'mistake':z['string']()['describe']('Short\x20description\x20of\x20the\x20mistake'),'correct_usage':z['string']()['describe']('The\x20correct\x20usage\x20pattern'),'wrong_example':z['string']()['describe']('Example\x20of\x20the\x20wrong\x20usage'),'correct_example':z['string']()['describe']('Example\x20of\x20the\x20correct\x20usage')})['describe']('A\x20known\x20common\x20mistake\x20for\x20an\x20on-chain\x20operation.\x20Use\x20this\x20to\x20proactively\x20warn\x20users\x20before\x20they\x20submit\x20a\x20transaction.');export const CommonMistakeFilterSchema=z['object']({'object_type':z['optional'](z['string']())['describe']('Filter\x20by\x20object\x20type\x20(e.g.\x20\x22Service\x22)'),'operation':z['optional'](z['string']())['describe']('Filter\x20by\x20operation\x20field\x20name\x20(e.g.\x20\x22compensation_fund_add\x22)'),'category':z['optional'](z['enum'](['field_name','unit','value_range','workflow','timing']))['describe']('Filter\x20by\x20category\x20(e.g.\x20\x22field_name\x22\x20for\x20field-name\x20mistakes,\x20\x22unit\x22\x20for\x20unit\x20mistakes)')})['describe']('Filter\x20for\x20common\x20mistakes.\x20Use\x20operation:\x22compensation_fund_add\x22\x20to\x20find\x20mistakes\x20for\x20a\x20specific\x20operation.');export const BridgeTokenInfoSchema=z['object']({'tokenId':z['number']()['describe']('On-chain\x20token\x20ID\x20(mainnet:\x20WBTC=1,\x20ETH/WETH=2,\x20USDC=3,\x20USDT=4)'),'symbol':z['string']()['describe']('Token\x20symbol/abbreviation\x20(ETH,\x20WETH,\x20WBTC,\x20USDC,\x20USDT)'),'wowTypeTag':z['string']()['describe']('WOW-side\x20token\x20type\x20tag\x20(format:\x20{address}::{module}::{struct},\x20e.g.\x20\x220x2::wow::WOW\x22,\x20\x220x...::usdt::USDT\x22).\x20IMPORTANT:\x20This\x20value\x20can\x20be\x20used\x20directly\x20as\x20the\x20`type_parameter`\x20for\x20Service\x20/\x20Treasury\x20/\x20Reward\x20/\x20Allocation\x20objects\x20to\x20set\x20their\x20payment\x20token.\x20e.g.\x20use\x20USDT\x27s\x20wowTypeTag\x20to\x20create\x20a\x20Service\x20that\x20accepts\x20USDT\x20payments.\x20To\x20discover\x20all\x20available\x20tokens,\x20query\x20this\x20info\x20type.'),'evmAddress':z['string']()['describe']('EVM-side\x20contract\x20address\x20(0x000...000\x20for\x20native\x20ETH;\x20ERC20\x20contract\x20address\x20otherwise)'),'evmDecimals':z['number']()['describe']('EVM-side\x20decimals\x20(ETH/WETH=18,\x20WBTC=8,\x20USDC/USDT=6)'),'wowDecimals':z['number']()['describe']('WOW-side\x20decimals\x20(ETH/WBTC=8,\x20USDC/USDT=6)'),'evmChains':z['array'](z['number']())['optional']()['describe']('Bridge\x20protocol\x20chain\x20IDs\x20where\x20this\x20token\x20is\x20available\x20(e.g.\x2010\x20=\x20ETH\x20mainnet)'),'description':z['string']()['optional']()['describe']('Token\x20description')})['describe']('Mainnet\x20Bridge\x20token\x20info');export const FundingGuidanceSchema=z['object']({'overview':z['string']()['describe']('Overview\x20of\x20how\x20to\x20obtain\x20WOW\x20gas\x20and\x20payment\x20tokens'),'testnet':z['object']({'token':z['string']()['describe']('Testnet\x20token\x20(WOW)'),'method':z['literal']('faucet')['describe']('Testnet\x20funding\x20method\x20(faucet)'),'faucet_url':z['string']()['describe']('Testnet\x20faucet\x20URL'),'note':z['string']()['describe']('Testnet\x20funding\x20note:\x20all\x20merchant/order\x20testing\x20can\x20use\x20WOW')}),'mainnet':z['object']({'method':z['literal']('eth_bridge')['describe']('Mainnet\x20funding\x20method\x20(ETH\x20mainnet\x20cross-chain\x20bridge)'),'supported_tokens':z['array'](z['string']())['describe']('Tokens\x20supported\x20by\x20the\x20mainnet\x20bridge\x20(ETH/USDT/USDC/WBTC)'),'steps':z['array'](z['string']())['describe']('Step-by-step\x20mainnet\x20funding\x20flow:\x20query\x20active\x20EVM\x20account\x20→\x20transfer\x20from\x20external\x20wallet\x20→\x20confirm\x20balance\x20→\x20cross-chain\x20to\x20WOW')}),'airdrop':z['object']({'url':z['string']()['describe']('WOW\x20mainnet\x20airdrop\x20URL'),'status':z['string']()['describe']('Airdrop\x20status\x20(under\x20construction)')}),'payment_token':z['object']({'testnet_default':z['string']()['describe']('Default\x20testnet\x20payment\x20token\x20(WOW)'),'mainnet_option':z['string']()['describe']('Mainnet\x20payment\x20token\x20option\x20(USDT\x20and\x20other\x20stablecoins)'),'migration_note':z['string']()['describe']('Guidance:\x20ask\x20whether\x20to\x20switch\x20payment\x20token\x20when\x20migrating\x20testnet\x20→\x20mainnet')})})['describe']('Funding\x20guidance\x20—\x20how\x20to\x20obtain\x20WOW\x20gas\x20and\x20payment\x20tokens\x20(testnet\x20faucet\x20/\x20mainnet\x20bridge\x20/\x20airdrop).\x20This\x20is\x20the\x20first-step\x20guidance\x20for\x20new\x20users.');export const ProtocolInfoQuerySchema=z['discriminatedUnion']('info',[z['object']({'info':z['literal']('constants')})['strict']()['describe']('Constants\x20query'),z['object']({'info':z['literal']('built-in\x20permissions'),'filter':z['optional'](PermissionFilterSchema)['describe']('Filter\x20for\x20built-in\x20permissions.\x20Use\x20operation:\x22compensation_fund_add\x22\x20to\x20find\x20which\x20permission\x20a\x20specific\x20operation\x20requires.')})['strict']()['describe']('Built-in\x20permissions\x20query.\x20Each\x20permission\x20includes\x20an\x20optional\x20\x22operation\x22\x20field\x20that\x20maps\x20to\x20the\x20SDK/MCP\x20Call*_Data\x20field\x20name\x20triggering\x20it.\x20Use\x20this\x20to\x20answer:\x20\x22What\x20permission\x20does\x20operation\x20X\x20require?\x22\x20—\x20e.g.\x20filter\x20operation:\x22compensation_fund_add\x22\x20returns\x20permission\x20index\x20315\x20(service.compensation_fund_deposit).'),z['object']({'info':z['literal']('common\x20mistakes'),'filter':z['optional'](CommonMistakeFilterSchema)['describe']('Filter\x20for\x20common\x20mistakes.\x20Use\x20operation:\x22compensation_fund_add\x22\x20to\x20find\x20mistakes\x20for\x20a\x20specific\x20operation,\x20or\x20category:\x22field_name\x22\x20for\x20all\x20field-name\x20mistakes.')})['strict']()['describe']('Common\x20mistakes\x20query.\x20Returns\x20known\x20field-name,\x20unit,\x20value-range,\x20workflow,\x20and\x20timing\x20pitfalls\x20for\x20on-chain\x20operations.\x20Use\x20this\x20to\x20proactively\x20warn\x20users\x20before\x20submitting\x20a\x20transaction.\x20Example:\x20query\x20operation:\x22compensation_fund_add\x22\x20to\x20learn\x20about\x20the\x20{amount}\x20vs\x20{balance}\x20field\x20name\x20mistake.'),z['object']({'info':z['literal']('guard\x20instructions'),'filter':z['optional'](GuardInstructFilterOptionsSchema)['describe']('Filter\x20for\x20guard\x20instructions')})['strict']()['describe']('Guard\x20instructions\x20and\x20wowok\x20object\x20queries'),z['object']({'info':z['literal']('current\x20network')})['strict']()['describe']('Current\x20network\x20entrypoint'),z['object']({'info':z['literal']('value\x20types')})['strict']()['describe']('Value\x20types\x20query\x20-\x20returns\x20all\x20supported\x20value\x20types\x20with\x20their\x20numeric\x20and\x20string\x20representations'),z['object']({'info':z['literal']('mainnet\x20bridge\x20tokens')})['strict']()['describe']('Mainnet\x20Bridge\x20tokens\x20query\x20-\x20returns\x20all\x20tokens\x20deployed\x20on\x20the\x20mainnet\x20bridge\x20with\x20their\x20symbol,\x20WOW-side\x20type\x20tag,\x20EVM\x20address,\x20decimals,\x20and\x20description'),z['object']({'info':z['literal']('funding\x20guidance')})['strict']()['describe']('Funding\x20guidance\x20query\x20-\x20how\x20to\x20obtain\x20WOW\x20gas\x20and\x20payment\x20tokens.\x20Returns\x20testnet\x20faucet\x20info,\x20mainnet\x20ETH\x20cross-chain\x20bridge\x20flow,\x20and\x20the\x20WOW\x20mainnet\x20airdrop\x20link.\x20Use\x20this\x20when\x20a\x20user\x20asks\x20how\x20to\x20obtain\x20tokens/gas/funds,\x20or\x20as\x20a\x20proactive\x20first-use\x20reminder.'),z['object']({'info':z['literal']('upgrade_check')})['strict']()['describe']('Upgrade\x20check\x20-\x20returns\x20current\x20vs\x20latest\x20npm\x20versions\x20of\x20the\x20WoWok\x20MCP\x20server\x20and\x20SDK,\x20whether\x20the\x20WoWok\x20desktop\x20client\x20is\x20installed,\x20and\x20whether\x20an\x20upgrade/install\x20reminder\x20is\x20due.\x20Call\x20at\x20the\x20start\x20of\x20a\x20conversation\x20to\x20decide\x20whether\x20to\x20remind\x20the\x20user\x20to\x20upgrade\x20or\x20install\x20the\x20client.')])['describe']('WoWok\x20Build-in\x20infomation\x20query');export const BuiltinPermissionSchema=z['object']({'result':z['array'](PermissionInfoTypeSchema)['describe']('Built-in\x20permissions\x20result')})['describe']('Built-in\x20permissions\x20query\x20result');export const UpgradeCheckComponentSchema=z['object']({'current':z['string']()['nullable']()['describe']('Currently\x20installed/running\x20version'),'latest':z['string']()['nullable']()['describe']('Latest\x20published\x20npm\x20version\x20(null\x20when\x20offline/unreachable)'),'outdated':z['boolean']()['describe']('true\x20when\x20a\x20newer\x20version\x20is\x20available')})['describe']('A\x20component\x20version\x20comparison');export const UpgradeCheckResultSchema=z['object']({'mcp':UpgradeCheckComponentSchema['describe']('WoWok\x20MCP\x20server\x20version\x20comparison'),'sdk':UpgradeCheckComponentSchema['describe']('WoWok\x20SDK\x20version\x20comparison'),'client_installed':z['boolean']()['describe']('Whether\x20the\x20WoWok\x20desktop\x20client\x20is\x20installed'),'client_install_hint':z['string']()['nullable']()['describe']('Where\x20to\x20get\x20the\x20desktop\x20client\x20(e.g.\x20download\x20URL)'),'upgrade_available':z['boolean']()['describe']('true\x20when\x20any\x20component\x20is\x20outdated'),'reminder':z['object']({'type':z['enum'](['upgrade','install_client','none'])['describe']('Reminder\x20kind'),'due':z['boolean']()['describe']('Whether\x20to\x20surface\x20the\x20reminder\x20in\x20this\x20conversation'),'message':z['string']()['nullable']()['describe']('Ready-to-use,\x20benefit-focused\x20reminder\x20message;\x20null\x20when\x20not\x20due')})['describe']('Reminder\x20decision'),'checked_at':z['string']()['describe']('ISO\x20timestamp\x20of\x20the\x20check')})['describe']('Upgrade\x20&\x20client-install\x20reminder\x20check\x20result');export const ProtocolInfoResultWrappedSchema=z['discriminatedUnion']('info',[z['object']({'info':z['literal']('constants'),'result':z['array'](ConstantItemSchema)['describe']('Constants\x20result')}),z['object']({'info':z['literal']('built-in\x20permissions'),'result':z['array'](PermissionInfoTypeSchema)['describe']('Built-in\x20permissions\x20result.\x20Each\x20item\x20includes\x20an\x20optional\x20\x22operation\x22\x20field\x20mapping\x20to\x20the\x20SDK/MCP\x20field\x20name\x20that\x20triggers\x20this\x20permission.')}),z['object']({'info':z['literal']('common\x20mistakes'),'result':z['array'](CommonMistakeInfoSchema)['describe']('Common\x20mistakes\x20result.\x20Each\x20item\x20documents\x20a\x20known\x20pitfall\x20(wrong\x20field\x20name,\x20wrong\x20unit,\x20wrong\x20workflow\x20order,\x20etc.)\x20with\x20wrong/correct\x20examples.')}),z['object']({'info':z['literal']('guard\x20instructions'),'result':z['array'](GuardItemSchema)['describe']('Guard\x20instructions\x20result')}),z['object']({'info':z['literal']('current\x20network'),'result':EntrypointSchema['describe']('Current\x20network\x20entrypoint')}),z['object']({'info':z['literal']('value\x20types'),'result':z['array'](ConstantItemSchema)['describe']('Value\x20types\x20result\x20-\x20each\x20item\x20contains\x20name\x20(string),\x20value\x20(string),\x20and\x20description\x20showing\x20the\x20numeric\x20mapping')}),z['object']({'info':z['literal']('mainnet\x20bridge\x20tokens'),'result':z['array'](BridgeTokenInfoSchema)['describe']('Mainnet\x20Bridge\x20tokens\x20result\x20-\x20each\x20item\x20contains\x20tokenId,\x20symbol,\x20wowTypeTag,\x20evmAddress,\x20evmDecimals,\x20wowDecimals,\x20evmChains,\x20and\x20description')}),z['object']({'info':z['literal']('funding\x20guidance'),'result':FundingGuidanceSchema['describe']('Funding\x20guidance\x20result\x20-\x20testnet\x20faucet\x20/\x20mainnet\x20bridge\x20/\x20airdrop\x20/\x20payment-token\x20guidance')}),z['object']({'info':z['literal']('upgrade_check'),'result':UpgradeCheckResultSchema['describe']('Upgrade\x20&\x20client-install\x20reminder\x20check\x20result')})])['describe']('Protocol\x20info\x20result');export const ProtocolInfoResultSchema=z['object']({'result':ProtocolInfoResultWrappedSchema})['describe']('Protocol\x20info\x20result');export const LocalQueryResultSchema=z['union']([z['object']({'query_type':z['literal']('local_mark_list'),'result':QueryLocalMarkListResultSchema['shape']['result']}),z['object']({'query_type':z['literal']('account_list'),'result':QueryAccountListResultSchema['shape']['result']}),z['object']({'query_type':z['literal']('local_info_list'),'result':QueryLocalInfoListResultSchema['shape']['result']}),z['object']({'query_type':z['literal']('token_list'),'result':QueryLocalTokenListResultSchema['shape']['result']}),z['object']({'query_type':z['literal']('account_balance'),'result':QueryAccountResultSchema})]);export const TxObjectChangeSchema=z['object']({'id':z['string']()['describe']('Object\x20ID\x20affected\x20by\x20the\x20transaction'),'type':z['enum'](['created','mutated','deleted','wrapped','unwrapped'])['describe']('Type\x20of\x20object\x20change'),'object_type':z['string']()['optional']()['describe']('Full\x20Move\x20type\x20of\x20the\x20object'),'sender':z['string']()['optional']()['describe']('Sender\x20who\x20caused\x20this\x20object\x20change'),'version':z['string']()['optional']()['describe']('Object\x20version\x20after\x20the\x20change'),'previous_version':z['string']()['optional']()['describe']('Previous\x20object\x20version\x20(for\x20mutations)'),'digest':z['string']()['optional']()['describe']('Transaction\x20digest\x20that\x20caused\x20this\x20change')})['strict']()['describe']('Object\x20change\x20within\x20a\x20transaction');export const TxBalanceChangeSchema=z['object']({'owner':z['string']()['describe']('Owner\x20address\x20of\x20the\x20balance\x20change'),'coin_type':z['string']()['describe']('Coin\x20type\x20(e.g.\x200x2::wow::WOW)'),'amount':z['string']()['describe']('Amount\x20changed\x20(signed\x20string,\x20positive=incoming,\x20negative=outgoing)')})['strict']()['describe']('Balance\x20change\x20within\x20a\x20transaction');export const TxEventSchema=z['object']({'type':z['string']()['describe']('Fully-qualified\x20event\x20type\x20(e.g.\x200x2::progress::ProgressEvent)'),'package_id':z['string']()['optional']()['describe']('Package\x20that\x20declared\x20the\x20event\x20module'),'module':z['string']()['optional']()['describe']('Module\x20name\x20that\x20emitted\x20the\x20event'),'sender':z['string']()['optional']()['describe']('Sender\x20of\x20the\x20emitting\x20transaction'),'parsed_json':z['unknown']()['optional']()['describe']('Parsed\x20JSON\x20payload\x20of\x20the\x20event\x20(Move\x20struct\x20fields)'),'bcs':z['string']()['optional']()['describe']('Raw\x20BCS\x20bytes\x20of\x20the\x20event\x20(base64)')})['strict']()['describe']('Event\x20emitted\x20by\x20a\x20transaction');export const TransactionDetailSchema=z['object']({'digest':z['string']()['describe']('Transaction\x20digest\x20(0x...)'),'status':z['enum'](['success','failed'])['describe']('Transaction\x20execution\x20status'),'error':z['string']()['optional']()['describe']('Error\x20message\x20if\x20the\x20transaction\x20failed'),'timestamp_ms':z['string']()['optional']()['describe']('Unix\x20timestamp\x20in\x20milliseconds\x20(string)'),'sender':z['string']()['optional']()['describe']('Transaction\x20sender\x20address'),'gas_used':z['string']()['optional']()['describe']('Total\x20gas\x20used\x20(string,\x20BigInt)'),'gas_budget':z['string']()['optional']()['describe']('Gas\x20budget\x20set\x20by\x20the\x20sender\x20(string)'),'kind':z['string']()['optional']()['describe']('Transaction\x20kind\x20(e.g.\x20ProgrammableTransaction)'),'object_changes':z['array'](TxObjectChangeSchema)['describe']('Object\x20changes\x20(created/mutated/deleted)'),'balance_changes':z['array'](TxBalanceChangeSchema)['describe']('Balance\x20changes\x20for\x20all\x20involved\x20owners'),'event_count':z['number']()['describe']('Number\x20of\x20events\x20emitted\x20by\x20this\x20transaction'),'events':z['array'](TxEventSchema)['describe']('Events\x20emitted\x20by\x20the\x20transaction.\x20Always\x20populated\x20by\x20query_transaction\x20(showEvents=true).\x20'+'Each\x20event\x20carries\x20its\x20Move\x20struct\x20payload\x20(parsed_json)\x20so\x20callers\x20can\x20inspect\x20'+'ProgressEvent,\x20NewOrderEvent,\x20ArbEvent,\x20etc.\x20without\x20an\x20extra\x20query.'),'epoch':z['string']()['optional']()['describe']('Epoch\x20number\x20when\x20the\x20transaction\x20was\x20executed'),'is_system_tx':z['boolean']()['optional']()['describe']('Whether\x20this\x20was\x20a\x20system\x20transaction'),'cache_expire':z['union']([z['number'](),z['literal']('INFINITE')])['optional']()['describe']('Cache\x20expiration\x20timestamp')})['strict']()['describe']('Full\x20transaction\x20detail\x20—\x20verifiable\x20proof\x20of\x20an\x20on-chain\x20operation');export const TransactionHistoryItemSchema=z['object']({'digest':z['string']()['describe']('Transaction\x20digest'),'status':z['enum'](['success','failed'])['describe']('Transaction\x20execution\x20status'),'timestamp_ms':z['string']()['optional']()['describe']('Unix\x20timestamp\x20in\x20milliseconds'),'sender':z['string']()['optional']()['describe']('Transaction\x20sender\x20address'),'kind':z['string']()['optional']()['describe']('Transaction\x20kind'),'gas_used':z['string']()['optional']()['describe']('Gas\x20used\x20(string)'),'objects_touched':z['array'](z['string']())['describe']('Object\x20IDs\x20touched\x20by\x20this\x20transaction'),'has_object_changes':z['boolean']()['describe']('Whether\x20this\x20tx\x20created/mutated/deleted\x20objects')})['strict']()['describe']('Transaction\x20history\x20summary\x20item');export const TransactionHistoryAnswerSchema=z['object']({'transactions':z['array'](TransactionHistoryItemSchema)['describe']('Transaction\x20history\x20items'),'next_cursor':z['union']([z['string'](),z['null']()])['describe']('Cursor\x20for\x20the\x20next\x20page\x20(null\x20if\x20no\x20more\x20pages)'),'has_next_page':z['boolean']()['describe']('Whether\x20more\x20pages\x20are\x20available'),'cache_expire':z['union']([z['number'](),z['literal']('INFINITE')])['optional']()['describe']('Cache\x20expiration\x20timestamp')})['strict']()['describe']('Paginated\x20transaction\x20history\x20answer');export const OnchainQueryResultSchema_Part1=z['union']([z['object']({'query_type':z['literal']('onchain_personal_profile'),'result':z['union']([ObjectPersonalSchema,z['undefined']()])}),z['object']({'query_type':z['literal']('onchain_objects'),'result':ObjectsAnswerSchema}),z['object']({'query_type':z['literal']('onchain_table'),'result':z['union']([TableAnswerSchema,z['undefined']()])}),z['object']({'query_type':z['literal']('onchain_table_item_repository_data'),'result':z['union']([TableItem_RepositoryDataSchema,z['undefined']()])}),z['object']({'query_type':z['literal']('onchain_table_item_permission_perm'),'result':z['union']([TableItem_PermissionPermSchema,z['undefined']()])}),z['object']({'query_type':z['literal']('onchain_table_item_entity_registrar'),'result':z['union']([TableItem_EntityRegistrarSchema,z['undefined']()])}),z['object']({'query_type':z['literal']('onchain_table_item_entity_linker'),'result':z['union']([TableItem_EntityLinkerSchema,z['undefined']()])})]);export const OnchainQueryResultSchema_Part2=z['union']([z['object']({'query_type':z['literal']('onchain_table_item_reward_record'),'result':z['union']([TableItem_RewardRecordSchema,z['undefined']()])}),z['object']({'query_type':z['literal']('onchain_table_item_demand_presenter'),'result':z['union']([TableItem_DemandPresenterSchema,z['undefined']()])}),z['object']({'query_type':z['literal']('onchain_table_item_treasury_history'),'result':z['union']([TableItem_TreasuryHistorySchema,z['undefined']()])}),z['object']({'query_type':z['literal']('onchain_table_item_machine_node'),'result':z['union']([TableItem_MachineNodeSchema,z['undefined']()])}),z['object']({'query_type':z['literal']('onchain_table_item_progress_history'),'result':z['union']([TableItem_ProgressHistorySchema,z['undefined']()])}),z['object']({'query_type':z['literal']('onchain_table_item_address_mark'),'result':z['union']([TableItem_AddressMarkSchema,z['undefined']()])}),z['object']({'query_type':z['literal']('onchain_received'),'result':QueryReceivedResultSchema['shape']['result']})]);export const OnchainQueryResultSchema_Part3=z['union']([z['object']({'query_type':z['literal']('onchain_transaction'),'result':z['union']([TransactionDetailSchema,z['undefined']()])})['strict'](),z['object']({'query_type':z['literal']('onchain_object_history'),'result':z['union']([TransactionHistoryAnswerSchema,z['undefined']()])})['strict'](),z['object']({'query_type':z['literal']('onchain_address_activity'),'result':z['union']([TransactionHistoryAnswerSchema,z['undefined']()])})['strict'](),z['object']({'query_type':z['literal']('token_value_convert'),'result':z['object']({'token_type':z['string']()['describe']('Full\x20token\x20type\x20used\x20for\x20conversion'),'symbol':z['string']()['optional']()['describe']('Resolved\x20token\x20symbol'),'decimals':z['number']()['optional']()['describe']('Resolved\x20decimals\x20N\x20—\x20the\x20precision\x20reminder'),'precision_known':z['boolean']()['describe']('false\x20→\x20precision\x20unavailable;\x20conversion\x20may\x20have\x20been\x20impossible'),'direction':z['union']([z['literal']('raw_to_unit'),z['literal']('unit_to_raw')]),'input':z['string']()['describe']('Input\x20value\x20as\x20provided'),'output':z['string']()['describe']('Converted\x20value\x20(empty\x20string\x20when\x20conversion\x20was\x20impossible)'),'error':z['string']()['optional']()['describe']('Hard\x20failure\x20reason\x20(e.g.\x20unit→raw\x20without\x20known\x20precision)'),'text':z['string']()['describe']('One-line\x20human\x20text\x20with\x20the\x20decimals\x20reminder')})['strict']()['describe']('Bidirectional\x20token\x20value\x20conversion\x20result\x20—\x20see\x20Fund\x20Processing\x20Layer')})['strict']()]);export const AllQueryResultsSchema=z['union']([LocalQueryResultSchema,OnchainQueryResultSchema_Part1,OnchainQueryResultSchema_Part2,OnchainQueryResultSchema_Part3]);export const WatchQueryOperationsResultSchema=z['object']({'result':AllQueryResultsSchema,'semantic':SemanticSummarySchema['optional']()['describe']('Business\x20semantic\x20summary\x20for\x20the\x20query\x20operation')})['describe']('Watch\x20query\x20operations\x20result\x20schema');
|