@sentio/sdk-bundle 2.57.6 → 2.57.7-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) 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/ext/index.js +1 -1
  6. package/lib/aptos/index.js +1 -1
  7. package/lib/btc/index.js +1 -1
  8. package/lib/{chunk-OSGWCETR.js → chunk-47ROPUTI.js} +2 -2
  9. package/lib/{chunk-AH5F7424.js → chunk-7LRLMZ2R.js} +2 -2
  10. package/lib/{chunk-MXGFKFWL.js → chunk-CGAPKM4X.js} +2 -2
  11. package/lib/chunk-DS2LOABN.js +3 -0
  12. package/lib/chunk-DS2LOABN.js.map +1 -0
  13. package/lib/{chunk-FKVU72SD.js → chunk-EKY3AYVC.js} +2 -2
  14. package/lib/{chunk-T5ZWWDR3.js → chunk-EOYTRF5D.js} +2 -2
  15. package/lib/{chunk-AFT43SGS.js → chunk-JDXUKJQ4.js} +2 -2
  16. package/lib/{chunk-QXO44PWW.js → chunk-KIESPDK2.js} +2 -2
  17. package/lib/chunk-KNV3FDUD.js +32 -0
  18. package/lib/chunk-KNV3FDUD.js.map +1 -0
  19. package/lib/{chunk-GY56IKIO.js → chunk-MHTDLKHZ.js} +2 -2
  20. package/lib/{chunk-Y2L3VTNW.js → chunk-NK2D7BI5.js} +2 -2
  21. package/lib/{chunk-WPZZ3ADX.js → chunk-NSA57BNP.js} +2 -2
  22. package/lib/{chunk-DDVYPPD6.js → chunk-NYKX56LS.js} +2 -2
  23. package/lib/{chunk-2YQIIWLW.js → chunk-RLXGQEGB.js} +2 -2
  24. package/lib/{chunk-QIPKYK5K.js → chunk-RMM5W53S.js} +2 -2
  25. package/lib/{chunk-KJEKGUSP.js → chunk-ULGQYWKO.js} +2 -2
  26. package/lib/{chunk-2AL4DHUZ.js → chunk-X4DAYPSG.js} +2 -2
  27. package/lib/eth/builtin/eacaggregatorproxy.js +1 -1
  28. package/lib/eth/builtin/erc1155.js +1 -1
  29. package/lib/eth/builtin/erc20.js +1 -1
  30. package/lib/eth/builtin/erc721.js +1 -1
  31. package/lib/eth/builtin/index.js +1 -1
  32. package/lib/eth/builtin/weth9.js +1 -1
  33. package/lib/eth/index.js +1 -1
  34. package/lib/fuel/index.js +1 -1
  35. package/lib/stark/index.js +1 -1
  36. package/lib/sui/builtin/0x1.js +1 -1
  37. package/lib/sui/builtin/0x2.js +1 -1
  38. package/lib/sui/builtin/0x3.js +1 -1
  39. package/lib/sui/builtin/index.js +1 -1
  40. package/lib/sui/ext/index.js +1 -1
  41. package/lib/sui/index.js +1 -1
  42. package/lib/testing/index.js +1 -1
  43. package/lib/utils/index.js +1 -1
  44. package/package.json +2 -2
  45. package/lib/chunk-4WNGQ3EZ.js +0 -3
  46. package/lib/chunk-4WNGQ3EZ.js.map +0 -1
  47. package/lib/chunk-UUYHTLBU.js +0 -32
  48. package/lib/chunk-UUYHTLBU.js.map +0 -1
  49. /package/lib/{chunk-OSGWCETR.js.map → chunk-47ROPUTI.js.map} +0 -0
  50. /package/lib/{chunk-AH5F7424.js.map → chunk-7LRLMZ2R.js.map} +0 -0
  51. /package/lib/{chunk-MXGFKFWL.js.map → chunk-CGAPKM4X.js.map} +0 -0
  52. /package/lib/{chunk-FKVU72SD.js.map → chunk-EKY3AYVC.js.map} +0 -0
  53. /package/lib/{chunk-T5ZWWDR3.js.map → chunk-EOYTRF5D.js.map} +0 -0
  54. /package/lib/{chunk-AFT43SGS.js.map → chunk-JDXUKJQ4.js.map} +0 -0
  55. /package/lib/{chunk-QXO44PWW.js.map → chunk-KIESPDK2.js.map} +0 -0
  56. /package/lib/{chunk-GY56IKIO.js.map → chunk-MHTDLKHZ.js.map} +0 -0
  57. /package/lib/{chunk-Y2L3VTNW.js.map → chunk-NK2D7BI5.js.map} +0 -0
  58. /package/lib/{chunk-WPZZ3ADX.js.map → chunk-NSA57BNP.js.map} +0 -0
  59. /package/lib/{chunk-DDVYPPD6.js.map → chunk-NYKX56LS.js.map} +0 -0
  60. /package/lib/{chunk-2YQIIWLW.js.map → chunk-RLXGQEGB.js.map} +0 -0
  61. /package/lib/{chunk-QIPKYK5K.js.map → chunk-RMM5W53S.js.map} +0 -0
  62. /package/lib/{chunk-KJEKGUSP.js.map → chunk-ULGQYWKO.js.map} +0 -0
  63. /package/lib/{chunk-2AL4DHUZ.js.map → chunk-X4DAYPSG.js.map} +0 -0
