@wowok/agent-mcp 3.2.9 → 3.3.1

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.
Files changed (207) hide show
  1. package/README.md +2 -2
  2. package/dist/chain-semantics/field-capability.js +1 -1
  3. package/dist/chain-semantics/freeze-map.js +1 -1
  4. package/dist/chain-semantics/fund-flow.js +1 -1
  5. package/dist/chain-semantics/object-graph.js +1 -1
  6. package/dist/composition/audit.js +1 -1
  7. package/dist/composition/compile.d.ts +10 -1
  8. package/dist/composition/compile.js +1 -1
  9. package/dist/composition/inflight.js +1 -1
  10. package/dist/extensions/capability-manifest.js +1 -1
  11. package/dist/extensions/industry-audit.spec.js +1 -1
  12. package/dist/extensions/industry-pack.js +1 -1
  13. package/dist/graph/onchain/facts.spec.js +1 -1
  14. package/dist/graph/onchain/field-manifest.js +1 -1
  15. package/dist/harness/recover.js +1 -1
  16. package/dist/intent/types.d.ts +1 -1
  17. package/dist/intent/types.js +1 -1
  18. package/dist/keeper/KeeperScan.d.ts +2 -1
  19. package/dist/keeper/KeeperScan.js +1 -1
  20. package/dist/keeper/keeper.spec.js +1 -1
  21. package/dist/keeper/types.d.ts +3 -0
  22. package/dist/keeper/types.js +1 -1
  23. package/dist/knowledge/allocator-rail-verifier.d.ts +34 -0
  24. package/dist/knowledge/allocator-rail-verifier.js +1 -0
  25. package/dist/knowledge/arbitration-ledger.js +1 -1
  26. package/dist/knowledge/arbitration-templates.js +1 -1
  27. package/dist/knowledge/arbitration-venue-order.js +1 -1
  28. package/dist/knowledge/audit-rules.d.ts +19 -1
  29. package/dist/knowledge/audit-rules.js +1 -1
  30. package/dist/knowledge/baselines/rules/alloc_audit.json +1 -1
  31. package/dist/knowledge/baselines/rules/arb.json +1 -1
  32. package/dist/knowledge/baselines/rules/guard.json +15 -5
  33. package/dist/knowledge/baselines/rules/machine.json +9 -6
  34. package/dist/knowledge/baselines/rules/plan.json +12 -12
  35. package/dist/knowledge/baselines/semantic-facts.js +1 -1
  36. package/dist/knowledge/builtin-templates.d.ts +1 -1
  37. package/dist/knowledge/builtin-templates.js +1 -1
  38. package/dist/knowledge/contract-invariants.js +1 -1
  39. package/dist/knowledge/event-semantics.js +1 -1
  40. package/dist/knowledge/fund-layer.js +1 -1
  41. package/dist/knowledge/getting-started.js +1 -1
  42. package/dist/knowledge/guard-anchor-reach.d.ts +1 -1
  43. package/dist/knowledge/guard-anchor-reach.js +1 -1
  44. package/dist/knowledge/guard-bindings.js +1 -1
  45. package/dist/knowledge/guard-design-patterns.d.ts +1 -1
  46. package/dist/knowledge/guard-design-patterns.js +1 -1
  47. package/dist/knowledge/guard-field-cognition.js +1 -1
  48. package/dist/knowledge/guard-render.js +1 -1
  49. package/dist/knowledge/guard-risk.js +1 -1
  50. package/dist/knowledge/guard-templates.d.ts +1 -1
  51. package/dist/knowledge/guard-templates.js +1 -1
  52. package/dist/knowledge/index.js +1 -1
  53. package/dist/knowledge/industry-registry.js +1 -1
  54. package/dist/knowledge/industry-strategy.js +1 -1
  55. package/dist/knowledge/jsonrpc-enum.js +1 -1
  56. package/dist/knowledge/machine-ledger.js +1 -1
  57. package/dist/knowledge/machine-puzzle.d.ts +1 -1
  58. package/dist/knowledge/machine-puzzle.js +1 -1
  59. package/dist/knowledge/machine-risk.js +1 -1
  60. package/dist/knowledge/machine-templates.js +1 -1
  61. package/dist/knowledge/machine-topology.d.ts +8 -0
  62. package/dist/knowledge/machine-topology.js +1 -1
  63. package/dist/knowledge/machine-translation.js +1 -1
  64. package/dist/knowledge/permission-ledger.js +1 -1
  65. package/dist/knowledge/protocol-facts.d.ts +16 -0
  66. package/dist/knowledge/protocol-facts.js +1 -0
  67. package/dist/knowledge/recipient-constraint.js +1 -1
  68. package/dist/knowledge/reward-ledger.d.ts +2 -1
  69. package/dist/knowledge/reward-ledger.js +1 -1
  70. package/dist/knowledge/reward-templates.js +1 -1
  71. package/dist/knowledge/safety-rules.d.ts +0 -2
  72. package/dist/knowledge/safety-rules.js +1 -1
  73. package/dist/knowledge/scenario-modes.d.ts +7 -0
  74. package/dist/knowledge/scenario-modes.js +1 -1
  75. package/dist/knowledge/strategy-manuals.js +1 -1
  76. package/dist/knowledge/template-loader.d.ts +13 -1
  77. package/dist/knowledge/template-loader.js +1 -1
  78. package/dist/knowledge/template-registry.js +1 -1
  79. package/dist/knowledge/template-scanner.js +1 -1
  80. package/dist/knowledge/tool-constraints.js +1 -1
  81. package/dist/knowledge/tools-reference.js +1 -1
  82. package/dist/monitor/MonitorLoop.js +1 -1
  83. package/dist/monitor/normalize.d.ts +1 -1
  84. package/dist/monitor/normalize.js +1 -1
  85. package/dist/monitor/types.d.ts +1 -1
  86. package/dist/monitor/types.js +1 -1
  87. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  88. package/dist/playbooks/service-build/game-theory.d.ts +1 -0
  89. package/dist/playbooks/service-build/game-theory.js +1 -1
  90. package/dist/playbooks/service-build/intent-analyzer.js +1 -1
  91. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  92. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  93. package/dist/playbooks/service-build/object-panorama.js +1 -1
  94. package/dist/playbooks/service-build/participation-radar.js +1 -1
  95. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  96. package/dist/playbooks/service-build/service-panorama.js +1 -1
  97. package/dist/playbooks/service-build/service-quote.js +1 -1
  98. package/dist/playbooks/service-build/service-quote.spec.js +1 -1
  99. package/dist/relationship/registry.js +1 -1
  100. package/dist/review/index.js +1 -1
  101. package/dist/role/profiles.js +1 -1
  102. package/dist/rules.js +1 -1
  103. package/dist/safety/confirm-gate.js +1 -1
  104. package/dist/schema/benchmark-migration/index.d.ts +5 -1
  105. package/dist/schema/benchmark-migration/index.js +1 -1
  106. package/dist/schema/call/arbitration.d.ts +4 -4
  107. package/dist/schema/call/arbitration.js +1 -1
  108. package/dist/schema/call/base.d.ts +39 -0
  109. package/dist/schema/call/base.js +1 -1
  110. package/dist/schema/call/bridge.d.ts +1 -0
  111. package/dist/schema/call/contact.d.ts +4 -4
  112. package/dist/schema/call/demand.d.ts +4 -4
  113. package/dist/schema/call/error-codes.d.ts +1 -1
  114. package/dist/schema/call/error-codes.js +1 -1
  115. package/dist/schema/call/handler.js +1 -1
  116. package/dist/schema/call/machine.d.ts +12 -4
  117. package/dist/schema/call/order.d.ts +4 -4
  118. package/dist/schema/call/permission.d.ts +4 -4
  119. package/dist/schema/call/progress.d.ts +4 -4
  120. package/dist/schema/call/receipt.d.ts +8 -0
  121. package/dist/schema/call/receipt.js +1 -1
  122. package/dist/schema/call/repository.d.ts +4 -4
  123. package/dist/schema/call/reward.d.ts +24 -4
  124. package/dist/schema/call/reward.js +1 -1
  125. package/dist/schema/call/semantic.js +1 -1
  126. package/dist/schema/call/service.d.ts +6 -4
  127. package/dist/schema/call/service.js +1 -1
  128. package/dist/schema/call/treasury.d.ts +4 -4
  129. package/dist/schema/common/index.d.ts +2 -2
  130. package/dist/schema/common/index.js +1 -1
  131. package/dist/schema/goal/index.d.ts +5 -1
  132. package/dist/schema/goal/planning.d.ts +10 -2
  133. package/dist/schema/goal/planning.js +1 -1
  134. package/dist/schema/industry-pack/index.d.ts +3 -0
  135. package/dist/schema/industry-pack/index.js +1 -1
  136. package/dist/schema/intent-radar/index.d.ts +9 -0
  137. package/dist/schema/intent-radar/index.js +1 -1
  138. package/dist/schema/local/index.d.ts +10 -0
  139. package/dist/schema/local/index.js +1 -1
  140. package/dist/schema/operations.d.ts +35 -22
  141. package/dist/schema/operations.js +1 -1
  142. package/dist/schema/query/bi.d.ts +16 -0
  143. package/dist/schema/query/bi.js +1 -1
  144. package/dist/schema/query/index.d.ts +52 -48
  145. package/dist/schema/query/index.js +1 -1
  146. package/dist/schema/schema-query/index.d.ts +1 -0
  147. package/dist/schema/schema-query/index.js +1 -1
  148. package/dist/schema/schema-version.js +1 -1
  149. package/dist/schema/workspace/index.d.ts +9 -0
  150. package/dist/schema/workspace/index.js +1 -1
  151. package/dist/schema-query-impl/index.d.ts +1 -1
  152. package/dist/schema-query-impl/index.js +1 -1
  153. package/dist/schemas/account_operation.output.json +1 -0
  154. package/dist/schemas/account_operation.schema.json +1 -1
  155. package/dist/schemas/benchmark_migration_operation.schema.json +27 -3
  156. package/dist/schemas/bridge_operation.output.json +1 -0
  157. package/dist/schemas/goal_operation.schema.json +26 -2
  158. package/dist/schemas/index.json +1 -1
  159. package/dist/schemas/industry_pack_operation.output.json +8 -0
  160. package/dist/schemas/industry_pack_operation.schema.json +9 -0
  161. package/dist/schemas/intent_radar.output.json +8 -2
  162. package/dist/schemas/intent_radar.schema.json +4 -1
  163. package/dist/schemas/local_cache_operation.output.json +1 -0
  164. package/dist/schemas/local_history_operation.output.json +1 -0
  165. package/dist/schemas/local_info_operation.output.json +1 -0
  166. package/dist/schemas/local_mark_operation.output.json +1 -0
  167. package/dist/schemas/monitor_events.schema.json +3 -1
  168. package/dist/schemas/onchain_events.output.json +275 -11
  169. package/dist/schemas/onchain_events.schema.json +25 -1
  170. package/dist/schemas/onchain_operations.output.json +40 -0
  171. package/dist/schemas/onchain_operations.schema.json +573 -104
  172. package/dist/schemas/onchain_operations_allocation.schema.json +2 -2
  173. package/dist/schemas/onchain_operations_arbitration.schema.json +11 -7
  174. package/dist/schemas/onchain_operations_contact.schema.json +9 -5
  175. package/dist/schemas/onchain_operations_demand.schema.json +9 -5
  176. package/dist/schemas/onchain_operations_guard.schema.json +342 -4
  177. package/dist/schemas/onchain_operations_machine.schema.json +17 -5
  178. package/dist/schemas/onchain_operations_order.schema.json +9 -5
  179. package/dist/schemas/onchain_operations_permission.schema.json +9 -5
  180. package/dist/schemas/onchain_operations_progress.schema.json +9 -5
  181. package/dist/schemas/onchain_operations_repository.schema.json +9 -5
  182. package/dist/schemas/onchain_operations_reward.schema.json +89 -9
  183. package/dist/schemas/onchain_operations_service.schema.json +18 -11
  184. package/dist/schemas/onchain_operations_treasury.schema.json +9 -5
  185. package/dist/schemas/query_toolkit.output.json +237 -14
  186. package/dist/schemas/schema_query.schema.json +3 -2
  187. package/dist/schemas/workspace_operation.output.json +23 -3
  188. package/dist/schemas/workspace_operation.schema.json +3 -3
  189. package/dist/tools/handlers/benchmark-migration.d.ts +45 -1
  190. package/dist/tools/handlers/benchmark-migration.js +1 -1
  191. package/dist/tools/handlers/config.js +1 -1
  192. package/dist/tools/handlers/industry-pack.js +1 -1
  193. package/dist/tools/handlers/intent-radar.js +1 -1
  194. package/dist/tools/handlers/keeper.d.ts +1 -1
  195. package/dist/tools/handlers/onchain.d.ts +12 -0
  196. package/dist/tools/handlers/onchain.js +1 -1
  197. package/dist/tools/handlers/schema-query.js +1 -1
  198. package/dist/tools/handlers/workflow.js +1 -1
  199. package/dist/tools/handlers/workspace.js +1 -1
  200. package/dist/tools/index.js +1 -1
  201. package/dist/tools/registry/agent.js +1 -1
  202. package/dist/tools/registry/business.js +1 -1
  203. package/dist/tools/registry/local.js +1 -1
  204. package/dist/tools/registry/query.js +1 -1
  205. package/dist/tools/rules-hook.js +1 -1
  206. package/dist/tools/wrap.js +1 -1
  207. package/package.json +2 -2
