@sentio/sdk-bundle 2.57.7 → 2.57.8-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/lib/aptos/builtin/0x1.js +1 -1
  2. package/lib/aptos/builtin/0x3.js +1 -1
  3. package/lib/aptos/builtin/0x4.js +1 -1
  4. package/lib/aptos/builtin/index.js +1 -1
  5. package/lib/aptos/builtin/index.js.map +1 -1
  6. package/lib/aptos/ext/index.js +1 -1
  7. package/lib/aptos/ext/index.js.map +1 -1
  8. package/lib/aptos/index.js +1 -1
  9. package/lib/chunk-5AMCSNP7.js +7 -0
  10. package/lib/{chunk-WKFPJMXF.js.map → chunk-5AMCSNP7.js.map} +1 -1
  11. package/lib/{chunk-DWDJMSCJ.js → chunk-5F7WBLI4.js} +2 -2
  12. package/lib/{chunk-GXO7DCHZ.js → chunk-6CDEUHBK.js} +2 -2
  13. package/lib/{chunk-GXO7DCHZ.js.map → chunk-6CDEUHBK.js.map} +1 -1
  14. package/lib/chunk-AVNDNZMN.js +32 -0
  15. package/lib/{chunk-4XU3L3GP.js.map → chunk-AVNDNZMN.js.map} +1 -1
  16. package/lib/{chunk-AEDJCR64.js → chunk-B3F4WQRS.js} +2 -2
  17. package/lib/chunk-GTB5ZIMY.js +3 -0
  18. package/lib/{chunk-NRVSYA3B.js.map → chunk-GTB5ZIMY.js.map} +1 -1
  19. package/lib/{chunk-DJGKCH6U.js → chunk-GV7ZOJAQ.js} +2 -2
  20. package/lib/{chunk-DJGKCH6U.js.map → chunk-GV7ZOJAQ.js.map} +1 -1
  21. package/lib/{chunk-E4QNFY3U.js → chunk-LBW4DXQE.js} +2 -2
  22. package/lib/{chunk-LQC7CDVY.js → chunk-LWWZWZ4F.js} +2 -2
  23. package/lib/chunk-MPOOAJHZ.js +6 -0
  24. package/lib/{chunk-VJVZRE4N.js.map → chunk-MPOOAJHZ.js.map} +1 -1
  25. package/lib/{chunk-6NEMCBBH.js → chunk-OZNKQEYB.js} +2 -2
  26. package/lib/{chunk-6NEMCBBH.js.map → chunk-OZNKQEYB.js.map} +1 -1
  27. package/lib/{chunk-53EDEVTE.js → chunk-Q2FNRM5C.js} +2 -2
  28. package/lib/{chunk-53EDEVTE.js.map → chunk-Q2FNRM5C.js.map} +1 -1
  29. package/lib/{chunk-5HKPVFEF.js → chunk-QP5BWTK3.js} +2 -2
  30. package/lib/{chunk-6JYMR42Q.js → chunk-TJSPP6SM.js} +15 -15
  31. package/lib/{chunk-6JYMR42Q.js.map → chunk-TJSPP6SM.js.map} +1 -1
  32. package/lib/chunk-WO6IV4SO.js +499 -0
  33. package/lib/{chunk-WE2XH6H5.js.map → chunk-WO6IV4SO.js.map} +1 -1
  34. package/lib/chunk-WU52LDUL.js +6 -0
  35. package/lib/{chunk-UXGHKVAC.js.map → chunk-WU52LDUL.js.map} +1 -1
  36. package/lib/eth/builtin/eacaggregatorproxy.js +1 -1
  37. package/lib/eth/builtin/erc1155.js +1 -1
  38. package/lib/eth/builtin/erc20.js +1 -1
  39. package/lib/eth/builtin/erc721.js +1 -1
  40. package/lib/eth/builtin/index.js +1 -1
  41. package/lib/eth/builtin/index.js.map +1 -1
  42. package/lib/eth/builtin/weth9.js +1 -1
  43. package/lib/eth/index.js +1 -1
  44. package/lib/fuel/index.js +1 -1
  45. package/lib/solana/builtin/index.js +1 -1
  46. package/lib/solana/builtin/index.js.map +1 -1
  47. package/lib/solana/index.js +1 -1
  48. package/lib/stark/index.js +14 -14
  49. package/lib/stark/index.js.map +1 -1
  50. package/lib/sui/builtin/0x1.js +1 -1
  51. package/lib/sui/builtin/0x2.js +1 -1
  52. package/lib/sui/builtin/0x3.js +1 -1
  53. package/lib/sui/builtin/index.js +1 -1
  54. package/lib/sui/builtin/index.js.map +1 -1
  55. package/lib/sui/ext/index.js +1 -1
  56. package/lib/sui/ext/index.js.map +1 -1
  57. package/lib/sui/index.js +1 -1
  58. package/lib/testing/index.js +142 -15
  59. package/lib/testing/index.js.map +1 -1
  60. package/lib/utils/index.js +1 -1
  61. package/package.json +3 -2
  62. package/lib/chunk-4XU3L3GP.js +0 -32
  63. package/lib/chunk-NLNLOORO.js +0 -3
  64. package/lib/chunk-NLNLOORO.js.map +0 -1
  65. package/lib/chunk-NRVSYA3B.js +0 -3
  66. package/lib/chunk-UXGHKVAC.js +0 -6
  67. package/lib/chunk-VJVZRE4N.js +0 -6
  68. package/lib/chunk-WE2XH6H5.js +0 -499
  69. package/lib/chunk-WKFPJMXF.js +0 -7
  70. /package/lib/{chunk-DWDJMSCJ.js.map → chunk-5F7WBLI4.js.map} +0 -0
  71. /package/lib/{chunk-AEDJCR64.js.map → chunk-B3F4WQRS.js.map} +0 -0
  72. /package/lib/{chunk-E4QNFY3U.js.map → chunk-LBW4DXQE.js.map} +0 -0
  73. /package/lib/{chunk-LQC7CDVY.js.map → chunk-LWWZWZ4F.js.map} +0 -0
  74. /package/lib/{chunk-5HKPVFEF.js.map → chunk-QP5BWTK3.js.map} +0 -0
