@wowok/wowok 2.5.4 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/esm/{arb-CmXTftBS.mjs → arb-CnbQw0LB.mjs} +1 -1
  2. package/dist/esm/{base-BwMlgHp_.mjs → base-BT5c3H9N.mjs} +1 -1
  3. package/dist/esm/{call-CZ19Y-Dx.mjs → call-Btobs8kp.mjs} +1 -1
  4. package/dist/esm/client/index.d.mts +1 -1
  5. package/dist/esm/client/index.mjs +1 -1
  6. package/dist/esm/{client-BP4Izdze.mjs → client-Jb2DzzQN.mjs} +1 -1
  7. package/dist/esm/cryptography/index.d.mts +1 -1
  8. package/dist/esm/graphql/index.d.mts +1 -1
  9. package/dist/esm/graphql/index.mjs +1 -1
  10. package/dist/esm/{graphql-CwmnSE3B.mjs → graphql-CS8zWneq.mjs} +1 -1
  11. package/dist/esm/grpc/index.d.mts +1 -1
  12. package/dist/esm/grpc/index.mjs +1 -1
  13. package/dist/esm/{grpc-DANFm8FC.mjs → grpc-CEHMfCxs.mjs} +1 -1
  14. package/dist/esm/{index-WMzw6b7d.d.mts → index-CXN4AMVV.d.mts} +81 -68
  15. package/dist/esm/index.d.mts +4 -3
  16. package/dist/esm/index.mjs +1 -1
  17. package/dist/esm/jsonRpc/index.d.mts +1 -1
  18. package/dist/esm/jsonRpc/index.mjs +1 -1
  19. package/dist/esm/keypairs/ed25519/index.d.mts +1 -1
  20. package/dist/esm/keypairs/falcon512/index.d.mts +1 -1
  21. package/dist/esm/keypairs/passkey/index.d.mts +1 -1
  22. package/dist/esm/keypairs/secp256k1/index.d.mts +1 -1
  23. package/dist/esm/keypairs/secp256r1/index.d.mts +1 -1
  24. package/dist/esm/{messenger-xJup9AM0.mjs → messenger-BBo7c4o_.mjs} +1 -1
  25. package/dist/esm/messenger-api-xT1DE3pm.mjs +1 -0
  26. package/dist/esm/multisig/index.d.mts +1 -1
  27. package/dist/esm/{object-B8AoRIC5.mjs → object-DJOqAJAQ.mjs} +1 -1
  28. package/dist/esm/{passport-BcyLD6k9.mjs → passport-CeZG1Lh0.mjs} +1 -1
  29. package/dist/esm/{project-CoLo_rMf.d.mts → project-B8BG7hWF.d.mts} +23 -1
  30. package/dist/esm/{proof-DMOmJcWJ.mjs → proof-BrkOg0AA.mjs} +1 -1
  31. package/dist/esm/{query-BEvcDcH2.mjs → query-BgVxf09y.mjs} +1 -1
  32. package/dist/esm/{received-Bl2bGGec.mjs → received-GC349zpH.mjs} +1 -1
  33. package/dist/esm/{service-D0fjDWOh.mjs → service-BP423P7F.mjs} +1 -1
  34. package/dist/esm/transactions/index.d.mts +1 -1
  35. package/dist/esm/util-7R_TK4HK.d.mts +18 -0
  36. package/dist/esm/{util-CkirQkaj.mjs → util-BHAkupts.mjs} +1 -1
  37. package/dist/esm/verify/index.d.mts +1 -1
  38. package/dist/esm/w/call/allocation.d.mts +1 -1
  39. package/dist/esm/w/call/allocation.mjs +1 -1
  40. package/dist/esm/w/call/arbitration.d.mts +1 -1
  41. package/dist/esm/w/call/arbitration.mjs +1 -1
  42. package/dist/esm/w/call/base.d.mts +1 -1
  43. package/dist/esm/w/call/base.mjs +1 -1
  44. package/dist/esm/w/call/demand.d.mts +1 -1
  45. package/dist/esm/w/call/demand.mjs +1 -1
  46. package/dist/esm/w/call/guard.d.mts +1 -1
  47. package/dist/esm/w/call/guard.mjs +1 -1
  48. package/dist/esm/w/call/index.d.mts +1 -1
  49. package/dist/esm/w/call/index.mjs +1 -1
  50. package/dist/esm/w/call/machine.d.mts +1 -1
  51. package/dist/esm/w/call/machine.mjs +1 -1
  52. package/dist/esm/w/call/passport.d.mts +1 -1
  53. package/dist/esm/w/call/passport.mjs +1 -1
  54. package/dist/esm/w/call/payment.d.mts +1 -1
  55. package/dist/esm/w/call/payment.mjs +1 -1
  56. package/dist/esm/w/call/permission.d.mts +1 -1
  57. package/dist/esm/w/call/permission.mjs +1 -1
  58. package/dist/esm/w/call/progress.d.mts +1 -1
  59. package/dist/esm/w/call/progress.mjs +1 -1
  60. package/dist/esm/w/call/repository.d.mts +1 -1
  61. package/dist/esm/w/call/repository.mjs +1 -1
  62. package/dist/esm/w/call/reward.d.mts +1 -1
  63. package/dist/esm/w/call/reward.mjs +1 -1
  64. package/dist/esm/w/call/service.d.mts +1 -1
  65. package/dist/esm/w/call/service.mjs +1 -1
  66. package/dist/esm/w/call/treasury.d.mts +1 -1
  67. package/dist/esm/w/call/treasury.mjs +1 -1
  68. package/dist/esm/w/common.d.mts +1 -1
  69. package/dist/esm/w/index.d.mts +4 -3
  70. package/dist/esm/w/index.mjs +1 -1
  71. package/dist/esm/w/local/account.d.mts +1 -1
  72. package/dist/esm/w/local/account.mjs +1 -1
  73. package/dist/esm/w/local/index.d.mts +4 -3
  74. package/dist/esm/w/local/index.mjs +1 -1
  75. package/dist/esm/w/local/project.d.mts +2 -2
  76. package/dist/esm/w/local/project.mjs +1 -1
  77. package/dist/esm/w/local/token.d.mts +1 -1
  78. package/dist/esm/w/local/token.mjs +1 -1
  79. package/dist/esm/w/local/util.d.mts +2 -9
  80. package/dist/esm/w/local/util.mjs +1 -1
  81. package/dist/esm/w/messenger/index.d.mts +1 -1
  82. package/dist/esm/w/messenger/index.mjs +1 -1
  83. package/dist/esm/w/messenger/messenger-api.d.mts +1 -1
  84. package/dist/esm/w/messenger/messenger-api.mjs +1 -1
  85. package/dist/esm/w/messenger/messenger.d.mts +1 -1
  86. package/dist/esm/w/messenger/messenger.mjs +1 -1
  87. package/dist/esm/w/messenger/storage.d.mts +1 -1
  88. package/dist/esm/w/messenger/types.d.mts +1 -1
  89. package/dist/esm/w/query/index.d.mts +1 -1
  90. package/dist/esm/w/query/index.mjs +1 -1
  91. package/dist/esm/w/query/object.d.mts +1 -1
  92. package/dist/esm/w/query/object.mjs +1 -1
  93. package/dist/esm/{w-BPS1Hudh.mjs → w-Br6b3uC4.mjs} +1 -1
  94. package/package.json +1 -1
  95. package/dist/esm/messenger-api-CaWygfEF.mjs +0 -1