@@ -1,3 +1,3 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{B as f,C as p,U as O,V as R,W as h,e as m,f as b,i as s,o as i,t as T,w,x as P,y as v,z as y}from"./chunk-UUYHTLBU.js";import{a as l,e as k}from"./chunk-G5BIPHMS.js";var j={};k(j,{EACAggregatorProxyBoundContractView:()=>C,EACAggregatorProxyContractView:()=>x,EACAggregatorProxyProcessor:()=>u,EACAggregatorProxyProcessorTemplate:()=>A,EACAggregatorProxy__factory:()=>p,getEACAggregatorProxyContract:()=>d,getEACAggregatorProxyContractOnContext:()=>D,mockAnswerUpdatedLog:()=>I,mockNewRoundLog:()=>F,mockOwnershipTransferRequestedLog:()=>N,mockOwnershipTransferredLog:()=>B});var g=p.connect("0x0",R),x=class extends m{static{l(this,"EACAggregatorProxyContractView")}constructor(t){super(t),this.callStatic.contract=t}async accessController(t,e,r){try{return await this.contract.getFunction("accessController()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async aggregator(t,e,r){try{return await this.contract.getFunction("aggregator()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async decimals(t,e,r){try{return await this.contract.getFunction("decimals()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async description(t,e,r){try{return await this.contract.getFunction("description()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async getAnswer(t,e,r,a){try{return await this.contract.getFunction("getAnswer(uint256)")(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}}async getRoundData(t,e,r,a){try{return await this.contract.getFunction("getRoundData(uint80)")(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}}async getTimestamp(t,e,r,a){try{return await this.contract.getFunction("getTimestamp(uint256)")(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}}async latestAnswer(t,e,r){try{return await this.contract.getFunction("latestAnswer()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async latestRound(t,e,r){try{return await this.contract.getFunction("latestRound()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async latestRoundData(t,e,r){try{return await this.contract.getFunction("latestRoundData()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async latestTimestamp(t,e,r){try{return await this.contract.getFunction("latestTimestamp()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async owner(t,e,r){try{return await this.contract.getFunction("owner()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async phaseAggregators(t,e,r,a){try{return await this.contract.getFunction("phaseAggregators(uint16)")(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}}async phaseId(t,e,r){try{return await this.contract.getFunction("phaseId()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async proposedAggregator(t,e,r){try{return await this.contract.getFunction("proposedAggregator()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async proposedGetRoundData(t,e,r,a){try{return await this.contract.getFunction("proposedGetRoundData(uint80)")(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}}async proposedLatestRoundData(t,e,r){try{return await this.contract.getFunction("proposedLatestRoundData()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async version(t,e,r){try{return await this.contract.getFunction("version()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}callStatic={contract:this.contract,async acceptOwnership(t,e,r){try{return await this.contract.getFunction("acceptOwnership()").staticCall(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}},async confirmAggregator(t,e,r,a){try{return await this.contract.getFunction("confirmAggregator(address)").staticCall(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}},async proposeAggregator(t,e,r,a){try{return await this.contract.getFunction("proposeAggregator(address)").staticCall(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}},async setController(t,e,r,a){try{return await this.contract.getFunction("setController(address)").staticCall(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}},async transferOwnership(t,e,r,a){try{return await this.contract.getFunction("transferOwnership(address)").staticCall(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}}};encodeCall={acceptOwnership(t){return i(t,"acceptOwnership","function acceptOwnership()",[])},accessController(t){return i(t,"accessController","function accessController()",[])},aggregator(t){return i(t,"aggregator","function aggregator()",[])},confirmAggregator(t,e){return i(e,"confirmAggregator","function confirmAggregator(address)",[t])},decimals(t){return i(t,"decimals","function decimals()",[])},description(t){return i(t,"description","function description()",[])},getAnswer(t,e){return i(e,"getAnswer","function getAnswer(uint256)",[t])},getRoundData(t,e){return i(e,"getRoundData","function getRoundData(uint80)",[t])},getTimestamp(t,e){return i(e,"getTimestamp","function getTimestamp(uint256)",[t])},latestAnswer(t){return i(t,"latestAnswer","function latestAnswer()",[])},latestRound(t){return i(t,"latestRound","function latestRound()",[])},latestRoundData(t){return i(t,"latestRoundData","function latestRoundData()",[])},latestTimestamp(t){return i(t,"latestTimestamp","function latestTimestamp()",[])},owner(t){return i(t,"owner","function owner()",[])},phaseAggregators(t,e){return i(e,"phaseAggregators","function phaseAggregators(uint16)",[t])},phaseId(t){return i(t,"phaseId","function phaseId()",[])},proposeAggregator(t,e){return i(e,"proposeAggregator","function proposeAggregator(address)",[t])},proposedAggregator(t){return i(t,"proposedAggregator","function proposedAggregator()",[])},proposedGetRoundData(t,e){return i(e,"proposedGetRoundData","function proposedGetRoundData(uint80)",[t])},proposedLatestRoundData(t){return i(t,"proposedLatestRoundData","function proposedLatestRoundData()",[])},setController(t,e){return i(e,"setController","function setController(address)",[t])},transferOwnership(t,e){return i(e,"transferOwnership","function transferOwnership(address)",[t])},version(t){return i(t,"version","function version()",[])}}},C=class extends b{static{l(this,"EACAggregatorProxyBoundContractView")}async accessController(t){return await this.view.accessController({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async aggregator(t){return await this.view.aggregator({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async decimals(t){return await this.view.decimals({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async description(t){return await this.view.description({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async getAnswer(t,e){return await this.view.getAnswer(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async getRoundData(t,e){return await this.view.getRoundData(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async getTimestamp(t,e){return await this.view.getTimestamp(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async latestAnswer(t){return await this.view.latestAnswer({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async latestRound(t){return await this.view.latestRound({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async latestRoundData(t){return await this.view.latestRoundData({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async latestTimestamp(t){return await this.view.latestTimestamp({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async owner(t){return await this.view.owner({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async phaseAggregators(t,e){return await this.view.phaseAggregators(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async phaseId(t){return await this.view.phaseId({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async proposedAggregator(t){return await this.view.proposedAggregator({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async proposedGetRoundData(t,e){return await this.view.proposedGetRoundData(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async proposedLatestRoundData(t){return await this.view.proposedLatestRoundData({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async version(t){return await this.view.version({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}callStatic={view:this.view,context:this.context,async acceptOwnership(t){return await this.view.callStatic.acceptOwnership({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())},async confirmAggregator(t,e){return await this.view.callStatic.confirmAggregator(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())},async proposeAggregator(t,e){return await this.view.callStatic.proposeAggregator(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())},async setController(t,e){return await this.view.callStatic.setController(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())},async transferOwnership(t,e){return await this.view.callStatic.transferOwnership(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}};encodeCall={view:this.view,context:this.context,acceptOwnership(t){return this.view.encodeCall.acceptOwnership({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},accessController(t){return this.view.encodeCall.accessController({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},aggregator(t){return this.view.encodeCall.aggregator({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},confirmAggregator(t,e){return this.view.encodeCall.confirmAggregator(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},decimals(t){return this.view.encodeCall.decimals({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},description(t){return this.view.encodeCall.description({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},getAnswer(t,e){return this.view.encodeCall.getAnswer(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},getRoundData(t,e){return this.view.encodeCall.getRoundData(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},getTimestamp(t,e){return this.view.encodeCall.getTimestamp(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},latestAnswer(t){return this.view.encodeCall.latestAnswer({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},latestRound(t){return this.view.encodeCall.latestRound({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},latestRoundData(t){return this.view.encodeCall.latestRoundData({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},latestTimestamp(t){return this.view.encodeCall.latestTimestamp({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},owner(t){return this.view.encodeCall.owner({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},phaseAggregators(t,e){return this.view.encodeCall.phaseAggregators(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},phaseId(t){return this.view.encodeCall.phaseId({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},proposeAggregator(t,e){return this.view.encodeCall.proposeAggregator(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},proposedAggregator(t){return this.view.encodeCall.proposedAggregator({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},proposedGetRoundData(t,e){return this.view.encodeCall.proposedGetRoundData(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},proposedLatestRoundData(t){return this.view.encodeCall.proposedLatestRoundData({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},setController(t,e){return this.view.encodeCall.setController(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},transferOwnership(t,e){return this.view.encodeCall.transferOwnership(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},version(t){return this.view.encodeCall.version({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})}}},u=class o extends T{static{l(this,"EACAggregatorProxyProcessor")}onEventAnswerUpdated(t,e,r,a){return e||(e=g.filters["AnswerUpdated(int256,uint256,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onEventNewRound(t,e,r,a){return e||(e=g.filters["NewRound(uint256,address,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onEventOwnershipTransferRequested(t,e,r,a){return e||(e=g.filters["OwnershipTransferRequested(address,address)"](null,null)),super.onEthEvent(t,e,r,a)}onEventOwnershipTransferred(t,e,r,a){return e||(e=g.filters["OwnershipTransferred(address,address)"](null,null)),super.onEthEvent(t,e,r,a)}onCallAcceptOwnership(t,e,r){return super.onEthTrace("0x79ba5097",t,e,r)}onCallAccessController(t,e,r){return super.onEthTrace("0xbc43cbaf",t,e,r)}onCallAggregator(t,e,r){return super.onEthTrace("0x245a7bfc",t,e,r)}onCallConfirmAggregator(t,e,r){return super.onEthTrace("0xa928c096",t,e,r)}onCallDecimals(t,e,r){return super.onEthTrace("0x313ce567",t,e,r)}onCallDescription(t,e,r){return super.onEthTrace("0x7284e416",t,e,r)}onCallGetAnswer(t,e,r){return super.onEthTrace("0xb5ab58dc",t,e,r)}onCallGetRoundData(t,e,r){return super.onEthTrace("0x9a6fc8f5",t,e,r)}onCallGetTimestamp(t,e,r){return super.onEthTrace("0xb633620c",t,e,r)}onCallLatestAnswer(t,e,r){return super.onEthTrace("0x50d25bcd",t,e,r)}onCallLatestRound(t,e,r){return super.onEthTrace("0x668a0f02",t,e,r)}onCallLatestRoundData(t,e,r){return super.onEthTrace("0xfeaf968c",t,e,r)}onCallLatestTimestamp(t,e,r){return super.onEthTrace("0x8205bf6a",t,e,r)}onCallOwner(t,e,r){return super.onEthTrace("0x8da5cb5b",t,e,r)}onCallPhaseAggregators(t,e,r){return super.onEthTrace("0xc1597304",t,e,r)}onCallPhaseId(t,e,r){return super.onEthTrace("0x58303b10",t,e,r)}onCallProposeAggregator(t,e,r){return super.onEthTrace("0xf8a2abd3",t,e,r)}onCallProposedAggregator(t,e,r){return super.onEthTrace("0xe8c4be30",t,e,r)}onCallProposedGetRoundData(t,e,r){return super.onEthTrace("0x6001ac53",t,e,r)}onCallProposedLatestRoundData(t,e,r){return super.onEthTrace("0x8f6b4d91",t,e,r)}onCallSetController(t,e,r){return super.onEthTrace("0x92eefe9b",t,e,r)}onCallTransferOwnership(t,e,r){return super.onEthTrace("0xf2fde38b",t,e,r)}onCallVersion(t,e,r){return super.onEthTrace("0x54fd4d50",t,e,r)}static filters={AnswerUpdated(t,e,r){return g.filters["AnswerUpdated(int256,uint256,uint256)"](t,e,r)},NewRound(t,e,r){return g.filters["NewRound(uint256,address,uint256)"](t,e,r)},OwnershipTransferRequested(t,e){return g.filters["OwnershipTransferRequested(address,address)"](t,e)},OwnershipTransferred(t,e){return g.filters["OwnershipTransferred(address,address)"](t,e)}};CreateBoundContractView(){let t=d(this.config.network,this.config.address);return new C(this.config.address,t)}static bind(t){t.name||(t.name="EACAggregatorProxy");let e=w(t);return e||(e=new o(t),P(t,e)),e}},A=class extends f{static{l(this,"EACAggregatorProxyProcessorTemplate")}bindInternal(t){t.name||(t.name="EACAggregatorProxy");let e=w(t);return e||(e=new u(t),P(t,e)),e}onEventAnswerUpdated(t,e,r,a){return e||(e=g.filters["AnswerUpdated(int256,uint256,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onEventNewRound(t,e,r,a){return e||(e=g.filters["NewRound(uint256,address,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onEventOwnershipTransferRequested(t,e,r,a){return e||(e=g.filters["OwnershipTransferRequested(address,address)"](null,null)),super.onEthEvent(t,e,r,a)}onEventOwnershipTransferred(t,e,r,a){return e||(e=g.filters["OwnershipTransferred(address,address)"](null,null)),super.onEthEvent(t,e,r,a)}};function d(o,t){let e=v("EACAggregatorProxy",t,o);if(!e){let r=p.connect(t,O(o));e=new x(r),y("EACAggregatorProxy",t,o,e)}return e}l(d,"getEACAggregatorProxyContract");function D(o,t){let e=d(o.getChainId(),t),r=new C(t,e);return r.context=o,r.callStatic&&(r.callStatic.context=o),r}l(D,"getEACAggregatorProxyContractOnContext");import("node:process").then(o=>o.stdout.write(""));var E={blockHash:"0x0000000000000000000000000000000000000000000000000000000000000000",blockNumber:0,logIndex:0,removed:!1,transactionHash:"0x0000000000000000000000000000000000000000000000000000000000000000",transactionIndex:0};function I(o,t){let r=d(h.EthChainId.ETHEREUM,o).rawContract.interface.encodeEventLog("AnswerUpdated(int256,uint256,uint256)",[t.current,t.roundId,t.updatedAt]);return{...E,index:0,address:o,data:r.data,topics:r.topics}}l(I,"mockAnswerUpdatedLog");function F(o,t){let r=d(h.EthChainId.ETHEREUM,o).rawContract.interface.encodeEventLog("NewRound(uint256,address,uint256)",[t.roundId,t.startedBy,t.startedAt]);return{...E,index:0,address:o,data:r.data,topics:r.topics}}l(F,"mockNewRoundLog");function N(o,t){let r=d(h.EthChainId.ETHEREUM,o).rawContract.interface.encodeEventLog("OwnershipTransferRequested(address,address)",[t.from,t.to]);return{...E,index:0,address:o,data:r.data,topics:r.topics}}l(N,"mockOwnershipTransferRequestedLog");function B(o,t){let r=d(h.EthChainId.ETHEREUM,o).rawContract.interface.encodeEventLog("OwnershipTransferred(address,address)",[t.from,t.to]);return{...E,index:0,address:o,data:r.data,topics:r.topics}}l(B,"mockOwnershipTransferredLog");import("node:process").then(o=>o.stdout.write(""));import("node:process").then(o=>o.stdout.write(""));import("node:process").then(o=>o.stdout.write(""));export{x as a,C as b,u as c,A as d,d as e,D as f,I as g,F as h,N as i,B as j,j as k};
3
- //# sourceMappingURL=chunk-AH5F7424.js.map
2
+ import{B as f,C as p,U as O,V as R,W as h,e as m,f as b,i as s,o as i,t as T,w,x as P,y as v,z as y}from"./chunk-KNV3FDUD.js";import{a as l,e as k}from"./chunk-G5BIPHMS.js";var j={};k(j,{EACAggregatorProxyBoundContractView:()=>C,EACAggregatorProxyContractView:()=>x,EACAggregatorProxyProcessor:()=>u,EACAggregatorProxyProcessorTemplate:()=>A,EACAggregatorProxy__factory:()=>p,getEACAggregatorProxyContract:()=>d,getEACAggregatorProxyContractOnContext:()=>D,mockAnswerUpdatedLog:()=>I,mockNewRoundLog:()=>F,mockOwnershipTransferRequestedLog:()=>N,mockOwnershipTransferredLog:()=>B});var g=p.connect("0x0",R),x=class extends m{static{l(this,"EACAggregatorProxyContractView")}constructor(t){super(t),this.callStatic.contract=t}async accessController(t,e,r){try{return await this.contract.getFunction("accessController()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async aggregator(t,e,r){try{return await this.contract.getFunction("aggregator()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async decimals(t,e,r){try{return await this.contract.getFunction("decimals()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async description(t,e,r){try{return await this.contract.getFunction("description()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async getAnswer(t,e,r,a){try{return await this.contract.getFunction("getAnswer(uint256)")(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}}async getRoundData(t,e,r,a){try{return await this.contract.getFunction("getRoundData(uint80)")(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}}async getTimestamp(t,e,r,a){try{return await this.contract.getFunction("getTimestamp(uint256)")(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}}async latestAnswer(t,e,r){try{return await this.contract.getFunction("latestAnswer()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async latestRound(t,e,r){try{return await this.contract.getFunction("latestRound()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async latestRoundData(t,e,r){try{return await this.contract.getFunction("latestRoundData()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async latestTimestamp(t,e,r){try{return await this.contract.getFunction("latestTimestamp()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async owner(t,e,r){try{return await this.contract.getFunction("owner()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async phaseAggregators(t,e,r,a){try{return await this.contract.getFunction("phaseAggregators(uint16)")(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}}async phaseId(t,e,r){try{return await this.contract.getFunction("phaseId()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async proposedAggregator(t,e,r){try{return await this.contract.getFunction("proposedAggregator()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async proposedGetRoundData(t,e,r,a){try{return await this.contract.getFunction("proposedGetRoundData(uint80)")(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}}async proposedLatestRoundData(t,e,r){try{return await this.contract.getFunction("proposedLatestRoundData()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}async version(t,e,r){try{return await this.contract.getFunction("version()")(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}}callStatic={contract:this.contract,async acceptOwnership(t,e,r){try{return await this.contract.getFunction("acceptOwnership()").staticCall(t||{})}catch(a){let n=new Error().stack;throw s(a,void 0,n)}},async confirmAggregator(t,e,r,a){try{return await this.contract.getFunction("confirmAggregator(address)").staticCall(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}},async proposeAggregator(t,e,r,a){try{return await this.contract.getFunction("proposeAggregator(address)").staticCall(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}},async setController(t,e,r,a){try{return await this.contract.getFunction("setController(address)").staticCall(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}},async transferOwnership(t,e,r,a){try{return await this.contract.getFunction("transferOwnership(address)").staticCall(t,e||{})}catch(n){let c=new Error().stack;throw s(n,void 0,c)}}};encodeCall={acceptOwnership(t){return i(t,"acceptOwnership","function acceptOwnership()",[])},accessController(t){return i(t,"accessController","function accessController()",[])},aggregator(t){return i(t,"aggregator","function aggregator()",[])},confirmAggregator(t,e){return i(e,"confirmAggregator","function confirmAggregator(address)",[t])},decimals(t){return i(t,"decimals","function decimals()",[])},description(t){return i(t,"description","function description()",[])},getAnswer(t,e){return i(e,"getAnswer","function getAnswer(uint256)",[t])},getRoundData(t,e){return i(e,"getRoundData","function getRoundData(uint80)",[t])},getTimestamp(t,e){return i(e,"getTimestamp","function getTimestamp(uint256)",[t])},latestAnswer(t){return i(t,"latestAnswer","function latestAnswer()",[])},latestRound(t){return i(t,"latestRound","function latestRound()",[])},latestRoundData(t){return i(t,"latestRoundData","function latestRoundData()",[])},latestTimestamp(t){return i(t,"latestTimestamp","function latestTimestamp()",[])},owner(t){return i(t,"owner","function owner()",[])},phaseAggregators(t,e){return i(e,"phaseAggregators","function phaseAggregators(uint16)",[t])},phaseId(t){return i(t,"phaseId","function phaseId()",[])},proposeAggregator(t,e){return i(e,"proposeAggregator","function proposeAggregator(address)",[t])},proposedAggregator(t){return i(t,"proposedAggregator","function proposedAggregator()",[])},proposedGetRoundData(t,e){return i(e,"proposedGetRoundData","function proposedGetRoundData(uint80)",[t])},proposedLatestRoundData(t){return i(t,"proposedLatestRoundData","function proposedLatestRoundData()",[])},setController(t,e){return i(e,"setController","function setController(address)",[t])},transferOwnership(t,e){return i(e,"transferOwnership","function transferOwnership(address)",[t])},version(t){return i(t,"version","function version()",[])}}},C=class extends b{static{l(this,"EACAggregatorProxyBoundContractView")}async accessController(t){return await this.view.accessController({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async aggregator(t){return await this.view.aggregator({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async decimals(t){return await this.view.decimals({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async description(t){return await this.view.description({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async getAnswer(t,e){return await this.view.getAnswer(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async getRoundData(t,e){return await this.view.getRoundData(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async getTimestamp(t,e){return await this.view.getTimestamp(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async latestAnswer(t){return await this.view.latestAnswer({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async latestRound(t){return await this.view.latestRound({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async latestRoundData(t){return await this.view.latestRoundData({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async latestTimestamp(t){return await this.view.latestTimestamp({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async owner(t){return await this.view.owner({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async phaseAggregators(t,e){return await this.view.phaseAggregators(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async phaseId(t){return await this.view.phaseId({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async proposedAggregator(t){return await this.view.proposedAggregator({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async proposedGetRoundData(t,e){return await this.view.proposedGetRoundData(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async proposedLatestRoundData(t){return await this.view.proposedLatestRoundData({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async version(t){return await this.view.version({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}callStatic={view:this.view,context:this.context,async acceptOwnership(t){return await this.view.callStatic.acceptOwnership({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())},async confirmAggregator(t,e){return await this.view.callStatic.confirmAggregator(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())},async proposeAggregator(t,e){return await this.view.callStatic.proposeAggregator(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())},async setController(t,e){return await this.view.callStatic.setController(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())},async transferOwnership(t,e){return await this.view.callStatic.transferOwnership(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}};encodeCall={view:this.view,context:this.context,acceptOwnership(t){return this.view.encodeCall.acceptOwnership({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},accessController(t){return this.view.encodeCall.accessController({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},aggregator(t){return this.view.encodeCall.aggregator({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},confirmAggregator(t,e){return this.view.encodeCall.confirmAggregator(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},decimals(t){return this.view.encodeCall.decimals({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},description(t){return this.view.encodeCall.description({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},getAnswer(t,e){return this.view.encodeCall.getAnswer(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},getRoundData(t,e){return this.view.encodeCall.getRoundData(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},getTimestamp(t,e){return this.view.encodeCall.getTimestamp(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},latestAnswer(t){return this.view.encodeCall.latestAnswer({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},latestRound(t){return this.view.encodeCall.latestRound({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},latestRoundData(t){return this.view.encodeCall.latestRoundData({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},latestTimestamp(t){return this.view.encodeCall.latestTimestamp({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},owner(t){return this.view.encodeCall.owner({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},phaseAggregators(t,e){return this.view.encodeCall.phaseAggregators(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},phaseId(t){return this.view.encodeCall.phaseId({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},proposeAggregator(t,e){return this.view.encodeCall.proposeAggregator(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},proposedAggregator(t){return this.view.encodeCall.proposedAggregator({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},proposedGetRoundData(t,e){return this.view.encodeCall.proposedGetRoundData(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},proposedLatestRoundData(t){return this.view.encodeCall.proposedLatestRoundData({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},setController(t,e){return this.view.encodeCall.setController(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},transferOwnership(t,e){return this.view.encodeCall.transferOwnership(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},version(t){return this.view.encodeCall.version({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})}}},u=class o extends T{static{l(this,"EACAggregatorProxyProcessor")}onEventAnswerUpdated(t,e,r,a){return e||(e=g.filters["AnswerUpdated(int256,uint256,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onEventNewRound(t,e,r,a){return e||(e=g.filters["NewRound(uint256,address,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onEventOwnershipTransferRequested(t,e,r,a){return e||(e=g.filters["OwnershipTransferRequested(address,address)"](null,null)),super.onEthEvent(t,e,r,a)}onEventOwnershipTransferred(t,e,r,a){return e||(e=g.filters["OwnershipTransferred(address,address)"](null,null)),super.onEthEvent(t,e,r,a)}onCallAcceptOwnership(t,e,r){return super.onEthTrace("0x79ba5097",t,e,r)}onCallAccessController(t,e,r){return super.onEthTrace("0xbc43cbaf",t,e,r)}onCallAggregator(t,e,r){return super.onEthTrace("0x245a7bfc",t,e,r)}onCallConfirmAggregator(t,e,r){return super.onEthTrace("0xa928c096",t,e,r)}onCallDecimals(t,e,r){return super.onEthTrace("0x313ce567",t,e,r)}onCallDescription(t,e,r){return super.onEthTrace("0x7284e416",t,e,r)}onCallGetAnswer(t,e,r){return super.onEthTrace("0xb5ab58dc",t,e,r)}onCallGetRoundData(t,e,r){return super.onEthTrace("0x9a6fc8f5",t,e,r)}onCallGetTimestamp(t,e,r){return super.onEthTrace("0xb633620c",t,e,r)}onCallLatestAnswer(t,e,r){return super.onEthTrace("0x50d25bcd",t,e,r)}onCallLatestRound(t,e,r){return super.onEthTrace("0x668a0f02",t,e,r)}onCallLatestRoundData(t,e,r){return super.onEthTrace("0xfeaf968c",t,e,r)}onCallLatestTimestamp(t,e,r){return super.onEthTrace("0x8205bf6a",t,e,r)}onCallOwner(t,e,r){return super.onEthTrace("0x8da5cb5b",t,e,r)}onCallPhaseAggregators(t,e,r){return super.onEthTrace("0xc1597304",t,e,r)}onCallPhaseId(t,e,r){return super.onEthTrace("0x58303b10",t,e,r)}onCallProposeAggregator(t,e,r){return super.onEthTrace("0xf8a2abd3",t,e,r)}onCallProposedAggregator(t,e,r){return super.onEthTrace("0xe8c4be30",t,e,r)}onCallProposedGetRoundData(t,e,r){return super.onEthTrace("0x6001ac53",t,e,r)}onCallProposedLatestRoundData(t,e,r){return super.onEthTrace("0x8f6b4d91",t,e,r)}onCallSetController(t,e,r){return super.onEthTrace("0x92eefe9b",t,e,r)}onCallTransferOwnership(t,e,r){return super.onEthTrace("0xf2fde38b",t,e,r)}onCallVersion(t,e,r){return super.onEthTrace("0x54fd4d50",t,e,r)}static filters={AnswerUpdated(t,e,r){return g.filters["AnswerUpdated(int256,uint256,uint256)"](t,e,r)},NewRound(t,e,r){return g.filters["NewRound(uint256,address,uint256)"](t,e,r)},OwnershipTransferRequested(t,e){return g.filters["OwnershipTransferRequested(address,address)"](t,e)},OwnershipTransferred(t,e){return g.filters["OwnershipTransferred(address,address)"](t,e)}};CreateBoundContractView(){let t=d(this.config.network,this.config.address);return new C(this.config.address,t)}static bind(t){t.name||(t.name="EACAggregatorProxy");let e=w(t);return e||(e=new o(t),P(t,e)),e}},A=class extends f{static{l(this,"EACAggregatorProxyProcessorTemplate")}bindInternal(t){t.name||(t.name="EACAggregatorProxy");let e=w(t);return e||(e=new u(t),P(t,e)),e}onEventAnswerUpdated(t,e,r,a){return e||(e=g.filters["AnswerUpdated(int256,uint256,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onEventNewRound(t,e,r,a){return e||(e=g.filters["NewRound(uint256,address,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onEventOwnershipTransferRequested(t,e,r,a){return e||(e=g.filters["OwnershipTransferRequested(address,address)"](null,null)),super.onEthEvent(t,e,r,a)}onEventOwnershipTransferred(t,e,r,a){return e||(e=g.filters["OwnershipTransferred(address,address)"](null,null)),super.onEthEvent(t,e,r,a)}};function d(o,t){let e=v("EACAggregatorProxy",t,o);if(!e){let r=p.connect(t,O(o));e=new x(r),y("EACAggregatorProxy",t,o,e)}return e}l(d,"getEACAggregatorProxyContract");function D(o,t){let e=d(o.getChainId(),t),r=new C(t,e);return r.context=o,r.callStatic&&(r.callStatic.context=o),r}l(D,"getEACAggregatorProxyContractOnContext");import("node:process").then(o=>o.stdout.write(""));var E={blockHash:"0x0000000000000000000000000000000000000000000000000000000000000000",blockNumber:0,logIndex:0,removed:!1,transactionHash:"0x0000000000000000000000000000000000000000000000000000000000000000",transactionIndex:0};function I(o,t){let r=d(h.EthChainId.ETHEREUM,o).rawContract.interface.encodeEventLog("AnswerUpdated(int256,uint256,uint256)",[t.current,t.roundId,t.updatedAt]);return{...E,index:0,address:o,data:r.data,topics:r.topics}}l(I,"mockAnswerUpdatedLog");function F(o,t){let r=d(h.EthChainId.ETHEREUM,o).rawContract.interface.encodeEventLog("NewRound(uint256,address,uint256)",[t.roundId,t.startedBy,t.startedAt]);return{...E,index:0,address:o,data:r.data,topics:r.topics}}l(F,"mockNewRoundLog");function N(o,t){let r=d(h.EthChainId.ETHEREUM,o).rawContract.interface.encodeEventLog("OwnershipTransferRequested(address,address)",[t.from,t.to]);return{...E,index:0,address:o,data:r.data,topics:r.topics}}l(N,"mockOwnershipTransferRequestedLog");function B(o,t){let r=d(h.EthChainId.ETHEREUM,o).rawContract.interface.encodeEventLog("OwnershipTransferred(address,address)",[t.from,t.to]);return{...E,index:0,address:o,data:r.data,topics:r.topics}}l(B,"mockOwnershipTransferredLog");import("node:process").then(o=>o.stdout.write(""));import("node:process").then(o=>o.stdout.write(""));import("node:process").then(o=>o.stdout.write(""));export{x as a,C as b,u as c,A as d,d as e,D as f,I as g,F as h,N as i,B as j,j as k};
3
+ //# sourceMappingURL=chunk-7LRLMZ2R.js.map
@@ -1,7 +1,7 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{a as je,b as xe,c as _,e as Ne,f as m,g as P,i as Ae}from"./chunk-AFT43SGS.js";import{a as f,b as M}from"./chunk-4WNGQ3EZ.js";import{D as ce,E as ve,a as T,d as Q,f as F,i as Te,m as v,n as ie,o as ae,u as Ie,v as ye,w as Z}from"./chunk-ZBVXDY4B.js";import{a as _e}from"./chunk-HRZJHNIM.js";import{Ca as A,D as S,Ld as W,W as Oe,Zd as K,fa as we,he as Y,je as w,x as N}from"./chunk-LZ2L3BVP.js";import{a,f as B}from"./chunk-G5BIPHMS.js";import{ListStateStorage as $e}from"@sentio/runtime";var p=B(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 et(n,e){return h(n)?n:e.object(n)}a(et,"transactionArgumentOrObject");function tt(n,e){return h(n)?n:typeof n=="string"?e.pure.string(n):e.pure.u64(n)}a(tt,"transactionArgumentOrPure");function nt(n,e){return h(n)?n:e.pure.address(n)}a(nt,"transactionArgumentOrPureAddress");function rt(n,e){return h(n)?n:e.pure.u8(n)}a(rt,"transactionArgumentOrPureU8");function st(n,e){return h(n)?n:e.pure.u16(n)}a(st,"transactionArgumentOrPureU16");function ot(n,e){return h(n)?n:e.pure.u32(n)}a(ot,"transactionArgumentOrPureU32");function it(n,e){return h(n)?n:e.pure.u64(n)}a(it,"transactionArgumentOrPureU64");function at(n,e){return h(n)?n:e.pure.u128(n)}a(at,"transactionArgumentOrPureU128");function ct(n,e){return h(n)?n:e.pure.u256(n)}a(ct,"transactionArgumentOrPureU256");function ut(n,e){return h(n)?n:e.pure.bool(n)}a(ut,"transactionArgumentOrPureBool");function dt(n,e){return h(n)?n:e.makeMoveVec({elements:n.map(t=>e.object(t))})}a(dt,"transactionArgumentOrVec");function z(n){return{address:n.address,exposedFunctions:Object.entries(n.exposedFunctions).map(([e,t])=>Le(e,t)),name:n.name,structs:Object.entries(n.structs).map(([e,t])=>Ve(e,t)),enums:Object.entries(n.enums||{}).map(([e,t])=>Ue(e,t))}}a(z,"toInternalModule");function Le(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(Le,"toInternalFunction");function Ve(n,e){return{abilities:e.abilities.abilities,fields:e.fields.map(Me),typeParams:e.typeParameters.map(t=>({constraints:t.constraints.abilities})),isNative:!1,isEvent:!1,name:n}}a(Ve,"toInternalStruct");function Ue(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(Me),t),{})}}a(Ue,"toInternalEnum");function Me(n){return{name:n.name,type:j(n.type)}}a(Me,"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 Ie{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=Te(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 ye{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 xe(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 je(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 _[i]();case"address":return _.Address;case"vector":return _.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 _.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}}},Ge="https://fullnode.mainnet.sui.io/",Pe=new Map;function Ee(n=Ge){let e=Pe.get(n);return e||(e=new I(new Ne({url:n})),Pe.set(n,e)),e}a(Ee,"defaultMoveCoder");var ke=new Map,ue;async function Je(n){let e=ke.get(n);if(!e){e=new I(n);let t=await n.getChainIdentifier(),r=Ee();ue||(ue=await r.adapter.getChainId()),t===ue&&(e=r),ke.set(n,e)}return e}a(Je,"getMoveCoder");var De=new Map;function k(n=m.MAIN_NET){let e=De.get(n);return e||(e=new I(P(n)),De.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 ve{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 He(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(He,"getMoveCalls");import("node:process").then(n=>n.stdout.write(""));var L={resourceChanges:!1,allEvents:!0,inputs:!0};function fe(n){return{startCheckpoint:n.startCheckpoint||0n,address:n.address===w?w:F(n.address),network:n.network||m.MAIN_NET,baseLabels:n.baseLabels}}a(fe,"configure");var V=class n extends $e{static{a(this,"SuiProcessorState")}static INSTANCE=new n},U=class{static{a(this,"SuiBaseProcessor")}moduleName;config;eventHandlers=[];callHandlers=[];objectChangeHandlers=[];coder;constructor(e,t){return this.moduleName=e,this.config=fe(t),V.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({...L,...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({...L,...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=He(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({...L,...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 U{static{a(this,"SuiModulesProcessor")}static bind(e){return new n(w,e)}},pe=class n extends U{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 qe}from"@sentio/runtime";var D=B(K(),1);var me={owned:!1},y=class n extends qe{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}},G=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 G{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({...L,...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}},J=class n extends G{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)}},$=class n extends G{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 We}from"@sentio/runtime";var b=B(K(),1);var H=class n extends We{static{a(this,"SuiAccountProcessorTemplateState")}static INSTANCE=new n},q=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=F(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=F(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 q{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 q{static{a(this,"SuiObjectProcessorTemplate")}createProcessor(e){let t=J.bind(e);return t.templateId=this.id,t}},Se=class extends q{static{a(this,"SuiWrappedObjectProcessorTemplate")}createProcessor(e){let t=$.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 Ke,PluginManager as Ye,USER_PROCESSOR as Qe}from"@sentio/runtime";var l=B(K(),1);var Ce=B(_e(),1);var se=class extends Ke{static{a(this,"SuiPlugin")}name="SuiPlugin";handlers={suiCallHandlers:[],suiEventHandlers:[],suiObjectHandlers:[],suiObjectChangeHandlers:[]};async start(e){await Ae(),console.log("total instances:",e.templateInstances.length);let t=new Set(Object.values(Ce.SuiChainId));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},Ze)}}async configure(e){let t={suiCallHandlers:[],suiEventHandlers:[],suiObjectHandlers:[],suiObjectChangeHandlers:[]};for(let r of V.INSTANCE.getValues()){let s=Oe.fromPartial({transactionConfig:[],processorType:Qe,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=we.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)+`
2
+ import{a as je,b as xe,c as _,e as Ne,f as m,g as P,i as Ae}from"./chunk-JDXUKJQ4.js";import{a as f,b as M}from"./chunk-DS2LOABN.js";import{D as ce,E as ve,a as T,d as Q,f as F,i as Te,m as v,n as ie,o as ae,u as Ie,v as ye,w as Z}from"./chunk-ZBVXDY4B.js";import{a as _e}from"./chunk-HRZJHNIM.js";import{Ca as A,D as S,Ld as W,W as Oe,Zd as K,fa as we,he as Y,je as w,x as N}from"./chunk-LZ2L3BVP.js";import{a,f as B}from"./chunk-G5BIPHMS.js";import{ListStateStorage as $e}from"@sentio/runtime";var p=B(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 et(n,e){return h(n)?n:e.object(n)}a(et,"transactionArgumentOrObject");function tt(n,e){return h(n)?n:typeof n=="string"?e.pure.string(n):e.pure.u64(n)}a(tt,"transactionArgumentOrPure");function nt(n,e){return h(n)?n:e.pure.address(n)}a(nt,"transactionArgumentOrPureAddress");function rt(n,e){return h(n)?n:e.pure.u8(n)}a(rt,"transactionArgumentOrPureU8");function st(n,e){return h(n)?n:e.pure.u16(n)}a(st,"transactionArgumentOrPureU16");function ot(n,e){return h(n)?n:e.pure.u32(n)}a(ot,"transactionArgumentOrPureU32");function it(n,e){return h(n)?n:e.pure.u64(n)}a(it,"transactionArgumentOrPureU64");function at(n,e){return h(n)?n:e.pure.u128(n)}a(at,"transactionArgumentOrPureU128");function ct(n,e){return h(n)?n:e.pure.u256(n)}a(ct,"transactionArgumentOrPureU256");function ut(n,e){return h(n)?n:e.pure.bool(n)}a(ut,"transactionArgumentOrPureBool");function dt(n,e){return h(n)?n:e.makeMoveVec({elements:n.map(t=>e.object(t))})}a(dt,"transactionArgumentOrVec");function z(n){return{address:n.address,exposedFunctions:Object.entries(n.exposedFunctions).map(([e,t])=>Le(e,t)),name:n.name,structs:Object.entries(n.structs).map(([e,t])=>Ve(e,t)),enums:Object.entries(n.enums||{}).map(([e,t])=>Ue(e,t))}}a(z,"toInternalModule");function Le(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(Le,"toInternalFunction");function Ve(n,e){return{abilities:e.abilities.abilities,fields:e.fields.map(Me),typeParams:e.typeParameters.map(t=>({constraints:t.constraints.abilities})),isNative:!1,isEvent:!1,name:n}}a(Ve,"toInternalStruct");function Ue(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(Me),t),{})}}a(Ue,"toInternalEnum");function Me(n){return{name:n.name,type:j(n.type)}}a(Me,"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 Ie{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=Te(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 ye{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 xe(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 je(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 _[i]();case"address":return _.Address;case"vector":return _.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 _.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}}},Ge="https://fullnode.mainnet.sui.io/",Pe=new Map;function Ee(n=Ge){let e=Pe.get(n);return e||(e=new I(new Ne({url:n})),Pe.set(n,e)),e}a(Ee,"defaultMoveCoder");var ke=new Map,ue;async function Je(n){let e=ke.get(n);if(!e){e=new I(n);let t=await n.getChainIdentifier(),r=Ee();ue||(ue=await r.adapter.getChainId()),t===ue&&(e=r),ke.set(n,e)}return e}a(Je,"getMoveCoder");var De=new Map;function k(n=m.MAIN_NET){let e=De.get(n);return e||(e=new I(P(n)),De.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 ve{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 He(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(He,"getMoveCalls");import("node:process").then(n=>n.stdout.write(""));var L={resourceChanges:!1,allEvents:!0,inputs:!0};function fe(n){return{startCheckpoint:n.startCheckpoint||0n,address:n.address===w?w:F(n.address),network:n.network||m.MAIN_NET,baseLabels:n.baseLabels}}a(fe,"configure");var V=class n extends $e{static{a(this,"SuiProcessorState")}static INSTANCE=new n},U=class{static{a(this,"SuiBaseProcessor")}moduleName;config;eventHandlers=[];callHandlers=[];objectChangeHandlers=[];coder;constructor(e,t){return this.moduleName=e,this.config=fe(t),V.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({...L,...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({...L,...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=He(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({...L,...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 U{static{a(this,"SuiModulesProcessor")}static bind(e){return new n(w,e)}},pe=class n extends U{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 qe}from"@sentio/runtime";var D=B(K(),1);var me={owned:!1},y=class n extends qe{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}},G=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 G{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({...L,...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}},J=class n extends G{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)}},$=class n extends G{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 We}from"@sentio/runtime";var b=B(K(),1);var H=class n extends We{static{a(this,"SuiAccountProcessorTemplateState")}static INSTANCE=new n},q=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=F(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=F(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 q{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 q{static{a(this,"SuiObjectProcessorTemplate")}createProcessor(e){let t=J.bind(e);return t.templateId=this.id,t}},Se=class extends q{static{a(this,"SuiWrappedObjectProcessorTemplate")}createProcessor(e){let t=$.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 Ke,PluginManager as Ye,USER_PROCESSOR as Qe}from"@sentio/runtime";var l=B(K(),1);var Ce=B(_e(),1);var se=class extends Ke{static{a(this,"SuiPlugin")}name="SuiPlugin";handlers={suiCallHandlers:[],suiEventHandlers:[],suiObjectHandlers:[],suiObjectChangeHandlers:[]};async start(e){await Ae(),console.log("total instances:",e.templateInstances.length);let t=new Set(Object.values(Ce.SuiChainId));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},Ze)}}async configure(e){let t={suiCallHandlers:[],suiEventHandlers:[],suiObjectHandlers:[],suiObjectChangeHandlers:[]};for(let r of V.INSTANCE.getValues()){let s=Oe.fromPartial({transactionConfig:[],processorType:Qe,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=we.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
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
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
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
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)}}};Ye.INSTANCE.register(new se);var Ze=new g("",Ce.SuiChainId.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,et as b,tt as c,nt as d,rt as e,st as f,ot as g,it as h,at as i,ct as j,ut as k,dt as l,I as m,Je as n,k as o,g as p,E as q,de as r,ee as s,He as t,U as u,le as v,pe as w,x,J as y,he as z,$ as A,ge as B,be as C,Se as D,se as E};
7
- //# sourceMappingURL=chunk-MXGFKFWL.js.map
7
+ //# sourceMappingURL=chunk-CGAPKM4X.js.map
@@ -0,0 +1,3 @@
1
+ import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
+ import{a as r}from"./chunk-G5BIPHMS.js";import{AsyncLocalStorage as i}from"node:async_hooks";import{metricsStorage as a}from"@sentio/runtime";function d(){return a.getStore()||"unknown"}r(d,"getHandlerName");function m(t){return new Proxy(t,{get:r((f,e,n)=>a.run(a.getStore()||`${t.constructor.name}.${e.toString()}`,()=>{let o=f[e];return typeof o=="function"?i.bind((...y)=>o.apply(n,y)):Reflect.get(f,e,n)}),"get")})}r(m,"proxyProcessor");function g(t){return new Proxy(t,{set:r((f,e,n,o)=>{let y=a.getStore();if(n.handler&&typeof n.handler=="function"&&y){let c=n.handler;n.handler=(...u)=>a.run(y,()=>c.apply(o,u))}return Reflect.set(f,e,n,o)},"set")})}r(g,"proxyHandlers");import("node:process").then(t=>t.stdout.write(""));export{d as a,m as b,g as c};
3
+ //# sourceMappingURL=chunk-DS2LOABN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/metrics.ts"],"sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks'\nimport { metricsStorage } from '@sentio/runtime'\n\nexport function getHandlerName() {\n return metricsStorage.getStore() || 'unknown'\n}\n\nexport function proxyProcessor(cls: any) {\n return new Proxy(cls, {\n get: (target, prop, receiver) => {\n return metricsStorage.run(metricsStorage.getStore() || `${cls.constructor.name}.${prop.toString()}`, () => {\n const fn = (target as any)[prop]\n if (typeof fn == 'function') {\n return AsyncLocalStorage.bind((...args: any) => fn.apply(receiver, args))\n }\n return Reflect.get(target, prop, receiver)\n })\n }\n })\n}\n\nexport function proxyHandlers(arr: any[]) {\n return new Proxy(arr, {\n set: (target, prop, value, receiver) => {\n const handlerName = metricsStorage.getStore()\n if (value.handler && typeof value.handler == 'function' && handlerName) {\n const fn = value.handler\n value.handler = (...args: any) => metricsStorage.run(handlerName, () => fn.apply(receiver, args))\n }\n return Reflect.set(target, prop, value, receiver)\n }\n })\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";wCAAA,OAAS,qBAAAA,MAAyB,mBAClC,OAAS,kBAAAC,MAAsB,kBAExB,SAASC,GAAiB,CAC/B,OAAOC,EAAe,SAAS,GAAK,SACtC,CAFgBC,EAAAF,EAAA,kBAIT,SAASG,EAAeC,EAAU,CACvC,OAAO,IAAI,MAAMA,EAAK,CACpB,IAAKF,EAAA,CAACG,EAAQC,EAAMC,IACXN,EAAe,IAAIA,EAAe,SAAS,GAAK,GAAGG,EAAI,YAAY,IAAI,IAAIE,EAAK,SAAS,CAAC,GAAI,IAAM,CACzG,IAAME,EAAMH,EAAeC,CAAI,EAC/B,OAAI,OAAOE,GAAM,WACRC,EAAkB,KAAK,IAAIC,IAAcF,EAAG,MAAMD,EAAUG,CAAI,CAAC,EAEnE,QAAQ,IAAIL,EAAQC,EAAMC,CAAQ,CAC3C,CAAC,EAPE,MASP,CAAC,CACH,CAZgBL,EAAAC,EAAA,kBAcT,SAASQ,EAAcC,EAAY,CACxC,OAAO,IAAI,MAAMA,EAAK,CACpB,IAAKV,EAAA,CAACG,EAAQC,EAAMO,EAAON,IAAa,CACtC,IAAMO,EAAcb,EAAe,SAAS,EAC5C,GAAIY,EAAM,SAAW,OAAOA,EAAM,SAAW,YAAcC,EAAa,CACtE,IAAMN,EAAKK,EAAM,QACjBA,EAAM,QAAU,IAAIH,IAAcT,EAAe,IAAIa,EAAa,IAAMN,EAAG,MAAMD,EAAUG,CAAI,CAAC,CAClG,CACA,OAAO,QAAQ,IAAIL,EAAQC,EAAMO,EAAON,CAAQ,CAClD,EAPK,MAQP,CAAC,CACH,CAXgBL,EAAAS,EAAA,iBAYf,OAAO,cAAc,EAAE,KAAMI,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC","names":["AsyncLocalStorage","metricsStorage","getHandlerName","metricsStorage","__name","proxyProcessor","cls","target","prop","receiver","fn","AsyncLocalStorage","args","proxyHandlers","arr","value","handlerName","p"]}
@@ -1,5 +1,5 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{a as I,b as R}from"./chunk-4WNGQ3EZ.js";import{D as f,Ld as B,Na as P,Oa as N,Qa as b,Ra as _,Sa as O,W as V,Zd as A,_d as l,ce as F,he as H}from"./chunk-LZ2L3BVP.js";import{a as v}from"./chunk-RA75ESSD.js";import{a as o,f as x}from"./chunk-G5BIPHMS.js";var h=class extends F{constructor(e,n,a,s){super({});this.chainId=e;this.name=n;this.tx=a;this.address=s}static{o(this,"BTCContext")}getMetaDataInternal(e,n){return{address:this.address,contractName:this.name,blockNumber:BigInt(this.tx.blockheight??0),transactionIndex:0,transactionHash:this.tx.txid,chainId:this.getChainId(),name:e,logIndex:0,labels:B(n)}}getChainId(){return this.chainId}},m=class extends F{constructor(e,n,a,s){super({});this.chainId=e;this.name=n;this.block=a;this.address=s}static{o(this,"BTCBlockContext")}getMetaDataInternal(e,n){return{address:this.address??"",contractName:this.name,blockNumber:BigInt(this.block.height??0),transactionIndex:0,transactionHash:"",chainId:this.getChainId(),name:e,logIndex:0,labels:B(n)}}getChainId(){return this.chainId}};import("node:process").then(r=>r.stdout.write(""));import{ListStateStorage as M}from"@sentio/runtime";var g=x(A(),1);var u=class r extends M{static{o(this,"BTCProcessorState")}static INSTANCE=new r},w=class r{constructor(t){this.config=t;return R(this)}static{o(this,"BTCProcessor")}callHandlers=[];blockHandlers=[];static bind(t){let e=new r(t);return u.INSTANCE.addValue(e),e}onTransaction(t,e){let n={handlerName:I(),handler:o(async a=>{let s=a.transaction,i=new h(this.config.chainId,this.config.name??this.config.address??"",s,this.config.address??s.vout?.[0]?.scriptPubKey?.address);return await t(s,i),i.stopAndGetResult()},"handler"),filter:e};return this.callHandlers.push(n),this}onInterval(t,e,n,a){e&&e.backfillInterval<e.recentInterval&&(e.backfillInterval=e.recentInterval);let s=this;return this.blockHandlers.push({blockInterval:n,timeIntervalInMinutes:e,handlerName:I(),handler:o(async function(i){let d=i.block;if(!d)throw new g.ServerError(g.Status.INVALID_ARGUMENT,"Block is empty");let p={...d};a?.getTransactions&&(p.tx=d.rawtx?.map(L=>L));let y=new m(s.config.chainId,s.config.name??s.config.address??"",p,s.config.address);return await t(p,y),y.stopAndGetResult()},"handler"),fetchConfig:a}),this}onBlockInterval(t,e=250,n=1e3,a){return this.onInterval(t,void 0,{recentInterval:e,backfillInterval:n},a)}onTimeInterval(t,e=60,n=240,a){return this.onInterval(t,{recentInterval:e,backfillInterval:n},void 0,a)}};import("node:process").then(r=>r.stdout.write(""));function q(r){if(r){let t=_.create(),e=[],n=[],a=[];for(let s of Array.isArray(r)?r:[r]){let{preVOut:i,preTransaction:d,...p}=s;e.push(p),i&&n.push(i),d&&a.push(d)}if(t.filters=b.create({filters:T(e)}),n.length>0){let s=T(n);s&&s.length>0&&(t.preVOut=s[0])}return a.length>0&&(t.preTransaction=C(a)?.[0]),t}}o(q,"toVinFilter");function G(r){if(r){let t=O.create(),e=Array.isArray(r)?r:[r];return t.filters=b.create({filters:T(e)}),t}}o(G,"toVOutFilter");function C(r){return(Array.isArray(r)?r:[r]).map(e=>({filter:T(e.filter),inputFilter:q(e.inputFilter),outputFilter:G(e.outputFilter)}))}o(C,"filters2Proto");function z(r){let t=P.create();r instanceof Date&&(t.eq=l(r)),typeof r=="number"&&(t.eq=l(r)),typeof r=="string"&&(t.eq=l(r)),r instanceof v&&(t.eq=l(r)),typeof r=="bigint"&&(t.eq=l(r)),typeof r=="boolean"&&(t.eq=l(r)),Array.isArray(r)&&(t.in={values:r.map(e=>l(e))});for(let[e,n]of Object.entries(r))switch(e){case"prefix":case"contains":case"notContains":t[e]=n.toString();break;case"length":t.lengthEq=n;break;case"lengthGt":case"lengthLt":t[e]=n;break;case"hasAny":case"hasAll":case"in":t[e]={values:n.map(a=>l(a))};break;case"eq":case"gt":case"gte":case"lt":case"lte":case"ne":t[e]=l(n);break;default:throw new Error("Unknown condition op: "+e)}return t}o(z,"toCondition");function T(r){if(r&&r.length>0){let t=[];for(let e of r){let n=N.create();for(let[a,s]of Object.entries(e))n.conditions[a]=z(s);t.push(n)}return t}return[]}o(T,"convertFilters");import("node:process").then(r=>r.stdout.write(""));import{errorString as D,GLOBAL_CONFIG as S,mergeProcessResults as E,Plugin as K,PluginManager as U,USER_PROCESSOR as j}from"@sentio/runtime";var c=x(A(),1);var k=class extends K{static{o(this,"BTCPlugin")}name="BTCPlugin";handlers={txHandlers:[],blockHandlers:[]};async configure(t){let e={txHandlers:[],blockHandlers:[]};for(let n of u.INSTANCE.getValues()){let a=V.fromPartial({processorType:j,contract:{name:n.config.name,chainId:n.config.chainId.toString(),address:n.config.address||"*",abi:""},startBlock:n.config.startBlock,endBlock:n.config.endBlock});for(let s of n.callHandlers){let i=e.txHandlers.push(s.handler)-1,d=s.handlerName;s.filter?a.btcTransactionConfigs.push({filters:C(s.filter),handlerId:i,handlerName:d}):a.contract?.address!="*"&&a.btcTransactionConfigs.push({filters:C({outputFilter:{script_address:n.config.address}}),handlerId:i,handlerName:d})}for(let s of n.blockHandlers){let i=e.blockHandlers.push(s.handler)-1;a.intervalConfigs.push({slot:0,slotInterval:s.blockInterval,minutes:0,minutesInterval:s.timeIntervalInMinutes,handlerId:i,handlerName:s.handlerName,fetchConfig:{transaction:s.fetchConfig?.getTransactions??!1,trace:!1,block:!0,transactionReceipt:!1,transactionReceiptLogs:!1}})}t.contractConfigs.push(a)}this.handlers=e}supportedHandlers=[f.BTC_TRANSACTION,f.BTC_BLOCK];processBinding(t){switch(t.handlerType){case f.BTC_TRANSACTION:return this.processTransaction(t);case f.BTC_BLOCK:return this.processBlock(t);default:throw new c.ServerError(c.Status.INVALID_ARGUMENT,"No handle type registered "+t.handlerType)}}async start(t){}stateDiff(t){return H.INSTANCE.getValues().length!==t.templateInstances.length}async processTransaction(t){if(!t.data?.btcTransaction)throw new c.ServerError(c.Status.INVALID_ARGUMENT,"BTCEvents can't be null");let e=[],n=t.data?.btcTransaction;for(let a of t.handlerIds){let s=this.handlers.txHandlers[a](t.data?.btcTransaction).catch(i=>{throw new c.ServerError(c.Status.INTERNAL,"error processing transaction: "+JSON.stringify(n)+`
2
+ import{a as I,b as R}from"./chunk-DS2LOABN.js";import{D as f,Ld as B,Na as P,Oa as N,Qa as b,Ra as _,Sa as O,W as V,Zd as A,_d as l,ce as F,he as H}from"./chunk-LZ2L3BVP.js";import{a as v}from"./chunk-RA75ESSD.js";import{a as o,f as x}from"./chunk-G5BIPHMS.js";var h=class extends F{constructor(e,n,a,s){super({});this.chainId=e;this.name=n;this.tx=a;this.address=s}static{o(this,"BTCContext")}getMetaDataInternal(e,n){return{address:this.address,contractName:this.name,blockNumber:BigInt(this.tx.blockheight??0),transactionIndex:0,transactionHash:this.tx.txid,chainId:this.getChainId(),name:e,logIndex:0,labels:B(n)}}getChainId(){return this.chainId}},m=class extends F{constructor(e,n,a,s){super({});this.chainId=e;this.name=n;this.block=a;this.address=s}static{o(this,"BTCBlockContext")}getMetaDataInternal(e,n){return{address:this.address??"",contractName:this.name,blockNumber:BigInt(this.block.height??0),transactionIndex:0,transactionHash:"",chainId:this.getChainId(),name:e,logIndex:0,labels:B(n)}}getChainId(){return this.chainId}};import("node:process").then(r=>r.stdout.write(""));import{ListStateStorage as M}from"@sentio/runtime";var g=x(A(),1);var u=class r extends M{static{o(this,"BTCProcessorState")}static INSTANCE=new r},w=class r{constructor(t){this.config=t;return R(this)}static{o(this,"BTCProcessor")}callHandlers=[];blockHandlers=[];static bind(t){let e=new r(t);return u.INSTANCE.addValue(e),e}onTransaction(t,e){let n={handlerName:I(),handler:o(async a=>{let s=a.transaction,i=new h(this.config.chainId,this.config.name??this.config.address??"",s,this.config.address??s.vout?.[0]?.scriptPubKey?.address);return await t(s,i),i.stopAndGetResult()},"handler"),filter:e};return this.callHandlers.push(n),this}onInterval(t,e,n,a){e&&e.backfillInterval<e.recentInterval&&(e.backfillInterval=e.recentInterval);let s=this;return this.blockHandlers.push({blockInterval:n,timeIntervalInMinutes:e,handlerName:I(),handler:o(async function(i){let d=i.block;if(!d)throw new g.ServerError(g.Status.INVALID_ARGUMENT,"Block is empty");let p={...d};a?.getTransactions&&(p.tx=d.rawtx?.map(L=>L));let y=new m(s.config.chainId,s.config.name??s.config.address??"",p,s.config.address);return await t(p,y),y.stopAndGetResult()},"handler"),fetchConfig:a}),this}onBlockInterval(t,e=250,n=1e3,a){return this.onInterval(t,void 0,{recentInterval:e,backfillInterval:n},a)}onTimeInterval(t,e=60,n=240,a){return this.onInterval(t,{recentInterval:e,backfillInterval:n},void 0,a)}};import("node:process").then(r=>r.stdout.write(""));function q(r){if(r){let t=_.create(),e=[],n=[],a=[];for(let s of Array.isArray(r)?r:[r]){let{preVOut:i,preTransaction:d,...p}=s;e.push(p),i&&n.push(i),d&&a.push(d)}if(t.filters=b.create({filters:T(e)}),n.length>0){let s=T(n);s&&s.length>0&&(t.preVOut=s[0])}return a.length>0&&(t.preTransaction=C(a)?.[0]),t}}o(q,"toVinFilter");function G(r){if(r){let t=O.create(),e=Array.isArray(r)?r:[r];return t.filters=b.create({filters:T(e)}),t}}o(G,"toVOutFilter");function C(r){return(Array.isArray(r)?r:[r]).map(e=>({filter:T(e.filter),inputFilter:q(e.inputFilter),outputFilter:G(e.outputFilter)}))}o(C,"filters2Proto");function z(r){let t=P.create();r instanceof Date&&(t.eq=l(r)),typeof r=="number"&&(t.eq=l(r)),typeof r=="string"&&(t.eq=l(r)),r instanceof v&&(t.eq=l(r)),typeof r=="bigint"&&(t.eq=l(r)),typeof r=="boolean"&&(t.eq=l(r)),Array.isArray(r)&&(t.in={values:r.map(e=>l(e))});for(let[e,n]of Object.entries(r))switch(e){case"prefix":case"contains":case"notContains":t[e]=n.toString();break;case"length":t.lengthEq=n;break;case"lengthGt":case"lengthLt":t[e]=n;break;case"hasAny":case"hasAll":case"in":t[e]={values:n.map(a=>l(a))};break;case"eq":case"gt":case"gte":case"lt":case"lte":case"ne":t[e]=l(n);break;default:throw new Error("Unknown condition op: "+e)}return t}o(z,"toCondition");function T(r){if(r&&r.length>0){let t=[];for(let e of r){let n=N.create();for(let[a,s]of Object.entries(e))n.conditions[a]=z(s);t.push(n)}return t}return[]}o(T,"convertFilters");import("node:process").then(r=>r.stdout.write(""));import{errorString as D,GLOBAL_CONFIG as S,mergeProcessResults as E,Plugin as K,PluginManager as U,USER_PROCESSOR as j}from"@sentio/runtime";var c=x(A(),1);var k=class extends K{static{o(this,"BTCPlugin")}name="BTCPlugin";handlers={txHandlers:[],blockHandlers:[]};async configure(t){let e={txHandlers:[],blockHandlers:[]};for(let n of u.INSTANCE.getValues()){let a=V.fromPartial({processorType:j,contract:{name:n.config.name,chainId:n.config.chainId.toString(),address:n.config.address||"*",abi:""},startBlock:n.config.startBlock,endBlock:n.config.endBlock});for(let s of n.callHandlers){let i=e.txHandlers.push(s.handler)-1,d=s.handlerName;s.filter?a.btcTransactionConfigs.push({filters:C(s.filter),handlerId:i,handlerName:d}):a.contract?.address!="*"&&a.btcTransactionConfigs.push({filters:C({outputFilter:{script_address:n.config.address}}),handlerId:i,handlerName:d})}for(let s of n.blockHandlers){let i=e.blockHandlers.push(s.handler)-1;a.intervalConfigs.push({slot:0,slotInterval:s.blockInterval,minutes:0,minutesInterval:s.timeIntervalInMinutes,handlerId:i,handlerName:s.handlerName,fetchConfig:{transaction:s.fetchConfig?.getTransactions??!1,trace:!1,block:!0,transactionReceipt:!1,transactionReceiptLogs:!1}})}t.contractConfigs.push(a)}this.handlers=e}supportedHandlers=[f.BTC_TRANSACTION,f.BTC_BLOCK];processBinding(t){switch(t.handlerType){case f.BTC_TRANSACTION:return this.processTransaction(t);case f.BTC_BLOCK:return this.processBlock(t);default:throw new c.ServerError(c.Status.INVALID_ARGUMENT,"No handle type registered "+t.handlerType)}}async start(t){}stateDiff(t){return H.INSTANCE.getValues().length!==t.templateInstances.length}async processTransaction(t){if(!t.data?.btcTransaction)throw new c.ServerError(c.Status.INVALID_ARGUMENT,"BTCEvents can't be null");let e=[],n=t.data?.btcTransaction;for(let a of t.handlerIds){let s=this.handlers.txHandlers[a](t.data?.btcTransaction).catch(i=>{throw new c.ServerError(c.Status.INTERNAL,"error processing transaction: "+JSON.stringify(n)+`
3
3
  `+D(i))});S.execution.sequential&&await s,e.push(s)}return E(await Promise.all(e))}async processBlock(t){if(!t.data?.btcBlock)throw new c.ServerError(c.Status.INVALID_ARGUMENT,"Block can't be empty");let e=t.data.btcBlock,n=[];for(let a of t.handlerIds){let s=this.handlers.blockHandlers[a](e).catch(i=>{throw new c.ServerError(c.Status.INTERNAL,"error processing block: "+JSON.stringify(e)+`
4
4
  `+D(i))});S.execution.sequential&&await s,n.push(s)}return E(await Promise.all(n))}};U.INSTANCE.register(new k);import("node:process").then(r=>r.stdout.write(""));export{h as a,m as b,u as c,w as d,C as e,k as f};
5
- //# sourceMappingURL=chunk-FKVU72SD.js.map
5
+ //# sourceMappingURL=chunk-EKY3AYVC.js.map
@@ -1,3 +1,3 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{B,F as u,U as O,V as R,W as v,e as y,f as b,i as l,o as i,t as T,w as g,x as m,y as w,z as P}from"./chunk-UUYHTLBU.js";import{a as o,e as S}from"./chunk-G5BIPHMS.js";var C=u.connect("0x0",R),x=class extends y{static{o(this,"ERC20BytesContractView")}constructor(t){super(t),this.callStatic.contract=t}async name(t,e,r){try{return await this.contract.getFunction("name()")(t||{})}catch(a){let s=new Error().stack;throw l(a,void 0,s)}}async totalSupply(t,e,r){try{return await this.contract.getFunction("totalSupply()")(t||{})}catch(a){let s=new Error().stack;throw l(a,void 0,s)}}async decimals(t,e,r){try{return await this.contract.getFunction("decimals()")(t||{})}catch(a){let s=new Error().stack;throw l(a,void 0,s)}}async balanceOf(t,e,r,a){try{return await this.contract.getFunction("balanceOf(address)")(t,e||{})}catch(s){let c=new Error().stack;throw l(s,void 0,c)}}async symbol(t,e,r){try{return await this.contract.getFunction("symbol()")(t||{})}catch(a){let s=new Error().stack;throw l(a,void 0,s)}}async allowance(t,e,r,a,s){try{return await this.contract.getFunction("allowance(address,address)")(t,e,r||{})}catch(c){let d=new Error().stack;throw l(c,void 0,d)}}callStatic={contract:this.contract,async approve(t,e,r,a,s){try{return await this.contract.getFunction("approve(address,uint256)").staticCall(t,e,r||{})}catch(c){let d=new Error().stack;throw l(c,void 0,d)}},async transferFrom(t,e,r,a,s,c){try{return await this.contract.getFunction("transferFrom(address,address,uint256)").staticCall(t,e,r,a||{})}catch(d){let F=new Error().stack;throw l(d,void 0,F)}},async transfer(t,e,r,a,s){try{return await this.contract.getFunction("transfer(address,uint256)").staticCall(t,e,r||{})}catch(c){let d=new Error().stack;throw l(c,void 0,d)}}};encodeCall={name(t){return i(t,"name","function name()",[])},approve(t,e,r){return i(r,"approve","function approve(address,uint256)",[t,e])},totalSupply(t){return i(t,"totalSupply","function totalSupply()",[])},transferFrom(t,e,r,a){return i(a,"transferFrom","function transferFrom(address,address,uint256)",[t,e,r])},decimals(t){return i(t,"decimals","function decimals()",[])},balanceOf(t,e){return i(e,"balanceOf","function balanceOf(address)",[t])},symbol(t){return i(t,"symbol","function symbol()",[])},transfer(t,e,r){return i(r,"transfer","function transfer(address,uint256)",[t,e])},allowance(t,e,r){return i(r,"allowance","function allowance(address,address)",[t,e])}}},h=class extends b{static{o(this,"ERC20BytesBoundContractView")}async name(t){return await this.view.name({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async totalSupply(t){return await this.view.totalSupply({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async decimals(t){return await this.view.decimals({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async balanceOf(t,e){return await this.view.balanceOf(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async symbol(t){return await this.view.symbol({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async allowance(t,e,r){return await this.view.allowance(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())}callStatic={view:this.view,context:this.context,async approve(t,e,r){return await this.view.callStatic.approve(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())},async transferFrom(t,e,r,a){return await this.view.callStatic.transferFrom(t,e,r,{blockTag:this.context.blockNumber,...a},this.context.preparedData,this.context.getEthCallContext())},async transfer(t,e,r){return await this.view.callStatic.transfer(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())}};encodeCall={view:this.view,context:this.context,name(t){return this.view.encodeCall.name({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},approve(t,e,r){return this.view.encodeCall.approve(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})},totalSupply(t){return this.view.encodeCall.totalSupply({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},transferFrom(t,e,r,a){return this.view.encodeCall.transferFrom(t,e,r,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(a)})},decimals(t){return this.view.encodeCall.decimals({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},balanceOf(t,e){return this.view.encodeCall.balanceOf(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},symbol(t){return this.view.encodeCall.symbol({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},transfer(t,e,r){return this.view.encodeCall.transfer(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})},allowance(t,e,r){return this.view.encodeCall.allowance(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})}}},E=class n extends T{static{o(this,"ERC20BytesProcessor")}onEventApproval(t,e,r,a){return e||(e=C.filters["Approval(address,address,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onEventTransfer(t,e,r,a){return e||(e=C.filters["Transfer(address,address,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onCallName(t,e,r){return super.onEthTrace("0x06fdde03",t,e,r)}onCallApprove(t,e,r){return super.onEthTrace("0x095ea7b3",t,e,r)}onCallTotalSupply(t,e,r){return super.onEthTrace("0x18160ddd",t,e,r)}onCallTransferFrom(t,e,r){return super.onEthTrace("0x23b872dd",t,e,r)}onCallDecimals(t,e,r){return super.onEthTrace("0x313ce567",t,e,r)}onCallBalanceOf(t,e,r){return super.onEthTrace("0x70a08231",t,e,r)}onCallSymbol(t,e,r){return super.onEthTrace("0x95d89b41",t,e,r)}onCallTransfer(t,e,r){return super.onEthTrace("0xa9059cbb",t,e,r)}onCallAllowance(t,e,r){return super.onEthTrace("0xdd62ed3e",t,e,r)}static filters={Approval(t,e,r){return C.filters["Approval(address,address,uint256)"](t,e,r)},Transfer(t,e,r){return C.filters["Transfer(address,address,uint256)"](t,e,r)}};CreateBoundContractView(){let t=p(this.config.network,this.config.address);return new h(this.config.address,t)}static bind(t){t.name||(t.name="ERC20Bytes");let e=g(t);return e||(e=new n(t),m(t,e)),e}},f=class extends B{static{o(this,"ERC20BytesProcessorTemplate")}bindInternal(t){t.name||(t.name="ERC20Bytes");let e=g(t);return e||(e=new E(t),m(t,e)),e}onEventApproval(t,e,r,a){return e||(e=C.filters["Approval(address,address,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onEventTransfer(t,e,r,a){return e||(e=C.filters["Transfer(address,address,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}};function p(n,t){let e=w("ERC20Bytes",t,n);if(!e){let r=u.connect(t,O(n));e=new x(r),P("ERC20Bytes",t,n,e)}return e}o(p,"getERC20BytesContract");function A(n,t){let e=p(n.getChainId(),t),r=new h(t,e);return r.context=n,r.callStatic&&(r.callStatic.context=n),r}o(A,"getERC20BytesContractOnContext");import("node:process").then(n=>n.stdout.write(""));var N={};S(N,{ERC20BytesBoundContractView:()=>h,ERC20BytesContractView:()=>x,ERC20BytesProcessor:()=>E,ERC20BytesProcessorTemplate:()=>f,ERC20Bytes__factory:()=>u,getERC20BytesContract:()=>p,getERC20BytesContractOnContext:()=>A,mockApprovalLog:()=>D,mockTransferLog:()=>I});var k={blockHash:"0x0000000000000000000000000000000000000000000000000000000000000000",blockNumber:0,logIndex:0,removed:!1,transactionHash:"0x0000000000000000000000000000000000000000000000000000000000000000",transactionIndex:0};function D(n,t){let r=p(v.EthChainId.ETHEREUM,n).rawContract.interface.encodeEventLog("Approval(address,address,uint256)",[t.owner,t.spender,t.value]);return{...k,index:0,address:n,data:r.data,topics:r.topics}}o(D,"mockApprovalLog");function I(n,t){let r=p(v.EthChainId.ETHEREUM,n).rawContract.interface.encodeEventLog("Transfer(address,address,uint256)",[t.from,t.to,t.value]);return{...k,index:0,address:n,data:r.data,topics:r.topics}}o(I,"mockTransferLog");import("node:process").then(n=>n.stdout.write(""));import("node:process").then(n=>n.stdout.write(""));import("node:process").then(n=>n.stdout.write(""));export{E as a,f as b,p as c,N as d};
3
- //# sourceMappingURL=chunk-T5ZWWDR3.js.map
2
+ import{B,F as u,U as O,V as R,W as v,e as y,f as b,i as l,o as i,t as T,w as g,x as m,y as w,z as P}from"./chunk-KNV3FDUD.js";import{a as o,e as S}from"./chunk-G5BIPHMS.js";var C=u.connect("0x0",R),x=class extends y{static{o(this,"ERC20BytesContractView")}constructor(t){super(t),this.callStatic.contract=t}async name(t,e,r){try{return await this.contract.getFunction("name()")(t||{})}catch(a){let s=new Error().stack;throw l(a,void 0,s)}}async totalSupply(t,e,r){try{return await this.contract.getFunction("totalSupply()")(t||{})}catch(a){let s=new Error().stack;throw l(a,void 0,s)}}async decimals(t,e,r){try{return await this.contract.getFunction("decimals()")(t||{})}catch(a){let s=new Error().stack;throw l(a,void 0,s)}}async balanceOf(t,e,r,a){try{return await this.contract.getFunction("balanceOf(address)")(t,e||{})}catch(s){let c=new Error().stack;throw l(s,void 0,c)}}async symbol(t,e,r){try{return await this.contract.getFunction("symbol()")(t||{})}catch(a){let s=new Error().stack;throw l(a,void 0,s)}}async allowance(t,e,r,a,s){try{return await this.contract.getFunction("allowance(address,address)")(t,e,r||{})}catch(c){let d=new Error().stack;throw l(c,void 0,d)}}callStatic={contract:this.contract,async approve(t,e,r,a,s){try{return await this.contract.getFunction("approve(address,uint256)").staticCall(t,e,r||{})}catch(c){let d=new Error().stack;throw l(c,void 0,d)}},async transferFrom(t,e,r,a,s,c){try{return await this.contract.getFunction("transferFrom(address,address,uint256)").staticCall(t,e,r,a||{})}catch(d){let F=new Error().stack;throw l(d,void 0,F)}},async transfer(t,e,r,a,s){try{return await this.contract.getFunction("transfer(address,uint256)").staticCall(t,e,r||{})}catch(c){let d=new Error().stack;throw l(c,void 0,d)}}};encodeCall={name(t){return i(t,"name","function name()",[])},approve(t,e,r){return i(r,"approve","function approve(address,uint256)",[t,e])},totalSupply(t){return i(t,"totalSupply","function totalSupply()",[])},transferFrom(t,e,r,a){return i(a,"transferFrom","function transferFrom(address,address,uint256)",[t,e,r])},decimals(t){return i(t,"decimals","function decimals()",[])},balanceOf(t,e){return i(e,"balanceOf","function balanceOf(address)",[t])},symbol(t){return i(t,"symbol","function symbol()",[])},transfer(t,e,r){return i(r,"transfer","function transfer(address,uint256)",[t,e])},allowance(t,e,r){return i(r,"allowance","function allowance(address,address)",[t,e])}}},h=class extends b{static{o(this,"ERC20BytesBoundContractView")}async name(t){return await this.view.name({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async totalSupply(t){return await this.view.totalSupply({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async decimals(t){return await this.view.decimals({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async balanceOf(t,e){return await this.view.balanceOf(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async symbol(t){return await this.view.symbol({blockTag:this.context.blockNumber,...t},this.context.preparedData,this.context.getEthCallContext())}async allowance(t,e,r){return await this.view.allowance(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())}callStatic={view:this.view,context:this.context,async approve(t,e,r){return await this.view.callStatic.approve(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())},async transferFrom(t,e,r,a){return await this.view.callStatic.transferFrom(t,e,r,{blockTag:this.context.blockNumber,...a},this.context.preparedData,this.context.getEthCallContext())},async transfer(t,e,r){return await this.view.callStatic.transfer(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())}};encodeCall={view:this.view,context:this.context,name(t){return this.view.encodeCall.name({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},approve(t,e,r){return this.view.encodeCall.approve(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})},totalSupply(t){return this.view.encodeCall.totalSupply({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},transferFrom(t,e,r,a){return this.view.encodeCall.transferFrom(t,e,r,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(a)})},decimals(t){return this.view.encodeCall.decimals({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},balanceOf(t,e){return this.view.encodeCall.balanceOf(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},symbol(t){return this.view.encodeCall.symbol({chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(t)})},transfer(t,e,r){return this.view.encodeCall.transfer(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})},allowance(t,e,r){return this.view.encodeCall.allowance(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})}}},E=class n extends T{static{o(this,"ERC20BytesProcessor")}onEventApproval(t,e,r,a){return e||(e=C.filters["Approval(address,address,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onEventTransfer(t,e,r,a){return e||(e=C.filters["Transfer(address,address,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onCallName(t,e,r){return super.onEthTrace("0x06fdde03",t,e,r)}onCallApprove(t,e,r){return super.onEthTrace("0x095ea7b3",t,e,r)}onCallTotalSupply(t,e,r){return super.onEthTrace("0x18160ddd",t,e,r)}onCallTransferFrom(t,e,r){return super.onEthTrace("0x23b872dd",t,e,r)}onCallDecimals(t,e,r){return super.onEthTrace("0x313ce567",t,e,r)}onCallBalanceOf(t,e,r){return super.onEthTrace("0x70a08231",t,e,r)}onCallSymbol(t,e,r){return super.onEthTrace("0x95d89b41",t,e,r)}onCallTransfer(t,e,r){return super.onEthTrace("0xa9059cbb",t,e,r)}onCallAllowance(t,e,r){return super.onEthTrace("0xdd62ed3e",t,e,r)}static filters={Approval(t,e,r){return C.filters["Approval(address,address,uint256)"](t,e,r)},Transfer(t,e,r){return C.filters["Transfer(address,address,uint256)"](t,e,r)}};CreateBoundContractView(){let t=p(this.config.network,this.config.address);return new h(this.config.address,t)}static bind(t){t.name||(t.name="ERC20Bytes");let e=g(t);return e||(e=new n(t),m(t,e)),e}},f=class extends B{static{o(this,"ERC20BytesProcessorTemplate")}bindInternal(t){t.name||(t.name="ERC20Bytes");let e=g(t);return e||(e=new E(t),m(t,e)),e}onEventApproval(t,e,r,a){return e||(e=C.filters["Approval(address,address,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}onEventTransfer(t,e,r,a){return e||(e=C.filters["Transfer(address,address,uint256)"](null,null,null)),super.onEthEvent(t,e,r,a)}};function p(n,t){let e=w("ERC20Bytes",t,n);if(!e){let r=u.connect(t,O(n));e=new x(r),P("ERC20Bytes",t,n,e)}return e}o(p,"getERC20BytesContract");function A(n,t){let e=p(n.getChainId(),t),r=new h(t,e);return r.context=n,r.callStatic&&(r.callStatic.context=n),r}o(A,"getERC20BytesContractOnContext");import("node:process").then(n=>n.stdout.write(""));var N={};S(N,{ERC20BytesBoundContractView:()=>h,ERC20BytesContractView:()=>x,ERC20BytesProcessor:()=>E,ERC20BytesProcessorTemplate:()=>f,ERC20Bytes__factory:()=>u,getERC20BytesContract:()=>p,getERC20BytesContractOnContext:()=>A,mockApprovalLog:()=>D,mockTransferLog:()=>I});var k={blockHash:"0x0000000000000000000000000000000000000000000000000000000000000000",blockNumber:0,logIndex:0,removed:!1,transactionHash:"0x0000000000000000000000000000000000000000000000000000000000000000",transactionIndex:0};function D(n,t){let r=p(v.EthChainId.ETHEREUM,n).rawContract.interface.encodeEventLog("Approval(address,address,uint256)",[t.owner,t.spender,t.value]);return{...k,index:0,address:n,data:r.data,topics:r.topics}}o(D,"mockApprovalLog");function I(n,t){let r=p(v.EthChainId.ETHEREUM,n).rawContract.interface.encodeEventLog("Transfer(address,address,uint256)",[t.from,t.to,t.value]);return{...k,index:0,address:n,data:r.data,topics:r.topics}}o(I,"mockTransferLog");import("node:process").then(n=>n.stdout.write(""));import("node:process").then(n=>n.stdout.write(""));import("node:process").then(n=>n.stdout.write(""));export{E as a,f as b,p as c,N as d};
3
+ //# sourceMappingURL=chunk-EOYTRF5D.js.map