@@ -1 +1 @@
1
- import{ResponseData,LocalMark,enrichMoveError}from'@wowok/wowok';import{classifyError,normalizeErrorMessage,buildSemantic}from'./semantic.js';import{buildReceipt}from'./receipt.js';import{recover,resetAttempts}from'../../harness/recover.js';import{stableOperationId}from'../../harness/operation-id.js';import{verify,recordCoverageGap}from'../../harness/verify.js';function applySchemaWarning(a,b){const c=b?.['schema_check'];if(!c||c['warnings']['length']===0x0&&c['errors']['length']===0x0)return a;const d=[...c['warnings'],...c['errors']];let e=a['semantic'];e&&d['length']>0x0&&(e={...e,'warnings':[...e['warnings']||[],...d]});const f={'compatible':c['compatible'],'warnings':d,'client_version':c['client_version'],'server_versions':c['versions']};return{...a,'semantic':e,'schema_warning':f};}function convertBigInts(a){if(typeof a==='bigint')return a['toString']();if(Array['isArray'](a))return a['map'](convertBigInts);if(a instanceof Map){const b={};for(const [c,d]of a)b[String(c)]=convertBigInts(d);return b;}if(a instanceof Set)return Array['from'](a)['map'](convertBigInts);if(a&&typeof a==='object'){const e={};for(const f of Object['keys'](a))e[f]=convertBigInts(a[f]);return e;}return a;}function safeTextJson(a,b){try{return JSON['stringify'](a);}catch(c){return'WARNING:\x20the\x20operation\x20EXECUTED\x20on-chain\x20but\x20its\x20response\x20body\x20failed\x20to\x20serialize\x20'+('('+(c?.['message']??'unknown\x20serialization\x20error')+').\x20Do\x20NOT\x20retry\x20—\x20judge\x20the\x20')+'outcome\x20by\x20the\x20transaction\x20digest\x20instead:\x20query\x20it\x20or\x20re-read\x20the\x20target\x20object.\x20'+('digest:\x20'+(b??'n/a'));}}function recoveryOperationId(a){return a?.['operation_id']??stableOperationId(a?.['operation_type']??'call',a?.['data']);}function failureDiagnosis(a,b,c,d){return verify({'expected':a,'actual':{'result_type':b['kind'],'error_code':c,'error':d}});}function recordSuccessCoverageGap(a,b,c){const d=verify({'expected':a,'actual':{'result_type':'transaction','semantic':b}});recordCoverageGap(d,{'operation_type':c['operation_type']});}function buildSubmissionTemplate(a){const b=a,c=b?.['submission']??[];if(!Array['isArray'](c)||c['length']===0x0)return undefined;const d=Array['isArray'](b?.['guard'])&&b['guard']['length']>0x0?b['guard']:c['map'](f=>({'object':f['guard'],'impack':!![]})),e=c['map'](f=>({'guard':f['guard'],'submission':(Array['isArray'](f['submission'])?f['submission']:[])['map'](h=>{const i=h?.['value_type']??'Address',j=h?.['object_type']?String(h['object_type']):i;return{'identifier':h?.['identifier'],'name':h?.['name']??'','b_submission':!![],'value_type':i,'value':'<'+j+'\x20—\x20see\x20required_fields>'};})}));return{'submission_template':{'type':'submission','guard':d,'submission':e},'submission_placement':{'instruction':'Re-issue\x20the\x20SAME\x20operation\x20(data\x20UNCHANGED)\x20adding\x20the\x20object\x20above\x20as\x20the\x20TOP-LEVEL\x20'+'`submission`\x20field\x20of\x20the\x20tool\x20call\x20—\x20a\x20SIBLING\x20of\x20`data`\x20and\x20`env`,\x20NEVER\x20inside\x20`data`,\x20'+'NEVER\x20at\x20the\x20args\x20root.\x20Use\x20call_with_submission\x20semantics:\x20fill\x20every\x20value\x20slot\x20'+'marked\x20\x22<...\x20—\x20see\x20required_fields>\x22.\x20Field\x20name\x20`impack`\x20is\x20literal\x20(true\x20=\x20the\x20'+'guard\x27s\x20verdict\x20participates);\x20slot\x20254\x20takes\x20the\x20ORDER\x20address\x20bound\x20to\x20the\x20operation.','submission':{'type':'submission','guard':d,'submission':e}}};}export function handleCallResult(a,b){const c=convertBigInts(a),d=buildReceipt(c);if(d['kind']==='error'){const g=enrichMoveError(normalizeErrorMessage(d['error'])),h=classifyError(g),i={'outcome':'failed','message':'Error:\x20'+g,'result':{'type':'error','error':g,'error_code':h['error_code'],'retryable':h['retryable'],'recovery_hint':h['recovery_hint']},'recovery':recover(h['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,h['error_code'],g):undefined},j=applySchemaWarning(i,b);return{'content':[{'type':'text','text':j['message']}],'structuredContent':j};}if(d['kind']==='transaction'){const k=ResponseData(c);if(!d['executed']){const v=enrichMoveError(normalizeErrorMessage(d['txError'])||d['txStatus']||'unknown\x20error'),w=classifyError(v),x={'outcome':'failed','message':'Transaction\x20failed:\x20'+v,'result':{'type':'error','error':v,'error_code':w['error_code'],'retryable':w['retryable'],'recovery_hint':w['recovery_hint']},'recovery':recover(w['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,w['error_code'],v):undefined},y=applySchemaWarning(x,b);return{'content':[{'type':'text','text':y['message']},{'type':'text','text':safeTextJson(k,d['digest'])}],'structuredContent':y};}resetAttempts(recoveryOperationId(b));const l=b?.['response_level']==='full',m=k['filter'](z=>z?.['change']==='created'),n=c?.['effects']?.['gasUsed'],o=z=>{const A=Number(z);return Number['isFinite'](A)?A:undefined;};let p,q;if(n&&typeof n==='object'){const z=o(n['computationCost']);if(z!==undefined){const A=o(n['storageCost'])??0x0,B=o(n['storageRebate'])??0x0,C=o(n['nonRefundableStorageFee'])??0x0;q={'computation':z,'storage':A,'storage_rebate':B,'non_refundable_storage':C},p=z+A+C-B;}}const s={'outcome':'executed','message':'Transaction\x20completed\x20successfully','result':l?{'type':'transaction',...c}:{'type':'transaction','digest':c['digest'],'created':m,...p!==undefined?{'gas_used':p}:{},...q?{'fee_components':q}:{}},'semantic':buildSemantic(d,b)};b?.['expected']&&recordSuccessCoverageGap(b['expected'],s['semantic'],b);const t=applySchemaWarning(s,b),u=l?safeTextJson(k,d['digest']):'Transaction\x20executed\x20(compact\x20response):\x20digest\x20'+(d['digest']??'')+';\x20created\x20'+m['length']+'\x20object(s)'+(p!==undefined?';\x20gas\x20'+p+'\x20(raw\x20units)':'')+'.\x20Call\x20again\x20with\x20response_level:\x27full\x27\x20to\x20include\x20the\x20complete\x20raw\x20result.';return{'content':[{'type':'text','text':t['message']},{'type':'text','text':u}],'structuredContent':t};}if(d['kind']==='submission'){const D=c?.['submission'],E=Array['isArray'](D)&&D['length']===0x0,F=c?.['guards'],G=E?{'outcome':'pending_input','message':'GUARD\x20EVALUATED\x20FALSE\x20—\x20the\x20condition\x20did\x20not\x20hold.\x20This\x20is\x20NOT\x20a\x20missing-data\x20problem:\x20the\x20Guard\x20table\x20'+'required\x20no\x20submission,\x20so\x20the\x20expression\x20itself\x20returned\x20false.\x20Do\x20NOT\x20retry\x20the\x20same\x20call.','result':{'type':'guard_result','guard_result':![],'guards':F??[],...c},'semantic':b?{'intent':'guard_evaluated_false','status':'pending_input','summary':'Guard\x20expression\x20evaluated\x20to\x20false\x20('+(F??[])['length']+'\x20guard(s)\x20checked)\x20—\x20fix\x20the\x20condition,\x20the\x20object\x20binding,\x20or\x20the\x20on-chain\x20state;\x20do\x20not\x20resubmit\x20the\x20same\x20call','next_actions':[{'action':'Inspect\x20the\x20Guard\x20expression\x20with\x20analyze_guard_semantics\x20(tree\x20+\x20JSON\x20+\x20mermaid)\x20to\x20see\x20WHICH\x20sub-condition\x20is\x20false','reason':'A\x20composite\x20Guard\x20can\x20fail\x20on\x20any\x20operand;\x20the\x20object-level\x20report\x20cannot\x20tell\x20you\x20which','tool':'guard.operate\x20/\x20analyze_guard_semantics','priority':'required'},{'action':'Verify\x20the\x20Guard\x20is\x20bound\x20to\x20THIS\x20order/service\x20—\x20an\x20address\x20constant\x20for\x20another\x20listing\x20makes\x20every\x20condition\x20false','reason':'Hit\x20twice\x20on\x20testnet:\x20a\x20Guard\x20carried\x20a\x20constant\x20address\x20belonging\x20to\x20a\x20different\x20Service','tool':'onchain_objects','priority':'required'},{'action':'Re-read\x20the\x20referenced\x20state\x20with\x20a\x20FORCED-FRESH\x20query\x20before\x20concluding\x20the\x20chain\x20state\x20is\x20wrong','reason':'A\x20cached\x20read\x20can\x20show\x20a\x20pre-transaction\x20value\x20and\x20make\x20a\x20satisfied\x20condition\x20look\x20false','tool':'query_toolkit\x20(onchain_objects,\x20omit\x20no_cache)','priority':'recommended'}]}:undefined}:{'outcome':'pending_input','message':'SUBMISSION\x20REQUIRED\x20—\x20the\x20Guard\x20needs\x20data\x20you\x20have\x20not\x20supplied\x20yet.\x20Retry\x20with\x20the\x20listed\x20values.','result':{'type':'submission',...c,...buildSubmissionTemplate(c)??{}},'semantic':b?{'intent':'guard_submission_required','status':'pending_input','summary':'Guard\x20verification\x20required\x20—\x20fill\x20the\x20submission\x20data\x20and\x20resubmit','next_actions':[{'action':'fill\x20guard\x20submission\x20data\x20and\x20resubmit\x20via\x20call_with_submission','reason':'Guard\x20rejected\x20the\x20call;\x20submission\x20must\x20satisfy\x20the\x20Guard\x20table\x20requirements','tool':'onchain_operations\x20(with\x20submission\x20field)','priority':'required'}]}:undefined},H=applySchemaWarning(G,b);return{'content':[{'type':'text','text':H['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':H};}if(Array['isArray'](c)){const I={'outcome':'executed','message':'Operation\x20completed','result':{'type':'data','data':c}},J=applySchemaWarning(I,b);return{'content':[{'type':'text','text':J['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':J};}if(c===undefined||c===null){const K={'outcome':'executed','message':'Operation\x20completed','result':{'type':'null'}},L=applySchemaWarning(K,b);return{'content':[{'type':'text','text':L['message']}],'structuredContent':L};}const e={'outcome':'executed','message':'Operation\x20completed','result':{'type':'transaction',...c},'semantic':buildSemantic(d,b)},f=applySchemaWarning(e,b);return{'content':[{'type':'text','text':f['message']}],'structuredContent':f};}export function createServerConfig(a,b){return{'name':a['name'],'version':a['version'],'description':b||a['description']};}export function createCapabilitiesConfig(){return{'capabilities':{'prompts':{},'resources':{},'tools':{'listChanged':!![]},'logging':{}}};}export function createToolMeta(a,b){return{'author':'WOWOK\x20Team','createdAt':'2026-02-01','lastUpdated':'2026-02-01','category':a,'tags':b,'requiresAuth':![]};}export function createToolAnnotations(a=![],b=![]){return{'readOnlyHint':a,'destructiveHint':b,'idempotentHint':!![],'openWorldHint':![]};}export async function transformSubmission(a){if(!a)return undefined;const b=(a['guard']||[])['map'](h=>h['object'])['filter'](Boolean),c=(a['submission']||[])['map'](h=>h['guard'])['filter'](Boolean),d=[...new Set([...b,...c])],e=d['length']>0x0?await LocalMark['Instance']()['get_many_address'](d):[],f=new Map();d['forEach']((h,i)=>{const j=e[i];j&&f['set'](h,j);});const g=h=>{if(typeof h!=='string')throw new Error('Guard\x20reference\x20must\x20be\x20a\x20string\x20(got\x20'+(h===undefined?'undefined':typeof h)+')');if(f['has'](h))return f['get'](h);for(const [i,j]of f['entries']()){if(i===h)return j;}if(h['startsWith']('0x'))return h;throw new Error('Guard\x20name\x20or\x20address\x20not\x20found:\x20'+h);};return{'type':'submission','guard':(a['guard']||[])['map'](h=>({'object':g(h['object']),'impack':h['impack']||![]})),'submission':(a['submission']||[])['map'](h=>({'guard':g(h['guard']),'submission':h['submission']||[]}))};}export function validateInput(a,b){return b['parse'](a);}export function getEnvConfig(a){return a??{};}
1
+ import{ResponseData,LocalMark,enrichMoveError}from'@wowok/wowok';import{classifyError,normalizeErrorMessage,buildSemantic}from'./semantic.js';import{buildReceipt,buildReceiveMovedReceipt}from'./receipt.js';import{recover,resetAttempts}from'../../harness/recover.js';import{stableOperationId}from'../../harness/operation-id.js';import{verify,recordCoverageGap}from'../../harness/verify.js';function applySchemaWarning(a,b){const c=b?.['schema_check'];if(!c||c['warnings']['length']===0x0&&c['errors']['length']===0x0)return a;const d=[...c['warnings'],...c['errors']];let e=a['semantic'];e&&d['length']>0x0&&(e={...e,'warnings':[...e['warnings']||[],...d]});const f={'compatible':c['compatible'],'warnings':d,'client_version':c['client_version'],'server_versions':c['versions']};return{...a,'semantic':e,'schema_warning':f};}function convertBigInts(a){if(typeof a==='bigint')return a['toString']();if(Array['isArray'](a))return a['map'](convertBigInts);if(a instanceof Map){const b={};for(const [c,d]of a)b[String(c)]=convertBigInts(d);return b;}if(a instanceof Set)return Array['from'](a)['map'](convertBigInts);if(a&&typeof a==='object'){const e={};for(const f of Object['keys'](a))e[f]=convertBigInts(a[f]);return e;}return a;}function safeTextJson(a,b){try{return JSON['stringify'](a);}catch(c){return'WARNING:\x20the\x20operation\x20EXECUTED\x20on-chain\x20but\x20its\x20response\x20body\x20failed\x20to\x20serialize\x20'+('('+(c?.['message']??'unknown\x20serialization\x20error')+').\x20Do\x20NOT\x20retry\x20—\x20judge\x20the\x20')+'outcome\x20by\x20the\x20transaction\x20digest\x20instead:\x20query\x20it\x20or\x20re-read\x20the\x20target\x20object.\x20'+('digest:\x20'+(b??'n/a'));}}function recoveryOperationId(a){return a?.['operation_id']??stableOperationId(a?.['operation_type']??'call',a?.['data']);}function failureDiagnosis(a,b,c,d){return verify({'expected':a,'actual':{'result_type':b['kind'],'error_code':c,'error':d}});}function recordSuccessCoverageGap(a,b,c){const d=verify({'expected':a,'actual':{'result_type':'transaction','semantic':b}});recordCoverageGap(d,{'operation_type':c['operation_type']});}function buildSubmissionTemplate(a){const b=a,c=b?.['submission']??[];if(!Array['isArray'](c)||c['length']===0x0)return undefined;const d=Array['isArray'](b?.['guard'])&&b['guard']['length']>0x0?b['guard']:c['map'](f=>({'object':f['guard'],'impack':!![]})),e=c['map'](f=>({'guard':f['guard'],'submission':(Array['isArray'](f['submission'])?f['submission']:[])['map'](h=>{const i=h?.['value_type']??'Address',j=h?.['object_type']?String(h['object_type']):i;return{'identifier':h?.['identifier'],'name':h?.['name']??'','b_submission':!![],'value_type':i,'value':'<'+j+'\x20—\x20see\x20required_fields>'};})}));return{'submission_template':{'type':'submission','guard':d,'submission':e},'submission_placement':{'instruction':'Re-issue\x20the\x20SAME\x20operation\x20(data\x20UNCHANGED)\x20adding\x20the\x20object\x20above\x20as\x20the\x20TOP-LEVEL\x20'+'`submission`\x20field\x20of\x20the\x20tool\x20call\x20—\x20a\x20SIBLING\x20of\x20`data`\x20and\x20`env`,\x20NEVER\x20inside\x20`data`,\x20'+'NEVER\x20at\x20the\x20args\x20root.\x20Use\x20call_with_submission\x20semantics:\x20fill\x20every\x20value\x20slot\x20'+'marked\x20\x22<...\x20—\x20see\x20required_fields>\x22.\x20Field\x20name\x20`impack`\x20is\x20literal\x20(true\x20=\x20the\x20'+'guard\x27s\x20verdict\x20participates);\x20slot\x20254\x20takes\x20the\x20ORDER\x20address\x20bound\x20to\x20the\x20operation.','submission':{'type':'submission','guard':d,'submission':e}}};}export function handleCallResult(a,b){const c=convertBigInts(a),d=buildReceipt(c);if(d['kind']==='error'){const g=enrichMoveError(normalizeErrorMessage(d['error'])),h=classifyError(g),i={'outcome':'failed','message':'Error:\x20'+g,'result':{'type':'error','error':g,'error_code':h['error_code'],'retryable':h['retryable'],'recovery_hint':h['recovery_hint']},'recovery':recover(h['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,h['error_code'],g):undefined},j=applySchemaWarning(i,b);return{'content':[{'type':'text','text':j['message']}],'structuredContent':j};}if(d['kind']==='transaction'){const k=ResponseData(c);if(!d['executed']){const w=enrichMoveError(normalizeErrorMessage(d['txError'])||d['txStatus']||'unknown\x20error'),x=classifyError(w),y={'outcome':'failed','message':'Transaction\x20failed:\x20'+w,'result':{'type':'error','error':w,'error_code':x['error_code'],'retryable':x['retryable'],'recovery_hint':x['recovery_hint']},'recovery':recover(x['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,x['error_code'],w):undefined},z=applySchemaWarning(y,b);return{'content':[{'type':'text','text':z['message']},{'type':'text','text':safeTextJson(k,d['digest'])}],'structuredContent':z};}resetAttempts(recoveryOperationId(b));const l=b?.['response_level']==='full',m=k['filter'](A=>A?.['change']==='created'),n=c?.['effects']?.['gasUsed'],o=A=>{const B=Number(A);return Number['isFinite'](B)?B:undefined;};let p,q;if(n&&typeof n==='object'){const A=o(n['computationCost']);if(A!==undefined){const B=o(n['storageCost'])??0x0,C=o(n['storageRebate'])??0x0,D=o(n['nonRefundableStorageFee'])??0x0;q={'computation':A,'storage':B,'storage_rebate':C,'non_refundable_storage':D},p=A+B+D-C;}}const s={'outcome':'executed','message':'Transaction\x20completed\x20successfully','result':l?{'type':'transaction',...c}:{'type':'transaction','digest':c['digest'],'created':m,...p!==undefined?{'gas_used':p}:{},...q?{'fee_components':q}:{}},'semantic':buildSemantic(d,b)},t=buildReceiveMovedReceipt(b?.['data'],d);t&&(s['result']['receive_receipt']=t,t['objects_moved']===0x0&&t['note']&&(s['message']='Transaction\x20executed\x20(tx_ok=true),\x20but\x20NOTHING\x20MOVED\x20into\x20the\x20wallet\x20'+'(objects_moved=0)\x20—\x20the\x20receive\x20resolved\x20to\x20a\x20no-op.\x20Do\x20NOT\x20report\x20funds\x20'+'or\x20objects\x20as\x20arrived;\x20verify\x20per\x20the\x20note\x20in\x20result.receive_receipt.',s['semantic']&&(s['semantic']={...s['semantic'],'warnings':[...s['semantic']['warnings']??[],t['note']]})));b?.['expected']&&recordSuccessCoverageGap(b['expected'],s['semantic'],b);const u=applySchemaWarning(s,b),v=l?safeTextJson(k,d['digest']):'Transaction\x20executed\x20(compact\x20response):\x20digest\x20'+(d['digest']??'')+';\x20created\x20'+m['length']+'\x20object(s)'+(p!==undefined?';\x20gas\x20'+p+'\x20(raw\x20units)':'')+(t?';\x20receive_receipt:\x20objects_moved='+t['objects_moved']+(t['note']?'\x20—\x20'+t['note']:''):'')+'.\x20Call\x20again\x20with\x20response_level:\x27full\x27\x20to\x20include\x20the\x20complete\x20raw\x20result.';return{'content':[{'type':'text','text':u['message']},{'type':'text','text':v}],'structuredContent':u};}if(d['kind']==='submission'){const E=c?.['submission'],F=Array['isArray'](E)&&E['length']===0x0,G=c?.['guards'],H=F?{'outcome':'pending_input','message':'GUARD\x20EVALUATED\x20FALSE\x20—\x20the\x20condition\x20did\x20not\x20hold.\x20This\x20is\x20NOT\x20a\x20missing-data\x20problem:\x20the\x20Guard\x20table\x20'+'required\x20no\x20submission,\x20so\x20the\x20expression\x20itself\x20returned\x20false.\x20Do\x20NOT\x20retry\x20the\x20same\x20call.','result':{'type':'guard_result','guard_result':![],'guards':G??[],...c},'semantic':b?{'intent':'guard_evaluated_false','status':'pending_input','summary':'Guard\x20expression\x20evaluated\x20to\x20false\x20('+(G??[])['length']+'\x20guard(s)\x20checked)\x20—\x20fix\x20the\x20condition,\x20the\x20object\x20binding,\x20or\x20the\x20on-chain\x20state;\x20do\x20not\x20resubmit\x20the\x20same\x20call','next_actions':[{'action':'Inspect\x20the\x20Guard\x20expression\x20with\x20analyze_guard_semantics\x20(tree\x20+\x20JSON\x20+\x20mermaid)\x20to\x20see\x20WHICH\x20sub-condition\x20is\x20false','reason':'A\x20composite\x20Guard\x20can\x20fail\x20on\x20any\x20operand;\x20the\x20object-level\x20report\x20cannot\x20tell\x20you\x20which','tool':'guard.operate\x20/\x20analyze_guard_semantics','priority':'required'},{'action':'Verify\x20the\x20Guard\x20is\x20bound\x20to\x20THIS\x20order/service\x20—\x20an\x20address\x20constant\x20for\x20another\x20listing\x20makes\x20every\x20condition\x20false','reason':'Hit\x20twice\x20on\x20testnet:\x20a\x20Guard\x20carried\x20a\x20constant\x20address\x20belonging\x20to\x20a\x20different\x20Service','tool':'onchain_objects','priority':'required'},{'action':'Re-read\x20the\x20referenced\x20state\x20with\x20a\x20FORCED-FRESH\x20query\x20before\x20concluding\x20the\x20chain\x20state\x20is\x20wrong','reason':'A\x20cached\x20read\x20can\x20show\x20a\x20pre-transaction\x20value\x20and\x20make\x20a\x20satisfied\x20condition\x20look\x20false','tool':'query_toolkit\x20(onchain_objects,\x20omit\x20no_cache)','priority':'recommended'}]}:undefined}:{'outcome':'pending_input','message':'SUBMISSION\x20REQUIRED\x20—\x20the\x20Guard\x20needs\x20data\x20you\x20have\x20not\x20supplied\x20yet.\x20Retry\x20with\x20the\x20listed\x20values.','result':{'type':'submission',...c,...buildSubmissionTemplate(c)??{}},'semantic':b?{'intent':'guard_submission_required','status':'pending_input','summary':'Guard\x20verification\x20required\x20—\x20fill\x20the\x20submission\x20data\x20and\x20resubmit','next_actions':[{'action':'fill\x20guard\x20submission\x20data\x20and\x20resubmit\x20via\x20call_with_submission','reason':'Guard\x20rejected\x20the\x20call;\x20submission\x20must\x20satisfy\x20the\x20Guard\x20table\x20requirements','tool':'onchain_operations\x20(with\x20submission\x20field)','priority':'required'}]}:undefined},I=applySchemaWarning(H,b);return{'content':[{'type':'text','text':I['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':I};}if(Array['isArray'](c)){const J={'outcome':'executed','message':'Operation\x20completed','result':{'type':'data','data':c}},K=applySchemaWarning(J,b);return{'content':[{'type':'text','text':K['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':K};}if(c===undefined||c===null){const L={'outcome':'executed','message':'Operation\x20completed','result':{'type':'null'}},M=applySchemaWarning(L,b);return{'content':[{'type':'text','text':M['message']}],'structuredContent':M};}const e={'outcome':'executed','message':'Operation\x20completed','result':{'type':'transaction',...c},'semantic':buildSemantic(d,b)},f=applySchemaWarning(e,b);return{'content':[{'type':'text','text':f['message']}],'structuredContent':f};}export function createServerConfig(a,b){return{'name':a['name'],'version':a['version'],'description':b||a['description']};}export function createCapabilitiesConfig(){return{'capabilities':{'prompts':{},'resources':{},'tools':{'listChanged':!![]},'logging':{}}};}export function createToolMeta(a,b){return{'author':'WOWOK\x20Team','createdAt':'2026-02-01','lastUpdated':'2026-02-01','category':a,'tags':b,'requiresAuth':![]};}export function createToolAnnotations(a=![],b=![]){return{'readOnlyHint':a,'destructiveHint':b,'idempotentHint':!![],'openWorldHint':![]};}export async function transformSubmission(a){if(!a)return undefined;const b=(a['guard']||[])['map'](h=>h['object'])['filter'](Boolean),c=(a['submission']||[])['map'](h=>h['guard'])['filter'](Boolean),d=[...new Set([...b,...c])],e=d['length']>0x0?await LocalMark['Instance']()['get_many_address'](d):[],f=new Map();d['forEach']((h,i)=>{const j=e[i];j&&f['set'](h,j);});const g=h=>{if(typeof h!=='string')throw new Error('Guard\x20reference\x20must\x20be\x20a\x20string\x20(got\x20'+(h===undefined?'undefined':typeof h)+')');if(f['has'](h))return f['get'](h);for(const [i,j]of f['entries']()){if(i===h)return j;}if(h['startsWith']('0x'))return h;throw new Error('Guard\x20name\x20or\x20address\x20not\x20found:\x20'+h);};return{'type':'submission','guard':(a['guard']||[])['map'](h=>({'object':g(h['object']),'impack':h['impack']||![]})),'submission':(a['submission']||[])['map'](h=>({'guard':g(h['guard']),'submission':h['submission']||[]}))};}export function validateInput(a,b){return b['parse'](a);}export function getEnvConfig(a){return a??{};}
@@ -89,6 +89,7 @@ export declare const NodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
89
89
  }, z.core.$strict>, z.ZodString]>>>>;
90
90
  }, z.core.$strict>>;
91
91
  }, z.core.$strict>>;
92
+ optional: z.ZodOptional<z.ZodBoolean>;
92
93
  }, z.core.$strict>>;
93
94
  bReplace: z.ZodOptional<z.ZodBoolean>;
94
95
  }, z.core.$strict>, z.ZodObject<{
@@ -116,6 +117,7 @@ export declare const NodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
116
117
  }, z.core.$strict>, z.ZodString]>>>>;
117
118
  }, z.core.$strict>>;
118
119
  }, z.core.$strict>>;
120
+ optional: z.ZodOptional<z.ZodBoolean>;
119
121
  }, z.core.$strict>>;
120
122
  bReplace: z.ZodOptional<z.ZodBoolean>;
121
123
  }, z.core.$strict>, z.ZodObject<{
@@ -190,6 +192,7 @@ export declare const NodeFieldSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUni
190
192
  }, z.core.$strict>, z.ZodString]>>>>;