@@ -1 +1 @@
1
- import{a as a39a}from'./wow-types-DcqbnAaK.mjs';import{t as a39b}from'./client-BP4Izdze.mjs';import{t as a39c}from'./Transaction-CzqJDezj.mjs';import{n as a39d}from'./network-CeDd07Hg.mjs';import{dt as a39e,it as a39f}from'./common-asa9BxDq.mjs';import{o as a39g}from'./exception-0GqTGX2P.mjs';import{Config}from'./w/local/config.mjs';import{LocalMark}from'./w/local/local.mjs';import{Account}from'./w/local/account.mjs';import{G as a39h,L as a39i,ct as a39j}from'./object-B8AoRIC5.mjs';const ONCHAIN_CONSTANTS={'MAX_NODE_COUNT_ONCHAIN':0xc8,'MAX_NODE_COUNT_SDK':0x64,'MAX_FORWARD_COUNT':0x14,'MAX_FORWARD_ORDER_COUNT':0x14,'MAX_NODE_PAIR_COUNT':0x28,'MAX_CONSENSUS_REPOSITORIES_COUNT':0xc8,'USER_DEFINED_PERM_INDEX_START':0x3e8,'MAX_PERM_FOR_ENTITY':0x3e8,'MAX_ENTITY_COUNT':0x3e8,'MAX_ADMIN_COUNT':0x1f4,'MAX_AGENT_COUNT':0xa,'MAX_DISPUTE_COUNT':0xa,'MAX_ALLOCATOR_COUNT':0x64,'MAX_SHARING_COUNT':0x64,'MAX_VOTING_GUARD_COUNT':0x32,'MAX_POLICY_COUNT':0x32,'MAX_POLICY_DESCRIPTION_LEN':0x1f4,'MAX_POLICY_GUARD_COUNT':0xa,'MAX_DATA_SIZE':0xa000,'MAX_ID_COUNT_ONCE':0x64,'MAX_REWARD_COUNT':0x14,'MAX_CONTEXT_REPOSITORY_COUNT':0x1e,'MAX_NAMED_OPERATOR_COUNT':0x3c,'MAX_NAMED_OPERATOR_ADDRESS_COUNT':0x50,'MAX_SALE_COUNT':0x32,'MAX_REPOSITORY_COUNT':0x64,'MAX_ARBITRATION_COUNT':0x14,'MAX_DISCOUNT_COUNT_ONCE':0x3e8,'MAX_DISCOUNT_RECEIVER_ONCE':0x3e8,'MAX_DISCOUNT_TOTAL_COUNT':0x4e20,'DEFAULT_LOCK_DURATION':0x9a7ec800,'MAX_REQUIRED_INFO_SIZE':0x14,'MAX_WIP_LENGTH':0x400,'MAX_WIP_HASH_LENGTH':0x40,'DISCOUNT_TYPE_RATES':0x0,'DISCOUNT_TYPE_MINUS':0x1,'MAX_EXTERNAL_DEPOSIT_GUARD_COUNT':0x64,'MAX_EXTERNAL_WITHDRAW_GUARD_COUNT':0xc8,'MAX_IM_COUNT':0xc8,'MAX_TAGS_COUNT':0x64,'MAX_RECIPIENT_COUNT':0xc8,'MAX_PROPOSITION_COUNT':0x14,'MAX_VOTOR_COUNT':0x208,'WITHDRAW_DURATION_TIME':0x9a7ec800,'MAX_ADDRESS_COUNT':0x1450,'MAX_RECORD_LENGTH':0xfa0,'BRIDGE_MESSAGE_VERSION':0x1,'BRIDGE_EVM_ADDRESS_LENGTH':0x14,'BRIDGE_CURRENT_VERSION':0x1,'BRIDGE_TRANSFER_STATUS_PENDING':0x0,'BRIDGE_TRANSFER_STATUS_APPROVED':0x1,'BRIDGE_TRANSFER_STATUS_CLAIMED':0x2,'BRIDGE_TRANSFER_STATUS_NOT_FOUND':0x3,'MAX_GUARD_COUNT_DEMAND':0x14,'MAX_GUARD_COUNT_PASSPORT':0x14,'MAX_GUARD_COUNT_REWARD':0xc8,'MAX_SUBMISSION_SIZE_PASSPORT':0x100,'MAX_RECORD_COUNT_REWARD':0x1450,'MAX_RECORD_COUNT_REGISTRAR':0x3e8,'WOWOK_WTS_PROOF_TYPE':0x1,'MAX_PROOF_SIZE':0x2800,'MAX_SERVER_PUBKEY_SIZE':0x800,'MAX_SERVER_SIGNATURE_SIZE':0x9e20},MAX_NODE_COUNT=ONCHAIN_CONSTANTS['MAX_NODE_COUNT_SDK'],MAX_NODE_COUNT_ONCHAIN=ONCHAIN_CONSTANTS['MAX_NODE_COUNT_ONCHAIN'],MAX_FORWARD_COUNT=ONCHAIN_CONSTANTS['MAX_FORWARD_COUNT'],MAX_FORWARD_ORDER_COUNT=ONCHAIN_CONSTANTS['MAX_FORWARD_ORDER_COUNT'],MAX_NODE_PAIR_COUNT=ONCHAIN_CONSTANTS['MAX_NODE_PAIR_COUNT'],MAX_CONSENSUS_REPOSITORIES_COUNT=ONCHAIN_CONSTANTS['MAX_CONSENSUS_REPOSITORIES_COUNT'],USER_DEFINED_PERM_INDEX_START=ONCHAIN_CONSTANTS['USER_DEFINED_PERM_INDEX_START'],MAX_PERM_FOR_ENTITY=ONCHAIN_CONSTANTS['MAX_PERM_FOR_ENTITY'],MAX_ENTITY_COUNT=ONCHAIN_CONSTANTS['MAX_ENTITY_COUNT'],MAX_ADMIN_COUNT=ONCHAIN_CONSTANTS['MAX_ADMIN_COUNT'],MAX_AGENT_COUNT=ONCHAIN_CONSTANTS['MAX_AGENT_COUNT'],MAX_DISPUTE_COUNT=ONCHAIN_CONSTANTS['MAX_DISPUTE_COUNT'],MAX_ALLOCATOR_COUNT=ONCHAIN_CONSTANTS['MAX_ALLOCATOR_COUNT'],MAX_SHARING_COUNT=ONCHAIN_CONSTANTS['MAX_SHARING_COUNT'],MAX_VOTING_GUARD_COUNT=ONCHAIN_CONSTANTS['MAX_VOTING_GUARD_COUNT'],MAX_POLICY_COUNT=ONCHAIN_CONSTANTS['MAX_POLICY_COUNT'],MAX_POLICY_DESCRIPTION_LEN=ONCHAIN_CONSTANTS['MAX_POLICY_DESCRIPTION_LEN'],MAX_POLICY_GUARD_COUNT=ONCHAIN_CONSTANTS['MAX_POLICY_GUARD_COUNT'],MAX_DATA_SIZE=ONCHAIN_CONSTANTS['MAX_DATA_SIZE'],MAX_ID_COUNT_ONCE=ONCHAIN_CONSTANTS['MAX_ID_COUNT_ONCE'],MAX_REWARD_COUNT=ONCHAIN_CONSTANTS['MAX_REWARD_COUNT'],MAX_CONTEXT_REPOSITORY_COUNT=ONCHAIN_CONSTANTS['MAX_CONTEXT_REPOSITORY_COUNT'],MAX_NAMED_OPERATOR_COUNT=ONCHAIN_CONSTANTS['MAX_NAMED_OPERATOR_COUNT'],MAX_NAMED_OPERATOR_ADDRESS_COUNT=ONCHAIN_CONSTANTS['MAX_NAMED_OPERATOR_ADDRESS_COUNT'],MAX_SALE_COUNT=ONCHAIN_CONSTANTS['MAX_SALE_COUNT'],MAX_REPOSITORY_COUNT=ONCHAIN_CONSTANTS['MAX_REPOSITORY_COUNT'],MAX_ARBITRATION_COUNT=ONCHAIN_CONSTANTS['MAX_ARBITRATION_COUNT'],MAX_DISCOUNT_COUNT_ONCE=ONCHAIN_CONSTANTS['MAX_DISCOUNT_COUNT_ONCE'],MAX_DISCOUNT_RECEIVER_ONCE=ONCHAIN_CONSTANTS['MAX_DISCOUNT_RECEIVER_ONCE'],MAX_DISCOUNT_TOTAL_COUNT=ONCHAIN_CONSTANTS['MAX_DISCOUNT_TOTAL_COUNT'],DEFAULT_LOCK_DURATION=ONCHAIN_CONSTANTS['DEFAULT_LOCK_DURATION'],MAX_REQUIRED_INFO_SIZE=ONCHAIN_CONSTANTS['MAX_REQUIRED_INFO_SIZE'],MAX_WIP_LENGTH=ONCHAIN_CONSTANTS['MAX_WIP_LENGTH'],MAX_WIP_HASH_LENGTH=ONCHAIN_CONSTANTS['MAX_WIP_HASH_LENGTH'],DISCOUNT_TYPE_RATES=ONCHAIN_CONSTANTS['DISCOUNT_TYPE_RATES'],DISCOUNT_TYPE_MINUS=ONCHAIN_CONSTANTS['DISCOUNT_TYPE_MINUS'],MAX_EXTERNAL_DEPOSIT_GUARD_COUNT=ONCHAIN_CONSTANTS['MAX_EXTERNAL_DEPOSIT_GUARD_COUNT'],MAX_EXTERNAL_WITHDRAW_GUARD_COUNT=ONCHAIN_CONSTANTS['MAX_EXTERNAL_WITHDRAW_GUARD_COUNT'],MAX_IM_COUNT=ONCHAIN_CONSTANTS['MAX_IM_COUNT'],MAX_TAGS_COUNT=ONCHAIN_CONSTANTS['MAX_TAGS_COUNT'],MAX_RECIPIENT_COUNT=ONCHAIN_CONSTANTS['MAX_RECIPIENT_COUNT'],MAX_PROPOSITION_COUNT=ONCHAIN_CONSTANTS['MAX_PROPOSITION_COUNT'],MAX_VOTOR_COUNT=ONCHAIN_CONSTANTS['MAX_VOTOR_COUNT'],WITHDRAW_DURATION_TIME=ONCHAIN_CONSTANTS['WITHDRAW_DURATION_TIME'],MAX_ADDRESS_COUNT=ONCHAIN_CONSTANTS['MAX_ADDRESS_COUNT'],MAX_RECORD_LENGTH=ONCHAIN_CONSTANTS['MAX_RECORD_LENGTH'],BRIDGE_MESSAGE_VERSION=ONCHAIN_CONSTANTS['BRIDGE_MESSAGE_VERSION'],BRIDGE_EVM_ADDRESS_LENGTH=ONCHAIN_CONSTANTS['BRIDGE_EVM_ADDRESS_LENGTH'],BRIDGE_CURRENT_VERSION=ONCHAIN_CONSTANTS['BRIDGE_CURRENT_VERSION'],BRIDGE_TRANSFER_STATUS_PENDING=ONCHAIN_CONSTANTS['BRIDGE_TRANSFER_STATUS_PENDING'],BRIDGE_TRANSFER_STATUS_APPROVED=ONCHAIN_CONSTANTS['BRIDGE_TRANSFER_STATUS_APPROVED'],BRIDGE_TRANSFER_STATUS_CLAIMED=ONCHAIN_CONSTANTS['BRIDGE_TRANSFER_STATUS_CLAIMED'],BRIDGE_TRANSFER_STATUS_NOT_FOUND=ONCHAIN_CONSTANTS['BRIDGE_TRANSFER_STATUS_NOT_FOUND'],MAX_GUARD_COUNT_DEMAND=ONCHAIN_CONSTANTS['MAX_GUARD_COUNT_DEMAND'],MAX_GUARD_COUNT_PASSPORT=ONCHAIN_CONSTANTS['MAX_GUARD_COUNT_PASSPORT'],MAX_GUARD_COUNT_REWARD=ONCHAIN_CONSTANTS['MAX_GUARD_COUNT_REWARD'],MAX_SUBMISSION_SIZE_PASSPORT=ONCHAIN_CONSTANTS['MAX_SUBMISSION_SIZE_PASSPORT'],MAX_RECORD_COUNT_REWARD=ONCHAIN_CONSTANTS['MAX_RECORD_COUNT_REWARD'],MAX_RECORD_COUNT_REGISTRAR=ONCHAIN_CONSTANTS['MAX_RECORD_COUNT_REGISTRAR'],WOWOK_WTS_PROOF_TYPE=ONCHAIN_CONSTANTS['WOWOK_WTS_PROOF_TYPE'],MAX_PROOF_SIZE=ONCHAIN_CONSTANTS['MAX_PROOF_SIZE'],MAX_SERVER_PUBKEY_SIZE=ONCHAIN_CONSTANTS['MAX_SERVER_PUBKEY_SIZE'],MAX_SERVER_SIGNATURE_SIZE=ONCHAIN_CONSTANTS['MAX_SERVER_SIGNATURE_SIZE'],resolve_submission_names=async a=>{for(const b of a['guard']){const c=await LocalMark['Instance']()['get_address'](b['object']);if(!c||!a39a(c))a39g('invalid\x20address','guard\x20object:\x20'+b['object']);b['object']=c;}for(const d of a['submission'])if(d['guard']){const e=await LocalMark['Instance']()['get_address'](d['guard']);if(e)d['guard']=e;}},verify_guard=async(a,b)=>{if(b['guard']['length']>MAX_GUARD_COUNT_PASSPORT)a39g('invalid\x20parameter','guards\x20invalid:\x20guard\x20count\x20exceeds\x20maximum\x20limit\x20'+MAX_GUARD_COUNT_PASSPORT);await resolve_submission_names(b);const c=new a39c(),d=newPassport(c);for(const f of b['guard'])await guardAdd(c,d,f['object'],b['submission']['find'](g=>g['guard']===f['object'])?.['submission']??[],f['impack']);verify(c,d),freeze(c,d);let e=await Account['Instance']()['sign_and_commit'](c,await a39h(a),a['network']);if(!e)a39g('fail','sign\x20and\x20commit\x20failed');if(e?.['digest']&&!e?.['objectChanges']){const g=await Config['Instance']()['network_get'](a['network']);e=await new a39b({'url':a39d(g),'network':g})['getTransactionBlock']({'digest':e?.['digest'],'options':{'showObjectChanges':!![]}});}return e;},get_guardSubmissions=async(a,b)=>{if(b['length']===0x0)a39g('invalid\x20parameter','guards\x20invalid:\x20guards\x20empty');b=[...new Set(b)];if(b['length']>MAX_GUARD_COUNT_PASSPORT)a39g('invalid\x20parameter','guards\x20invalid:\x20guard\x20count\x20exceeds\x20maximum\x20limit\x20\x20'+MAX_GUARD_COUNT_PASSPORT+'\x20once');const c=await a39i({'objects':[...b],'no_cache':a['no_cache'],'network':a['network']});if(!c['objects']||c['objects']['length']===0x0)a39g('invalid\x20parameter','Guard\x20objects\x20not\x20found:\x20'+b['join'](',\x20'));const d=[],e=new Map();c['objects']['forEach'](m=>{if(m['type']!=='Guard')a39g('invalid\x20parameter','guards\x20invalid:\x20guard\x20\x27'+m['object']+'\x27\x20is\x20not\x20a\x20guard\x20object');const n=m;n['relies']?.['forEach'](o=>{if(!d['includes'](o))d['push'](o);}),(n['rep_quote']instanceof Map?n['rep_quote']:new Map(Object['entries'](n['rep_quote']||{})))['forEach']((o,p)=>{if(e['has'](p)){const q=e['get'](p)||[];o['forEach'](s=>{if(!q['includes'](s))q['push'](s);}),e['set'](p,q);}else e['set'](p,o);});});const f=await a39i({'objects':[...e['keys']()],'no_cache':a['no_cache'],'network':a['network']}),g=[];f['objects']['forEach'](m=>{if(m['type']!=='Repository')a39g('invalid\x20parameter','rep\x20invalid:\x20rep\x20\x27'+m['object']+'\x27\x20is\x20not\x20a\x20guard\x20object');const n=m;n['policies']['forEach'](o=>{if((e['get'](n['object'])||[])['includes'](o['name'])&&o['quote_guard']&&!g['includes'](o['quote_guard']))g['push'](o['quote_guard']);});});const h=[...new Set([...g,...c['objects']['map'](m=>m['object'])])],i=new Set(h),j=[...d['filter'](m=>!i['has'](m))['map'](m=>({'object':m,'impack':![]})),...h['map'](m=>({'object':m,'impack':!![]}))];if(j['length']>MAX_GUARD_COUNT_PASSPORT)a39g('invalid\x20parameter','guards\x20invalid:\x20guard\x20count(include\x20relies\x20guards)\x20exceeds\x20maximum\x20limit\x20'+MAX_GUARD_COUNT_PASSPORT);const k=await a39i({'objects':[...d,...g],'no_cache':a['no_cache'],'network':a['network']}),l=[];return k['objects']['forEach'](m=>{const n=m,o=[];n['table']?.['forEach'](p=>{if(p['b_submission'])o['push'](p);});if(o['length']>0x0&&l['find'](p=>p['guard']===n['object'])===void 0x0)l['push']({'guard':n['object'],'submission':o});}),c['objects']['forEach'](m=>{const n=m,o=[];n['table']?.['forEach'](p=>{if(p['b_submission'])o['push'](p);});if(o['length']>0x0&&l['find'](p=>p['guard']===n['object'])===void 0x0)l['push']({'guard':n['object'],'submission':o});}),{'type':'submission','guard':j,'submission':l};};function passportFn(a){return'0x2::passport::'+a;}function newPassport(a){return a['moveCall']({'target':passportFn('new'),'arguments':[a['object']['clock']()]});}function freeze(a,b){a['moveCall']({'target':passportFn('freezen'),'arguments':[a39e(a,b)]});}function destroy(a,b){a['moveCall']({'target':passportFn('destroy'),'arguments':[a39e(a,b)]});}const guardAdd=async(a,b,c,d,e)=>{if(d['length']>0x100)a39g('guard\x20table\x20item\x20length\x20exceeded','Submission\x20size\x20exceeds\x20maximum\x20limit\x20256');const f=a['pure']['vector']('u8',d['map'](j=>j['identifier'])),g=[];for(let j=0x0;j<d['length'];j++){if(!d[j]['value'])a39g('invalid\x20value','Value\x20is\x20undefined\x20for\x20identifier\x20'+d[j]['identifier']);const k=await a39j(a39f(d[j]['value_type']),d[j]['value']);g['push'](Array['from'](k));}const h=a['pure']['vector']('vector<u8>',g);a['moveCall']({'target':passportFn('guard_add'),'arguments':[a39e(a,b),a39e(a,c),f,h,a['pure']['bool'](e)]});};function guardClear(a,b){a['moveCall']({'target':passportFn('guard_clear'),'arguments':[a39e(a,b)]});}function verify(a,b){return a['moveCall']({'target':passportFn('verify'),'arguments':[a39e(a,b)]});}export{MAX_PROPOSITION_COUNT as $,MAX_DISCOUNT_RECEIVER_ONCE as A,MAX_GUARD_COUNT_REWARD as B,MAX_AGENT_COUNT as C,MAX_CONTEXT_REPOSITORY_COUNT as D,MAX_CONSENSUS_REPOSITORIES_COUNT as E,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT as F,MAX_NODE_COUNT as G,MAX_IM_COUNT as H,MAX_FORWARD_COUNT as I,MAX_PERM_FOR_ENTITY as J,MAX_NODE_COUNT_ONCHAIN as K,MAX_FORWARD_ORDER_COUNT as L,MAX_DISPUTE_COUNT as M,MAX_ENTITY_COUNT as N,MAX_DATA_SIZE as O,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT as P,MAX_PROOF_SIZE as Q,MAX_GUARD_COUNT_DEMAND as R,MAX_ADMIN_COUNT as S,MAX_ARBITRATION_COUNT as T,MAX_NAMED_OPERATOR_ADDRESS_COUNT as U,MAX_ID_COUNT_ONCE as V,MAX_NAMED_OPERATOR_COUNT as W,MAX_POLICY_DESCRIPTION_LEN as X,MAX_POLICY_COUNT as Y,MAX_POLICY_GUARD_COUNT as Z,BRIDGE_TRANSFER_STATUS_PENDING as _,ONCHAIN_CONSTANTS as _t,guardClear as a,MAX_REQUIRED_INFO_SIZE as at,DISCOUNT_TYPE_RATES as b,WOWOK_WTS_PROOF_TYPE as bt,resolve_submission_names as c,MAX_SERVER_PUBKEY_SIZE as ct,BRIDGE_CURRENT_VERSION as d,MAX_SUBMISSION_SIZE_PASSPORT as dt,MAX_RECIPIENT_COUNT as et,BRIDGE_EVM_ADDRESS_LENGTH as f,MAX_TAGS_COUNT as ft,BRIDGE_TRANSFER_STATUS_NOT_FOUND as g,MAX_WIP_LENGTH as gt,BRIDGE_TRANSFER_STATUS_CLAIMED as h,MAX_WIP_HASH_LENGTH as ht,guardAdd as i,MAX_REPOSITORY_COUNT as it,MAX_DISCOUNT_TOTAL_COUNT as j,MAX_DISCOUNT_COUNT_ONCE as k,verify as l,MAX_SERVER_SIGNATURE_SIZE as lt,BRIDGE_TRANSFER_STATUS_APPROVED as m,MAX_VOTOR_COUNT as mt,freeze as n,MAX_RECORD_COUNT_REWARD as nt,newPassport as o,MAX_REWARD_COUNT as ot,BRIDGE_MESSAGE_VERSION as p,MAX_VOTING_GUARD_COUNT as pt,MAX_NODE_PAIR_COUNT as q,get_guardSubmissions as r,MAX_RECORD_LENGTH as rt,passportFn as s,MAX_SALE_COUNT as st,destroy as t,MAX_RECORD_COUNT_REGISTRAR as tt,verify_guard as u,MAX_SHARING_COUNT as ut,DEFAULT_LOCK_DURATION as v,USER_DEFINED_PERM_INDEX_START as vt,MAX_ALLOCATOR_COUNT as w,MAX_ADDRESS_COUNT as x,DISCOUNT_TYPE_MINUS as y,WITHDRAW_DURATION_TIME as yt,MAX_GUARD_COUNT_PASSPORT as z};
1
+ import{a as a39a}from'./wow-types-DcqbnAaK.mjs';import{t as a39b}from'./client-Jb2DzzQN.mjs';import{t as a39c}from'./Transaction-CzqJDezj.mjs';import{n as a39d}from'./network-CeDd07Hg.mjs';import{dt as a39e,it as a39f}from'./common-asa9BxDq.mjs';import{o as a39g}from'./exception-0GqTGX2P.mjs';import{Config}from'./w/local/config.mjs';import{LocalMark}from'./w/local/local.mjs';import{Account}from'./w/local/account.mjs';import{G as a39h,L as a39i,ct as a39j}from'./object-DJOqAJAQ.mjs';const ONCHAIN_CONSTANTS={'MAX_NODE_COUNT_ONCHAIN':0xc8,'MAX_NODE_COUNT_SDK':0x64,'MAX_FORWARD_COUNT':0x14,'MAX_FORWARD_ORDER_COUNT':0x14,'MAX_NODE_PAIR_COUNT':0x28,'MAX_CONSENSUS_REPOSITORIES_COUNT':0xc8,'USER_DEFINED_PERM_INDEX_START':0x3e8,'MAX_PERM_FOR_ENTITY':0x3e8,'MAX_ENTITY_COUNT':0x3e8,'MAX_ADMIN_COUNT':0x1f4,'MAX_AGENT_COUNT':0xa,'MAX_DISPUTE_COUNT':0xa,'MAX_ALLOCATOR_COUNT':0x64,'MAX_SHARING_COUNT':0x64,'MAX_VOTING_GUARD_COUNT':0x32,'MAX_POLICY_COUNT':0x32,'MAX_POLICY_DESCRIPTION_LEN':0x1f4,'MAX_POLICY_GUARD_COUNT':0xa,'MAX_DATA_SIZE':0xa000,'MAX_ID_COUNT_ONCE':0x64,'MAX_REWARD_COUNT':0x14,'MAX_CONTEXT_REPOSITORY_COUNT':0x1e,'MAX_NAMED_OPERATOR_COUNT':0x3c,'MAX_NAMED_OPERATOR_ADDRESS_COUNT':0x50,'MAX_SALE_COUNT':0x32,'MAX_REPOSITORY_COUNT':0x64,'MAX_ARBITRATION_COUNT':0x14,'MAX_DISCOUNT_COUNT_ONCE':0x3e8,'MAX_DISCOUNT_RECEIVER_ONCE':0x3e8,'MAX_DISCOUNT_TOTAL_COUNT':0x4e20,'DEFAULT_LOCK_DURATION':0x9a7ec800,'MAX_REQUIRED_INFO_SIZE':0x14,'MAX_WIP_LENGTH':0x400,'MAX_WIP_HASH_LENGTH':0x40,'DISCOUNT_TYPE_RATES':0x0,'DISCOUNT_TYPE_MINUS':0x1,'MAX_EXTERNAL_DEPOSIT_GUARD_COUNT':0x64,'MAX_EXTERNAL_WITHDRAW_GUARD_COUNT':0xc8,'MAX_IM_COUNT':0xc8,'MAX_TAGS_COUNT':0x64,'MAX_RECIPIENT_COUNT':0xc8,'MAX_PROPOSITION_COUNT':0x14,'MAX_VOTOR_COUNT':0x208,'WITHDRAW_DURATION_TIME':0x9a7ec800,'MAX_ADDRESS_COUNT':0x1450,'MAX_RECORD_LENGTH':0xfa0,'BRIDGE_MESSAGE_VERSION':0x1,'BRIDGE_EVM_ADDRESS_LENGTH':0x14,'BRIDGE_CURRENT_VERSION':0x1,'BRIDGE_TRANSFER_STATUS_PENDING':0x0,'BRIDGE_TRANSFER_STATUS_APPROVED':0x1,'BRIDGE_TRANSFER_STATUS_CLAIMED':0x2,'BRIDGE_TRANSFER_STATUS_NOT_FOUND':0x3,'MAX_GUARD_COUNT_DEMAND':0x14,'MAX_GUARD_COUNT_PASSPORT':0x14,'MAX_GUARD_COUNT_REWARD':0xc8,'MAX_SUBMISSION_SIZE_PASSPORT':0x100,'MAX_RECORD_COUNT_REWARD':0x1450,'MAX_RECORD_COUNT_REGISTRAR':0x3e8,'WOWOK_WTS_PROOF_TYPE':0x1,'MAX_PROOF_SIZE':0x2800,'MAX_SERVER_PUBKEY_SIZE':0x800,'MAX_SERVER_SIGNATURE_SIZE':0x9e20},MAX_NODE_COUNT=ONCHAIN_CONSTANTS['MAX_NODE_COUNT_SDK'],MAX_NODE_COUNT_ONCHAIN=ONCHAIN_CONSTANTS['MAX_NODE_COUNT_ONCHAIN'],MAX_FORWARD_COUNT=ONCHAIN_CONSTANTS['MAX_FORWARD_COUNT'],MAX_FORWARD_ORDER_COUNT=ONCHAIN_CONSTANTS['MAX_FORWARD_ORDER_COUNT'],MAX_NODE_PAIR_COUNT=ONCHAIN_CONSTANTS['MAX_NODE_PAIR_COUNT'],MAX_CONSENSUS_REPOSITORIES_COUNT=ONCHAIN_CONSTANTS['MAX_CONSENSUS_REPOSITORIES_COUNT'],USER_DEFINED_PERM_INDEX_START=ONCHAIN_CONSTANTS['USER_DEFINED_PERM_INDEX_START'],MAX_PERM_FOR_ENTITY=ONCHAIN_CONSTANTS['MAX_PERM_FOR_ENTITY'],MAX_ENTITY_COUNT=ONCHAIN_CONSTANTS['MAX_ENTITY_COUNT'],MAX_ADMIN_COUNT=ONCHAIN_CONSTANTS['MAX_ADMIN_COUNT'],MAX_AGENT_COUNT=ONCHAIN_CONSTANTS['MAX_AGENT_COUNT'],MAX_DISPUTE_COUNT=ONCHAIN_CONSTANTS['MAX_DISPUTE_COUNT'],MAX_ALLOCATOR_COUNT=ONCHAIN_CONSTANTS['MAX_ALLOCATOR_COUNT'],MAX_SHARING_COUNT=ONCHAIN_CONSTANTS['MAX_SHARING_COUNT'],MAX_VOTING_GUARD_COUNT=ONCHAIN_CONSTANTS['MAX_VOTING_GUARD_COUNT'],MAX_POLICY_COUNT=ONCHAIN_CONSTANTS['MAX_POLICY_COUNT'],MAX_POLICY_DESCRIPTION_LEN=ONCHAIN_CONSTANTS['MAX_POLICY_DESCRIPTION_LEN'],MAX_POLICY_GUARD_COUNT=ONCHAIN_CONSTANTS['MAX_POLICY_GUARD_COUNT'],MAX_DATA_SIZE=ONCHAIN_CONSTANTS['MAX_DATA_SIZE'],MAX_ID_COUNT_ONCE=ONCHAIN_CONSTANTS['MAX_ID_COUNT_ONCE'],MAX_REWARD_COUNT=ONCHAIN_CONSTANTS['MAX_REWARD_COUNT'],MAX_CONTEXT_REPOSITORY_COUNT=ONCHAIN_CONSTANTS['MAX_CONTEXT_REPOSITORY_COUNT'],MAX_NAMED_OPERATOR_COUNT=ONCHAIN_CONSTANTS['MAX_NAMED_OPERATOR_COUNT'],MAX_NAMED_OPERATOR_ADDRESS_COUNT=ONCHAIN_CONSTANTS['MAX_NAMED_OPERATOR_ADDRESS_COUNT'],MAX_SALE_COUNT=ONCHAIN_CONSTANTS['MAX_SALE_COUNT'],MAX_REPOSITORY_COUNT=ONCHAIN_CONSTANTS['MAX_REPOSITORY_COUNT'],MAX_ARBITRATION_COUNT=ONCHAIN_CONSTANTS['MAX_ARBITRATION_COUNT'],MAX_DISCOUNT_COUNT_ONCE=ONCHAIN_CONSTANTS['MAX_DISCOUNT_COUNT_ONCE'],MAX_DISCOUNT_RECEIVER_ONCE=ONCHAIN_CONSTANTS['MAX_DISCOUNT_RECEIVER_ONCE'],MAX_DISCOUNT_TOTAL_COUNT=ONCHAIN_CONSTANTS['MAX_DISCOUNT_TOTAL_COUNT'],DEFAULT_LOCK_DURATION=ONCHAIN_CONSTANTS['DEFAULT_LOCK_DURATION'],MAX_REQUIRED_INFO_SIZE=ONCHAIN_CONSTANTS['MAX_REQUIRED_INFO_SIZE'],MAX_WIP_LENGTH=ONCHAIN_CONSTANTS['MAX_WIP_LENGTH'],MAX_WIP_HASH_LENGTH=ONCHAIN_CONSTANTS['MAX_WIP_HASH_LENGTH'],DISCOUNT_TYPE_RATES=ONCHAIN_CONSTANTS['DISCOUNT_TYPE_RATES'],DISCOUNT_TYPE_MINUS=ONCHAIN_CONSTANTS['DISCOUNT_TYPE_MINUS'],MAX_EXTERNAL_DEPOSIT_GUARD_COUNT=ONCHAIN_CONSTANTS['MAX_EXTERNAL_DEPOSIT_GUARD_COUNT'],MAX_EXTERNAL_WITHDRAW_GUARD_COUNT=ONCHAIN_CONSTANTS['MAX_EXTERNAL_WITHDRAW_GUARD_COUNT'],MAX_IM_COUNT=ONCHAIN_CONSTANTS['MAX_IM_COUNT'],MAX_TAGS_COUNT=ONCHAIN_CONSTANTS['MAX_TAGS_COUNT'],MAX_RECIPIENT_COUNT=ONCHAIN_CONSTANTS['MAX_RECIPIENT_COUNT'],MAX_PROPOSITION_COUNT=ONCHAIN_CONSTANTS['MAX_PROPOSITION_COUNT'],MAX_VOTOR_COUNT=ONCHAIN_CONSTANTS['MAX_VOTOR_COUNT'],WITHDRAW_DURATION_TIME=ONCHAIN_CONSTANTS['WITHDRAW_DURATION_TIME'],MAX_ADDRESS_COUNT=ONCHAIN_CONSTANTS['MAX_ADDRESS_COUNT'],MAX_RECORD_LENGTH=ONCHAIN_CONSTANTS['MAX_RECORD_LENGTH'],BRIDGE_MESSAGE_VERSION=ONCHAIN_CONSTANTS['BRIDGE_MESSAGE_VERSION'],BRIDGE_EVM_ADDRESS_LENGTH=ONCHAIN_CONSTANTS['BRIDGE_EVM_ADDRESS_LENGTH'],BRIDGE_CURRENT_VERSION=ONCHAIN_CONSTANTS['BRIDGE_CURRENT_VERSION'],BRIDGE_TRANSFER_STATUS_PENDING=ONCHAIN_CONSTANTS['BRIDGE_TRANSFER_STATUS_PENDING'],BRIDGE_TRANSFER_STATUS_APPROVED=ONCHAIN_CONSTANTS['BRIDGE_TRANSFER_STATUS_APPROVED'],BRIDGE_TRANSFER_STATUS_CLAIMED=ONCHAIN_CONSTANTS['BRIDGE_TRANSFER_STATUS_CLAIMED'],BRIDGE_TRANSFER_STATUS_NOT_FOUND=ONCHAIN_CONSTANTS['BRIDGE_TRANSFER_STATUS_NOT_FOUND'],MAX_GUARD_COUNT_DEMAND=ONCHAIN_CONSTANTS['MAX_GUARD_COUNT_DEMAND'],MAX_GUARD_COUNT_PASSPORT=ONCHAIN_CONSTANTS['MAX_GUARD_COUNT_PASSPORT'],MAX_GUARD_COUNT_REWARD=ONCHAIN_CONSTANTS['MAX_GUARD_COUNT_REWARD'],MAX_SUBMISSION_SIZE_PASSPORT=ONCHAIN_CONSTANTS['MAX_SUBMISSION_SIZE_PASSPORT'],MAX_RECORD_COUNT_REWARD=ONCHAIN_CONSTANTS['MAX_RECORD_COUNT_REWARD'],MAX_RECORD_COUNT_REGISTRAR=ONCHAIN_CONSTANTS['MAX_RECORD_COUNT_REGISTRAR'],WOWOK_WTS_PROOF_TYPE=ONCHAIN_CONSTANTS['WOWOK_WTS_PROOF_TYPE'],MAX_PROOF_SIZE=ONCHAIN_CONSTANTS['MAX_PROOF_SIZE'],MAX_SERVER_PUBKEY_SIZE=ONCHAIN_CONSTANTS['MAX_SERVER_PUBKEY_SIZE'],MAX_SERVER_SIGNATURE_SIZE=ONCHAIN_CONSTANTS['MAX_SERVER_SIGNATURE_SIZE'],resolve_submission_names=async a=>{for(const b of a['guard']){const c=await LocalMark['Instance']()['get_address'](b['object']);if(!c||!a39a(c))a39g('invalid\x20address','guard\x20object:\x20'+b['object']);b['object']=c;}for(const d of a['submission'])if(d['guard']){const e=await LocalMark['Instance']()['get_address'](d['guard']);if(e)d['guard']=e;}},verify_guard=async(a,b)=>{if(b['guard']['length']>MAX_GUARD_COUNT_PASSPORT)a39g('invalid\x20parameter','guards\x20invalid:\x20guard\x20count\x20exceeds\x20maximum\x20limit\x20'+MAX_GUARD_COUNT_PASSPORT);await resolve_submission_names(b);const c=new a39c(),d=newPassport(c);for(const f of b['guard'])await guardAdd(c,d,f['object'],b['submission']['find'](g=>g['guard']===f['object'])?.['submission']??[],f['impack']);verify(c,d),freeze(c,d);let e=await Account['Instance']()['sign_and_commit'](c,await a39h(a),a['network']);if(!e)a39g('fail','sign\x20and\x20commit\x20failed');if(e?.['digest']&&!e?.['objectChanges']){const g=await Config['Instance']()['network_get'](a['network']);e=await new a39b({'url':a39d(g),'network':g})['getTransactionBlock']({'digest':e?.['digest'],'options':{'showObjectChanges':!![]}});}return e;},get_guardSubmissions=async(a,b)=>{if(b['length']===0x0)a39g('invalid\x20parameter','guards\x20invalid:\x20guards\x20empty');b=[...new Set(b)];if(b['length']>MAX_GUARD_COUNT_PASSPORT)a39g('invalid\x20parameter','guards\x20invalid:\x20guard\x20count\x20exceeds\x20maximum\x20limit\x20\x20'+MAX_GUARD_COUNT_PASSPORT+'\x20once');const c=await a39i({'objects':[...b],'no_cache':a['no_cache'],'network':a['network']});if(!c['objects']||c['objects']['length']===0x0)a39g('invalid\x20parameter','Guard\x20objects\x20not\x20found:\x20'+b['join'](',\x20'));const d=[],e=new Map();c['objects']['forEach'](m=>{if(m['type']!=='Guard')a39g('invalid\x20parameter','guards\x20invalid:\x20guard\x20\x27'+m['object']+'\x27\x20is\x20not\x20a\x20guard\x20object');const n=m;n['relies']?.['forEach'](o=>{if(!d['includes'](o))d['push'](o);}),(n['rep_quote']instanceof Map?n['rep_quote']:new Map(Object['entries'](n['rep_quote']||{})))['forEach']((o,p)=>{if(e['has'](p)){const q=e['get'](p)||[];o['forEach'](s=>{if(!q['includes'](s))q['push'](s);}),e['set'](p,q);}else e['set'](p,o);});});const f=await a39i({'objects':[...e['keys']()],'no_cache':a['no_cache'],'network':a['network']}),g=[];f['objects']['forEach'](m=>{if(m['type']!=='Repository')a39g('invalid\x20parameter','rep\x20invalid:\x20rep\x20\x27'+m['object']+'\x27\x20is\x20not\x20a\x20guard\x20object');const n=m;n['policies']['forEach'](o=>{if((e['get'](n['object'])||[])['includes'](o['name'])&&o['quote_guard']&&!g['includes'](o['quote_guard']))g['push'](o['quote_guard']);});});const h=[...new Set([...g,...c['objects']['map'](m=>m['object'])])],i=new Set(h),j=[...d['filter'](m=>!i['has'](m))['map'](m=>({'object':m,'impack':![]})),...h['map'](m=>({'object':m,'impack':!![]}))];if(j['length']>MAX_GUARD_COUNT_PASSPORT)a39g('invalid\x20parameter','guards\x20invalid:\x20guard\x20count(include\x20relies\x20guards)\x20exceeds\x20maximum\x20limit\x20'+MAX_GUARD_COUNT_PASSPORT);const k=await a39i({'objects':[...d,...g],'no_cache':a['no_cache'],'network':a['network']}),l=[];return k['objects']['forEach'](m=>{const n=m,o=[];n['table']?.['forEach'](p=>{if(p['b_submission'])o['push'](p);});if(o['length']>0x0&&l['find'](p=>p['guard']===n['object'])===void 0x0)l['push']({'guard':n['object'],'submission':o});}),c['objects']['forEach'](m=>{const n=m,o=[];n['table']?.['forEach'](p=>{if(p['b_submission'])o['push'](p);});if(o['length']>0x0&&l['find'](p=>p['guard']===n['object'])===void 0x0)l['push']({'guard':n['object'],'submission':o});}),{'type':'submission','guard':j,'submission':l};};function passportFn(a){return'0x2::passport::'+a;}function newPassport(a){return a['moveCall']({'target':passportFn('new'),'arguments':[a['object']['clock']()]});}function freeze(a,b){a['moveCall']({'target':passportFn('freezen'),'arguments':[a39e(a,b)]});}function destroy(a,b){a['moveCall']({'target':passportFn('destroy'),'arguments':[a39e(a,b)]});}const guardAdd=async(a,b,c,d,e)=>{if(d['length']>0x100)a39g('guard\x20table\x20item\x20length\x20exceeded','Submission\x20size\x20exceeds\x20maximum\x20limit\x20256');const f=a['pure']['vector']('u8',d['map'](j=>j['identifier'])),g=[];for(let j=0x0;j<d['length'];j++){if(!d[j]['value'])a39g('invalid\x20value','Value\x20is\x20undefined\x20for\x20identifier\x20'+d[j]['identifier']);const k=await a39j(a39f(d[j]['value_type']),d[j]['value']);g['push'](Array['from'](k));}const h=a['pure']['vector']('vector<u8>',g);a['moveCall']({'target':passportFn('guard_add'),'arguments':[a39e(a,b),a39e(a,c),f,h,a['pure']['bool'](e)]});};function guardClear(a,b){a['moveCall']({'target':passportFn('guard_clear'),'arguments':[a39e(a,b)]});}function verify(a,b){return a['moveCall']({'target':passportFn('verify'),'arguments':[a39e(a,b)]});}export{MAX_PROPOSITION_COUNT as $,MAX_DISCOUNT_RECEIVER_ONCE as A,MAX_GUARD_COUNT_REWARD as B,MAX_AGENT_COUNT as C,MAX_CONTEXT_REPOSITORY_COUNT as D,MAX_CONSENSUS_REPOSITORIES_COUNT as E,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT as F,MAX_NODE_COUNT as G,MAX_IM_COUNT as H,MAX_FORWARD_COUNT as I,MAX_PERM_FOR_ENTITY as J,MAX_NODE_COUNT_ONCHAIN as K,MAX_FORWARD_ORDER_COUNT as L,MAX_DISPUTE_COUNT as M,MAX_ENTITY_COUNT as N,MAX_DATA_SIZE as O,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT as P,MAX_PROOF_SIZE as Q,MAX_GUARD_COUNT_DEMAND as R,MAX_ADMIN_COUNT as S,MAX_ARBITRATION_COUNT as T,MAX_NAMED_OPERATOR_ADDRESS_COUNT as U,MAX_ID_COUNT_ONCE as V,MAX_NAMED_OPERATOR_COUNT as W,MAX_POLICY_DESCRIPTION_LEN as X,MAX_POLICY_COUNT as Y,MAX_POLICY_GUARD_COUNT as Z,BRIDGE_TRANSFER_STATUS_PENDING as _,ONCHAIN_CONSTANTS as _t,guardClear as a,MAX_REQUIRED_INFO_SIZE as at,DISCOUNT_TYPE_RATES as b,WOWOK_WTS_PROOF_TYPE as bt,resolve_submission_names as c,MAX_SERVER_PUBKEY_SIZE as ct,BRIDGE_CURRENT_VERSION as d,MAX_SUBMISSION_SIZE_PASSPORT as dt,MAX_RECIPIENT_COUNT as et,BRIDGE_EVM_ADDRESS_LENGTH as f,MAX_TAGS_COUNT as ft,BRIDGE_TRANSFER_STATUS_NOT_FOUND as g,MAX_WIP_LENGTH as gt,BRIDGE_TRANSFER_STATUS_CLAIMED as h,MAX_WIP_HASH_LENGTH as ht,guardAdd as i,MAX_REPOSITORY_COUNT as it,MAX_DISCOUNT_TOTAL_COUNT as j,MAX_DISCOUNT_COUNT_ONCE as k,verify as l,MAX_SERVER_SIGNATURE_SIZE as lt,BRIDGE_TRANSFER_STATUS_APPROVED as m,MAX_VOTOR_COUNT as mt,freeze as n,MAX_RECORD_COUNT_REWARD as nt,newPassport as o,MAX_REWARD_COUNT as ot,BRIDGE_MESSAGE_VERSION as p,MAX_VOTING_GUARD_COUNT as pt,MAX_NODE_PAIR_COUNT as q,get_guardSubmissions as r,MAX_RECORD_LENGTH as rt,passportFn as s,MAX_SALE_COUNT as st,destroy as t,MAX_RECORD_COUNT_REGISTRAR as tt,verify_guard as u,MAX_SHARING_COUNT as ut,DEFAULT_LOCK_DURATION as v,USER_DEFINED_PERM_INDEX_START as vt,MAX_ALLOCATOR_COUNT as w,MAX_ADDRESS_COUNT as x,DISCOUNT_TYPE_MINUS as y,WITHDRAW_DURATION_TIME as yt,MAX_GUARD_COUNT_PASSPORT as z};
@@ -155,6 +155,17 @@ interface EvaluationInput {
155
155
  details?: Record<string, unknown>;
156
156
  metadata?: Record<string, unknown>;
157
157
  }
