@wowok/wowok 2.7.7 → 2.7.9

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 (145) hide show
  1. package/dist/esm/Transaction-BlZi1w6F.mjs +1 -0
  2. package/dist/esm/arb-JMhHn5kY.mjs +1 -0
  3. package/dist/esm/base-o08Syk_8.mjs +1 -0
  4. package/dist/esm/bcs/index.d.mts +1 -1
  5. package/dist/esm/{cache-BMhtVd6c.d.mts → cache-D81EHaqu.d.mts} +5 -0
  6. package/dist/esm/call-CtePYECR.mjs +1 -0
  7. package/dist/esm/client/index.d.mts +1 -1
  8. package/dist/esm/client/index.mjs +1 -1
  9. package/dist/esm/client-oE69u-rK.mjs +1 -0
  10. package/dist/esm/{common-ofEOpNis.mjs → common-Guc0E9Tj.mjs} +1 -1
  11. package/dist/esm/cryptography/index.d.mts +1 -1
  12. package/dist/esm/exception-Xd2RFs2i.mjs +1 -0
  13. package/dist/esm/graphql/index.d.mts +1 -1
  14. package/dist/esm/graphql/index.mjs +1 -1
  15. package/dist/esm/{graphql-Ckcg8Cgh.mjs → graphql-DyX3W1VP.mjs} +1 -1
  16. package/dist/esm/grpc/index.d.mts +1 -1
  17. package/dist/esm/grpc/index.mjs +1 -1
  18. package/dist/esm/{grpc-Dwy62pUk.mjs → grpc-BfuVFCn4.mjs} +1 -1
  19. package/dist/esm/{index-DmWs3NAv.d.mts → index-DWq5l_Q3.d.mts} +2 -1
  20. package/dist/esm/{index-ByXPNYyQ.d.mts → index-OlNG95EF.d.mts} +461 -84
  21. package/dist/esm/{index-B-cxGU73.d.mts → index-o_aMVwsK.d.mts} +6 -6
  22. package/dist/esm/index.d.mts +5 -6
  23. package/dist/esm/index.mjs +1 -1
  24. package/dist/esm/jsonRpc/index.d.mts +1 -1
  25. package/dist/esm/jsonRpc/index.mjs +1 -1
  26. package/dist/esm/keypairs/ed25519/index.d.mts +1 -1
  27. package/dist/esm/keypairs/falcon512/index.d.mts +1 -1
  28. package/dist/esm/keypairs/passkey/index.d.mts +1 -1
  29. package/dist/esm/keypairs/secp256k1/index.d.mts +1 -1
  30. package/dist/esm/keypairs/secp256r1/index.d.mts +1 -1
  31. package/dist/esm/{local-gzBIsXyJ.d.mts → local-CC1Zd3Pp.d.mts} +6 -4
  32. package/dist/esm/{messenger-BLZocqqg.mjs → messenger-B-CSCV8C.mjs} +1 -1
  33. package/dist/esm/{messenger-api-U3GALZ6d.mjs → messenger-api-DTnmFsT-.mjs} +1 -1
  34. package/dist/esm/multisig/index.d.mts +1 -1
  35. package/dist/esm/multisig/index.mjs +1 -1
  36. package/dist/esm/network-y8yMus5q.mjs +1 -1
  37. package/dist/esm/object-CJHJxXlc.mjs +1 -0
  38. package/dist/esm/passkey-hU0KN8tj.mjs +1 -1
  39. package/dist/esm/passport-B5g5Rv9_.mjs +1 -0
  40. package/dist/esm/proof-pOwly4FL.mjs +1 -0
  41. package/dist/esm/publickey-C1XTriFK.mjs +1 -1
  42. package/dist/esm/publickey-CO7mE1h4.mjs +1 -1
  43. package/dist/esm/publickey-CaeLjex_.mjs +1 -1
  44. package/dist/esm/publickey-CvsHmrwa.mjs +1 -1
  45. package/dist/esm/publickey-D1qNOZY_.mjs +1 -1
  46. package/dist/esm/publickey-DioRydm4.mjs +1 -1
  47. package/dist/esm/query-BDY4w7pA.mjs +1 -0
  48. package/dist/esm/{received--vCB9_Go.mjs → received-D0KPLcZ8.mjs} +1 -1
  49. package/dist/esm/secp256k1-DbTX5WTS.mjs +1 -1
  50. package/dist/esm/secp256r1-tIVPNUMT.mjs +1 -1
  51. package/dist/esm/service-Rz5iSVL2.mjs +1 -0
  52. package/dist/esm/storage-j7eJYpqQ.mjs +1 -0
  53. package/dist/esm/transactions/index.d.mts +1 -1
  54. package/dist/esm/transactions/index.mjs +1 -1
  55. package/dist/esm/{transactions-dZ1GjC4C.mjs → transactions-Cpkdf1BJ.mjs} +1 -1
  56. package/dist/esm/{util-D877nLGl.mjs → util-Bwj83MFX.mjs} +1 -1
  57. package/dist/esm/utils/index.d.mts +2 -2
  58. package/dist/esm/utils/index.mjs +1 -1
  59. package/dist/esm/utils-CoXIRMWK.mjs +1 -0
  60. package/dist/esm/verify/index.d.mts +1 -1
  61. package/dist/esm/w/call/allocation.d.mts +1 -1
  62. package/dist/esm/w/call/allocation.mjs +1 -1
  63. package/dist/esm/w/call/arbitration.d.mts +1 -1
  64. package/dist/esm/w/call/arbitration.mjs +1 -1
  65. package/dist/esm/w/call/base.d.mts +1 -1
  66. package/dist/esm/w/call/base.mjs +1 -1
  67. package/dist/esm/w/call/demand.d.mts +1 -1
  68. package/dist/esm/w/call/demand.mjs +1 -1
  69. package/dist/esm/w/call/guard.d.mts +1 -1
  70. package/dist/esm/w/call/guard.mjs +1 -1
  71. package/dist/esm/w/call/index.d.mts +2 -2
  72. package/dist/esm/w/call/index.mjs +1 -1
  73. package/dist/esm/w/call/machine.d.mts +1 -1
  74. package/dist/esm/w/call/machine.mjs +1 -1
  75. package/dist/esm/w/call/passport.d.mts +1 -1
  76. package/dist/esm/w/call/passport.mjs +1 -1
  77. package/dist/esm/w/call/payment.d.mts +2 -2
  78. package/dist/esm/w/call/payment.mjs +1 -1
  79. package/dist/esm/w/call/permission.d.mts +1 -1
  80. package/dist/esm/w/call/permission.mjs +1 -1
  81. package/dist/esm/w/call/progress.d.mts +1 -1
  82. package/dist/esm/w/call/progress.mjs +1 -1
  83. package/dist/esm/w/call/repository.d.mts +1 -1
  84. package/dist/esm/w/call/repository.mjs +1 -1
  85. package/dist/esm/w/call/reward.d.mts +1 -1
  86. package/dist/esm/w/call/reward.mjs +1 -1
  87. package/dist/esm/w/call/service.d.mts +1 -1
  88. package/dist/esm/w/call/service.mjs +1 -1
  89. package/dist/esm/w/call/treasury.d.mts +1 -1
  90. package/dist/esm/w/call/treasury.mjs +1 -1
  91. package/dist/esm/w/common.d.mts +2 -2
  92. package/dist/esm/w/common.mjs +1 -1
  93. package/dist/esm/w/index.d.mts +3 -4
  94. package/dist/esm/w/index.mjs +1 -1
  95. package/dist/esm/w/local/account.d.mts +2 -2
  96. package/dist/esm/w/local/account.mjs +1 -1
  97. package/dist/esm/w/local/cache.d.mts +1 -1
  98. package/dist/esm/w/local/cache.mjs +1 -1
  99. package/dist/esm/w/local/config.mjs +1 -1
  100. package/dist/esm/w/local/evm/networks.mjs +1 -1
  101. package/dist/esm/w/local/evm-account.mjs +1 -1
  102. package/dist/esm/w/local/index.d.mts +3 -4
  103. package/dist/esm/w/local/index.mjs +1 -1
  104. package/dist/esm/w/local/local.d.mts +1 -1
  105. package/dist/esm/w/local/local.mjs +1 -1
  106. package/dist/esm/w/local/secure-storage.mjs +1 -1
  107. package/dist/esm/w/local/storage.mjs +1 -1
  108. package/dist/esm/w/local/token.d.mts +1 -1
  109. package/dist/esm/w/local/token.mjs +1 -1
  110. package/dist/esm/w/local/util.mjs +1 -1
  111. package/dist/esm/w/local/wip.mjs +1 -1
  112. package/dist/esm/w/messenger/index.d.mts +1 -1
  113. package/dist/esm/w/messenger/index.mjs +1 -1
  114. package/dist/esm/w/messenger/messenger-api.d.mts +1 -1
  115. package/dist/esm/w/messenger/messenger-api.mjs +1 -1
  116. package/dist/esm/w/messenger/messenger.d.mts +1 -1
  117. package/dist/esm/w/messenger/messenger.mjs +1 -1
  118. package/dist/esm/w/messenger/pq/crypto.mjs +1 -1
  119. package/dist/esm/w/messenger/reply.d.mts +1 -1
  120. package/dist/esm/w/messenger/storage.d.mts +1 -1
  121. package/dist/esm/w/messenger/storage.mjs +1 -1
  122. package/dist/esm/w/messenger/types.d.mts +1 -1
  123. package/dist/esm/w/query/index.d.mts +2 -2
  124. package/dist/esm/w/query/index.mjs +1 -1
  125. package/dist/esm/w/query/object.d.mts +2 -2
  126. package/dist/esm/w/query/object.mjs +1 -1
  127. package/dist/esm/w-CRLsrxnb.mjs +1 -0
  128. package/package.json +1 -4
  129. package/dist/esm/Transaction-DcFD1-9u.mjs +0 -1
  130. package/dist/esm/arb-O5dC5NyR.mjs +0 -1
  131. package/dist/esm/base-DAh1eDOw.mjs +0 -1
  132. package/dist/esm/call-BhTcKYCd.mjs +0 -1
  133. package/dist/esm/client-Cn7jc7Xf.mjs +0 -1
  134. package/dist/esm/exception-C6IYkBi6.mjs +0 -1
  135. package/dist/esm/lock-QdrQzo0u.mjs +0 -1
  136. package/dist/esm/object-CuC7vjpw.mjs +0 -1
  137. package/dist/esm/passport-Z-HwuwHV.mjs +0 -1
  138. package/dist/esm/project-B3Z3z_Z_.d.mts +0 -246
  139. package/dist/esm/proof-DxWRz1Ji.mjs +0 -1
  140. package/dist/esm/query-BOTRwnYe.mjs +0 -1
  141. package/dist/esm/service-5AFQS7-D.mjs +0 -1
  142. package/dist/esm/utils-CpS-PwC-.mjs +0 -1
  143. package/dist/esm/w/local/project.d.mts +0 -2
  144. package/dist/esm/w/local/project.mjs +0 -1
  145. package/dist/esm/w-C8-9OGcr.mjs +0 -1