191
193
  }, z.core.$strict>>;
192
194
  }, z.core.$strict>>;
195
+ optional: z.ZodOptional<z.ZodBoolean>;
193
196
  }, z.core.$strict>>;
194
197
  bReplace: z.ZodOptional<z.ZodBoolean>;
195
198
  }, z.core.$strict>, z.ZodObject<{
@@ -217,6 +220,7 @@ export declare const NodeFieldSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUni
217
220
  }, z.core.$strict>, z.ZodString]>>>>;
218
221
  }, z.core.$strict>>;
219
222
  }, z.core.$strict>>;
223
+ optional: z.ZodOptional<z.ZodBoolean>;
220
224
  }, z.core.$strict>>;
221
225
  bReplace: z.ZodOptional<z.ZodBoolean>;
222
226
  }, z.core.$strict>, z.ZodObject<{
@@ -343,6 +347,7 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
343
347
  }, z.core.$strict>, z.ZodString]>>>>;
344
348
  }, z.core.$strict>>;
345
349
  }, z.core.$strict>>;
350
+ optional: z.ZodOptional<z.ZodBoolean>;
346
351
  }, z.core.$strict>>;
347
352
  bReplace: z.ZodOptional<z.ZodBoolean>;
348
353
  }, z.core.$strict>, z.ZodObject<{
@@ -370,6 +375,7 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
370
375
  }, z.core.$strict>, z.ZodString]>>>>;