158
+ interface ProjectDocument {
159
+ id: string;
160
+ project_id: string;
161
+ version?: string;
162
+ network: string;
163
+ doc_type: string;
164
+ content: string;
165
+ checksum?: string;
166
+ generated_at?: number;
167
+ updated_at?: number;
168
+ }
158
169
  interface ObjectDiff {
159
170
  address: string;
160
171
  fromTime: number;
@@ -192,6 +203,12 @@ declare class LocalProject {
192
203
  }): Promise<ProjectObject[]>;
193
204
  removeObject(id: string): Promise<void>;
194
205
  removeObjectByAddress(projectId: string, address: string): Promise<void>;
206
+ updateObject(id: string, updates: {
207
+ objectName?: string;
208
+ objectType?: string;
209
+ role?: ObjectRole;
210
+ tags?: string[];
211
+ }): Promise<ProjectObject>;
195
212
  findObjectsByAddress(address: string): Promise<ProjectObject[]>;
196
213
  cacheObject(address: string, objectType: string | null, data: string, network: string): Promise<void>;
197
214
  getCachedObject(address: string): Promise<ObjectCacheEntry | undefined>;
@@ -213,10 +230,15 @@ declare class LocalProject {
213
230
  evalType?: EvaluationType;
214
231
  }): Promise<Evaluation[]>;