@@ -1,3 +1,3 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{$ as L,A as k,Aa as ka,B as l,Ba as la,C as m,Ca as ma,D as n,Da as na,E as o,Ea as oa,F as p,Fa as pa,G as q,Ga as qa,H as r,Ha as ra,I as s,Ia as sa,J as t,Ja as ta,K as u,Ka as ua,L as v,La as va,M as w,Ma as wa,N as x,Na as xa,O as y,Oa as ya,P as z,Pa as za,Q as A,Qa as Aa,R as B,Ra as Ba,S as C,Sa as Ca,T as D,Ta as Da,U as E,Ua as Ea,V as F,Va as Fa,W as G,Wa as Ga,X as H,Xa as Ha,Y as I,Z as J,_ as K,aa as M,ba as N,ca as O,da as P,ea as Q,fa as R,ga as S,ha as T,ia as U,ja as V,ka as W,la as X,ma as Y,na as Z,oa as _,pa as $,q as a,qa as aa,r as b,ra as ba,s as c,sa as ca,t as d,ta as da,u as e,ua as ea,v as f,va as fa,w as g,wa as ga,x as h,xa as ha,y as i,ya as ia,z as j,za as ja}from"../../chunk-WE2XH6H5.js";import"../../chunk-4JXRK4YH.js";import"../../chunk-TSEQGMTN.js";import"../../chunk-J7Z2TKQE.js";import"../../chunk-VJVZRE4N.js";import"../../chunk-GXO7DCHZ.js";import"../../chunk-6NEMCBBH.js";import"../../chunk-4XU3L3GP.js";import"../../chunk-DS2LOABN.js";import"../../chunk-ZBVXDY4B.js";import"../../chunk-NAIXLTAG.js";import"../../chunk-SUCYR7EB.js";import"../../chunk-NLNLOORO.js";import"../../chunk-LZ2L3BVP.js";import"../../chunk-RA75ESSD.js";import"../../chunk-G5BIPHMS.js";export{p as account,a as acl,B as aggregator,ra as aggregator_factory,S as aggregator_v2,b as any$,T as aptos_account,C as aptos_coin,ha as aptos_governance,D as big_vector,E as bit_vector,h as block,u as bls12381,ia as bls12381_algebra,U as bn254_algebra,F as capability,v as chain_id,L as chain_status,d as code,e as coin,G as comparator,V as config_buffer,ja as consensus_config,M as copyable_any,aa as crypto_algebra,da as delegation_pool,Ga as dispatchable_fungible_asset,c as dkg,q as ed25519,i as event,ka as execution_config,w as features,W as fixed_point32,X as fixed_point64,Y as function_info,ba as fungible_asset,N as gas_schedule,r as genesis,sa as governance_proposal,f as guid,va as jwk_consensus_config,g as jwks,ea as keyless_account,Ha as loadAllTypes,O as managed_coin,Z as multi_ed25519,la as multisig_account,l as object$,za as object_code_deployment,m as option,ta as optional_aggregator,x as pool_u64,ma as pool_u64_unbound,Aa as primary_fungible_store,H as randomness,Ca as randomness_api_v0_config,pa as randomness_config,Da as randomness_config_seqnum,fa as reconfiguration,xa as reconfiguration_state,na as resource_account,P as ristretto255,Fa as ristretto255_bulletproofs,wa as ristretto255_elgamal,ya as ristretto255_pedersen,y as secp256k1,I as simple_map,J as smart_table,Q as smart_vector,j as stake,ca as staking_config,oa as staking_contract,_ as staking_proxy,$ as state_storage,K as storage_gas,n as string$,R as string_utils,k as table,qa as table_with_length,z as timestamp,ua as transaction_context,ga as transaction_fee,Ba as transaction_validation,A as type_info,Ea as validator_consensus_info,s as version,t as vesting,o as voting};
2
+ import{$ as L,A as k,Aa as ka,B as l,Ba as la,C as m,Ca as ma,D as n,Da as na,E as o,Ea as oa,F as p,Fa as pa,G as q,Ga as qa,H as r,Ha as ra,I as s,Ia as sa,J as t,Ja as ta,K as u,Ka as ua,L as v,La as va,M as w,Ma as wa,N as x,Na as xa,O as y,Oa as ya,P as z,Pa as za,Q as A,Qa as Aa,R as B,Ra as Ba,S as C,Sa as Ca,T as D,Ta as Da,U as E,Ua as Ea,V as F,Va as Fa,W as G,Wa as Ga,X as H,Xa as Ha,Y as I,Z as J,_ as K,aa as M,ba as N,ca as O,da as P,ea as Q,fa as R,ga as S,ha as T,ia as U,ja as V,ka as W,la as X,ma as Y,na as Z,oa as _,pa as $,q as a,qa as aa,r as b,ra as ba,s as c,sa as ca,t as d,ta as da,u as e,ua as ea,v as f,va as fa,w as g,wa as ga,x as h,xa as ha,y as i,ya as ia,z as j,za as ja}from"../../chunk-WO6IV4SO.js";import"../../chunk-4JXRK4YH.js";import"../../chunk-TSEQGMTN.js";import"../../chunk-J7Z2TKQE.js";import"../../chunk-MPOOAJHZ.js";import"../../chunk-6CDEUHBK.js";import"../../chunk-OZNKQEYB.js";import"../../chunk-AVNDNZMN.js";import"../../chunk-DS2LOABN.js";import"../../chunk-ZBVXDY4B.js";import"../../chunk-NAIXLTAG.js";import"../../chunk-SUCYR7EB.js";import"../../chunk-LZ2L3BVP.js";import"../../chunk-RA75ESSD.js";import"../../chunk-G5BIPHMS.js";export{p as account,a as acl,B as aggregator,ra as aggregator_factory,S as aggregator_v2,b as any$,T as aptos_account,C as aptos_coin,ha as aptos_governance,D as big_vector,E as bit_vector,h as block,u as bls12381,ia as bls12381_algebra,U as bn254_algebra,F as capability,v as chain_id,L as chain_status,d as code,e as coin,G as comparator,V as config_buffer,ja as consensus_config,M as copyable_any,aa as crypto_algebra,da as delegation_pool,Ga as dispatchable_fungible_asset,c as dkg,q as ed25519,i as event,ka as execution_config,w as features,W as fixed_point32,X as fixed_point64,Y as function_info,ba as fungible_asset,N as gas_schedule,r as genesis,sa as governance_proposal,f as guid,va as jwk_consensus_config,g as jwks,ea as keyless_account,Ha as loadAllTypes,O as managed_coin,Z as multi_ed25519,la as multisig_account,l as object$,za as object_code_deployment,m as option,ta as optional_aggregator,x as pool_u64,ma as pool_u64_unbound,Aa as primary_fungible_store,H as randomness,Ca as randomness_api_v0_config,pa as randomness_config,Da as randomness_config_seqnum,fa as reconfiguration,xa as reconfiguration_state,na as resource_account,P as ristretto255,Fa as ristretto255_bulletproofs,wa as ristretto255_elgamal,ya as ristretto255_pedersen,y as secp256k1,I as simple_map,J as smart_table,Q as smart_vector,j as stake,ca as staking_config,oa as staking_contract,_ as staking_proxy,$ as state_storage,K as storage_gas,n as string$,R as string_utils,k as table,qa as table_with_length,z as timestamp,ua as transaction_context,ga as transaction_fee,Ba as transaction_validation,A as type_info,Ea as validator_consensus_info,s as version,t as vesting,o as voting};
3
3
  //# sourceMappingURL=0x1.js.map
@@ -1,3 +1,3 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{a,b,c,d,e,f}from"../../chunk-AEDJCR64.js";import"../../chunk-WE2XH6H5.js";import"../../chunk-4JXRK4YH.js";import"../../chunk-TSEQGMTN.js";import"../../chunk-J7Z2TKQE.js";import"../../chunk-VJVZRE4N.js";import"../../chunk-GXO7DCHZ.js";import"../../chunk-6NEMCBBH.js";import"../../chunk-4XU3L3GP.js";import"../../chunk-DS2LOABN.js";import"../../chunk-ZBVXDY4B.js";import"../../chunk-NAIXLTAG.js";import"../../chunk-SUCYR7EB.js";import"../../chunk-NLNLOORO.js";import"../../chunk-LZ2L3BVP.js";import"../../chunk-RA75ESSD.js";import"../../chunk-G5BIPHMS.js";export{f as loadAllTypes,b as property_map,a as token,c as token_coin_swap,e as token_event_store,d as token_transfers};
2
+ import{a,b,c,d,e,f}from"../../chunk-B3F4WQRS.js";import"../../chunk-WO6IV4SO.js";import"../../chunk-4JXRK4YH.js";import"../../chunk-TSEQGMTN.js";import"../../chunk-J7Z2TKQE.js";import"../../chunk-MPOOAJHZ.js";import"../../chunk-6CDEUHBK.js";import"../../chunk-OZNKQEYB.js";import"../../chunk-AVNDNZMN.js";import"../../chunk-DS2LOABN.js";import"../../chunk-ZBVXDY4B.js";import"../../chunk-NAIXLTAG.js";import"../../chunk-SUCYR7EB.js";import"../../chunk-LZ2L3BVP.js";import"../../chunk-RA75ESSD.js";import"../../chunk-G5BIPHMS.js";export{f as loadAllTypes,b as property_map,a as token,c as token_coin_swap,e as token_event_store,d as token_transfers};
3
3
  //# sourceMappingURL=0x3.js.map
@@ -1,3 +1,3 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{a,b,c,d,e,f}from"../../chunk-5HKPVFEF.js";import"../../chunk-WE2XH6H5.js";import"../../chunk-4JXRK4YH.js";import"../../chunk-TSEQGMTN.js";import"../../chunk-J7Z2TKQE.js";import"../../chunk-VJVZRE4N.js";import"../../chunk-GXO7DCHZ.js";import"../../chunk-6NEMCBBH.js";import"../../chunk-4XU3L3GP.js";import"../../chunk-DS2LOABN.js";import"../../chunk-ZBVXDY4B.js";import"../../chunk-NAIXLTAG.js";import"../../chunk-SUCYR7EB.js";import"../../chunk-NLNLOORO.js";import"../../chunk-LZ2L3BVP.js";import"../../chunk-RA75ESSD.js";import"../../chunk-G5BIPHMS.js";export{d as aptos_token,c as collection,f as loadAllTypes,e as property_map,b as royalty,a as token};
2
+ import{a,b,c,d,e,f}from"../../chunk-QP5BWTK3.js";import"../../chunk-WO6IV4SO.js";import"../../chunk-4JXRK4YH.js";import"../../chunk-TSEQGMTN.js";import"../../chunk-J7Z2TKQE.js";import"../../chunk-MPOOAJHZ.js";import"../../chunk-6CDEUHBK.js";import"../../chunk-OZNKQEYB.js";import"../../chunk-AVNDNZMN.js";import"../../chunk-DS2LOABN.js";import"../../chunk-ZBVXDY4B.js";import"../../chunk-NAIXLTAG.js";import"../../chunk-SUCYR7EB.js";import"../../chunk-LZ2L3BVP.js";import"../../chunk-RA75ESSD.js";import"../../chunk-G5BIPHMS.js";export{d as aptos_token,c as collection,f as loadAllTypes,e as property_map,b as royalty,a as token};
3
3
  //# sourceMappingURL=0x4.js.map