371
376
  }, z.core.$strict>>;
372
377
  }, z.core.$strict>>;
378
+ optional: z.ZodOptional<z.ZodBoolean>;
373
379
  }, z.core.$strict>>;
374
380
  bReplace: z.ZodOptional<z.ZodBoolean>;
375
381
  }, z.core.$strict>, z.ZodObject<{
@@ -420,7 +426,7 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
420
426
  }, z.core.$strict>]>>;
421
427
  pause: z.ZodOptional<z.ZodBoolean>;
422
428
  publish: z.ZodOptional<z.ZodBoolean>;
423
- owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
429
+ owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
424
430
  id: z.ZodString;
425
431
  type: z.ZodString;
426
432
  content_raw: z.ZodOptional<z.ZodAny>;
@@ -437,7 +443,7 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
437
443
  version: z.ZodOptional<z.ZodString>;
438
444
  digest: z.ZodOptional<z.ZodString>;
439
445
  }, z.core.$strict>>;
440
- }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
446
+ }, z.core.$strict>]>>;
441
447
  um: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
442
448
  }, z.core.$strict>;
443
449
  export declare const CallMachine_InputSchema: z.ZodObject<{
@@ -519,6 +525,7 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
519
525
  }, z.core.$strict>, z.ZodString]>>>>;