@@ -0,0 +1 @@
1
+ import{a as a51a}from'./wow-types-DcqbnAaK.mjs';import{o as a51b}from'./exception-Xd2RFs2i.mjs';import{$ as a51c,G as a51d,J as a51e,K as a51f,W as a51g,X as a51h,_t as a51i,d as a51j,f as a51k,gt as a51l,h as a51m,p as a51n,pt as a51o,q as a51p,vt as a51q,y as a51r}from'./common-Guc0E9Tj.mjs';import{LocalMark}from'./w/local/local.mjs';import{WIP,verify_wip}from'./w/local/wip.mjs';import{GetAccountOrMark_Address,GetManyAccountOrMark_Address}from'./w/local/index.mjs';import{Tt as a51s,X as a51t,bt as a51u,yt as a51v}from'./object-CJHJxXlc.mjs';import{t as a51w}from'./received-D0KPLcZ8.mjs';import{A as a51x,C as a51y,T as a51z,b as a51A,ct as a51B,j as a51C,k as a51D,lt as a51E,ot as a51F,st as a51G,tt as a51H,v as a51I,y as a51J}from'./passport-B5g5Rv9_.mjs';import{r as a51K,t as a51L}from'./base-o08Syk_8.mjs';import{paymentInfo,resolvePaymentInfoContext}from'./w/call/payment.mjs';import{allocators}from'./w/call/allocation.mjs';import{create as a51M,newPermission}from'./w/call/permission.mjs';import{a as a51N,i as a51O,n as a51P,r as a51Q}from'./arb-JMhHn5kY.mjs';import{n as a51R}from'./util-Bwj83MFX.mjs';import{accomplish,adminUnhold,create as a51S,getMachineNodeForward,hold}from'./w/call/progress.mjs';var CallOrder=class extends a51L{constructor(a){super(),this['object_address']=void 0x0,this['service']=void 0x0,this['_resolved_arb_cache']=new Map(),this['data']=a;}async['prepare'](a){await super['prepare'](a);if(!this['object_address'])this['object_address']=await a51n(this['data']?.['object']);if(this['object_address']){this['content']=void 0x0,await this['update_content'](a,'Order',this['object_address']);if(!this['content'])a51b('invalid\x20parameter','CallOrder_Data.data.object:'+this['object_address']);}else a51b('invalid\x20parameter','CallOrder_Data.data.object:'+this['data']?.['object']);const b=this['content'];if(this['data']['progress']!=null){if(!b['machine'])a51b('invalid\x20parameter','CallOrder_Data.data.progress\x20error\x20on\x20machine\x20not\x20set');const d=await a51t({'objects':[b['machine']],'no_cache':a['no_cache'],'network':a['network']});if(d['objects']&&d['objects']['length']===0x1&&d['objects'][0x0]['type']==='Machine')this['_resolved_progress_machine']=d['objects'][0x0];else a51b('invalid\x20parameter','CallOrder_Data.data.progress\x20fail\x20with\x20machine\x20invalid\x20for\x20this\x20order');}const c=new Set();if(this['data']['arb_confirm']?.['arb'])c['add'](this['data']['arb_confirm']['arb']);if(this['data']['arb_objection']?.['arb'])c['add'](this['data']['arb_objection']['arb']);if(this['data']['arb_claim_compensation']?.['arb'])c['add'](this['data']['arb_claim_compensation']['arb']);for(const e of c){const f=await this['get_arb'](a,e);this['_resolved_arb_cache']['set'](e,f);}if(this['data']['arb_claim_compensation'])await this['get_service'](a);if(this['data']['receive']==='recently'&&this['object_address'])this['_resolved_receive']=await a51w({'name_or_address':{'name_or_address':this['object_address'],'local_mark_first':!![]},'no_cache':a['no_cache'],'network':a['network']});if(this['data']['agent']!=null)this['_resolved_agents']=await GetManyAccountOrMark_Address(this['data']['agent']);}async['call'](a){await this['prepare'](a);const b=[],c=e=>{if(!b['includes'](e))b['push'](e);},d=this['content'];if(this['data']['progress']!=null){if(!d['machine']||!d['progress'])a51b('invalid\x20parameter','CallOrder_Data.data.progress\x20error\x20on\x20progress\x20not\x20set');const e=await a51t({'objects':[d['progress']],'no_cache':a['no_cache'],'network':a['network']});if(!e['objects']||e['objects']['length']!==0x1||e['objects'][0x0]['type']!=='Progress')a51b('invalid\x20parameter','CallOrder_Data.data.progress\x20fetch\x20error');const f=e['objects'][0x0],g=await getMachineNodeForward(a,f['machine'],f['current'],this['data']['progress']['operation']['next_node_name'],this['data']['progress']['operation']['forward']);if(g['error'])a51b('invalid\x20parameter','CallOrder_Data.data.progress.operation.forward:'+this['data']?.['progress']['operation']['forward']+'\x20validation\x20failed.\x20'+g['error']);if(g['forward']?.['guard'])c(g['forward']['guard']['guard']);}if(b['length']>0x0)return await this['check_guard_and_call'](a,b);return await this['exec'](a);}async['get_service'](a){if(!this['service']&&this['content']){const b=await a51t({'objects':[this['content']['service']],'no_cache':a['no_cache'],'network':a['network']});if(b['objects']&&b['objects']['length']===0x1){const c=b['objects'][0x0];if(!c['type']||c['type']!=='Service')a51b('invalid\x20argument\x20type','object\x20'+this['content']['service']+'\x20type\x20'+c['type']+'\x20is\x20not\x20Service');const d=a51u(c['type_raw'],'service::Service');if(!d)a51b('invalid\x20argument\x20type','Service\x20'+this['content']['service']+'\x20type\x20'+c['type_raw']+'\x20is\x20not\x20valid');this['service']={'object':c,'type':d};}}if(!this['service'])a51b('invalid\x20parameter','CallOrder_Data.data.order_required_info\x20error\x20on\x20service\x20'+this['content']['service']);return this['service'];}async['operate'](a,b,c,d){const e=this['content'];if(this['data']['agent']!=null){const g=this['_resolved_agents']??[];if(g['length']>a51y)a51b('invalid\x20parameter','CallOrder_Data.data.agent\x20count\x20'+g['length']+'\x20exceeds\x20maximum\x20'+a51y);agent_set(b,{'order':a51l(b,this['object_address']),'agents':g});}if(this['data']['required_info']!==void 0x0)await order_required_info_update(b,a51l(b,this['object_address']),this['data']['required_info']);if(this['data']['progress']!=null){if(!e['machine']||!e['progress'])a51b('invalid\x20parameter','CallOrder_Data.data.progress\x20fail\x20with\x20machine\x20or\x20progress\x20invalid\x20for\x20this\x20order');const h=this['_resolved_progress_machine'];if(!h)a51b('invalid\x20parameter','CallOrder_Data.data.progress\x20pre-resolution\x20missing\x20—\x20internal\x20invariant\x20violation');const i=this['data']['progress']['op'];if(i==='adminUnhold')adminUnhold(b,e['progress'],h['object'],h['permission'],this['data']['progress']['operation']['next_node_name'],this['data']['progress']['operation']['forward'],this['data']['progress']['message']??'',c);else{if(i==='hold'||i==='unhold')hold(b,e['progress'],h['object'],h['permission'],this['data']['progress']['operation']['next_node_name'],this['data']['progress']['operation']['forward'],this['data']['progress']['message']??'',i==='hold',this['object_address'],c);else accomplish(b,e['progress'],h['object'],h['permission'],this['data']['progress']['operation']['next_node_name'],this['data']['progress']['operation']['forward'],this['data']['progress']['message']??'',this['object_address'],c);}}const f=j=>{const k=this['_resolved_arb_cache']['get'](j);if(!k)a51b('invalid\x20parameter','Arb\x20'+j+'\x20was\x20not\x20pre-resolved\x20—\x20internal\x20invariant\x20violation');return k;};if(this['data']['arb_confirm']!=null){const j=f(this['data']['arb_confirm']['arb']);this['check_arb'](e,j,0x0);if(this['data']['arb_confirm']['proposition']!==void 0x0){if(this['data']['arb_confirm']['proposition']['length']>a51H)a51b('invalid\x20parameter','CallOrder_Data.data.arb_confirm.proposition\x20length\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20'+a51H);a51N(b,j['object']['object'],j['type'],a51l(b,this['object_address']),this['data']['arb_confirm']['proposition'],this['data']['arb_confirm']['description'],this['data']['arb_confirm']['confirm']);}else{if(this['data']['arb_confirm']['description']!==void 0x0)a51P(b,j['object']['object'],j['type'],a51l(b,this['object_address']),this['data']['arb_confirm']['description'],this['data']['arb_confirm']['confirm']);else a51O(b,j['object']['object'],j['type'],a51l(b,this['object_address']),this['data']['arb_confirm']['confirm']);}}if(this['data']['arb_objection']!=null){const k=f(this['data']['arb_objection']['arb']);this['check_arb'](e,k,0x3),a51Q(b,k['object']['object'],k['type'],a51l(b,this['object_address']),this['data']['arb_objection']['objection']);}if(this['data']['arb_claim_compensation']){const l=f(this['data']['arb_claim_compensation']['arb']);this['check_arb'](e,l,0x3);const m=await this['get_service'](a);compensation_claim(b,{'service':m['object']['object'],'service_type':m['type'],'arbitration_object':l['object']['arbitration'],'arbitration_type':l['type'],'order':a51l(b,this['object_address']),'arb':l['object']['object']});}if(this['data']['receive']!=null&&this['object_address']){const n=this['_resolved_receive']!==void 0x0?this['_resolved_receive']:this['data']['receive'];if(n==='recently')a51b('invalid\x20parameter','CallOrder.data.receive\x20internal\x20invariant\x20—\x20\x27recently\x27\x20not\x20pre-resolved');await owner_receive(b,a51l(b,this['object_address']),n);}if(this['data']['transfer_to']!=null)await owner_change(b,{'order':a51l(b,this['object_address']),'new_owner':this['data']['transfer_to']});}async['get_arb'](a,b){const c=await a51t({'objects':[b],'no_cache':a['no_cache'],'network':a['network']});if(!c['objects']||c['objects']['length']!==0x1)a51b('invalid\x20parameter','Arb\x20'+b+'\x20not\x20found');const d=c['objects'][0x0];if(!d['type']||d['type']!=='Arb')a51b('invalid\x20argument\x20type','object\x20'+b+'\x20type\x20'+d['type']+'\x20is\x20not\x20Arb');const e=a51u(d['type_raw'],'arb::Arb');if(!e)a51b('invalid\x20argument\x20type','Arb\x20'+b+'\x20type\x20'+d['type_raw']+'\x20is\x20not\x20valid');return{'object':d,'type':e};}['check_arb'](a,b,c){if(b['object']['status']!==c)a51b('invalid\x20parameter','arb\x20'+b['object']['object']+'\x20status\x20'+b['object']['status']+'\x20not\x20'+c);if(b['object']['order']!==this['object_address'])a51b('invalid\x20parameter','arb\x20'+b['object']['object']+'\x20order\x20'+b['object']['order']+'\x20not\x20'+this['object_address']);if(a['claimed_by'])a51b('invalid\x20parameter','arb\x20'+b['object']['object']+'\x20error\x20on\x20order\x20'+this['object_address']+'\x20already\x20disputed\x20by\x20'+a['claimed_by']);}};function orderFn(a){return'0x2::order::'+a;}function create$1(a,b){return a51s([b]),a['moveCall']({'target':orderFn('create'),'arguments':[a51l(a,b)]});}async function owner_change(a,b){const c=await GetAccountOrMark_Address(b['new_owner']);if(!c)a51b('invalid\x20parameter','CallOrder_Data.data.new_owner:'+b['new_owner']);a51s([b['order']]),a['moveCall']({'target':orderFn('owner_change'),'arguments':[a51l(a,b['order']),a['pure']['address'](c),a['object']['mutEntityOrder'](),a['object']['clock']()]});}function agent_set(a,b){a51s([b['order'],...b['agents']]),a['moveCall']({'target':orderFn('agent_set'),'arguments':[a51l(a,b['order']),a['pure']['vector']('address',b['agents']),a['object']['mutEntityOrder'](),a['object']['clock']()]});}async function owner_receive(a,b,c){a51s([b]);if(Array['isArray'](c))for(const d of c){if(!d['type']||!a51m(d['type']))a51b('invalid\x20argument\x20type','type\x20'+d['type']+'\x20is\x20invalid');a51s([d['id']]);const e=d['type']['match'](/CoinWrapper<([^>]+)>/);if(e){const f=e[0x1],g=d['content_raw']?.['payment'];if(!g)a51b('invalid\x20argument\x20type','CoinWrapper\x20'+d['id']+'\x20is\x20missing\x20payment\x20info;\x20query\x20with\x20type=\x27CoinWrapper\x27\x20(ReceivedBalance)\x20or\x20provide\x20content_raw.payment');const [h,i]=await Promise['all']([LocalMark['Instance']()['get_address'](d['id']),LocalMark['Instance']()['get_address'](g)]);if(!h||!i)a51b('invalid\x20argument\x20type','Received\x20'+d['id']+'\x20or\x20Payment\x20'+g+'\x20is\x20invalid');a['moveCall']({'target':orderFn('owner_receive'),'arguments':[a51l(a,b),a51i(a,h,d['version'],d['digest']),a51l(a,i)],'typeArguments':[f]});continue;}a['moveCall']({'target':orderFn('owner_receive_object'),'arguments':[a51l(a,b),a51i(a,d['id'],d['version'],d['digest'])],'typeArguments':[d['type']]});}else{const j=c['token_type']['match'](/CoinWrapper<([^>]+)>/);if(!j)a51b('invalid\x20argument\x20type','Invalid\x20CoinWrapper\x20type:\x20'+c['token_type']);const k=j[0x1];if(!a51m(k))a51b('invalid\x20argument\x20type','Invalid\x20CoinWrapper\x20type:\x20'+k);for(const l of c['received']){const [m,n]=await Promise['all']([LocalMark['Instance']()['get_address'](l['id']),LocalMark['Instance']()['get_address'](l['payment'])]);if(!m||!n)a51b('invalid\x20argument\x20type','Received\x20'+l['id']+'\x20or\x20Payment\x20'+l['payment']+'\x20is\x20invalid');a['moveCall']({'target':orderFn('owner_receive'),'arguments':[a51l(a,b),a51i(a,m,l['version'],l['digest']),a51l(a,n)],'typeArguments':[k]});}}}async function order_required_info_update(a,b,c){a51s([b]);if(c!==void 0x0){c=await LocalMark['Instance']()['get_address'](c)??null;if(!c)a51b('invalid\x20parameter','CallOrder_Data.data.required_info\x20'+c+'\x20not\x20found');}a['moveCall']({'target':orderFn('required_info_update'),'arguments':[a51l(a,b),a['pure']['option']('address',c)]});}function compensation_claim(a,b){if(!a51m(b['service_type']))a51b('invalid\x20parameter','Compensation\x20claim\x20service\x20type\x20'+b['service_type']+'\x20is\x20not\x20valid');if(!a51m(b['arbitration_type']))a51b('invalid\x20parameter','Compensation\x20claim\x20arbitration\x20type\x20'+b['arbitration_type']+'\x20is\x20not\x20valid');a51s([b['service'],b['arbitration_object'],b['order'],b['arb']]),a['moveCall']({'target':a51o('compensation_claim'),'arguments':[a51l(a,b['service']),a51l(a,b['arbitration_object']),a51l(a,b['order']),a51l(a,b['arb']),a['object']['clock']()],'typeArguments':[b['service_type'],b['arbitration_type']]});}const NAMED_OPERATOR_ORDER_PAYER='';var CallService=class extends a51L{constructor(a){super(),this['object_address']=void 0x0,this['permission_address']=void 0x0,this['new_permission_description']=void 0x0,this['parameter_type']=void 0x0,this['checkPublished']=b=>{if(this['content']&&!this['content']['bPublished'])a51b('fail','Service\x20object\x20has\x20not\x20been\x20published\x20yet,\x20so\x20the\x20operation\x20('+b+')\x20cannot\x20proceed.');},this['checkNotPublishedAbsolute']=b=>{if(this['content']&&this['content']['bPublished'])a51b('fail','Service\x20is\x20published.\x20Operation\x20('+b+')\x20is\x20PERMANENTLY\x20BLOCKED\x20(Move\x20layer:\x20assert!(!bPublished)\x20at\x20service.move\x20L633/L653/L503).\x20Must\x20create\x20a\x20new\x20Service.');},this['checkNotPublishedConditional']=b=>{if(this['content']&&this['content']['bPublished']){const c=this['content'];if(c['paused_time']!=null&&c['setting_lock_duration']!=null){const d=Number(c['paused_time']),e=Number(c['setting_lock_duration']),f=Date['now'](),g=d+e;if(f>=g)return;a51b('fail','Service\x20is\x20published\x20and\x20locked.\x20Operation\x20('+b+')\x20requires\x20pause\x20+\x20setting_lock_duration\x20wait\x20(Move\x20layer:\x20assert_not_published\x20at\x20service.move\x20L303-308).\x20Paused\x20at:\x20'+d+',\x20lock_duration:\x20'+e+'ms,\x20unlock\x20at:\x20'+g+',\x20current:\x20'+f+',\x20remaining:\x20'+(g-f)+'ms.');}a51b('fail','Service\x20is\x20published.\x20Operation\x20('+b+')\x20requires\x20pause\x20+\x20setting_lock_duration\x20wait\x20(Move\x20layer:\x20assert_not_published\x20at\x20service.move\x20L303-308).\x20Please\x20pause\x20the\x20Service\x20first\x20(pause:\x20true)\x20and\x20wait\x20for\x20setting_lock_duration\x20to\x20pass.');}},this['checkNotPaused']=b=>{if(this['content']&&this['content']['bPaused'])a51b('fail','Service\x20object\x20has\x20been\x20paused\x20and\x20operation\x20('+b+')\x20cannot\x20proceed.');},this['data']=a;}async['prepare'](a){await super['prepare'](a);if(!this['object_address'])this['object_address']=await a51n(this['data']?.['object']);if(this['object_address']){this['content']=void 0x0,await this['update_content'](a,'Service',this['object_address']);if(!this['content'])a51b('invalid\x20parameter','CallService_Data.data.object:'+this['object_address']);this['permission_address']=this['content']['permission'],this['parameter_type']=a51u(this['content']['type_raw'],'service::Service');if(!this['permission_address'])a51b('invalid\x20parameter','CallService_Data.data.object.permission\x20is\x20empty');if(!a51m(this['parameter_type']))a51b('invalid\x20argument\x20type','CallService_Data.data.object.type_parameter\x20is\x20empty');}else{const c=a51j(this['data']['object']);this['permission_address']=await a51n(c?.['permission']),this['new_permission_description']=a51k(c?.['permission']),this['parameter_type']=c?.['type_parameter'];if(!a51m(this['parameter_type']))a51b('invalid\x20argument\x20type','CallService_Data.data.object.type_parameter\x20invalid');}if(this['data']['buy_guard']!=null&&!a51a(this['data']['buy_guard'])){const d=await LocalMark['Instance']()['get_address'](this['data']['buy_guard']);if(!d||!a51a(d))a51b('invalid\x20address','buy_guard:\x20'+this['data']['buy_guard']);this['data']['buy_guard']=d;}if(this['data']['rewards']?.['op']==='add'||this['data']['rewards']?.['op']==='set')this['_resolved_rewards_add']=await a51R(a,this['data']['rewards']['objects'],'Reward','reward::Reward',!![]);if(this['data']['arbitrations']?.['op']==='add'||this['data']['arbitrations']?.['op']==='set')this['_resolved_arbitrations_add']=await a51R(a,this['data']['arbitrations']['objects'],'Arbitration','arbitration::Arbitration',!![]);if(this['data']['compensation_fund_receive']==='recently'&&this['object_address']){const e=await a51w({'name_or_address':{'name_or_address':this['object_address'],'local_mark_first':!![]},'type':'CoinWrapper','network':a['network'],'no_cache':a['no_cache']});if(Array['isArray'](e))a51b('invalid\x20parameter','CallService_Data.data.compensation_fund_receive:\x20received\x20is\x20ReceivedNormal[]\x20(expected\x20ReceivedBalance)');this['_resolved_comp_fund_receive']=e;}{const f=this['_resolved_comp_fund_receive']!==void 0x0?this['_resolved_comp_fund_receive']:this['data']['compensation_fund_receive'];if(f!=null&&typeof f==='object'&&!Array['isArray'](f)&&'received'in f&&Array['isArray'](f['received'])){const h=f['received'],i=[];for(const j of h){let k;if(j['id']!=null&&a51a(j['id']))k=j['id'];else{if(j['id']!=null)k=await LocalMark['Instance']()['get_address'](j['id'])||void 0x0;}let l;if(j['payment']!=null&&a51a(j['payment']))l=j['payment'];else{if(j['payment']!=null)l=await LocalMark['Instance']()['get_address'](j['payment'])||void 0x0;}i['push']({'id':k,'payment':l});}this['_resolved_comp_items']=i;}}if(this['data']['owner_receive']==='recently'&&this['object_address'])this['_resolved_owner_receive']=await a51w({'name_or_address':{'name_or_address':this['object_address'],'local_mark_first':!![]},'network':a['network'],'no_cache':a['no_cache']});if(this['data']['repositories']?.['op']==='add'||this['data']['repositories']?.['op']==='set')this['_resolved_repos_add']=await LocalMark['Instance']()['get_many_address_availables'](this['data']['repositories']['objects']);else{if(this['data']['repositories']?.['op']==='remove')this['_resolved_repos_remove']=await LocalMark['Instance']()['get_many_address_availables'](this['data']['repositories']['objects']);}if(this['data']['rewards']?.['op']==='remove')this['_resolved_rewards_remove']=await LocalMark['Instance']()['get_many_address_availables'](this['data']['rewards']['objects']);if(this['data']['arbitrations']?.['op']==='remove')this['_resolved_arbitrations_remove']=await LocalMark['Instance']()['get_many_address_availables'](this['data']['arbitrations']['objects']);if(this['data']['discount_destroy']!=null)this['_resolved_discount_destroy']=await LocalMark['Instance']()['get_many_address_availables'](this['data']['discount_destroy']);const b=this['data']['order_new']?.['buy']?.['discount'];if(b!=null&&b!==void 0x0){if(a51a(String(b)))this['_resolved_buy_discount']=String(b);else{const o=await LocalMark['Instance']()['get_address'](b);if(o)this['_resolved_buy_discount']=o;}}if(this['data']['order_new']?.['agents']!=null)this['_resolved_buy_agents']=await GetManyAccountOrMark_Address(this['data']['order_new']['agents']);if(this['data']['machine']!==void 0x0&&this['data']['machine']!==null&&this['data']['machine']!==''){if(a51a(this['data']['machine']))this['_resolved_machine']=this['data']['machine'];else{const p=await LocalMark['Instance']()['get_address'](this['data']['machine']);if(p)this['_resolved_machine']=p;else a51b('invalid\x20argument\x20type','Machine\x20not\x20found\x20'+this['data']['machine']);}}else{if(this['data']['machine']===null||this['data']['machine']==='')this['_resolved_machine']=null;}if(this['data']['um']!==void 0x0){if(this['data']['um']===null||this['data']['um']==='')this['_resolved_um']=null;else{if(a51a(this['data']['um']))this['_resolved_um']=this['data']['um'];else{const q=await LocalMark['Instance']()['get_address'](this['data']['um']);if(q)this['_resolved_um']=q;else a51b('invalid\x20parameter','CallService_Data.data.um:'+this['data']['um']);}}}if(this['data']['compensation_fund_withdraw']!=null){this['_resolved_comp_withdraw_pi']=await resolvePaymentInfoContext(a,this['data']['compensation_fund_withdraw']['payment_info']);const s=await GetAccountOrMark_Address(this['data']['compensation_fund_withdraw']['receipt']);if(!s||!a51a(s))a51b('invalid\x20address','compensation_fund_withdraw\x20receipt:\x20'+JSON['stringify'](this['data']['compensation_fund_withdraw']['receipt']));this['_resolved_comp_withdraw_receipt']=s;}}async['call'](a){await this['prepare'](a);const b=[],c=[],d=f=>{if(!b['includes'](f))b['push'](f);},e=f=>{if(this['permission_address']&&!c['includes'](f))c['push'](f);};if(this['permission_address']&&!this['object_address'])e(0x12c);if(this['data']?.['order_new']){if(!this['content'])a51b('invalid\x20parameter','CallService_Data.data.order_new\x20fail\x20because\x20the\x20Service\x20'+JSON['stringify'](this['data']['object'])+'\x20content\x20not\x20ready');this['order_allowed']();if(this['content']['buy_guard']!=null)d(this['content']['buy_guard']);}if(this['permission_address']&&this['data']?.['description']!=null&&this['object_address'])e(0x12d);if(this['permission_address']&&this['data']?.['location']!=null)e(0x12f);if(this['permission_address']&&this['data']?.['repositories']!=null)e(0x130);if(this['permission_address']&&this['data']?.['sales']!=null)e(0x131);this['permission_address']&&this['data']?.['machine']!==void 0x0&&(this['checkNotPublishedAbsolute']('machine'),e(0x132));if(this['permission_address']&&this['data']?.['discount']!=null)e(0x138);if(this['permission_address']&&this['data']?.['arbitrations']!=null){if(this['data']['arbitrations']['op']==='remove'||this['data']['arbitrations']['op']==='clear')this['checkNotPublishedConditional']('arbitrations');e(0x134);}this['permission_address']&&this['data']?.['customer_required']!=null&&(this['checkCustomerRequiredNeedsUm'](),e(0x135));if(this['permission_address']&&this['data']?.['pause']!==void 0x0)e(0x136);this['permission_address']&&this['data']?.['publish']&&(this['checkCustomerRequiredNeedsUm'](),e(0x137));this['permission_address']&&this['data']?.['order_allocators']!==void 0x0&&(this['checkNotPublishedAbsolute']('order_allocators'),e(0x139));if(this['permission_address']&&this['data']?.['buy_guard']!=null)e(0x133);if(this['permission_address']&&this['data']?.['compensation_fund_add']!=null)e(0x13b);this['permission_address']&&this['data']?.['compensation_fund_withdraw']!=null&&(this['checkNotPublishedConditional']('compensation_fund_withdraw'),e(0x13a));if(this['permission_address']&&this['data']?.['setting_lock_duration_add']!==void 0x0)e(0x13d);if(this['permission_address']&&this['data']?.['rewards']!=null){if(this['data']['rewards']['op']==='remove'||this['data']['rewards']['op']==='clear')this['checkNotPublishedConditional']('rewards');e(0x13e);}if(this['permission_address']&&this['data']?.['compensation_fund_receive']!=null)e(0x13c);if(this['permission_address']&&this['data']?.['owner_receive']!=null)e(0x13f);if(this['permission_address']&&this['data']?.['um']!==void 0x0)e(0x140);if(this['permission_address']||b['length']>0x0)return await this['check_permission_and_call'](a,this['permission_address'],c,b);return await this['exec'](a);}async['operate'](a,b,c,d){let e=this['permission_address'],f=this['object_address'];if(!this['object_address']){if(!e)e=newPermission(b,this['new_permission_description']??'');if(e&&this['parameter_type'])f=newService(b,this['parameter_type'],e,this['data']?.['description']??'',c);}if(!f||!e)a51b('invalid\x20parameter','CallService_Data.data.object:'+this['object_address']);let g;if(this['data']?.['order_new']!=null&&this['content']){this['order_allowed']();const h=this['data']?.['order_new'],j=this['content']['sales'],k=new Set();for(const l of h['buy']['items']){const o=j['find'](r=>r['name']===l['name']);if(!o)a51b('invalid\x20parameter','Product\x20\x22'+l['name']+'\x22\x20not\x20found\x20in\x20Service\x20sales');if(l['wip_hash']===''&&o['wip_hash']!=='')l['wip_hash']=o['wip_hash'];if(k['has'](o['wip']))continue;if(o['wip']==='')continue;const q=await verify_wip(o['wip'],l['wip_hash']!==''?l['wip_hash']:void 0x0);if(!q['valid'])a51b('invalid\x20parameter','WIP\x20file\x20verification\x20failed\x20for\x20product\x20\x22'+l['name']+'\x22\x20at\x20'+o['wip']+':\x20'+q['error']);k['add'](o['wip']);}if(this['_resolved_buy_discount']!==void 0x0)h['buy']['discount']=this['_resolved_buy_discount'];g=await buy(a,b,f,this['parameter_type'],this['content']['machine'],h['buy'],c);if(!g)a51b('fail','Buy\x20failed,\x20no\x20order\x20created');if(h?.['agents']!=null)agent_set(b,{'order':g['order'],'agents':this['_resolved_buy_agents']??[]});if(h?.['order_required_info']!==void 0x0&&h['order_required_info']['length']>0x0)await order_required_info_update(b,g['order'],h['order_required_info']);if(h?.['transfer']!=null)await owner_change(b,{'order':g['order'],'new_owner':h['transfer']});if(h?.['namedNewAllocation']!=null&&g?.['allocation'])await this['new_with_mark'](a,b,'Allocation',g?.['allocation'],a51j(h['namedNewAllocation']));if(g?.['progress']){if(h?.['namedNewProgress']!=null)await this['new_with_mark'](a,b,'Progress',a51S(b,g?.['progress']),a51j(h['namedNewProgress']));else a51S(b,g?.['progress']);}if(g?.['order']){const r=create$1(b,g?.['order']);if(h?.['namedNewOrder']!=null)await this['new_with_mark'](a,b,'Order',r,a51j(h['namedNewOrder']));}}if(this['object_address']&&this['data']['description']!=null)description_set(b,f,this['parameter_type'],e,this['data']['description'],c);if(this['data']['location']!=null)location_set(b,f,this['parameter_type'],e,this['data']['location'],c);if(this['data']['sales']!=null)switch(this['data']['sales']['op']){case'add':case'set':for(const s of this['data']['sales']['sales'])if(s['wip']!==''){const t=await verify_wip(s['wip'],s['wip_hash']!==''?s['wip_hash']:void 0x0);if(!t['valid'])a51b('invalid\x20parameter','WIP\x20file\x20verification\x20failed\x20for\x20product\x20\x22'+s['name']+'\x22\x20at\x20'+s['wip']+':\x20'+t['error']);const u=new WIP(),v=await u['load'](s['wip']);s['wip_hash']=u['getHash'](v);}if(this['data']['sales']['op']==='add')sales_add(b,f,this['parameter_type'],e,this['data']['sales']['sales'],c);else sales_set(b,f,this['parameter_type'],e,this['data']['sales']['sales'],c);break;case'remove':sales_remove(b,f,this['parameter_type'],e,this['data']['sales']['sales_name'],c);break;case'clear':sales_clear(b,f,this['parameter_type'],e,c);break;}if(this['data']['repositories']!=null)switch(this['data']['repositories']['op']){case'add':case'set':if(this['data']['repositories']['objects']['length']>MAX_REPOSITORY_COUNT)a51b('invalid\x20parameter','CallService_Data.data.repositories.objects:'+this['data']['repositories']['objects']);if(this['data']['repositories']['op']==='set')repository_clear(b,f,this['parameter_type'],e,c);(this['_resolved_repos_add']??[])['forEach'](w=>{repository_add(b,f,this['parameter_type'],e,w,c);});break;case'remove':{if(this['data']['repositories']['objects']['length']>MAX_REPOSITORY_COUNT)a51b('invalid\x20parameter','CallService_Data.data.repositories.objects:'+this['data']['repositories']['objects']);const w=this['_resolved_repos_remove']??[];repository_remove(b,f,this['parameter_type'],e,w,c);break;}case'clear':repository_clear(b,f,this['parameter_type'],e,c);break;}if(this['data']['rewards']!=null)switch(this['data']['rewards']['op']){case'add':case'set':if(this['data']['rewards']['objects']['length']>MAX_REWARD_COUNT)a51b('invalid\x20parameter','rewards\x20count\x20exceeds\x20maximum\x20limit\x20'+MAX_REWARD_COUNT);if(this['data']['rewards']['op']==='set')reward_clear(b,f,this['parameter_type'],e,c);(this['_resolved_rewards_add']??[])['forEach'](x=>{reward_add(b,f,this['parameter_type'],e,x['object'],x['type'],c);});break;case'remove':{if(this['data']['rewards']['objects']['length']>MAX_REWARD_COUNT)a51b('invalid\x20parameter','rewards\x20count\x20exceeds\x20maximum\x20limit\x20'+MAX_REWARD_COUNT);const x=this['_resolved_rewards_remove']??[];reward_remove(b,f,this['parameter_type'],e,x,c);break;}case'clear':reward_clear(b,f,this['parameter_type'],e,c);break;}if(this['data']['arbitrations']!=null)switch(this['data']['arbitrations']['op']){case'add':case'set':if(this['data']['arbitrations']['objects']['length']>MAX_ARBITRATION_COUNT)a51b('invalid\x20parameter','arbitrations\x20count\x20exceeds\x20maximum\x20limit\x20'+MAX_ARBITRATION_COUNT);if(this['data']['arbitrations']['op']==='set')arbitration_clear(b,f,this['parameter_type'],e,c);(this['_resolved_arbitrations_add']??[])['forEach'](y=>{arbitrations_add(b,f,this['parameter_type'],e,y['object'],y['type'],c);});break;case'remove':{if(this['data']['arbitrations']['objects']['length']>MAX_ARBITRATION_COUNT)a51b('invalid\x20parameter','arbitrations\x20count\x20exceeds\x20maximum\x20limit\x20'+MAX_ARBITRATION_COUNT);const y=this['_resolved_arbitrations_remove']??[];arbitrations_remove(b,f,this['parameter_type'],e,y,c);break;}case'clear':arbitration_clear(b,f,this['parameter_type'],e,c);break;}if(this['data']['discount']!=null)await discount(b,f,this['parameter_type'],e,this['data']['discount'],c);if(this['data']['discount_destroy']!=null)discount_destroy(b,this['_resolved_discount_destroy']??[]);if(this['data']['machine']!==void 0x0){const z=this['_resolved_machine'];if(this['data']['machine']&&!z)a51b('invalid\x20argument\x20type','Machine\x20not\x20found\x20'+this['data']['machine']);this['data']['machine']=z??(this['data']['machine']||null),machine_set(b,f,this['parameter_type'],e,this['data']['machine'],c);}if(this['data']['customer_required']!=null)customer_required_set(b,f,this['parameter_type'],e,this['data']['customer_required'],c);if(this['data']['order_allocators']!==void 0x0)order_allocators_set(b,f,this['parameter_type'],e,this['data']['order_allocators']?await allocators(b,this['data']['order_allocators']):null,c);if(this['data']['buy_guard']!==void 0x0)buy_guard_set(b,f,this['parameter_type'],e,this['data']['buy_guard'],c);if(this['data']['compensation_fund_add']!=null)await compensation_fund_add(a,b,f,this['parameter_type'],e,this['data']['compensation_fund_add'],c);if(this['data']['compensation_fund_withdraw']!=null){const A=this['_resolved_comp_withdraw_receipt'];if(!A||!a51a(A))a51b('invalid\x20address','compensation_fund_withdraw\x20receipt\x20internal\x20invariant\x20—\x20not\x20pre-resolved:\x20'+JSON['stringify'](this['data']['compensation_fund_withdraw']['receipt']));const B=await paymentInfo(a,b,this['data']['compensation_fund_withdraw']['payment_info'],this['_resolved_comp_withdraw_pi']);compensation_fund_withdraw(b,f,this['parameter_type'],B,A,e,c);}if(this['data']['setting_lock_duration_add']!==void 0x0)setting_lock_duration_add(b,f,this['parameter_type'],e,this['data']['setting_lock_duration_add'],c);if(this['data']['compensation_fund_receive']!=null&&this['object_address']){const C=this['_resolved_comp_fund_receive']!==void 0x0?this['_resolved_comp_fund_receive']:this['data']['compensation_fund_receive'];if(typeof C==='object'&&!Array['isArray'](C)&&'received'in C){if(C['token_type']!==this['parameter_type'])a51b('invalid\x20parameter','token_type\x20'+C['token_type']+'\x20is\x20not\x20equal\x20to\x20parameter_type\x20'+this['parameter_type']);const D=C['received'],E=this['_resolved_comp_items'];if(D?.['length']>0x0){if(!E||E['length']!==D['length'])a51b('invalid\x20parameter','CallService.compensation_fund_receive\x20internal\x20invariant\x20—\x20pre-resolved\x20count\x20mismatch\x20('+(E?.['length']??0x0)+'\x20vs\x20'+D['length']+')');for(let F=0x0;F<D['length'];F++){const G=D[F],H=E[F],I=H?.['id'],J=H?.['payment'];if(!I||!J)a51b('invalid\x20argument\x20type','Compensation\x20fund\x20receive\x20object\x20'+G['id']+'\x20or\x20payment\x20object\x20'+G['payment']+'\x20not\x20found');compensation_fund_receive(b,f,this['parameter_type'],e,I,J,c);}}}else{if(Array['isArray'](C))a51b('invalid\x20parameter','CallService_Data.data.compensation_fund_receive:\x20received\x20is\x20ReceivedNormal[]\x20(expected\x20ReceivedBalance)');}}if(this['data']['owner_receive']!=null&&this['object_address']){const K=this['_resolved_owner_receive']!==void 0x0?this['_resolved_owner_receive']:this['data']['owner_receive'];if(K==='recently')a51b('invalid\x20parameter','CallService.data.owner_receive\x20internal\x20invariant\x20—\x20\x27recently\x27\x20not\x20pre-resolved');await a51v(b,f,e,K,this['parameter_type'],L=>'0x2::service::'+L,c);}if(this['data']['um']!==void 0x0){const L=this['_resolved_um']??null;if(this['data']['um']&&!L)a51b('invalid\x20parameter','CallService_Data.data.um:'+this['data']['um']);um_set(b,f,this['parameter_type'],e,L,c);}if(this['data']['pause']!=null)pause(b,f,this['parameter_type'],e,this['data']['pause'],c);if(this['data']['publish'])publish(b,f,this['parameter_type'],e,c);if(!this['permission_address']){const M=a51j(this['data']?.['object']);await this['new_with_mark'](a,b,'Permission',a51M(b,e),a51j(M['permission']));}if(!this['object_address'])await this['new_with_mark'](a,b,'Service',create(b,f,this['parameter_type']),a51j(this['data']?.['object']));}['order_allowed'](){if(this['content']?.['bPaused'])return a51b('invalid\x20parameter','Service\x20is\x20paused'),![];if(this['content']?.['bPublished']!==!![])return a51b('invalid\x20parameter','Service\x20is\x20not\x20published'),![];return!![];}['checkCustomerRequiredNeedsUm'](){const a=this['content'],b=Array['isArray'](this['data']['customer_required'])?this['data']['customer_required']:a?.['customer_required']??[];if(b['length']===0x0)return;if(!(this['data']['um']!==void 0x0?this['data']['um']:a?.['um']??null))a51b('invalid\x20parameter','customer_required\x20is\x20set\x20to\x20['+b['join'](',\x20')+']\x20but\x20no\x20Contact\x20(um)\x20is\x20configured.\x20The\x20customer\x27s\x20private\x20information\x20is\x20delivered\x20via\x20end-to-end\x20encrypted\x20Messenger,\x20which\x20routes\x20to\x20the\x20Contact\x20object\x20bound\x20as\x20um.\x20Without\x20um\x20there\x20is\x20no\x20channel\x20to\x20receive\x20it.\x20Set\x20um\x20(Contact)\x20together\x20with\x20customer_required.');}};const MAX_SALE_COUNT=a51E,MAX_REPOSITORY_COUNT=a51F,MAX_ARBITRATION_COUNT=a51z,MAX_REWARD_COUNT=a51B,MAX_CUSTOMER_REQUIRED_INFO_COUNT=a51G,MAX_DISCOUNT_COUNT_ONCE=a51D,MAX_DISCOUNT_RECEIVER_ONCE=a51x,MAX_DISCOUNT_TOTAL_COUNT=a51C,MAX_REQUIRED_INFO_SIZE=a51G,DEFAULT_SETTING_LOCK_DURATION=a51I,DEFAULT_LOCK_DURATION=a51I,DISCOUNT_TYPE_RATES=a51A,DISCOUNT_TYPE_MINUS=a51J,MAX_WIP_LENGTH=0x400,MAX_WIP_HASH_LENGTH=0x40;function sale(a,b){if(typeof b['name']==='string'&&!a51p(b['name']))a51b('invalid\x20parameter','Name\x20'+b['name']+'\x20exceeds\x20maximum\x20length\x20256');if(b['wip']['length']>MAX_WIP_LENGTH)a51b('invalid\x20parameter','WIP\x20'+b['wip']+'\x20exceeds\x20maximum\x20length\x20'+MAX_WIP_LENGTH);const c=b['wip'];if(b['wip']['length']>0x0&&!a51f(b['wip']))a51b('invalid\x20url','WIP\x20'+b['wip']+'\x20is\x20not\x20a\x20valid\x20HTTP/HTTPS\x20URL');const d=b['wip_hash']['includes'](':')?b['wip_hash']['split'](':')[0x1]:b['wip_hash'];if(d['length']>MAX_WIP_HASH_LENGTH)a51b('invalid\x20parameter','WIP\x20hash\x20'+d+'\x20exceeds\x20maximum\x20length\x20'+MAX_WIP_HASH_LENGTH);return a['moveCall']({'target':a51o('sale'),'arguments':[a51q(a,b['name']),a['pure']['u64'](b['price']),a['pure']['u64'](b['stock']),a['pure']['bool'](b['suspension']),a51q(a,c),a51q(a,d)]});}function quote_item(a,b){if(!a51p(b['name']))a51b('invalid\x20parameter','Quote\x20item\x20name\x20'+b['name']+'\x20is\x20not\x20valid');if(!a51c(b['stock']))a51b('invalid\x20u64','Quote\x20item\x20stock\x20'+b['stock']+'\x20is\x20not\x20valid');const c=b['wip_hash']['includes'](':')?b['wip_hash']['split'](':')[0x1]:b['wip_hash'];if(c['length']>MAX_WIP_HASH_LENGTH)a51b('invalid\x20parameter','Quote\x20item\x20wip_hash\x20'+c+'\x20exceeds\x20maximum\x20length\x20'+MAX_WIP_HASH_LENGTH);return a['moveCall']({'target':a51o('quote_item'),'arguments':[a51q(a,b['name']),a['pure']['u64'](b['stock']),a51q(a,c)]});}function discount_send(a,b,c){if(b['length']===0x0)return;a51s([...b,c]);if(b['length']>MAX_DISCOUNT_COUNT_ONCE)a51b('invalid\x20parameter','Discount\x20count\x20'+b['length']+'\x20exceeds\x20maximum\x20limit\x20'+MAX_DISCOUNT_COUNT_ONCE);if(b['length']===0x1){a['moveCall']({'target':a51o('discount_send_singleton'),'arguments':[a51l(a,b[0x0]),a['pure']['address'](c)]});return;}else a['moveCall']({'target':a51o('discount_send'),'arguments':[a['makeMoveVec']({'elements':b,'type':'0x2::service::Discount'}),a['pure']['address'](c)]});}function discount_destroy(a,b){a51s([...b]),b['forEach'](c=>{a['moveCall']({'target':a51o('discount_destroy'),'arguments':[a51l(a,c)]});});}const buy=async(a,b,c,d,e,f,g)=>{if(f['items']['length']===0x0)return;a51s([c,f['discount'],e,g]);if(!a51m(d))a51b('invalid\x20parameter','Buy\x20service\x20type\x20'+d+'\x20is\x20not\x20valid');if(!a51g(f['items'],l=>{if(!a51p(l['name']))a51b('invalid\x20parameter','Buy\x20item\x20name\x20'+l['name']+'\x20is\x20not\x20valid');if(!a51c(l['stock']))a51b('invalid\x20u64','Buy\x20item\x20stock\x20'+l['stock']+'\x20is\x20not\x20valid');return!![];}))a51b('invalid\x20parameter','Buy\x20items\x20is\x20not\x20valid');if(typeof f['payment_remark']==='string'&&!a51e(f['payment_remark']))a51b('invalid\x20parameter','Buy\x20payment\x20remark\x20'+f['payment_remark']+'\x20is\x20not\x20valid');f['payment_remark']=f['payment_remark']||'';if(f['payment_index']!=null&&!a51c(f['payment_index']))a51b('invalid\x20u64','Buy\x20payment\x20index\x20'+f['payment_index']+'\x20is\x20not\x20valid');const h=await a51K(a,b,f['total_pay'],d);f['discount']=await LocalMark['Instance']()['get_address'](f['discount']);let i=void 0x0;if(f['discount'])i=b['moveCall']({'target':a51o('quote_with_discount'),'arguments':[a51l(b,c),b['makeMoveVec']({'elements':f['items']['map'](l=>quote_item(b,l)),'type':'0x2::service::QuoteItem'}),a51l(b,f['discount'])],'typeArguments':[d]});else i=b['moveCall']({'target':a51o('quote'),'arguments':[a51l(b,c),b['makeMoveVec']({'elements':f['items']['map'](l=>quote_item(b,l)),'type':'0x2::service::QuoteItem'})],'typeArguments':[d]});let j;if(g)j=b['moveCall']({'target':a51o('buy_with_passport'),'arguments':[a51l(b,c),a51l(b,g),i,b['object']['mutEntityOrder'](),b['object']['mutObjectLinkerTx'](),b['object']['clock']()],'typeArguments':[d]});else j=b['moveCall']({'target':a51o('buy'),'arguments':[a51l(b,c),i,b['object']['mutEntityOrder'](),b['object']['mutObjectLinkerTx'](),b['object']['clock']()],'typeArguments':[d]});const k={'order':j};k['allocation']=b['moveCall']({'target':a51o('order_allocation'),'arguments':[a51l(b,c),a51l(b,j),h,b['pure']['string'](f['payment_remark']??''),b['pure']['u64'](f['payment_index']||0x0),b['object']['mutObjectLinkerTx'](),b['object']['clock']()],'typeArguments':[d]});if(e)k['progress']=b['moveCall']({'target':a51o('order_progress'),'arguments':[a51l(b,c),a51l(b,j),a51l(b,e),b['object']['mutObjectLinkerTx'](),b['object']['clock']()],'typeArguments':[d]});return k;};function newService(a,b,c,d,e){a51s([c,e]);if(typeof d==='string'&&!a51d(d))a51b('invalid\x20description','Description\x20exceeds\x20maximum\x20length\x20'+a51r);if(!a51m(b))a51b('invalid\x20parameter','New\x20service\x20type\x20'+b+'\x20is\x20not\x20valid');if(e)return a['moveCall']({'target':a51o('new_with_passport'),'arguments':[a51l(a,c),a51l(a,e),a51q(a,d),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[b]});else return a['moveCall']({'target':a51o('new'),'arguments':[a51l(a,c),a51q(a,d),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[b]});}function description_set(a,b,c,d,e,f){a51s([b,d,f]);if(typeof e==='string'&&!a51d(e))a51b('invalid\x20description','Description\x20exceeds\x20maximum\x20length\x20'+a51r);if(!a51m(c))a51b('invalid\x20parameter','Description\x20set\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a51o('description_set_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a51q(a,e)],'typeArguments':[c]});else a['moveCall']({'target':a51o('description_set'),'arguments':[a51l(a,b),a51l(a,d),a51q(a,e)],'typeArguments':[c]});}function um_set(a,b,c,d,e,f){a51s([b,d]);if(!a51m(c))a51b('invalid\x20parameter','Service\x20type\x20'+c+'\x20is\x20not\x20valid');if(e){if(f)a['moveCall']({'target':a51o('um_set_with_passport'),'arguments':[a51l(a,b),a51l(a,d),f,a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('um_set'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});}else{if(f)a['moveCall']({'target':a51o('um_none_with_passport'),'arguments':[a51l(a,b),a51l(a,d),f,a['object']['mutObjectLinkerCore']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('um_none'),'arguments':[a51l(a,b),a51l(a,d),a['object']['mutObjectLinkerCore']()],'typeArguments':[c]});}}function location_set(a,b,c,d,e,f){a51s([b,d,f]);if(typeof e==='string'&&!a51p(e))a51b('invalid\x20parameter','Location\x20'+e+'\x20exceeds\x20maximum\x20length\x20256');if(!a51m(c))a51b('invalid\x20parameter','Location\x20set\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a51o('location_set_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a51q(a,e)],'typeArguments':[c]});else a['moveCall']({'target':a51o('location_set'),'arguments':[a51l(a,b),a51l(a,d),a51q(a,e)],'typeArguments':[c]});}function create(a,b,c){a51s([b]);if(!a51m(c))a51b('invalid\x20parameter','Create\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');return a['moveCall']({'target':a51o('create'),'arguments':[a51l(a,b)],'typeArguments':[c]});}function sales_add(a,b,c,d,e,f){if(e['length']===0x0)return;a51s([b,d,f]);if(!a51m(c))a51b('invalid\x20parameter','Sales\x20add\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a51o('sales_add_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a['makeMoveVec']({'elements':e['map'](g=>sale(a,g)),'type':'0x2::service::Sale'})],'typeArguments':[c]});else a['moveCall']({'target':a51o('sales_add'),'arguments':[a51l(a,b),a51l(a,d),a['makeMoveVec']({'elements':e['map'](g=>sale(a,g)),'type':'0x2::service::Sale'})],'typeArguments':[c]});}function sales_remove(a,b,c,d,e,f){if(e['length']===0x0)return;a51s([b,d,f]);if(!a51m(c))a51b('invalid\x20parameter','Sales\x20remove\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a51o('sales_remove_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a['pure']['vector']('string',e)],'typeArguments':[c]});else a['moveCall']({'target':a51o('sales_remove'),'arguments':[a51l(a,b),a51l(a,d),a['pure']['vector']('string',e)],'typeArguments':[c]});}function sales_clear(a,b,c,d,e){a51s([b,d,e]);if(!a51m(c))a51b('invalid\x20parameter','Sales\x20clear\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(e)a['moveCall']({'target':a51o('sales_clear_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,e)],'typeArguments':[c]});else a['moveCall']({'target':a51o('sales_clear'),'arguments':[a51l(a,b),a51l(a,d)],'typeArguments':[c]});}function sales_set(a,b,c,d,e,f){if(e['length']===0x0)return;a51s([b,d,f]);if(!a51m(c))a51b('invalid\x20parameter','Sales\x20set\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a51o('sales_set_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a['makeMoveVec']({'elements':e['map'](g=>sale(a,g)),'type':'0x2::service::Sale'})],'typeArguments':[c]});else a['moveCall']({'target':a51o('sales_set'),'arguments':[a51l(a,b),a51l(a,d),a['makeMoveVec']({'elements':e['map'](g=>sale(a,g)),'type':'0x2::service::Sale'})],'typeArguments':[c]});}function price_add(a,b,c,d,e,f,g){a51s([b,d,g]);if(!a51m(c))a51b('invalid\x20parameter','Price\x20add\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(typeof e==='string'&&!a51p(e))a51b('invalid\x20parameter','Sale\x20name\x20'+e+'\x20exceeds\x20maximum\x20length\x20256');if(!a51c(f))a51b('invalid\x20u64','Price\x20add\x20'+f+'\x20is\x20not\x20valid');if(g)a['moveCall']({'target':a51o('price_add_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,g),a51q(a,e),a['pure']['u64'](f)],'typeArguments':[c]});else a['moveCall']({'target':a51o('price_add'),'arguments':[a51l(a,b),a51l(a,d),a51q(a,e),a['pure']['u64'](f)],'typeArguments':[c]});}function price_reduce(a,b,c,d,e,f,g){a51s([b,d,g]);if(!a51m(c))a51b('invalid\x20parameter','Price\x20reduce\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(typeof e==='string'&&!a51p(e))a51b('invalid\x20parameter','Sale\x20name\x20'+e+'\x20exceeds\x20maximum\x20length\x20256');if(!a51c(f))a51b('invalid\x20u64','Price\x20reduce\x20'+f+'\x20is\x20not\x20valid');if(g)a['moveCall']({'target':a51o('price_reduce_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,g),a51q(a,e),a['pure']['u64'](f)],'typeArguments':[c]});else a['moveCall']({'target':a51o('price_reduce'),'arguments':[a51l(a,b),a51l(a,d),a51q(a,e),a['pure']['u64'](f)],'typeArguments':[c]});}function stock_add(a,b,c,d,e,f,g){a51s([b,d,g]);if(!a51m(c))a51b('invalid\x20parameter','Stock\x20add\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(typeof e==='string'&&!a51p(e))a51b('invalid\x20parameter','Sale\x20name\x20'+e+'\x20exceeds\x20maximum\x20length\x20256');if(!a51c(f))a51b('invalid\x20u64','Stock\x20add\x20'+f+'\x20is\x20not\x20valid');if(g)a['moveCall']({'target':a51o('stock_add_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,g),a51q(a,e),a['pure']['u64'](f)],'typeArguments':[c]});else a['moveCall']({'target':a51o('stock_add'),'arguments':[a51l(a,b),a51l(a,d),a51q(a,e),a['pure']['u64'](f)],'typeArguments':[c]});}function stock_reduce(a,b,c,d,e,f,g){a51s([b,d,g]);if(!a51m(c))a51b('invalid\x20parameter','Stock\x20reduce\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(typeof e==='string'&&!a51p(e))a51b('invalid\x20parameter','Sale\x20name\x20'+e+'\x20exceeds\x20maximum\x20length\x20256');if(!a51c(f))a51b('invalid\x20u64','Stock\x20reduce\x20'+f+'\x20is\x20not\x20valid');if(g)a['moveCall']({'target':a51o('stock_reduce_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,g),a51q(a,e),a['pure']['u64'](f)],'typeArguments':[c]});else a['moveCall']({'target':a51o('stock_reduce'),'arguments':[a51l(a,b),a51l(a,d),a51q(a,e),a['pure']['u64'](f)],'typeArguments':[c]});}function sale_suspension(a,b,c,d,e,f,g){a51s([b,d,g]);if(!a51m(c))a51b('invalid\x20parameter','Sale\x20suspension\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(typeof e==='string'&&!a51p(e))a51b('invalid\x20parameter','Sale\x20name\x20'+e+'\x20exceeds\x20maximum\x20length\x20256');if(g)a['moveCall']({'target':a51o('sale_suspension_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,g),a51q(a,e),a['pure']['bool'](f)],'typeArguments':[c]});else a['moveCall']({'target':a51o('sale_suspension'),'arguments':[a51l(a,b),a51l(a,d),a51q(a,e),a['pure']['bool'](f)],'typeArguments':[c]});}function repository_add(a,b,c,d,e,f){a51s([b,d,e,f]);if(!a51m(c))a51b('invalid\x20parameter','Repository\x20add\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a51o('repository_add_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('repository_add'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});}function repository_remove(a,b,c,d,e,f){if(e['length']===0x0)return;a51s([b,d,f,...e]);if(!a51m(c))a51b('invalid\x20parameter','Repository\x20remove\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a51o('repository_remove_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a['pure']['vector']('address',e),a['object']['mutObjectLinkerCore']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('repository_remove'),'arguments':[a51l(a,b),a51l(a,d),a['pure']['vector']('address',e),a['object']['mutObjectLinkerCore']()],'typeArguments':[c]});}function repository_clear(a,b,c,d,e){a51s([b,d,e]);if(!a51m(c))a51b('invalid\x20parameter','Repository\x20clear\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(e)a['moveCall']({'target':a51o('repository_clear_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,e),a['object']['mutObjectLinkerCore']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('repository_clear'),'arguments':[a51l(a,b),a51l(a,d),a['object']['mutObjectLinkerCore']()],'typeArguments':[c]});}function buy_guard_set(a,b,c,d,e,f){a51s([b,d,e,f]);if(!a51m(c))a51b('invalid\x20parameter','Buy\x20guard\x20set\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f){if(e)a['moveCall']({'target':a51o('buy_guard_set_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('buy_guard_none_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a['object']['mutObjectLinkerCore']()],'typeArguments':[c]});}else{if(e)a['moveCall']({'target':a51o('buy_guard_set'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('buy_guard_none'),'arguments':[a51l(a,b),a51l(a,d),a['object']['mutObjectLinkerCore']()],'typeArguments':[c]});}}function machine_set(a,b,c,d,e,f){a51s([b,d,e,f]);if(!a51m(c))a51b('invalid\x20parameter','Machine\x20set\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f){if(e)a['moveCall']({'target':a51o('machine_set_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('machine_none_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a['object']['mutObjectLinkerCore']()],'typeArguments':[c]});}else{if(e)a['moveCall']({'target':a51o('machine_set'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('machine_none'),'arguments':[a51l(a,b),a51l(a,d),a['object']['mutObjectLinkerCore']()],'typeArguments':[c]});}}function publish(a,b,c,d,e){a51s([b,d,e]);if(!a51m(c))a51b('invalid\x20parameter','Publish\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(e)a['moveCall']({'target':a51o('publish_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,e)],'typeArguments':[c]});else a['moveCall']({'target':a51o('publish'),'arguments':[a51l(a,b),a51l(a,d)],'typeArguments':[c]});}function pause(a,b,c,d,e,f){a51s([b,d,f]);if(!a51m(c))a51b('invalid\x20parameter','Pause\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a51o('pause_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a['pure']['bool'](e),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('pause'),'arguments':[a51l(a,b),a51l(a,d),a['pure']['bool'](e),a['object']['clock']()],'typeArguments':[c]});}function customer_required_set(a,b,c,d,e,f){if(e['length']>MAX_REQUIRED_INFO_SIZE)a51b('invalid\x20parameter','Customer\x20required\x20set\x20size\x20'+e['length']+'\x20is\x20exceed\x20maximum\x20size\x20'+MAX_REQUIRED_INFO_SIZE);a51s([b,d,f]);if(!a51m(c))a51b('invalid\x20parameter','Customer\x20required\x20set\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');e['forEach'](g=>{if(!a51e(g))a51b('invalid\x20parameter','Customer\x20required\x20info\x20'+g+'\x20is\x20exceed\x20maximum\x20length\x2064\x20or\x20start\x20with\x20\x220x\x22');});if(f)a['moveCall']({'target':a51o('custom_required_info_set_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a['pure']['vector']('string',e)],'typeArguments':[c]});else a['moveCall']({'target':a51o('custom_required_info_set'),'arguments':[a51l(a,b),a51l(a,d),a['pure']['vector']('string',e)],'typeArguments':[c]});}function arbitrations_add(a,b,c,d,e,f,g){a51s([b,d,e,g]);if(!a51m(c))a51b('invalid\x20parameter','Arbitrations\x20add\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a51m(f))a51b('invalid\x20parameter','Arbitrations\x20add\x20arbitration\x20type\x20'+f+'\x20is\x20not\x20valid');if(g)a['moveCall']({'target':a51o('arbitration_add_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,g),a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c,f]});else a['moveCall']({'target':a51o('arbitration_add'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c,f]});}function arbitrations_remove(a,b,c,d,e,f){if(e['length']===0x0)return;a51s([b,d,f]);if(!a51m(c))a51b('invalid\x20parameter','Arbitrations\x20remove\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a51o('arbitration_remove_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a['pure']['vector']('address',e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('arbitration_remove'),'arguments':[a51l(a,b),a51l(a,d),a['pure']['vector']('address',e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});}function arbitration_clear(a,b,c,d,e){a51s([b,d,e]);if(!a51m(c))a51b('invalid\x20parameter','Arbitrations\x20clear\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(e)a['moveCall']({'target':a51o('arbitration_clear_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('arbitration_clear'),'arguments':[a51l(a,b),a51l(a,d),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});}async function compensation_fund_add(a,b,c,d,e,f,g){a51s([c,e,g]);if(!a51m(d))a51b('invalid\x20parameter','Compensation\x20fund\x20add\x20service\x20type\x20'+d+'\x20is\x20not\x20valid');const h=await a51K(a,b,f,d);if(g)b['moveCall']({'target':a51o('compensation_fund_add_with_passport'),'arguments':[a51l(b,c),a51l(b,e),a51l(b,g),h],'typeArguments':[d]});else b['moveCall']({'target':a51o('compensation_fund_add'),'arguments':[a51l(b,c),a51l(b,e),h],'typeArguments':[d]});}function setting_lock_duration_add(a,b,c,d,e,f){if(!a51c(e)||e===0x0)return;a51s([b,d,f]);if(!a51m(c))a51b('invalid\x20parameter','setting_lock_duration_add\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a51o('setting_lock_duration_add_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a['pure']['u64'](e)],'typeArguments':[c]});else a['moveCall']({'target':a51o('setting_lock_duration_add'),'arguments':[a51l(a,b),a51l(a,d),a['pure']['u64'](e)],'typeArguments':[c]});}function order_allocators_set(a,b,c,d,e,f){a51s([b,d,e,f]);if(!a51m(c))a51b('invalid\x20parameter','Order\x20allocators\x20set\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a51o('order_allocators_set_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a['object']['option']({'type':'0x2::allocation::Allocators','value':e??null})],'typeArguments':[c]});else a['moveCall']({'target':a51o('order_allocators_set'),'arguments':[a51l(a,b),a51l(a,d),a['object']['option']({'type':'0x2::allocation::Allocators','value':e??null})],'typeArguments':[c]});}function reward_add(a,b,c,d,e,f,g){a51s([b,d,e,g]);if(!a51m(c))a51b('invalid\x20parameter','Rewards\x20add\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a51m(f))a51b('invalid\x20parameter','Rewards\x20add\x20reward\x20type\x20'+f+'\x20is\x20not\x20valid');if(g)a['moveCall']({'target':a51o('reward_add_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,g),a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c,f]});else a['moveCall']({'target':a51o('reward_add'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c,f]});}function reward_remove(a,b,c,d,e,f){if(e['length']===0x0)return;a51s([b,d,f]);if(!a51m(c))a51b('invalid\x20parameter','Rewards\x20remove\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a51o('reward_remove_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a['pure']['vector']('address',e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('reward_remove'),'arguments':[a51l(a,b),a51l(a,d),a['pure']['vector']('address',e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});}function reward_clear(a,b,c,d,e){a51s([b,d,e]);if(!a51m(c))a51b('invalid\x20parameter','Rewards\x20clear\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(e)a['moveCall']({'target':a51o('reward_clear_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,e),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('reward_clear'),'arguments':[a51l(a,b),a51l(a,d),a['object']['mutObjectLinkerCore'](),a['object']['clock']()],'typeArguments':[c]});}function compensation_fund_receive(a,b,c,d,e,f,g){if(!f)a51b('invalid\x20parameter','Compensation\x20fund\x20receive\x20payment\x20is\x20required');a51s([b,d,e,f,g]);if(!a51m(c))a51b('invalid\x20parameter','Compensation\x20fund\x20receive\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(g)a['moveCall']({'target':a51o('compensation_fund_receive_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,g),a51l(a,e),a51l(a,f)],'typeArguments':[c]});else a['moveCall']({'target':a51o('compensation_fund_receive'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,e),a51l(a,f)],'typeArguments':[c]});}function compensation_fund_withdraw(a,b,c,d,e,f,g){a51s([b,f,e,d,g]);if(!a51m(c))a51b('invalid\x20parameter','Compensation\x20fund\x20withdraw\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(g)a['moveCall']({'target':a51o('compensation_fund_withdraw_with_passport'),'arguments':[a51l(a,b),a51l(a,f),a51l(a,g),a['pure']['address'](e),a51l(a,d),a['object']['mutObjectLinkerTx'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('compensation_fund_withdraw'),'arguments':[a51l(a,b),a51l(a,f),a['pure']['address'](e),a51l(a,d),a['object']['mutObjectLinkerTx'](),a['object']['clock']()],'typeArguments':[c]});}async function discount(a,b,c,d,e,f){let g=[];if(Array['isArray'](e['recipient']))g=e['recipient'];else g=await GetManyAccountOrMark_Address(e['recipient']);if(g['length']===0x0||e['count']===0x0)return;if(g['length']>MAX_DISCOUNT_RECEIVER_ONCE)a51b('invalid\x20parameter','Discount\x20recipient\x20length\x20'+g['length']+'\x20is\x20exceed\x20max\x20'+MAX_DISCOUNT_RECEIVER_ONCE);if(!a51e(e['name']))a51b('invalid\x20parameter','Discount\x20name\x20'+e['name']+'\x20is\x20not\x20valid');if(!a51h(e['count'])||e['count']>MAX_DISCOUNT_COUNT_ONCE)a51b('invalid\x20parameter','Discount\x20count\x20'+e['count']+'\x20is\x20exceed\x20max\x20'+MAX_DISCOUNT_COUNT_ONCE);if(g['length']*e['count']>MAX_DISCOUNT_TOTAL_COUNT)a51b('invalid\x20parameter','Discount\x20total\x20count\x20'+g['length']*e['count']+'\x20is\x20exceed\x20max\x20'+MAX_DISCOUNT_TOTAL_COUNT);if(e['benchmark']!=null&&!a51c(e['benchmark']))a51b('invalid\x20parameter','Discount\x20benchmark\x20'+e['benchmark']+'\x20is\x20not\x20valid');const h=e['time_ms_start']??Date['now']();if(e['time_ms_end']<h)a51b('invalid\x20parameter','Discount\x20time_ms_end\x20'+e['time_ms_end']+'\x20is\x20not\x20valid');if(e['discount_value']!=null&&!a51c(e['discount_value']))a51b('invalid\x20parameter','Discount\x20discount_value\x20'+e['discount_value']+'\x20is\x20not\x20valid');a51s([b,d,f,...g]);if(!a51m(c))a51b('invalid\x20parameter','Discount\x20service\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a51o('discount_with_passport'),'arguments':[a51l(a,b),a51l(a,d),a51l(a,f),a['pure']['string'](e['name']),a['pure']['u8'](e['discount_type']),a['pure']['u64'](e['discount_value']),a['pure']['option']('u64',e['benchmark']??null),a['pure']['bool'](e['transferable']),a['pure']['option']('u64',e['time_ms_start']??null),a['pure']['u64'](e['time_ms_end']),a['pure']['u16'](e['count']),a['pure']['vector']('address',g),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a51o('discount'),'arguments':[a51l(a,b),a51l(a,d),a['pure']['string'](e['name']),a['pure']['u8'](e['discount_type']),a['pure']['u64'](e['discount_value']),a['pure']['option']('u64',e['benchmark']??null),a['pure']['bool'](e['transferable']),a['pure']['option']('u64',e['time_ms_start']??null),a['pure']['u64'](e['time_ms_end']),a['pure']['u16'](e['count']),a['pure']['vector']('address',g),a['object']['clock']()],'typeArguments':[c]});}export{CallOrder as $,location_set as A,repository_remove as B,compensation_fund_withdraw as C,discount as D,description_set as E,price_add as F,sales_add as G,reward_clear as H,price_reduce as I,sales_set as J,sales_clear as K,publish as L,newService as M,order_allocators_set as N,discount_destroy as O,pause as P,um_set as Q,repository_add as R,compensation_fund_receive as S,customer_required_set as T,reward_remove as U,reward_add as V,sale_suspension as W,stock_add as X,setting_lock_duration_add as Y,stock_reduce as Z,arbitrations_add as _,DISCOUNT_TYPE_RATES as a,buy_guard_set as b,MAX_DISCOUNT_COUNT_ONCE as c,MAX_REPOSITORY_COUNT as d,MAX_REQUIRED_INFO_SIZE as f,arbitration_clear as g,NAMED_OPERATOR_ORDER_PAYER as h,DISCOUNT_TYPE_MINUS as i,machine_set as j,discount_send as k,MAX_DISCOUNT_RECEIVER_ONCE as l,MAX_SALE_COUNT as m,DEFAULT_LOCK_DURATION as n,MAX_ARBITRATION_COUNT as o,MAX_REWARD_COUNT as p,sales_remove as q,DEFAULT_SETTING_LOCK_DURATION as r,MAX_CUSTOMER_REQUIRED_INFO_COUNT as s,CallService as t,MAX_DISCOUNT_TOTAL_COUNT as u,arbitrations_remove as v,create as w,compensation_fund_add as x,buy as y,repository_clear as z};
@@ -0,0 +1 @@
1
+ import{getWowDir}from'./w/local/util.mjs';import a52a from'libsql';import*as a52b from'path';import*as a52c from'fs';var AsyncLock=class{constructor(){this['_locked']=![],this['_queue']=[];}async['acquire'](){if(!this['_locked']){this['_locked']=!![];return;}return new Promise(a=>{this['_queue']['push'](a);});}['release'](){if(this['_queue']['length']>0x0)this['_queue']['shift']()();else this['_locked']=![];}async['run'](a){await this['acquire']();try{return await a();}finally{this['release']();}}};const WOW_DIR=getWowDir(),CACHE_DB_PATH=a52b['join'](WOW_DIR,'cache.db'),ACCOUNT_DB_PATH=a52b['join'](WOW_DIR,'account.db');function ensureWowDirExists(){if(!a52c['existsSync'](WOW_DIR))a52c['mkdirSync'](WOW_DIR,{'recursive':!![]});}ensureWowDirExists();function getCacheDatabase(){ensureWowDirExists();const a=new a52a(CACHE_DB_PATH);a['pragma']('journal_mode\x20=\x20WAL'),a['pragma']('synchronous\x20=\x20NORMAL'),a['pragma']('busy_timeout\x20=\x205000');try{a['pragma']('wal_checkpoint(FULL)');}catch{}return a['exec']('\x0a\x09\x09CREATE\x20TABLE\x20IF\x20NOT\x20EXISTS\x20cache\x20(\x0a\x09\x09\x09key\x20TEXT\x20PRIMARY\x20KEY,\x0a\x09\x09\x09value\x20TEXT\x20NOT\x20NULL,\x0a\x09\x09\x09updated_at\x20INTEGER\x20DEFAULT\x20(strftime(\x27%s\x27,\x20\x27now\x27))\x0a\x09\x09);\x0a\x09'),a;}let cacheDbInstance=null;new AsyncLock();function getCacheDb(){if(cacheDbInstance)return cacheDbInstance;if(!cacheDbInstance)cacheDbInstance=getCacheDatabase();return cacheDbInstance;}function getAccountDatabase(){ensureWowDirExists();const a=new a52a(ACCOUNT_DB_PATH);a['pragma']('journal_mode\x20=\x20WAL'),a['pragma']('synchronous\x20=\x20NORMAL'),a['pragma']('busy_timeout\x20=\x205000');try{a['pragma']('wal_checkpoint(FULL)');}catch{}try{a52c['chmodSync'](ACCOUNT_DB_PATH,0x180);}catch{}return a['exec']('\x0a\x09\x09CREATE\x20TABLE\x20IF\x20NOT\x20EXISTS\x20accounts\x20(\x0a\x09\x09\x09id\x20INTEGER\x20PRIMARY\x20KEY\x20CHECK\x20(id\x20=\x201),\x0a\x09\x09\x09data\x20TEXT\x20NOT\x20NULL,\x0a\x09\x09\x09updated_at\x20INTEGER\x20DEFAULT\x20(strftime(\x27%s\x27,\x20\x27now\x27))\x0a\x09\x09);\x0a\x09'),a;}let accountDbInstance=null;new AsyncLock();function getAccountDb(){if(accountDbInstance)return accountDbInstance;if(!accountDbInstance)accountDbInstance=getAccountDatabase();return accountDbInstance;}const KEY_METADATA_TABLE='key_metadata';var SQLiteStorage=class{constructor(a){this['_dbSource']=a;}get['db'](){if(this['_dbSource'])return this['_dbSource'];if(!this['_db'])this['_db']=getCacheDb();return this['_db'];}async['get'](a){return this['db']['prepare']('SELECT\x20value\x20FROM\x20cache\x20WHERE\x20key\x20=\x20?')['get'](a)?.['value'];}async['getMany'](a){const b=a['map'](()=>'?')['join'](','),c=this['db']['prepare']('SELECT\x20key,\x20value\x20FROM\x20cache\x20WHERE\x20key\x20IN\x20('+b+')')['all'](...a),d=new Map(c['map'](e=>[e['key'],e['value']]));return a['map'](e=>d['get'](e));}async['put'](a,b){this['db']['prepare']('\x0a\x09\x09\x09INSERT\x20INTO\x20cache\x20(key,\x20value,\x20updated_at)\x20\x0a\x09\x09\x09VALUES\x20(?,\x20?,\x20strftime(\x27%s\x27,\x20\x27now\x27))\x0a\x09\x09\x09ON\x20CONFLICT(key)\x20DO\x20UPDATE\x20SET\x20value\x20=\x20excluded.value,\x20updated_at\x20=\x20excluded.updated_at\x0a\x09\x09')['run'](a,b);}async['putMany'](a){const b=this['db']['prepare']('\x0a\x09\x09\x09INSERT\x20INTO\x20cache\x20(key,\x20value,\x20updated_at)\x20\x0a\x09\x09\x09VALUES\x20(?,\x20?,\x20strftime(\x27%s\x27,\x20\x27now\x27))\x0a\x09\x09\x09ON\x20CONFLICT(key)\x20DO\x20UPDATE\x20SET\x20value\x20=\x20excluded.value,\x20updated_at\x20=\x20excluded.updated_at\x0a\x09\x09');this['db']['transaction'](c=>{for(const d of c)b['run'](d['key'],d['value']);})(a);}async['del'](a){this['db']['prepare']('DELETE\x20FROM\x20cache\x20WHERE\x20key\x20=\x20?')['run'](a);}async['delByPrefix'](a){this['db']['prepare']('DELETE\x20FROM\x20cache\x20WHERE\x20key\x20LIKE\x20?')['run'](a+'%');}async['list'](a){if(a)return this['db']['prepare']('SELECT\x20key,\x20value\x20FROM\x20cache\x20WHERE\x20key\x20LIKE\x20?')['all'](a+'%');return this['db']['prepare']('SELECT\x20key,\x20value\x20FROM\x20cache')['all']();}async['clear'](){this['db']['exec']('DELETE\x20FROM\x20cache');}},UserModeStorage=class{constructor(a){this['_tableInitialized']=![],this['_dbSource']=a;}get['db'](){const a=this['_dbSource']??(this['_db']??=getCacheDb());return!this['_tableInitialized']&&(a['exec']('\x0a\x09\x09\x09\x09CREATE\x20TABLE\x20IF\x20NOT\x20EXISTS\x20user_modes\x20(\x0a\x09\x09\x09\x09\x09owner\x20TEXT\x20NOT\x20NULL,\x0a\x09\x09\x09\x09\x09name\x20TEXT\x20NOT\x20NULL,\x0a\x09\x09\x09\x09\x09data\x20TEXT\x20NOT\x20NULL,\x0a\x09\x09\x09\x09\x09updated_at\x20INTEGER\x20DEFAULT\x20(strftime(\x27%s\x27,\x20\x27now\x27)),\x0a\x09\x09\x09\x09\x09PRIMARY\x20KEY\x20(owner,\x20name)\x0a\x09\x09\x09\x09);\x0a\x09\x09\x09'),this['_tableInitialized']=!![]),a;}async['save'](a,b,c){this['db']['prepare']('\x0a\x09\x09\x09INSERT\x20INTO\x20user_modes\x20(owner,\x20name,\x20data,\x20updated_at)\x0a\x09\x09\x09VALUES\x20(?,\x20?,\x20?,\x20strftime(\x27%s\x27,\x20\x27now\x27))\x0a\x09\x09\x09ON\x20CONFLICT(owner,\x20name)\x20DO\x20UPDATE\x20SET\x20data\x20=\x20excluded.data,\x20updated_at\x20=\x20excluded.updated_at\x0a\x09\x09')['run'](a,b,c);}async['get'](a,b){return this['db']['prepare']('SELECT\x20data\x20FROM\x20user_modes\x20WHERE\x20owner\x20=\x20?\x20AND\x20name\x20=\x20?')['get'](a,b)?.['data'];}async['list'](a){if(a!==void 0x0)return this['db']['prepare']('SELECT\x20owner,\x20name,\x20data,\x20updated_at\x20FROM\x20user_modes\x20WHERE\x20owner\x20=\x20?\x20ORDER\x20BY\x20name')['all'](a);return this['db']['prepare']('SELECT\x20owner,\x20name,\x20data,\x20updated_at\x20FROM\x20user_modes\x20ORDER\x20BY\x20owner,\x20name')['all']();}async['delete'](a,b){return this['db']['prepare']('DELETE\x20FROM\x20user_modes\x20WHERE\x20owner\x20=\x20?\x20AND\x20name\x20=\x20?')['run'](a,b)['changes']>0x0;}},SQLiteAccountStorage=class{constructor(a,b='accounts'){this['_tableName']=b,this['_tableInitialized']=![],this['_dbSource']=a;}get['db'](){if(this['_dbSource'])return this['_dbSource'];if(!this['_db'])this['_db']=getAccountDb();return!this['_tableInitialized']&&this['_tableName']!=='accounts'&&(this['_db']['exec']('\x0a\x09\x09\x09\x09CREATE\x20TABLE\x20IF\x20NOT\x20EXISTS\x20'+this['_tableName']+'\x20(\x0a\x09\x09\x09\x09\x09id\x20INTEGER\x20PRIMARY\x20KEY\x20CHECK\x20(id\x20=\x201),\x0a\x09\x09\x09\x09\x09data\x20TEXT\x20NOT\x20NULL,\x0a\x09\x09\x09\x09\x09updated_at\x20INTEGER\x20DEFAULT\x20(strftime(\x27%s\x27,\x20\x27now\x27))\x0a\x09\x09\x09\x09);\x0a\x09\x09\x09'),this['_tableInitialized']=!![]),this['_db'];}async['get'](){return this['db']['prepare']('SELECT\x20data\x20FROM\x20'+this['_tableName']+'\x20WHERE\x20id\x20=\x201')['get']()?.['data'];}async['put'](a){this['db']['prepare']('\x0a\x09\x09\x09INSERT\x20INTO\x20'+this['_tableName']+'\x20(id,\x20data,\x20updated_at)\x0a\x09\x09\x09VALUES\x20(1,\x20?,\x20strftime(\x27%s\x27,\x20\x27now\x27))\x0a\x09\x09\x09ON\x20CONFLICT(id)\x20DO\x20UPDATE\x20SET\x20data\x20=\x20excluded.data,\x20updated_at\x20=\x20excluded.updated_at\x0a\x09\x09')['run'](a);try{this['db']['pragma']('wal_checkpoint(FULL)');}catch{}}async['clear'](){this['db']['exec']('DELETE\x20FROM\x20'+this['_tableName']);}};function resetAllDbConnections(){if(cacheDbInstance){try{cacheDbInstance['close']();}catch(a){}cacheDbInstance=null;}if(accountDbInstance){try{accountDbInstance['close']();}catch(b){}accountDbInstance=null;}}process['on']('exit',()=>{resetAllDbConnections();}),process['on']('SIGINT',()=>{resetAllDbConnections();}),process['on']('SIGTERM',()=>{resetAllDbConnections();});function clearKeyMetadata(){try{getAccountDb()['exec']('DELETE\x20FROM\x20'+KEY_METADATA_TABLE);}catch{}}function resetAllStorage(){clearKeyMetadata(),resetAllDbConnections();}const defaultStorage=new SQLiteStorage(),defaultAccountStorage=new SQLiteAccountStorage();export{clearKeyMetadata as a,getAccountDb as c,AsyncLock as d,UserModeStorage as i,resetAllDbConnections as l,SQLiteAccountStorage as n,defaultAccountStorage as o,SQLiteStorage as r,defaultStorage as s,KEY_METADATA_TABLE as t,resetAllStorage as u};
@@ -1,2 +1,2 @@
1
- import { $ as TransactionObjectInput, Bx as GasData, Fx as SerializedTransactionDataV2, Hx as TransactionData, Ix as SerializedTransactionDataV1, Lx as Argument, Px as TransactionDataBuilder, Q as TransactionObjectArgument, Rx as CallArg, Vx as ObjectRef, Z as Transaction, _ as SerialTransactionExecutor, at as Inputs, b as getPureBcsSchema, ct as TransactionInput, et as TransactionResult, f as isArgument, g as ParallelTransactionExecutorOptions, h as ParallelTransactionExecutor, it as TransactionPlugin, lt as UpgradePolicy, m as coinWithBalance, nt as BuildTransactionOptions, ot as TransactionArgument, p as Arguments, rt as SerializeTransactionOptions, st as TransactionCommands, tt as isTransaction, v as AsyncCache, x as normalizedTypeToMoveTypeSignature, y as ObjectCache, zx as Command } from "../index-ByXPNYyQ.mjs";
1
+ import { $ as TransactionObjectInput, CS as GasData, Q as TransactionObjectArgument, SS as Command, TS as TransactionData, Z as Transaction, _ as SerialTransactionExecutor, _S as TransactionDataBuilder, at as Inputs, b as getPureBcsSchema, bS as Argument, ct as TransactionInput, et as TransactionResult, f as isArgument, g as ParallelTransactionExecutorOptions, h as ParallelTransactionExecutor, it as TransactionPlugin, lt as UpgradePolicy, m as coinWithBalance, nt as BuildTransactionOptions, ot as TransactionArgument, p as Arguments, rt as SerializeTransactionOptions, st as TransactionCommands, tt as isTransaction, v as AsyncCache, vS as SerializedTransactionDataV2, wS as ObjectRef, x as normalizedTypeToMoveTypeSignature, xS as CallArg, y as ObjectCache, yS as SerializedTransactionDataV1 } from "../index-OlNG95EF.mjs";
2
2
  export { type Argument, Arguments, AsyncCache, type BuildTransactionOptions, type CallArg, type Command, type GasData, Inputs, ObjectCache, type ObjectRef, ParallelTransactionExecutor, type ParallelTransactionExecutorOptions, SerialTransactionExecutor, type SerializeTransactionOptions, type SerializedTransactionDataV1, type SerializedTransactionDataV2, Transaction, type TransactionArgument, TransactionCommands, type TransactionData, TransactionDataBuilder, type TransactionInput, type TransactionObjectArgument, type TransactionObjectInput, type TransactionPlugin, type TransactionResult, UpgradePolicy, coinWithBalance, getPureBcsSchema, isArgument, isTransaction, normalizedTypeToMoveTypeSignature };
@@ -1 +1 @@
1
- import{_ as a53a,c as a53b,d as a53c,f as a53d,g as a53e,l as a53f,n as a53g,r as a53h,t as a53i,u as a53j}from'../Transaction-DcFD1-9u.mjs';import{a as a53k,i as a53l,n as a53m,r as a53n,t as a53o}from'../transactions-dZ1GjC4C.mjs';export{a53o as Arguments,a53l as AsyncCache,a53j as Inputs,a53k as ObjectCache,a53m as ParallelTransactionExecutor,a53n as SerialTransactionExecutor,a53i as Transaction,a53c as TransactionCommands,a53e as TransactionDataBuilder,a53d as UpgradePolicy,a53h as coinWithBalance,a53b as getPureBcsSchema,a53a as isArgument,a53g as isTransaction,a53f as normalizedTypeToMoveTypeSignature};
1
+ import{_ as a53a,c as a53b,d as a53c,f as a53d,g as a53e,l as a53f,n as a53g,r as a53h,t as a53i,u as a53j}from'../Transaction-BlZi1w6F.mjs';import{a as a53k,i as a53l,n as a53m,r as a53n,t as a53o}from'../transactions-Cpkdf1BJ.mjs';export{a53o as Arguments,a53l as AsyncCache,a53j as Inputs,a53k as ObjectCache,a53m as ParallelTransactionExecutor,a53n as SerialTransactionExecutor,a53i as Transaction,a53c as TransactionCommands,a53e as TransactionDataBuilder,a53d as UpgradePolicy,a53h as coinWithBalance,a53b as getPureBcsSchema,a53a as isArgument,a53g as isTransaction,a53f as normalizedTypeToMoveTypeSignature};
@@ -1 +1 @@
1
- import{c as a54a}from'./wow-types-DcqbnAaK.mjs';import{o as a54b}from'./bcs-BrmSFFhn.mjs';import{a as a54c,g as a54d,i as a54e,n as a54f,s as a54g,t as a54h}from'./Transaction-DcFD1-9u.mjs';import{promiseWithResolvers}from'@mysten/utils';var AsyncCache=class{async['getObject'](a){const [b,c]=await Promise['all']([this['get']('OwnedObject',a),this['get']('SharedOrImmutableObject',a)]);return b??c??null;}async['getObjects'](a){return Promise['all'](a['map'](b=>this['getObject'](b)));}async['addObject'](a){if(a['owner'])await this['set']('OwnedObject',a['objectId'],a);else await this['set']('SharedOrImmutableObject',a['objectId'],a);return a;}async['addObjects'](a){await Promise['all'](a['map'](async b=>this['addObject'](b)));}async['deleteObject'](a){await Promise['all']([this['delete']('OwnedObject',a),this['delete']('SharedOrImmutableObject',a)]);}async['deleteObjects'](a){await Promise['all'](a['map'](b=>this['deleteObject'](b)));}async['getMoveFunctionDefinition'](a){const b=a54a(a['package'])+'::'+a['module']+'::'+a['function'];return this['get']('MoveFunction',b);}async['addMoveFunctionDefinition'](a){const b=a54a(a['package']),c=b+'::'+a['module']+'::'+a['function'],d={...a,'package':b};return await this['set']('MoveFunction',c,d),d;}async['deleteMoveFunctionDefinition'](a){const b=a54a(a['package'])+'::'+a['module']+'::'+a['function'];await this['delete']('MoveFunction',b);}async['getCustom'](a){return this['get']('Custom',a);}async['setCustom'](a,b){return this['set']('Custom',a,b);}async['deleteCustom'](a){return this['delete']('Custom',a);}},InMemoryCache=class extends AsyncCache{#caches={'OwnedObject':new Map(),'SharedOrImmutableObject':new Map(),'MoveFunction':new Map(),'Custom':new Map()};async['get'](a,b){return this.#caches[a]['get'](b)??null;}async['set'](a,b,c){this.#caches[a]['set'](b,c);}async['delete'](a,b){this.#caches[a]['delete'](b);}async['clear'](a){if(a)this.#caches[a]['clear']();else{for(const b of Object['values'](this.#caches))b['clear']();}}},ObjectCache=class{#cache;#onEffects;constructor({cache:cache=new InMemoryCache(),onEffects:a}){this.#cache=cache,this.#onEffects=a;}['asPlugin'](){return async(a,b,c)=>{const d=a['inputs']['filter'](g=>g['UnresolvedObject'])['map'](g=>g['UnresolvedObject']['objectId']),e=(await this.#cache['getObjects'](d))['filter'](g=>g!==null),f=new Map(e['map'](g=>[g['objectId'],g]));for(const g of a['inputs']){if(!g['UnresolvedObject'])continue;const h=f['get'](g['UnresolvedObject']['objectId']);if(!h)continue;if(h['initialSharedVersion']&&!g['UnresolvedObject']['initialSharedVersion'])g['UnresolvedObject']['initialSharedVersion']=h['initialSharedVersion'];else{if(h['version']&&!g['UnresolvedObject']['version'])g['UnresolvedObject']['version']=h['version'];if(h['digest']&&!g['UnresolvedObject']['digest'])g['UnresolvedObject']['digest']=h['digest'];}}await Promise['all'](a['commands']['map'](async i=>{if(i['MoveCall']){const j=await this['getMoveFunctionDefinition']({'package':i['MoveCall']['package'],'module':i['MoveCall']['module'],'function':i['MoveCall']['function']});if(j)i['MoveCall']['_argumentTypes']=j['parameters'];}})),await c(),await Promise['all'](a['commands']['map'](async i=>{if(i['MoveCall']?.['_argumentTypes'])await this.#cache['addMoveFunctionDefinition']({'package':i['MoveCall']['package'],'module':i['MoveCall']['module'],'function':i['MoveCall']['function'],'parameters':i['MoveCall']['_argumentTypes']});}));};}async['clear'](){await this.#cache['clear']();}async['getMoveFunctionDefinition'](a){return this.#cache['getMoveFunctionDefinition'](a);}async['getObjects'](a){return this.#cache['getObjects'](a);}async['deleteObjects'](a){return this.#cache['deleteObjects'](a);}async['clearOwnedObjects'](){await this.#cache['clear']('OwnedObject');}async['clearCustom'](){await this.#cache['clear']('Custom');}async['getCustom'](a){return this.#cache['getCustom'](a);}async['setCustom'](a,b){return this.#cache['setCustom'](a,b);}async['deleteCustom'](a){return this.#cache['deleteCustom'](a);}async['applyEffects'](a){if(!a['V2'])throw new Error('Unsupported\x20transaction\x20effects\x20version\x20'+a['$kind']);const {lamportVersion:b,changedObjects:c}=a['V2'],d=[],e=[];c['forEach'](([f,g])=>{if(g['outputState']['NotExist'])d['push'](f);else{if(g['outputState']['ObjectWrite']){const [h,i]=g['outputState']['ObjectWrite'];e['push']({'objectId':f,'digest':h,'version':b,'owner':i['AddressOwner']??i['ObjectOwner']??null,'initialSharedVersion':i['Shared']?.['initialSharedVersion']??null});}}}),await Promise['all']([this.#cache['addObjects'](e),this.#cache['deleteObjects'](d),this.#onEffects?.(a)]);}},CachingTransactionExecutor=class{#client;#lastDigest=null;constructor({client:a,...b}){this.#client=a,this['cache']=new ObjectCache(b);}async['reset'](){await Promise['all']([this['cache']['clearOwnedObjects'](),this['cache']['clearCustom'](),this['waitForLastTransaction']()]);}async['buildTransaction']({transaction:a,...b}){return a['addBuildPlugin'](this['cache']['asPlugin']()),a['addBuildPlugin'](a54g),a['build']({'client':this.#client,...b});}async['executeTransaction']({transaction:a,signatures:b,include:c}){const d=a54f(a)?await this['buildTransaction']({'transaction':a}):a,e=await this.#client['core']['executeTransaction']({'transaction':d,'signatures':b,'include':{...c,'effects':!![]}}),f=e['$kind']==='Transaction'?e['Transaction']:e['FailedTransaction'];if(f['effects']?.['bcs']){const g=a54b['TransactionEffects']['parse'](f['effects']['bcs']);await this['applyEffects'](g);}return e;}async['signAndExecuteTransaction']({include:a,transaction:b,signer:c}){b['setSenderIfNotSet'](c['toWowAddress']());const d=await this['buildTransaction']({'transaction':b}),{signature:e}=await c['signTransaction'](d);return this['executeTransaction']({'transaction':d,'signatures':[e],'include':a});}async['applyEffects'](a){this.#lastDigest=a['V2']?.['transactionDigest']??null,await this['cache']['applyEffects'](a);}async['waitForLastTransaction'](){this.#lastDigest&&(await this.#client['core']['waitForTransaction']({'digest':this.#lastDigest}),this.#lastDigest=null);}},SerialQueue=class{#queue=[];async['runTask'](a){return new Promise((b,c)=>{this.#queue['push'](()=>{a()['finally'](()=>{this.#queue['shift']();if(this.#queue['length']>0x0)this.#queue[0x0]();})['then'](b,c);});if(this.#queue['length']===0x1)this.#queue[0x0]();});}},ParallelQueue=class{#queue;constructor(a){this.#queue=[],this['activeTasks']=0x0,this['maxTasks']=a;}['runTask'](a){return new Promise((b,c)=>{if(this['activeTasks']<this['maxTasks'])this['activeTasks']++,a()['finally'](()=>{if(this.#queue['length']>0x0)this.#queue['shift']()();else this['activeTasks']--;})['then'](b,c);else this.#queue['push'](()=>{a()['finally'](()=>{if(this.#queue['length']>0x0)this.#queue['shift']()();else this['activeTasks']--;})['then'](b,c);});});}};const EPOCH_BOUNDARY_WINDOW$1=0xea60;var SerialTransactionExecutor=class{#queue=new SerialQueue();#signer;#client;#cache;#defaultGasBudget;#gasMode;#epochInfo=null;#epochInfoPromise=null;constructor(a){const {signer:b,defaultGasBudget:defaultGasBudget=0x2faf080n,client:c,cache:d}=a;this.#signer=b,this.#client=c,this.#defaultGasBudget=defaultGasBudget,this.#gasMode=a['gasMode']??'coins',this.#cache=new CachingTransactionExecutor({'client':c,'cache':d,'onEffects':e=>this.#cacheGasCoin(e)});}async['applyEffects'](a){return this.#cache['applyEffects'](a);}#cacheGasCoin=async a=>{if(this.#gasMode==='addressBalance'||!a['V2'])return;const b=getGasCoinFromEffects(a)['ref'];if(b)this.#cache['cache']['setCustom']('gasCoin',b);else this.#cache['cache']['deleteCustom']('gasCoin');};async['buildTransaction'](a){return this.#queue['runTask'](()=>this.#buildTransaction(a));}#buildTransaction=async a=>{await a['prepareForSerialization']({'client':this.#client,'supportedIntents':['CoinWithBalance']});const b=a54h['from'](a);if(this.#gasMode==='addressBalance')b['setGasPayment']([]),b['setExpiration'](await this.#getValidDuringExpiration());else{const c=await this.#cache['cache']['getCustom']('gasCoin');if(c)b['setGasPayment']([c]);}return b['setGasBudgetIfNotSet'](this.#defaultGasBudget),b['setSenderIfNotSet'](this.#signer['toWowAddress']()),this.#cache['buildTransaction']({'transaction':b});};async #getValidDuringExpiration(){await this.#ensureEpochInfo();const a=BigInt(this.#epochInfo['epoch']);return{'ValidDuring':{'minEpoch':String(a),'maxEpoch':String(a+0x1n),'minTimestamp':null,'maxTimestamp':null,'chain':this.#epochInfo['chainIdentifier'],'nonce':Math['random']()*0x100000000>>>0x0}};}async #ensureEpochInfo(){if(this.#epochInfo&&this.#epochInfo['expiration']-EPOCH_BOUNDARY_WINDOW$1-Date['now']()>0x0)return;if(this.#epochInfoPromise){await this.#epochInfoPromise;return;}this.#epochInfoPromise=this.#fetchEpochInfo();try{await this.#epochInfoPromise;}finally{this.#epochInfoPromise=null;}}async #fetchEpochInfo(){const [{systemState:a},{chainIdentifier:b}]=await Promise['all']([this.#client['core']['getCurrentSystemState'](),this.#client['core']['getChainIdentifier']()]);this.#epochInfo={'epoch':a['epoch'],'expiration':Number(a['epochStartTimestampMs'])+Number(a['parameters']['epochDurationMs']),'chainIdentifier':b};}['resetCache'](){return this.#cache['reset']();}['waitForLastTransaction'](){return this.#cache['waitForLastTransaction']();}['executeTransaction'](a,b,c=[]){return this.#queue['runTask'](async()=>{const d=a54f(a)?await this.#buildTransaction(a):a,{signature:e}=await this.#signer['signTransaction'](d);return this.#cache['executeTransaction']({'signatures':[e,...c],'transaction':d,'include':b})['catch'](async f=>{await this['resetCache']();throw f;});});}};function getGasCoinFromEffects(a){if(!a['V2'])throw new Error('Unexpected\x20effects\x20version');const b=a['V2']['changedObjects'][a['V2']['gasObjectIndex']];if(!b)throw new Error('Gas\x20object\x20not\x20found\x20in\x20effects');const [c,{outputState:d}]=b;if(!d['ObjectWrite'])throw new Error('Unexpected\x20gas\x20object\x20state');const [e,f]=d['ObjectWrite'];return{'ref':{'objectId':c,'digest':e,'version':a['V2']['lamportVersion']},'owner':f['AddressOwner']||f['ObjectOwner']};}const PARALLEL_EXECUTOR_DEFAULTS={'coinBatchSize':0x14,'initialCoinBalance':0xbebc200n,'minimumCoinBalance':0x2faf080n,'maxPoolSize':0x32},EPOCH_BOUNDARY_WINDOW=0xea60;var ParallelTransactionExecutor=class{#signer;#client;#gasMode;#coinBatchSize;#initialCoinBalance;#minimumCoinBalance;#defaultGasBudget;#maxPoolSize;#sourceCoins;#coinPool=[];#cache;#objectIdQueues=new Map();#buildQueue=new SerialQueue();#executeQueue;#lastDigest=null;#cacheLock=null;#pendingTransactions=0x0;#epochInfo=null;#epochInfoPromise=null;constructor(a){this.#signer=a['signer'],this.#client=a['client'],this.#gasMode=a['gasMode']??'coins';if(this.#gasMode==='coins'){const b=a;this.#coinBatchSize=b['coinBatchSize']??PARALLEL_EXECUTOR_DEFAULTS['coinBatchSize'],this.#initialCoinBalance=b['initialCoinBalance']??PARALLEL_EXECUTOR_DEFAULTS['initialCoinBalance'],this.#minimumCoinBalance=b['minimumCoinBalance']??PARALLEL_EXECUTOR_DEFAULTS['minimumCoinBalance'],this.#sourceCoins=b['sourceCoins']?new Map(b['sourceCoins']['map'](c=>[c,null])):null;}else this.#coinBatchSize=0x0,this.#initialCoinBalance=0x0n,this.#minimumCoinBalance=PARALLEL_EXECUTOR_DEFAULTS['minimumCoinBalance'],this.#sourceCoins=null;this.#defaultGasBudget=a['defaultGasBudget']??this.#minimumCoinBalance,this.#maxPoolSize=a['maxPoolSize']??PARALLEL_EXECUTOR_DEFAULTS['maxPoolSize'],this.#cache=new CachingTransactionExecutor({'client':a['client'],'cache':a['cache']}),this.#executeQueue=new ParallelQueue(this.#maxPoolSize);}['resetCache'](){return this.#epochInfo=null,this.#updateCache(()=>this.#cache['reset']());}async['waitForLastTransaction'](){await this.#updateCache(()=>this.#waitForLastDigest());}async['executeTransaction'](a,b,c=[]){const {promise:d,resolve:e,reject:f}=promiseWithResolvers(),g=await this.#getUsedObjects(a),h=()=>{this.#executeQueue['runTask'](()=>{return this.#execute(a,g,b,c)['then'](e,f);});},i=new Set();g['forEach'](j=>{if(this.#objectIdQueues['get'](j))i['add'](j),this.#objectIdQueues['get'](j)['push'](()=>{i['delete'](j);if(i['size']===0x0)h();});else this.#objectIdQueues['set'](j,[]);});if(i['size']===0x0)h();return d;}async #getUsedObjects(a){const b=new Set();let c=![];return a['addSerializationPlugin'](async(d,e,f)=>{await f();if(c)return;c=!![],d['inputs']['forEach'](g=>{if(g['Object']?.['ImmOrOwnedObject']?.['objectId'])b['add'](g['Object']['ImmOrOwnedObject']['objectId']);else{if(g['Object']?.['Receiving']?.['objectId'])b['add'](g['Object']['Receiving']['objectId']);else{if(g['UnresolvedObject']?.['objectId']&&!g['UnresolvedObject']['initialSharedVersion'])b['add'](g['UnresolvedObject']['objectId']);}}});}),await a['prepareForSerialization']({'client':this.#client}),b;}async #execute(a,b,c,d=[]){let e=null;try{a['setSenderIfNotSet'](this.#signer['toWowAddress']()),await this.#buildQueue['runTask'](async()=>{if(!a['getData']()['gasData']['price'])a['setGasPrice'](await this.#getGasPrice());a['setGasBudgetIfNotSet'](this.#defaultGasBudget),await this.#updateCache(),this.#pendingTransactions++,this.#gasMode==='addressBalance'?(a['setGasPayment']([]),a['setExpiration'](await this.#getValidDuringExpiration())):(e=await this.#getGasCoin(),a['setGasPayment']([{'objectId':e['id'],'version':e['version'],'digest':e['digest']}])),await this.#cache['buildTransaction']({'transaction':a,'onlyTransactionKind':!![]});});const f=await a['build']({'client':this.#client}),{signature:g}=await this.#signer['signTransaction'](f),h=await this.#cache['executeTransaction']({'transaction':f,'signatures':[g,...d],'include':c}),i=h['$kind']==='Transaction'?h['Transaction']:h['FailedTransaction'],j=i['effects'],k=j['gasObject'],l=j['gasUsed'];if(e&&l&&k){const m=e;if((k['outputOwner']?.['AddressOwner']??k['outputOwner']?.['ObjectOwner'])===this.#signer['toWowAddress']()){const n=BigInt(l['computationCost'])+BigInt(l['storageCost'])-BigInt(l['storageRebate']),o=m['balance']-n;let p=![];new a54d(a['getData']())['mapArguments'](r=>{if(r['$kind']==='GasCoin')p=!![];return r;});const q={'objectId':k['objectId'],'version':k['outputVersion'],'digest':k['outputDigest']};if(!p&&o>=this.#minimumCoinBalance)this.#coinPool['push']({'id':q['objectId'],'version':q['version'],'digest':q['digest'],'balance':o});else{if(!this.#sourceCoins)this.#sourceCoins=new Map();this.#sourceCoins['set'](q['objectId'],q);}}}return this.#lastDigest=i['digest'],h;}catch(r){if(e){if(!this.#sourceCoins)this.#sourceCoins=new Map();this.#sourceCoins['set'](e['id'],null);}await this.#updateCache(async()=>{await Promise['all']([this.#cache['cache']['deleteObjects']([...b]),this.#waitForLastDigest()]);});throw r;}finally{b['forEach'](s=>{const t=this.#objectIdQueues['get'](s);if(t&&t['length']>0x0)t['shift']()();else{if(t)this.#objectIdQueues['delete'](s);}}),this.#pendingTransactions--;}}async #updateCache(a){if(this.#cacheLock)await this.#cacheLock;this.#cacheLock=a?.()['then'](()=>{this.#cacheLock=null;},()=>{})??null;}async #waitForLastDigest(){const a=this.#lastDigest;a&&(this.#lastDigest=null,await this.#client['core']['waitForTransaction']({'digest':a}));}async #getGasCoin(){if(this.#coinPool['length']===0x0&&this.#pendingTransactions<=this.#maxPoolSize)await this.#refillCoinPool();if(this.#coinPool['length']===0x0)throw new Error('No\x20coins\x20available');return this.#coinPool['shift']();}async #getGasPrice(){return await this.#ensureEpochInfo(),this.#epochInfo['price'];}async #getValidDuringExpiration(){await this.#ensureEpochInfo();const a=BigInt(this.#epochInfo['epoch']);return{'ValidDuring':{'minEpoch':String(a),'maxEpoch':String(a+0x1n),'minTimestamp':null,'maxTimestamp':null,'chain':this.#epochInfo['chainIdentifier'],'nonce':Math['random']()*0x100000000>>>0x0}};}async #ensureEpochInfo(){if(this.#epochInfo&&this.#epochInfo['expiration']-EPOCH_BOUNDARY_WINDOW-Date['now']()>0x0)return;if(this.#epochInfoPromise){await this.#epochInfoPromise;return;}this.#epochInfoPromise=this.#fetchEpochInfo();try{await this.#epochInfoPromise;}finally{this.#epochInfoPromise=null;}}async #fetchEpochInfo(){const [{systemState:a},{chainIdentifier:b}]=await Promise['all']([this.#client['core']['getCurrentSystemState'](),this.#client['core']['getChainIdentifier']()]);this.#epochInfo={'epoch':a['epoch'],'price':BigInt(a['referenceGasPrice']),'expiration':Number(a['epochStartTimestampMs'])+Number(a['parameters']['epochDurationMs']),'chainIdentifier':b};}async #refillCoinPool(){const a=Math['min'](this.#coinBatchSize,this.#maxPoolSize-(this.#coinPool['length']+this.#pendingTransactions)+0x1);if(a===0x0)return;const b=new a54h(),c=this.#signer['toWowAddress']();b['setSender'](c);if(this.#sourceCoins){const n=[],o=[];for(const [p,q]of this.#sourceCoins)if(q)n['push'](q);else o['push'](p);if(o['length']>0x0){const {objects:r}=await this.#client['core']['getObjects']({'objectIds':o});n['push'](...r['filter'](s=>!(s instanceof Error))['map'](s=>({'objectId':s['objectId'],'version':s['version'],'digest':s['digest']})));}b['setGasPayment'](n),this.#sourceCoins=new Map();}const d=new Array(a)['fill'](this.#initialCoinBalance),e=b['splitCoins'](b['gas'],d),f=[];for(let s=0x0;s<d['length'];s++)f['push'](e[s]);b['transferObjects'](f,c),await this['waitForLastTransaction'](),b['addBuildPlugin'](a54g);const g=await b['build']({'client':this.#client}),{signature:h}=await this.#signer['signTransaction'](g),j=await this.#client['core']['executeTransaction']({'transaction':g,'signatures':[h],'include':{'effects':!![]}}),k=j['$kind']==='Transaction'?j['Transaction']:j['FailedTransaction'],l=k['effects'];l['changedObjects']['forEach'](t=>{if(t['objectId']===l['gasObject']?.['objectId']||t['outputState']!=='ObjectWrite')return;this.#coinPool['push']({'id':t['objectId'],'version':t['outputVersion'],'digest':t['outputDigest'],'balance':BigInt(this.#initialCoinBalance)});});if(!this.#sourceCoins)this.#sourceCoins=new Map();const m=l['gasObject'];this.#sourceCoins['set'](m['objectId'],{'objectId':m['objectId'],'version':m['outputVersion'],'digest':m['outputDigest']}),await this.#client['core']['waitForTransaction']({'digest':k['digest']});}};const Arguments={'pure':a54e(a=>b=>b['pure'](a)),'object':a54c(a=>b=>b['object'](a)),'sharedObjectRef':(...a)=>b=>b['sharedObjectRef'](...a),'objectRef':(...a)=>b=>b['objectRef'](...a),'receivingRef':(...a)=>b=>b['receivingRef'](...a)};export{ObjectCache as a,AsyncCache as i,ParallelTransactionExecutor as n,SerialTransactionExecutor as r,Arguments as t};
1
+ import{c as a54a}from'./wow-types-DcqbnAaK.mjs';import{o as a54b}from'./bcs-BrmSFFhn.mjs';import{a as a54c,g as a54d,i as a54e,n as a54f,s as a54g,t as a54h}from'./Transaction-BlZi1w6F.mjs';import{promiseWithResolvers}from'@mysten/utils';var AsyncCache=class{async['getObject'](a){const [b,c]=await Promise['all']([this['get']('OwnedObject',a),this['get']('SharedOrImmutableObject',a)]);return b??c??null;}async['getObjects'](a){return Promise['all'](a['map'](b=>this['getObject'](b)));}async['addObject'](a){if(a['owner'])await this['set']('OwnedObject',a['objectId'],a);else await this['set']('SharedOrImmutableObject',a['objectId'],a);return a;}async['addObjects'](a){await Promise['all'](a['map'](async b=>this['addObject'](b)));}async['deleteObject'](a){await Promise['all']([this['delete']('OwnedObject',a),this['delete']('SharedOrImmutableObject',a)]);}async['deleteObjects'](a){await Promise['all'](a['map'](b=>this['deleteObject'](b)));}async['getMoveFunctionDefinition'](a){const b=a54a(a['package'])+'::'+a['module']+'::'+a['function'];return this['get']('MoveFunction',b);}async['addMoveFunctionDefinition'](a){const b=a54a(a['package']),c=b+'::'+a['module']+'::'+a['function'],d={...a,'package':b};return await this['set']('MoveFunction',c,d),d;}async['deleteMoveFunctionDefinition'](a){const b=a54a(a['package'])+'::'+a['module']+'::'+a['function'];await this['delete']('MoveFunction',b);}async['getCustom'](a){return this['get']('Custom',a);}async['setCustom'](a,b){return this['set']('Custom',a,b);}async['deleteCustom'](a){return this['delete']('Custom',a);}},InMemoryCache=class extends AsyncCache{#caches={'OwnedObject':new Map(),'SharedOrImmutableObject':new Map(),'MoveFunction':new Map(),'Custom':new Map()};async['get'](a,b){return this.#caches[a]['get'](b)??null;}async['set'](a,b,c){this.#caches[a]['set'](b,c);}async['delete'](a,b){this.#caches[a]['delete'](b);}async['clear'](a){if(a)this.#caches[a]['clear']();else{for(const b of Object['values'](this.#caches))b['clear']();}}},ObjectCache=class{#cache;#onEffects;constructor({cache:cache=new InMemoryCache(),onEffects:a}){this.#cache=cache,this.#onEffects=a;}['asPlugin'](){return async(a,b,c)=>{const d=a['inputs']['filter'](g=>g['UnresolvedObject'])['map'](g=>g['UnresolvedObject']['objectId']),e=(await this.#cache['getObjects'](d))['filter'](g=>g!==null),f=new Map(e['map'](g=>[g['objectId'],g]));for(const g of a['inputs']){if(!g['UnresolvedObject'])continue;const h=f['get'](g['UnresolvedObject']['objectId']);if(!h)continue;if(h['initialSharedVersion']&&!g['UnresolvedObject']['initialSharedVersion'])g['UnresolvedObject']['initialSharedVersion']=h['initialSharedVersion'];else{if(h['version']&&!g['UnresolvedObject']['version'])g['UnresolvedObject']['version']=h['version'];if(h['digest']&&!g['UnresolvedObject']['digest'])g['UnresolvedObject']['digest']=h['digest'];}}await Promise['all'](a['commands']['map'](async i=>{if(i['MoveCall']){const j=await this['getMoveFunctionDefinition']({'package':i['MoveCall']['package'],'module':i['MoveCall']['module'],'function':i['MoveCall']['function']});if(j)i['MoveCall']['_argumentTypes']=j['parameters'];}})),await c(),await Promise['all'](a['commands']['map'](async i=>{if(i['MoveCall']?.['_argumentTypes'])await this.#cache['addMoveFunctionDefinition']({'package':i['MoveCall']['package'],'module':i['MoveCall']['module'],'function':i['MoveCall']['function'],'parameters':i['MoveCall']['_argumentTypes']});}));};}async['clear'](){await this.#cache['clear']();}async['getMoveFunctionDefinition'](a){return this.#cache['getMoveFunctionDefinition'](a);}async['getObjects'](a){return this.#cache['getObjects'](a);}async['deleteObjects'](a){return this.#cache['deleteObjects'](a);}async['clearOwnedObjects'](){await this.#cache['clear']('OwnedObject');}async['clearCustom'](){await this.#cache['clear']('Custom');}async['getCustom'](a){return this.#cache['getCustom'](a);}async['setCustom'](a,b){return this.#cache['setCustom'](a,b);}async['deleteCustom'](a){return this.#cache['deleteCustom'](a);}async['applyEffects'](a){if(!a['V2'])throw new Error('Unsupported\x20transaction\x20effects\x20version\x20'+a['$kind']);const {lamportVersion:b,changedObjects:c}=a['V2'],d=[],e=[];c['forEach'](([f,g])=>{if(g['outputState']['NotExist'])d['push'](f);else{if(g['outputState']['ObjectWrite']){const [h,i]=g['outputState']['ObjectWrite'];e['push']({'objectId':f,'digest':h,'version':b,'owner':i['AddressOwner']??i['ObjectOwner']??null,'initialSharedVersion':i['Shared']?.['initialSharedVersion']??null});}}}),await Promise['all']([this.#cache['addObjects'](e),this.#cache['deleteObjects'](d),this.#onEffects?.(a)]);}},CachingTransactionExecutor=class{#client;#lastDigest=null;constructor({client:a,...b}){this.#client=a,this['cache']=new ObjectCache(b);}async['reset'](){await Promise['all']([this['cache']['clearOwnedObjects'](),this['cache']['clearCustom'](),this['waitForLastTransaction']()]);}async['buildTransaction']({transaction:a,...b}){return a['addBuildPlugin'](this['cache']['asPlugin']()),a['addBuildPlugin'](a54g),a['build']({'client':this.#client,...b});}async['executeTransaction']({transaction:a,signatures:b,include:c}){const d=a54f(a)?await this['buildTransaction']({'transaction':a}):a,e=await this.#client['core']['executeTransaction']({'transaction':d,'signatures':b,'include':{...c,'effects':!![]}}),f=e['$kind']==='Transaction'?e['Transaction']:e['FailedTransaction'];if(f['effects']?.['bcs']){const g=a54b['TransactionEffects']['parse'](f['effects']['bcs']);await this['applyEffects'](g);}return e;}async['signAndExecuteTransaction']({include:a,transaction:b,signer:c}){b['setSenderIfNotSet'](c['toWowAddress']());const d=await this['buildTransaction']({'transaction':b}),{signature:e}=await c['signTransaction'](d);return this['executeTransaction']({'transaction':d,'signatures':[e],'include':a});}async['applyEffects'](a){this.#lastDigest=a['V2']?.['transactionDigest']??null,await this['cache']['applyEffects'](a);}async['waitForLastTransaction'](){this.#lastDigest&&(await this.#client['core']['waitForTransaction']({'digest':this.#lastDigest}),this.#lastDigest=null);}},SerialQueue=class{#queue=[];async['runTask'](a){return new Promise((b,c)=>{this.#queue['push'](()=>{a()['finally'](()=>{this.#queue['shift']();if(this.#queue['length']>0x0)this.#queue[0x0]();})['then'](b,c);});if(this.#queue['length']===0x1)this.#queue[0x0]();});}},ParallelQueue=class{#queue;constructor(a){this.#queue=[],this['activeTasks']=0x0,this['maxTasks']=a;}['runTask'](a){return new Promise((b,c)=>{if(this['activeTasks']<this['maxTasks'])this['activeTasks']++,a()['finally'](()=>{if(this.#queue['length']>0x0)this.#queue['shift']()();else this['activeTasks']--;})['then'](b,c);else this.#queue['push'](()=>{a()['finally'](()=>{if(this.#queue['length']>0x0)this.#queue['shift']()();else this['activeTasks']--;})['then'](b,c);});});}};const EPOCH_BOUNDARY_WINDOW$1=0xea60;var SerialTransactionExecutor=class{#queue=new SerialQueue();#signer;#client;#cache;#defaultGasBudget;#gasMode;#epochInfo=null;#epochInfoPromise=null;constructor(a){const {signer:b,defaultGasBudget:defaultGasBudget=0x2faf080n,client:c,cache:d}=a;this.#signer=b,this.#client=c,this.#defaultGasBudget=defaultGasBudget,this.#gasMode=a['gasMode']??'coins',this.#cache=new CachingTransactionExecutor({'client':c,'cache':d,'onEffects':e=>this.#cacheGasCoin(e)});}async['applyEffects'](a){return this.#cache['applyEffects'](a);}#cacheGasCoin=async a=>{if(this.#gasMode==='addressBalance'||!a['V2'])return;const b=getGasCoinFromEffects(a)['ref'];if(b)this.#cache['cache']['setCustom']('gasCoin',b);else this.#cache['cache']['deleteCustom']('gasCoin');};async['buildTransaction'](a){return this.#queue['runTask'](()=>this.#buildTransaction(a));}#buildTransaction=async a=>{await a['prepareForSerialization']({'client':this.#client,'supportedIntents':['CoinWithBalance']});const b=a54h['from'](a);if(this.#gasMode==='addressBalance')b['setGasPayment']([]),b['setExpiration'](await this.#getValidDuringExpiration());else{const c=await this.#cache['cache']['getCustom']('gasCoin');if(c)b['setGasPayment']([c]);}return b['setGasBudgetIfNotSet'](this.#defaultGasBudget),b['setSenderIfNotSet'](this.#signer['toWowAddress']()),this.#cache['buildTransaction']({'transaction':b});};async #getValidDuringExpiration(){await this.#ensureEpochInfo();const a=BigInt(this.#epochInfo['epoch']);return{'ValidDuring':{'minEpoch':String(a),'maxEpoch':String(a+0x1n),'minTimestamp':null,'maxTimestamp':null,'chain':this.#epochInfo['chainIdentifier'],'nonce':Math['random']()*0x100000000>>>0x0}};}async #ensureEpochInfo(){if(this.#epochInfo&&this.#epochInfo['expiration']-EPOCH_BOUNDARY_WINDOW$1-Date['now']()>0x0)return;if(this.#epochInfoPromise){await this.#epochInfoPromise;return;}this.#epochInfoPromise=this.#fetchEpochInfo();try{await this.#epochInfoPromise;}finally{this.#epochInfoPromise=null;}}async #fetchEpochInfo(){const [{systemState:a},{chainIdentifier:b}]=await Promise['all']([this.#client['core']['getCurrentSystemState'](),this.#client['core']['getChainIdentifier']()]);this.#epochInfo={'epoch':a['epoch'],'expiration':Number(a['epochStartTimestampMs'])+Number(a['parameters']['epochDurationMs']),'chainIdentifier':b};}['resetCache'](){return this.#cache['reset']();}['waitForLastTransaction'](){return this.#cache['waitForLastTransaction']();}['executeTransaction'](a,b,c=[]){return this.#queue['runTask'](async()=>{const d=a54f(a)?await this.#buildTransaction(a):a,{signature:e}=await this.#signer['signTransaction'](d);return this.#cache['executeTransaction']({'signatures':[e,...c],'transaction':d,'include':b})['catch'](async f=>{await this['resetCache']();throw f;});});}};function getGasCoinFromEffects(a){if(!a['V2'])throw new Error('Unexpected\x20effects\x20version');const b=a['V2']['changedObjects'][a['V2']['gasObjectIndex']];if(!b)throw new Error('Gas\x20object\x20not\x20found\x20in\x20effects');const [c,{outputState:d}]=b;if(!d['ObjectWrite'])throw new Error('Unexpected\x20gas\x20object\x20state');const [e,f]=d['ObjectWrite'];return{'ref':{'objectId':c,'digest':e,'version':a['V2']['lamportVersion']},'owner':f['AddressOwner']||f['ObjectOwner']};}const PARALLEL_EXECUTOR_DEFAULTS={'coinBatchSize':0x14,'initialCoinBalance':0xbebc200n,'minimumCoinBalance':0x2faf080n,'maxPoolSize':0x32},EPOCH_BOUNDARY_WINDOW=0xea60;var ParallelTransactionExecutor=class{#signer;#client;#gasMode;#coinBatchSize;#initialCoinBalance;#minimumCoinBalance;#defaultGasBudget;#maxPoolSize;#sourceCoins;#coinPool=[];#cache;#objectIdQueues=new Map();#buildQueue=new SerialQueue();#executeQueue;#lastDigest=null;#cacheLock=null;#pendingTransactions=0x0;#epochInfo=null;#epochInfoPromise=null;constructor(a){this.#signer=a['signer'],this.#client=a['client'],this.#gasMode=a['gasMode']??'coins';if(this.#gasMode==='coins'){const b=a;this.#coinBatchSize=b['coinBatchSize']??PARALLEL_EXECUTOR_DEFAULTS['coinBatchSize'],this.#initialCoinBalance=b['initialCoinBalance']??PARALLEL_EXECUTOR_DEFAULTS['initialCoinBalance'],this.#minimumCoinBalance=b['minimumCoinBalance']??PARALLEL_EXECUTOR_DEFAULTS['minimumCoinBalance'],this.#sourceCoins=b['sourceCoins']?new Map(b['sourceCoins']['map'](c=>[c,null])):null;}else this.#coinBatchSize=0x0,this.#initialCoinBalance=0x0n,this.#minimumCoinBalance=PARALLEL_EXECUTOR_DEFAULTS['minimumCoinBalance'],this.#sourceCoins=null;this.#defaultGasBudget=a['defaultGasBudget']??this.#minimumCoinBalance,this.#maxPoolSize=a['maxPoolSize']??PARALLEL_EXECUTOR_DEFAULTS['maxPoolSize'],this.#cache=new CachingTransactionExecutor({'client':a['client'],'cache':a['cache']}),this.#executeQueue=new ParallelQueue(this.#maxPoolSize);}['resetCache'](){return this.#epochInfo=null,this.#updateCache(()=>this.#cache['reset']());}async['waitForLastTransaction'](){await this.#updateCache(()=>this.#waitForLastDigest());}async['executeTransaction'](a,b,c=[]){const {promise:d,resolve:e,reject:f}=promiseWithResolvers(),g=await this.#getUsedObjects(a),h=()=>{this.#executeQueue['runTask'](()=>{return this.#execute(a,g,b,c)['then'](e,f);});},i=new Set();g['forEach'](j=>{if(this.#objectIdQueues['get'](j))i['add'](j),this.#objectIdQueues['get'](j)['push'](()=>{i['delete'](j);if(i['size']===0x0)h();});else this.#objectIdQueues['set'](j,[]);});if(i['size']===0x0)h();return d;}async #getUsedObjects(a){const b=new Set();let c=![];return a['addSerializationPlugin'](async(d,e,f)=>{await f();if(c)return;c=!![],d['inputs']['forEach'](g=>{if(g['Object']?.['ImmOrOwnedObject']?.['objectId'])b['add'](g['Object']['ImmOrOwnedObject']['objectId']);else{if(g['Object']?.['Receiving']?.['objectId'])b['add'](g['Object']['Receiving']['objectId']);else{if(g['UnresolvedObject']?.['objectId']&&!g['UnresolvedObject']['initialSharedVersion'])b['add'](g['UnresolvedObject']['objectId']);}}});}),await a['prepareForSerialization']({'client':this.#client}),b;}async #execute(a,b,c,d=[]){let e=null;try{a['setSenderIfNotSet'](this.#signer['toWowAddress']()),await this.#buildQueue['runTask'](async()=>{if(!a['getData']()['gasData']['price'])a['setGasPrice'](await this.#getGasPrice());a['setGasBudgetIfNotSet'](this.#defaultGasBudget),await this.#updateCache(),this.#pendingTransactions++,this.#gasMode==='addressBalance'?(a['setGasPayment']([]),a['setExpiration'](await this.#getValidDuringExpiration())):(e=await this.#getGasCoin(),a['setGasPayment']([{'objectId':e['id'],'version':e['version'],'digest':e['digest']}])),await this.#cache['buildTransaction']({'transaction':a,'onlyTransactionKind':!![]});});const f=await a['build']({'client':this.#client}),{signature:g}=await this.#signer['signTransaction'](f),h=await this.#cache['executeTransaction']({'transaction':f,'signatures':[g,...d],'include':c}),i=h['$kind']==='Transaction'?h['Transaction']:h['FailedTransaction'],j=i['effects'],k=j['gasObject'],l=j['gasUsed'];if(e&&l&&k){const m=e;if((k['outputOwner']?.['AddressOwner']??k['outputOwner']?.['ObjectOwner'])===this.#signer['toWowAddress']()){const n=BigInt(l['computationCost'])+BigInt(l['storageCost'])-BigInt(l['storageRebate']),o=m['balance']-n;let p=![];new a54d(a['getData']())['mapArguments'](r=>{if(r['$kind']==='GasCoin')p=!![];return r;});const q={'objectId':k['objectId'],'version':k['outputVersion'],'digest':k['outputDigest']};if(!p&&o>=this.#minimumCoinBalance)this.#coinPool['push']({'id':q['objectId'],'version':q['version'],'digest':q['digest'],'balance':o});else{if(!this.#sourceCoins)this.#sourceCoins=new Map();this.#sourceCoins['set'](q['objectId'],q);}}}return this.#lastDigest=i['digest'],h;}catch(r){if(e){if(!this.#sourceCoins)this.#sourceCoins=new Map();this.#sourceCoins['set'](e['id'],null);}await this.#updateCache(async()=>{await Promise['all']([this.#cache['cache']['deleteObjects']([...b]),this.#waitForLastDigest()]);});throw r;}finally{b['forEach'](s=>{const t=this.#objectIdQueues['get'](s);if(t&&t['length']>0x0)t['shift']()();else{if(t)this.#objectIdQueues['delete'](s);}}),this.#pendingTransactions--;}}async #updateCache(a){if(this.#cacheLock)await this.#cacheLock;this.#cacheLock=a?.()['then'](()=>{this.#cacheLock=null;},()=>{})??null;}async #waitForLastDigest(){const a=this.#lastDigest;a&&(this.#lastDigest=null,await this.#client['core']['waitForTransaction']({'digest':a}));}async #getGasCoin(){if(this.#coinPool['length']===0x0&&this.#pendingTransactions<=this.#maxPoolSize)await this.#refillCoinPool();if(this.#coinPool['length']===0x0)throw new Error('No\x20coins\x20available');return this.#coinPool['shift']();}async #getGasPrice(){return await this.#ensureEpochInfo(),this.#epochInfo['price'];}async #getValidDuringExpiration(){await this.#ensureEpochInfo();const a=BigInt(this.#epochInfo['epoch']);return{'ValidDuring':{'minEpoch':String(a),'maxEpoch':String(a+0x1n),'minTimestamp':null,'maxTimestamp':null,'chain':this.#epochInfo['chainIdentifier'],'nonce':Math['random']()*0x100000000>>>0x0}};}async #ensureEpochInfo(){if(this.#epochInfo&&this.#epochInfo['expiration']-EPOCH_BOUNDARY_WINDOW-Date['now']()>0x0)return;if(this.#epochInfoPromise){await this.#epochInfoPromise;return;}this.#epochInfoPromise=this.#fetchEpochInfo();try{await this.#epochInfoPromise;}finally{this.#epochInfoPromise=null;}}async #fetchEpochInfo(){const [{systemState:a},{chainIdentifier:b}]=await Promise['all']([this.#client['core']['getCurrentSystemState'](),this.#client['core']['getChainIdentifier']()]);this.#epochInfo={'epoch':a['epoch'],'price':BigInt(a['referenceGasPrice']),'expiration':Number(a['epochStartTimestampMs'])+Number(a['parameters']['epochDurationMs']),'chainIdentifier':b};}async #refillCoinPool(){const a=Math['min'](this.#coinBatchSize,this.#maxPoolSize-(this.#coinPool['length']+this.#pendingTransactions)+0x1);if(a===0x0)return;const b=new a54h(),c=this.#signer['toWowAddress']();b['setSender'](c);if(this.#sourceCoins){const n=[],o=[];for(const [p,q]of this.#sourceCoins)if(q)n['push'](q);else o['push'](p);if(o['length']>0x0){const {objects:r}=await this.#client['core']['getObjects']({'objectIds':o});n['push'](...r['filter'](s=>!(s instanceof Error))['map'](s=>({'objectId':s['objectId'],'version':s['version'],'digest':s['digest']})));}b['setGasPayment'](n),this.#sourceCoins=new Map();}const d=new Array(a)['fill'](this.#initialCoinBalance),e=b['splitCoins'](b['gas'],d),f=[];for(let s=0x0;s<d['length'];s++)f['push'](e[s]);b['transferObjects'](f,c),await this['waitForLastTransaction'](),b['addBuildPlugin'](a54g);const g=await b['build']({'client':this.#client}),{signature:h}=await this.#signer['signTransaction'](g),j=await this.#client['core']['executeTransaction']({'transaction':g,'signatures':[h],'include':{'effects':!![]}}),k=j['$kind']==='Transaction'?j['Transaction']:j['FailedTransaction'],l=k['effects'];l['changedObjects']['forEach'](t=>{if(t['objectId']===l['gasObject']?.['objectId']||t['outputState']!=='ObjectWrite')return;this.#coinPool['push']({'id':t['objectId'],'version':t['outputVersion'],'digest':t['outputDigest'],'balance':BigInt(this.#initialCoinBalance)});});if(!this.#sourceCoins)this.#sourceCoins=new Map();const m=l['gasObject'];this.#sourceCoins['set'](m['objectId'],{'objectId':m['objectId'],'version':m['outputVersion'],'digest':m['outputDigest']}),await this.#client['core']['waitForTransaction']({'digest':k['digest']});}};const Arguments={'pure':a54e(a=>b=>b['pure'](a)),'object':a54c(a=>b=>b['object'](a)),'sharedObjectRef':(...a)=>b=>b['sharedObjectRef'](...a),'objectRef':(...a)=>b=>b['objectRef'](...a),'receivingRef':(...a)=>b=>b['receivingRef'](...a)};export{ObjectCache as a,AsyncCache as i,ParallelTransactionExecutor as n,SerialTransactionExecutor as r,Arguments as t};
@@ -1 +1 @@
1
- import{o as a55a}from'./exception-C6IYkBi6.mjs';import{U as a55b,pt as a55c}from'./object-CuC7vjpw.mjs';async function queryObjectWithType(a,b,c,d){const e=await a55b({'objects':[b],'no_cache':a['no_cache'],'network':a['network']});if(!e['objects']||e['objects']['length']!==0x1)a55a('invalid\x20argument\x20type','object\x20'+b+'\x20not\x20found');if(!e['objects'][0x0]['type']||e['objects'][0x0]['type']!==c)a55a('invalid\x20argument\x20type','object\x20'+b+'\x20type\x20'+e['objects'][0x0]['type']+'\x20is\x20not\x20'+c);const f=a55c(e['objects'][0x0]['type_raw'],d);if(!f)a55a('invalid\x20argument\x20type','object\x20'+b+'\x20type_raw\x20'+e['objects'][0x0]['type_raw']+'\x20is\x20not\x20'+d);return{'object':e['objects'][0x0]['object'],'type':f};}async function queryObjectsWithType(a,b,c,d,e){const f=await a55b({'objects':b,'no_cache':a['no_cache'],'network':a['network']}),g=[];if(f['objects'])f['objects']['forEach'](h=>{if(h['type']===c){const i=a55c(h['type_raw'],''+d);if(i)g['push']({'object':h['object'],'type':i});}});if(e&&g['length']!==b['length'])a55a('invalid\x20parameter','founded\x20'+g['length']+'\x20objects\x20'+g['map'](h=>h['object'])+'\x20,\x20expect\x20'+b['length']+':\x20'+b['filter'](h=>!g['map'](i=>i['object'])['includes'](h)));return g;}export{queryObjectsWithType as n,queryObjectWithType as t};
1
+ import{o as a55a}from'./exception-Xd2RFs2i.mjs';import{X as a55b,bt as a55c}from'./object-CJHJxXlc.mjs';async function queryObjectWithType(a,b,c,d){const e=await a55b({'objects':[b],'no_cache':a['no_cache'],'network':a['network']});if(!e['objects']||e['objects']['length']!==0x1)a55a('invalid\x20argument\x20type','object\x20'+b+'\x20not\x20found');if(!e['objects'][0x0]['type']||e['objects'][0x0]['type']!==c)a55a('invalid\x20argument\x20type','object\x20'+b+'\x20type\x20'+e['objects'][0x0]['type']+'\x20is\x20not\x20'+c);const f=a55c(e['objects'][0x0]['type_raw'],d);if(!f)a55a('invalid\x20argument\x20type','object\x20'+b+'\x20type_raw\x20'+e['objects'][0x0]['type_raw']+'\x20is\x20not\x20'+d);return{'object':e['objects'][0x0]['object'],'type':f};}async function queryObjectsWithType(a,b,c,d,e){const f=await a55b({'objects':b,'no_cache':a['no_cache'],'network':a['network']}),g=[];if(f['objects'])f['objects']['forEach'](h=>{if(h['type']===c){const i=a55c(h['type_raw'],''+d);if(i)g['push']({'object':h['object'],'type':i});}});if(e&&g['length']!==b['length'])a55a('invalid\x20parameter','founded\x20'+g['length']+'\x20objects\x20'+g['map'](h=>h['object'])+'\x20,\x20expect\x20'+b['length']+':\x20'+b['filter'](h=>!g['map'](i=>i['object'])['includes'](h)));return g;}export{queryObjectsWithType as n,queryObjectWithType as t};
@@ -1,3 +1,3 @@
1
1
  import { n as normalizeTypeTag } from "../type-tag-serializer-BOCNO96r.mjs";
2
- import { A as isValidTransactionDigest, B as parseToUnits, C as WOW_SYSTEM_ADDRESS, D as WOW_ADDRESS_LENGTH, E as WOW_TYPE_ARG, F as normalizeWowObjectId, I as parseStructTag, L as formatAddress, M as isValidWowObjectId, N as normalizeStructTag, O as isValidNamedPackage, P as normalizeWowAddress, R as formatDigest, S as WOW_REGISTRAR_OBJECT_ID, T as WOW_SYSTEM_STATE_OBJECT_ID, _ as WOW_ENTITY_PERMISSION_OBJECT_ID, a as toBase64, b as WOW_OBJECT_LINKER_TX_OBJECT_ID, c as deriveDynamicFieldID, d as WOW_CLOCK_OBJECT_ID, f as WOW_COIN_REGISTRY_OBJECT_ID, g as WOW_ENTITY_OBJECT_ID, h as WOW_ENTITY_CONTACT_OBJECT_ID, i as toBase58, j as isValidWowAddress, k as isValidStructTag, l as MIST_PER_WOW, m as WOW_DENY_LIST_OBJECT_ID, n as fromBase64, o as toHex, p as WOW_DECIMALS, r as fromHex, s as deriveObjectID, t as fromBase58, u as MOVE_STDLIB_ADDRESS, v as WOW_FRAMEWORK_ADDRESS, w as WOW_SYSTEM_MODULE_NAME, x as WOW_RANDOM_OBJECT_ID, y as WOW_OBJECT_LINKER_CORE_OBJECT_ID, z as parseToMist } from "../index-DmWs3NAv.mjs";
3
- export { MIST_PER_WOW, MOVE_STDLIB_ADDRESS, WOW_ADDRESS_LENGTH, WOW_CLOCK_OBJECT_ID, WOW_COIN_REGISTRY_OBJECT_ID, WOW_DECIMALS, WOW_DENY_LIST_OBJECT_ID, WOW_ENTITY_CONTACT_OBJECT_ID, WOW_ENTITY_OBJECT_ID, WOW_ENTITY_PERMISSION_OBJECT_ID, WOW_FRAMEWORK_ADDRESS, WOW_OBJECT_LINKER_CORE_OBJECT_ID, WOW_OBJECT_LINKER_TX_OBJECT_ID, WOW_RANDOM_OBJECT_ID, WOW_REGISTRAR_OBJECT_ID, WOW_SYSTEM_ADDRESS, WOW_SYSTEM_MODULE_NAME, WOW_SYSTEM_STATE_OBJECT_ID, WOW_TYPE_ARG, deriveDynamicFieldID, deriveObjectID, formatAddress, formatDigest, fromBase58, fromBase64, fromHex, isValidNamedPackage, isValidStructTag, isValidTransactionDigest, isValidWowAddress, isValidWowObjectId, normalizeStructTag, normalizeTypeTag, normalizeWowAddress, normalizeWowObjectId, parseStructTag, parseToMist, parseToUnits, toBase58, toBase64, toHex };
2
+ import { A as isValidStructTag, B as parseToMist, C as WOW_REGISTRAR_OBJECT_ID, D as WOW_TYPE_ARG, E as WOW_SYSTEM_STATE_OBJECT_ID, F as normalizeWowAddress, I as normalizeWowObjectId, L as parseStructTag, M as isValidWowAddress, N as isValidWowObjectId, O as WOW_ADDRESS_LENGTH, P as normalizeStructTag, R as formatAddress, S as WOW_RANDOM_OBJECT_ID, T as WOW_SYSTEM_MODULE_NAME, V as parseToUnits, _ as WOW_ENTITY_ORDER_OBJECT_ID, a as toBase64, b as WOW_OBJECT_LINKER_CORE_OBJECT_ID, c as deriveDynamicFieldID, d as WOW_CLOCK_OBJECT_ID, f as WOW_COIN_REGISTRY_OBJECT_ID, g as WOW_ENTITY_OBJECT_ID, h as WOW_ENTITY_CONTACT_OBJECT_ID, i as toBase58, j as isValidTransactionDigest, k as isValidNamedPackage, l as MIST_PER_WOW, m as WOW_DENY_LIST_OBJECT_ID, n as fromBase64, o as toHex, p as WOW_DECIMALS, r as fromHex, s as deriveObjectID, t as fromBase58, u as MOVE_STDLIB_ADDRESS, v as WOW_ENTITY_PERMISSION_OBJECT_ID, w as WOW_SYSTEM_ADDRESS, x as WOW_OBJECT_LINKER_TX_OBJECT_ID, y as WOW_FRAMEWORK_ADDRESS, z as formatDigest } from "../index-DWq5l_Q3.mjs";
3
+ export { MIST_PER_WOW, MOVE_STDLIB_ADDRESS, WOW_ADDRESS_LENGTH, WOW_CLOCK_OBJECT_ID, WOW_COIN_REGISTRY_OBJECT_ID, WOW_DECIMALS, WOW_DENY_LIST_OBJECT_ID, WOW_ENTITY_CONTACT_OBJECT_ID, WOW_ENTITY_OBJECT_ID, WOW_ENTITY_ORDER_OBJECT_ID, WOW_ENTITY_PERMISSION_OBJECT_ID, WOW_FRAMEWORK_ADDRESS, WOW_OBJECT_LINKER_CORE_OBJECT_ID, WOW_OBJECT_LINKER_TX_OBJECT_ID, WOW_RANDOM_OBJECT_ID, WOW_REGISTRAR_OBJECT_ID, WOW_SYSTEM_ADDRESS, WOW_SYSTEM_MODULE_NAME, WOW_SYSTEM_STATE_OBJECT_ID, WOW_TYPE_ARG, deriveDynamicFieldID, deriveObjectID, formatAddress, formatDigest, fromBase58, fromBase64, fromHex, isValidNamedPackage, isValidStructTag, isValidTransactionDigest, isValidWowAddress, isValidWowObjectId, normalizeStructTag, normalizeTypeTag, normalizeWowAddress, normalizeWowObjectId, parseStructTag, parseToMist, parseToUnits, toBase58, toBase64, toHex };
@@ -1 +1 @@
1
- import{a as a56a,c as a56b,i as a56c,l as a56d,n as a56e,o as a56f,r as a56g,s as a56h,t as a56i,u as a56j}from'../wow-types-DcqbnAaK.mjs';import{d as a56k}from'../bcs-BrmSFFhn.mjs';import{A as a56l,C as a56m,D as a56n,E as a56o,O as a56p,T as a56q,_ as a56r,a as a56s,b as a56t,c as a56u,d as a56v,f as a56w,g as a56x,h as a56y,i as a56z,j as a56A,k as a56B,l as a56C,m as a56D,n as a56E,o as a56F,p as a56G,r as a56H,s as a56I,t as a56J,u as a56K,v as a56L,w as a56M,x as a56N,y as a56O}from'../utils-CpS-PwC-.mjs';export{a56w as MIST_PER_WOW,a56G as MOVE_STDLIB_ADDRESS,a56i as WOW_ADDRESS_LENGTH,a56D as WOW_CLOCK_OBJECT_ID,a56y as WOW_COIN_REGISTRY_OBJECT_ID,a56x as WOW_DECIMALS,a56r as WOW_DENY_LIST_OBJECT_ID,a56L as WOW_ENTITY_CONTACT_OBJECT_ID,a56O as WOW_ENTITY_OBJECT_ID,a56t as WOW_ENTITY_PERMISSION_OBJECT_ID,a56N as WOW_FRAMEWORK_ADDRESS,a56m as WOW_OBJECT_LINKER_CORE_OBJECT_ID,a56M as WOW_OBJECT_LINKER_TX_OBJECT_ID,a56q as WOW_RANDOM_OBJECT_ID,a56o as WOW_REGISTRAR_OBJECT_ID,a56n as WOW_SYSTEM_ADDRESS,a56p as WOW_SYSTEM_MODULE_NAME,a56B as WOW_SYSTEM_STATE_OBJECT_ID,a56l as WOW_TYPE_ARG,a56A as deriveDynamicFieldID,a56I as deriveObjectID,a56u as formatAddress,a56C as formatDigest,a56J as fromBase58,a56E as fromBase64,a56H as fromHex,a56e as isValidNamedPackage,a56g as isValidStructTag,a56c as isValidTransactionDigest,a56a as isValidWowAddress,a56f as isValidWowObjectId,a56h as normalizeStructTag,a56k as normalizeTypeTag,a56b as normalizeWowAddress,a56d as normalizeWowObjectId,a56j as parseStructTag,a56K as parseToMist,a56v as parseToUnits,a56z as toBase58,a56s as toBase64,a56F as toHex};
1
+ import{a as a56a,c as a56b,i as a56c,l as a56d,n as a56e,o as a56f,r as a56g,s as a56h,t as a56i,u as a56j}from'../wow-types-DcqbnAaK.mjs';import{d as a56k}from'../bcs-BrmSFFhn.mjs';import{A as a56l,D as a56m,E as a56n,M as a56o,O as a56p,S as a56q,T as a56r,_ as a56s,a as a56t,b as a56u,c as a56v,d as a56w,f as a56x,g as a56y,h as a56z,i as a56A,j as a56B,k as a56C,l as a56D,m as a56E,n as a56F,o as a56G,p as a56H,r as a56I,s as a56J,t as a56K,u as a56L,v as a56M,w as a56N,x as a56O,y as a56P}from'../utils-CoXIRMWK.mjs';export{a56x as MIST_PER_WOW,a56H as MOVE_STDLIB_ADDRESS,a56i as WOW_ADDRESS_LENGTH,a56E as WOW_CLOCK_OBJECT_ID,a56z as WOW_COIN_REGISTRY_OBJECT_ID,a56y as WOW_DECIMALS,a56s as WOW_DENY_LIST_OBJECT_ID,a56M as WOW_ENTITY_CONTACT_OBJECT_ID,a56P as WOW_ENTITY_OBJECT_ID,a56u as WOW_ENTITY_ORDER_OBJECT_ID,a56O as WOW_ENTITY_PERMISSION_OBJECT_ID,a56q as WOW_FRAMEWORK_ADDRESS,a56N as WOW_OBJECT_LINKER_CORE_OBJECT_ID,a56r as WOW_OBJECT_LINKER_TX_OBJECT_ID,a56n as WOW_RANDOM_OBJECT_ID,a56m as WOW_REGISTRAR_OBJECT_ID,a56p as WOW_SYSTEM_ADDRESS,a56C as WOW_SYSTEM_MODULE_NAME,a56l as WOW_SYSTEM_STATE_OBJECT_ID,a56B as WOW_TYPE_ARG,a56o as deriveDynamicFieldID,a56J as deriveObjectID,a56v as formatAddress,a56D as formatDigest,a56K as fromBase58,a56F as fromBase64,a56I as fromHex,a56e as isValidNamedPackage,a56g as isValidStructTag,a56c as isValidTransactionDigest,a56a as isValidWowAddress,a56f as isValidWowObjectId,a56h as normalizeStructTag,a56k as normalizeTypeTag,a56b as normalizeWowAddress,a56d as normalizeWowObjectId,a56j as parseStructTag,a56L as parseToMist,a56w as parseToUnits,a56A as toBase58,a56t as toBase64,a56G as toHex};
@@ -0,0 +1 @@
1
+ import{o as a57a,u as a57b}from'./bcs-BrmSFFhn.mjs';import{fromBase58 as a57c,fromBase64 as a57d,fromHex as a57e,toBase58 as a57f,toBase64 as a57g,toHex,toHex as a57h}from'@mysten/bcs';import{blake2b}from'@noble/hashes/blake2.js';function deriveDynamicFieldID(a,b,c){const d=a57a['Address']['serialize'](a)['toBytes'](),e=a57a['TypeTag']['serialize'](b)['toBytes'](),f=a57a['u64']()['serialize'](c['length'])['toBytes'](),g=blake2b['create']({'dkLen':0x20});g['update'](new Uint8Array([0xf0])),g['update'](d),g['update'](f),g['update'](c),g['update'](e);const h=g['digest'](),i=new Uint8Array(0x20);return i[0x0]=0xf1,i['set'](h['slice'](0x0,0x1f),0x1),'0x'+toHex(i);}const WOW_DECIMALS=0x9,MIST_PER_WOW=BigInt(0x3b9aca00),MOVE_STDLIB_ADDRESS='0x0000000000000000000000000000000000000000000000000000000000000001',WOW_FRAMEWORK_ADDRESS='0x0000000000000000000000000000000000000000000000000000000000000002',WOW_SYSTEM_ADDRESS='0x0000000000000000000000000000000000000000000000000000000000000003',WOW_CLOCK_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000006',WOW_SYSTEM_MODULE_NAME='wow_system',WOW_TYPE_ARG=WOW_FRAMEWORK_ADDRESS+'::wow::WOW',WOW_SYSTEM_STATE_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000005',WOW_RANDOM_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000008',WOW_COIN_REGISTRY_OBJECT_ID='0x000000000000000000000000000000000000000000000000000000000000000c',WOW_DENY_LIST_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000403',WOW_ENTITY_CONTACT_OBJECT_ID='0xaa9',WOW_REGISTRAR_OBJECT_ID='0xaaa',WOW_ENTITY_OBJECT_ID='0xaab',WOW_MESSENGER_OBJECT_ID='0xaac',WOW_ENTITY_PERMISSION_OBJECT_ID='0xaad',WOW_OBJECT_LINKER_CORE_OBJECT_ID='0xaae',WOW_OBJECT_LINKER_TX_OBJECT_ID='0xaaf',WOW_ENTITY_ORDER_OBJECT_ID='0xaa8',ELLIPSIS='…';function formatAddress(a){if(a['length']<=0x6)return a;const b=a['startsWith']('0x')?0x2:0x0;return'0x'+a['slice'](b,b+0x4)+ELLIPSIS+a['slice'](-0x4);}function formatDigest(a){return''+a['slice'](0x0,0xa)+ELLIPSIS;}const AMOUNT_REGEX=/^-?(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+)$/;function parseToUnits(a,b){if(b<0x0||!Number['isInteger'](b))throw new Error('Invalid\x20decimals:\x20'+b);if(!AMOUNT_REGEX['test'](a))throw new Error('Invalid\x20amount:\x20\x22'+a+'\x22');const c=a['startsWith']('-'),[d,e='']=(c?a['slice'](0x1):a)['split']('.');if(e['length']>b)throw new Error('Too\x20many\x20decimal\x20places:\x20\x22'+a+'\x22\x20has\x20'+e['length']+'\x20but\x20max\x20is\x20'+b);const f=e['padEnd'](b,'0')||'0',g=BigInt(d||'0')*0xan**BigInt(b)+BigInt(f);return c?-g:g;}function parseToMist(a){return parseToUnits(a,0x9);}function deriveObjectID(a,b,c){return deriveDynamicFieldID(a,'0x2::derived_object::DerivedObjectKey<'+(typeof b==='string'?b:a57b['tagToString'](b))+'>',c);}export{WOW_SYSTEM_STATE_OBJECT_ID as A,WOW_MESSENGER_OBJECT_ID as C,WOW_REGISTRAR_OBJECT_ID as D,WOW_RANDOM_OBJECT_ID as E,deriveDynamicFieldID as M,WOW_SYSTEM_ADDRESS as O,WOW_FRAMEWORK_ADDRESS as S,WOW_OBJECT_LINKER_TX_OBJECT_ID as T,WOW_DENY_LIST_OBJECT_ID as _,a57g as a,WOW_ENTITY_ORDER_OBJECT_ID as b,formatAddress as c,parseToUnits as d,MIST_PER_WOW as f,WOW_DECIMALS as g,WOW_COIN_REGISTRY_OBJECT_ID as h,a57f as i,WOW_TYPE_ARG as j,WOW_SYSTEM_MODULE_NAME as k,formatDigest as l,WOW_CLOCK_OBJECT_ID as m,a57d as n,a57h as o,MOVE_STDLIB_ADDRESS as p,a57e as r,deriveObjectID as s,a57c as t,parseToMist as u,WOW_ENTITY_CONTACT_OBJECT_ID as v,WOW_OBJECT_LINKER_CORE_OBJECT_ID as w,WOW_ENTITY_PERMISSION_OBJECT_ID as x,WOW_ENTITY_OBJECT_ID as y};
@@ -1,2 +1,2 @@
1
- import { Gb as verifyPersonalMessageSignature, Kb as verifySignature, Ub as publicKeyFromRawBytes, Wb as publicKeyFromWowBytes, qb as verifyTransactionSignature } from "../index-ByXPNYyQ.mjs";
1
+ import { Ax as verifyTransactionSignature, Dx as publicKeyFromWowBytes, Ex as publicKeyFromRawBytes, Ox as verifyPersonalMessageSignature, kx as verifySignature } from "../index-OlNG95EF.mjs";
2
2
  export { publicKeyFromRawBytes, publicKeyFromWowBytes, verifyPersonalMessageSignature, verifySignature, verifyTransactionSignature };
@@ -1,2 +1,2 @@
1
- import { $u as MAX_ALLOCATOR_COUNT, Qu as CallAllocation_Data, Xu as AllocatorsType, Zu as CallAllocation, ad as receive, ed as alloc, gg as MAX_SHARING_COUNT, id as newAllocation, nd as allocators, od as sharing, rd as create, td as allocationFn } from "../../index-ByXPNYyQ.mjs";
1
+ import { Cd as sharing, Sd as receive, Yg as MAX_SHARING_COUNT, _d as alloc, bd as create, gd as MAX_ALLOCATOR_COUNT, hd as CallAllocation_Data, md as CallAllocation, pd as AllocatorsType, vd as allocationFn, xd as newAllocation, yd as allocators } from "../../index-OlNG95EF.mjs";
2
2
  export { AllocatorsType, CallAllocation, CallAllocation_Data, MAX_ALLOCATOR_COUNT, MAX_SHARING_COUNT, alloc, allocationFn, allocators, create, newAllocation, receive, sharing };
@@ -1 +1 @@
1
- import{a as a59a}from'../../wow-types-DcqbnAaK.mjs';import{$ as a59b,Q as a59c,W as a59d,f as a59e,ht as a59f,m as a59g,u as a59h,v as a59i}from'../../common-ofEOpNis.mjs';import{o as a59j}from'../../exception-C6IYkBi6.mjs';import{LocalMark}from'../local/local.mjs';import{GetAccountOrMark_Address,GetManyAccountOrMark_Address}from'../local/index.mjs';import{pt as a59k,vt as a59l}from'../../object-CuC7vjpw.mjs';import{t as a59m}from'../../received--vCB9_Go.mjs';import{dt as a59n,r as a59o,w as a59p}from'../../passport-Z-HwuwHV.mjs';import{r as a59q,t as a59r}from'../../base-DAh1eDOw.mjs';import{paymentInfo}from'./payment.mjs';var CallAllocation=class extends a59r{constructor(a){super(),this['object_address']=void 0x0,this['type_parameter']=void 0x0,this['data']=a;}async['prepare'](a){await super['prepare'](a);if(!this['object_address'])this['object_address']=await a59e(this['data']?.['object']);if(this['object_address']){this['content']=void 0x0,await this['update_content'](a,'Allocation',this['object_address']);if(!this['content'])a59j('invalid\x20parameter','CallAllocation_Data.data.object:'+this['object_address']);this['type_parameter']=a59k(this['content']['type_raw'],'allocation::Allocation');if(!this['type_parameter'])a59j('invalid\x20argument\x20type','CallAllocation_Data.data.object.type_parameter\x20is\x20empty');}else{const b=a59h(this['data']['object']);if(!b||!a59g(b?.['type_parameter']))a59j('invalid\x20argument\x20type','CallAllocation_Data.data.object.type_parameter\x20is\x20empty');this['type_parameter']=b?.['type_parameter'];}if('alloc_by_guard'in this['data']&&this['data']['alloc_by_guard']!=null&&!a59a(this['data']['alloc_by_guard'])){const c=await LocalMark['Instance']()['get_address'](this['data']['alloc_by_guard']);if(!c||!a59a(c))a59j('invalid\x20address','alloc_by_guard:\x20'+this['data']['alloc_by_guard']);this['data']['alloc_by_guard']=c;}}async['call'](a){await this['prepare'](a);if('alloc_by_guard'in this['data']&&this['data']['alloc_by_guard']!=null){const b=this['data']['alloc_by_guard'];if(this['content']&&!this['content']['allocators']['find'](d=>d['guard']===b))a59j('invalid\x20parameter','alloc_by_guard:\x20'+b+'\x20not\x20found\x20in\x20allocators\x20'+this['content']['allocators']['map'](d=>d['guard']));const c=await a59o(a,[b]);if(c['submission']['length']>0x0)return{'type':'submission','guard':c['guard'],'submission':c['submission']};return await this['check_passport'](a,c);}return await this['exec'](a);}async['operate'](a,b,c){if(this['object_address']){if('received_coins'in this['data']&&this['data']['received_coins']!=null){if(this['data']['received_coins']==='recently'){const d=await a59m({'name_or_address':{'name_or_address':this['object_address'],'local_mark_first':!![]},'type':'CoinWrapper','network':a['network'],'no_cache':a['no_cache']});if(Array['isArray'](d))a59j('invalid\x20parameter','CallAllocation_Data.data.received_coins:\x20received\x20is\x20ReceivedNormal[]');else this['data']['received_coins']=d;}if(typeof this['data']['received_coins']==='object'&&'received'in this['data']['received_coins']&&this['data']['received_coins']['received']?.['length']>0x0){if(this['data']['received_coins']?.['token_type']!==this['type_parameter'])a59j('invalid\x20parameter','CallAllocation_Data.data.received_coins.token_type:'+this['data']['received_coins']?.['token_type']);for(const e of this['data']['received_coins']['received']){if(!a59a(e['id'])||!a59a(e['payment']))a59j('invalid\x20parameter','CallAllocation_Data.data.received_coins:'+e['id']);receive(b,a59f(b,this['object_address']),this['type_parameter'],a59f(b,e['id']),a59f(b,e['payment']));}}}if('alloc_by_guard'in this['data']&&this['data']['alloc_by_guard']!=null){if(!c)a59j('invalid\x20parameter','CallAllocation_Data.data.alloc_by_guard:'+this['data']['alloc_by_guard']);alloc(b,a59f(b,this['object_address']),this['type_parameter'],this['data']['alloc_by_guard'],c);}}else{const f=a59h(this['data']['object']);if(!a59g(f?.['type_parameter']))a59j('invalid\x20argument\x20type','CallAllocation_Data.data.object.type_parameter\x20'+f?.['type_parameter']);this['type_parameter']=f?.['type_parameter'];let g;if('coin'in this['data']&&this['data']['coin'])g=await a59q(a,b,this['data']['coin'],this['type_parameter']);if(g&&'allocators'in this['data']&&this['data']['allocators']&&this['type_parameter']){const h=newAllocation(b,this['type_parameter'],g,await allocators(b,this['data']['allocators']));await this['new_with_mark'](a,b,'Allocation',create(b,h,this['type_parameter'],await paymentInfo(a,b,this['data']['payment_info'])),f);}else a59j('invalid\x20parameter','CallAllocation_Data.data\x20'+JSON['stringify'](this['data']));}}};function allocationFn(a){return'0x2::allocation::'+a;}const MAX_ALLOCATOR_COUNT=a59p,getAllocationModeNumber=a=>{let b;if(typeof a==='number')b=a;else{if(typeof a==='string')switch(a){case'Amount':b=0x0;break;case'Rate':b=0x1;break;case'Surplus':b=0x2;break;default:b=Number(a);}else b=Number(a);}if(b!==0x0&&b!==0x1&&b!==0x2)a59j('invalid\x20parameter','Invalid\x20allocation\x20mode:\x20'+a+'.\x20Only\x200\x20(Amount),\x201\x20(Rate),\x20or\x202\x20(Surplus)\x20are\x20allowed.');return b;},sharing=async(a,b,c)=>{const d=getAllocationModeNumber(b['mode']);if('GuardIdentifier'in b['who']){if(!a59b(b['who']['GuardIdentifier']))a59j('invalid\x20u8','sharing\x20GuardIdentifier:\x20'+b['who']['GuardIdentifier']);return a['moveCall']({'target':allocationFn('sharing_for_guard_identifier'),'arguments':[a['pure']['u8'](b['who']['GuardIdentifier']),a['pure']['u64'](b['sharing']),a['pure']['u8'](d)]});}else{if('Entity'in b['who']){const e=c||await GetAccountOrMark_Address(b['who']['Entity']);if(!e)a59j('invalid\x20address','sharing\x20Entity:\x20'+b['who']['Entity']);return a['moveCall']({'target':allocationFn('sharing_for_address'),'arguments':[a['pure']['address'](e),a['pure']['u64'](b['sharing']),a['pure']['u8'](d)]});}else return a['moveCall']({'target':allocationFn('sharing_for_signer'),'arguments':[a['pure']['u64'](b['sharing']),a['pure']['u8'](d)]});}},allocators=async(a,b)=>{if(!a59d(b['description']))a59j('invalid\x20parameter','Description\x20exceeds\x20maximum\x20length\x20'+a59i);if(b['allocators']['length']>MAX_ALLOCATOR_COUNT)a59j('invalid\x20parameter','Allocator\x20count\x20exceeds\x20maximum\x20limit\x20'+MAX_ALLOCATOR_COUNT);if(b['allocators']['length']===0x0)a59j('invalid\x20parameter','Allocator\x20array\x20cannot\x20be\x20empty');if(!a59c(b['threshold']))a59j('invalid\x20parameter','threshold:\x20'+b['threshold']);const c=a['moveCall']({'target':allocationFn('allocators'),'arguments':[a['pure']['string'](b['description']),a['pure']['u64'](b['threshold'])]});for(let d=0x0;d<b['allocators']['length'];d++){const e=b['allocators'][d];if(e['sharing']['length']===0x0)a59j('invalid\x20parameter','sharing\x20array\x20cannot\x20be\x20empty');if(e['sharing']['length']>a59n)a59j('invalid\x20parameter','sharing\x20count\x20exceeds\x20maximum\x20limit\x20'+a59n);const f=e['sharing']['map'](r=>getAllocationModeNumber(r['mode'])),h=e['sharing']['filter']((r,s)=>f[s]===0x0),j=e['sharing']['filter']((r,s)=>f[s]===0x1),k=e['sharing']['filter']((r,s)=>f[s]===0x2);if(k['length']>0x1)a59j('invalid\x20parameter','Allocator['+d+']:\x20max\x20ONE\x20Surplus\x20item\x20per\x20Allocator\x20(contract\x20EMULTIPLE_SURPLUS=5).\x20Found\x20'+k['length']+'\x20Surplus\x20items.\x20Items:\x20'+e['sharing']['map']((r,t)=>'['+t+']\x20mode='+r['mode']+',\x20sharing='+r['sharing'])['join'](',\x20')+'.\x20Fix:\x20keep\x20only\x20one\x20Surplus\x20item\x20or\x20remove\x20all\x20Surplus\x20items.');if(j['length']>0x0){const r=j['reduce']((t,u)=>t+BigInt(u['sharing']),0x0n),s=j['map'](t=>'['+e['sharing']['indexOf'](t)+']\x20rate='+t['sharing'])['join'](',\x20');if(k['length']>0x0){if(r>0x2710n)a59j('invalid\x20parameter','Allocator['+d+']:\x20Rate\x20sum\x20exceeds\x2010000\x20when\x20Surplus\x20is\x20defined\x20(contract\x20ERATE_EXCEEDS_10000=6).\x20Current\x20sum:\x20'+r+',\x20max\x20allowed:\x2010000.\x20Rate\x20items:\x20'+s+'.\x20Fix:\x20reduce\x20Rate\x20values\x20so\x20sum\x20<=\x2010000,\x20or\x20remove\x20the\x20Surplus\x20item\x20(then\x20sum\x20must\x20==\x2010000).');}else{if(r!==0x2710n)a59j('invalid\x20parameter','Allocator['+d+']:\x20Rate\x20sum\x20must\x20be\x20EXACTLY\x2010000\x20when\x20no\x20Surplus\x20is\x20defined\x20(contract\x20ERATE_NOT_10000=4).\x20Current\x20sum:\x20'+r+',\x20expected:\x2010000.\x20Rate\x20items:\x20'+s+'.\x20Fix:\x20adjust\x20Rate\x20values\x20so\x20sum\x20==\x2010000,\x20or\x20add\x20a\x20Surplus\x20item\x20(then\x20sum\x20can\x20be\x20<=\x2010000).');}}if(h['length']>0x0&&e['max']!=null){const t=h['reduce']((v,w)=>v+BigInt(w['sharing']),0x0n),u=BigInt(e['max']);if(t>u)a59j('invalid\x20parameter','Allocator['+d+']:\x20Amount\x20sum\x20exceeds\x20max\x20(contract\x20EAMOUNT_EXCEEDS_MAX=13).\x20Amount\x20sum:\x20'+t+',\x20max:\x20'+u+'.\x20Amount\x20items:\x20'+h['map'](v=>'['+e['sharing']['indexOf'](v)+']\x20amount='+v['sharing'])['join'](',\x20')+'.\x20Fix:\x20reduce\x20Amount\x20values\x20so\x20sum\x20<=\x20max,\x20or\x20increase/remove\x20max.');}if(h['length']>0x0&&j['length']===0x0&&k['length']===0x0){const v=h['reduce']((x,y)=>x+BigInt(y['sharing']),0x0n),w=BigInt(b['threshold']);if(v<w)a59j('invalid\x20parameter','Allocator['+d+']:\x20Amount\x20sum\x20below\x20threshold\x20(contract\x20EAMOUNT_BELOW_THRESHOLD=12).\x20Amount\x20sum:\x20'+v+',\x20threshold:\x20'+w+'.\x20Amount\x20items:\x20'+h['map'](x=>'['+e['sharing']['indexOf'](x)+']\x20amount='+x['sharing'])['join'](',\x20')+'.\x20Fix:\x20increase\x20Amount\x20values\x20so\x20sum\x20>=\x20threshold,\x20or\x20add\x20Rate/Surplus\x20items\x20(threshold\x20only\x20applies\x20when\x20no\x20Rate\x20and\x20no\x20Surplus).');}const l=e['sharing']['map']((x,y)=>{if('Entity'in x['who'])return{'index':y,'name_or_address':x['who']['Entity']['name_or_address']};else return null;})['filter'](x=>x!==null),[m,n]=await Promise['all']([LocalMark['Instance']()['get_address'](e['guard']),GetManyAccountOrMark_Address({'entities':l,'check_all_founded':!![]})]),o=new Array(e['sharing']['length']);l['forEach']((x,y)=>{o[x['index']]=n[y];});if(!m)a59j('invalid\x20address','guard:\x20'+e['guard']);const p=await Promise['all'](e['sharing']['map'](async(x,y)=>{if('Entity'in x['who']){const z=o[y];if(!z)a59j('invalid\x20address','entity:\x20'+(typeof x['who']['Entity']==='string'?x['who']['Entity']:x['who']['Entity']['name_or_address']));return sharing(a,x,z);}else return sharing(a,x);})),q=a['makeMoveVec']({'elements':p,'type':'0x2::allocation::Sharing'});a['moveCall']({'target':allocationFn('allocator_add'),'arguments':[c,a59f(a,m),q,a['pure']['option']('u64',e?.['max'])]});}return c;};function alloc(a,b,c,d,e){a59l([b,d,e]);if(!a59g(c))a59j('invalid\x20parameter','allocation_type:\x20'+c+'\x20invalid');a['moveCall']({'target':allocationFn('alloc'),'arguments':[b,a59f(a,d),a59f(a,e),a['object']['mutObjectLinkerTx'](),a['object']['clock']()],'typeArguments':[c]});}function newAllocation(a,b,c,d){return a59l([c,d]),a['moveCall']({'target':allocationFn('new_with_coin'),'arguments':[c,d,a['object']['mutObjectLinkerTx'](),a['object']['clock']()],'typeArguments':[b]});}function create(a,b,c,d){a59l([b,d]);if(!a59g(c))a59j('invalid\x20parameter','allocation_type:\x20'+c+'\x20invalid');return a['moveCall']({'target':allocationFn('create'),'arguments':[b,a59f(a,d)],'typeArguments':[c]});}function receive(a,b,c,d,e){a59l([b,e,d]);if(!a59g(c))a59j('invalid\x20parameter','allocation_type:\x20'+c+'\x20invalid');return a['moveCall']({'target':allocationFn('receive'),'arguments':[b,a59f(a,d),a59f(a,e)],'typeArguments':[c]});}export{CallAllocation,MAX_ALLOCATOR_COUNT,a59n as MAX_SHARING_COUNT,alloc,allocationFn,allocators,create,newAllocation,receive,sharing};
1
+ import{a as a59a}from'../../wow-types-DcqbnAaK.mjs';import{o as a59b}from'../../exception-Xd2RFs2i.mjs';import{$ as a59c,G as a59d,d as a59e,et as a59f,gt as a59g,h as a59h,p as a59i,y as a59j}from'../../common-Guc0E9Tj.mjs';import{LocalMark}from'../local/local.mjs';import{GetAccountOrMark_Address,GetManyAccountOrMark_Address}from'../local/index.mjs';import{Tt as a59k,bt as a59l}from'../../object-CJHJxXlc.mjs';import{t as a59m}from'../../received-D0KPLcZ8.mjs';import{ft as a59n,r as a59o,w as a59p}from'../../passport-B5g5Rv9_.mjs';import{r as a59q,t as a59r}from'../../base-o08Syk_8.mjs';import{paymentInfo,resolvePaymentInfoContext}from'./payment.mjs';var CallAllocation=class extends a59r{constructor(a){super(),this['object_address']=void 0x0,this['type_parameter']=void 0x0,this['data']=a;}async['prepare'](a){await super['prepare'](a);if(!this['object_address'])this['object_address']=await a59i(this['data']?.['object']);if(this['object_address']){this['content']=void 0x0,await this['update_content'](a,'Allocation',this['object_address']);if(!this['content'])a59b('invalid\x20parameter','CallAllocation_Data.data.object:'+this['object_address']);this['type_parameter']=a59l(this['content']['type_raw'],'allocation::Allocation');if(!this['type_parameter'])a59b('invalid\x20argument\x20type','CallAllocation_Data.data.object.type_parameter\x20is\x20empty');}else{const b=a59e(this['data']['object']);if(!b||!a59h(b?.['type_parameter']))a59b('invalid\x20argument\x20type','CallAllocation_Data.data.object.type_parameter\x20is\x20empty');this['type_parameter']=b?.['type_parameter'];}if('alloc_by_guard'in this['data']&&this['data']['alloc_by_guard']!=null&&!a59a(this['data']['alloc_by_guard'])){const c=await LocalMark['Instance']()['get_address'](this['data']['alloc_by_guard']);if(!c||!a59a(c))a59b('invalid\x20address','alloc_by_guard:\x20'+this['data']['alloc_by_guard']);this['data']['alloc_by_guard']=c;}if('received_coins'in this['data']&&this['data']['received_coins']==='recently'&&this['object_address']){const d=await a59m({'name_or_address':{'name_or_address':this['object_address'],'local_mark_first':!![]},'type':'CoinWrapper','network':a['network'],'no_cache':a['no_cache']});if(Array['isArray'](d))a59b('invalid\x20parameter','CallAllocation_Data.data.received_coins:\x20received\x20is\x20ReceivedNormal[]\x20(expected\x20ReceivedBalance)');this['_resolved_received_coins']=d;}if('payment_info'in this['data']&&this['data']['payment_info']!=null)this['_resolved_alloc_pi']=await resolvePaymentInfoContext(a,this['data']['payment_info']);}async['call'](a){await this['prepare'](a);if('alloc_by_guard'in this['data']&&this['data']['alloc_by_guard']!=null){const b=this['data']['alloc_by_guard'];if(this['content']&&!this['content']['allocators']['find'](d=>d['guard']===b))a59b('invalid\x20parameter','alloc_by_guard:\x20'+b+'\x20not\x20found\x20in\x20allocators\x20'+this['content']['allocators']['map'](d=>d['guard']));const c=await a59o(a,[b]);if(c['submission']['length']>0x0)return{'type':'submission','guard':c['guard'],'submission':c['submission']};return await this['check_passport'](a,c);}return await this['exec'](a);}async['operate'](a,b,c){if(this['object_address']){if('received_coins'in this['data']&&this['data']['received_coins']!=null){const d=this['_resolved_received_coins']!==void 0x0?this['_resolved_received_coins']:this['data']['received_coins'];if(d==='recently')a59b('invalid\x20parameter','CallAllocation_Data.data.received_coins:\x20internal\x20invariant\x20—\x20\x27recently\x27\x20not\x20pre-resolved');else{if(Array['isArray'](d))a59b('invalid\x20parameter','CallAllocation_Data.data.received_coins:\x20received\x20is\x20ReceivedNormal[]\x20(expected\x20ReceivedBalance)');else{if(d['received']?.['length']>0x0){if(d['token_type']!==this['type_parameter'])a59b('invalid\x20parameter','CallAllocation_Data.data.received_coins.token_type:'+d['token_type']);for(const e of d['received']){if(!a59a(e['id'])||!a59a(e['payment']))a59b('invalid\x20parameter','CallAllocation_Data.data.received_coins:'+e['id']);receive(b,a59g(b,this['object_address']),this['type_parameter'],a59g(b,e['id']),a59g(b,e['payment']));}}}}}if('alloc_by_guard'in this['data']&&this['data']['alloc_by_guard']!=null){if(!c)a59b('invalid\x20parameter','CallAllocation_Data.data.alloc_by_guard:'+this['data']['alloc_by_guard']);alloc(b,a59g(b,this['object_address']),this['type_parameter'],this['data']['alloc_by_guard'],c);}}else{const f=a59e(this['data']['object']);if(!a59h(f?.['type_parameter']))a59b('invalid\x20argument\x20type','CallAllocation_Data.data.object.type_parameter\x20'+f?.['type_parameter']);this['type_parameter']=f?.['type_parameter'];let g;if('coin'in this['data']&&this['data']['coin'])g=await a59q(a,b,this['data']['coin'],this['type_parameter']);if(g&&'allocators'in this['data']&&this['data']['allocators']&&this['type_parameter']){const h=newAllocation(b,this['type_parameter'],g,await allocators(b,this['data']['allocators']));await this['new_with_mark'](a,b,'Allocation',create(b,h,this['type_parameter'],await paymentInfo(a,b,this['data']['payment_info'],this['_resolved_alloc_pi'])),f);}else a59b('invalid\x20parameter','CallAllocation_Data.data\x20'+JSON['stringify'](this['data']));}}};function allocationFn(a){return'0x2::allocation::'+a;}const MAX_ALLOCATOR_COUNT=a59p,getAllocationModeNumber=a=>{let b;if(typeof a==='number')b=a;else{if(typeof a==='string')switch(a){case'Amount':b=0x0;break;case'Rate':b=0x1;break;case'Surplus':b=0x2;break;default:b=Number(a);}else b=Number(a);}if(b!==0x0&&b!==0x1&&b!==0x2)a59b('invalid\x20parameter','Invalid\x20allocation\x20mode:\x20'+a+'.\x20Only\x200\x20(Amount),\x201\x20(Rate),\x20or\x202\x20(Surplus)\x20are\x20allowed.');return b;},sharing=async(a,b,c)=>{const d=getAllocationModeNumber(b['mode']);if('GuardIdentifier'in b['who']){if(!a59f(b['who']['GuardIdentifier']))a59b('invalid\x20u8','sharing\x20GuardIdentifier:\x20'+b['who']['GuardIdentifier']);return a['moveCall']({'target':allocationFn('sharing_for_guard_identifier'),'arguments':[a['pure']['u8'](b['who']['GuardIdentifier']),a['pure']['u64'](b['sharing']),a['pure']['u8'](d)]});}else{if('Entity'in b['who']){const e=c||await GetAccountOrMark_Address(b['who']['Entity']);if(!e)a59b('invalid\x20address','sharing\x20Entity:\x20'+b['who']['Entity']);return a['moveCall']({'target':allocationFn('sharing_for_address'),'arguments':[a['pure']['address'](e),a['pure']['u64'](b['sharing']),a['pure']['u8'](d)]});}else return a['moveCall']({'target':allocationFn('sharing_for_signer'),'arguments':[a['pure']['u64'](b['sharing']),a['pure']['u8'](d)]});}},allocators=async(a,b)=>{if(!a59d(b['description']))a59b('invalid\x20parameter','Description\x20exceeds\x20maximum\x20length\x20'+a59j);if(b['allocators']['length']>MAX_ALLOCATOR_COUNT)a59b('invalid\x20parameter','Allocator\x20count\x20exceeds\x20maximum\x20limit\x20'+MAX_ALLOCATOR_COUNT);if(b['allocators']['length']===0x0)a59b('invalid\x20parameter','Allocator\x20array\x20cannot\x20be\x20empty');if(!a59c(b['threshold']))a59b('invalid\x20parameter','threshold:\x20'+b['threshold']);const c=a['moveCall']({'target':allocationFn('allocators'),'arguments':[a['pure']['string'](b['description']),a['pure']['u64'](b['threshold'])]});for(let d=0x0;d<b['allocators']['length'];d++){const e=b['allocators'][d];if(e['sharing']['length']===0x0)a59b('invalid\x20parameter','sharing\x20array\x20cannot\x20be\x20empty');if(e['sharing']['length']>a59n)a59b('invalid\x20parameter','sharing\x20count\x20exceeds\x20maximum\x20limit\x20'+a59n);const f=e['sharing']['map'](r=>getAllocationModeNumber(r['mode'])),h=e['sharing']['filter']((r,s)=>f[s]===0x0),j=e['sharing']['filter']((r,s)=>f[s]===0x1),k=e['sharing']['filter']((r,s)=>f[s]===0x2);if(k['length']>0x1)a59b('invalid\x20parameter','Allocator['+d+']:\x20max\x20ONE\x20Surplus\x20item\x20per\x20Allocator\x20(contract\x20EMULTIPLE_SURPLUS=5).\x20Found\x20'+k['length']+'\x20Surplus\x20items.\x20Items:\x20'+e['sharing']['map']((r,t)=>'['+t+']\x20mode='+r['mode']+',\x20sharing='+r['sharing'])['join'](',\x20')+'.\x20Fix:\x20keep\x20only\x20one\x20Surplus\x20item\x20or\x20remove\x20all\x20Surplus\x20items.');if(j['length']>0x0){const r=j['reduce']((t,u)=>t+BigInt(u['sharing']),0x0n),s=j['map'](t=>'['+e['sharing']['indexOf'](t)+']\x20rate='+t['sharing'])['join'](',\x20');if(k['length']>0x0){if(r>0x2710n)a59b('invalid\x20parameter','Allocator['+d+']:\x20Rate\x20sum\x20exceeds\x2010000\x20when\x20Surplus\x20is\x20defined\x20(contract\x20ERATE_EXCEEDS_10000=6).\x20Current\x20sum:\x20'+r+',\x20max\x20allowed:\x2010000.\x20Rate\x20items:\x20'+s+'.\x20Fix:\x20reduce\x20Rate\x20values\x20so\x20sum\x20<=\x2010000,\x20or\x20remove\x20the\x20Surplus\x20item\x20(then\x20sum\x20must\x20==\x2010000).');}else{if(r!==0x2710n)a59b('invalid\x20parameter','Allocator['+d+']:\x20Rate\x20sum\x20must\x20be\x20EXACTLY\x2010000\x20when\x20no\x20Surplus\x20is\x20defined\x20(contract\x20ERATE_NOT_10000=4).\x20Current\x20sum:\x20'+r+',\x20expected:\x2010000.\x20Rate\x20items:\x20'+s+'.\x20Fix:\x20adjust\x20Rate\x20values\x20so\x20sum\x20==\x2010000,\x20or\x20add\x20a\x20Surplus\x20item\x20(then\x20sum\x20can\x20be\x20<=\x2010000).');}}if(h['length']>0x0&&e['max']!=null){const t=h['reduce']((v,w)=>v+BigInt(w['sharing']),0x0n),u=BigInt(e['max']);if(t>u)a59b('invalid\x20parameter','Allocator['+d+']:\x20Amount\x20sum\x20exceeds\x20max\x20(contract\x20EAMOUNT_EXCEEDS_MAX=13).\x20Amount\x20sum:\x20'+t+',\x20max:\x20'+u+'.\x20Amount\x20items:\x20'+h['map'](v=>'['+e['sharing']['indexOf'](v)+']\x20amount='+v['sharing'])['join'](',\x20')+'.\x20Fix:\x20reduce\x20Amount\x20values\x20so\x20sum\x20<=\x20max,\x20or\x20increase/remove\x20max.');}if(h['length']>0x0&&j['length']===0x0&&k['length']===0x0){const v=h['reduce']((x,y)=>x+BigInt(y['sharing']),0x0n),w=BigInt(b['threshold']);if(v<w)a59b('invalid\x20parameter','Allocator['+d+']:\x20Amount\x20sum\x20below\x20threshold\x20(contract\x20EAMOUNT_BELOW_THRESHOLD=12).\x20Amount\x20sum:\x20'+v+',\x20threshold:\x20'+w+'.\x20Amount\x20items:\x20'+h['map'](x=>'['+e['sharing']['indexOf'](x)+']\x20amount='+x['sharing'])['join'](',\x20')+'.\x20Fix:\x20increase\x20Amount\x20values\x20so\x20sum\x20>=\x20threshold,\x20or\x20add\x20Rate/Surplus\x20items\x20(threshold\x20only\x20applies\x20when\x20no\x20Rate\x20and\x20no\x20Surplus).');}const l=e['sharing']['map']((x,y)=>{if('Entity'in x['who'])return{'index':y,'name_or_address':x['who']['Entity']['name_or_address']};else return null;})['filter'](x=>x!==null),[m,n]=await Promise['all']([LocalMark['Instance']()['get_address'](e['guard']),GetManyAccountOrMark_Address({'entities':l,'check_all_founded':!![]})]),o=new Array(e['sharing']['length']);l['forEach']((x,y)=>{o[x['index']]=n[y];});if(!m)a59b('invalid\x20address','guard:\x20'+e['guard']);const p=await Promise['all'](e['sharing']['map'](async(x,y)=>{if('Entity'in x['who']){const z=o[y];if(!z)a59b('invalid\x20address','entity:\x20'+(typeof x['who']['Entity']==='string'?x['who']['Entity']:x['who']['Entity']['name_or_address']));return sharing(a,x,z);}else return sharing(a,x);})),q=a['makeMoveVec']({'elements':p,'type':'0x2::allocation::Sharing'});a['moveCall']({'target':allocationFn('allocator_add'),'arguments':[c,a59g(a,m),q,a['pure']['option']('u64',e?.['max'])]});}return c;};function alloc(a,b,c,d,e){a59k([b,d,e]);if(!a59h(c))a59b('invalid\x20parameter','allocation_type:\x20'+c+'\x20invalid');a['moveCall']({'target':allocationFn('alloc'),'arguments':[b,a59g(a,d),a59g(a,e),a['object']['mutObjectLinkerTx'](),a['object']['clock']()],'typeArguments':[c]});}function newAllocation(a,b,c,d){return a59k([c,d]),a['moveCall']({'target':allocationFn('new_with_coin'),'arguments':[c,d,a['object']['mutObjectLinkerTx'](),a['object']['clock']()],'typeArguments':[b]});}function create(a,b,c,d){a59k([b,d]);if(!a59h(c))a59b('invalid\x20parameter','allocation_type:\x20'+c+'\x20invalid');return a['moveCall']({'target':allocationFn('create'),'arguments':[b,a59g(a,d)],'typeArguments':[c]});}function receive(a,b,c,d,e){a59k([b,e,d]);if(!a59h(c))a59b('invalid\x20parameter','allocation_type:\x20'+c+'\x20invalid');return a['moveCall']({'target':allocationFn('receive'),'arguments':[b,a59g(a,d),a59g(a,e)],'typeArguments':[c]});}export{CallAllocation,MAX_ALLOCATOR_COUNT,a59n as MAX_SHARING_COUNT,alloc,allocationFn,allocators,create,newAllocation,receive,sharing};
@@ -1,2 +1,2 @@
1
- import { Au as confirm, Bu as pause, Du as CallArbitration_Data, Eu as CallArbitration, Fu as feedback, Gu as vote, Hu as um_set, Iu as fees_alloc, Ju as voting_guard_clear, Ku as voting_deadline_change, Lu as fees_transfer, Mu as description_set, Nu as dispute, Ou as arb_withdraw, Pu as fee_set, Ru as location_set, Uu as usage_guard_none, Vu as reset, Wu as usage_guard_set, Yu as voting_guard_remove, ju as create, ku as arbitration, qu as voting_guard_add, yg as MAX_VOTING_GUARD_COUNT, zu as newArbitration } from "../../index-ByXPNYyQ.mjs";
1
+ import { $u as fees_alloc, Gu as arb_withdraw, Ju as create, Ku as arbitration, Qg as MAX_VOTING_GUARD_COUNT, Qu as feedback, Uu as CallArbitration, Wu as CallArbitration_Data, Xu as dispute, Yu as description_set, Zu as fee_set, ad as um_set, cd as vote, dd as voting_guard_clear, ed as fees_transfer, fd as voting_guard_remove, id as reset, ld as voting_deadline_change, nd as newArbitration, od as usage_guard_none, qu as confirm, rd as pause, sd as usage_guard_set, td as location_set, ud as voting_guard_add } from "../../index-OlNG95EF.mjs";
2
2
  export { CallArbitration, CallArbitration_Data, MAX_VOTING_GUARD_COUNT, arb_withdraw, arbitration, confirm, create, description_set, dispute, fee_set, feedback, fees_alloc, fees_transfer, location_set, newArbitration, pause, reset, um_set, usage_guard_none, usage_guard_set, vote, voting_deadline_change, voting_guard_add, voting_guard_clear, voting_guard_remove };