wowok_agent 2.1.39 → 2.2.0
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/index.js +1237 -1
- package/dist/schema/call/allocation.js +24 -1
- package/dist/schema/call/arbitration.js +92 -1
- package/dist/schema/call/base.js +134 -1
- package/dist/schema/call/contact.js +37 -1
- package/dist/schema/call/demand.js +47 -1
- package/dist/schema/call/guard.js +58 -1
- package/dist/schema/call/handler.js +171 -1
- package/dist/schema/call/index.js +18 -1
- package/dist/schema/call/machine.js +152 -1
- package/dist/schema/call/order.js +34 -1
- package/dist/schema/call/payment.js +17 -1
- package/dist/schema/call/permission.js +105 -1
- package/dist/schema/call/personal.js +68 -1
- package/dist/schema/call/progress.js +26 -1
- package/dist/schema/call/proof.js +27 -1
- package/dist/schema/call/repository.js +76 -1
- package/dist/schema/call/reward.js +42 -1
- package/dist/schema/call/service.js +82 -1
- package/dist/schema/call/treasury.js +71 -1
- package/dist/schema/common/index.js +345 -1
- package/dist/schema/index.js +7 -1
- package/dist/schema/local/index.js +855 -1
- package/dist/schema/local/wip.js +187 -1
- package/dist/schema/messenger/index.d.ts +4 -4
- package/dist/schema/messenger/index.js +446 -1
- package/dist/schema/query/index.js +1265 -1
- package/dist/schema/utils/guard-parser.js +401 -1
- package/dist/schema/utils/guard-query-utils.js +22 -1
- package/dist/schema/utils/node-parser.js +353 -1
- package/dist/schema/utils/permission-index-utils.js +7 -1
- package/package.json +3 -5
|
@@ -1 +1,1265 @@
|
|
|
1
|
-
import{z}from'zod';import{TokenTypeInfoSchema,QueryLocalMarkListResultSchema,QueryAccountListResultSchema,QueryLocalInfoListResultSchema,QueryLocalTokenListResultSchema,QueryAccountResultSchema}from'../local/index.js';import{AccountOrMark_AddressSchema,BalanceTypeSchema,EntrypointSchema,GuardIdentifierSchema,GuardTableItemSchema,NameOrAddressSchema,ObjectBaseSchema,ObjectTypeSchema,QueryIdSchema,SupportedValueSchema,ValueTypeSchema,LongNameSchema,DescriptionSchema}from'../common/index.js';import{isValidPermissionIndex}from'../utils/permission-index-utils.js';import{isValidGuardQueryId,isValidGuardQueryIdOrName}from'../utils/guard-query-utils.js';import{isWitnessType}from'wowok';import{DiscountType as a25a}from'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.';export const AmountTypeSchema=z['enum'](['GuardU64Identifier','Fixed'])['describe']('Amount\x20type.\x20GuardU64Identifier\x20indicates\x20the\x20amount\x20comes\x20from\x20U64\x20type\x20data\x20defined\x20in\x20Guard\x20table\x20(Identifier\x20index),\x20Fixed\x20indicates\x20using\x20a\x20fixed\x20amount.');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']('Determined\x20ID'),z['object']({'Signer':z['literal']('signer')})['describe']('Current\x20transaction\x20signer\x20ID')])['describe']('Recipient\x20ID');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':z['number']()['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':z['number']()['describe']('Current\x20follow\x20information\x20position'),'count':z['number']()['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':z['number']()['describe']('On-chain\x20registration\x20time'),'referrer':z['union']([z['string'](),z['null']()])['describe']('Referrer'),'mark_object':z['union']([z['string'](),z['null']()])['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']('HTTP\x20URL\x20of\x20wip\x20file'),'wip_hash':z['string']()['describe']('Hash\x20of\x20WIP.\x20If\x20EMPTY\x20string,\x20the\x20hash\x20within\x20wip\x20will\x20be\x20automatically\x20used;\x20else,\x20the\x20consistency\x20of\x20the\x20hash\x20within\x20wip\x20will\x20be\x20verified\x20with\x20the\x20provided\x20hash.')})['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']('Dispute\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['string']()['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':z['number']()['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':z['number']()['describe']('Total\x20operation\x20weight'),'threshold':z['number']()['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['enum'](['Amount','Rate','Surplus'])['describe']('Reward\x20allocation\x20mode.\x20Amount\x20indicates\x20allocation\x20by\x20amount,\x20Rate\x20indicates\x20allocation\x20by\x20proportion,\x20Surplus\x20indicates\x20allocation\x20by\x20remaining\x20amount.\x20In\x20a\x20fund\x20allocator,\x20Amount\x20will\x20be\x20allocated\x20first,\x20then\x20remaining\x20funds\x20will\x20be\x20allocated\x20by\x20Rate\x20(if\x20no\x20Surplus\x20is\x20defined,\x20sum\x20of\x20all\x20Rates\x20must\x20be\x2010000),\x20and\x20finally\x20Surplus\x20gets\x20remaining\x20amount\x20(maximum\x20one\x20per\x20fund\x20allocator).');export const AllocationSharingSchema=z['object']({'who':RecipientSchema['describe']('Recipient\x20ID'),'sharing':BalanceTypeSchema['describe']('Reward\x20allocation\x20value'),'mode':AllocationModeSchema['describe']('Reward\x20allocation\x20mode')})['describe']('Fund\x20allocation\x20item');export const AllocatorSchema=z['object']({'guard':NameOrAddressSchema['describe']('Guard\x20object\x20ID.\x20If\x20Guard\x20verification\x20passes,\x20fund\x20allocation\x20will\x20start\x20automatically.'),'sharing':z['array'](AllocationSharingSchema)['describe']('Fund\x20allocation\x20item\x20list.\x20Each\x20item\x20represents\x20a\x20recipient\x20and\x20their\x20corresponding\x20reward\x20allocation\x20value.'),'fix':BalanceTypeSchema['optional']()['describe']('Fixed\x20allocation\x20amount.\x20If\x20specified,\x20all\x20recipients\x20will\x20receive\x20the\x20fixed\x20allocation\x20amount.'),'max':z['union']([BalanceTypeSchema,z['null']()])['optional']()['describe']('Maximum\x20allocation\x20amount.\x20If\x20specified,\x20allocation\x20amount\x20cannot\x20exceed\x20maximum\x20allocation\x20amount.')})['describe']('Fund\x20allocator');export const AllocatorsSchema=z['object']({'description':DescriptionSchema['describe']('Description\x20of\x20fund\x20allocator\x20list'),'threshold':BalanceTypeSchema['describe']('Threshold.\x20If\x20defined,\x20fund\x20allocation\x20will\x20be\x20triggered\x20when\x20amount\x20in\x20Allocation\x20object\x20reaches\x20this\x20threshold.'),'allocators':z['array'](AllocatorSchema)['describe']('Fund\x20allocator\x20list.\x20Each\x20fund\x20allocator\x20represents\x20a\x20fund\x20allocation\x20strategy.')})['describe']('Fund\x20allocator\x20list');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\x20pool\x20for\x20arbitration\x20results.\x20Order\x20users\x20can\x20receive\x20compensation\x20from\x20this\x20fund\x20based\x20on\x20arbitration\x20results.'),'paused_time':z['union']([z['number'](),z['null']()])['describe']('Service\x20purchase\x20pause\x20time.\x20If\x20not\x20paused,\x20it\x20is\x20null.'),'compensation_lock_duration':z['union']([z['string'](),z['number']()])['describe']('Lock\x20duration\x20for\x20arbitration\x20result\x20compensation.\x20After\x20service\x20is\x20paused\x20for\x20longer\x20than\x20this\x20duration,\x20service\x20manager\x20can\x20retrieve\x20compensation_fund.\x20Default\x20is\x20at\x20least\x2030\x20days.'),'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['literal'](a25a['RATES'])['describe']('Rate\x20discount\x20type'),z['literal'](a25a['FIXED'])['describe']('Fixed\x20discount\x20type')])['describe']('Discount\x20type');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':z['number']()['describe']('Reward\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']('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['number']()['int']()['refine'](isWitnessType,{'message':'Invalid\x20WitnessType\x20value'});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']()['describe']('Optional.\x20When\x20specified,\x20the\x20query\x20retrieves\x20data\x20from\x20the\x20associated\x20object\x20instead\x20of\x20the\x20object\x20itself.\x20For\x20example,\x20querying\x20an\x20order\x20with\x20convert_witness=TypeOrderProgress\x20retrieves\x20the\x20associated\x20Progress\x20object\x20data.')})['strict']()['describe']('The\x20object\x20to\x20query\x20from\x20the\x20Guard\x20table.'),'parameters':z['array'](GuardNodeSchema)['describe']('Parameters\x20required\x20by\x20the\x20query\x20(must\x20match\x20the\x20query\x27s\x20expected\x20parameters\x20type).')})['strict']()['describe']('Returns\x20the\x20result\x20of\x20executing\x20a\x20data\x20query\x20instruction\x20on\x20the\x20specified\x20object.\x20The\x20return\x20type\x20depends\x20on\x20the\x20query\x20being\x20executed.'),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)})['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)})['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).')]))['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['string']()['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)['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':z['union']([z['string'](),z['null']()])['describe']('Recommended\x20service\x20object\x20ID'),'update_time':z['number']()['describe']('Last\x20update\x20time'),'acceptance_score':z['union']([z['number'](),z['null']()])['describe']('Demand\x20object\x20feedback\x20score'),'feedback':z['string']()['describe']('Demand\x20object\x20feedback\x20information'),'feedback_time':z['number']()['describe']('Demand\x20object\x20feedback\x20time')})['describe']('Demand\x20object\x27s\x20Service\x20recommendation\x20record');export const MachineForwardGuardSchema=z['object']({'guard':z['string']()['describe']('Guard\x20object\x20ID'),'retained_submission':z['array'](z['number']())['optional']()['describe']('Data\x20submitted\x20by\x20user\x20during\x20Guard\x20object\x20verification')})['describe']('Record\x20of\x20Guard\x20object\x20in\x20MachineForwardGuard\x20object');export const MachineForwardSchema=z['object']({'name':z['string']()['describe']('Forward\x20name'),'namedOperator':z['string']()['optional']()['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':PermissionIndexTypeSchema['optional']()['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':z['number']()['int']()['min'](0x0)['max'](0xffff)['describe']('Forward\x20weight'),'guard':MachineForwardGuardSchema['optional']()['describe']('Guard\x20object\x20ID,\x20if\x20defined,\x20Guard\x20verification\x20must\x20also\x20pass\x20to\x20complete\x20Forward\x20(e.g.,\x20completed\x20promised\x20supply\x20chain\x20sub-order).')})['describe']('Forward\x20in\x20Machine\x20object');export const MachineNodePairSchema=z['object']({'prev_node':z['string']()['describe']('Previous\x20node\x20name'),'threshold':z['number']()['int']()['min'](0x0)['max'](0xffffffff)['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')})['describe']('Node\x20pair\x20in\x20Machine\x20object');export const MachineNodeSchema=z['object']({'name':z['string']()['describe']('Node\x20name'),'pairs':z['array'](MachineNodePairSchema)['describe']('Node\x20pair\x20list')})['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':z['number']()['int']()['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':z['number']()['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':z['union']([z['string'](),z['null']()])['describe']('Guard\x20object\x20ID\x20verified\x20during\x20operation\x20(none\x20if\x20operated\x20through\x20Permission)'),'amount':BalanceTypeSchema['describe']('Payment\x20amount'),'time':z['number']()['describe']('Payment\x20time\x20(Unix\x20timestamp)'),'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']('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':z['union']([z['string'](),z['number']()])['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')])['describe']('Event\x20type');export const EventCursorSchema=z['object']({'eventSeq':z['string']()['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':z['union']([z['string'](),z['literal']('ArbEvent'),z['literal']('NewOrderEvent'),z['literal']('ProgressEvent'),z['literal']('DemandPresentEvent'),z['literal']('DemandFeedbackEvent'),z['literal']('NewEntityEvent')])['describe']('Event\x20type'),'type_raw':z['string']()['describe']('Raw\x20event\x20type'),'time':z['string']()['describe']('Event\x20occurrence\x20time')})['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':z['union']([z['number'](),z['literal']('INFINITE')])['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')})['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')})['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'),'name':z['string']()['describe']('Name'),'description':z['string']()['describe']('Description'),'object_type':z['string']()['describe']('Object\x20type')})['describe']('Permission\x20info\x20type');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')})['describe']('Permission\x20filter');export const ProtocolInfoQuerySchema=z['discriminatedUnion']('info',[z['object']({'info':z['literal']('constants')})['describe']('Constants\x20query'),z['object']({'info':z['literal']('built-in\x20permissions'),'filter':z['optional'](PermissionFilterSchema)['describe']('Filter\x20for\x20built-in\x20permissions')})['describe']('Built-in\x20permissions\x20query'),z['object']({'info':z['literal']('guard\x20instructions'),'filter':z['optional'](GuardInstructFilterOptionsSchema)['describe']('Filter\x20for\x20guard\x20instructions')})['describe']('Guard\x20instructions\x20and\x20wowok\x20object\x20queries'),z['object']({'info':z['literal']('current\x20network')})['describe']('Current\x20network\x20entrypoint'),z['object']({'info':z['literal']('value\x20types')})['describe']('Value\x20types\x20query\x20-\x20returns\x20all\x20supported\x20value\x20types\x20with\x20their\x20numeric\x20and\x20string\x20representations')])['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 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')}),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')})])['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 WatchQueryOperationsResultSchema=z['object']({'result':z['any']()})['describe']('Watch\x20query\x20operations\x20result\x20schema\x20(using\x20any\x20to\x20avoid\x20TypeScript\x20inference\x20limits)');
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TokenTypeInfoSchema, QueryLocalMarkListResultSchema, QueryAccountListResultSchema, QueryLocalInfoListResultSchema, QueryLocalTokenListResultSchema, QueryAccountResultSchema } from "../local/index.js";
|
|
3
|
+
import { AccountOrMark_AddressSchema, BalanceTypeSchema, EntrypointSchema, GuardIdentifierSchema, GuardTableItemSchema, NameOrAddressSchema, ObjectBaseSchema, ObjectTypeSchema, QueryIdSchema, SupportedValueSchema, ValueTypeSchema, LongNameSchema, DescriptionSchema } from "../common/index.js";
|
|
4
|
+
import { isValidPermissionIndex } from '../utils/permission-index-utils.js';
|
|
5
|
+
import { isValidGuardQueryId, isValidGuardQueryIdOrName } from '../utils/guard-query-utils.js';
|
|
6
|
+
import { isWitnessType, } from "wowok";
|
|
7
|
+
import { DiscountType as WDiscountType } from "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
|
+
export const AmountTypeSchema = z.enum(["GuardU64Identifier", "Fixed"]).describe("Amount type. GuardU64Identifier indicates the amount comes from U64 type data defined in Guard table (Identifier index), Fixed indicates using a fixed amount.");
|
|
12
|
+
export const GuardQuerySchema = z.object({
|
|
13
|
+
id: QueryIdSchema,
|
|
14
|
+
name: z.string().describe("Name of the query instruction."),
|
|
15
|
+
objectType: ObjectTypeSchema.describe("Type of the Object that the query instruction operates on."),
|
|
16
|
+
parameters: z.array(ValueTypeSchema).describe("List of parameter types for the query instruction."),
|
|
17
|
+
return: ValueTypeSchema.describe("Return value type of the query instruction."),
|
|
18
|
+
description: z.string().describe("Detailed description of the query instruction."),
|
|
19
|
+
parameters_description: z.array(z.string()).describe("Detailed descriptions of the query instruction parameters."),
|
|
20
|
+
});
|
|
21
|
+
export const GuardSubmissionSchema = z.object({
|
|
22
|
+
identifier: GuardIdentifierSchema.describe("Identifier"),
|
|
23
|
+
value_type: ValueTypeSchema.describe("Value type"),
|
|
24
|
+
value: SupportedValueSchema.describe("Value"),
|
|
25
|
+
}).describe("Guard submission");
|
|
26
|
+
export const RecipientSchema = z.union([
|
|
27
|
+
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."),
|
|
28
|
+
z.object({ Entity: AccountOrMark_AddressSchema }).describe("Determined ID"),
|
|
29
|
+
z.object({ Signer: z.literal("signer") }).describe("Current transaction signer ID"),
|
|
30
|
+
]).describe("Recipient ID");
|
|
31
|
+
export const RecordsInEntitySchema = z.object({
|
|
32
|
+
name: z.string().describe("Record name"),
|
|
33
|
+
value_type: ValueTypeSchema.describe("Value type"),
|
|
34
|
+
value: SupportedValueSchema.describe("Value"),
|
|
35
|
+
}).describe("Information record");
|
|
36
|
+
export const PermissionIndexTypeSchema = z.number().int().refine((value) => {
|
|
37
|
+
return isValidPermissionIndex(value);
|
|
38
|
+
}, {
|
|
39
|
+
message: "Permission index must be a valid BuiltinPermissionIndex value or user defined between 1000 and 65535"
|
|
40
|
+
}).describe("Permission index type");
|
|
41
|
+
export const VoteInEntityLinkerSchema = z.object({
|
|
42
|
+
address: z.string().describe("Account or object ID"),
|
|
43
|
+
like: z.boolean().optional().describe("Whether liked"),
|
|
44
|
+
dislike: z.boolean().optional().describe("Whether disliked"),
|
|
45
|
+
affiliation: z.boolean().optional().describe("Whether affiliated"),
|
|
46
|
+
time: z.number().describe("Time"),
|
|
47
|
+
}).describe("Follow record");
|
|
48
|
+
export const ObjectEntityRegistrarSchema = ObjectBaseSchema.extend({
|
|
49
|
+
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."),
|
|
50
|
+
}).describe("On-chain entity registrar");
|
|
51
|
+
export const ObjectEntityLinkerSchema = ObjectBaseSchema.extend({
|
|
52
|
+
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."),
|
|
53
|
+
}).describe("On-chain entity linker");
|
|
54
|
+
export const ObjectResourceSchema = ObjectBaseSchema.extend({
|
|
55
|
+
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."),
|
|
56
|
+
}).describe("On-chain address tag manager");
|
|
57
|
+
export const TableItem_EntityLinkerSchema = ObjectBaseSchema.extend({
|
|
58
|
+
address: z.string().describe("Followed ID"),
|
|
59
|
+
pos: z.number().describe("Current follow information position"),
|
|
60
|
+
count: z.number().describe("Follower count. Number of entities who have been followed others. Use 'query_table' or 'query_table_item' to get 'EntityLinker' table items."),
|
|
61
|
+
votes: z.array(VoteInEntityLinkerSchema).describe("Follow records"),
|
|
62
|
+
}).describe("On-chain followed object data");
|
|
63
|
+
export const TableItem_EntityRegistrarSchema = ObjectBaseSchema.extend({
|
|
64
|
+
address: z.string().describe("Entity ID"),
|
|
65
|
+
description: z.string().describe("Entity description"),
|
|
66
|
+
time: z.number().describe("On-chain registration time"),
|
|
67
|
+
referrer: z.union([z.string(), z.null()]).describe("Referrer"),
|
|
68
|
+
mark_object: z.union([z.string(), z.null()]).describe("Your on-chain address mark object by entity ID"),
|
|
69
|
+
records: z.array(RecordsInEntitySchema).describe("Information records"),
|
|
70
|
+
}).describe("On-chain entity data");
|
|
71
|
+
export const TableItem_AddressMarkSchema = ObjectBaseSchema.extend({
|
|
72
|
+
entity: z.string().describe("Entity ID"),
|
|
73
|
+
name: z.string().describe("Tag name"),
|
|
74
|
+
tags: z.array(z.string()).describe("Tag list"),
|
|
75
|
+
}).describe("On-chain ID mark data");
|
|
76
|
+
export const ServiceGuardSchema = z.object({
|
|
77
|
+
guard: z.string().describe("Service guard"),
|
|
78
|
+
service_identifier: z.union([GuardIdentifierSchema, z.null()]).optional().describe("Service identifier. Used to determine the service verified in Guard"),
|
|
79
|
+
}).describe("Service guard");
|
|
80
|
+
export const ObjectDemandSchema = ObjectBaseSchema.extend({
|
|
81
|
+
description: z.string().describe("Demand description"),
|
|
82
|
+
location: z.string().describe("Demand location"),
|
|
83
|
+
rewards: z.array(z.string()).describe("Reward list. Used to incentivize qualified Presenters to claim rewards"),
|
|
84
|
+
guards: z.array(ServiceGuardSchema).describe("Service Guard list"),
|
|
85
|
+
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."),
|
|
86
|
+
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
87
|
+
permission: z.string().describe("Permission"),
|
|
88
|
+
}).describe("Demand object");
|
|
89
|
+
export const ObjectMachineSchema = ObjectBaseSchema.extend({
|
|
90
|
+
description: z.string().describe("Machine description"),
|
|
91
|
+
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."),
|
|
92
|
+
consensus_repositories: z.array(z.string()).describe("Consensus repository list. Used to determine consensus data storage during Machine operation."),
|
|
93
|
+
bPaused: z.boolean().describe("Whether paused"),
|
|
94
|
+
bPublished: z.boolean().describe("Whether published"),
|
|
95
|
+
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
96
|
+
permission: z.string().describe("Permission object ID. Used to modify operation permission settings for Machine settings."),
|
|
97
|
+
}).describe("Machine object");
|
|
98
|
+
export const ServiceSaleSchema = z.object({
|
|
99
|
+
name: LongNameSchema.describe("Name of the product or service for sale"),
|
|
100
|
+
price: BalanceTypeSchema.describe("Price of the product or service"),
|
|
101
|
+
stock: BalanceTypeSchema.describe("Stock of the product or service"),
|
|
102
|
+
suspension: z.boolean().describe("Whether sale is suspended"),
|
|
103
|
+
wip: z.string().describe("HTTP URL of wip file"),
|
|
104
|
+
wip_hash: z.string().describe(`Hash of WIP. If EMPTY string, the hash within wip will be automatically used; else, the consistency of the hash within wip will be verified with the provided hash.`),
|
|
105
|
+
}).describe("Service sale");
|
|
106
|
+
export const PurchasedItemSchema = z.object({
|
|
107
|
+
name: LongNameSchema.describe("Name of the product or service"),
|
|
108
|
+
price: BalanceTypeSchema.describe("Service price"),
|
|
109
|
+
quantity: BalanceTypeSchema.describe("Service quantity"),
|
|
110
|
+
wip_hash: z.string().describe("WIP file hash of the item"),
|
|
111
|
+
});
|
|
112
|
+
export const ObjectOrderSchema = ObjectBaseSchema.extend({
|
|
113
|
+
items: z.array(PurchasedItemSchema).describe("Purchased service list"),
|
|
114
|
+
discount: z.union([z.string(), z.null()]).describe("Used discount object ID"),
|
|
115
|
+
progress: z.union([z.string(), z.null()]).describe("Order progress object ID"),
|
|
116
|
+
machine: z.union([z.string(), z.null()]).describe("Machine ID that progress belongs to"),
|
|
117
|
+
amount: BalanceTypeSchema.describe("Order amount"),
|
|
118
|
+
builder: z.string().describe("Purchaser ID"),
|
|
119
|
+
service: z.string().describe("Service ID"),
|
|
120
|
+
dispute: z.array(z.string()).describe("Dispute object ID list. When unsatisfied with order delivery, dispute objects can be created."),
|
|
121
|
+
agent: z.array(z.string()).describe("Agent ID list. Agents handle all order operations except payment collection."),
|
|
122
|
+
allocation: z.union([z.string(), z.null()]).describe("Order amount allocation object ID"),
|
|
123
|
+
claimed_by: z.union([z.string(), z.null()]).describe("Order dispute object ID that has claimed order arbitration amount."),
|
|
124
|
+
required_info: z.string().describe("Contact object ID (recipient) or WTS Proof object (delivery proof) that information has been delivered via Wowok Messenger."),
|
|
125
|
+
time: z.union([z.string(), z.number()]).describe("Order creation time"),
|
|
126
|
+
});
|
|
127
|
+
export const NamedOperatorSchema = z.object({
|
|
128
|
+
name: z.string().describe("Namespace name"),
|
|
129
|
+
operators: z.array(z.string()).describe("Operator ID list"),
|
|
130
|
+
}).describe("Namespace operator. Namespace is a permission identifier defined in Machine, allowing different Progress to bind different operators to exercise unified permission definitions.");
|
|
131
|
+
export const ProgressSessionHolderSchema = z.object({
|
|
132
|
+
forward: z.string().describe("An operation name"),
|
|
133
|
+
who: z.union([z.string(), z.null()]).describe("Operator ID"),
|
|
134
|
+
retained_submission: z.array(GuardSubmissionSchema).describe("Used to define submitted data after Guard verification"),
|
|
135
|
+
msg: z.string().describe("Information submitted to complete operation"),
|
|
136
|
+
accomplished: z.boolean().describe("Whether completed"),
|
|
137
|
+
time: z.number().describe("Session creation time"),
|
|
138
|
+
}).describe("An operation in Progress session");
|
|
139
|
+
export const ProgressSessionSchema = z.object({
|
|
140
|
+
next_node: z.string().describe("Next node ID"),
|
|
141
|
+
forwards: z.array(ProgressSessionHolderSchema).describe("Operation list in Progress session"),
|
|
142
|
+
weights: z.number().describe("Total operation weight"),
|
|
143
|
+
threshold: z.number().describe("Operation threshold. When total operation weight exceeds threshold, session is considered completed and Progress moves from current node to next node."),
|
|
144
|
+
}).describe("Progress session");
|
|
145
|
+
export const ObjectProgressSchema = ObjectBaseSchema.extend({
|
|
146
|
+
machine: z.string().describe("Machine ID that Progress object belongs to"),
|
|
147
|
+
context_repositories: z.array(z.string()).describe("Context repository list. Used to store context data during Progress operation."),
|
|
148
|
+
current: z.string().describe("Current node name"),
|
|
149
|
+
task: z.union([z.string(), z.null()]).describe("Target task ID executed by Progress (e.g., Order ID)"),
|
|
150
|
+
namedOperator: z.array(NamedOperatorSchema).describe("Namespace operator list. Each process can independently maintain operators for permissions represented by its namespace."),
|
|
151
|
+
session: z.array(ProgressSessionSchema).describe("Progress session list"),
|
|
152
|
+
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."),
|
|
153
|
+
current_time: z.number().describe("Current node entry timestamp"),
|
|
154
|
+
}).describe("Progress object");
|
|
155
|
+
export const AmountSchema = z.discriminatedUnion("type", [
|
|
156
|
+
z.object({
|
|
157
|
+
type: z.literal("GuardU64Identifier"),
|
|
158
|
+
value: GuardIdentifierSchema,
|
|
159
|
+
}).describe("Guard verified amount. Get amount value from specified data index in Guard table. The value type must be u64."),
|
|
160
|
+
z.object({
|
|
161
|
+
type: z.literal("Fixed"),
|
|
162
|
+
value: BalanceTypeSchema,
|
|
163
|
+
}).describe("Fixed amount"),
|
|
164
|
+
]).describe("Amount");
|
|
165
|
+
export const RewardGuardSchema = z.object({
|
|
166
|
+
guard: NameOrAddressSchema.describe("Guard object ID or name."),
|
|
167
|
+
recipient: RecipientSchema,
|
|
168
|
+
amount: AmountSchema.describe("Reward amount"),
|
|
169
|
+
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."),
|
|
170
|
+
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."),
|
|
171
|
+
}).describe("Reward Guard type");
|
|
172
|
+
export const ObjectRewardSchema = ObjectBaseSchema.extend({
|
|
173
|
+
description: z.string().describe("Reward object description"),
|
|
174
|
+
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."),
|
|
175
|
+
balance: BalanceTypeSchema.describe("Current balance of reward object"),
|
|
176
|
+
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."),
|
|
177
|
+
record_count: z.number().describe("Number of reward claimer records. Use 'query_table' or 'query_table_item' to get 'RewardRecord' table items."),
|
|
178
|
+
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
179
|
+
permission: z.string().describe("Permission object ID"),
|
|
180
|
+
}).describe("Reward object");
|
|
181
|
+
export const AllocationModeSchema = z.enum(["Amount", "Rate", "Surplus"]).describe("Reward allocation mode. Amount indicates allocation by amount, Rate indicates allocation by proportion, Surplus indicates allocation by remaining amount. In a fund allocator, Amount will be allocated first, then remaining funds will be allocated by Rate (if no Surplus is defined, sum of all Rates must be 10000), and finally Surplus gets remaining amount (maximum one per fund allocator).");
|
|
182
|
+
export const AllocationSharingSchema = z.object({
|
|
183
|
+
who: RecipientSchema.describe("Recipient ID"),
|
|
184
|
+
sharing: BalanceTypeSchema.describe("Reward allocation value"),
|
|
185
|
+
mode: AllocationModeSchema.describe("Reward allocation mode"),
|
|
186
|
+
}).describe("Fund allocation item");
|
|
187
|
+
export const AllocatorSchema = z.object({
|
|
188
|
+
guard: NameOrAddressSchema.describe("Guard object ID. If Guard verification passes, fund allocation will start automatically."),
|
|
189
|
+
sharing: z.array(AllocationSharingSchema).describe("Fund allocation item list. Each item represents a recipient and their corresponding reward allocation value."),
|
|
190
|
+
fix: BalanceTypeSchema.optional().describe("Fixed allocation amount. If specified, all recipients will receive the fixed allocation amount."),
|
|
191
|
+
max: z.union([BalanceTypeSchema, z.null()]).optional().describe("Maximum allocation amount. If specified, allocation amount cannot exceed maximum allocation amount."),
|
|
192
|
+
}).describe("Fund allocator");
|
|
193
|
+
export const AllocatorsSchema = z.object({
|
|
194
|
+
description: DescriptionSchema.describe("Description of fund allocator list"),
|
|
195
|
+
threshold: BalanceTypeSchema.describe("Threshold. If defined, fund allocation will be triggered when amount in Allocation object reaches this threshold."),
|
|
196
|
+
allocators: z.array(AllocatorSchema).describe("Fund allocator list. Each fund allocator represents a fund allocation strategy."),
|
|
197
|
+
}).describe("Fund allocator list");
|
|
198
|
+
export const ObjectServiceSchema = ObjectBaseSchema.extend({
|
|
199
|
+
description: z.string().describe("Service object description"),
|
|
200
|
+
location: z.string().describe("Service object location"),
|
|
201
|
+
sales: z.array(ServiceSaleSchema).describe("Service sale list."),
|
|
202
|
+
repositories: z.array(z.string()).describe("Repository object list for service object's shared data"),
|
|
203
|
+
buy_guard: z.union([z.string(), z.null()]).describe("Purchase Guard object ID. If defined, service can only be purchased if Guard verification passes."),
|
|
204
|
+
machine: z.union([z.string(), z.null()]).describe("Machine object ID for each order's processing flow. The Machine must be in published state."),
|
|
205
|
+
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."),
|
|
206
|
+
bPaused: z.boolean().describe("Whether service purchase is paused"),
|
|
207
|
+
customer_required: z.array(z.string()).describe("Information required from customer. Such as phone, email, etc."),
|
|
208
|
+
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."),
|
|
209
|
+
compensation_fund: BalanceTypeSchema.describe("Compensation fund pool for arbitration results. Order users can receive compensation from this fund based on arbitration results."),
|
|
210
|
+
paused_time: z.union([z.number(), z.null()]).describe("Service purchase pause time. If not paused, it is null."),
|
|
211
|
+
compensation_lock_duration: z.union([z.string(), z.number()]).describe("Lock duration for arbitration result compensation. After service is paused for longer than this duration, service manager can retrieve compensation_fund. Default is at least 30 days."),
|
|
212
|
+
order_allocators: z.union([AllocatorsSchema, z.null()]).describe("Order fund allocator list."),
|
|
213
|
+
rewards: z.array(z.string()).describe("Reward object list"),
|
|
214
|
+
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
215
|
+
permission: z.string().describe("Permission object ID"),
|
|
216
|
+
}).describe("Service object");
|
|
217
|
+
export const ArbVotedSchema = z.object({
|
|
218
|
+
voter: z.string().describe("Voter ID"),
|
|
219
|
+
agrees: z.array(z.number().min(0).max(255)).describe("List of supported Proposition indices"),
|
|
220
|
+
weight: z.number().describe("Voting weight"),
|
|
221
|
+
time: z.number().describe("Voting time"),
|
|
222
|
+
}).describe("Voting record");
|
|
223
|
+
export const ArbPropositionSchema = z.object({
|
|
224
|
+
name: z.string().describe("Proposal name"),
|
|
225
|
+
votes: z.number().describe("Number of votes supporting this proposal"),
|
|
226
|
+
}).describe("Proposal");
|
|
227
|
+
export const ArbIndemnitySchema = z.object({
|
|
228
|
+
amount: BalanceTypeSchema.describe("Compensation amount"),
|
|
229
|
+
time: z.number().describe("Arbitration time"),
|
|
230
|
+
}).describe("Arbitration compensation");
|
|
231
|
+
export const ArbStatusSchema = z.enum([
|
|
232
|
+
"Principal_confirming",
|
|
233
|
+
"Arbitrator_confirming",
|
|
234
|
+
"Voting",
|
|
235
|
+
"Arbitrated",
|
|
236
|
+
"Objectionable",
|
|
237
|
+
"Finished",
|
|
238
|
+
"Withdrawn",
|
|
239
|
+
]).describe("Arb object status");
|
|
240
|
+
export const ObjectArbSchema = ObjectBaseSchema.extend({
|
|
241
|
+
description: z.string().describe("Arb object statement"),
|
|
242
|
+
arbitration: z.string().describe("Parent arbitration object ID"),
|
|
243
|
+
order: z.string().describe("Order object ID"),
|
|
244
|
+
voted: z.array(ArbVotedSchema).describe("Voting record list"),
|
|
245
|
+
proposition: z.array(ArbPropositionSchema).describe("Claim/proposal list"),
|
|
246
|
+
fee: BalanceTypeSchema.describe("Arbitration fee"),
|
|
247
|
+
feedback: z.string().describe("Arbitration feedback"),
|
|
248
|
+
indemnity: z.union([ArbIndemnitySchema, z.null()]).optional().describe("Arbitration compensation"),
|
|
249
|
+
voting_deadline: z.union([z.number(), z.string()]).optional().describe("Voting deadline"),
|
|
250
|
+
objection: z.string().describe("Arbitration objection"),
|
|
251
|
+
status: ArbStatusSchema,
|
|
252
|
+
compensation_time: z.union([z.number(), z.null()]).describe("Compensation claim time"),
|
|
253
|
+
time: z.number().describe("Arbitration time"),
|
|
254
|
+
}).describe("Arb object");
|
|
255
|
+
export const DiscountTypeSchema = z.union([
|
|
256
|
+
z.literal(WDiscountType.RATES).describe("Rate discount type"),
|
|
257
|
+
z.literal(WDiscountType.FIXED).describe("Fixed discount type")
|
|
258
|
+
]).describe("Discount type");
|
|
259
|
+
export const ObjectDiscountSchema = ObjectBaseSchema.extend({
|
|
260
|
+
name: z.string().describe("Discount name"),
|
|
261
|
+
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)."),
|
|
262
|
+
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."),
|
|
263
|
+
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)."),
|
|
264
|
+
time_start: z.union([z.string(), z.number()]).describe("Discount effective start time"),
|
|
265
|
+
time_end: z.union([z.string(), z.number()]).describe("Discount effective end time"),
|
|
266
|
+
service: z.string().describe("Parent service object ID"),
|
|
267
|
+
transferable: z.boolean().describe("Whether discount is transferable to other users"),
|
|
268
|
+
}).describe("Discount object");
|
|
269
|
+
export const AmountFromDepositGuardSchema = z.object({
|
|
270
|
+
guard: z.string().describe("Guard object ID or name"),
|
|
271
|
+
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."),
|
|
272
|
+
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."),
|
|
273
|
+
}).describe("Guard object that needs verification during deposit");
|
|
274
|
+
export const AmountFromWithdrawGuardSchema = z.object({
|
|
275
|
+
guard: z.string().describe("Guard object ID or name"),
|
|
276
|
+
identifier: z.number().describe("Guard Table data index, whose corresponding value is the withdrawable amount."),
|
|
277
|
+
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."),
|
|
278
|
+
}).describe("Guard object that needs verification during withdrawal");
|
|
279
|
+
export const ObjectTreasurySchema = ObjectBaseSchema.extend({
|
|
280
|
+
description: z.string().describe("Treasury object description"),
|
|
281
|
+
balance: BalanceTypeSchema.describe("Current balance"),
|
|
282
|
+
history_count: z.number().describe("Transaction record count. Use 'query_table' or 'query_table_item' to get 'TreasuryRecord' table items."),
|
|
283
|
+
external_deposit_guard: z.array(AmountFromDepositGuardSchema).describe("Guard object list that can be verified for non-permissioned users during deposit"),
|
|
284
|
+
external_withdraw_guard: z.array(AmountFromWithdrawGuardSchema).describe("Guard object list that can be verified for non-permissioned users during withdrawal"),
|
|
285
|
+
inflow: BalanceTypeSchema.describe("Inflow amount"),
|
|
286
|
+
outflow: BalanceTypeSchema.describe("Outflow amount"),
|
|
287
|
+
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
288
|
+
permission: z.string().describe("Permission object ID"),
|
|
289
|
+
}).describe("Treasury object");
|
|
290
|
+
export const TreasuryOpSchema = z.enum(["Withdraw", "Deposit", "Receive"]).describe("Treasury object operation type");
|
|
291
|
+
export const TreasuryRecordSchema = z.object({
|
|
292
|
+
op: TreasuryOpSchema.describe("Treasury object operation type"),
|
|
293
|
+
signer: z.string().describe("Operator user ID"),
|
|
294
|
+
external_guard: z.union([z.string(), z.null()]).describe("External Guard object ID. If null, operation was completed through Permission object permissions."),
|
|
295
|
+
amount: BalanceTypeSchema.describe("Operation amount"),
|
|
296
|
+
time: z.union([z.number(), z.string()]).describe("Operation time"),
|
|
297
|
+
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."),
|
|
298
|
+
}).describe("Treasury object transaction record");
|
|
299
|
+
export const PolicyWriteGuardSchema = z.object({
|
|
300
|
+
guard: z.string().describe("Guard object ID"),
|
|
301
|
+
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."),
|
|
302
|
+
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."),
|
|
303
|
+
}).describe("Guard object that needs verification when writing policy");
|
|
304
|
+
export const IdFromSchema = z.union([
|
|
305
|
+
z.literal(0).describe("None (0)"),
|
|
306
|
+
z.literal(1).describe("Clock (1)"),
|
|
307
|
+
z.literal(2).describe("Signer (2)"),
|
|
308
|
+
z.literal("None").describe("None"),
|
|
309
|
+
z.literal("Clock").describe("Clock"),
|
|
310
|
+
z.literal("Signer").describe("Signer"),
|
|
311
|
+
z.literal("none").describe("none"),
|
|
312
|
+
z.literal("clock").describe("clock"),
|
|
313
|
+
z.literal("signer").describe("signer"),
|
|
314
|
+
]).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.");
|
|
315
|
+
export const PolicyRuleSchema = z.object({
|
|
316
|
+
name: z.string().describe("Policy rule name"),
|
|
317
|
+
description: z.string().describe("Policy rule description"),
|
|
318
|
+
write_guard: z.array(PolicyWriteGuardSchema).describe("Guard object list that can be verified when writing data"),
|
|
319
|
+
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."),
|
|
320
|
+
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."),
|
|
321
|
+
value_type: ValueTypeSchema.describe("Type of data value when writing data."),
|
|
322
|
+
});
|
|
323
|
+
export const TableItem_RepositoryDataSchema = ObjectBaseSchema.extend({
|
|
324
|
+
entity: z.string().describe("Object or user ID"),
|
|
325
|
+
name: z.string().describe("Data item name (Policy Name)"),
|
|
326
|
+
value: z.array(z.number()).describe("Raw data value (first byte is value type, remaining bytes are Bcs formatted value)"),
|
|
327
|
+
data: z.object({
|
|
328
|
+
value_type: ValueTypeSchema.describe("Type of data value."),
|
|
329
|
+
value: SupportedValueSchema.describe("Data value."),
|
|
330
|
+
}),
|
|
331
|
+
}).describe("Storage data item owned by Repository object");
|
|
332
|
+
export const TableItem_RewardRecordSchema = ObjectBaseSchema.extend({
|
|
333
|
+
recipient: z.string().describe("Reward recipient ID"),
|
|
334
|
+
guard: z.string().describe("Guard object ID"),
|
|
335
|
+
total: BalanceTypeSchema.describe("Total reward amount"),
|
|
336
|
+
record: z.array(z.object({
|
|
337
|
+
amount: BalanceTypeSchema.describe("Reward amount"),
|
|
338
|
+
time: z.number().describe("Reward time"),
|
|
339
|
+
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."),
|
|
340
|
+
})).describe("Reward record list"),
|
|
341
|
+
}).describe("Reward object's reward record");
|
|
342
|
+
export const ObjectRepositorySchema = ObjectBaseSchema.extend({
|
|
343
|
+
description: z.string().describe("Repository object description"),
|
|
344
|
+
policies: z.array(PolicyRuleSchema).describe("Repository object policy rule list"),
|
|
345
|
+
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."),
|
|
346
|
+
rewards: z.array(z.string()).describe("Reward object list"),
|
|
347
|
+
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
348
|
+
permission: z.string().describe("Permission object ID"),
|
|
349
|
+
}).describe("Repository object");
|
|
350
|
+
export const ImSchema = z.object({
|
|
351
|
+
at: z.string().describe("Contact's account address for instant messaging"),
|
|
352
|
+
status: z.string().describe("Contact's current status message"),
|
|
353
|
+
join_time: z.number().describe("Timestamp when contact joined (milliseconds since epoch)"),
|
|
354
|
+
description: z.string().describe("Description or note about this contact"),
|
|
355
|
+
}).describe("Instant Messaging contact entry with address, status, and metadata");
|
|
356
|
+
export const ObjectContactSchema = ObjectBaseSchema.extend({
|
|
357
|
+
description: z.string().describe("Contact object description or public information"),
|
|
358
|
+
permission: z.string().describe("Permission object ID that controls who can modify this contact"),
|
|
359
|
+
location: z.string().describe("Physical or virtual location information for this contact"),
|
|
360
|
+
ims: z.array(ImSchema).describe("List of instant messaging contacts. Each entry contains an address for encrypted real-time communication via Wowok Messenger"),
|
|
361
|
+
}).describe("Contact object storing on-chain instant messaging addresses for real-time encrypted communication between object managers and users");
|
|
362
|
+
export const ObjectPersonalSchema = ObjectBaseSchema.extend({
|
|
363
|
+
address: z.string().describe("User's address"),
|
|
364
|
+
like: z.number().describe("User's like count"),
|
|
365
|
+
dislike: z.number().describe("User's dislike count"),
|
|
366
|
+
info: z.array(RecordsInEntitySchema).describe("User's personal information record list"),
|
|
367
|
+
description: z.string().describe("User's personal description"),
|
|
368
|
+
referrer: z.union([z.string(), z.null()]).describe("User's referrer ID"),
|
|
369
|
+
mark_object: z.union([z.string(), z.null()]).describe("On-chain address mark object ID"),
|
|
370
|
+
details: z.array(VoteInEntityLinkerSchema).describe("User's voting record list in EntityLinker"),
|
|
371
|
+
active_tx: z.union([z.string(), z.null()]).describe("User's recent active transaction ID"),
|
|
372
|
+
passive_tx: z.union([z.string(), z.null()]).describe("Recent transaction ID interacting with user"),
|
|
373
|
+
time: z.number().describe("User object creation time"),
|
|
374
|
+
}).describe("Personal object");
|
|
375
|
+
export const ObjectProofSchema = ObjectBaseSchema.extend({
|
|
376
|
+
description: z.string().describe("Proof description"),
|
|
377
|
+
proof: z.string().describe("Proof content. e.g., merkle tree root"),
|
|
378
|
+
server_pubkey: z.string().describe("Server public key"),
|
|
379
|
+
server_signature: z.string().describe("Server signature"),
|
|
380
|
+
proof_type: z.union([z.number(), z.string()]).describe("Proof type. 1: WTS proof; 1-100 reserved."),
|
|
381
|
+
item_count: z.union([z.number(), z.string(), z.null()]).describe("Item count. e.g., number of items in the merkle tree"),
|
|
382
|
+
about_address: z.union([z.string(), z.null()]).describe("About address. e.g., address of the entity being proved"),
|
|
383
|
+
signer: z.string().describe("Signer address"),
|
|
384
|
+
time: z.number().describe("Proof creation time"),
|
|
385
|
+
}).describe("Proof object");
|
|
386
|
+
export const WReceivedObjectSchema = ObjectBaseSchema.extend({
|
|
387
|
+
balance: BalanceTypeSchema.describe("Amount contained in object"),
|
|
388
|
+
payment: z.string().describe("Payment object ID"),
|
|
389
|
+
}).describe("Amount object received by on-chain object");
|
|
390
|
+
export const ObjectPermissionSchema = ObjectBaseSchema.extend({
|
|
391
|
+
builder: z.string().describe("Permission object owner ID (highest permission user)"),
|
|
392
|
+
admin: z.array(z.string()).describe("Admin user ID list"),
|
|
393
|
+
description: z.string().describe("Permission object description"),
|
|
394
|
+
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."),
|
|
395
|
+
perm_remark: z.array(z.object({
|
|
396
|
+
index: PermissionIndexTypeSchema,
|
|
397
|
+
remark: z.string().describe("Permission item remark"),
|
|
398
|
+
})).describe("Permission item remark list"),
|
|
399
|
+
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
400
|
+
}).describe("Permission object");
|
|
401
|
+
export const WitnessTypeSchema = z.number()
|
|
402
|
+
.int()
|
|
403
|
+
.refine(isWitnessType, {
|
|
404
|
+
message: 'Invalid WitnessType value',
|
|
405
|
+
});
|
|
406
|
+
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.");
|
|
407
|
+
export const GuardNodeSchema = z.lazy(() => z.discriminatedUnion('type', [
|
|
408
|
+
z.object({
|
|
409
|
+
type: z.literal('identifier'),
|
|
410
|
+
identifier: GuardIdentifierSchema,
|
|
411
|
+
}).strict().describe('Returns the constant value stored at the specified identifier in the Guard table.'),
|
|
412
|
+
z.object({
|
|
413
|
+
type: z.literal('query'),
|
|
414
|
+
query: z.union([
|
|
415
|
+
z.number().int().refine((id) => isValidGuardQueryId(id), { message: "Invalid guard query ID. ID not found in GUARDQUERY array." }),
|
|
416
|
+
z.string().refine((name) => isValidGuardQueryIdOrName(name), { message: "Invalid guard query name. Name not found in GUARDQUERY array (case-insensitive)." })
|
|
417
|
+
]).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."),
|
|
418
|
+
object: z.object({
|
|
419
|
+
identifier: GuardIdentifierSchema,
|
|
420
|
+
convert_witness: WitnessTypeSchema.optional().describe("Optional. When specified, the query retrieves data from the associated object instead of the object itself. For example, querying an order with convert_witness=TypeOrderProgress retrieves the associated Progress object data."),
|
|
421
|
+
}).strict().describe("The object to query from the Guard table."),
|
|
422
|
+
parameters: z.array(GuardNodeSchema).describe("Parameters required by the query (must match the query's expected parameters type)."),
|
|
423
|
+
}).strict().describe("Returns the result of executing a data query instruction on the specified object. The return type depends on the query being executed."),
|
|
424
|
+
z.object({
|
|
425
|
+
type: z.literal('logic_as_u256_greater_or_equal'),
|
|
426
|
+
nodes: z.array(GuardNodeSchema),
|
|
427
|
+
}).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.`),
|
|
428
|
+
z.object({
|
|
429
|
+
type: z.literal('logic_as_u256_lesser_or_equal'),
|
|
430
|
+
nodes: z.array(GuardNodeSchema),
|
|
431
|
+
}).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.`),
|
|
432
|
+
z.object({
|
|
433
|
+
type: z.literal('logic_as_u256_greater'),
|
|
434
|
+
nodes: z.array(GuardNodeSchema),
|
|
435
|
+
}).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.`),
|
|
436
|
+
z.object({
|
|
437
|
+
type: z.literal('logic_as_u256_lesser'),
|
|
438
|
+
nodes: z.array(GuardNodeSchema),
|
|
439
|
+
}).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.`),
|
|
440
|
+
z.object({
|
|
441
|
+
type: z.literal('logic_as_u256_equal'),
|
|
442
|
+
nodes: z.array(GuardNodeSchema),
|
|
443
|
+
}).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.`),
|
|
444
|
+
z.object({
|
|
445
|
+
type: z.literal('logic_equal'),
|
|
446
|
+
nodes: z.array(GuardNodeSchema),
|
|
447
|
+
}).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.`),
|
|
448
|
+
z.object({
|
|
449
|
+
type: z.literal('logic_not'),
|
|
450
|
+
node: GuardNodeSchema,
|
|
451
|
+
}).strict().describe("Returns Bool. Computed by inverting the boolean value of the child node (true -> false, false -> true)."),
|
|
452
|
+
z.object({
|
|
453
|
+
type: z.literal('logic_and'),
|
|
454
|
+
nodes: z.array(GuardNodeSchema),
|
|
455
|
+
}).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.`),
|
|
456
|
+
z.object({
|
|
457
|
+
type: z.literal('logic_or'),
|
|
458
|
+
nodes: z.array(GuardNodeSchema),
|
|
459
|
+
}).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.`),
|
|
460
|
+
z.object({
|
|
461
|
+
type: z.literal('logic_string_contains'),
|
|
462
|
+
nodes: z.array(GuardNodeSchema),
|
|
463
|
+
}).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.`),
|
|
464
|
+
z.object({
|
|
465
|
+
type: z.literal('logic_string_nocase_contains'),
|
|
466
|
+
nodes: z.array(GuardNodeSchema),
|
|
467
|
+
}).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.`),
|
|
468
|
+
z.object({
|
|
469
|
+
type: z.literal('logic_string_nocase_equal'),
|
|
470
|
+
nodes: z.array(GuardNodeSchema),
|
|
471
|
+
}).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.`),
|
|
472
|
+
z.object({
|
|
473
|
+
type: z.literal('calc_number_add'),
|
|
474
|
+
nodes: z.array(GuardNodeSchema),
|
|
475
|
+
}).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 + ...).`),
|
|
476
|
+
z.object({
|
|
477
|
+
type: z.literal('calc_number_multiply'),
|
|
478
|
+
nodes: z.array(GuardNodeSchema),
|
|
479
|
+
}).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 * ...).`),
|
|
480
|
+
z.object({
|
|
481
|
+
type: z.literal('calc_number_subtract'),
|
|
482
|
+
nodes: z.array(GuardNodeSchema),
|
|
483
|
+
}).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 - ...).`),
|
|
484
|
+
z.object({
|
|
485
|
+
type: z.literal('calc_number_divide'),
|
|
486
|
+
nodes: z.array(GuardNodeSchema),
|
|
487
|
+
}).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.`),
|
|
488
|
+
z.object({
|
|
489
|
+
type: z.literal('calc_number_mod'),
|
|
490
|
+
nodes: z.array(GuardNodeSchema),
|
|
491
|
+
}).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.`),
|
|
492
|
+
z.object({
|
|
493
|
+
type: z.literal('calc_string_length'),
|
|
494
|
+
node: GuardNodeSchema,
|
|
495
|
+
}).strict().describe("Returns U64. Computed by getting the length (number of UTF-8 bytes) of the child node value."),
|
|
496
|
+
z.object({
|
|
497
|
+
type: z.literal('calc_string_nocase_contains'),
|
|
498
|
+
nodes: z.array(GuardNodeSchema),
|
|
499
|
+
}).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.`),
|
|
500
|
+
z.object({
|
|
501
|
+
type: z.literal('calc_string_nocase_equal'),
|
|
502
|
+
nodes: z.array(GuardNodeSchema),
|
|
503
|
+
}).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.`),
|
|
504
|
+
z.object({
|
|
505
|
+
type: z.literal('calc_string_contains'),
|
|
506
|
+
nodes: z.array(GuardNodeSchema),
|
|
507
|
+
}).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.`),
|
|
508
|
+
z.object({
|
|
509
|
+
type: z.literal('calc_string_indexof'),
|
|
510
|
+
nodeLeft: GuardNodeSchema,
|
|
511
|
+
nodeRight: GuardNodeSchema,
|
|
512
|
+
order: z.enum(['forward', 'backward']).describe("'forward' searches from start to end, 'backward' searches from end to start."),
|
|
513
|
+
}).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)."),
|
|
514
|
+
z.object({
|
|
515
|
+
type: z.literal('calc_string_nocase_indexof'),
|
|
516
|
+
nodeLeft: GuardNodeSchema,
|
|
517
|
+
nodeRight: GuardNodeSchema,
|
|
518
|
+
order: z.enum(['forward', 'backward']).describe("'forward' searches from start to end, 'backward' searches from end to start."),
|
|
519
|
+
}).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)."),
|
|
520
|
+
z.object({
|
|
521
|
+
type: z.literal('convert_number_address'),
|
|
522
|
+
node: GuardNodeSchema,
|
|
523
|
+
}).strict().describe("Returns Address. Computed by converting the child node value from number type to Address type."),
|
|
524
|
+
z.object({
|
|
525
|
+
type: z.literal('convert_address_number'),
|
|
526
|
+
node: GuardNodeSchema,
|
|
527
|
+
}).strict().describe("Returns U256. Computed by converting the child node value from Address type to number type."),
|
|
528
|
+
z.object({
|
|
529
|
+
type: z.literal('convert_number_string'),
|
|
530
|
+
node: GuardNodeSchema,
|
|
531
|
+
}).strict().describe("Returns String. Computed by converting the child node value from number type to string type."),
|
|
532
|
+
z.object({
|
|
533
|
+
type: z.literal('convert_string_number'),
|
|
534
|
+
node: GuardNodeSchema,
|
|
535
|
+
}).strict().describe("Returns U256. Computed by parsing the child node value as a number. Throws exception if the string is not a valid number."),
|
|
536
|
+
z.object({
|
|
537
|
+
type: z.literal('convert_safe_u8'),
|
|
538
|
+
node: GuardNodeSchema,
|
|
539
|
+
}).strict().describe("Returns U8. Computed by converting the child node value to U8. Throws exception if value is out of U8 range (0-255)."),
|
|
540
|
+
z.object({
|
|
541
|
+
type: z.literal('convert_safe_u16'),
|
|
542
|
+
node: GuardNodeSchema,
|
|
543
|
+
}).strict().describe("Returns U16. Computed by converting the child node value to U16. Throws exception if value is out of U16 range (0-65535)."),
|
|
544
|
+
z.object({
|
|
545
|
+
type: z.literal('convert_safe_u32'),
|
|
546
|
+
node: GuardNodeSchema,
|
|
547
|
+
}).strict().describe("Returns U32. Computed by converting the child node value to U32. Throws exception if value is out of U32 range."),
|
|
548
|
+
z.object({
|
|
549
|
+
type: z.literal('convert_safe_u64'),
|
|
550
|
+
node: GuardNodeSchema,
|
|
551
|
+
}).strict().describe("Returns U64. Computed by converting the child node value to U64. Throws exception if value is out of U64 range."),
|
|
552
|
+
z.object({
|
|
553
|
+
type: z.literal('convert_safe_u128'),
|
|
554
|
+
node: GuardNodeSchema,
|
|
555
|
+
}).strict().describe("Returns U128. Computed by converting the child node value to U128. Throws exception if value is out of U128 range."),
|
|
556
|
+
z.object({
|
|
557
|
+
type: z.literal('convert_safe_u256'),
|
|
558
|
+
node: GuardNodeSchema,
|
|
559
|
+
}).strict().describe("Returns U256. Computed by converting the child node value to U256."),
|
|
560
|
+
z.object({
|
|
561
|
+
type: z.literal('value_type'),
|
|
562
|
+
node: GuardNodeSchema,
|
|
563
|
+
}).strict().describe(`Returns U8. Computed by getting the type identifier (ValueType) of the child node value. ${VALUE_TYPE_DESCRIPTION}`),
|
|
564
|
+
z.object({
|
|
565
|
+
type: z.literal('vec_length'),
|
|
566
|
+
node: GuardNodeSchema,
|
|
567
|
+
}).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.`),
|
|
568
|
+
z.object({
|
|
569
|
+
type: z.literal('vec_contains_bool'),
|
|
570
|
+
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).`),
|
|
571
|
+
}).strict().describe("Returns Bool. Computed by checking if the vector (first node) contains ALL boolean values (subsequent nodes)."),
|
|
572
|
+
z.object({
|
|
573
|
+
type: z.literal('vec_contains_address'),
|
|
574
|
+
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).`),
|
|
575
|
+
}).strict().describe("Returns Bool. Computed by checking if the vector (first node) contains ALL address values (subsequent nodes)."),
|
|
576
|
+
z.object({
|
|
577
|
+
type: z.literal('vec_contains_string'),
|
|
578
|
+
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).`),
|
|
579
|
+
}).strict().describe("Returns Bool. Computed by checking if the vector (first node) contains ALL string values (subsequent nodes)."),
|
|
580
|
+
z.object({
|
|
581
|
+
type: z.literal('vec_contains_string_nocase'),
|
|
582
|
+
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).`),
|
|
583
|
+
}).strict().describe("Returns Bool. Computed by checking if the vector (first node) contains ALL string values (subsequent nodes), using case-insensitive comparison."),
|
|
584
|
+
z.object({
|
|
585
|
+
type: z.literal('vec_contains_number'),
|
|
586
|
+
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).`),
|
|
587
|
+
}).strict().describe("Returns Bool. Computed by checking if the vector (first node) contains ALL number values (subsequent nodes)."),
|
|
588
|
+
z.object({
|
|
589
|
+
type: z.literal('vec_indexof_bool'),
|
|
590
|
+
nodeLeft: GuardNodeSchema,
|
|
591
|
+
nodeRight: GuardNodeSchema,
|
|
592
|
+
order: z.enum(['forward', 'backward']).describe("'forward' searches from index 0, 'backward' searches from last index."),
|
|
593
|
+
}).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)."),
|
|
594
|
+
z.object({
|
|
595
|
+
type: z.literal('vec_indexof_address'),
|
|
596
|
+
nodeLeft: GuardNodeSchema,
|
|
597
|
+
nodeRight: GuardNodeSchema,
|
|
598
|
+
order: z.enum(['forward', 'backward']).describe("'forward' searches from index 0, 'backward' searches from last index."),
|
|
599
|
+
}).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)."),
|
|
600
|
+
z.object({
|
|
601
|
+
type: z.literal('vec_indexof_string'),
|
|
602
|
+
nodeLeft: GuardNodeSchema,
|
|
603
|
+
nodeRight: GuardNodeSchema,
|
|
604
|
+
order: z.enum(['forward', 'backward']).describe("'forward' searches from index 0, 'backward' searches from last index."),
|
|
605
|
+
}).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)."),
|
|
606
|
+
z.object({
|
|
607
|
+
type: z.literal('vec_indexof_string_nocase'),
|
|
608
|
+
nodeLeft: GuardNodeSchema,
|
|
609
|
+
nodeRight: GuardNodeSchema,
|
|
610
|
+
order: z.enum(['forward', 'backward']).describe("'forward' searches from index 0, 'backward' searches from last index."),
|
|
611
|
+
}).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)."),
|
|
612
|
+
z.object({
|
|
613
|
+
type: z.literal('vec_indexof_number'),
|
|
614
|
+
nodeLeft: GuardNodeSchema,
|
|
615
|
+
nodeRight: GuardNodeSchema,
|
|
616
|
+
order: z.enum(['forward', 'backward']).describe("'forward' searches from index 0, 'backward' searches from last index."),
|
|
617
|
+
}).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)."),
|
|
618
|
+
z.object({
|
|
619
|
+
type: z.literal('context'),
|
|
620
|
+
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)."),
|
|
621
|
+
}).strict().describe("Signer returns transaction sender address (Address), Clock returns current on-chain timestamp (U64), Guard returns current Guard object ID (Address)."),
|
|
622
|
+
z.object({
|
|
623
|
+
type: z.literal('query_reward_record_find'),
|
|
624
|
+
object: z.object({
|
|
625
|
+
identifier: GuardIdentifierSchema,
|
|
626
|
+
}).strict().describe("Reference to the Reward object in the Guard table (must be Address type)."),
|
|
627
|
+
find: z.enum(['first', 'last']).describe("'first' finds the earliest matching record, 'last' finds the most recent matching record."),
|
|
628
|
+
recipient: GuardNodeSchema.describe("GuardNode that returns the recipient address to search for (must be Address type). Typically an 'identifier' node referencing the recipient's address from the Guard table."),
|
|
629
|
+
where: z.object({
|
|
630
|
+
guard: z.string().optional().describe("Optional filter: Guard object address constant to match."),
|
|
631
|
+
timeMin: z.string().optional().describe("Optional filter: minimum timestamp (inclusive) for record creation time. Use string to represent U64 value."),
|
|
632
|
+
timeMax: z.string().optional().describe("Optional filter: maximum timestamp (inclusive) for record creation time. Use string to represent U64 value."),
|
|
633
|
+
amountMin: z.string().optional().describe("Optional filter: minimum reward amount (inclusive). Use string to represent U64 value."),
|
|
634
|
+
amountMax: z.string().optional().describe("Optional filter: maximum reward amount (inclusive). Use string to represent U64 value."),
|
|
635
|
+
storeFromId: z.union([
|
|
636
|
+
z.literal('exists'),
|
|
637
|
+
z.literal('not_exists'),
|
|
638
|
+
z.object({ eq: z.string().describe("Address string to match") })
|
|
639
|
+
]).optional().describe("Optional filter for store_from_id field: 'exists' means any value exists, 'not_exists' means no value, {eq: string} matches specific address."),
|
|
640
|
+
}).strict().describe("Filter conditions for the reward record query."),
|
|
641
|
+
}).strict().describe("Returns a RewardRecord object (as Value type). Finds the first or last reward record matching the specified recipient and filter conditions. Use with 'value_type' node to check if a record was found (returns ValueType 19 if found, otherwise may return empty)."),
|
|
642
|
+
z.object({
|
|
643
|
+
type: z.literal('query_reward_record_count'),
|
|
644
|
+
object: z.object({
|
|
645
|
+
identifier: GuardIdentifierSchema,
|
|
646
|
+
}).strict().describe("Reference to the Reward object in the Guard table (must be Address type)."),
|
|
647
|
+
recipient: GuardNodeSchema.describe("GuardNode that returns the recipient address to count records for (must be Address type). Typically an 'identifier' node referencing the recipient's address from the Guard table."),
|
|
648
|
+
where: z.object({
|
|
649
|
+
guard: z.string().optional().describe("Optional filter: Guard object address constant to match."),
|
|
650
|
+
timeMin: z.string().optional().describe("Optional filter: minimum timestamp (inclusive) for record creation time. Use string to represent U64 value."),
|
|
651
|
+
timeMax: z.string().optional().describe("Optional filter: maximum timestamp (inclusive) for record creation time. Use string to represent U64 value."),
|
|
652
|
+
amountMin: z.string().optional().describe("Optional filter: minimum reward amount (inclusive). Use string to represent U64 value."),
|
|
653
|
+
amountMax: z.string().optional().describe("Optional filter: maximum reward amount (inclusive). Use string to represent U64 value."),
|
|
654
|
+
storeFromId: z.union([
|
|
655
|
+
z.literal('exists'),
|
|
656
|
+
z.literal('not_exists'),
|
|
657
|
+
z.object({ eq: z.string().describe("Address string to match") })
|
|
658
|
+
]).optional().describe("Optional filter for store_from_id field: 'exists' means any value exists, 'not_exists' means no value, {eq: string} matches specific address."),
|
|
659
|
+
}).strict().describe("Filter conditions for the reward record count query."),
|
|
660
|
+
}).strict().describe("Returns U64. Counts the number of reward records matching the specified recipient and filter conditions."),
|
|
661
|
+
z.object({
|
|
662
|
+
type: z.literal('query_reward_record_exists'),
|
|
663
|
+
object: z.object({
|
|
664
|
+
identifier: GuardIdentifierSchema,
|
|
665
|
+
}).strict().describe("Reference to the Reward object in the Guard table (must be Address type)."),
|
|
666
|
+
recipient: GuardNodeSchema.describe("GuardNode that returns the recipient address to check records for (must be Address type). Typically an 'identifier' node referencing the recipient's address from the Guard table."),
|
|
667
|
+
where: z.object({
|
|
668
|
+
guard: z.string().optional().describe("Optional filter: Guard object address constant to match."),
|
|
669
|
+
timeMin: z.string().optional().describe("Optional filter: minimum timestamp (inclusive) for record creation time. Use string to represent U64 value."),
|
|
670
|
+
timeMax: z.string().optional().describe("Optional filter: maximum timestamp (inclusive) for record creation time. Use string to represent U64 value."),
|
|
671
|
+
amountMin: z.string().optional().describe("Optional filter: minimum reward amount (inclusive). Use string to represent U64 value."),
|
|
672
|
+
amountMax: z.string().optional().describe("Optional filter: maximum reward amount (inclusive). Use string to represent U64 value."),
|
|
673
|
+
storeFromId: z.union([
|
|
674
|
+
z.literal('exists'),
|
|
675
|
+
z.literal('not_exists'),
|
|
676
|
+
z.object({ eq: z.string().describe("Address string to match") })
|
|
677
|
+
]).optional().describe("Optional filter for store_from_id field: 'exists' means any value exists, 'not_exists' means no value, {eq: string} matches specific address."),
|
|
678
|
+
}).strict().describe("Filter conditions for the reward record existence query."),
|
|
679
|
+
}).strict().describe("Returns Bool. Returns true if at least one reward record exists matching the specified recipient and filter conditions, otherwise false."),
|
|
680
|
+
z.object({
|
|
681
|
+
type: z.literal('query_progress_history_find'),
|
|
682
|
+
object: z.object({
|
|
683
|
+
identifier: GuardIdentifierSchema,
|
|
684
|
+
}).strict().describe("Reference to the Progress object in the Guard table (must be Address type)."),
|
|
685
|
+
where: z.object({
|
|
686
|
+
node: z.string().optional().describe("Optional filter: node name string to match."),
|
|
687
|
+
nextNode: z.string().optional().describe("Optional filter: next node name string to match."),
|
|
688
|
+
timeMin: z.string().optional().describe("Optional filter: minimum timestamp (inclusive) for history entry time. Use string to represent U64 value."),
|
|
689
|
+
timeMax: z.string().optional().describe("Optional filter: maximum timestamp (inclusive) for history entry time. Use string to represent U64 value."),
|
|
690
|
+
indexMin: z.string().optional().describe("Optional filter: minimum history index (inclusive) to search within. Use string to represent U64 value."),
|
|
691
|
+
indexMax: z.string().optional().describe("Optional filter: maximum history index (inclusive) to search within. Use string to represent U64 value."),
|
|
692
|
+
}).strict().describe("Filter conditions for the progress history query."),
|
|
693
|
+
find: z.enum(['first', 'last']).describe("'first' finds the earliest matching history entry, 'last' finds the most recent matching history entry."),
|
|
694
|
+
}).strict().describe("Returns a ProgressHistory object (as Value type). Finds the first or last history entry matching the filter conditions. Use with 'value_type' node to check if an entry was found."),
|
|
695
|
+
z.object({
|
|
696
|
+
type: z.literal('query_progress_history_session_find'),
|
|
697
|
+
object: z.object({
|
|
698
|
+
identifier: GuardIdentifierSchema,
|
|
699
|
+
}).strict().describe("Reference to the Progress object in the Guard table (must be Address type)."),
|
|
700
|
+
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."),
|
|
701
|
+
where: z.object({
|
|
702
|
+
nextNode: z.string().optional().describe("Optional filter: next node name string to match."),
|
|
703
|
+
}).strict().describe("Filter conditions for the progress history session query."),
|
|
704
|
+
find: z.enum(['first', 'last']).describe("'first' finds the earliest matching session, 'last' finds the most recent matching session."),
|
|
705
|
+
}).strict().describe("Returns a ProgressHistorySession object (as Value type). Finds the first or last session within the specified history entry matching the filter conditions. Use with 'value_type' node to check if a session was found."),
|
|
706
|
+
z.object({
|
|
707
|
+
type: z.literal('query_progress_history_session_forward_find'),
|
|
708
|
+
object: z.object({
|
|
709
|
+
identifier: GuardIdentifierSchema,
|
|
710
|
+
}).strict().describe("Reference to the Progress object in the Guard table (must be Address type)."),
|
|
711
|
+
historyIdx: GuardNodeSchema.describe("GuardNode that returns the history index (U64 type). Typically an 'identifier' node referencing a U64 value from the Guard table."),
|
|
712
|
+
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."),
|
|
713
|
+
where: z.object({
|
|
714
|
+
who: z.string().optional().describe("Optional filter: operator address string to match."),
|
|
715
|
+
operation: z.string().optional().describe("Optional filter: operation name string to match."),
|
|
716
|
+
accomplished: z.boolean().optional().describe("Optional filter: whether the forward operation was accomplished."),
|
|
717
|
+
timeMin: z.string().optional().describe("Optional filter: minimum timestamp (inclusive) for forward operation time. Use string to represent U64 value."),
|
|
718
|
+
timeMax: z.string().optional().describe("Optional filter: maximum timestamp (inclusive) for forward operation time. Use string to represent U64 value."),
|
|
719
|
+
}).strict().describe("Filter conditions for the progress history session forward query."),
|
|
720
|
+
find: z.enum(['first', 'last']).describe("'first' finds the earliest matching forward operation, 'last' finds the most recent matching forward operation."),
|
|
721
|
+
}).strict().describe("Returns a ProgressHistorySessionForward object (as Value type). Finds the first or last forward operation within the specified history session matching the filter conditions. Use with 'value_type' node to check if a forward operation was found."),
|
|
722
|
+
z.object({
|
|
723
|
+
type: z.literal('query_progress_history_session_count'),
|
|
724
|
+
object: z.object({
|
|
725
|
+
identifier: GuardIdentifierSchema,
|
|
726
|
+
}).strict().describe("Reference to the Progress object in the Guard table (must be Address type)."),
|
|
727
|
+
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."),
|
|
728
|
+
}).strict().describe("Returns U64. Counts the number of sessions within the specified history entry."),
|
|
729
|
+
z.object({
|
|
730
|
+
type: z.literal('query_progress_history_session_forward_count'),
|
|
731
|
+
object: z.object({
|
|
732
|
+
identifier: GuardIdentifierSchema,
|
|
733
|
+
}).strict().describe("Reference to the Progress object in the Guard table (must be Address type)."),
|
|
734
|
+
historyIdx: GuardNodeSchema.describe("GuardNode that returns the history index (U64 type). Typically an 'identifier' node referencing a U64 value from the Guard table."),
|
|
735
|
+
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."),
|
|
736
|
+
}).strict().describe("Returns U64. Counts the number of forward operations within the specified history session."),
|
|
737
|
+
z.object({
|
|
738
|
+
type: z.literal('query_progress_history_session_forward_retained_submission_count'),
|
|
739
|
+
object: z.object({
|
|
740
|
+
identifier: GuardIdentifierSchema,
|
|
741
|
+
}).strict().describe("Reference to the Progress object in the Guard table (must be Address type)."),
|
|
742
|
+
historyIdx: GuardNodeSchema.describe("GuardNode that returns the history index (U64 type). Typically an 'identifier' node referencing a U64 value from the Guard table."),
|
|
743
|
+
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."),
|
|
744
|
+
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."),
|
|
745
|
+
}).strict().describe("Returns U64. Counts the number of retained submissions within the specified forward operation.")
|
|
746
|
+
])).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.");
|
|
747
|
+
export const ObjectGuardSchema = ObjectBaseSchema.extend({
|
|
748
|
+
description: z.string().describe("Guard object description"),
|
|
749
|
+
table: z.array(GuardTableItemSchema).describe("Guard object table item list"),
|
|
750
|
+
input: z.array(z.number()).describe("Guard object instruction sequence"),
|
|
751
|
+
root: GuardNodeSchema.describe("Guard object root node"),
|
|
752
|
+
rep_quote: z.record(z.string().describe("Repository object ID"), z.array(z.string()).describe("Repository policy list")).describe("Depends on Repository policy quote"),
|
|
753
|
+
relies: z.array(z.string()).describe("List of other Guard object IDs that this Guard object depends on"),
|
|
754
|
+
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"),
|
|
755
|
+
rep: z.boolean().describe("If false, has complex Repository quote dependencies and cannot be used as an independent Guard"),
|
|
756
|
+
}).describe("Guard object");
|
|
757
|
+
export const PaymentInfoSchema = z.object({
|
|
758
|
+
for_object: z.union([z.string(), z.null()]).optional().describe("Payment for a specific object ID"),
|
|
759
|
+
for_guard: z.union([z.string(), z.null()]).optional().describe("Payment to satisfy verification of a Guard object"),
|
|
760
|
+
remark: z.string().describe("Payment record remark"),
|
|
761
|
+
index: z.union([z.number(), z.string()]).describe("Payment record index"),
|
|
762
|
+
}).describe("Payment information");
|
|
763
|
+
export const ObjectPaymentSchema = ObjectBaseSchema.extend({
|
|
764
|
+
record: z.array(z.object({
|
|
765
|
+
recipient: RecipientSchema,
|
|
766
|
+
amount: BalanceTypeSchema,
|
|
767
|
+
})).describe("Payment record list"),
|
|
768
|
+
amount: BalanceTypeSchema.describe("Payment amount"),
|
|
769
|
+
time: z.string().describe("Payment time"),
|
|
770
|
+
from_object: z.union([z.string(), z.null()]).optional().describe("Payment source object ID"),
|
|
771
|
+
signer: z.string().describe("Payment signer ID"),
|
|
772
|
+
info: PaymentInfoSchema,
|
|
773
|
+
}).describe("Payment object");
|
|
774
|
+
export const ObjectAllocationSchema = ObjectBaseSchema.extend({
|
|
775
|
+
description: z.string().describe("Fund allocation object description"),
|
|
776
|
+
allocators: z.array(AllocatorSchema).describe("Fund allocation object allocator list"),
|
|
777
|
+
balance: BalanceTypeSchema.describe("Fund allocation object balance"),
|
|
778
|
+
payment_info: PaymentInfoSchema.optional().describe("Payment information"),
|
|
779
|
+
payment: z.array(z.string()).describe("Payment object ID list. Each fund allocation automatically generates a payment object to record fund flow"),
|
|
780
|
+
}).describe("Fund allocation object");
|
|
781
|
+
export const VoteWeightSchema = z.union([
|
|
782
|
+
z.object({
|
|
783
|
+
GuardIdentifier: GuardIdentifierSchema,
|
|
784
|
+
}).describe("Use value corresponding to Guard object's Table index as voting weight"),
|
|
785
|
+
z.object({
|
|
786
|
+
FixedValue: z.number().int().min(0).max(65535).describe("Fixed voting weight value"),
|
|
787
|
+
}).describe("Fixed voting weight"),
|
|
788
|
+
]).describe("Voting weight");
|
|
789
|
+
export const VotingGuardSchema = z.object({
|
|
790
|
+
guard: z.string().describe("Voting Guard object ID"),
|
|
791
|
+
vote_weight: VoteWeightSchema,
|
|
792
|
+
}).describe("Voting Guard object");
|
|
793
|
+
export const ObjectArbitrationSchema = ObjectBaseSchema.extend({
|
|
794
|
+
description: z.string().describe("Arbitration object description"),
|
|
795
|
+
location: z.string().describe("Arbitration object location"),
|
|
796
|
+
voting_guard: z.array(VotingGuardSchema).describe("Voting Guard object list"),
|
|
797
|
+
usage_guard: z.union([z.string(), z.null()]).optional().describe("Guard object ID that needs verification when submitting arbitration"),
|
|
798
|
+
fee: BalanceTypeSchema.describe("Single arbitration fee"),
|
|
799
|
+
balance: BalanceTypeSchema.describe("Arbitration object balance"),
|
|
800
|
+
bPaused: z.boolean().describe("Whether arbitration object is paused"),
|
|
801
|
+
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
802
|
+
permission: z.string().describe("Arbitration object permission"),
|
|
803
|
+
}).describe("Arbitration object");
|
|
804
|
+
export const GuardInPassportSchema = z.object({
|
|
805
|
+
guard: z.string().describe("Guard object ID"),
|
|
806
|
+
result: z.boolean().describe("Guard object verification result"),
|
|
807
|
+
impack: z.boolean().describe("Whether Guard object verification result participates in final result determination (AND logic)"),
|
|
808
|
+
relies: z.array(z.string()).describe("List of other Guard object IDs that this Guard object depends on"),
|
|
809
|
+
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"),
|
|
810
|
+
submission: GuardSubmissionSchema.describe("Data submitted by user during Guard object verification"),
|
|
811
|
+
}).describe("Record of Guard object in Passport object");
|
|
812
|
+
export const ObjectPassportSchema = ObjectBaseSchema.extend({
|
|
813
|
+
info: z.array(GuardInPassportSchema).describe("List of Guard object records in Passport object"),
|
|
814
|
+
result: z.boolean().describe("Passport object final verification result"),
|
|
815
|
+
tx_hash: z.string().describe("Transaction hash where verification occurred"),
|
|
816
|
+
impack_guard: z.array(z.string()).describe("List of Guard object IDs participating in final result determination"),
|
|
817
|
+
time: z.number().describe("Creation time of the Passport object"),
|
|
818
|
+
signer: z.string().describe("Signer address of the Passport object"),
|
|
819
|
+
has_verified: z.boolean().describe("Whether the Passport object has been verified"),
|
|
820
|
+
}).describe("Passport object");
|
|
821
|
+
export const TableItem_PermissionPermSchema = ObjectBaseSchema.extend({
|
|
822
|
+
address: z.string().describe("User ID or Guard ID"),
|
|
823
|
+
perm: z.array(PermissionIndexTypeSchema).describe("Permission list obtained after user or Guard object verification"),
|
|
824
|
+
}).describe("Permission object's permission record");
|
|
825
|
+
export const TableItem_DemandPresenterSchema = ObjectBaseSchema.extend({
|
|
826
|
+
address: z.string().describe("Referrer ID"),
|
|
827
|
+
recommend: z.string().describe("Recommendation letter"),
|
|
828
|
+
service: z.union([z.string(), z.null()]).describe("Recommended service object ID"),
|
|
829
|
+
update_time: z.number().describe("Last update time"),
|
|
830
|
+
acceptance_score: z.union([z.number(), z.null()]).describe("Demand object feedback score"),
|
|
831
|
+
feedback: z.string().describe("Demand object feedback information"),
|
|
832
|
+
feedback_time: z.number().describe("Demand object feedback time"),
|
|
833
|
+
}).describe("Demand object's Service recommendation record");
|
|
834
|
+
export const MachineForwardGuardSchema = z.object({
|
|
835
|
+
guard: z.string().describe("Guard object ID"),
|
|
836
|
+
retained_submission: z.array(z.number()).optional().describe("Data submitted by user during Guard object verification"),
|
|
837
|
+
}).describe("Record of Guard object in MachineForwardGuard object");
|
|
838
|
+
export const MachineForwardSchema = z.object({
|
|
839
|
+
name: z.string().describe("Forward name"),
|
|
840
|
+
namedOperator: z.string().optional().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)."),
|
|
841
|
+
permissionIndex: PermissionIndexTypeSchema.optional().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)."),
|
|
842
|
+
weight: z.number().int().min(0).max(65535).describe("Forward weight"),
|
|
843
|
+
guard: MachineForwardGuardSchema.optional().describe("Guard object ID, if defined, Guard verification must also pass to complete Forward (e.g., completed promised supply chain sub-order)."),
|
|
844
|
+
}).describe("Forward in Machine object");
|
|
845
|
+
export const MachineNodePairSchema = z.object({
|
|
846
|
+
prev_node: z.string().describe("Previous node name"),
|
|
847
|
+
threshold: z.number().int().min(0).max(4294967295).describe("Threshold to trigger node advancement. If total Forward weight is greater than or equal to threshold, node advancement is triggered."),
|
|
848
|
+
forwards: z.array(MachineForwardSchema).describe("Forward list"),
|
|
849
|
+
}).describe("Node pair in Machine object");
|
|
850
|
+
export const MachineNodeSchema = z.object({
|
|
851
|
+
name: z.string().describe("Node name"),
|
|
852
|
+
pairs: z.array(MachineNodePairSchema).describe("Node pair list"),
|
|
853
|
+
}).describe("Node in Machine object");
|
|
854
|
+
export const TableItem_MachineNodeSchema = ObjectBaseSchema.extend({
|
|
855
|
+
name: z.string().describe("Node name"),
|
|
856
|
+
value: z.array(MachineNodePairSchema).describe("Node pair list"),
|
|
857
|
+
}).describe("Node record in Machine object");
|
|
858
|
+
export const TableItem_ProgressHistorySchema = ObjectBaseSchema.extend({
|
|
859
|
+
index: z.number().int().describe("Progress record index (starting from 0)"),
|
|
860
|
+
node: z.string().describe("Previous node name"),
|
|
861
|
+
next_node: z.string().describe("Next node name"),
|
|
862
|
+
session: z.array(ProgressSessionSchema).describe("Progress session list"),
|
|
863
|
+
time: z.number().describe("Progress record completion time (Unix timestamp)"),
|
|
864
|
+
}).describe("Completed progress record in Progress object");
|
|
865
|
+
export const TableItem_TreasuryHistorySchema = ObjectBaseSchema.extend({
|
|
866
|
+
payment: NameOrAddressSchema.describe("Payment object ID"),
|
|
867
|
+
op: TreasuryOpSchema.describe("Operation type"),
|
|
868
|
+
signer: z.string().describe("Operator ID"),
|
|
869
|
+
external_guard: z.union([z.string(), z.null()]).describe("Guard object ID verified during operation (none if operated through Permission)"),
|
|
870
|
+
amount: BalanceTypeSchema.describe("Payment amount"),
|
|
871
|
+
time: z.number().describe("Payment time (Unix timestamp)"),
|
|
872
|
+
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."),
|
|
873
|
+
}).describe("Payment record in Treasury object");
|
|
874
|
+
export const ObjectsQuerySchema = QueryEnvSchema.extend({
|
|
875
|
+
objects: z.array(NameOrAddressSchema).describe("List of object IDs to query"),
|
|
876
|
+
}).describe("Request parameters for querying objects");
|
|
877
|
+
export const ObjectUnionSchema = z.union([
|
|
878
|
+
ObjectTreasurySchema,
|
|
879
|
+
ObjectPermissionSchema,
|
|
880
|
+
ObjectMachineSchema,
|
|
881
|
+
ObjectServiceSchema,
|
|
882
|
+
ObjectOrderSchema,
|
|
883
|
+
ObjectProgressSchema,
|
|
884
|
+
ObjectDemandSchema,
|
|
885
|
+
ObjectArbitrationSchema,
|
|
886
|
+
ObjectAllocationSchema,
|
|
887
|
+
ObjectRewardSchema,
|
|
888
|
+
ObjectRepositorySchema,
|
|
889
|
+
ObjectGuardSchema,
|
|
890
|
+
ObjectPaymentSchema,
|
|
891
|
+
ObjectPassportSchema,
|
|
892
|
+
ObjectEntityRegistrarSchema,
|
|
893
|
+
ObjectEntityLinkerSchema,
|
|
894
|
+
ObjectResourceSchema,
|
|
895
|
+
ObjectArbSchema,
|
|
896
|
+
ObjectDiscountSchema,
|
|
897
|
+
ObjectContactSchema,
|
|
898
|
+
ObjectPersonalSchema,
|
|
899
|
+
ObjectBaseSchema,
|
|
900
|
+
ObjectProofSchema,
|
|
901
|
+
]).describe("Union of all wowok on-chain object types");
|
|
902
|
+
export const ObjectsAnswerSchema = z.object({
|
|
903
|
+
objects: z.array(ObjectUnionSchema).optional().describe("List of queried objects"),
|
|
904
|
+
}).describe("Response for querying objects");
|
|
905
|
+
export const PersonalQuerySchema = QueryEnvSchema.extend({
|
|
906
|
+
account: NameOrAddressSchema.optional().describe("Account name or ID to query. Use empty string '' for the default account. "),
|
|
907
|
+
}).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.");
|
|
908
|
+
export const TableQuerySchema = QueryEnvSchema.extend({
|
|
909
|
+
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
910
|
+
cursor: z.union([z.string(), z.null()]).optional().describe("Pagination cursor"),
|
|
911
|
+
limit: z.union([z.number(), z.null()]).optional().describe("Number of records returned per page"),
|
|
912
|
+
}).describe("Request parameters for querying object's data table");
|
|
913
|
+
export const TableAnswerItemSchema = z.object({
|
|
914
|
+
key: z.object({
|
|
915
|
+
type: z.string().describe("Key type"),
|
|
916
|
+
value: z.union([z.string(), z.number()]).describe("Key value"),
|
|
917
|
+
}).describe("Query key and its type"),
|
|
918
|
+
type: z.string().describe("Table item object type"),
|
|
919
|
+
object: z.string().describe("Table item object ID"),
|
|
920
|
+
version: z.union([z.string(), z.number()]).describe("Table item object version"),
|
|
921
|
+
}).describe("Result item of object's data table query");
|
|
922
|
+
export const TableAnswerSchema = z.object({
|
|
923
|
+
items: z.array(TableAnswerItemSchema),
|
|
924
|
+
nextCursor: z.union([z.string(), z.null()]),
|
|
925
|
+
hasNextPage: z.boolean(),
|
|
926
|
+
cache_expire: z.union([z.string(), z.number()]).optional(),
|
|
927
|
+
});
|
|
928
|
+
export const QueryTableItem_byAddressSchema = QueryEnvSchema.extend({
|
|
929
|
+
parent: z.string().describe("Parent object ID of the data table to query"),
|
|
930
|
+
address: z.union([AccountOrMark_AddressSchema, z.string()]).describe("ID of the record to query"),
|
|
931
|
+
}).describe("Request parameters for querying records by ID in object's data table");
|
|
932
|
+
export const QueryTableItem_byU64Schema = QueryEnvSchema.extend({
|
|
933
|
+
parent: z.string().describe("Parent object ID of the data table to query"),
|
|
934
|
+
u64: z.union([z.number(), z.string()]).describe("U64 value of the record to query"),
|
|
935
|
+
}).describe("Request parameters for querying records by U64 in object's data table");
|
|
936
|
+
export const QueryTableItem_byStringSchema = QueryEnvSchema.extend({
|
|
937
|
+
parent: z.string().describe("Parent object ID of the data table to query"),
|
|
938
|
+
key: z.string().describe("String key of the record to query"),
|
|
939
|
+
}).describe("Request parameters for querying records by string key in object's data table");
|
|
940
|
+
export const QueryTableItem_byNameAddressSchema = QueryEnvSchema.extend({
|
|
941
|
+
parent: z.string().describe("Parent object ID of the data table to query"),
|
|
942
|
+
name: z.string().describe("Name of the record to query"),
|
|
943
|
+
entity: z.union([AccountOrMark_AddressSchema, z.number()]).describe("ID of the record to query"),
|
|
944
|
+
}).describe("Request parameters for querying records by name and ID in object's data table");
|
|
945
|
+
export const QueryTableItem_Registrar_EntitySchema = QueryEnvSchema.extend({
|
|
946
|
+
address: z.union([AccountOrMark_AddressSchema, z.string()]).describe("ID of the record to query"),
|
|
947
|
+
}).describe("Request parameters for querying records by ID in Registrar object's data table");
|
|
948
|
+
export const EventTypeSchema = z.union([
|
|
949
|
+
z.literal("ArbEvent"),
|
|
950
|
+
z.literal("NewOrderEvent"),
|
|
951
|
+
z.literal("ProgressEvent"),
|
|
952
|
+
z.literal("DemandPresentEvent"),
|
|
953
|
+
z.literal("DemandFeedbackEvent"),
|
|
954
|
+
z.literal("NewEntityEvent"),
|
|
955
|
+
]).describe("Event type");
|
|
956
|
+
export const EventCursorSchema = z.object({
|
|
957
|
+
eventSeq: z.string().describe("Event sequence number"),
|
|
958
|
+
txDigest: z.string().describe("Transaction digest"),
|
|
959
|
+
}).describe("Event cursor");
|
|
960
|
+
export const EventBaseSchema = z.object({
|
|
961
|
+
id: EventCursorSchema,
|
|
962
|
+
sender: z.string().describe("Event sender ID"),
|
|
963
|
+
type: z.union([
|
|
964
|
+
z.string(),
|
|
965
|
+
z.literal("ArbEvent"),
|
|
966
|
+
z.literal("NewOrderEvent"),
|
|
967
|
+
z.literal("ProgressEvent"),
|
|
968
|
+
z.literal("DemandPresentEvent"),
|
|
969
|
+
z.literal("DemandFeedbackEvent"),
|
|
970
|
+
z.literal("NewEntityEvent"),
|
|
971
|
+
]).describe("Event type"),
|
|
972
|
+
type_raw: z.string().describe("Raw event type"),
|
|
973
|
+
time: z.string().describe("Event occurrence time"),
|
|
974
|
+
}).describe("Event base information");
|
|
975
|
+
export const ArbEventSchema = EventBaseSchema.extend({
|
|
976
|
+
arb: z.string().describe("Arbitration object ID"),
|
|
977
|
+
arbitration: z.string().describe("Arbitration object ID"),
|
|
978
|
+
order: z.string().describe("Order object ID"),
|
|
979
|
+
status: ArbStatusSchema,
|
|
980
|
+
}).describe("Arbitration event");
|
|
981
|
+
export const NewOrderEventSchema = EventBaseSchema.extend({
|
|
982
|
+
order: z.string().describe("Order object ID"),
|
|
983
|
+
service: z.string().describe("Service object ID"),
|
|
984
|
+
progress: z.union([z.string(), z.null()]).optional().describe("Progress object ID"),
|
|
985
|
+
discount: z.union([z.string(), z.null()]).optional().describe("Discount object ID"),
|
|
986
|
+
allocation: z.union([z.string(), z.null()]).optional().describe("Allocation object ID"),
|
|
987
|
+
amount: BalanceTypeSchema,
|
|
988
|
+
}).describe("New order event");
|
|
989
|
+
export const ProgressEventSchema = EventBaseSchema.extend({
|
|
990
|
+
progress: z.string().describe("Progress object ID"),
|
|
991
|
+
machine: z.string().describe("Machine object ID"),
|
|
992
|
+
task: z.union([z.string(), z.null()]).optional().describe("Task object ID"),
|
|
993
|
+
node: z.string().describe("Current node name"),
|
|
994
|
+
forward: z.union([z.string(), z.null()]).optional().describe("Forward operation name"),
|
|
995
|
+
hold: z.union([z.boolean(), z.null()]).optional().describe("Whether it is a hold operation"),
|
|
996
|
+
}).describe("Progress event");
|
|
997
|
+
export const DemandPresentEventSchema = EventBaseSchema.extend({
|
|
998
|
+
demand: z.string().describe("Demand object ID"),
|
|
999
|
+
service: z.union([z.string(), z.null()]).optional().describe("Service object ID"),
|
|
1000
|
+
recommend: z.string().describe("Recommendation letter"),
|
|
1001
|
+
}).describe("Event of recommending service to Demand object");
|
|
1002
|
+
export const DemandFeedbackEventSchema = EventBaseSchema.extend({
|
|
1003
|
+
demand: z.string().describe("Demand object ID"),
|
|
1004
|
+
service: z.union([z.string(), z.null()]).optional().describe("Service object ID"),
|
|
1005
|
+
feedback: z.string().describe("Feedback content"),
|
|
1006
|
+
acceptance_score: z.union([z.number(), z.null()]).optional().describe("Acceptance score"),
|
|
1007
|
+
}).describe("Event of Demand object feedback to referrer");
|
|
1008
|
+
export const NewEntityEventSchema = EventBaseSchema.extend({
|
|
1009
|
+
address: z.string().describe("User ID"),
|
|
1010
|
+
resource: z.string().describe("ID mark object ID owned by user"),
|
|
1011
|
+
referrer: z.union([z.string(), z.null()]).optional().describe("Referrer ID"),
|
|
1012
|
+
}).describe("New user event");
|
|
1013
|
+
export const EventAnswerSchema = z.object({
|
|
1014
|
+
data: z.array(z.union([
|
|
1015
|
+
EventBaseSchema,
|
|
1016
|
+
ArbEventSchema,
|
|
1017
|
+
NewOrderEventSchema,
|
|
1018
|
+
ProgressEventSchema,
|
|
1019
|
+
DemandPresentEventSchema,
|
|
1020
|
+
DemandFeedbackEventSchema,
|
|
1021
|
+
NewEntityEventSchema,
|
|
1022
|
+
])).describe("Event object data"),
|
|
1023
|
+
hasNextPage: z.boolean().describe("Whether there is a next page"),
|
|
1024
|
+
nextCursor: z.union([EventCursorSchema, z.null()]).optional().describe("Next page cursor"),
|
|
1025
|
+
cache_expire: z.union([z.number(), z.literal("INFINITE")]).optional().describe("Cache expiration time"),
|
|
1026
|
+
}).describe("Event query result");
|
|
1027
|
+
export const EventQuerySchema = QueryEnvSchema.extend({
|
|
1028
|
+
type: EventTypeSchema.describe("Event type"),
|
|
1029
|
+
cursor: z.union([EventCursorSchema, z.null()]).optional().describe("Event cursor"),
|
|
1030
|
+
limit: z.union([z.number(), z.null()]).optional().describe("Query count limit"),
|
|
1031
|
+
order: z.union([z.literal("ascending"), z.literal("descending"), z.null()]).optional().describe("Sort order"),
|
|
1032
|
+
}).describe("Event query parameters");
|
|
1033
|
+
export const OnchainEventsInputSchema = z.object({
|
|
1034
|
+
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)"),
|
|
1035
|
+
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"),
|
|
1036
|
+
limit: z.union([z.number(), z.null()]).optional().describe("Maximum number of events to return per query. Use null for default limit"),
|
|
1037
|
+
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"),
|
|
1038
|
+
no_cache: z.boolean().optional().describe("Whether to bypass cache and fetch fresh data from the blockchain"),
|
|
1039
|
+
network: EntrypointSchema.optional().describe("Network to query: 'mainnet' or 'testnet'. Uses default network if not specified"),
|
|
1040
|
+
}).describe("Input parameters for querying on-chain WOWOK events");
|
|
1041
|
+
export const OnchainEventsResultSchema = z.object({
|
|
1042
|
+
result: z.union([EventAnswerSchema, z.null()]).describe("Event query result containing list of events and pagination info, or null if no data found"),
|
|
1043
|
+
}).describe("Result of on-chain events query");
|
|
1044
|
+
export const TableItem_RepositoryDataOrUndefinedSchema = z.union([TableItem_RepositoryDataSchema, z.null()]).describe("Repository data item or null");
|
|
1045
|
+
export const TableItem_PermissionPermOrUndefinedSchema = z.union([TableItem_PermissionPermSchema, z.null()]).describe("Permission permission item or null");
|
|
1046
|
+
export const TableItem_EntityRegistrarOrUndefinedSchema = z.union([TableItem_EntityRegistrarSchema, z.null()]).describe("Entity registrar item or null");
|
|
1047
|
+
export const TableItem_EntityLinkerOrUndefinedSchema = z.union([TableItem_EntityLinkerSchema, z.null()]).describe("Entity linker item or null");
|
|
1048
|
+
export const TableItem_RewardRecordOrUndefinedSchema = z.union([TableItem_RewardRecordSchema, z.null()]).describe("Reward record item or null");
|
|
1049
|
+
export const TableItem_DemandPresenterOrUndefinedSchema = z.union([TableItem_DemandPresenterSchema, z.null()]).describe("Demand presenter item or null");
|
|
1050
|
+
export const TableItem_TreasuryHistoryOrUndefinedSchema = z.union([TableItem_TreasuryHistorySchema, z.null()]).describe("Treasury history item or null");
|
|
1051
|
+
export const TableItem_MachineNodeOrUndefinedSchema = z.union([TableItem_MachineNodeSchema, z.null()]).describe("Machine node item or null");
|
|
1052
|
+
export const TableItem_ProgressHistoryOrUndefinedSchema = z.union([TableItem_ProgressHistorySchema, z.null()]).describe("Progress history item or null");
|
|
1053
|
+
export const TableItem_AddressMarkOrUndefinedSchema = z.union([TableItem_AddressMarkSchema, z.null()]).describe("Address mark item or null");
|
|
1054
|
+
export const ObjectPersonalOrUndefinedSchema = z.object({
|
|
1055
|
+
result: z.union([ObjectPersonalSchema, z.null()]).describe("Personal object or null")
|
|
1056
|
+
}).describe("Personal object or null");
|
|
1057
|
+
export const TokenTypeInfoOrUndefinedSchema = z.object({
|
|
1058
|
+
result: z.union([TokenTypeInfoSchema, z.null()]).describe("Token type info or null")
|
|
1059
|
+
}).describe("Token type info or null");
|
|
1060
|
+
export const EventAnswerOrUndefinedSchema = z.object({
|
|
1061
|
+
result: z.union([EventAnswerSchema, z.null()]).describe("Event answer or null")
|
|
1062
|
+
}).describe("Event answer or null");
|
|
1063
|
+
export const TableAnswerOrUndefinedSchema = z.object({
|
|
1064
|
+
result: z.union([TableAnswerSchema, z.null()]).describe("Table answer or null")
|
|
1065
|
+
}).describe("Table answer or null");
|
|
1066
|
+
export const QueryTableItemSchema = z.discriminatedUnion("type", [
|
|
1067
|
+
z.object({
|
|
1068
|
+
type: z.literal("RepositoryData"),
|
|
1069
|
+
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1070
|
+
name: z.string().describe("Name of the record to query"),
|
|
1071
|
+
entity: z.union([AccountOrMark_AddressSchema, z.number()]).describe("ID or address of the entity; or address that number is casted to"),
|
|
1072
|
+
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1073
|
+
network: EntrypointSchema.optional(),
|
|
1074
|
+
}).describe("Request parameters for querying repository data table item"),
|
|
1075
|
+
z.object({
|
|
1076
|
+
type: z.literal("PermissionPerm"),
|
|
1077
|
+
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1078
|
+
address: z.union([AccountOrMark_AddressSchema, z.string()]).describe("User ID or address, or Guard ID in the permission perm table"),
|
|
1079
|
+
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1080
|
+
network: EntrypointSchema.optional(),
|
|
1081
|
+
}).describe("Request parameters for querying permission perm table item"),
|
|
1082
|
+
z.object({
|
|
1083
|
+
type: z.literal("EntityRegistrar"),
|
|
1084
|
+
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1085
|
+
address: AccountOrMark_AddressSchema.describe("User ID or address of the entity"),
|
|
1086
|
+
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1087
|
+
network: EntrypointSchema.optional(),
|
|
1088
|
+
}).describe("Request parameters for querying entity registrar table item"),
|
|
1089
|
+
z.object({
|
|
1090
|
+
type: z.literal("EntityLinker"),
|
|
1091
|
+
address: z.union([AccountOrMark_AddressSchema, z.string()]).describe("ID or address that the registrar votes are attached to"),
|
|
1092
|
+
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1093
|
+
network: EntrypointSchema.optional(),
|
|
1094
|
+
}).describe("Request parameters for querying entity linker table item"),
|
|
1095
|
+
z.object({
|
|
1096
|
+
type: z.literal("RewardRecord"),
|
|
1097
|
+
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1098
|
+
address: AccountOrMark_AddressSchema.describe("User ID or address that claims the reward"),
|
|
1099
|
+
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1100
|
+
network: EntrypointSchema.optional(),
|
|
1101
|
+
}).describe("Request parameters for querying reward record table item"),
|
|
1102
|
+
z.object({
|
|
1103
|
+
type: z.literal("DemandPresenter"),
|
|
1104
|
+
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1105
|
+
address: AccountOrMark_AddressSchema.describe("User ID or address of the Demand presenter"),
|
|
1106
|
+
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1107
|
+
network: EntrypointSchema.optional(),
|
|
1108
|
+
}).describe("Request parameters for querying demand presenter table item"),
|
|
1109
|
+
z.object({
|
|
1110
|
+
type: z.literal("TreasuryRecord"),
|
|
1111
|
+
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1112
|
+
address: AccountOrMark_AddressSchema.describe("ID of the payment that the treasury record is attached to"),
|
|
1113
|
+
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1114
|
+
network: EntrypointSchema.optional(),
|
|
1115
|
+
}).describe("Request parameters for querying treasury record table item"),
|
|
1116
|
+
z.object({
|
|
1117
|
+
type: z.literal("MachineNode"),
|
|
1118
|
+
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1119
|
+
key: z.string().describe("String key of the node name to query"),
|
|
1120
|
+
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1121
|
+
network: EntrypointSchema.optional(),
|
|
1122
|
+
}).describe("Request parameters for querying machine node table item"),
|
|
1123
|
+
z.object({
|
|
1124
|
+
type: z.literal("ProgressHistory"),
|
|
1125
|
+
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1126
|
+
u64: z.union([z.number(), z.string()]).describe("U64 value of the record to query"),
|
|
1127
|
+
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1128
|
+
network: EntrypointSchema.optional(),
|
|
1129
|
+
}).describe("Request parameters for querying progress history table item"),
|
|
1130
|
+
z.object({
|
|
1131
|
+
type: z.literal("AddressMark"),
|
|
1132
|
+
parent: NameOrAddressSchema.describe("Parent object ID of the data table to query"),
|
|
1133
|
+
address: AccountOrMark_AddressSchema.describe("ID or address that the mark name and tags are attached to"),
|
|
1134
|
+
no_cache: z.boolean().optional().describe("Whether to disable cache"),
|
|
1135
|
+
network: EntrypointSchema.optional(),
|
|
1136
|
+
}).describe("Request parameters for querying address mark table item"),
|
|
1137
|
+
]).describe("Request parameters for querying table items");
|
|
1138
|
+
export const TableItemUnionOrUndefinedSchema = z.object({
|
|
1139
|
+
result: z.union([
|
|
1140
|
+
TableItem_RepositoryDataSchema,
|
|
1141
|
+
TableItem_PermissionPermSchema,
|
|
1142
|
+
TableItem_EntityRegistrarSchema,
|
|
1143
|
+
TableItem_EntityLinkerSchema,
|
|
1144
|
+
TableItem_RewardRecordSchema,
|
|
1145
|
+
TableItem_DemandPresenterSchema,
|
|
1146
|
+
TableItem_TreasuryHistorySchema,
|
|
1147
|
+
TableItem_MachineNodeSchema,
|
|
1148
|
+
TableItem_ProgressHistorySchema,
|
|
1149
|
+
TableItem_AddressMarkSchema,
|
|
1150
|
+
z.null()
|
|
1151
|
+
]).describe("Table item or null")
|
|
1152
|
+
}).describe("Table item or null");
|
|
1153
|
+
export const ConstantItemSchema = z.object({
|
|
1154
|
+
name: z.string().describe('Name'),
|
|
1155
|
+
value: z.union([z.string(), z.number()]).describe('Value'),
|
|
1156
|
+
description: z.string().describe('Description')
|
|
1157
|
+
}).describe('Constant item');
|
|
1158
|
+
export const PermissionInfoTypeSchema = z.object({
|
|
1159
|
+
index: z.number().describe('Permission index'),
|
|
1160
|
+
name: z.string().describe('Name'),
|
|
1161
|
+
description: z.string().describe('Description'),
|
|
1162
|
+
object_type: z.string().describe('Object type')
|
|
1163
|
+
}).describe('Permission info type');
|
|
1164
|
+
export const GuardInstructSchema = z.object({
|
|
1165
|
+
name: z.string().describe('Name of the guard instruction'),
|
|
1166
|
+
id: z.number().int().describe('ID of the guard instruction (OperatorType or ContextType)'),
|
|
1167
|
+
description: z.string().describe('Description of the guard instruction'),
|
|
1168
|
+
returnType: z.optional(ValueTypeSchema).describe('Return type of the guard instruction')
|
|
1169
|
+
}).describe('Guard instruction info');
|
|
1170
|
+
export const GuardItemSchema = z.object({
|
|
1171
|
+
name: z.string().describe('Name of the guard instruction or query'),
|
|
1172
|
+
id: z.union([z.number().int(), QueryIdSchema]).describe('ID of the guard instruction or query'),
|
|
1173
|
+
description: z.string().describe('Description'),
|
|
1174
|
+
returnType: z.optional(ValueTypeSchema).describe('Return type for guard instruction'),
|
|
1175
|
+
objectType: z.optional(ObjectTypeSchema).describe('Object type for guard query'),
|
|
1176
|
+
parameters: z.optional(z.array(ValueTypeSchema)).describe('Parameters for guard query'),
|
|
1177
|
+
return: z.optional(ValueTypeSchema).describe('Return type for guard query'),
|
|
1178
|
+
parameters_description: z.optional(z.array(z.string())).describe('Parameter descriptions for guard query'),
|
|
1179
|
+
}).describe('Guard item - either a guard instruction or a guard query');
|
|
1180
|
+
export const GuardInstructFilterOptionsSchema = z.object({
|
|
1181
|
+
name: z.optional(z.string()).describe('Name filter (case-insensitive partial match)'),
|
|
1182
|
+
id: z.optional(z.array(z.number().int())).describe('ID array filter (OperatorType | ContextType | number)'),
|
|
1183
|
+
returnType: z.optional(ValueTypeSchema).describe('Return type filter'),
|
|
1184
|
+
paramCount: z.optional(z.number().int()).describe('Parameter count filter'),
|
|
1185
|
+
scope: z.optional(z.enum(['instruct', 'object query', 'all'])).describe('Scope filter: instruct, object query, or all').default("all"),
|
|
1186
|
+
objectType: z.optional(ObjectTypeSchema).describe('Object type filter (only for object query scope)')
|
|
1187
|
+
}).describe('Guard instruction filter options');
|
|
1188
|
+
export const PermissionFilterSchema = z.object({
|
|
1189
|
+
objectType: z.optional(ObjectTypeSchema).describe('Object type filter'),
|
|
1190
|
+
name: z.optional(z.string()).describe('Name filter'),
|
|
1191
|
+
index: z.optional(PermissionIndexTypeSchema).describe('Index filter'),
|
|
1192
|
+
description: z.optional(z.string()).describe('Description filter')
|
|
1193
|
+
}).describe('Permission filter');
|
|
1194
|
+
export const ProtocolInfoQuerySchema = z.discriminatedUnion('info', [
|
|
1195
|
+
z.object({
|
|
1196
|
+
info: z.literal('constants')
|
|
1197
|
+
}).describe('Constants query'),
|
|
1198
|
+
z.object({
|
|
1199
|
+
info: z.literal('built-in permissions'),
|
|
1200
|
+
filter: z.optional(PermissionFilterSchema).describe('Filter for built-in permissions')
|
|
1201
|
+
}).describe('Built-in permissions query'),
|
|
1202
|
+
z.object({
|
|
1203
|
+
info: z.literal('guard instructions'),
|
|
1204
|
+
filter: z.optional(GuardInstructFilterOptionsSchema).describe('Filter for guard instructions')
|
|
1205
|
+
}).describe('Guard instructions and wowok object queries'),
|
|
1206
|
+
z.object({
|
|
1207
|
+
info: z.literal('current network')
|
|
1208
|
+
}).describe('Current network entrypoint'),
|
|
1209
|
+
z.object({
|
|
1210
|
+
info: z.literal('value types')
|
|
1211
|
+
}).describe('Value types query - returns all supported value types with their numeric and string representations')
|
|
1212
|
+
]).describe('WoWok Build-in infomation query');
|
|
1213
|
+
export const BuiltinPermissionSchema = z.object({
|
|
1214
|
+
result: z.array(PermissionInfoTypeSchema).describe('Built-in permissions result')
|
|
1215
|
+
}).describe('Built-in permissions query result');
|
|
1216
|
+
export const ProtocolInfoResultWrappedSchema = z.discriminatedUnion('info', [
|
|
1217
|
+
z.object({
|
|
1218
|
+
info: z.literal('constants'),
|
|
1219
|
+
result: z.array(ConstantItemSchema).describe('Constants result')
|
|
1220
|
+
}),
|
|
1221
|
+
z.object({
|
|
1222
|
+
info: z.literal('built-in permissions'),
|
|
1223
|
+
result: z.array(PermissionInfoTypeSchema).describe('Built-in permissions result')
|
|
1224
|
+
}),
|
|
1225
|
+
z.object({
|
|
1226
|
+
info: z.literal('guard instructions'),
|
|
1227
|
+
result: z.array(GuardItemSchema).describe('Guard instructions result')
|
|
1228
|
+
}),
|
|
1229
|
+
z.object({
|
|
1230
|
+
info: z.literal('current network'),
|
|
1231
|
+
result: EntrypointSchema.describe('Current network entrypoint')
|
|
1232
|
+
}),
|
|
1233
|
+
z.object({
|
|
1234
|
+
info: z.literal('value types'),
|
|
1235
|
+
result: z.array(ConstantItemSchema).describe('Value types result - each item contains name (string), value (string), and description showing the numeric mapping')
|
|
1236
|
+
})
|
|
1237
|
+
]).describe('Protocol info result');
|
|
1238
|
+
export const ProtocolInfoResultSchema = z.object({
|
|
1239
|
+
result: ProtocolInfoResultWrappedSchema
|
|
1240
|
+
}).describe('Protocol info result');
|
|
1241
|
+
export const LocalQueryResultSchema = z.union([
|
|
1242
|
+
z.object({
|
|
1243
|
+
query_type: z.literal("local_mark_list"),
|
|
1244
|
+
result: QueryLocalMarkListResultSchema.shape.result,
|
|
1245
|
+
}),
|
|
1246
|
+
z.object({
|
|
1247
|
+
query_type: z.literal("account_list"),
|
|
1248
|
+
result: QueryAccountListResultSchema.shape.result,
|
|
1249
|
+
}),
|
|
1250
|
+
z.object({
|
|
1251
|
+
query_type: z.literal("local_info_list"),
|
|
1252
|
+
result: QueryLocalInfoListResultSchema.shape.result,
|
|
1253
|
+
}),
|
|
1254
|
+
z.object({
|
|
1255
|
+
query_type: z.literal("token_list"),
|
|
1256
|
+
result: QueryLocalTokenListResultSchema.shape.result,
|
|
1257
|
+
}),
|
|
1258
|
+
z.object({
|
|
1259
|
+
query_type: z.literal("account_balance"),
|
|
1260
|
+
result: QueryAccountResultSchema,
|
|
1261
|
+
}),
|
|
1262
|
+
]);
|
|
1263
|
+
export const WatchQueryOperationsResultSchema = z.object({
|
|
1264
|
+
result: z.any()
|
|
1265
|
+
}).describe("Watch query operations result schema (using any to avoid TypeScript inference limits)");
|