520
526
  }, z.core.$strict>>;
521
527
  }, z.core.$strict>>;
528
+ optional: z.ZodOptional<z.ZodBoolean>;
522
529
  }, z.core.$strict>>;
523
530
  bReplace: z.ZodOptional<z.ZodBoolean>;
524
531
  }, z.core.$strict>, z.ZodObject<{
@@ -546,6 +553,7 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
546
553
  }, z.core.$strict>, z.ZodString]>>>>;
547
554
  }, z.core.$strict>>;
548
555
  }, z.core.$strict>>;
556
+ optional: z.ZodOptional<z.ZodBoolean>;
549
557
  }, z.core.$strict>>;
550
558
  bReplace: z.ZodOptional<z.ZodBoolean>;
551
559
  }, z.core.$strict>, z.ZodObject<{
@@ -596,7 +604,7 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
596
604
  }, z.core.$strict>]>>;
597
605
  pause: z.ZodOptional<z.ZodBoolean>;
598
606
  publish: z.ZodOptional<z.ZodBoolean>;
599
- owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
607
+ owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
600
608
  id: z.ZodString;
601
609
  type: z.ZodString;
602
610
  content_raw: z.ZodOptional<z.ZodAny>;
@@ -613,7 +621,7 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
613
621
  version: z.ZodOptional<z.ZodString>;
614
622
  digest: z.ZodOptional<z.ZodString>;
615
623
  }, z.core.$strict>>;
616
- }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
624
+ }, z.core.$strict>]>>;
617
625
  um: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
618
626
  }, z.core.$strict>;
619
627
  env: z.ZodOptional<z.ZodObject<{
@@ -68,7 +68,7 @@ export declare const CallOrder_DataSchema: z.ZodObject<{
68
68
  arb_claim_compensation: z.ZodOptional<z.ZodObject<{
69
69
  arb: z.ZodString;
70
70
  }, z.core.$strict>>;
71
- receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
71
+ receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
72
72
  id: z.ZodString;
73
73
  type: z.ZodString;
74
74
  content_raw: z.ZodOptional<z.ZodAny>;
@@ -85,7 +85,7 @@ export declare const CallOrder_DataSchema: z.ZodObject<{
85
85
  version: z.ZodOptional<z.ZodString>;
86
86
  digest: z.ZodOptional<z.ZodString>;
87
87
  }, z.core.$strict>>;
88
- }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
88
+ }, z.core.$strict>]>>;
89
89
  transfer_to: z.ZodOptional<z.ZodObject<{
90
90
  name_or_address: z.ZodOptional<z.ZodString>;
91
91
  local_mark_first: z.ZodOptional<z.ZodBoolean>;
@@ -148,7 +148,7 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
148
148
  arb_claim_compensation: z.ZodOptional<z.ZodObject<{
149
149
  arb: z.ZodString;
150
150
  }, z.core.$strict>>;
151
- receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
151
+ receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
152
152
  id: z.ZodString;
153
153
  type: z.ZodString;
154
154
  content_raw: z.ZodOptional<z.ZodAny>;
@@ -165,7 +165,7 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
165
165
  version: z.ZodOptional<z.ZodString>;
166
166
  digest: z.ZodOptional<z.ZodString>;
167
167
  }, z.core.$strict>>;