215
232
  getLatestEvaluation(projectId: string, evalType: EvaluationType): Promise<Evaluation | undefined>;
233
+ saveDocument(projectId: string, network: string, content: string, docType?: string): Promise<ProjectDocument>;
234
+ getDocument(projectId: string, network: string, docType?: string): Promise<ProjectDocument | undefined>;
235
+ listDocuments(projectId: string): Promise<ProjectDocument[]>;
236
+ deleteDocument(projectId: string, network: string, docType?: string): Promise<boolean>;
237
+ private computeChecksum;
216
238
  /**
217
239
  * Reset all database connections (for testing).
218
240
  */
219
241
  static resetDbConnection(): void;
220
242
  }
221
243
  //#endregion
222
- export { ProjectVersion as C, ProjectUpdate as S, ProjectFilter as _, EvaluationType as a, ProjectPerspective as b, GraphEdgeInput as c, ObjectCacheEntry as d, ObjectCacheHistoryEntry as f, ProjectCreate as g, Project as h, EvaluationInput as i, GraphNode as l, ObjectRole as m, EdgeSource as n, GraphData as o, ObjectDiff as p, Evaluation as r, GraphEdge as s, DiffField as t, LocalProject as u, ProjectObject as v, RelationshipType as w, ProjectStatus as x, ProjectObjectAdd as y };
244
+ export { ProjectUpdate as C, ProjectStatus as S, RelationshipType as T, ProjectDocument as _, EvaluationType as a, ProjectObjectAdd as b, GraphEdgeInput as c, ObjectCacheEntry as d, ObjectCacheHistoryEntry as f, ProjectCreate as g, Project as h, EvaluationInput as i, GraphNode as l, ObjectRole as m, EdgeSource as n, GraphData as o, ObjectDiff as p, Evaluation as r, GraphEdge as s, DiffField as t, LocalProject as u, ProjectFilter as v, ProjectVersion as w, ProjectPerspective as x, ProjectObject as y };
@@ -1 +1 @@
1
- import{t as a40a}from'./rolldown-runtime-D7D4PA-g.mjs';import{B as a40b,g as a40c}from'./common-asa9BxDq.mjs';import{o as a40d}from'./exception-0GqTGX2P.mjs';import{isValidAddress}from'./w/local/local.mjs';import{Q as a40e,ct as a40f,lt as a40g}from'./passport-BcyLD6k9.mjs';import{t as a40h}from'./base-BwMlgHp_.mjs';var proof_exports=a40a({'CallProof':()=>CallProof,'create':()=>create,'gen_proof':()=>gen_proof,'proofFn':()=>proofFn}),CallProof=class extends a40h{constructor(a){super(),this['data']=a;}async['call'](a){return await this['prepare'](a),await this['exec'](a);}async['operate'](a,b,c){await this['new_with_mark'](a,b,'Proof',create(b,this['data']?.['description'],this['data']?.['proof'],this['data']?.['server_pubkey'],this['data']?.['server_signature'],this['data']?.['proof_type'],this['data']?.['item_count'],this['data']?.['about_address']),this['data']?.['namedNew']);}};function proofFn(a){return'0x2::proof::'+a;}const gen_proof=async(a,b,c,d,e,f,g,h)=>{return await new CallProof({'proof':b,'server_pubkey':c,'server_signature':d,'proof_type':e,'description':f,'item_count':g,'about_address':h})['call'](a);};function create(a,b,c,d,e,f,g,h){if(!a40b(b))a40d('invalid\x20description','Description\x20length\x20exceeds\x20'+a40c);if(c['length']>a40e)a40d('invalid\x20parameter','Proof\x20length\x20exceeds\x20'+a40e);if(d['length']>a40f)a40d('invalid\x20parameter','Server\x20pubkey\x20length\x20exceeds\x20'+a40f);if(e['length']>a40g)a40d('invalid\x20parameter','Server\x20signature\x20length\x20exceeds\x20'+a40g);if(h&&!isValidAddress(h))a40d('invalid\x20address','About\x20address\x20'+h+'\x20is\x20not\x20valid');return a['moveCall']({'target':proofFn('create_wowok_proof'),'arguments':[a['pure']['string'](c),a['pure']['option']('u64',g),a['pure']['string'](b),a['pure']['string'](d),a['pure']['string'](e),a['pure']['option']('address',h??null),a['pure']['u64'](f),a['object']['clock']()]});}export{gen_proof as n,proof_exports as r,CallProof as t};
1
+ import{t as a40a}from'./rolldown-runtime-D7D4PA-g.mjs';import{B as a40b,g as a40c}from'./common-asa9BxDq.mjs';import{o as a40d}from'./exception-0GqTGX2P.mjs';import{isValidAddress}from'./w/local/local.mjs';import{Q as a40e,ct as a40f,lt as a40g}from'./passport-CeZG1Lh0.mjs';import{t as a40h}from'./base-BT5c3H9N.mjs';var proof_exports=a40a({'CallProof':()=>CallProof,'create':()=>create,'gen_proof':()=>gen_proof,'proofFn':()=>proofFn}),CallProof=class extends a40h{constructor(a){super(),this['data']=a;}async['call'](a){return await this['prepare'](a),await this['exec'](a);}async['operate'](a,b,c){await this['new_with_mark'](a,b,'Proof',create(b,this['data']?.['description'],this['data']?.['proof'],this['data']?.['server_pubkey'],this['data']?.['server_signature'],this['data']?.['proof_type'],this['data']?.['item_count'],this['data']?.['about_address']),this['data']?.['namedNew']);}};function proofFn(a){return'0x2::proof::'+a;}const gen_proof=async(a,b,c,d,e,f,g,h)=>{return await new CallProof({'proof':b,'server_pubkey':c,'server_signature':d,'proof_type':e,'description':f,'item_count':g,'about_address':h})['call'](a);};function create(a,b,c,d,e,f,g,h){if(!a40b(b))a40d('invalid\x20description','Description\x20length\x20exceeds\x20'+a40c);if(c['length']>a40e)a40d('invalid\x20parameter','Proof\x20length\x20exceeds\x20'+a40e);if(d['length']>a40f)a40d('invalid\x20parameter','Server\x20pubkey\x20length\x20exceeds\x20'+a40f);if(e['length']>a40g)a40d('invalid\x20parameter','Server\x20signature\x20length\x20exceeds\x20'+a40g);if(h&&!isValidAddress(h))a40d('invalid\x20address','About\x20address\x20'+h+'\x20is\x20not\x20valid');return a['moveCall']({'target':proofFn('create_wowok_proof'),'arguments':[a['pure']['string'](c),a['pure']['option']('u64',g),a['pure']['string'](b),a['pure']['string'](d),a['pure']['string'](e),a['pure']['option']('address',h??null),a['pure']['u64'](f),a['object']['clock']()]});}export{gen_proof as n,proof_exports as r,CallProof as t};
@@ -1 +1 @@
1
- import{t as a47a}from'./client-BP4Izdze.mjs';import{n as a47b}from'./network-CeDd07Hg.mjs';import{A as a47c,D as a47d,E as a47e,M as a47f,a as a47g,j as a47h,n as a47i,o as a47j,s as a47k}from'./common-asa9BxDq.mjs';import{Cache}from'./w/local/cache.mjs';import{Config}from'./w/local/config.mjs';import{LocalMark}from'./w/local/local.mjs';import{compressedPubKeyToAddress}from'./w/local/evm/rlp.mjs';import{GetAccountOrMark_Address}from'./w/local/index.mjs';import{X as a47l}from'./object-B8AoRIC5.mjs';import{query_permissions}from'./w/call/permission.mjs';const query_events_json=async a=>{try{const b=JSON['parse'](a);return JSON['stringify']({'data':await query_events(b)});}catch(c){return JSON['stringify']({'error':c?.['toString']()});}},query_events=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=a['cursor']?a['cursor']['eventSeq']+':'+a['cursor']['txDigest']:'',e=a['limit']?.['toString']()??'',f=a['order']??'',g=await Cache['read'](['event',a['type'],c,e,f,b],async()=>{const h=await events(a['type'],a);return{'expire':Cache['DefaultExpireTime'](),'data':h};},a['no_cache']);if(g){const h=g['data'];return h['cache_expire']=g['expire'],h;}},events=async(a,b)=>{const c=await Config['Instance']()['network_get'](b['network']),d=new a47a({'url':a47b(c),'network':c}),e=a==='ArbEvent'||a==='NewOrderEvent'||a==='ProgressEvent'||a==='DemandPresentEvent'||a==='DemandFeedbackEvent'||a==='NewEntityEvent';let f;if(e)f='0x2'+{'ArbEvent':'::arb::ArbEvent','NewOrderEvent':'::order::NewOrderEvent','ProgressEvent':'::progress::ProgressEvent','DemandPresentEvent':'::demand::PresentEvent','DemandFeedbackEvent':'::demand::DemandEvent','NewEntityEvent':'::entity::NewEntityEvent'}[a];else f=a;const g=await d['queryEvents']({'query':{'MoveEventType':f},'cursor':b['cursor'],'limit':b['limit'],'order':b['order']==='descending'?'descending':'ascending'});return{'data':g?.['data']?.['map'](h=>{if(h?.['packageId']==='0x2'){if(h?.['type']?.['includes']('::order::NewOrderEvent'))return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':'NewOrderEvent','order':h?.['parsedJson']?.['object'],'service':h?.['parsedJson']?.['service'],'progress':h?.['parsedJson']?.['progress']?.['some']??null,'amount':h?.['parsedJson']?.['amount'],'discount':h?.['parsedJson']?.['discount']?.['some']??null,'allocation':h?.['parsedJson']?.['allocation']?.['some']??null};else{if(h?.['type']?.['includes']('::demand::PresentEvent'))return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':'DemandPresentEvent','demand':h?.['parsedJson']?.['object'],'service':h?.['parsedJson']?.['service']?.['some']??null,'recommend':h?.['parsedJson']?.['tips']};else{if(h?.['type']?.['includes']('::demand::DemandEvent'))return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':'DemandFeedbackEvent','demand':h?.['parsedJson']?.['object'],'service':h?.['parsedJson']?.['service']?.['some']??null,'feedback':h?.['parsedJson']?.['feedback'],'acceptance_score':h?.['parsedJson']?.['acceptance_score']?.['some']??null};else{if(h?.['type']?.['includes']('::progress::ProgressEvent'))return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':'ProgressEvent','progress':h?.['parsedJson']?.['object'],'machine':h?.['parsedJson']?.['machine'],'task':h?.['parsedJson']?.['task'],'node':h?.['parsedJson']?.['node'],'forward':h?.['parsedJson']?.['forward'],'hold':h?.['parsedJson']?.['hold']};else{if(h?.['type']?.['includes']('::arb::ArbEvent'))return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':'ArbEvent','arb':h?.['parsedJson']?.['object'],'arbitration':h?.['parsedJson']?.['arbitration'],'order':h?.['parsedJson']?.['order'],'status':h?.['parsedJson']?.['status']};else{if(h?.['type']?.['includes']('::entity::NewEntityEvent'))return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':'NewEntityEvent','resource':h?.['parsedJson']?.['resource'],'address':h?.['sender'],'referrer':h?.['parsedJson']?.['referrer']?.['some']??null};}}}}}}return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':h?.['type'],'parsedJson_raw':h?.['parsedJson']};}),'hasNextPage':g?.['hasNextPage'],'nextCursor':g?.['nextCursor']};};let BridgeChainId=function(a){return a[a['WowMainnet']=0x0]='WowMainnet',a[a['EthMainnet']=0xa]='EthMainnet',a;}({});function isEvmChain(a){return a===0xa;}function isWowChain(a){return a===0x0;}let BridgeVersion=function(a){return a[a['V1']=0x1]='V1',a[a['V2']=0x2]='V2',a;}({}),BridgeTokenId=function(a){return a['Eth']='ETH',a['Weth']='WETH',a['Wbtc']='WBTC',a['Usdc']='USDC',a['Usdt']='USDT',a;}({}),TransferStatus=function(a){return a['Pending']='pending',a['Approved']='approved',a['Claimed']='claimed',a['Failed']='failed',a['NotFound']='not_found',a;}({}),BridgeErrorCode=function(a){return a['EstimateFailed']='ESTIMATE_FAILED',a['Reverted']='REVERTED',a['Timeout']='TIMEOUT',a['NoSignatures']='NO_SIGNATURES',a['NodeUnavailable']='NODE_UNAVAILABLE',a['InvalidParam']='INVALID_PARAM',a['AccountNotFound']='ACCOUNT_NOT_FOUND',a['Unknown']='UNKNOWN',a;}({});const MAINNET_COMMITTEE_PUBKEYS=['0x032f020d08ca4a8632e2442ae789b961265d80b6058135bba1d2daa30ddea0acf0','0x02bb110601a69423651f1faadb1d510d895cd91baa37a470f09479aa84ef9128bb','0x03add24c04f5149421849510709d309f826f42751922f1131c784283fc2bad0b0b'],MAINNET_COMMITTEE_WEIGHTS=[0xd06,0xd06,0xd05],MAINNET_COMMITTEE_MEMBER_ADDRESSES=['0x373ee3febe317168fe58c66faaa446e26e57c2f1','0x2829ea9323836b5c8e0f8c47cd3abdc70962e891','0x97b3c777af04e4df7cb3fd1c92893a0358db9beb'],MAINNET_BRIDGE_CONFIG={'wow':{'rpcUrl':'https://fullnode.mainnet.wowok.net:443','bridgeObjectId':'0x9','clockObjectId':'0x6','network':'mainnet'},'ethereum':{'chainId':0x1,'bridgeChainId':0xa,'rpcUrl':'','bridgeProxyAddress':'0xA8d914Cc121CB2d2179Ca540bC0B8213F224aa00','bridgeVaultAddress':'0xC9A6EF1A3dC6f0681d39C318c4882FB7704a7848','bridgeCommitteeAddress':'0x822779c4183ed69bdd38e0454ec1826d2ae186a5','bridgeConfigAddress':'0xaf9414c8ab0a0905a6b9ad24c927416ac765a4ce'},'bridgeNodeUrls':['http://43.156.120.237:9211','http://150.158.76.254:9211','http://110.40.159.14:9211'],'defaultVersion':0x2,'tokens':[{'tokenId':0x1,'symbol':'WBTC','wowTypeTag':'0x06c69f212cc7bef6ff730b42bc739be7786902c501f15e99dbce1b8b5c7eff58::btc::BTC','evmAddress':'0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599','evmDecimals':0x8,'wowDecimals':0x8,'evmChains':[0xa],'description':'Wrapped\x20BTC\x20(ERC20).\x20Bitcoin\x20price\x20exposure\x20on\x20Ethereum;\x201\x20WBTC\x20=\x201\x20BTC.'},{'tokenId':0x2,'symbol':'ETH','wowTypeTag':'0xdb429818d697419e12a3481af1d21f32e603bff8716d45b0e964c2191db6604f::eth::ETH','evmAddress':'0x0000000000000000000000000000000000000000','evmDecimals':0x12,'wowDecimals':0x8,'evmChains':[0xa],'description':'Native\x20ETH.\x20Calls\x20bridgeETHV2{value};\x20vault\x20auto-wraps\x20to\x20WETH\x20internally.\x2018\x20decimals\x20on\x20EVM,\x208\x20decimals\x20on\x20WOW.'},{'tokenId':0x2,'symbol':'WETH','wowTypeTag':'0xdb429818d697419e12a3481af1d21f32e603bff8716d45b0e964c2191db6604f::eth::ETH','evmAddress':'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2','evmDecimals':0x12,'wowDecimals':0x8,'evmChains':[0xa],'description':'Wrapped\x20ETH\x20(ERC20).\x20Calls\x20bridgeERC20V2;\x20shares\x20Token\x20ID\x202\x20and\x20WOW\x20type\x20tag\x20with\x20native\x20ETH.'},{'tokenId':0x3,'symbol':'USDC','wowTypeTag':'0xe70fcfd8ef984292b11346ee43880ea9d6fba9f270c90bd0432574db14af67bf::usdc::USDC','evmAddress':'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48','evmDecimals':0x6,'wowDecimals':0x6,'evmChains':[0xa],'description':'USD\x20Coin\x20(USDC).\x20Fully\x20collateralized\x20USD\x20stablecoin;\x206\x20decimals\x20on\x20both\x20sides.'},{'tokenId':0x4,'symbol':'USDT','wowTypeTag':'0x4f160cf9a28ca8ac8bc0a46e13b02588dc05722148dd964807b9be89a0fcfe4d::usdt::USDT','evmAddress':'0xdAC17F958D2ee523a2206206994597C13D831ec7','evmDecimals':0x6,'wowDecimals':0x6,'evmChains':[0xa],'description':'Tether\x20USD\x20(USDT).\x20Fiat-collateralized\x20stablecoin;\x206\x20decimals\x20on\x20both\x20sides.'}],'timeouts':{'nodeRpcMs':0x7530,'signaturePollIntervalMs':0x1388,'signatureCollectMs':0xf*0xea60,'autoClaimMs':0xa*0xea60}};function findEvmChainConfig(a,b){if(a['ethereum']['chainId']===b)return a['ethereum'];if(a['l2']){for(const c of Object['values'](a['l2']))if(c&&c['chainId']===b)return c;}}function findEvmChainConfigByBridgeChainId(a,b){if(a['ethereum']['bridgeChainId']===b)return a['ethereum'];if(a['l2']){for(const c of Object['values'](a['l2']))if(c&&c['bridgeChainId']===b)return c;}}function findToken(a,b){return a['tokens']['find'](c=>c['tokenId']===b);}function findTokenBySymbol(a,b){return a['tokens']['find'](c=>c['symbol']===b);}function verifyCommitteeConsistency(){const a=[];for(let b=0x0;b<MAINNET_COMMITTEE_PUBKEYS['length'];b++){const c=MAINNET_COMMITTEE_PUBKEYS[b],d=MAINNET_COMMITTEE_MEMBER_ADDRESSES[b],e=compressedPubKeyToAddress(c);if(e['toLowerCase']()!==d['toLowerCase']())a['push']({'index':b,'pubkey':c,'expected':d,'actual':e});}return a;}const INFO_CONSTANT={'type':'constants','constants':[{'name':'Protocol\x20Package\x20ID','value':'0x2','description':'Protocol\x20package\x20ID'},{'name':'Gas\x20Token\x20Type','value':a47k,'description':'Gas\x20token\x20type'},{'name':'Gas\x20Coin\x20Type','value':a47j,'description':'Gas\x20coin\x20type'},{'name':'Entity\x20Linker\x20ID','value':a47c,'description':'Entity\x20Linker\x20ID'},{'name':'Entity\x20Registrar\x20ID','value':a47g,'description':'Entity\x20registrar\x20ID'}],'value_types':Object['entries'](a47h)['filter'](([a,b])=>isNaN(Number(a))&&a!=='Value')['map'](([a,b])=>({'name':a,'value':a,'description':'Value\x20type\x20'+a+'\x20=\x20'+b})),'object_types':Object['values'](a47e)['map'](a=>({'name':a,'value':a,'description':'Object\x20type\x20'+a})),'guard_instructions':Object['values'](a47d)['map'](a=>({'name':a,'value':a,'description':'Guard\x20instruction\x20'+a})),'guard_contexts':Object['values'](a47i)['map'](a=>({'name':a,'value':a,'description':'Guard\x20context\x20'+a})),'guard_witnesses':Object['values'](a47f)['map'](a=>({'name':a,'value':a,'description':'Guard\x20witness\x20'+a}))};async function queryProtocolInfo(a){switch(a['info']){case'constants':return{'info':'constants','result':INFO_CONSTANT['constants']};case'built-in\x20permissions':return{'info':'built-in\x20permissions','result':queryPermissions(a['filter']||{})};case'guard\x20instructions':return{'info':'guard\x20instructions','result':a47l(a['filter']||{})};case'current\x20network':return{'info':'current\x20network','result':await Config['Instance']()['network_get']()};case'value\x20types':return{'info':'value\x20types','result':INFO_CONSTANT['value_types']};case'mainnet\x20bridge\x20tokens':return{'info':'mainnet\x20bridge\x20tokens','result':MAINNET_BRIDGE_CONFIG['tokens']};default:throw new Error('Unsupported\x20info\x20type:\x20\x22'+a['info']+'\x22.\x20Valid\x20are:\x20\x22constants\x22,\x20\x22built-in\x20permissions\x22,\x20\x22guard\x20instructions\x22,\x20\x22current\x20network\x22,\x20\x22value\x20types\x22,\x20\x22mainnet\x20bridge\x20tokens\x22');}}function queryPermissions(a){return query_permissions(a);}const query_transaction_json=async a=>{try{const b=JSON['parse'](a);return JSON['stringify']({'data':await query_transaction(b)});}catch(c){return JSON['stringify']({'error':c?.['toString']()});}},query_transaction=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=a['digest'],d=await Cache['read'](['tx','detail',c,b],async()=>{const e=await new a47a({'url':a47b(b),'network':b})['getTransactionBlock']({'digest':c,'options':{'showEffects':!![],'showEvents':!![],'showBalanceChanges':!![],'showInput':!![],'showObjectChanges':!![]}}),f=parseTransactionBlock(e);return{'expire':Cache['DefaultExpireTime'](),'data':f};},a['no_cache']);if(d)return d['data']['cache_expire']=d['expire'],d['data'];},query_object_history_json=async a=>{try{const b=JSON['parse'](a);return JSON['stringify']({'data':await query_object_history(b)});}catch(c){return JSON['stringify']({'error':c?.['toString']()});}},query_object_history=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=(await LocalMark['Instance']()['get_many_address']([a['object']]))[0x0];if(!c)return{'transactions':[],'next_cursor':null,'has_next_page':![]};const d=a['cursor']??'',e=(a['limit']??0x14)['toString'](),f=a['order']??'descending',g=await Cache['read'](['tx','obj_history',c,d,e,f,b],async()=>{const h=await fetchTransactionHistory(b,{'InputObject':c},a['cursor'],a['limit']??0x14,a['order']??'descending');return{'expire':Cache['DefaultExpireTime'](),'data':h};},a['no_cache']);if(g)return g['data']['cache_expire']=g['expire'],g['data'];},query_address_activity_json=async a=>{try{const b=JSON['parse'](a);return JSON['stringify']({'data':await query_address_activity(b)});}catch(c){return JSON['stringify']({'error':c?.['toString']()});}},query_address_activity=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=await GetAccountOrMark_Address(a['name_or_address']);if(!c)return{'transactions':[],'next_cursor':null,'has_next_page':![]};const d=a['cursor']??'',e=(a['limit']??0x14)['toString'](),f=a['order']??'descending',g=await Cache['read'](['tx','addr_activity',c,d,e,f,b],async()=>{const h=await fetchTransactionHistory(b,{'FromAddress':c},a['cursor'],a['limit']??0x14,a['order']??'descending');return{'expire':Cache['DefaultExpireTime'](),'data':h};},a['no_cache']);if(g)return g['data']['cache_expire']=g['expire'],g['data'];},fetchTransactionHistory=async(a,b,c,d,e)=>{const f=await new a47a({'url':a47b(a),'network':a})['queryTransactionBlocks']({'filter':b,'options':{'showEffects':!![],'showInput':!![]},'cursor':c??void 0x0,'limit':Math['min'](d,0x32),'order':e});return{'transactions':(f?.['data']??[])['map'](g=>{const h=extractObjectsFromEffects(g?.['effects']);return{'digest':g?.['digest']??'','status':g?.['effects']?.['status']?.['status']==='success'?'success':'failed','timestamp_ms':g?.['timestampMs'],'sender':g?.['transaction']?.['data']?.['sender'],'kind':g?.['transaction']?.['data']?.['transaction']?.['kind']?Object['keys'](g['transaction']['data']['transaction'])[0x0]:void 0x0,'gas_used':g?.['effects']?.['gasUsed']?.['computationCost']?''+g['effects']['gasUsed']['computationCost']:void 0x0,'objects_touched':h,'has_object_changes':h['length']>0x0};}),'next_cursor':f?.['nextCursor']??null,'has_next_page':f?.['hasNextPage']??![]};},parseTransactionBlock=a=>{const b=a?.['effects'],c=b?.['status']?.['status']==='success'?'success':'failed',d=c==='failed'?b?.['status']?.['error']:void 0x0,e=(a?.['objectChanges']??[])['map'](i=>({'id':i?.['objectId']??'','type':i?.['type']??'mutated','object_type':i?.['objectType'],'sender':i?.['sender'],'version':i?.['version'],'previous_version':i?.['previousVersion'],'digest':i?.['digest']})),f=(a?.['balanceChanges']??[])['map'](i=>({'owner':typeof i?.['owner']==='string'?i['owner']:i?.['owner']?.['AddressOwner']??'','coin_type':i?.['coinType']??'','amount':i?.['amount']??'0'})),g=b?.['gasUsed'],h=g?''+(BigInt(g['computationCost']??0x0)+BigInt(g['storageCost']??0x0)-BigInt(g['storageRebate']??0x0)):void 0x0;return{'digest':a?.['digest']??'','status':c,'error':d,'timestamp_ms':a?.['timestampMs'],'sender':a?.['transaction']?.['data']?.['sender'],'gas_used':h,'gas_budget':a?.['transaction']?.['data']?.['gasData']?.['budget']?.['toString'](),'kind':a?.['transaction']?.['data']?.['transaction']?Object['keys'](a['transaction']['data']['transaction'])[0x0]:void 0x0,'object_changes':e,'balance_changes':f,'event_count':a?.['events']?.['length']??0x0,'epoch':b?.['epoch'],'is_system_tx':a?.['transaction']?.['data']?.['transaction']?.['kind']==='ConsensusCommitPrologue'};},extractObjectsFromEffects=a=>{if(!a)return[];const b=[],c=d=>{if(Array['isArray'](d)){for(const e of d)if(e?.['reference']?.['objectId'])b['push'](e['reference']['objectId']);else{if(e?.['objectId'])b['push'](e['objectId']);}}};return c(a['created']),c(a['mutated']),c(a['deleted']),c(a['wrapped']),c(a['unwrapped']),[...new Set(b)];};export{TransferStatus as C,query_events_json as D,query_events as E,BridgeVersion as S,isWowChain as T,findTokenBySymbol as _,query_transaction as a,BridgeErrorCode as b,queryPermissions as c,MAINNET_COMMITTEE_MEMBER_ADDRESSES as d,MAINNET_COMMITTEE_PUBKEYS as f,findToken as g,findEvmChainConfigByBridgeChainId as h,query_object_history_json as i,queryProtocolInfo as l,findEvmChainConfig as m,query_address_activity_json as n,query_transaction_json as o,MAINNET_COMMITTEE_WEIGHTS as p,query_object_history as r,INFO_CONSTANT as s,query_address_activity as t,MAINNET_BRIDGE_CONFIG as u,verifyCommitteeConsistency as v,isEvmChain as w,BridgeTokenId as x,BridgeChainId as y};
1
+ import{t as a47a}from'./client-Jb2DzzQN.mjs';import{n as a47b}from'./network-CeDd07Hg.mjs';import{A as a47c,D as a47d,E as a47e,M as a47f,a as a47g,j as a47h,n as a47i,o as a47j,s as a47k}from'./common-asa9BxDq.mjs';import{Cache}from'./w/local/cache.mjs';import{Config}from'./w/local/config.mjs';import{LocalMark}from'./w/local/local.mjs';import{compressedPubKeyToAddress}from'./w/local/evm/rlp.mjs';import{GetAccountOrMark_Address}from'./w/local/index.mjs';import{X as a47l}from'./object-DJOqAJAQ.mjs';import{query_permissions}from'./w/call/permission.mjs';const query_events_json=async a=>{try{const b=JSON['parse'](a);return JSON['stringify']({'data':await query_events(b)});}catch(c){return JSON['stringify']({'error':c?.['toString']()});}},query_events=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=a['cursor']?a['cursor']['eventSeq']+':'+a['cursor']['txDigest']:'',e=a['limit']?.['toString']()??'',f=a['order']??'',g=await Cache['read'](['event',a['type'],c,e,f,b],async()=>{const h=await events(a['type'],a);return{'expire':Cache['DefaultExpireTime'](),'data':h};},a['no_cache']);if(g){const h=g['data'];return h['cache_expire']=g['expire'],h;}},events=async(a,b)=>{const c=await Config['Instance']()['network_get'](b['network']),d=new a47a({'url':a47b(c),'network':c}),e=a==='ArbEvent'||a==='NewOrderEvent'||a==='ProgressEvent'||a==='DemandPresentEvent'||a==='DemandFeedbackEvent'||a==='NewEntityEvent';let f;if(e)f='0x2'+{'ArbEvent':'::arb::ArbEvent','NewOrderEvent':'::order::NewOrderEvent','ProgressEvent':'::progress::ProgressEvent','DemandPresentEvent':'::demand::PresentEvent','DemandFeedbackEvent':'::demand::DemandEvent','NewEntityEvent':'::entity::NewEntityEvent'}[a];else f=a;const g=await d['queryEvents']({'query':{'MoveEventType':f},'cursor':b['cursor'],'limit':b['limit'],'order':b['order']==='descending'?'descending':'ascending'});return{'data':g?.['data']?.['map'](h=>{if(h?.['packageId']==='0x2'){if(h?.['type']?.['includes']('::order::NewOrderEvent'))return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':'NewOrderEvent','order':h?.['parsedJson']?.['object'],'service':h?.['parsedJson']?.['service'],'progress':h?.['parsedJson']?.['progress']?.['some']??null,'amount':h?.['parsedJson']?.['amount'],'discount':h?.['parsedJson']?.['discount']?.['some']??null,'allocation':h?.['parsedJson']?.['allocation']?.['some']??null};else{if(h?.['type']?.['includes']('::demand::PresentEvent'))return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':'DemandPresentEvent','demand':h?.['parsedJson']?.['object'],'service':h?.['parsedJson']?.['service']?.['some']??null,'recommend':h?.['parsedJson']?.['tips']};else{if(h?.['type']?.['includes']('::demand::DemandEvent'))return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':'DemandFeedbackEvent','demand':h?.['parsedJson']?.['object'],'service':h?.['parsedJson']?.['service']?.['some']??null,'feedback':h?.['parsedJson']?.['feedback'],'acceptance_score':h?.['parsedJson']?.['acceptance_score']?.['some']??null};else{if(h?.['type']?.['includes']('::progress::ProgressEvent'))return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':'ProgressEvent','progress':h?.['parsedJson']?.['object'],'machine':h?.['parsedJson']?.['machine'],'task':h?.['parsedJson']?.['task'],'node':h?.['parsedJson']?.['node'],'forward':h?.['parsedJson']?.['forward'],'hold':h?.['parsedJson']?.['hold']};else{if(h?.['type']?.['includes']('::arb::ArbEvent'))return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':'ArbEvent','arb':h?.['parsedJson']?.['object'],'arbitration':h?.['parsedJson']?.['arbitration'],'order':h?.['parsedJson']?.['order'],'status':h?.['parsedJson']?.['status']};else{if(h?.['type']?.['includes']('::entity::NewEntityEvent'))return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':'NewEntityEvent','resource':h?.['parsedJson']?.['resource'],'address':h?.['sender'],'referrer':h?.['parsedJson']?.['referrer']?.['some']??null};}}}}}}return{'id':h?.['id'],'time':h?.['timestampMs'],'type_raw':h?.['type'],'sender':h?.['sender'],'type':h?.['type'],'parsedJson_raw':h?.['parsedJson']};}),'hasNextPage':g?.['hasNextPage'],'nextCursor':g?.['nextCursor']};};let BridgeChainId=function(a){return a[a['WowMainnet']=0x0]='WowMainnet',a[a['EthMainnet']=0xa]='EthMainnet',a;}({});function isEvmChain(a){return a===0xa;}function isWowChain(a){return a===0x0;}let BridgeVersion=function(a){return a[a['V1']=0x1]='V1',a[a['V2']=0x2]='V2',a;}({}),BridgeTokenId=function(a){return a['Eth']='ETH',a['Weth']='WETH',a['Wbtc']='WBTC',a['Usdc']='USDC',a['Usdt']='USDT',a;}({}),TransferStatus=function(a){return a['Pending']='pending',a['Approved']='approved',a['Claimed']='claimed',a['Failed']='failed',a['NotFound']='not_found',a;}({}),BridgeErrorCode=function(a){return a['EstimateFailed']='ESTIMATE_FAILED',a['Reverted']='REVERTED',a['Timeout']='TIMEOUT',a['NoSignatures']='NO_SIGNATURES',a['NodeUnavailable']='NODE_UNAVAILABLE',a['InvalidParam']='INVALID_PARAM',a['AccountNotFound']='ACCOUNT_NOT_FOUND',a['Unknown']='UNKNOWN',a;}({});const MAINNET_COMMITTEE_PUBKEYS=['0x032f020d08ca4a8632e2442ae789b961265d80b6058135bba1d2daa30ddea0acf0','0x02bb110601a69423651f1faadb1d510d895cd91baa37a470f09479aa84ef9128bb','0x03add24c04f5149421849510709d309f826f42751922f1131c784283fc2bad0b0b'],MAINNET_COMMITTEE_WEIGHTS=[0xd06,0xd06,0xd05],MAINNET_COMMITTEE_MEMBER_ADDRESSES=['0x373ee3febe317168fe58c66faaa446e26e57c2f1','0x2829ea9323836b5c8e0f8c47cd3abdc70962e891','0x97b3c777af04e4df7cb3fd1c92893a0358db9beb'],MAINNET_BRIDGE_CONFIG={'wow':{'rpcUrl':'https://fullnode.mainnet.wowok.net:443','bridgeObjectId':'0x9','clockObjectId':'0x6','network':'mainnet'},'ethereum':{'chainId':0x1,'bridgeChainId':0xa,'rpcUrl':'','bridgeProxyAddress':'0xA8d914Cc121CB2d2179Ca540bC0B8213F224aa00','bridgeVaultAddress':'0xC9A6EF1A3dC6f0681d39C318c4882FB7704a7848','bridgeCommitteeAddress':'0x822779c4183ed69bdd38e0454ec1826d2ae186a5','bridgeConfigAddress':'0xaf9414c8ab0a0905a6b9ad24c927416ac765a4ce'},'bridgeNodeUrls':['http://43.156.120.237:9211','http://150.158.76.254:9211','http://110.40.159.14:9211'],'defaultVersion':0x2,'tokens':[{'tokenId':0x1,'symbol':'WBTC','wowTypeTag':'0x06c69f212cc7bef6ff730b42bc739be7786902c501f15e99dbce1b8b5c7eff58::btc::BTC','evmAddress':'0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599','evmDecimals':0x8,'wowDecimals':0x8,'evmChains':[0xa],'description':'Wrapped\x20BTC\x20(ERC20).\x20Bitcoin\x20price\x20exposure\x20on\x20Ethereum;\x201\x20WBTC\x20=\x201\x20BTC.'},{'tokenId':0x2,'symbol':'ETH','wowTypeTag':'0xdb429818d697419e12a3481af1d21f32e603bff8716d45b0e964c2191db6604f::eth::ETH','evmAddress':'0x0000000000000000000000000000000000000000','evmDecimals':0x12,'wowDecimals':0x8,'evmChains':[0xa],'description':'Native\x20ETH.\x20Calls\x20bridgeETHV2{value};\x20vault\x20auto-wraps\x20to\x20WETH\x20internally.\x2018\x20decimals\x20on\x20EVM,\x208\x20decimals\x20on\x20WOW.'},{'tokenId':0x2,'symbol':'WETH','wowTypeTag':'0xdb429818d697419e12a3481af1d21f32e603bff8716d45b0e964c2191db6604f::eth::ETH','evmAddress':'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2','evmDecimals':0x12,'wowDecimals':0x8,'evmChains':[0xa],'description':'Wrapped\x20ETH\x20(ERC20).\x20Calls\x20bridgeERC20V2;\x20shares\x20Token\x20ID\x202\x20and\x20WOW\x20type\x20tag\x20with\x20native\x20ETH.'},{'tokenId':0x3,'symbol':'USDC','wowTypeTag':'0xe70fcfd8ef984292b11346ee43880ea9d6fba9f270c90bd0432574db14af67bf::usdc::USDC','evmAddress':'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48','evmDecimals':0x6,'wowDecimals':0x6,'evmChains':[0xa],'description':'USD\x20Coin\x20(USDC).\x20Fully\x20collateralized\x20USD\x20stablecoin;\x206\x20decimals\x20on\x20both\x20sides.'},{'tokenId':0x4,'symbol':'USDT','wowTypeTag':'0x4f160cf9a28ca8ac8bc0a46e13b02588dc05722148dd964807b9be89a0fcfe4d::usdt::USDT','evmAddress':'0xdAC17F958D2ee523a2206206994597C13D831ec7','evmDecimals':0x6,'wowDecimals':0x6,'evmChains':[0xa],'description':'Tether\x20USD\x20(USDT).\x20Fiat-collateralized\x20stablecoin;\x206\x20decimals\x20on\x20both\x20sides.'}],'timeouts':{'nodeRpcMs':0x7530,'signaturePollIntervalMs':0x1388,'signatureCollectMs':0xf*0xea60,'autoClaimMs':0xa*0xea60}};function findEvmChainConfig(a,b){if(a['ethereum']['chainId']===b)return a['ethereum'];if(a['l2']){for(const c of Object['values'](a['l2']))if(c&&c['chainId']===b)return c;}}function findEvmChainConfigByBridgeChainId(a,b){if(a['ethereum']['bridgeChainId']===b)return a['ethereum'];if(a['l2']){for(const c of Object['values'](a['l2']))if(c&&c['bridgeChainId']===b)return c;}}function findToken(a,b){return a['tokens']['find'](c=>c['tokenId']===b);}function findTokenBySymbol(a,b){return a['tokens']['find'](c=>c['symbol']===b);}function verifyCommitteeConsistency(){const a=[];for(let b=0x0;b<MAINNET_COMMITTEE_PUBKEYS['length'];b++){const c=MAINNET_COMMITTEE_PUBKEYS[b],d=MAINNET_COMMITTEE_MEMBER_ADDRESSES[b],e=compressedPubKeyToAddress(c);if(e['toLowerCase']()!==d['toLowerCase']())a['push']({'index':b,'pubkey':c,'expected':d,'actual':e});}return a;}const INFO_CONSTANT={'type':'constants','constants':[{'name':'Protocol\x20Package\x20ID','value':'0x2','description':'Protocol\x20package\x20ID'},{'name':'Gas\x20Token\x20Type','value':a47k,'description':'Gas\x20token\x20type'},{'name':'Gas\x20Coin\x20Type','value':a47j,'description':'Gas\x20coin\x20type'},{'name':'Entity\x20Linker\x20ID','value':a47c,'description':'Entity\x20Linker\x20ID'},{'name':'Entity\x20Registrar\x20ID','value':a47g,'description':'Entity\x20registrar\x20ID'}],'value_types':Object['entries'](a47h)['filter'](([a,b])=>isNaN(Number(a))&&a!=='Value')['map'](([a,b])=>({'name':a,'value':a,'description':'Value\x20type\x20'+a+'\x20=\x20'+b})),'object_types':Object['values'](a47e)['map'](a=>({'name':a,'value':a,'description':'Object\x20type\x20'+a})),'guard_instructions':Object['values'](a47d)['map'](a=>({'name':a,'value':a,'description':'Guard\x20instruction\x20'+a})),'guard_contexts':Object['values'](a47i)['map'](a=>({'name':a,'value':a,'description':'Guard\x20context\x20'+a})),'guard_witnesses':Object['values'](a47f)['map'](a=>({'name':a,'value':a,'description':'Guard\x20witness\x20'+a}))};async function queryProtocolInfo(a){switch(a['info']){case'constants':return{'info':'constants','result':INFO_CONSTANT['constants']};case'built-in\x20permissions':return{'info':'built-in\x20permissions','result':queryPermissions(a['filter']||{})};case'guard\x20instructions':return{'info':'guard\x20instructions','result':a47l(a['filter']||{})};case'current\x20network':return{'info':'current\x20network','result':await Config['Instance']()['network_get']()};case'value\x20types':return{'info':'value\x20types','result':INFO_CONSTANT['value_types']};case'mainnet\x20bridge\x20tokens':return{'info':'mainnet\x20bridge\x20tokens','result':MAINNET_BRIDGE_CONFIG['tokens']};default:throw new Error('Unsupported\x20info\x20type:\x20\x22'+a['info']+'\x22.\x20Valid\x20are:\x20\x22constants\x22,\x20\x22built-in\x20permissions\x22,\x20\x22guard\x20instructions\x22,\x20\x22current\x20network\x22,\x20\x22value\x20types\x22,\x20\x22mainnet\x20bridge\x20tokens\x22');}}function queryPermissions(a){return query_permissions(a);}const query_transaction_json=async a=>{try{const b=JSON['parse'](a);return JSON['stringify']({'data':await query_transaction(b)});}catch(c){return JSON['stringify']({'error':c?.['toString']()});}},query_transaction=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=a['digest'],d=await Cache['read'](['tx','detail',c,b],async()=>{const e=await new a47a({'url':a47b(b),'network':b})['getTransactionBlock']({'digest':c,'options':{'showEffects':!![],'showEvents':!![],'showBalanceChanges':!![],'showInput':!![],'showObjectChanges':!![]}}),f=parseTransactionBlock(e);return{'expire':Cache['DefaultExpireTime'](),'data':f};},a['no_cache']);if(d)return d['data']['cache_expire']=d['expire'],d['data'];},query_object_history_json=async a=>{try{const b=JSON['parse'](a);return JSON['stringify']({'data':await query_object_history(b)});}catch(c){return JSON['stringify']({'error':c?.['toString']()});}},query_object_history=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=(await LocalMark['Instance']()['get_many_address']([a['object']]))[0x0];if(!c)return{'transactions':[],'next_cursor':null,'has_next_page':![]};const d=a['cursor']??'',e=(a['limit']??0x14)['toString'](),f=a['order']??'descending',g=await Cache['read'](['tx','obj_history',c,d,e,f,b],async()=>{const h=await fetchTransactionHistory(b,{'InputObject':c},a['cursor'],a['limit']??0x14,a['order']??'descending');return{'expire':Cache['DefaultExpireTime'](),'data':h};},a['no_cache']);if(g)return g['data']['cache_expire']=g['expire'],g['data'];},query_address_activity_json=async a=>{try{const b=JSON['parse'](a);return JSON['stringify']({'data':await query_address_activity(b)});}catch(c){return JSON['stringify']({'error':c?.['toString']()});}},query_address_activity=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=await GetAccountOrMark_Address(a['name_or_address']);if(!c)return{'transactions':[],'next_cursor':null,'has_next_page':![]};const d=a['cursor']??'',e=(a['limit']??0x14)['toString'](),f=a['order']??'descending',g=await Cache['read'](['tx','addr_activity',c,d,e,f,b],async()=>{const h=await fetchTransactionHistory(b,{'FromAddress':c},a['cursor'],a['limit']??0x14,a['order']??'descending');return{'expire':Cache['DefaultExpireTime'](),'data':h};},a['no_cache']);if(g)return g['data']['cache_expire']=g['expire'],g['data'];},fetchTransactionHistory=async(a,b,c,d,e)=>{const f=await new a47a({'url':a47b(a),'network':a})['queryTransactionBlocks']({'filter':b,'options':{'showEffects':!![],'showInput':!![]},'cursor':c??void 0x0,'limit':Math['min'](d,0x32),'order':e});return{'transactions':(f?.['data']??[])['map'](g=>{const h=extractObjectsFromEffects(g?.['effects']);return{'digest':g?.['digest']??'','status':g?.['effects']?.['status']?.['status']==='success'?'success':'failed','timestamp_ms':g?.['timestampMs'],'sender':g?.['transaction']?.['data']?.['sender'],'kind':g?.['transaction']?.['data']?.['transaction']?.['kind']?Object['keys'](g['transaction']['data']['transaction'])[0x0]:void 0x0,'gas_used':g?.['effects']?.['gasUsed']?.['computationCost']?''+g['effects']['gasUsed']['computationCost']:void 0x0,'objects_touched':h,'has_object_changes':h['length']>0x0};}),'next_cursor':f?.['nextCursor']??null,'has_next_page':f?.['hasNextPage']??![]};},parseTransactionBlock=a=>{const b=a?.['effects'],c=b?.['status']?.['status']==='success'?'success':'failed',d=c==='failed'?b?.['status']?.['error']:void 0x0,e=(a?.['objectChanges']??[])['map'](i=>({'id':i?.['objectId']??'','type':i?.['type']??'mutated','object_type':i?.['objectType'],'sender':i?.['sender'],'version':i?.['version'],'previous_version':i?.['previousVersion'],'digest':i?.['digest']})),f=(a?.['balanceChanges']??[])['map'](i=>({'owner':typeof i?.['owner']==='string'?i['owner']:i?.['owner']?.['AddressOwner']??'','coin_type':i?.['coinType']??'','amount':i?.['amount']??'0'})),g=b?.['gasUsed'],h=g?''+(BigInt(g['computationCost']??0x0)+BigInt(g['storageCost']??0x0)-BigInt(g['storageRebate']??0x0)):void 0x0;return{'digest':a?.['digest']??'','status':c,'error':d,'timestamp_ms':a?.['timestampMs'],'sender':a?.['transaction']?.['data']?.['sender'],'gas_used':h,'gas_budget':a?.['transaction']?.['data']?.['gasData']?.['budget']?.['toString'](),'kind':a?.['transaction']?.['data']?.['transaction']?Object['keys'](a['transaction']['data']['transaction'])[0x0]:void 0x0,'object_changes':e,'balance_changes':f,'event_count':a?.['events']?.['length']??0x0,'epoch':b?.['epoch'],'is_system_tx':a?.['transaction']?.['data']?.['transaction']?.['kind']==='ConsensusCommitPrologue'};},extractObjectsFromEffects=a=>{if(!a)return[];const b=[],c=d=>{if(Array['isArray'](d)){for(const e of d)if(e?.['reference']?.['objectId'])b['push'](e['reference']['objectId']);else{if(e?.['objectId'])b['push'](e['objectId']);}}};return c(a['created']),c(a['mutated']),c(a['deleted']),c(a['wrapped']),c(a['unwrapped']),[...new Set(b)];};export{TransferStatus as C,query_events_json as D,query_events as E,BridgeVersion as S,isWowChain as T,findTokenBySymbol as _,query_transaction as a,BridgeErrorCode as b,queryPermissions as c,MAINNET_COMMITTEE_MEMBER_ADDRESSES as d,MAINNET_COMMITTEE_PUBKEYS as f,findToken as g,findEvmChainConfigByBridgeChainId as h,query_object_history_json as i,queryProtocolInfo as l,findEvmChainConfig as m,query_address_activity_json as n,query_transaction_json as o,MAINNET_COMMITTEE_WEIGHTS as p,query_object_history as r,INFO_CONSTANT as s,query_address_activity as t,MAINNET_BRIDGE_CONFIG as u,verifyCommitteeConsistency as v,isEvmChain as w,BridgeTokenId as x,BridgeChainId as y};
@@ -1 +1 @@
1
- import{t as a48a}from'./client-BP4Izdze.mjs';import{n as a48b}from'./network-CeDd07Hg.mjs';import'./common-asa9BxDq.mjs';import{o as a48c}from'./exception-0GqTGX2P.mjs';import{Config}from'./w/local/config.mjs';import{GetAccountOrMark_Address}from'./w/local/index.mjs';import{$ as a48d,L as a48e}from'./object-B8AoRIC5.mjs';const query_received=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=new a48a({'url':a48b(b),'network':b});let d;if(a['type']===void 0x0||a['type']===null){const f=await GetAccountOrMark_Address(a['name_or_address']);if(!f)a48c('invalid\x20parameter','query_received:\x20Object\x20'+a['name_or_address']+'\x20not\x20found.');return(await c['getOwnedObjects']({'owner':f,'options':{'showContent':!![],'showType':!![]}}))['data']['map'](g=>{return{'id':g?.['data']?.['objectId'],'type':g?.['data']?.['type'],'content_raw':g?.['data']?.['content']?.['fields']};});}if(a['type']==='CoinWrapper'){const g=typeof a['name_or_address']==='string'?a['name_or_address']:a['name_or_address']['name_or_address'];if(!g)a48c('invalid\x20parameter','query_received:\x20name_or_address\x20is\x20required.');const h=await a48e({'objects':[g],'no_cache':![],'network':a['network']});if(!h?.['objects']||h['objects']['length']!==0x1)a48c('invalid\x20parameter','query_received:\x20Object\x20'+g+'\x20not\x20found.');d=a48d(h['objects'][0x0]['type_raw']);if(!d)a48c('invalid\x20parameter','object\x20'+g+'\x20not\x20support\x20token\x20type;\x20query\x20with\x20type=undefined\x20instead.');const i=await c['getOwnedObjects']({'owner':h['objects'][0x0]['object'],'filter':{'StructType':'0x2::payment::CoinWrapper<'+d+'>'},'options':{'showContent':!![],'showType':!![]}});let j=BigInt(0x0);const k=i['data']['map'](l=>{const m=l?.['data']?.['content']?.['fields'];return j+=BigInt(m?.['coin']?.['fields']?.['balance']),{'payment':m?.['payment'],'balance':m?.['coin']?.['fields']?.['balance'],'id':l?.['data']?.['objectId'],'type':m?.['coin']?.['type']};});return{'balance':j,'received':k,'token_type':d};}const e=await GetAccountOrMark_Address(a['name_or_address']);if(!e)a48c('invalid\x20parameter','query_received:\x20Object\x20'+a['name_or_address']+'\x20not\x20found.');return(await c['getOwnedObjects']({'owner':e,'filter':{'StructType':a['type']},'options':{'showContent':!![],'showType':!![]}}))['data']['map'](l=>{return{'id':l?.['data']?.['objectId'],'type':l?.['data']?.['type'],'content_raw':l?.['data']?.['content']?.['fields']};});};export{query_received as t};
1
+ import{t as a48a}from'./client-Jb2DzzQN.mjs';import{n as a48b}from'./network-CeDd07Hg.mjs';import'./common-asa9BxDq.mjs';import{o as a48c}from'./exception-0GqTGX2P.mjs';import{Config}from'./w/local/config.mjs';import{GetAccountOrMark_Address}from'./w/local/index.mjs';import{$ as a48d,L as a48e}from'./object-DJOqAJAQ.mjs';const query_received=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=new a48a({'url':a48b(b),'network':b});let d;if(a['type']===void 0x0||a['type']===null){const f=await GetAccountOrMark_Address(a['name_or_address']);if(!f)a48c('invalid\x20parameter','query_received:\x20Object\x20'+a['name_or_address']+'\x20not\x20found.');return(await c['getOwnedObjects']({'owner':f,'options':{'showContent':!![],'showType':!![]}}))['data']['map'](g=>{return{'id':g?.['data']?.['objectId'],'type':g?.['data']?.['type'],'content_raw':g?.['data']?.['content']?.['fields']};});}if(a['type']==='CoinWrapper'){const g=typeof a['name_or_address']==='string'?a['name_or_address']:a['name_or_address']['name_or_address'];if(!g)a48c('invalid\x20parameter','query_received:\x20name_or_address\x20is\x20required.');const h=await a48e({'objects':[g],'no_cache':![],'network':a['network']});if(!h?.['objects']||h['objects']['length']!==0x1)a48c('invalid\x20parameter','query_received:\x20Object\x20'+g+'\x20not\x20found.');d=a48d(h['objects'][0x0]['type_raw']);if(!d)a48c('invalid\x20parameter','object\x20'+g+'\x20not\x20support\x20token\x20type;\x20query\x20with\x20type=undefined\x20instead.');const i=await c['getOwnedObjects']({'owner':h['objects'][0x0]['object'],'filter':{'StructType':'0x2::payment::CoinWrapper<'+d+'>'},'options':{'showContent':!![],'showType':!![]}});let j=BigInt(0x0);const k=i['data']['map'](l=>{const m=l?.['data']?.['content']?.['fields'];return j+=BigInt(m?.['coin']?.['fields']?.['balance']),{'payment':m?.['payment'],'balance':m?.['coin']?.['fields']?.['balance'],'id':l?.['data']?.['objectId'],'type':m?.['coin']?.['type']};});return{'balance':j,'received':k,'token_type':d};}const e=await GetAccountOrMark_Address(a['name_or_address']);if(!e)a48c('invalid\x20parameter','query_received:\x20Object\x20'+a['name_or_address']+'\x20not\x20found.');return(await c['getOwnedObjects']({'owner':e,'filter':{'StructType':a['type']},'options':{'showContent':!![],'showType':!![]}}))['data']['map'](l=>{return{'id':l?.['data']?.['objectId'],'type':l?.['data']?.['type'],'content_raw':l?.['data']?.['content']?.['fields']};});};export{query_received as t};