@@ -1,3 +1,3 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{g as t}from"../../chunk-AEDJCR64.js";import{g as x}from"../../chunk-5HKPVFEF.js";import{Ya as r}from"../../chunk-WE2XH6H5.js";import"../../chunk-4JXRK4YH.js";import"../../chunk-TSEQGMTN.js";import"../../chunk-J7Z2TKQE.js";import"../../chunk-VJVZRE4N.js";import"../../chunk-GXO7DCHZ.js";import"../../chunk-6NEMCBBH.js";import"../../chunk-4XU3L3GP.js";import"../../chunk-DS2LOABN.js";import"../../chunk-ZBVXDY4B.js";import"../../chunk-NAIXLTAG.js";import"../../chunk-SUCYR7EB.js";import"../../chunk-NLNLOORO.js";import"../../chunk-LZ2L3BVP.js";import"../../chunk-RA75ESSD.js";import"../../chunk-G5BIPHMS.js";import("node:process").then(o=>o.stdout.write(""));export{r as _0x1,t as _0x3,x as _0x4};
2
+ import{g as t}from"../../chunk-B3F4WQRS.js";import{g as x}from"../../chunk-QP5BWTK3.js";import{Ya as r}from"../../chunk-WO6IV4SO.js";import"../../chunk-4JXRK4YH.js";import"../../chunk-TSEQGMTN.js";import"../../chunk-J7Z2TKQE.js";import"../../chunk-MPOOAJHZ.js";import"../../chunk-6CDEUHBK.js";import"../../chunk-OZNKQEYB.js";import"../../chunk-AVNDNZMN.js";import"../../chunk-DS2LOABN.js";import"../../chunk-ZBVXDY4B.js";import"../../chunk-NAIXLTAG.js";import"../../chunk-SUCYR7EB.js";import"../../chunk-LZ2L3BVP.js";import"../../chunk-RA75ESSD.js";import"../../chunk-G5BIPHMS.js";import("node:process").then(o=>o.stdout.write(""));export{r as _0x1,t as _0x3,x as _0x4};
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/aptos/builtin/index.ts"],"sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nexport * as _0x1 from './0x1.js'\nexport * as _0x3 from './0x3.js'\nexport * as _0x4 from './0x4.js'\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";qmBAMC,OAAO,cAAc,EAAE,KAAMA,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC","names":["p"]}
1
+ {"version":3,"sources":["../../../src/aptos/builtin/index.ts"],"sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nexport * as _0x1 from './0x1.js'\nexport * as _0x3 from './0x3.js'\nexport * as _0x4 from './0x4.js'\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";qkBAMC,OAAO,cAAc,EAAE,KAAMA,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC","names":["p"]}
@@ -1,3 +1,3 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{a as p,b as g}from"../../chunk-LVWOFGF2.js";import{$a as w,Za as l,_a as a,ab as u,bb as y,cb as d,f as c}from"../../chunk-WE2XH6H5.js";import"../../chunk-4JXRK4YH.js";import"../../chunk-TSEQGMTN.js";import"../../chunk-J7Z2TKQE.js";import"../../chunk-VJVZRE4N.js";import"../../chunk-GXO7DCHZ.js";import"../../chunk-6NEMCBBH.js";import"../../chunk-4XU3L3GP.js";import"../../chunk-DS2LOABN.js";import"../../chunk-ZBVXDY4B.js";import"../../chunk-NAIXLTAG.js";import"../../chunk-SUCYR7EB.js";import"../../chunk-NLNLOORO.js";import"../../chunk-LZ2L3BVP.js";import"../../chunk-RA75ESSD.js";import{a as r}from"../../chunk-G5BIPHMS.js";var s=class{static{r(this,"CoinList")}calculateValueInUsd(t,i,n,o=c.MAIN_NET){return d(t,i,n,o)}async getCoinInfo(t){return u(t)}whiteListed(t){return a().has(t)}whitelistCoins(){return a()}},m=new s,f=class extends p{static{r(this,"AptosDex")}coinList=new s};async function E(e,t,i,n,o){return g(m,e,t,i,n,o)}r(E,"getPairValue");import("node:process").then(e=>e.stdout.write(""));function h(e,t,i){if(!t.changes)throw Error("No resource change found, did you forget set fetchOption to { resourceChanges: true } ");for(let n of t.changes){if(n.type!=="write_resource")continue;let o=n;if(o.address===e.guid.account_address&&o.data.type===`0x1::coin::CoinStore<${i}>`)return{value:BigInt(o.data.data.coin.value)}}}r(h,"findNewCoinBalances");import("node:process").then(e=>e.stdout.write(""));import("node:process").then(e=>e.stdout.write(""));export{m as AptosCoinList,f as AptosDex,s as CoinList,h as findNewCoinBalances,E as getPairValue,y as getPriceForToken,u as getTokenInfoWithFallback,l as initTokenList,w as isWhiteListToken,d as tokenTokenValueInUsd,a as whitelistTokens};
2
+ import{a as p,b as g}from"../../chunk-LVWOFGF2.js";import{$a as w,Za as l,_a as a,ab as u,bb as y,cb as d,f as c}from"../../chunk-WO6IV4SO.js";import"../../chunk-4JXRK4YH.js";import"../../chunk-TSEQGMTN.js";import"../../chunk-J7Z2TKQE.js";import"../../chunk-MPOOAJHZ.js";import"../../chunk-6CDEUHBK.js";import"../../chunk-OZNKQEYB.js";import"../../chunk-AVNDNZMN.js";import"../../chunk-DS2LOABN.js";import"../../chunk-ZBVXDY4B.js";import"../../chunk-NAIXLTAG.js";import"../../chunk-SUCYR7EB.js";import"../../chunk-LZ2L3BVP.js";import"../../chunk-RA75ESSD.js";import{a as r}from"../../chunk-G5BIPHMS.js";var s=class{static{r(this,"CoinList")}calculateValueInUsd(t,i,n,o=c.MAIN_NET){return d(t,i,n,o)}async getCoinInfo(t){return u(t)}whiteListed(t){return a().has(t)}whitelistCoins(){return a()}},m=new s,f=class extends p{static{r(this,"AptosDex")}coinList=new s};async function E(e,t,i,n,o){return g(m,e,t,i,n,o)}r(E,"getPairValue");import("node:process").then(e=>e.stdout.write(""));function h(e,t,i){if(!t.changes)throw Error("No resource change found, did you forget set fetchOption to { resourceChanges: true } ");for(let n of t.changes){if(n.type!=="write_resource")continue;let o=n;if(o.address===e.guid.account_address&&o.data.type===`0x1::coin::CoinStore<${i}>`)return{value:BigInt(o.data.data.coin.value)}}}r(h,"findNewCoinBalances");import("node:process").then(e=>e.stdout.write(""));import("node:process").then(e=>e.stdout.write(""));export{m as AptosCoinList,f as AptosDex,s as CoinList,h as findNewCoinBalances,E as getPairValue,y as getPriceForToken,u as getTokenInfoWithFallback,l as initTokenList,w as isWhiteListToken,d as tokenTokenValueInUsd,a as whitelistTokens};
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/aptos/ext/aptos-dex.ts","../../../src/aptos/ext/coin-event.ts","../../../src/aptos/ext/index.ts"],"sourcesContent":["import { BigDecimal } from '@sentio/bigdecimal'\nimport { AptosResourcesContext, AptosContext, AptosNetwork } from '../index.js'\nimport { MoveCoinList, MoveDex, moveGetPairValue, MovePoolAdaptor } from '../../move/ext/index.js'\nimport { MoveResource, Event, MoveModuleBytecode } from '@aptos-labs/ts-sdk'\nimport { getTokenInfoWithFallback, TokenInfo, tokenTokenValueInUsd, whitelistTokens } from './token.js'\n\nexport type PoolAdaptor<T> = MovePoolAdaptor<MoveResource, T>\n\nexport class CoinList implements MoveCoinList<TokenInfo, AptosNetwork> {\n calculateValueInUsd(\n amount: bigint,\n coinInfo: TokenInfo,\n timestamp: number,\n network: AptosNetwork = AptosNetwork.MAIN_NET\n ): Promise<BigDecimal> {\n return tokenTokenValueInUsd(amount, coinInfo, timestamp, network)\n }\n\n async getCoinInfo(type: string) {\n return getTokenInfoWithFallback(type)\n }\n\n whiteListed(type: string): boolean {\n return whitelistTokens().has(type)\n }\n\n whitelistCoins() {\n return whitelistTokens()\n }\n}\n\nexport const AptosCoinList = new CoinList()\n\nexport class AptosDex<T> extends MoveDex<\n TokenInfo,\n AptosNetwork,\n MoveModuleBytecode,\n MoveResource,\n Event,\n AptosContext,\n AptosResourcesContext,\n T\n> {\n coinList = new CoinList()\n declare poolAdaptor: PoolAdaptor<T>\n}\n\nexport async function getPairValue(\n ctx: AptosContext,\n coinx: string,\n coiny: string,\n coinXAmount: bigint,\n coinYAmount: bigint\n): Promise<BigDecimal> {\n return moveGetPairValue(AptosCoinList, ctx, coinx, coiny, coinXAmount, coinYAmount)\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","import { Event, UserTransactionResponse, WriteSetChangeWriteResource } from '@aptos-labs/ts-sdk'\nimport { coin } from '../builtin/0x1.js'\nimport { parseMoveType } from '../../move/index.js'\n\nexport function findNewCoinBalances(evt: Event, tx: UserTransactionResponse, coin: string): coin.Coin<any> | undefined {\n if (!tx.changes) {\n throw Error('No resource change found, did you forget set fetchOption to { resourceChanges: true } ')\n }\n for (const change of tx.changes) {\n if (change.type !== 'write_resource') {\n continue\n }\n const writeResource = change as WriteSetChangeWriteResource\n if (writeResource.address !== evt.guid.account_address) {\n continue\n }\n if (writeResource.data.type !== `0x1::coin::CoinStore<${coin}>`) {\n continue\n }\n return {\n value: BigInt((writeResource.data.data as any).coin.value)\n }\n }\n return undefined\n}\n\ninterface EventHandlerState {\n counter: string\n guid: {\n id: {\n addr: string\n creation_num: string\n }\n }\n}\n\n// TODO event handler name could be auto located from ABI\nfunction findResourceChangeType(evt: Event, tx: UserTransactionResponse, eventHandlerName: string) {\n if (!tx.changes) {\n throw Error('No resource change found, did you forget set fetchOption to { resourceChanges: true } ')\n }\n\n for (const change of tx.changes) {\n if (change.type !== 'write_resource') {\n continue\n }\n\n const writeResource = change as WriteSetChangeWriteResource\n if (writeResource.address !== evt.guid.account_address) {\n continue\n }\n\n const state: EventHandlerState = (writeResource.data.data as any)[eventHandlerName]\n\n if (\n BigInt(state.counter) === BigInt(evt.sequence_number) + 1n &&\n state.guid.id.addr === evt.guid.account_address &&\n state.guid.id.creation_num === evt.guid.creation_number\n ) {\n return writeResource.data.type\n }\n }\n\n const errStr = `Can't find matched resource change type: ${JSON.stringify(evt.data)} ${\n tx.version\n } ${eventHandlerName}`\n throw Error(errStr)\n}\n\nexport function getDepositCoinType(evt: Event, tx: UserTransactionResponse) {\n const coinStore = findResourceChangeType(evt, tx, 'deposit_events')\n return parseMoveType(coinStore).typeArgs[0].getSignature()\n}\n\nexport function getWithDrawCoinType(evt: Event, tx: UserTransactionResponse) {\n const coinStore = findResourceChangeType(evt, tx, 'withdraw_events')\n return parseMoveType(coinStore).typeArgs[0].getSignature()\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export * from './aptos-dex.js'\nexport * from './token.js'\nexport { findNewCoinBalances } from './coin-event.js'\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";2nBAQO,IAAMA,EAAN,KAAgE,CARvE,MAQuE,CAAAC,EAAA,iBACrE,oBACEC,EACAC,EACAC,EACAC,EAAwBC,EAAa,SAChB,CACrB,OAAOC,EAAqBL,EAAQC,EAAUC,EAAWC,CAAO,CAClE,CAEA,MAAM,YAAYG,EAAc,CAC9B,OAAOC,EAAyBD,CAAI,CACtC,CAEA,YAAYA,EAAuB,CACjC,OAAOE,EAAgB,EAAE,IAAIF,CAAI,CACnC,CAEA,gBAAiB,CACf,OAAOE,EAAgB,CACzB,CACF,EAEaC,EAAgB,IAAIX,EAEpBY,EAAN,cAA0BC,CAS/B,CA1CF,MA0CE,CAAAZ,EAAA,iBACA,SAAW,IAAID,CAEjB,EAEA,eAAsBc,EACpBC,EACAC,EACAC,EACAC,EACAC,EACqB,CACrB,OAAOC,EAAiBT,EAAeI,EAAKC,EAAOC,EAAOC,EAAaC,CAAW,CACpF,CARsBlB,EAAAa,EAAA,gBASrB,OAAO,cAAc,EAAE,KAAMO,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC,ECpD/C,SAASC,EAAoBC,EAAYC,EAA6BC,EAA0C,CACrH,GAAI,CAACD,EAAG,QACN,MAAM,MAAM,yFAAyF,EAEvG,QAAWE,KAAUF,EAAG,QAAS,CAC/B,GAAIE,EAAO,OAAS,iBAClB,SAEF,IAAMC,EAAgBD,EACtB,GAAIC,EAAc,UAAYJ,EAAI,KAAK,iBAGnCI,EAAc,KAAK,OAAS,wBAAwBF,CAAI,IAG5D,MAAO,CACL,MAAO,OAAQE,EAAc,KAAK,KAAa,KAAK,KAAK,CAC3D,CACF,CAEF,CApBgBC,EAAAN,EAAA,uBA0Ef,OAAO,cAAc,EAAE,KAAMO,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC,EC3ErD,OAAO,cAAc,EAAE,KAAMC,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC","names":["CoinList","__name","amount","coinInfo","timestamp","network","AptosNetwork","tokenTokenValueInUsd","type","getTokenInfoWithFallback","whitelistTokens","AptosCoinList","AptosDex","MoveDex","getPairValue","ctx","coinx","coiny","coinXAmount","coinYAmount","moveGetPairValue","p","findNewCoinBalances","evt","tx","coin","change","writeResource","__name","p","p"]}
1
+ {"version":3,"sources":["../../../src/aptos/ext/aptos-dex.ts","../../../src/aptos/ext/coin-event.ts","../../../src/aptos/ext/index.ts"],"sourcesContent":["import { BigDecimal } from '@sentio/bigdecimal'\nimport { AptosResourcesContext, AptosContext, AptosNetwork } from '../index.js'\nimport { MoveCoinList, MoveDex, moveGetPairValue, MovePoolAdaptor } from '../../move/ext/index.js'\nimport { MoveResource, Event, MoveModuleBytecode } from '@aptos-labs/ts-sdk'\nimport { getTokenInfoWithFallback, TokenInfo, tokenTokenValueInUsd, whitelistTokens } from './token.js'\n\nexport type PoolAdaptor<T> = MovePoolAdaptor<MoveResource, T>\n\nexport class CoinList implements MoveCoinList<TokenInfo, AptosNetwork> {\n calculateValueInUsd(\n amount: bigint,\n coinInfo: TokenInfo,\n timestamp: number,\n network: AptosNetwork = AptosNetwork.MAIN_NET\n ): Promise<BigDecimal> {\n return tokenTokenValueInUsd(amount, coinInfo, timestamp, network)\n }\n\n async getCoinInfo(type: string) {\n return getTokenInfoWithFallback(type)\n }\n\n whiteListed(type: string): boolean {\n return whitelistTokens().has(type)\n }\n\n whitelistCoins() {\n return whitelistTokens()\n }\n}\n\nexport const AptosCoinList = new CoinList()\n\nexport class AptosDex<T> extends MoveDex<\n TokenInfo,\n AptosNetwork,\n MoveModuleBytecode,\n MoveResource,\n Event,\n AptosContext,\n AptosResourcesContext,\n T\n> {\n coinList = new CoinList()\n declare poolAdaptor: PoolAdaptor<T>\n}\n\nexport async function getPairValue(\n ctx: AptosContext,\n coinx: string,\n coiny: string,\n coinXAmount: bigint,\n coinYAmount: bigint\n): Promise<BigDecimal> {\n return moveGetPairValue(AptosCoinList, ctx, coinx, coiny, coinXAmount, coinYAmount)\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","import { Event, UserTransactionResponse, WriteSetChangeWriteResource } from '@aptos-labs/ts-sdk'\nimport { coin } from '../builtin/0x1.js'\nimport { parseMoveType } from '../../move/index.js'\n\nexport function findNewCoinBalances(evt: Event, tx: UserTransactionResponse, coin: string): coin.Coin<any> | undefined {\n if (!tx.changes) {\n throw Error('No resource change found, did you forget set fetchOption to { resourceChanges: true } ')\n }\n for (const change of tx.changes) {\n if (change.type !== 'write_resource') {\n continue\n }\n const writeResource = change as WriteSetChangeWriteResource\n if (writeResource.address !== evt.guid.account_address) {\n continue\n }\n if (writeResource.data.type !== `0x1::coin::CoinStore<${coin}>`) {\n continue\n }\n return {\n value: BigInt((writeResource.data.data as any).coin.value)\n }\n }\n return undefined\n}\n\ninterface EventHandlerState {\n counter: string\n guid: {\n id: {\n addr: string\n creation_num: string\n }\n }\n}\n\n// TODO event handler name could be auto located from ABI\nfunction findResourceChangeType(evt: Event, tx: UserTransactionResponse, eventHandlerName: string) {\n if (!tx.changes) {\n throw Error('No resource change found, did you forget set fetchOption to { resourceChanges: true } ')\n }\n\n for (const change of tx.changes) {\n if (change.type !== 'write_resource') {\n continue\n }\n\n const writeResource = change as WriteSetChangeWriteResource\n if (writeResource.address !== evt.guid.account_address) {\n continue\n }\n\n const state: EventHandlerState = (writeResource.data.data as any)[eventHandlerName]\n\n if (\n BigInt(state.counter) === BigInt(evt.sequence_number) + 1n &&\n state.guid.id.addr === evt.guid.account_address &&\n state.guid.id.creation_num === evt.guid.creation_number\n ) {\n return writeResource.data.type\n }\n }\n\n const errStr = `Can't find matched resource change type: ${JSON.stringify(evt.data)} ${\n tx.version\n } ${eventHandlerName}`\n throw Error(errStr)\n}\n\nexport function getDepositCoinType(evt: Event, tx: UserTransactionResponse) {\n const coinStore = findResourceChangeType(evt, tx, 'deposit_events')\n return parseMoveType(coinStore).typeArgs[0].getSignature()\n}\n\nexport function getWithDrawCoinType(evt: Event, tx: UserTransactionResponse) {\n const coinStore = findResourceChangeType(evt, tx, 'withdraw_events')\n return parseMoveType(coinStore).typeArgs[0].getSignature()\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export * from './aptos-dex.js'\nexport * from './token.js'\nexport { findNewCoinBalances } from './coin-event.js'\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";2lBAQO,IAAMA,EAAN,KAAgE,CARvE,MAQuE,CAAAC,EAAA,iBACrE,oBACEC,EACAC,EACAC,EACAC,EAAwBC,EAAa,SAChB,CACrB,OAAOC,EAAqBL,EAAQC,EAAUC,EAAWC,CAAO,CAClE,CAEA,MAAM,YAAYG,EAAc,CAC9B,OAAOC,EAAyBD,CAAI,CACtC,CAEA,YAAYA,EAAuB,CACjC,OAAOE,EAAgB,EAAE,IAAIF,CAAI,CACnC,CAEA,gBAAiB,CACf,OAAOE,EAAgB,CACzB,CACF,EAEaC,EAAgB,IAAIX,EAEpBY,EAAN,cAA0BC,CAS/B,CA1CF,MA0CE,CAAAZ,EAAA,iBACA,SAAW,IAAID,CAEjB,EAEA,eAAsBc,EACpBC,EACAC,EACAC,EACAC,EACAC,EACqB,CACrB,OAAOC,EAAiBT,EAAeI,EAAKC,EAAOC,EAAOC,EAAaC,CAAW,CACpF,CARsBlB,EAAAa,EAAA,gBASrB,OAAO,cAAc,EAAE,KAAMO,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC,ECpD/C,SAASC,EAAoBC,EAAYC,EAA6BC,EAA0C,CACrH,GAAI,CAACD,EAAG,QACN,MAAM,MAAM,yFAAyF,EAEvG,QAAWE,KAAUF,EAAG,QAAS,CAC/B,GAAIE,EAAO,OAAS,iBAClB,SAEF,IAAMC,EAAgBD,EACtB,GAAIC,EAAc,UAAYJ,EAAI,KAAK,iBAGnCI,EAAc,KAAK,OAAS,wBAAwBF,CAAI,IAG5D,MAAO,CACL,MAAO,OAAQE,EAAc,KAAK,KAAa,KAAK,KAAK,CAC3D,CACF,CAEF,CApBgBC,EAAAN,EAAA,uBA0Ef,OAAO,cAAc,EAAE,KAAMO,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC,EC3ErD,OAAO,cAAc,EAAE,KAAMC,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC","names":["CoinList","__name","amount","coinInfo","timestamp","network","AptosNetwork","tokenTokenValueInUsd","type","getTokenInfoWithFallback","whitelistTokens","AptosCoinList","AptosDex","MoveDex","getPairValue","ctx","coinx","coiny","coinXAmount","coinYAmount","moveGetPairValue","p","findNewCoinBalances","evt","tx","coin","change","writeResource","__name","p","p"]}
@@ -1,3 +1,3 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{a as b,b as c,c as d,d as e,db as r,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p,p as q}from"../chunk-WE2XH6H5.js";import"../chunk-4JXRK4YH.js";import"../chunk-TSEQGMTN.js";import"../chunk-J7Z2TKQE.js";import"../chunk-VJVZRE4N.js";import"../chunk-GXO7DCHZ.js";import"../chunk-6NEMCBBH.js";import"../chunk-4XU3L3GP.js";import"../chunk-DS2LOABN.js";import{q as a}from"../chunk-ZBVXDY4B.js";import"../chunk-NAIXLTAG.js";import"../chunk-SUCYR7EB.js";import"../chunk-NLNLOORO.js";import"../chunk-LZ2L3BVP.js";import"../chunk-RA75ESSD.js";import"../chunk-G5BIPHMS.js";export{m as AptosBaseProcessor,i as AptosBindOptions,j as AptosContext,o as AptosGlobalProcessor,n as AptosModulesProcessor,g as AptosNetwork,r as AptosPlugin,q as AptosResourceProcessorTemplate,k as AptosResourcesContext,p as AptosResourcesProcessor,l as AptosTransactionProcessor,a as BUILTIN_TYPES,b as MoveCoder,h as MovementNetwork,e as RichAptosClient,f as RichAptosClientWithContext,c as defaultMoveCoder,d as defaultMoveCoderForClient};
2
+ import{a as b,b as c,c as d,d as e,db as r,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p,p as q}from"../chunk-WO6IV4SO.js";import"../chunk-4JXRK4YH.js";import"../chunk-TSEQGMTN.js";import"../chunk-J7Z2TKQE.js";import"../chunk-MPOOAJHZ.js";import"../chunk-6CDEUHBK.js";import"../chunk-OZNKQEYB.js";import"../chunk-AVNDNZMN.js";import"../chunk-DS2LOABN.js";import{q as a}from"../chunk-ZBVXDY4B.js";import"../chunk-NAIXLTAG.js";import"../chunk-SUCYR7EB.js";import"../chunk-LZ2L3BVP.js";import"../chunk-RA75ESSD.js";import"../chunk-G5BIPHMS.js";export{m as AptosBaseProcessor,i as AptosBindOptions,j as AptosContext,o as AptosGlobalProcessor,n as AptosModulesProcessor,g as AptosNetwork,r as AptosPlugin,q as AptosResourceProcessorTemplate,k as AptosResourcesContext,p as AptosResourcesProcessor,l as AptosTransactionProcessor,a as BUILTIN_TYPES,b as MoveCoder,h as MovementNetwork,e as RichAptosClient,f as RichAptosClientWithContext,c as defaultMoveCoder,d as defaultMoveCoderForClient};
3
3
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
+ import{a as ve,b as je,c as F,e as xe,f as m,g as P,i as Ne}from"./chunk-GTB5ZIMY.js";import{a as f,b as M}from"./chunk-DS2LOABN.js";import{D as ce,E as ye,a as T,d as Q,f as B,i as we,m as v,n as ie,o as ae,u as Te,v as Ie,w as Z}from"./chunk-ZBVXDY4B.js";import{Ca as A,D as S,Ld as W,W as Ce,Zd as K,fa as Oe,he as Y,je as w,x as N}from"./chunk-LZ2L3BVP.js";import{a,f as q}from"./chunk-G5BIPHMS.js";import{ListStateStorage as Je}from"@sentio/runtime";var p=q(K(),1);var Ze="0x0000000000000000000000000000000000000000000000000000000000000000";function h(n){return typeof n!="object"||n==null?!1:n.$kind==="GasCoin"||n.$kind==="Result"||n.$kind==="NestedResult"||n.$kind==="Input"}a(h,"isTransactionArgument");function Xe(n,e){return h(n)?n:e.object(n)}a(Xe,"transactionArgumentOrObject");function et(n,e){return h(n)?n:typeof n=="string"?e.pure.string(n):e.pure.u64(n)}a(et,"transactionArgumentOrPure");function tt(n,e){return h(n)?n:e.pure.address(n)}a(tt,"transactionArgumentOrPureAddress");function nt(n,e){return h(n)?n:e.pure.u8(n)}a(nt,"transactionArgumentOrPureU8");function rt(n,e){return h(n)?n:e.pure.u16(n)}a(rt,"transactionArgumentOrPureU16");function st(n,e){return h(n)?n:e.pure.u32(n)}a(st,"transactionArgumentOrPureU32");function ot(n,e){return h(n)?n:e.pure.u64(n)}a(ot,"transactionArgumentOrPureU64");function it(n,e){return h(n)?n:e.pure.u128(n)}a(it,"transactionArgumentOrPureU128");function at(n,e){return h(n)?n:e.pure.u256(n)}a(at,"transactionArgumentOrPureU256");function ct(n,e){return h(n)?n:e.pure.bool(n)}a(ct,"transactionArgumentOrPureBool");function ut(n,e){return h(n)?n:e.makeMoveVec({elements:n.map(t=>e.object(t))})}a(ut,"transactionArgumentOrVec");function z(n){return{address:n.address,exposedFunctions:Object.entries(n.exposedFunctions).map(([e,t])=>_e(e,t)),name:n.name,structs:Object.entries(n.structs).map(([e,t])=>Le(e,t)),enums:Object.entries(n.enums||{}).map(([e,t])=>Ve(e,t))}}a(z,"toInternalModule");function _e(n,e){let t;switch(e.visibility){case"Private":t=Z.PRIVATE;break;case"Public":t=Z.PUBLIC;break;case"Friend":t=Z.FRIEND;break;default:throw Error("No visibility for function"+n)}return{typeParams:e.typeParameters.map(r=>({constraints:r.abilities})),isEntry:e.isEntry,name:n,params:e.parameters.map(j),return:e.return.map(j),visibility:t}}a(_e,"toInternalFunction");function Le(n,e){return{abilities:e.abilities.abilities,fields:e.fields.map(Ae),typeParams:e.typeParameters.map(t=>({constraints:t.constraints.abilities})),isNative:!1,isEvent:!1,name:n}}a(Le,"toInternalStruct");function Ve(n,e){return{name:n,abilities:e.abilities.abilities,typeParams:e.typeParameters.map(t=>({constraints:t.constraints.abilities})),variants:Object.entries(e.variants).reduce((t,[r,s])=>(t[r]=s.map(Ae),t),{})}}a(Ve,"toInternalEnum");function Ae(n){return{name:n.name,type:j(n.type)}}a(Ae,"toInternalField");function j(n){if(typeof n=="string")return new v(n);if("Struct"in n){let e=[n.Struct.address,n.Struct.module,n.Struct.name].join(T),t=n.Struct.typeArguments.map(j);return new v(e,t)}if("Vector"in n)return new v("Vector",[j(n.Vector)]);if("TypeParameter"in n)return new v("T"+n.TypeParameter);if("Reference"in n){let e=j(n.Reference);return e.reference=!0,e}if("MutableReference"in n){let e=j(n.MutableReference);return e.reference=!0,e.mutable=!0,e}throw new Error("Unexpected sui type")}a(j,"toTypeDescriptor");var X=class extends Te{static{a(this,"SuiChainAdapter")}async getChainId(){return this.client.getChainIdentifier()}client;constructor(e){super(),this.client=e}async fetchModule(e,t){return await this.client.getNormalizedMoveModule({package:e,module:t})}async fetchModules(e){let t=await this.client.getNormalizedMoveModulesByPackage({package:e});return Object.values(t)}getMeaningfulFunctionParams(e){return e}toInternalModules(e){return Object.values(e).map(z)}getAllEventStructs(e){let t=new Map;for(let r of e){let s=we(r);for(let o of r.structs){let i=new Set(o.abilities);i.has("Drop")&&i.has("Copy")&&t.set(s+T+o.name,o)}}return t}getType(e){return e.type}getData(e){if(e===void 0)throw Error("val is undefined");return"parsedJson"in e?e.parsedJson:e.dataType==="moveObject"||"fields"in e&&"type"in e&&Object.keys(e).length===2?e.fields:e}};var I=class extends Ie{static{a(this,"MoveCoder")}constructor(e){super(new X(e))}load(e,t){let r=this.moduleMapping.get(e.address+"::"+e.name),s=this.moduleMapping.get(t+"::"+e.name);return r&&s||(this.accounts.add(e.address),r=z(e),this.loadInternal(r,t)),r}async decode(e,t){switch(t.qname){case"0x1::ascii::Char":if(e!==void 0&&typeof e!="string"){let s=(await super.decode(e,t)).byte;return String.fromCharCode(s)}case"0x1::ascii::String":if(e!==void 0&&typeof e!="string"){let s=(await super.decode(e,t)).bytes;return new TextDecoder().decode(new Uint8Array(s))}case"0x2::object::ID":if(e!==void 0&&typeof e!="string"){let s=(await super.decode(e,t)).bytes;return je(s)}case"0x2::url::Url":if(e!==void 0&&typeof e!="string")return(await super.decode(e,t)).url;case"0x2::coin::Coin":if(e!==void 0&&typeof e!="string"){let s=(await super.decode(e,t)).id.id.bytes;return new TextDecoder().decode(new Uint8Array(s))}return e;case"0x2::balance::Balance":return e.value?(await super.decode(e,t)).value:BigInt(e);case"0x1::option::Option":if(e===null)return e;if(e.vec){let s=await super.decode(e,t);return s=s.vec,s.length===0?null:s[0]}return this.decode(e,t.typeArgs[0]);case"Address":return ve(e);case"0x1::string::String":if(typeof e!="string")return new TextDecoder().decode(new Uint8Array(e.bytes));default:return super.decode(e,t)}}decodeEvent(e){return this.decodedStruct(e)}filterAndDecodeEvents(e,t){return typeof e=="string"&&(e=ie(e)),this.filterAndDecodeStruct(e,t)}async getDynamicFields(e,t=ae,r=ae){let s=new v("0x2::dynamic_field::Field");return s.typeArgs=[t,r],(await this.filterAndDecodeObjects(s,e)).map(i=>i.data_decoded)}filterAndDecodeObjects(e,t){return this.filterAndDecodeStruct(e,t)}async decodeFunctionPayload(e,t){let r=[e.package,e.module,e.function].join(T),s=await this.getMoveFunction(r),o=this.adapter.getMeaningfulFunctionParams(s.params),i=[];for(let c of e.arguments||[]){let d=c;if("Input"in d){let C=d.Input,O=t[C];O.type==="pure"?i.push(O.value):(O.type==="object"||console.error("unexpected function arg value"),i.push(void 0))}else i.push(void 0)}let u=await this.decodeArray(i,o,!1);return{...e,arguments_decoded:u}}bcsRegistered=new Set;bcsRegistry=new Map;async getBCSTypeWithArgs(e,t=[]){let r=e.qname,s=e.getNormalizedSignature(),o=this.bcsRegistry.get(s);if(o)return o;let i=r.toLowerCase();switch(i){case"u8":case"u16":case"u32":case"u64":case"u128":case"u256":case"bool":return F[i]();case"address":return F.Address;case"vector":return F.vector(t[0]);default:if(!r.includes("::"))throw`Unimplemented builtin type ${r}`}let u;try{u=await this.getMoveStruct(r)}catch(d){throw console.error("Invalid move address",r),d}let c={};for(let d of u.fields)if(d.type.qname.startsWith("T")&&t.length){let C=+d.type.qname.slice(1);c[d.name]=t[C]}else d.type.typeArgs.length&&t.length?c[d.name]=await this.getBCSTypeWithArgs(d.type,t):c[d.name]=await this.getBCSType(d.type);return F.struct(r,c)}async getBCSType(e){let t=await Promise.all(e.typeArgs.map(s=>this.getBCSType(s))),r=await this.getBCSTypeWithArgs(e,t);return this.bcsRegistry.set(e.getNormalizedSignature(),r),r}async registerBCSTypes(e){let t=e.getNormalizedSignature();if(this.bcsRegistered.has(t))return;this.bcsRegistered.add(t);let r=await this.getBCSType(e);this.bcsRegistry.set(e.getNormalizedSignature(),r)}async decodeBCS(e,t,r){if(await this.registerBCSTypes(e),typeof t=="string"){let o=Buffer.from(t,r);t=new Uint8Array(o,o.byteOffset,o.byteLength)}return this.bcsRegistry.get(e.getNormalizedSignature())?.parse(t)}async decodeDevInspectResult(e){let t=[];if(e.results!=null)for(let r of e.results)if(r.returnValues)for(let s of r.returnValues){let o=ie(s[1]),i=await this.decodeBCS(o,new Uint8Array(s[0])),u=await this.decodeType(i,o);t.push(u)}else t.push(null);return{...e,results_decoded:t}}},Ue="https://fullnode.mainnet.sui.io/",Me=new Map;function ke(n=Ue){let e=Me.get(n);return e||(e=new I(new xe({url:n})),Me.set(n,e)),e}a(ke,"defaultMoveCoder");var Pe=new Map,ue;async function Ge(n){let e=Pe.get(n);if(!e){e=new I(n);let t=await n.getChainIdentifier(),r=ke();ue||(ue=await r.adapter.getChainId()),t===ue&&(e=r),Pe.set(n,e)}return e}a(Ge,"getMoveCoder");var Ee=new Map;function k(n=m.MAIN_NET){let e=Ee.get(n);return e||(e=new I(P(n)),Ee.set(n,e)),e}a(k,"defaultMoveCoder");import("node:process").then(n=>n.stdout.write(""));var g=class extends ce{static{a(this,"SuiContext")}moduleName;timestamp;checkpoint;transaction;eventIndex;coder;constructor(e,t,r,s,o,i,u,c){super(c),this.address=r.toLowerCase(),this.network=t,this.moduleName=e,this.timestamp=s,this.checkpoint=o,this.eventIndex=u,this.coder=k(t),i&&(this.transaction=i)}getChainId(){return this.network}getTimestamp(){return this.timestamp.getDate()}getMetaDataInternal(e,t){return{address:this.address,contractName:this.moduleName,blockNumber:this.checkpoint,transactionIndex:0,transactionHash:this.transaction?.digest||"",logIndex:this.eventIndex,chainId:this.getChainId(),name:e,labels:W(t)}}get client(){return P(this.network)}},E=class extends ce{static{a(this,"SuiObjectChangeContext")}timestamp;checkpoint;coder;txDigest;constructor(e,t,r,s,o,i){super(i),this.address=t,this.network=e,this.timestamp=r,this.checkpoint=s,this.txDigest=o,this.coder=k(e)}getChainId(){return this.network}getTimestamp(){return this.timestamp.getDate()}getMetaDataInternal(e,t){return{address:this.address,contractName:"*",blockNumber:this.checkpoint,transactionIndex:-1,transactionHash:this.txDigest,logIndex:0,chainId:this.getChainId(),name:e,labels:W(t)}}get client(){return P(this.network)}},de=class extends ye{static{a(this,"SuiAddressContext")}address;network;checkpoint;timestamp;coder;contractName="address";constructor(e,t,r,s,o){super(o),this.address=t,this.network=e,this.checkpoint=r,this.timestamp=s,this.coder=k(e)}getChainId(){return this.network}getMetaDataInternal(e,t){return{address:this.address,contractName:this.contractName,blockNumber:this.checkpoint,transactionIndex:0,transactionHash:"",logIndex:0,chainId:this.getChainId(),name:e,labels:W(t)}}get client(){return P(this.network)}getTimestamp(){return this.timestamp.getDate()}},ee=class extends de{static{a(this,"SuiObjectContext")}contractName="object";objectId;objectVersion;constructor(e,t,r,s,o,i){super(e,t,s,o,i),this.objectId=t,this.objectVersion=r}};import("node:process").then(n=>n.stdout.write(""));function De(n){let e=n.transaction?.data.transaction;if(!e)return[];let t=e.kind==="ProgrammableTransaction"?e:void 0;return t?t.transactions.flatMap(r=>{if("MoveCall"in r){let s=r.MoveCall;return s.package=Q(s.package),[s]}return[]}):[]}a(De,"getMoveCalls");import("node:process").then(n=>n.stdout.write(""));var _={resourceChanges:!1,allEvents:!0,inputs:!0};function fe(n){return{startCheckpoint:n.startCheckpoint||0n,address:n.address===w?w:B(n.address),network:n.network||m.MAIN_NET,baseLabels:n.baseLabels}}a(fe,"configure");var L=class n extends Je{static{a(this,"SuiProcessorState")}static INSTANCE=new n},V=class{static{a(this,"SuiBaseProcessor")}moduleName;config;eventHandlers=[];callHandlers=[];objectChangeHandlers=[];coder;constructor(e,t){return this.moduleName=e,this.config=fe(t),L.INSTANCE.addValue(this),this.coder=k(this.config.network),M(this)}getChainId(){return this.config.network}onMoveEvent(e,t,r){let s=[],o=A.fromPartial({..._,...r});Array.isArray(t)?s=t:s.push(t);let i=this;return this.eventHandlers.push({handlerName:f(),handler:a(async function(u){if(!u.rawTransaction)throw new p.ServerError(p.Status.INVALID_ARGUMENT,"event is null");let c=JSON.parse(u.rawTransaction);c.events==null&&(c.events=[]);let d=JSON.parse(u.rawEvent),C=Number(d.id.eventSeq)||0,O=new g(i.moduleName,i.config.network,i.config.address,u.timestamp||new Date(0),u.slot,c,C,i.config.baseLabels),R=await i.coder.decodeEvent(d);return await e(R||d,O),O.stopAndGetResult()},"handler"),filters:s,fetchConfig:o}),this}onEntryFunctionCall(e,t,r){let s=[],o=A.fromPartial({..._,...r});Array.isArray(t)?s=t:s.push(t);let i=this,u=new Set(s.map(c=>c.function));return this.callHandlers.push({handlerName:f(),handler:a(async function(c){if(!c.rawTransaction)throw new p.ServerError(p.Status.INVALID_ARGUMENT,"call is null");let d=JSON.parse(c.rawTransaction),C=new g(i.moduleName,i.config.network,i.config.address,c.timestamp||new Date(0),c.slot,d,0,i.config.baseLabels);if(d){let O=De(d),R=d.transaction?.data?.transaction;if(!R)throw new p.ServerError(p.Status.INVALID_ARGUMENT,"Unexpected getTransactionKind get empty");let Re=R.kind==="ProgrammableTransaction"?R:void 0;for(let oe of O){let Be=[oe.module,oe.function].join(T);if(!u.has(Be))continue;let Fe=await i.coder.decodeFunctionPayload(oe,Re?.inputs||[]);await e(Fe,C)}}return C.stopAndGetResult()},"handler"),filters:s,fetchConfig:o}),this}onEvent(e,t){return this.onMoveEvent(e,{type:""},t),this}onTransactionBlock(e,t,r){let s=A.fromPartial({..._,...r}),o=this;return this.callHandlers.push({handlerName:f(),handler:a(async function(i){if(!i.rawTransaction)throw new p.ServerError(p.Status.INVALID_ARGUMENT,"transaction is null");let u=JSON.parse(i.rawTransaction),c=new g(o.moduleName,o.config.network,o.config.address,i.timestamp||new Date(0),i.slot,u,0,o.config.baseLabels);return u&&await e(u,c),c.stopAndGetResult()},"handler"),filters:[{...t,function:""}],fetchConfig:s}),this}onObjectChange(e,t){if(this.config.network===m.TEST_NET)throw new p.ServerError(p.Status.INVALID_ARGUMENT,"object change not supported in testnet");let r=this;return this.objectChangeHandlers.push({handlerName:f(),handler:a(async function(s){let o=new E(r.config.network,r.config.address,s.timestamp||new Date(0),s.slot,s.txDigest,r.config.baseLabels);return await e(s.rawChanges.map(i=>JSON.parse(i)),o),o.stopAndGetResult()},"handler"),type:t}),this}},le=class n extends V{static{a(this,"SuiModulesProcessor")}static bind(e){return new n(w,e)}},pe=class n extends V{static{a(this,"SuiGlobalProcessor")}static bind(e){return new n(w,{...e,address:w})}onTransactionBlock(e,t,r){return super.onTransactionBlock(e,t,r)}onObjectChange(e,t){return super.onObjectChange(e,t)}};import("node:process").then(n=>n.stdout.write(""));import{ListStateStorage as $e}from"@sentio/runtime";var D=q(K(),1);var me={owned:!1},y=class n extends $e{static{a(this,"SuiAccountProcessorState")}static INSTANCE=new n},te=class{static{a(this,"SuiBaseObjectOrAddressProcessor")}config;ownerType;templateId;objectHandlers=[];objectChangeHandlers=[];constructor(e){return e.ownerType===N.TYPE?this.config={startCheckpoint:e.startCheckpoint||0n,address:e.address==="*"?"*":Q(e.address),network:e.network||m.MAIN_NET,baseLabels:e.baseLabels}:this.config=fe(e),this.ownerType=e.ownerType,y.INSTANCE.addValue(this),M(this)}getChainId(){return this.config.network}onInterval(e,t,r,s,o,i=f()){let u=this;return this.objectHandlers.push({handlerName:i,handler:a(async function(c){let d=new ee(u.config.network,c.objectId,c.objectVersion,c.slot,c.timestamp||new Date(0),u.config.baseLabels);return await u.doHandle(e,c,d),d.stopAndGetResult()},"handler"),timeIntervalInMinutes:t,checkPointInterval:r,type:s,fetchConfig:{...me,...o}}),this}},U=class extends te{static{a(this,"SuiBaseObjectOrAddressProcessorInternal")}onTimeInterval(e,t=60,r=240,s,o){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,s,o)}onCheckpointInterval(e,t=1e5,r=4e5,s,o){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},s,o)}},x=class n extends U{static{a(this,"SuiAddressProcessor")}callHandlers=[];static bind(e){return new n({...e,ownerType:N.ADDRESS})}async doHandle(e,t,r){return e(t.rawObjects.map(s=>JSON.parse(s)),r)}onTransactionBlock(e,t,r){let s=A.fromPartial({..._,...r}),o={fromAndToAddress:{from:"",to:this.config.address},...t},i=this;return this.callHandlers.push({handlerName:f(),handler:a(async function(u){if(!u.rawTransaction)throw new D.ServerError(D.Status.INVALID_ARGUMENT,"transaction is null");let c=JSON.parse(u.rawTransaction),d=new g("object",i.config.network,i.config.address,u.timestamp||new Date(0),u.slot,c,0,i.config.baseLabels);return c&&await e(c,d),d.stopAndGetResult()},"handler"),filters:[{...o,function:""}],fetchConfig:s}),this}},G=class n extends U{static{a(this,"SuiObjectProcessor")}static bind(e){return new n({address:e.objectId,network:e.network,startCheckpoint:e.startCheckpoint,ownerType:N.OBJECT,baseLabels:e.baseLabels})}async doHandle(e,t,r){if(!t.rawSelf){console.log(`Sui object not existed in ${r.checkpoint}, please specific a start time`);return}return e(JSON.parse(t.rawSelf),t.rawObjects.map(s=>JSON.parse(s)),r)}},he=class n extends te{static{a(this,"SuiObjectTypeProcessor")}objectType;static bind(e){let t=new n({address:w,network:e.network,startCheckpoint:e.startCheckpoint,ownerType:N.TYPE,baseLabels:e.baseLabels});return t.objectType=e.objectType,t}async doHandle(e,t,r){if(!t.rawSelf){console.log(`Sui object not existed in ${r.checkpoint}, please specific a start time`);return}let s=await r.coder.filterAndDecodeObjects(this.objectType,[JSON.parse(t.rawSelf)]);return e(s[0],t.rawObjects.map(o=>JSON.parse(o)),r)}onObjectChange(e){if(this.config.network===m.TEST_NET)throw new D.ServerError(D.Status.INVALID_ARGUMENT,"object change not supported in testnet");let t=this;return this.objectChangeHandlers.push({handlerName:f(),handler:a(async function(r){let s=new E(t.config.network,t.config.address,r.timestamp||new Date(0),r.slot,r.txDigest,t.config.baseLabels);return await e(r.rawChanges.map(o=>JSON.parse(o)),s),s.stopAndGetResult()},"handler"),type:this.objectType.qname}),this}onTimeInterval(e,t=60,r=240,s){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,this.objectType.qname,s)}onCheckpointInterval(e,t=1e5,r=4e5,s){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},this.objectType.qname,s)}},J=class n extends U{static{a(this,"SuiWrappedObjectProcessor")}static bind(e){return new n({address:e.objectId,network:e.network,startCheckpoint:e.startCheckpoint,ownerType:N.WRAPPED_OBJECT,baseLabels:e.baseLabels})}async doHandle(e,t,r){return e(t.rawObjects.map(s=>JSON.parse(s)),r)}};import("node:process").then(n=>n.stdout.write(""));import{ListStateStorage as qe}from"@sentio/runtime";var b=q(K(),1);var H=class n extends qe{static{a(this,"SuiAccountProcessorTemplateState")}static INSTANCE=new n},$=class{static{a(this,"SuiObjectOrAddressProcessorTemplate")}id;objectHandlers=[];binds=new Set;constructor(){return this.id=H.INSTANCE.getValues().length,H.INSTANCE.addValue(this),M(this)}bind(e,t){e.network=e.network||t.network,e.startCheckpoint=e.startCheckpoint||t.checkpoint;let r=e.objectId||e.address;if(r==="*")throw new b.ServerError(b.Status.INVALID_ARGUMENT,"can't bind template instance with *");r=B(r);let s=[e.network,r].join("_");if(this.binds.has(s)){console.log(`Same object id can be bind to one template only once, ignore duplicate bind: ${s}`);return}this.binds.add(s);let o=this.createProcessor(e);for(let u of this.objectHandlers)o.onInterval(u.handler,u.timeIntervalInMinutes,u.checkpointInterval,u.type,u.fetchConfig,u.handlerName);let i=o.config;t.update({states:{configUpdated:!0}}),Y.INSTANCE.addValue({templateId:this.id,contract:{name:"",chainId:i.network,address:i.address,abi:""},startBlock:i.startCheckpoint,endBlock:0n,baseLabels:i.baseLabels}),console.log(`successfully bind template ${s}`)}unbind(e,t){e.network=e.network||t.network,e.startCheckpoint=e.startCheckpoint||t.checkpoint;let r=e.objectId||e.address;if(r==="*")throw new b.ServerError(b.Status.INVALID_ARGUMENT,"can't delete template instance bind with *");r=B(r);let s=[e.network,r].join("_");if(!this.binds.has(s)){console.log(`the template instance ${s} not existed or already unbind`);return}this.binds.delete(s);let o=0,i=Y.INSTANCE.unregister();for(let c of i){if(c.contract?.chainId===e.network&&c.contract.address==r){o++;continue}Y.INSTANCE.addValue(c)}if(o!==1)throw new b.ServerError(b.Status.INVALID_ARGUMENT,`Failed to delete template instance ${s}, deleted ${o} times`);let u=y.INSTANCE.unregister();o=0;for(let c of u){if(c.templateId===this.id&&c.config.network==e.network&&c.config.address===r){o++;continue}y.INSTANCE.addValue(c)}if(o!==1)throw new b.ServerError(b.Status.INVALID_ARGUMENT,`Failed to delete processor for template ${this.id}, ${s}. deleted ${o} times`);console.log(`successfully unbind template ${s}`),t.update({states:{configUpdated:!0}})}onInterval(e,t,r,s,o){return this.objectHandlers.push({handlerName:f(),handler:e,timeIntervalInMinutes:t,checkpointInterval:r,type:s,fetchConfig:{...me,...o}}),this}onTimeInterval(e,t=60,r=240,s,o){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,s,o)}onCheckpointInterval(e,t=1e5,r=4e5,s,o){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},s,o)}};var ge=class extends ${static{a(this,"SuiAddressProcessorTemplate")}handlers=[];createProcessor(e){let t=x.bind(e);for(let r of this.handlers)t.onTransactionBlock(r.handler,r.filter,r.fetchConfig);return t.templateId=this.id,t}onTransactionBlock(e,t,r){return this.handlers.push({handler:e,filter:t,fetchConfig:r}),this}},be=class extends ${static{a(this,"SuiObjectProcessorTemplate")}createProcessor(e){let t=G.bind(e);return t.templateId=this.id,t}},Se=class extends ${static{a(this,"SuiWrappedObjectProcessorTemplate")}createProcessor(e){let t=J.bind(e);return t.templateId=this.id,t}};import("node:process").then(n=>n.stdout.write(""));import("node:process").then(n=>n.stdout.write(""));import{errorString as ne,mergeProcessResults as re,Plugin as We,PluginManager as Ke,USER_PROCESSOR as Ye}from"@sentio/runtime";var l=q(K(),1);import{SuiChainId as He}from"@sentio/chain";var se=class extends We{static{a(this,"SuiPlugin")}name="SuiPlugin";handlers={suiCallHandlers:[],suiEventHandlers:[],suiObjectHandlers:[],suiObjectChangeHandlers:[]};async start(e){await Ne(),console.log("total instances:",e.templateInstances.length);let t=new Set(Object.values(He));for(let r of e.templateInstances){if(!t.has(r.contract?.chainId||""))continue;console.log("start template instance",r.templateId),H.INSTANCE.getValues()[r.templateId].bind({address:r.contract?.address||"",objectId:r.contract?.address||"",network:r.contract?.chainId||m.MAIN_NET,startCheckpoint:r.startBlock||0n,baseLabels:r.baseLabels},Qe)}}async configure(e){let t={suiCallHandlers:[],suiEventHandlers:[],suiObjectHandlers:[],suiObjectChangeHandlers:[]};for(let r of L.INSTANCE.getValues()){let s=Ce.fromPartial({transactionConfig:[],processorType:Ye,contract:{name:r.moduleName,chainId:r.config.network,address:r.config.address,abi:""},startBlock:r.config.startCheckpoint});for(let o of r.eventHandlers){let i=t.suiEventHandlers.push(o.handler)-1,u={filters:o.filters.map(c=>({type:c.type,account:c.account||""})),fetchConfig:o.fetchConfig,handlerId:i,handlerName:o.handlerName};s.moveEventConfigs.push(u)}for(let o of r.callHandlers){let i=t.suiCallHandlers.push(o.handler)-1,u={filters:o.filters.map(c=>({function:c.function,typeArguments:c.typeArguments||[],withTypeArguments:!!c.typeArguments,includeFailed:c.includeFailed||!1,publicKeyPrefix:c.publicKeyPrefix||"",fromAndToAddress:c.fromAndToAddress})),fetchConfig:o.fetchConfig,handlerId:i,handlerName:o.handlerName};s.moveCallConfigs.push(u)}for(let o of r.objectChangeHandlers){let i=t.suiObjectChangeHandlers.push(o.handler)-1,u={type:o.type,handlerId:i,handlerName:o.handlerName};s.moveResourceChangeConfigs.push(u)}e.contractConfigs.push(s)}for(let r of y.INSTANCE.getValues()){let s=Oe.fromPartial({address:r.config.address,chainId:r.getChainId(),startBlock:r.config.startCheckpoint});for(let o of r.objectChangeHandlers){let i=t.suiObjectChangeHandlers.push(o.handler)-1,u={type:o.type,handlerId:i,handlerName:o.handlerName};s.moveResourceChangeConfigs.push(u)}for(let o of r.objectHandlers){let i=t.suiObjectHandlers.push(o.handler)-1;s.moveIntervalConfigs.push({intervalConfig:{handlerId:i,handlerName:o.handlerName,minutes:0,minutesInterval:o.timeIntervalInMinutes,slot:0,slotInterval:o.checkPointInterval,fetchConfig:void 0},type:o.type||"",ownerType:r.ownerType,resourceFetchConfig:o.fetchConfig,fetchConfig:void 0})}if(r instanceof x)for(let o of r.callHandlers){let i=t.suiCallHandlers.push(o.handler)-1,u={filters:o.filters.map(c=>({function:c.function,typeArguments:c.typeArguments||[],withTypeArguments:!!c.typeArguments,includeFailed:c.includeFailed||!1,publicKeyPrefix:c.publicKeyPrefix||"",fromAndToAddress:c.fromAndToAddress})),fetchConfig:o.fetchConfig,handlerId:i,handlerName:o.handlerName};s.moveCallConfigs.push(u)}e.accountConfigs.push(s)}this.handlers=t}async processSuiEvent(e){if(!e.data?.suiEvent)throw new l.ServerError(l.Status.INVALID_ARGUMENT,"Event can't be empty");let t=[],r=e.data.suiEvent;for(let s of e.handlerIds)t.push(this.handlers.suiEventHandlers[s](r).catch(o=>{throw new l.ServerError(l.Status.INTERNAL,"error processing event: "+JSON.stringify(r)+`
3
+ `+ne(o))}));return re(await Promise.all(t))}async processSuiFunctionCall(e){if(!e.data?.suiCall)throw new l.ServerError(l.Status.INVALID_ARGUMENT,"Call can't be empty");let t=e.data.suiCall,r=[];for(let s of e.handlerIds){let o=this.handlers.suiCallHandlers[s](t).catch(i=>{throw new l.ServerError(l.Status.INTERNAL,"error processing call: "+JSON.stringify(t)+`
4
+ `+ne(i))});r.push(o)}return re(await Promise.all(r))}async processSuiObject(e){if(!e.data?.suiObject)throw new l.ServerError(l.Status.INVALID_ARGUMENT,"Object can't be empty");let t=e.data.suiObject,r=[];for(let s of e.handlerIds)r.push(this.handlers.suiObjectHandlers[s](t).catch(o=>{throw new l.ServerError(l.Status.INTERNAL,"error processing object: "+JSON.stringify(t)+`
5
+ `+ne(o))}));return re(await Promise.all(r))}async processSuiObjectChange(e){if(!e.data?.suiObjectChange)throw new l.ServerError(l.Status.INVALID_ARGUMENT,"Object change can't be empty");let t=e.data.suiObjectChange,r=[];for(let s of e.handlerIds)r.push(this.handlers.suiObjectChangeHandlers[s](t).catch(o=>{throw new l.ServerError(l.Status.INTERNAL,"error processing object change: "+JSON.stringify(t)+`
6
+ `+ne(o))}));return re(await Promise.all(r))}supportedHandlers=[S.SUI_EVENT,S.SUI_CALL,S.SUI_OBJECT,S.SUI_OBJECT_CHANGE];processBinding(e){switch(e.handlerType){case S.SUI_EVENT:return this.processSuiEvent(e);case S.SUI_CALL:return this.processSuiFunctionCall(e);case S.SUI_OBJECT:return this.processSuiObject(e);case S.SUI_OBJECT_CHANGE:return this.processSuiObjectChange(e);default:throw new l.ServerError(l.Status.INVALID_ARGUMENT,"No handle type registered "+e.handlerType)}}};Ke.INSTANCE.register(new se);var Qe=new g("",He.SUI_MAINNET,"",new Date,0n,{},0,{});import("node:process").then(n=>n.stdout.write(""));import("node:process").then(n=>n.stdout.write(""));export{Ze as a,Xe as b,et as c,tt as d,nt as e,rt as f,st as g,ot as h,it as i,at as j,ct as k,ut as l,I as m,Ge as n,k as o,g as p,E as q,de as r,ee as s,De as t,V as u,le as v,pe as w,x,G as y,he as z,J as A,ge as B,be as C,Se as D,se as E};
7
+ //# sourceMappingURL=chunk-5AMCSNP7.js.map