168
- }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
168
+ }, z.core.$strict>]>>;
169
169
  transfer_to: z.ZodOptional<z.ZodObject<{
170
170
  name_or_address: z.ZodOptional<z.ZodString>;
171
171
  local_mark_first: z.ZodOptional<z.ZodBoolean>;
@@ -341,7 +341,7 @@ export declare const CallPermission_DataSchema: z.ZodObject<{
341
341
  name_or_address: z.ZodOptional<z.ZodString>;
342
342
  local_mark_first: z.ZodOptional<z.ZodBoolean>;
343
343
  }, z.core.$strict>>;
344
- owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
344
+ owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
345
345
  id: z.ZodString;
346
346
  type: z.ZodString;
347
347
  content_raw: z.ZodOptional<z.ZodAny>;
@@ -358,7 +358,7 @@ export declare const CallPermission_DataSchema: z.ZodObject<{
358
358
  version: z.ZodOptional<z.ZodString>;
359
359
  digest: z.ZodOptional<z.ZodString>;
360
360
  }, z.core.$strict>>;
361
- }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
361
+ }, z.core.$strict>]>>;
362
362
  um: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
363
363
  }, z.core.$strict>;
364
364
  export declare const CallPermission_InputSchema: z.ZodObject<{
@@ -488,7 +488,7 @@ export declare const CallPermission_InputSchema: z.ZodObject<{
488
488
  name_or_address: z.ZodOptional<z.ZodString>;
489
489
  local_mark_first: z.ZodOptional<z.ZodBoolean>;
490
490
  }, z.core.$strict>>;
491
- owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
491
+ owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
492
492
  id: z.ZodString;
493
493
  type: z.ZodString;
494
494
  content_raw: z.ZodOptional<z.ZodAny>;
@@ -505,7 +505,7 @@ export declare const CallPermission_InputSchema: z.ZodObject<{
505
505
  version: z.ZodOptional<z.ZodString>;
506
506
  digest: z.ZodOptional<z.ZodString>;
507
507
  }, z.core.$strict>>;
508
- }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
508
+ }, z.core.$strict>]>>;
509
509
  um: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
510
510
  }, z.core.$strict>;
511
511
  env: z.ZodOptional<z.ZodObject<{
@@ -70,7 +70,7 @@ export declare const CallProgress_DataSchema: z.ZodObject<{
70
70
  }>>;
71
71
  message: z.ZodOptional<z.ZodString>;
72
72
  }, z.core.$strict>>>;
73
- owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
73
+ owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
74
74
  id: z.ZodString;
75
75
  type: z.ZodString;
76
76
  content_raw: z.ZodOptional<z.ZodAny>;
@@ -87,7 +87,7 @@ export declare const CallProgress_DataSchema: z.ZodObject<{
87
87
  version: z.ZodOptional<z.ZodString>;
88
88
  digest: z.ZodOptional<z.ZodString>;
89
89
  }, z.core.$strict>>;
90
- }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
90
+ }, z.core.$strict>]>>;
91
91
  review: z.ZodOptional<z.ZodObject<{
92
92
  repository: z.ZodString;
93
93
  key: z.ZodOptional<z.ZodString>;
@@ -140,7 +140,7 @@ export declare const CallProgress_InputSchema: z.ZodObject<{
140
140
  }>>;
141
141
  message: z.ZodOptional<z.ZodString>;
142
142
  }, z.core.$strict>>>;
143
- owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
143
+ owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
144
144
  id: z.ZodString;
145
145
  type: z.ZodString;
146
146
  content_raw: z.ZodOptional<z.ZodAny>;
@@ -157,7 +157,7 @@ export declare const CallProgress_InputSchema: z.ZodObject<{
157
157
  version: z.ZodOptional<z.ZodString>;
158
158
  digest: z.ZodOptional<z.ZodString>;
159
159
  }, z.core.$strict>>;
160
- }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
160
+ }, z.core.$strict>]>>;
161
161
  review: z.ZodOptional<z.ZodObject<{
162
162
  repository: z.ZodString;
163
163
  key: z.ZodOptional<z.ZodString>;
@@ -26,3 +26,11 @@ export interface ExecutionReceipt {
26
26
  raw: unknown;
27
27
  }
28
28
  export declare function buildReceipt(result: unknown): ExecutionReceipt;
29
+ export interface ReceiveMovedReceipt {
30
+ tx_ok: boolean;
31
+ objects_moved: number;
32
+ claimed_coins: number;
33
+ balance_deltas: number;
34
+ note?: string;
35
+ }
36
+ export declare function buildReceiveMovedReceipt(data: unknown, receipt: ExecutionReceipt): ReceiveMovedReceipt | undefined;
@@ -1 +1 @@
1
- const EMPTY_ARRAY=[];export function buildReceipt(a){if(a===undefined||a===null)return{'kind':'null','executed':![],...emptyChanges(),'raw':a};if(!Array['isArray'](a)&&typeof a==='object'&&'error'in a){const b=a['error'];return{'kind':'error','executed':![],'error':typeof b==='string'?b:String(b),...emptyChanges(),'raw':a};}if(Array['isArray'](a))return{'kind':'data','executed':![],...emptyChanges(),'raw':a};if(typeof a==='object'&&'guard'in a&&'submission'in a)return{'kind':'submission','executed':![],...emptyChanges(),'raw':a};if(typeof a==='object'&&'digest'in a){const c=a,d=c?.['effects']?.['status']?.['status'],e=d==='success'||c?.['effects']?.['status']?.['success']===!![],f=Array['isArray'](c['objectChanges'])?c['objectChanges']:EMPTY_ARRAY;return{'kind':'transaction','executed':e,'digest':typeof c['digest']==='string'?c['digest']:String(c['digest']),'txStatus':typeof d==='string'?d:undefined,'txError':c?.['effects']?.['status']?.['error'],'objectChanges':f,'created':f['filter'](g=>g?.['type']==='created'),'modified':f['filter'](g=>g?.['type']==='mutated'||g?.['type']==='published'),'events':Array['isArray'](c['events'])?c['events']:EMPTY_ARRAY,'balanceChanges':Array['isArray'](c['balanceChanges'])?c['balanceChanges']:EMPTY_ARRAY,'raw':a};}return{'kind':'data','executed':![],...emptyChanges(),'raw':a};}function emptyChanges(){return{'objectChanges':[],'created':[],'modified':[],'events':[],'balanceChanges':[]};}
1
+ const EMPTY_ARRAY=[];export function buildReceipt(a){if(a===undefined||a===null)return{'kind':'null','executed':![],...emptyChanges(),'raw':a};if(!Array['isArray'](a)&&typeof a==='object'&&'error'in a){const b=a['error'];return{'kind':'error','executed':![],'error':typeof b==='string'?b:String(b),...emptyChanges(),'raw':a};}if(Array['isArray'](a))return{'kind':'data','executed':![],...emptyChanges(),'raw':a};if(typeof a==='object'&&'guard'in a&&'submission'in a)return{'kind':'submission','executed':![],...emptyChanges(),'raw':a};if(typeof a==='object'&&'digest'in a){const c=a,d=c?.['effects']?.['status']?.['status'],e=d==='success'||c?.['effects']?.['status']?.['success']===!![],f=Array['isArray'](c['objectChanges'])?c['objectChanges']:EMPTY_ARRAY;return{'kind':'transaction','executed':e,'digest':typeof c['digest']==='string'?c['digest']:String(c['digest']),'txStatus':typeof d==='string'?d:undefined,'txError':c?.['effects']?.['status']?.['error'],'objectChanges':f,'created':f['filter'](g=>g?.['type']==='created'),'modified':f['filter'](g=>g?.['type']==='mutated'||g?.['type']==='published'),'events':Array['isArray'](c['events'])?c['events']:EMPTY_ARRAY,'balanceChanges':Array['isArray'](c['balanceChanges'])?c['balanceChanges']:EMPTY_ARRAY,'raw':a};}return{'kind':'data','executed':![],...emptyChanges(),'raw':a};}function emptyChanges(){return{'objectChanges':[],'created':[],'modified':[],'events':[],'balanceChanges':[]};}const isCoinType=a=>String(a??'')['includes']('::coin::Coin'),balanceOwner=a=>{const c=a?.['owner'];if(c&&typeof c==='object'){const d=c;return String(d['AddressOwner']??d['ObjectOwner']??'');}return String(c??'');},balanceAmount=a=>{const c=Number(a?.['amount']);return Number['isFinite'](c)?c:0x0;};export function buildReceiveMovedReceipt(a,c){if(!c['executed'])return undefined;const e=a??{};if(e['receive']==null&&e['owner_receive']==null)return undefined;if(typeof c['digest']==='string'&&c['digest']['startsWith']('dry_run:'))return undefined;if(c['objectChanges']['length']===0x0&&c['balanceChanges']['length']===0x0)return undefined;const f=c['created']['filter'](o=>isCoinType(o['objectType'])),g=c['balanceChanges'];let h,i=0x0;for(const o of g){const p=balanceAmount(o);p<0x0&&(h===undefined||p<i)&&(h=balanceOwner(o),i=p);}const j=h?g['filter'](q=>balanceAmount(q)>0x0&&balanceOwner(q)===h)['length']:0x0,k=f['length'],l=k>0x0?0x0:j,m=k>0x0?k:l,n=m===0x0?'NOTHING\x20MOVED:\x20the\x20transaction\x20executed\x20(tx_ok=true)\x20but\x20no\x20asset\x20arrival\x20was\x20detected\x20in\x20its\x20'+'effects\x20—\x20no\x20claimed\x20coin\x20objects\x20and\x20no\x20positive\x20balance\x20delta\x20to\x20the\x20signing\x20wallet.\x20The\x20receive\x20'+'resolved\x20to\x20a\x20no-op\x20(records\x20already\x20consumed/claimed,\x20or\x20nothing\x20pending).\x20Do\x20NOT\x20report\x20funds\x20or\x20'+'objects\x20as\x20arrived;\x20verify\x20with\x20account_balance\x20/\x20query_toolkit\x20onchain_received.':undefined;return{'tx_ok':!![],'objects_moved':m,'claimed_coins':k,'balance_deltas':l,...n!==undefined?{'note':n}:{}};}
@@ -276,7 +276,7 @@ export declare const CallRepository_DataSchema: z.ZodObject<{
276
276
  }, z.core.$strict>, z.ZodObject<{
277
277
  op: z.ZodLiteral<"clear">;
278
278
  }, z.core.$strict>]>>>;
279
- owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
279
+ owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
280
280
  id: z.ZodString;
281
281
  type: z.ZodString;
282
282
  content_raw: z.ZodOptional<z.ZodAny>;
@@ -293,7 +293,7 @@ export declare const CallRepository_DataSchema: z.ZodObject<{
293
293
  version: z.ZodOptional<z.ZodString>;
294
294
  digest: z.ZodOptional<z.ZodString>;
295
295
  }, z.core.$strict>>;
296
- }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
296
+ }, z.core.$strict>]>>;
297
297
  um: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
298
298
  }, z.core.$strict>;
299
299
  export declare const CallRepository_InputSchema: z.ZodObject<{
@@ -392,7 +392,7 @@ export declare const CallRepository_InputSchema: z.ZodObject<{
392
392
  }, z.core.$strict>, z.ZodObject<{
393
393
  op: z.ZodLiteral<"clear">;
394
394
  }, z.core.$strict>]>>>;
395
- owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
395
+ owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
396
396
  id: z.ZodString;
397
397
  type: z.ZodString;
398
398
  content_raw: z.ZodOptional<z.ZodAny>;
@@ -409,7 +409,7 @@ export declare const CallRepository_InputSchema: z.ZodObject<{
409
409
  version: z.ZodOptional<z.ZodString>;
410
410
  digest: z.ZodOptional<z.ZodString>;
411
411
  }, z.core.$strict>>;
412
- }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
412
+ }, z.core.$strict>]>>;
413
413
  um: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
414
414
  }, z.core.$strict>;
415
415
  env: z.ZodOptional<z.ZodObject<{
@@ -57,7 +57,7 @@ export declare const CallReward_DataSchema: z.ZodObject<{
57
57
  }, z.core.$strip>>>;
58
58
  guard_remove_expired: z.ZodOptional<z.ZodBoolean>;
59
59
  guard_expiration_time: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodNull]>>;
60
- owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
60
+ owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
61
61
  id: z.ZodString;
62
62
  type: z.ZodString;
63
63
  content_raw: z.ZodOptional<z.ZodAny>;
@@ -74,8 +74,18 @@ export declare const CallReward_DataSchema: z.ZodObject<{
74
74
  version: z.ZodOptional<z.ZodString>;
75
75
  digest: z.ZodOptional<z.ZodString>;
76
76
  }, z.core.$strict>>;
77
- }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
77
+ }, z.core.$strict>]>>;
78
78
  um: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
79
+ withdraw: z.ZodOptional<z.ZodObject<{
80
+ amount: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
81
+ payment_info: z.ZodObject<{
82
+ for_object: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
83
+ for_guard: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
84
+ remark: z.ZodString;
85
+ index: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
86
+ }, z.core.$strip>;
87
+ unwrap: z.ZodOptional<z.ZodBoolean>;
88
+ }, z.core.$strip>>;
79
89
  }, z.core.$strict>;
80
90
  export declare const CallReward_InputSchema: z.ZodObject<{
81
91
  data: z.ZodObject<{
@@ -136,7 +146,7 @@ export declare const CallReward_InputSchema: z.ZodObject<{
136
146
  }, z.core.$strip>>>;
137
147
  guard_remove_expired: z.ZodOptional<z.ZodBoolean>;
138
148
  guard_expiration_time: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodNull]>>;
139
- owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
149
+ owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
140
150
  id: z.ZodString;
141
151
  type: z.ZodString;
142
152
  content_raw: z.ZodOptional<z.ZodAny>;
@@ -153,8 +163,18 @@ export declare const CallReward_InputSchema: z.ZodObject<{
153
163
  version: z.ZodOptional<z.ZodString>;
154
164
  digest: z.ZodOptional<z.ZodString>;
155
165
  }, z.core.$strict>>;
156
- }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
166
+ }, z.core.$strict>]>>;
157
167
  um: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
168
+ withdraw: z.ZodOptional<z.ZodObject<{
169
+ amount: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
170
+ payment_info: z.ZodObject<{
171
+ for_object: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
172
+ for_guard: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
173
+ remark: z.ZodString;
174
+ index: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
175
+ }, z.core.$strip>;
176
+ unwrap: z.ZodOptional<z.ZodBoolean>;
177
+ }, z.core.$strip>>;
158
178
  }, z.core.$strict>;
159
179
  env: z.ZodOptional<z.ZodObject<{
160
180
  account: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -1 +1 @@
1
- import{z}from'zod';import{TypedPermissionObjectSchema,CoinParamSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{RewardGuardSchema}from'../query/index.js';import{ReceivedObjectsOrRecentlySchema,ReceivedBalanceOrRecentlySchema,NameOrAddressSchema,DescriptionSchema,RECEIVE_FORMAT_BLOCK_OBJECTS,RECEIVE_FORMAT_BLOCK_BALANCE}from'../common/index.js';export const CallReward_DataSchema=z['object']({'object':TypedPermissionObjectSchema,'claim':NameOrAddressSchema['optional']()['describe']('Guard\x20object\x20ID.\x20Used\x20to\x20verify\x20Guard\x20and\x20start\x20the\x20reward\x20distribution\x20process\x20corresponding\x20to\x20this\x20Guard.'),'description':DescriptionSchema['optional'](),'coin_add':CoinParamSchema['optional']()['describe']('Add\x20amount\x20to\x20Reward\x20object.'),'receive':ReceivedBalanceOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20received\x20by\x20Reward\x20object\x20and\x20store\x20them\x20in\x20pending\x20balance.'+RECEIVE_FORMAT_BLOCK_BALANCE),'guard_add':z['array'](RewardGuardSchema)['optional']()['describe']('Add\x20Guard\x20to\x20Reward\x20object.\x20IDIOMS\x20(F08\x20—\x20these\x20differ\x20from\x20Service\x20allocation,\x20follow\x20THIS\x20shape\x20here):\x20recipient\x20is\x20ONE\x20OF\x20{GuardIdentifier:\x20<u8>}\x20|\x20{Entity:\x20{name_or_address:\x20\x27mark\x27}}\x20|\x20{Signer:\x20\x27signer\x27}\x20(string\x20const\x20INSIDE\x20the\x20key,\x20NOT\x20a\x20bare\x20string);\x20amount\x20is\x20{type:\x20\x27Fixed\x27,\x20value:\x20\x270.1WOW\x27}\x20—\x20value\x20accepts\x20a\x20display\x20string\x20with\x20token\x20symbol\x20(\x270.1WOW\x27)\x20or\x20a\x20smallest-unit\x20integer\x20(\x27100000000\x27),\x20NOT\x20the\x20plain\x20balance\x20string\x20used\x20by\x20allocation\x20`sharing`.\x20FULL\x20EXAMPLE:\x20[{guard:\x20\x270xabc...\x27,\x20recipient:\x20{Signer:\x20\x27signer\x27},\x20amount:\x20{type:\x20\x27Fixed\x27,\x20value:\x20\x270.1WOW\x27}}].'),'guard_remove_expired':z['boolean']()['optional']()['describe']('Whether\x20to\x20remove\x20expired\x20Guard.'),'guard_expiration_time':z['union']([z['number']()['int']()['min'](0x1),z['null']()])['optional']()['describe']('Add\x20expiration\x20time(ms).\x20Before\x20this\x20time\x20expires,\x20new\x20Guard\x20and\x20fund\x20allocation\x20rules\x20cannot\x20be\x20added.'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Reward\x20object\x20and\x20send\x20them\x20to\x20the\x20owner\x20of\x20its\x20Permission\x20object.'+RECEIVE_FORMAT_BLOCK_OBJECTS),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20or\x20name.')})['strict']()['describe']('On-chain\x20Reward\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20type_parameter,\x20permission,\x20...}\x20to\x20create\x20a\x20Reward.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x27permission\x27\x20can\x20be\x20a\x20new\x20Permission\x20object\x20or\x20reference\x20an\x20existing\x20one\x20-\x20check\x20\x27object\x27\x20field\x20description\x20for\x20details.\x20(2)\x20OPERATE\x20EXISTING:\x20Set\x20\x27object\x27\x20field\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20STRING\x20for\x20existing,\x20OBJECT\x20for\x20new\x20creation.\x20NAME\x20RESOLUTION\x20SCOPE\x20(T8\x20az3-mn-261013):\x20a\x20LocalMark\x20name\x20resolves\x20ONLY\x20within\x20the\x20SIGNING\x20account\x27s\x20own\x20local\x20mark\x20store\x20—\x20when\x20the\x20Reward\x20was\x20named\x20by\x20a\x20DIFFERENT\x20account\x20(e.g.\x20the\x20merchant\x27s\x20mark)\x20and\x20you\x20operate\x20it\x20from\x20another\x20account,\x20the\x20name\x20lookup\x20fails\x20with\x20\x27not\x20found\x20locally\x27;\x20pass\x20the\x20on-chain\x200x\x20object\x20ID\x20instead\x20(resolve\x20it\x20once\x20via\x20workspace/onchain_objects\x20and\x20reuse\x20the\x20id).');export const CallReward_InputSchema=z['object']({'data':CallReward_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
1
+ import{z}from'zod';import{TypedPermissionObjectSchema,CoinParamSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{RewardGuardSchema,PaymentInfoSchema}from'../query/index.js';import{ReceivedObjectsOrRecentlySchema,ReceivedBalanceOrRecentlySchema,NameOrAddressSchema,DescriptionSchema,RECEIVE_FORMAT_BLOCK_OBJECTS,RECEIVE_FORMAT_BLOCK_BALANCE}from'../common/index.js';export const CallReward_DataSchema=z['object']({'object':TypedPermissionObjectSchema,'claim':NameOrAddressSchema['optional']()['describe']('Guard\x20object\x20ID.\x20Used\x20to\x20verify\x20Guard\x20and\x20start\x20the\x20reward\x20distribution\x20process\x20corresponding\x20to\x20this\x20Guard.'),'description':DescriptionSchema['optional'](),'coin_add':CoinParamSchema['optional']()['describe']('Add\x20amount\x20to\x20Reward\x20object.'),'receive':ReceivedBalanceOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20received\x20by\x20Reward\x20object\x20and\x20store\x20them\x20in\x20pending\x20balance.'+RECEIVE_FORMAT_BLOCK_BALANCE),'guard_add':z['array'](RewardGuardSchema)['optional']()['describe']('Add\x20Guard\x20to\x20Reward\x20object.\x20IDIOMS\x20(F08\x20—\x20these\x20differ\x20from\x20Service\x20allocation,\x20follow\x20THIS\x20shape\x20here):\x20recipient\x20is\x20ONE\x20OF\x20{GuardIdentifier:\x20<u8>}\x20|\x20{Entity:\x20{name_or_address:\x20\x27mark\x27}}\x20|\x20{Signer:\x20\x27signer\x27}\x20(string\x20const\x20INSIDE\x20the\x20key,\x20NOT\x20a\x20bare\x20string)\x20—\x20BUT\x20on\x20the\x20REWARD\x20claim\x20rail\x20the\x20recipient\x20MUST\x20equal\x20the\x20transaction\x20sender\x20(chain\x20assert,\x20abort\x2014),\x20so\x20{Signer:\x20\x27signer\x27}\x20is\x20the\x20canonical\x20form\x20and\x20{Entity}\x20also\x20passes\x20(SDK\x20replaces\x20it\x20with\x20the\x20claimant\x27s\x20account\x20at\x20claim\x20time);\x20a\x20{GuardIdentifier}\x20recipient\x20resolves\x20to\x20the\x20submitted\x20Order\x20and\x20is\x20STRUCTURALLY\x20UNPAYABLE\x20(every\x20claim\x20aborts\x2014)\x20—\x20the\x20tool\x20gate\x20rejects\x20it\x20(crs-mn-261015\x20F-12).\x20amount\x20is\x20{type:\x20\x27Fixed\x27,\x20value:\x20\x270.1WOW\x27}\x20—\x20value\x20accepts\x20a\x20display\x20string\x20with\x20token\x20symbol\x20(\x270.1WOW\x27)\x20or\x20a\x20smallest-unit\x20integer\x20(\x27100000000\x27),\x20NOT\x20the\x20plain\x20balance\x20string\x20used\x20by\x20allocation\x20`sharing`.\x20FULL\x20EXAMPLE:\x20[{guard:\x20\x270xabc...\x27,\x20recipient:\x20{Signer:\x20\x27signer\x27},\x20amount:\x20{type:\x20\x27Fixed\x27,\x20value:\x20\x270.1WOW\x27}}].'),'guard_remove_expired':z['boolean']()['optional']()['describe']('Whether\x20to\x20remove\x20expired\x20Guard.'),'guard_expiration_time':z['union']([z['number']()['int']()['min'](0x1),z['null']()])['optional']()['describe']('Add\x20expiration\x20time(ms).\x20Before\x20this\x20time\x20expires,\x20new\x20Guard\x20and\x20fund\x20allocation\x20rules\x20cannot\x20be\x20added.'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Reward\x20object\x20and\x20send\x20them\x20to\x20the\x20owner\x20of\x20its\x20Permission\x20object.'+RECEIVE_FORMAT_BLOCK_OBJECTS),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20or\x20name.'),'withdraw':z['object']({'amount':z['union']([z['number']()['int']()['min'](0x0),z['string']()])['describe']('Amount\x20to\x20withdraw\x20(SMALLEST\x20token\x20units,\x20e.g.\x20\x27100000000\x27).'),'payment_info':PaymentInfoSchema['describe']('Payment\x20receipt\x20metadata\x20(remark/index).\x20The\x20withdrawn\x20funds\x20leave\x20the\x20Reward\x20balance\x20inside\x20a\x20Payment\x20object\x20—\x20the\x20on-chain\x20auditable\x20receipt.'),'unwrap':z['boolean']()['optional']()['describe']('Auto-unwrap:\x20when\x20true,\x20the\x20coin\x20is\x20paid\x20straight\x20to\x20the\x20transaction\x20sender\x20in\x20the\x20SAME\x20transaction\x20(single-PTB\x20flow).\x20When\x20false\x20or\x20omitted\x20(default),\x20a\x20CoinWrapper\x20is\x20delivered\x20to\x20the\x20sender\x27s\x20wallet\x20for\x20later\x20unwrapping\x20via\x20the\x20payment\x20call\x20with\x20receive:true.\x20Both\x20modes\x20keep\x20the\x20Payment\x20object\x20as\x20the\x20on-chain\x20receipt.')})['optional']()['describe']('Permission-gated\x20balance\x20exit\x20(the\x20ONLY\x20non-claim\x20exit\x20from\x20the\x20Reward\x20balance):\x20withdraws\x20this\x20amount\x20from\x20the\x20Reward\x20balance\x20and\x20delivers\x20it\x20to\x20the\x20transaction\x20sender\x20inside\x20a\x20Payment\x20object\x20(the\x20on-chain\x20auditable\x20receipt,\x20keyed\x20by\x20the\x20RewardWithdrawEvent).\x20The\x20executing\x20account\x20needs\x20the\x20withdraw\x20right\x20(permission\x20index\x20158)\x20on\x20the\x20Reward\x27s\x20Permission\x20object.\x20Fails\x20on-chain\x20when\x20the\x20balance\x20is\x20insufficient\x20or\x20while\x20the\x20declared\x20no-guard\x20window\x20(guard_expiration_time)\x20is\x20still\x20in\x20the\x20future;\x20claim\x20replay\x20protection\x20is\x20unaffected.\x20Use\x20it\x20to\x20recover\x20mismatched\x20or\x20overfunded\x20pools.')})['strict']()['describe']('On-chain\x20Reward\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20type_parameter,\x20permission,\x20...}\x20to\x20create\x20a\x20Reward.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x27permission\x27\x20can\x20be\x20a\x20new\x20Permission\x20object\x20or\x20reference\x20an\x20existing\x20one\x20-\x20check\x20\x27object\x27\x20field\x20description\x20for\x20details.\x20(2)\x20OPERATE\x20EXISTING:\x20Set\x20\x27object\x27\x20field\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20STRING\x20for\x20existing,\x20OBJECT\x20for\x20new\x20creation.\x20NAME\x20RESOLUTION\x20SCOPE\x20(T8\x20az3-mn-261013):\x20a\x20LocalMark\x20name\x20resolves\x20ONLY\x20within\x20the\x20SIGNING\x20account\x27s\x20own\x20local\x20mark\x20store\x20—\x20when\x20the\x20Reward\x20was\x20named\x20by\x20a\x20DIFFERENT\x20account\x20(e.g.\x20the\x20merchant\x27s\x20mark)\x20and\x20you\x20operate\x20it\x20from\x20another\x20account,\x20the\x20name\x20lookup\x20fails\x20with\x20\x27not\x20found\x20locally\x27;\x20pass\x20the\x20on-chain\x200x\x20object\x20ID\x20instead\x20(resolve\x20it\x20once\x20via\x20workspace/onchain_objects\x20and\x20reuse\x20the\x20id).');export const CallReward_InputSchema=z['object']({'data':CallReward_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();