@sentio/sdk-bundle 2.55.0 → 2.55.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 (73) 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-I7TWNRII.js → chunk-24TKIKAC.js} +2 -2
  9. package/lib/{chunk-ECZHCPDZ.js → chunk-26VKFV5Y.js} +2 -2
  10. package/lib/{chunk-F3FKHNF5.js → chunk-4ZKROMHQ.js} +2 -2
  11. package/lib/{chunk-D2L7KWZ2.js → chunk-5NXOOGVA.js} +2 -2
  12. package/lib/{chunk-MD3T4H6B.js → chunk-6P4HU4KH.js} +2 -2
  13. package/lib/{chunk-4VKVPYSL.js → chunk-A3BBP3JY.js} +2 -2
  14. package/lib/{chunk-JL6D6MPI.js → chunk-CQUL5GH2.js} +2 -2
  15. package/lib/{chunk-P2KJHIUL.js → chunk-EJ3LB3BV.js} +2 -2
  16. package/lib/{chunk-KV6ZVB7D.js → chunk-HWODJFVJ.js} +2 -2
  17. package/lib/{chunk-B3UDK7W6.js → chunk-JUDV27KS.js} +2 -2
  18. package/lib/{chunk-YQ55FG72.js → chunk-NEZRMKYM.js} +2 -2
  19. package/lib/{chunk-UQPDY6MT.js → chunk-QR7CH6SO.js} +2 -2
  20. package/lib/{chunk-BS7I2ZMW.js → chunk-RIHABKWB.js} +2 -2
  21. package/lib/{chunk-WR6FD24P.js → chunk-RZTTP64K.js} +2 -2
  22. package/lib/{chunk-QHT2WN3B.js → chunk-SQBMMGFT.js} +2 -2
  23. package/lib/{chunk-JVCO6QTF.js → chunk-SXK7O76Y.js} +2 -2
  24. package/lib/{chunk-N2VKAC4J.js → chunk-VA46M7OL.js} +2 -2
  25. package/lib/{chunk-CX3O4KA4.js → chunk-VLD3QNSH.js} +105 -105
  26. package/lib/{chunk-CX3O4KA4.js.map → chunk-VLD3QNSH.js.map} +1 -1
  27. package/lib/{chunk-MO32SIXZ.js → chunk-YQ346IMF.js} +2 -2
  28. package/lib/chunk-ZSDI5U4B.js +6 -0
  29. package/lib/chunk-ZSDI5U4B.js.map +1 -0
  30. package/lib/core/index.js +1 -1
  31. package/lib/eth/builtin/eacaggregatorproxy.js +1 -1
  32. package/lib/eth/builtin/erc1155.js +1 -1
  33. package/lib/eth/builtin/erc20.js +1 -1
  34. package/lib/eth/builtin/erc721.js +1 -1
  35. package/lib/eth/builtin/index.js +1 -1
  36. package/lib/eth/builtin/weth9.js +1 -1
  37. package/lib/eth/index.js +1 -1
  38. package/lib/fuel/index.js +1 -1
  39. package/lib/index.js +1 -1
  40. package/lib/move/index.js +1 -1
  41. package/lib/solana/builtin/index.js +1 -1
  42. package/lib/solana/index.js +1 -1
  43. package/lib/stark/index.js +1 -1
  44. package/lib/store/index.js +1 -1
  45. package/lib/sui/builtin/0x1.js +1 -1
  46. package/lib/sui/builtin/0x2.js +1 -1
  47. package/lib/sui/builtin/0x3.js +1 -1
  48. package/lib/sui/builtin/index.js +1 -1
  49. package/lib/sui/ext/index.js +1 -1
  50. package/lib/sui/index.js +1 -1
  51. package/lib/testing/index.js +1 -1
  52. package/lib/utils/index.js +1 -1
  53. package/package.json +2 -2
  54. package/lib/chunk-SUNKPJCY.js +0 -6
  55. package/lib/chunk-SUNKPJCY.js.map +0 -1
  56. /package/lib/{chunk-I7TWNRII.js.map → chunk-24TKIKAC.js.map} +0 -0
  57. /package/lib/{chunk-ECZHCPDZ.js.map → chunk-26VKFV5Y.js.map} +0 -0
  58. /package/lib/{chunk-F3FKHNF5.js.map → chunk-4ZKROMHQ.js.map} +0 -0
  59. /package/lib/{chunk-D2L7KWZ2.js.map → chunk-5NXOOGVA.js.map} +0 -0
  60. /package/lib/{chunk-MD3T4H6B.js.map → chunk-6P4HU4KH.js.map} +0 -0
  61. /package/lib/{chunk-4VKVPYSL.js.map → chunk-A3BBP3JY.js.map} +0 -0
  62. /package/lib/{chunk-JL6D6MPI.js.map → chunk-CQUL5GH2.js.map} +0 -0
  63. /package/lib/{chunk-P2KJHIUL.js.map → chunk-EJ3LB3BV.js.map} +0 -0
  64. /package/lib/{chunk-KV6ZVB7D.js.map → chunk-HWODJFVJ.js.map} +0 -0
  65. /package/lib/{chunk-B3UDK7W6.js.map → chunk-JUDV27KS.js.map} +0 -0
  66. /package/lib/{chunk-YQ55FG72.js.map → chunk-NEZRMKYM.js.map} +0 -0
  67. /package/lib/{chunk-UQPDY6MT.js.map → chunk-QR7CH6SO.js.map} +0 -0
  68. /package/lib/{chunk-BS7I2ZMW.js.map → chunk-RIHABKWB.js.map} +0 -0
  69. /package/lib/{chunk-WR6FD24P.js.map → chunk-RZTTP64K.js.map} +0 -0
  70. /package/lib/{chunk-QHT2WN3B.js.map → chunk-SQBMMGFT.js.map} +0 -0
  71. /package/lib/{chunk-JVCO6QTF.js.map → chunk-SXK7O76Y.js.map} +0 -0
  72. /package/lib/{chunk-N2VKAC4J.js.map → chunk-VA46M7OL.js.map} +0 -0
  73. /package/lib/{chunk-MO32SIXZ.js.map → chunk-YQ346IMF.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 O,D as g,U as w,V as k,W as u,e as B,f as A,i as d,o as p,t as R,w as b,x as T,y as P,z as y}from"./chunk-QHT2WN3B.js";import{a as i,e as S}from"./chunk-G5BIPHMS.js";var V={};S(V,{ERC1155BoundContractView:()=>C,ERC1155ContractView:()=>f,ERC1155Processor:()=>E,ERC1155ProcessorTemplate:()=>F,ERC1155__factory:()=>g,getERC1155Contract:()=>h,getERC1155ContractOnContext:()=>N,mockApprovalForAllLog:()=>U,mockTransferBatchLog:()=>j,mockTransferSingleLog:()=>L,mockURILog:()=>D});var l=g.connect("0x0",k),f=class extends B{static{i(this,"ERC1155ContractView")}constructor(t){super(t),this.callStatic.contract=t}async balanceOf(t,e,r,n,s){try{return await this.contract.getFunction("balanceOf(address,uint256)")(t,e,r||{})}catch(o){let c=new Error().stack;throw d(o,void 0,c)}}async balanceOfBatch(t,e,r,n,s){try{return await this.contract.getFunction("balanceOfBatch(address[],uint256[])")(t,e,r||{})}catch(o){let c=new Error().stack;throw d(o,void 0,c)}}async isApprovedForAll(t,e,r,n,s){try{return await this.contract.getFunction("isApprovedForAll(address,address)")(t,e,r||{})}catch(o){let c=new Error().stack;throw d(o,void 0,c)}}async supportsInterface(t,e,r,n){try{return await this.contract.getFunction("supportsInterface(bytes4)")(t,e||{})}catch(s){let o=new Error().stack;throw d(s,void 0,o)}}async uri(t,e,r,n){try{return await this.contract.getFunction("uri(uint256)")(t,e||{})}catch(s){let o=new Error().stack;throw d(s,void 0,o)}}callStatic={contract:this.contract,async safeBatchTransferFrom(t,e,r,n,s,o,c,I){try{return await this.contract.getFunction("safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)").staticCall(t,e,r,n,s,o||{})}catch(x){let m=new Error().stack;throw d(x,void 0,m)}},async safeTransferFrom(t,e,r,n,s,o,c,I){try{return await this.contract.getFunction("safeTransferFrom(address,address,uint256,uint256,bytes)").staticCall(t,e,r,n,s,o||{})}catch(x){let m=new Error().stack;throw d(x,void 0,m)}},async setApprovalForAll(t,e,r,n,s){try{return await this.contract.getFunction("setApprovalForAll(address,bool)").staticCall(t,e,r||{})}catch(o){let c=new Error().stack;throw d(o,void 0,c)}}};encodeCall={balanceOf(t,e,r){return p(r,"balanceOf","function balanceOf(address,uint256)",[t,e])},balanceOfBatch(t,e,r){return p(r,"balanceOfBatch","function balanceOfBatch(address[],uint256[])",[t,e])},isApprovedForAll(t,e,r){return p(r,"isApprovedForAll","function isApprovedForAll(address,address)",[t,e])},safeBatchTransferFrom(t,e,r,n,s,o){return p(o,"safeBatchTransferFrom","function safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)",[t,e,r,n,s])},safeTransferFrom(t,e,r,n,s,o){return p(o,"safeTransferFrom","function safeTransferFrom(address,address,uint256,uint256,bytes)",[t,e,r,n,s])},setApprovalForAll(t,e,r){return p(r,"setApprovalForAll","function setApprovalForAll(address,bool)",[t,e])},supportsInterface(t,e){return p(e,"supportsInterface","function supportsInterface(bytes4)",[t])},uri(t,e){return p(e,"uri","function uri(uint256)",[t])}}},C=class extends A{static{i(this,"ERC1155BoundContractView")}async balanceOf(t,e,r){return await this.view.balanceOf(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())}async balanceOfBatch(t,e,r){return await this.view.balanceOfBatch(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())}async isApprovedForAll(t,e,r){return await this.view.isApprovedForAll(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())}async supportsInterface(t,e){return await this.view.supportsInterface(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async uri(t,e){return await this.view.uri(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}callStatic={view:this.view,context:this.context,async safeBatchTransferFrom(t,e,r,n,s,o){return await this.view.callStatic.safeBatchTransferFrom(t,e,r,n,s,{blockTag:this.context.blockNumber,...o},this.context.preparedData,this.context.getEthCallContext())},async safeTransferFrom(t,e,r,n,s,o){return await this.view.callStatic.safeTransferFrom(t,e,r,n,s,{blockTag:this.context.blockNumber,...o},this.context.preparedData,this.context.getEthCallContext())},async setApprovalForAll(t,e,r){return await this.view.callStatic.setApprovalForAll(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())}};encodeCall={view:this.view,context:this.context,balanceOf(t,e,r){return this.view.encodeCall.balanceOf(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})},balanceOfBatch(t,e,r){return this.view.encodeCall.balanceOfBatch(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})},isApprovedForAll(t,e,r){return this.view.encodeCall.isApprovedForAll(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})},safeBatchTransferFrom(t,e,r,n,s,o){return this.view.encodeCall.safeBatchTransferFrom(t,e,r,n,s,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(o)})},safeTransferFrom(t,e,r,n,s,o){return this.view.encodeCall.safeTransferFrom(t,e,r,n,s,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(o)})},setApprovalForAll(t,e,r){return this.view.encodeCall.setApprovalForAll(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})},supportsInterface(t,e){return this.view.encodeCall.supportsInterface(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},uri(t,e){return this.view.encodeCall.uri(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})}}},E=class a extends R{static{i(this,"ERC1155Processor")}onEventApprovalForAll(t,e,r,n){return e||(e=l.filters["ApprovalForAll(address,address,bool)"](null,null,null)),super.onEthEvent(t,e,r,n)}onEventTransferBatch(t,e,r,n){return e||(e=l.filters["TransferBatch(address,address,address,uint256[],uint256[])"](null,null,null,null,null)),super.onEthEvent(t,e,r,n)}onEventTransferSingle(t,e,r,n){return e||(e=l.filters["TransferSingle(address,address,address,uint256,uint256)"](null,null,null,null,null)),super.onEthEvent(t,e,r,n)}onEventURI(t,e,r,n){return e||(e=l.filters["URI(string,uint256)"](null,null)),super.onEthEvent(t,e,r,n)}onCallBalanceOf(t,e,r){return super.onEthTrace("0x00fdd58e",t,e,r)}onCallBalanceOfBatch(t,e,r){return super.onEthTrace("0x4e1273f4",t,e,r)}onCallIsApprovedForAll(t,e,r){return super.onEthTrace("0xe985e9c5",t,e,r)}onCallSafeBatchTransferFrom(t,e,r){return super.onEthTrace("0x2eb2c2d6",t,e,r)}onCallSafeTransferFrom(t,e,r){return super.onEthTrace("0xf242432a",t,e,r)}onCallSetApprovalForAll(t,e,r){return super.onEthTrace("0xa22cb465",t,e,r)}onCallSupportsInterface(t,e,r){return super.onEthTrace("0x01ffc9a7",t,e,r)}onCallUri(t,e,r){return super.onEthTrace("0x0e89341c",t,e,r)}static filters={ApprovalForAll(t,e,r){return l.filters["ApprovalForAll(address,address,bool)"](t,e,r)},TransferBatch(t,e,r,n,s){return l.filters["TransferBatch(address,address,address,uint256[],uint256[])"](t,e,r,n,s)},TransferSingle(t,e,r,n,s){return l.filters["TransferSingle(address,address,address,uint256,uint256)"](t,e,r,n,s)},URI(t,e){return l.filters["URI(string,uint256)"](t,e)}};CreateBoundContractView(){let t=h(this.config.network,this.config.address);return new C(this.config.address,t)}static bind(t){t.name||(t.name="ERC1155");let e=b(t);return e||(e=new a(t),T(t,e)),e}},F=class extends O{static{i(this,"ERC1155ProcessorTemplate")}bindInternal(t){t.name||(t.name="ERC1155");let e=b(t);return e||(e=new E(t),T(t,e)),e}onEventApprovalForAll(t,e,r,n){return e||(e=l.filters["ApprovalForAll(address,address,bool)"](null,null,null)),super.onEthEvent(t,e,r,n)}onEventTransferBatch(t,e,r,n){return e||(e=l.filters["TransferBatch(address,address,address,uint256[],uint256[])"](null,null,null,null,null)),super.onEthEvent(t,e,r,n)}onEventTransferSingle(t,e,r,n){return e||(e=l.filters["TransferSingle(address,address,address,uint256,uint256)"](null,null,null,null,null)),super.onEthEvent(t,e,r,n)}onEventURI(t,e,r,n){return e||(e=l.filters["URI(string,uint256)"](null,null)),super.onEthEvent(t,e,r,n)}};function h(a,t){let e=P("ERC1155",t,a);if(!e){let r=g.connect(t,w(a));e=new f(r),y("ERC1155",t,a,e)}return e}i(h,"getERC1155Contract");function N(a,t){let e=h(a.getChainId(),t),r=new C(t,e);return r.context=a,r.callStatic&&(r.callStatic.context=a),r}i(N,"getERC1155ContractOnContext");import("node:process").then(a=>a.stdout.write(""));var v={blockHash:"0x0000000000000000000000000000000000000000000000000000000000000000",blockNumber:0,logIndex:0,removed:!1,transactionHash:"0x0000000000000000000000000000000000000000000000000000000000000000",transactionIndex:0};function U(a,t){let r=h(u.EthChainId.ETHEREUM,a).rawContract.interface.encodeEventLog("ApprovalForAll(address,address,bool)",[t.account,t.operator,t.approved]);return{...v,index:0,address:a,data:r.data,topics:r.topics}}i(U,"mockApprovalForAllLog");function j(a,t){let r=h(u.EthChainId.ETHEREUM,a).rawContract.interface.encodeEventLog("TransferBatch(address,address,address,uint256[],uint256[])",[t.operator,t.from,t.to,t.ids,t.values]);return{...v,index:0,address:a,data:r.data,topics:r.topics}}i(j,"mockTransferBatchLog");function L(a,t){let r=h(u.EthChainId.ETHEREUM,a).rawContract.interface.encodeEventLog("TransferSingle(address,address,address,uint256,uint256)",[t.operator,t.from,t.to,t.id,t.value]);return{...v,index:0,address:a,data:r.data,topics:r.topics}}i(L,"mockTransferSingleLog");function D(a,t){let r=h(u.EthChainId.ETHEREUM,a).rawContract.interface.encodeEventLog("URI(string,uint256)",[t.value,t.id]);return{...v,index:0,address:a,data:r.data,topics:r.topics}}i(D,"mockURILog");import("node:process").then(a=>a.stdout.write(""));import("node:process").then(a=>a.stdout.write(""));import("node:process").then(a=>a.stdout.write(""));export{f as a,C as b,E as c,F as d,h as e,N as f,U as g,j as h,L as i,D as j,V as k};
3
- //# sourceMappingURL=chunk-ECZHCPDZ.js.map
2
+ import{B as O,D as g,U as w,V as k,W as u,e as B,f as A,i as d,o as p,t as R,w as b,x as T,y as P,z as y}from"./chunk-SQBMMGFT.js";import{a as i,e as S}from"./chunk-G5BIPHMS.js";var V={};S(V,{ERC1155BoundContractView:()=>C,ERC1155ContractView:()=>f,ERC1155Processor:()=>E,ERC1155ProcessorTemplate:()=>F,ERC1155__factory:()=>g,getERC1155Contract:()=>h,getERC1155ContractOnContext:()=>N,mockApprovalForAllLog:()=>U,mockTransferBatchLog:()=>j,mockTransferSingleLog:()=>L,mockURILog:()=>D});var l=g.connect("0x0",k),f=class extends B{static{i(this,"ERC1155ContractView")}constructor(t){super(t),this.callStatic.contract=t}async balanceOf(t,e,r,n,s){try{return await this.contract.getFunction("balanceOf(address,uint256)")(t,e,r||{})}catch(o){let c=new Error().stack;throw d(o,void 0,c)}}async balanceOfBatch(t,e,r,n,s){try{return await this.contract.getFunction("balanceOfBatch(address[],uint256[])")(t,e,r||{})}catch(o){let c=new Error().stack;throw d(o,void 0,c)}}async isApprovedForAll(t,e,r,n,s){try{return await this.contract.getFunction("isApprovedForAll(address,address)")(t,e,r||{})}catch(o){let c=new Error().stack;throw d(o,void 0,c)}}async supportsInterface(t,e,r,n){try{return await this.contract.getFunction("supportsInterface(bytes4)")(t,e||{})}catch(s){let o=new Error().stack;throw d(s,void 0,o)}}async uri(t,e,r,n){try{return await this.contract.getFunction("uri(uint256)")(t,e||{})}catch(s){let o=new Error().stack;throw d(s,void 0,o)}}callStatic={contract:this.contract,async safeBatchTransferFrom(t,e,r,n,s,o,c,I){try{return await this.contract.getFunction("safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)").staticCall(t,e,r,n,s,o||{})}catch(x){let m=new Error().stack;throw d(x,void 0,m)}},async safeTransferFrom(t,e,r,n,s,o,c,I){try{return await this.contract.getFunction("safeTransferFrom(address,address,uint256,uint256,bytes)").staticCall(t,e,r,n,s,o||{})}catch(x){let m=new Error().stack;throw d(x,void 0,m)}},async setApprovalForAll(t,e,r,n,s){try{return await this.contract.getFunction("setApprovalForAll(address,bool)").staticCall(t,e,r||{})}catch(o){let c=new Error().stack;throw d(o,void 0,c)}}};encodeCall={balanceOf(t,e,r){return p(r,"balanceOf","function balanceOf(address,uint256)",[t,e])},balanceOfBatch(t,e,r){return p(r,"balanceOfBatch","function balanceOfBatch(address[],uint256[])",[t,e])},isApprovedForAll(t,e,r){return p(r,"isApprovedForAll","function isApprovedForAll(address,address)",[t,e])},safeBatchTransferFrom(t,e,r,n,s,o){return p(o,"safeBatchTransferFrom","function safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)",[t,e,r,n,s])},safeTransferFrom(t,e,r,n,s,o){return p(o,"safeTransferFrom","function safeTransferFrom(address,address,uint256,uint256,bytes)",[t,e,r,n,s])},setApprovalForAll(t,e,r){return p(r,"setApprovalForAll","function setApprovalForAll(address,bool)",[t,e])},supportsInterface(t,e){return p(e,"supportsInterface","function supportsInterface(bytes4)",[t])},uri(t,e){return p(e,"uri","function uri(uint256)",[t])}}},C=class extends A{static{i(this,"ERC1155BoundContractView")}async balanceOf(t,e,r){return await this.view.balanceOf(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())}async balanceOfBatch(t,e,r){return await this.view.balanceOfBatch(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())}async isApprovedForAll(t,e,r){return await this.view.isApprovedForAll(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())}async supportsInterface(t,e){return await this.view.supportsInterface(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}async uri(t,e){return await this.view.uri(t,{blockTag:this.context.blockNumber,...e},this.context.preparedData,this.context.getEthCallContext())}callStatic={view:this.view,context:this.context,async safeBatchTransferFrom(t,e,r,n,s,o){return await this.view.callStatic.safeBatchTransferFrom(t,e,r,n,s,{blockTag:this.context.blockNumber,...o},this.context.preparedData,this.context.getEthCallContext())},async safeTransferFrom(t,e,r,n,s,o){return await this.view.callStatic.safeTransferFrom(t,e,r,n,s,{blockTag:this.context.blockNumber,...o},this.context.preparedData,this.context.getEthCallContext())},async setApprovalForAll(t,e,r){return await this.view.callStatic.setApprovalForAll(t,e,{blockTag:this.context.blockNumber,...r},this.context.preparedData,this.context.getEthCallContext())}};encodeCall={view:this.view,context:this.context,balanceOf(t,e,r){return this.view.encodeCall.balanceOf(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})},balanceOfBatch(t,e,r){return this.view.encodeCall.balanceOfBatch(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})},isApprovedForAll(t,e,r){return this.view.encodeCall.isApprovedForAll(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})},safeBatchTransferFrom(t,e,r,n,s,o){return this.view.encodeCall.safeBatchTransferFrom(t,e,r,n,s,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(o)})},safeTransferFrom(t,e,r,n,s,o){return this.view.encodeCall.safeTransferFrom(t,e,r,n,s,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(o)})},setApprovalForAll(t,e,r){return this.view.encodeCall.setApprovalForAll(t,e,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(r)})},supportsInterface(t,e){return this.view.encodeCall.supportsInterface(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})},uri(t,e){return this.view.encodeCall.uri(t,{chainId:this.context.chainId.toString(),address:this.context.address,blockTag:this.context.getBlockTag(e)})}}},E=class a extends R{static{i(this,"ERC1155Processor")}onEventApprovalForAll(t,e,r,n){return e||(e=l.filters["ApprovalForAll(address,address,bool)"](null,null,null)),super.onEthEvent(t,e,r,n)}onEventTransferBatch(t,e,r,n){return e||(e=l.filters["TransferBatch(address,address,address,uint256[],uint256[])"](null,null,null,null,null)),super.onEthEvent(t,e,r,n)}onEventTransferSingle(t,e,r,n){return e||(e=l.filters["TransferSingle(address,address,address,uint256,uint256)"](null,null,null,null,null)),super.onEthEvent(t,e,r,n)}onEventURI(t,e,r,n){return e||(e=l.filters["URI(string,uint256)"](null,null)),super.onEthEvent(t,e,r,n)}onCallBalanceOf(t,e,r){return super.onEthTrace("0x00fdd58e",t,e,r)}onCallBalanceOfBatch(t,e,r){return super.onEthTrace("0x4e1273f4",t,e,r)}onCallIsApprovedForAll(t,e,r){return super.onEthTrace("0xe985e9c5",t,e,r)}onCallSafeBatchTransferFrom(t,e,r){return super.onEthTrace("0x2eb2c2d6",t,e,r)}onCallSafeTransferFrom(t,e,r){return super.onEthTrace("0xf242432a",t,e,r)}onCallSetApprovalForAll(t,e,r){return super.onEthTrace("0xa22cb465",t,e,r)}onCallSupportsInterface(t,e,r){return super.onEthTrace("0x01ffc9a7",t,e,r)}onCallUri(t,e,r){return super.onEthTrace("0x0e89341c",t,e,r)}static filters={ApprovalForAll(t,e,r){return l.filters["ApprovalForAll(address,address,bool)"](t,e,r)},TransferBatch(t,e,r,n,s){return l.filters["TransferBatch(address,address,address,uint256[],uint256[])"](t,e,r,n,s)},TransferSingle(t,e,r,n,s){return l.filters["TransferSingle(address,address,address,uint256,uint256)"](t,e,r,n,s)},URI(t,e){return l.filters["URI(string,uint256)"](t,e)}};CreateBoundContractView(){let t=h(this.config.network,this.config.address);return new C(this.config.address,t)}static bind(t){t.name||(t.name="ERC1155");let e=b(t);return e||(e=new a(t),T(t,e)),e}},F=class extends O{static{i(this,"ERC1155ProcessorTemplate")}bindInternal(t){t.name||(t.name="ERC1155");let e=b(t);return e||(e=new E(t),T(t,e)),e}onEventApprovalForAll(t,e,r,n){return e||(e=l.filters["ApprovalForAll(address,address,bool)"](null,null,null)),super.onEthEvent(t,e,r,n)}onEventTransferBatch(t,e,r,n){return e||(e=l.filters["TransferBatch(address,address,address,uint256[],uint256[])"](null,null,null,null,null)),super.onEthEvent(t,e,r,n)}onEventTransferSingle(t,e,r,n){return e||(e=l.filters["TransferSingle(address,address,address,uint256,uint256)"](null,null,null,null,null)),super.onEthEvent(t,e,r,n)}onEventURI(t,e,r,n){return e||(e=l.filters["URI(string,uint256)"](null,null)),super.onEthEvent(t,e,r,n)}};function h(a,t){let e=P("ERC1155",t,a);if(!e){let r=g.connect(t,w(a));e=new f(r),y("ERC1155",t,a,e)}return e}i(h,"getERC1155Contract");function N(a,t){let e=h(a.getChainId(),t),r=new C(t,e);return r.context=a,r.callStatic&&(r.callStatic.context=a),r}i(N,"getERC1155ContractOnContext");import("node:process").then(a=>a.stdout.write(""));var v={blockHash:"0x0000000000000000000000000000000000000000000000000000000000000000",blockNumber:0,logIndex:0,removed:!1,transactionHash:"0x0000000000000000000000000000000000000000000000000000000000000000",transactionIndex:0};function U(a,t){let r=h(u.EthChainId.ETHEREUM,a).rawContract.interface.encodeEventLog("ApprovalForAll(address,address,bool)",[t.account,t.operator,t.approved]);return{...v,index:0,address:a,data:r.data,topics:r.topics}}i(U,"mockApprovalForAllLog");function j(a,t){let r=h(u.EthChainId.ETHEREUM,a).rawContract.interface.encodeEventLog("TransferBatch(address,address,address,uint256[],uint256[])",[t.operator,t.from,t.to,t.ids,t.values]);return{...v,index:0,address:a,data:r.data,topics:r.topics}}i(j,"mockTransferBatchLog");function L(a,t){let r=h(u.EthChainId.ETHEREUM,a).rawContract.interface.encodeEventLog("TransferSingle(address,address,address,uint256,uint256)",[t.operator,t.from,t.to,t.id,t.value]);return{...v,index:0,address:a,data:r.data,topics:r.topics}}i(L,"mockTransferSingleLog");function D(a,t){let r=h(u.EthChainId.ETHEREUM,a).rawContract.interface.encodeEventLog("URI(string,uint256)",[t.value,t.id]);return{...v,index:0,address:a,data:r.data,topics:r.topics}}i(D,"mockURILog");import("node:process").then(a=>a.stdout.write(""));import("node:process").then(a=>a.stdout.write(""));import("node:process").then(a=>a.stdout.write(""));export{f as a,C as b,E as c,F as d,h as e,N as f,U as g,j as h,L as i,D as j,V as k};
3
+ //# sourceMappingURL=chunk-26VKFV5Y.js.map
@@ -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-QHT2WN3B.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-F3FKHNF5.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-SQBMMGFT.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-4ZKROMHQ.js.map
@@ -1,5 +1,5 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{b as Il}from"./chunk-FMZDKD72.js";import{c as Sr,d as Nm,e as kl,g as Cm}from"./chunk-JL6D6MPI.js";import{a as Al}from"./chunk-IVMOWPFA.js";import{B as ia,Ed as El,Lc as Rl,Nc as Im,Oc as vm,Tb as Er,U as wl,Ud as Om,hd as Gs,mc as aa,nc as Am,oe as Sl,tc as ca,uc as km,wd as Ys,xd as Tm}from"./chunk-CX3O4KA4.js";import{a,b as ae,c as Pe,d as ce,e as Cn,f as le,g as xn}from"./chunk-G5BIPHMS.js";var Pl=ce((la,Ll)=>{"use strict";var Js=ae("buffer"),Ot=Js.Buffer;function xl(n,e){for(var t in n)e[t]=n[t]}a(xl,"copyProps");Ot.from&&Ot.alloc&&Ot.allocUnsafe&&Ot.allocUnsafeSlow?Ll.exports=Js:(xl(Js,la),la.Buffer=Ar);function Ar(n,e,t){return Ot(n,e,t)}a(Ar,"SafeBuffer");Ar.prototype=Object.create(Ot.prototype);xl(Ot,Ar);Ar.from=function(n,e,t){if(typeof n=="number")throw new TypeError("Argument must not be a number");return Ot(n,e,t)};Ar.alloc=function(n,e,t){if(typeof n!="number")throw new TypeError("Argument must be a number");var r=Ot(n);return e!==void 0?typeof t=="string"?r.fill(e,t):r.fill(e):r.fill(0),r};Ar.allocUnsafe=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return Ot(n)};Ar.allocUnsafeSlow=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return Js.SlowBuffer(n)}});var Ul=ce((tE,Bl)=>{"use strict";var Zs=Pl().Buffer;function Dm(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),t=0;t<e.length;t++)e[t]=255;for(var r=0;r<n.length;r++){var o=n.charAt(r),s=o.charCodeAt(0);if(e[s]!==255)throw new TypeError(o+" is ambiguous");e[s]=r}var i=n.length,u=n.charAt(0),f=Math.log(i)/Math.log(256),y=Math.log(256)/Math.log(i);function d(R){if((Array.isArray(R)||R instanceof Uint8Array)&&(R=Zs.from(R)),!Zs.isBuffer(R))throw new TypeError("Expected Buffer");if(R.length===0)return"";for(var S=0,A=0,C=0,x=R.length;C!==x&&R[C]===0;)C++,S++;for(var w=(x-C)*y+1>>>0,L=new Uint8Array(w);C!==x;){for(var z=R[C],Y=0,ne=w-1;(z!==0||Y<A)&&ne!==-1;ne--,Y++)z+=256*L[ne]>>>0,L[ne]=z%i>>>0,z=z/i>>>0;if(z!==0)throw new Error("Non-zero carry");A=Y,C++}for(var re=w-A;re!==w&&L[re]===0;)re++;for(var Se=u.repeat(S);re<w;++re)Se+=n.charAt(L[re]);return Se}a(d,"encode");function _(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return Zs.alloc(0);for(var S=0,A=0,C=0;R[S]===u;)A++,S++;for(var x=(R.length-S)*f+1>>>0,w=new Uint8Array(x);R[S];){var L=e[R.charCodeAt(S)];if(L===255)return;for(var z=0,Y=x-1;(L!==0||z<C)&&Y!==-1;Y--,z++)L+=i*w[Y]>>>0,w[Y]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");C=z,S++}for(var ne=x-C;ne!==x&&w[ne]===0;)ne++;var re=Zs.allocUnsafe(A+(x-ne));re.fill(0,0,A);for(var Se=A;ne!==x;)re[Se++]=w[ne++];return re}a(_,"decodeUnsafe");function E(R){var S=_(R);if(S)return S;throw new Error("Non-base"+i+" character")}return a(E,"decode"),{encode:d,decodeUnsafe:_,decode:E}}a(Dm,"base");Bl.exports=Dm});var Gr=ce((nE,Dl)=>{"use strict";var Mm=Ul(),$m="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";Dl.exports=Mm($m)});var Ml=ce(ha=>{"use strict";function Ft(n,e,t){return e<=n&&n<=t}a(Ft,"inRange");function no(n){if(n===void 0)return{};if(n===Object(n))return n;throw TypeError("Could not convert argument to dictionary")}a(no,"ToDictionary");function Hm(n){for(var e=String(n),t=e.length,r=0,o=[];r<t;){var s=e.charCodeAt(r);if(s<55296||s>57343)o.push(s);else if(56320<=s&&s<=57343)o.push(65533);else if(55296<=s&&s<=56319)if(r===t-1)o.push(65533);else{var i=n.charCodeAt(r+1);if(56320<=i&&i<=57343){var u=s&1023,f=i&1023;o.push(65536+(u<<10)+f),r+=1}else o.push(65533)}r+=1}return o}a(Hm,"stringToCodePoints");function zm(n){for(var e="",t=0;t<n.length;++t){var r=n[t];r<=65535?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return e}a(zm,"codePointsToString");var Qs=-1;function da(n){this.tokens=[].slice.call(n)}a(da,"Stream");da.prototype={endOfStream:a(function(){return!this.tokens.length},"endOfStream"),read:a(function(){return this.tokens.length?this.tokens.shift():Qs},"read"),prepend:a(function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(n)},"prepend"),push:a(function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.push(e.shift());else this.tokens.push(n)},"push")};var Yr=-1;function fa(n,e){if(n)throw TypeError("Decoder error");return e||65533}a(fa,"decoderError");var eo="utf-8";function to(n,e){if(!(this instanceof to))return new to(n,e);if(n=n!==void 0?String(n).toLowerCase():eo,n!==eo)throw new Error("Encoding not supported. Only utf-8 is supported");e=no(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}a(to,"TextDecoder");to.prototype={decode:a(function(e,t){var r;typeof e=="object"&&e instanceof ArrayBuffer?r=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):r=new Uint8Array(0),t=no(t),this._streaming||(this._decoder=new Fm({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var o=new da(r),s=[],i;!o.endOfStream()&&(i=this._decoder.handler(o,o.read()),i!==Yr);)i!==null&&(Array.isArray(i)?s.push.apply(s,i):s.push(i));if(!this._streaming){do{if(i=this._decoder.handler(o,o.read()),i===Yr)break;i!==null&&(Array.isArray(i)?s.push.apply(s,i):s.push(i))}while(!o.endOfStream());this._decoder=null}return s.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(s[0]===65279?(this._BOMseen=!0,s.shift()):this._BOMseen=!0),zm(s)},"decode")};function ro(n,e){if(!(this instanceof ro))return new ro(n,e);if(n=n!==void 0?String(n).toLowerCase():eo,n!==eo)throw new Error("Encoding not supported. Only utf-8 is supported");e=no(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}a(ro,"TextEncoder");ro.prototype={encode:a(function(e,t){e=e?String(e):"",t=no(t),this._streaming||(this._encoder=new Wm(this._options)),this._streaming=!!t.stream;for(var r=[],o=new da(Hm(e)),s;!o.endOfStream()&&(s=this._encoder.handler(o,o.read()),s!==Yr);)Array.isArray(s)?r.push.apply(r,s):r.push(s);if(!this._streaming){for(;s=this._encoder.handler(o,o.read()),s!==Yr;)Array.isArray(s)?r.push.apply(r,s):r.push(s);this._encoder=null}return new Uint8Array(r)},"encode")};function Fm(n){var e=n.fatal,t=0,r=0,o=0,s=128,i=191;this.handler=function(u,f){if(f===Qs&&o!==0)return o=0,fa(e);if(f===Qs)return Yr;if(o===0){if(Ft(f,0,127))return f;if(Ft(f,194,223))o=1,t=f-192;else if(Ft(f,224,239))f===224&&(s=160),f===237&&(i=159),o=2,t=f-224;else if(Ft(f,240,244))f===240&&(s=144),f===244&&(i=143),o=3,t=f-240;else return fa(e);return t=t<<6*o,null}if(!Ft(f,s,i))return t=o=r=0,s=128,i=191,u.prepend(f),fa(e);if(s=128,i=191,r+=1,t+=f-128<<6*(o-r),r!==o)return null;var y=t;return t=o=r=0,y}}a(Fm,"UTF8Decoder");function Wm(n){var e=n.fatal;this.handler=function(t,r){if(r===Qs)return Yr;if(Ft(r,0,127))return r;var o,s;Ft(r,128,2047)?(o=1,s=192):Ft(r,2048,65535)?(o=2,s=224):Ft(r,65536,1114111)&&(o=3,s=240);for(var i=[(r>>6*o)+s];o>0;){var u=r>>6*(o-1);i.push(128|u&63),o-=1}return i}}a(Wm,"UTF8Encoder");ha.TextEncoder=ro;ha.TextDecoder=to});var Wl=ce(Ee=>{"use strict";var Km=Ee&&Ee.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t),Object.defineProperty(n,r,{enumerable:!0,get:a(function(){return e[t]},"get")})}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),qm=Ee&&Ee.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),Nt=Ee&&Ee.__decorate||function(n,e,t,r){var o=arguments.length,s=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var u=n.length-1;u>=0;u--)(i=n[u])&&(s=(o<3?i(s):o>3?i(e,t,s):i(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},jm=Ee&&Ee.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.hasOwnProperty.call(n,t)&&Km(e,n,t);return qm(e,n),e},$l=Ee&&Ee.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.deserializeUnchecked=Ee.deserialize=Ee.serialize=Ee.BinaryReader=Ee.BinaryWriter=Ee.BorshError=Ee.baseDecode=Ee.baseEncode=void 0;var nr=$l(Er()),Hl=$l(Gr()),Vm=jm(Ml()),Gm=typeof TextDecoder!="function"?Vm.TextDecoder:TextDecoder,Ym=new Gm("utf-8",{fatal:!0});function Xm(n){return typeof n=="string"&&(n=Buffer.from(n,"utf8")),Hl.default.encode(Buffer.from(n))}a(Xm,"baseEncode");Ee.baseEncode=Xm;function Jm(n){return Buffer.from(Hl.default.decode(n))}a(Jm,"baseDecode");Ee.baseDecode=Jm;var pa=1024,Ke=class extends Error{static{a(this,"BorshError")}constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}};Ee.BorshError=Ke;var so=class{static{a(this,"BinaryWriter")}constructor(){this.buf=Buffer.alloc(pa),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(pa)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(Buffer.from(new nr.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(Buffer.from(new nr.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(Buffer.from(new nr.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(Buffer.from(new nr.default(e).toArray("le",64)))}writeBuffer(e){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),e,Buffer.alloc(pa)]),this.length+=e.length}writeString(e){this.maybeResize();let t=Buffer.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(Buffer.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(let r of e)this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}};Ee.BinaryWriter=so;function Ct(n,e,t){let r=t.value;t.value=function(...o){try{return r.apply(this,o)}catch(s){if(s instanceof RangeError){let i=s.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(i)>=0)throw new Ke("Reached the end of buffer when deserializing")}throw s}}}a(Ct,"handlingRangeError");var Qe=class{static{a(this,"BinaryReader")}constructor(e){this.buf=e,this.offset=0}readU8(){let e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){let e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){let e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){let e=this.readBuffer(8);return new nr.default(e,"le")}readU128(){let e=this.readBuffer(16);return new nr.default(e,"le")}readU256(){let e=this.readBuffer(32);return new nr.default(e,"le")}readU512(){let e=this.readBuffer(64);return new nr.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new Ke(`Expected buffer length ${e} isn't within bounds`);let t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){let e=this.readU32(),t=this.readBuffer(e);try{return Ym.decode(t)}catch(r){throw new Ke(`Error decoding UTF-8 string: ${r}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){let t=this.readU32(),r=Array();for(let o=0;o<t;++o)r.push(e());return r}};Nt([Ct],Qe.prototype,"readU8",null);Nt([Ct],Qe.prototype,"readU16",null);Nt([Ct],Qe.prototype,"readU32",null);Nt([Ct],Qe.prototype,"readU64",null);Nt([Ct],Qe.prototype,"readU128",null);Nt([Ct],Qe.prototype,"readU256",null);Nt([Ct],Qe.prototype,"readU512",null);Nt([Ct],Qe.prototype,"readString",null);Nt([Ct],Qe.prototype,"readFixedArray",null);Nt([Ct],Qe.prototype,"readArray",null);Ee.BinaryReader=Qe;function zl(n){return n.charAt(0).toUpperCase()+n.slice(1)}a(zl,"capitalizeFirstLetter");function kr(n,e,t,r,o){try{if(typeof r=="string")o[`write${zl(r)}`](t);else if(r instanceof Array)if(typeof r[0]=="number"){if(t.length!==r[0])throw new Ke(`Expecting byte array of length ${r[0]}, but got ${t.length} bytes`);o.writeFixedArray(t)}else if(r.length===2&&typeof r[1]=="number"){if(t.length!==r[1])throw new Ke(`Expecting byte array of length ${r[1]}, but got ${t.length} bytes`);for(let s=0;s<r[1];s++)kr(n,null,t[s],r[0],o)}else o.writeArray(t,s=>{kr(n,e,s,r[0],o)});else if(r.kind!==void 0)switch(r.kind){case"option":{t==null?o.writeU8(0):(o.writeU8(1),kr(n,e,t,r.type,o));break}case"map":{o.writeU32(t.size),t.forEach((s,i)=>{kr(n,e,i,r.key,o),kr(n,e,s,r.value,o)});break}default:throw new Ke(`FieldType ${r} unrecognized`)}else Fl(n,t,o)}catch(s){throw s instanceof Ke&&s.addToFieldPath(e),s}}a(kr,"serializeField");function Fl(n,e,t){if(typeof e.borshSerialize=="function"){e.borshSerialize(t);return}let r=n.get(e.constructor);if(!r)throw new Ke(`Class ${e.constructor.name} is missing in schema`);if(r.kind==="struct")r.fields.map(([o,s])=>{kr(n,o,e[o],s,t)});else if(r.kind==="enum"){let o=e[r.field];for(let s=0;s<r.values.length;++s){let[i,u]=r.values[s];if(i===o){t.writeU8(s),kr(n,i,e[i],u,t);break}}}else throw new Ke(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}a(Fl,"serializeStruct");function Zm(n,e,t=so){let r=new t;return Fl(n,e,r),r.toArray()}a(Zm,"serialize");Ee.serialize=Zm;function Ir(n,e,t,r){try{if(typeof t=="string")return r[`read${zl(t)}`]();if(t instanceof Array){if(typeof t[0]=="number")return r.readFixedArray(t[0]);if(typeof t[1]=="number"){let o=[];for(let s=0;s<t[1];s++)o.push(Ir(n,null,t[0],r));return o}else return r.readArray(()=>Ir(n,e,t[0],r))}if(t.kind==="option")return r.readU8()?Ir(n,e,t.type,r):void 0;if(t.kind==="map"){let o=new Map,s=r.readU32();for(let i=0;i<s;i++){let u=Ir(n,e,t.key,r),f=Ir(n,e,t.value,r);o.set(u,f)}return o}return ya(n,t,r)}catch(o){throw o instanceof Ke&&o.addToFieldPath(e),o}}a(Ir,"deserializeField");function ya(n,e,t){if(typeof e.borshDeserialize=="function")return e.borshDeserialize(t);let r=n.get(e);if(!r)throw new Ke(`Class ${e.name} is missing in schema`);if(r.kind==="struct"){let o={};for(let[s,i]of n.get(e).fields)o[s]=Ir(n,s,i,t);return new e(o)}if(r.kind==="enum"){let o=t.readU8();if(o>=r.values.length)throw new Ke(`Enum index: ${o} is out of range`);let[s,i]=r.values[o],u=Ir(n,s,i,t);return new e({[s]:u})}throw new Ke(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}a(ya,"deserializeStruct");function Qm(n,e,t,r=Qe){let o=new r(t),s=ya(n,e,o);if(o.offset<t.length)throw new Ke(`Unexpected ${t.length-o.offset} bytes after deserialized data`);return s}a(Qm,"deserialize");Ee.deserialize=Qm;function eg(n,e,t,r=Qe){let o=new r(t);return ya(n,e,o)}a(eg,"deserializeUnchecked");Ee.deserializeUnchecked=eg});var ba=ce(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.s16=O.s8=O.nu64be=O.u48be=O.u40be=O.u32be=O.u24be=O.u16be=O.nu64=O.u48=O.u40=O.u32=O.u24=O.u16=O.u8=O.offset=O.greedy=O.Constant=O.UTF8=O.CString=O.Blob=O.Boolean=O.BitField=O.BitStructure=O.VariantLayout=O.Union=O.UnionLayoutDiscriminator=O.UnionDiscriminator=O.Structure=O.Sequence=O.DoubleBE=O.Double=O.FloatBE=O.Float=O.NearInt64BE=O.NearInt64=O.NearUInt64BE=O.NearUInt64=O.IntBE=O.Int=O.UIntBE=O.UInt=O.OffsetLayout=O.GreedyCount=O.ExternalLayout=O.bindConstructorLayout=O.nameWithProperty=O.Layout=O.uint8ArrayToBuffer=O.checkUint8Array=void 0;O.constant=O.utf8=O.cstr=O.blob=O.unionLayoutDiscriminator=O.union=O.seq=O.bits=O.struct=O.f64be=O.f64=O.f32be=O.f32=O.ns64be=O.s48be=O.s40be=O.s32be=O.s24be=O.s16be=O.ns64=O.s48=O.s40=O.s32=O.s24=void 0;var ga=ae("buffer");function Zr(n){if(!(n instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}a(Zr,"checkUint8Array");O.checkUint8Array=Zr;function pe(n){return Zr(n),ga.Buffer.from(n.buffer,n.byteOffset,n.length)}a(pe,"uint8ArrayToBuffer");O.uint8ArrayToBuffer=pe;var ge=class{static{a(this,"Layout")}constructor(e,t){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){let t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}};O.Layout=ge;function _a(n,e){return e.property?n+"["+e.property+"]":n}a(_a,"nameWithProperty");O.nameWithProperty=_a;function tg(n,e){if(typeof n!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(n,"layout_"))throw new Error("Class is already bound to a layout");if(!(e&&e instanceof ge))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(e,"boundConstructor_"))throw new Error("layout is already bound to a constructor");n.layout_=e,e.boundConstructor_=n,e.makeDestinationObject=()=>new n,Object.defineProperty(n.prototype,"encode",{value(t,r){return e.encode(this,t,r)},writable:!0}),Object.defineProperty(n,"decode",{value(t,r){return e.decode(t,r)},writable:!0})}a(tg,"bindConstructorLayout");O.bindConstructorLayout=tg;var Ve=class extends ge{static{a(this,"ExternalLayout")}isCount(){throw new Error("ExternalLayout is abstract")}};O.ExternalLayout=Ve;var oo=class extends Ve{static{a(this,"GreedyCount")}constructor(e=1,t){if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t=0){Zr(e);let r=e.length-t;return Math.floor(r/this.elementSpan)}encode(e,t,r){return 0}};O.GreedyCount=oo;var Ln=class extends Ve{static{a(this,"OffsetLayout")}constructor(e,t=0,r){if(!(e instanceof ge))throw new TypeError("layout must be a Layout");if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof tt||this.layout instanceof ct}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,r=0){return this.layout.encode(e,t,r+this.offset)}};O.OffsetLayout=Ln;var tt=class extends ge{static{a(this,"UInt")}constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return pe(e).readUIntLE(t,this.span)}encode(e,t,r=0){return pe(t).writeUIntLE(e,r,this.span),this.span}};O.UInt=tt;var ct=class extends ge{static{a(this,"UIntBE")}constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return pe(e).readUIntBE(t,this.span)}encode(e,t,r=0){return pe(t).writeUIntBE(e,r,this.span),this.span}};O.UIntBE=ct;var Wt=class extends ge{static{a(this,"Int")}constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return pe(e).readIntLE(t,this.span)}encode(e,t,r=0){return pe(t).writeIntLE(e,r,this.span),this.span}};O.Int=Wt;var sr=class extends ge{static{a(this,"IntBE")}constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return pe(e).readIntBE(t,this.span)}encode(e,t,r=0){return pe(t).writeIntBE(e,r,this.span),this.span}};O.IntBE=sr;var ma=Math.pow(2,32);function So(n){let e=Math.floor(n/ma),t=n-e*ma;return{hi32:e,lo32:t}}a(So,"divmodInt64");function Ao(n,e){return n*ma+e}a(Ao,"roundedInt64");var io=class extends ge{static{a(this,"NearUInt64")}constructor(e){super(8,e)}decode(e,t=0){let r=pe(e),o=r.readUInt32LE(t),s=r.readUInt32LE(t+4);return Ao(s,o)}encode(e,t,r=0){let o=So(e),s=pe(t);return s.writeUInt32LE(o.lo32,r),s.writeUInt32LE(o.hi32,r+4),8}};O.NearUInt64=io;var ao=class extends ge{static{a(this,"NearUInt64BE")}constructor(e){super(8,e)}decode(e,t=0){let r=pe(e),o=r.readUInt32BE(t),s=r.readUInt32BE(t+4);return Ao(o,s)}encode(e,t,r=0){let o=So(e),s=pe(t);return s.writeUInt32BE(o.hi32,r),s.writeUInt32BE(o.lo32,r+4),8}};O.NearUInt64BE=ao;var co=class extends ge{static{a(this,"NearInt64")}constructor(e){super(8,e)}decode(e,t=0){let r=pe(e),o=r.readUInt32LE(t),s=r.readInt32LE(t+4);return Ao(s,o)}encode(e,t,r=0){let o=So(e),s=pe(t);return s.writeUInt32LE(o.lo32,r),s.writeInt32LE(o.hi32,r+4),8}};O.NearInt64=co;var uo=class extends ge{static{a(this,"NearInt64BE")}constructor(e){super(8,e)}decode(e,t=0){let r=pe(e),o=r.readInt32BE(t),s=r.readUInt32BE(t+4);return Ao(o,s)}encode(e,t,r=0){let o=So(e),s=pe(t);return s.writeInt32BE(o.hi32,r),s.writeUInt32BE(o.lo32,r+4),8}};O.NearInt64BE=uo;var lo=class extends ge{static{a(this,"Float")}constructor(e){super(4,e)}decode(e,t=0){return pe(e).readFloatLE(t)}encode(e,t,r=0){return pe(t).writeFloatLE(e,r),4}};O.Float=lo;var fo=class extends ge{static{a(this,"FloatBE")}constructor(e){super(4,e)}decode(e,t=0){return pe(e).readFloatBE(t)}encode(e,t,r=0){return pe(t).writeFloatBE(e,r),4}};O.FloatBE=fo;var ho=class extends ge{static{a(this,"Double")}constructor(e){super(8,e)}decode(e,t=0){return pe(e).readDoubleLE(t)}encode(e,t,r=0){return pe(t).writeDoubleLE(e,r),8}};O.Double=ho;var po=class extends ge{static{a(this,"DoubleBE")}constructor(e){super(8,e)}decode(e,t=0){return pe(e).readDoubleBE(t)}encode(e,t,r=0){return pe(t).writeDoubleBE(e,r),8}};O.DoubleBE=po;var yo=class extends ge{static{a(this,"Sequence")}constructor(e,t,r){if(!(e instanceof ge))throw new TypeError("elementLayout must be a Layout");if(!(t instanceof Ve&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let o=-1;!(t instanceof Ve)&&0<e.span&&(o=t*e.span),super(o,r),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0,o=this.count;if(o instanceof Ve&&(o=o.decode(e,t)),0<this.elementLayout.span)r=o*this.elementLayout.span;else{let s=0;for(;s<o;)r+=this.elementLayout.getSpan(e,t+r),++s}return r}decode(e,t=0){let r=[],o=0,s=this.count;for(s instanceof Ve&&(s=s.decode(e,t));o<s;)r.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),o+=1;return r}encode(e,t,r=0){let o=this.elementLayout,s=e.reduce((i,u)=>i+o.encode(u,t,r+i),0);return this.count instanceof Ve&&this.count.encode(e.length,t,r),s}};O.Sequence=yo;var mo=class extends ge{static{a(this,"Structure")}constructor(e,t,r){if(!(Array.isArray(e)&&e.reduce((s,i)=>s&&i instanceof ge,!0)))throw new TypeError("fields must be array of Layout instances");typeof t=="boolean"&&r===void 0&&(r=t,t=void 0);for(let s of e)if(0>s.span&&s.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let o=-1;try{o=e.reduce((s,i)=>s+i.getSpan(),0)}catch{}super(o,t),this.fields=e,this.decodePrefixes=!!r}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((o,s)=>{let i=s.getSpan(e,t);return t+=i,o+i},0)}catch{throw new RangeError("indeterminate span")}return r}decode(e,t=0){Zr(e);let r=this.makeDestinationObject();for(let o of this.fields)if(o.property!==void 0&&(r[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r=0){let o=r,s=0,i=0;for(let u of this.fields){let f=u.span;if(i=0<f?f:0,u.property!==void 0){let y=e[u.property];y!==void 0&&(i=u.encode(y,t,r),0>f&&(f=u.getSpan(t,r)))}s=r,r+=f}return s+i-o}fromArray(e){let t=this.makeDestinationObject();for(let r of this.fields)r.property!==void 0&&0<e.length&&(t[r.property]=e.shift());return t}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let t=0;for(let r of this.fields){if(r.property===e)return t;0>r.span?t=-1:0<=t&&(t+=r.span)}}};O.Structure=mo;var Pn=class{static{a(this,"UnionDiscriminator")}constructor(e){this.property=e}decode(e,t){throw new Error("UnionDiscriminator is abstract")}encode(e,t,r){throw new Error("UnionDiscriminator is abstract")}};O.UnionDiscriminator=Pn;var Jr=class extends Pn{static{a(this,"UnionLayoutDiscriminator")}constructor(e,t){if(!(e instanceof Ve&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(t||e.property||"variant"),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,r){return this.layout.encode(e,t,r)}};O.UnionLayoutDiscriminator=Jr;var Bn=class extends ge{static{a(this,"Union")}constructor(e,t,r){let o;if(e instanceof tt||e instanceof ct)o=new Jr(new Ln(e));else if(e instanceof Ve&&e.isCount())o=new Jr(e);else if(e instanceof Pn)o=e;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(t===void 0&&(t=null),!(t===null||t instanceof ge))throw new TypeError("defaultLayout must be null or a Layout");if(t!==null){if(0>t.span)throw new Error("defaultLayout must have constant span");t.property===void 0&&(t=t.replicate("content"))}let s=-1;t&&(s=t.span,0<=s&&(e instanceof tt||e instanceof ct)&&(s+=o.layout.span)),super(s,r),this.discriminator=o,this.usesPrefixDiscriminator=e instanceof tt||e instanceof ct,this.defaultLayout=t,this.registry={};let i=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(u){return i(u)},this.configGetSourceVariant=function(u){i=u.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;let r=this.getVariant(e,t);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,t)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;let t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(let t in this.registry){let r=this.registry[t];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw new Error("unable to infer src variant")}decode(e,t=0){let r,o=this.discriminator,s=o.decode(e,t),i=this.registry[s];if(i===void 0){let u=this.defaultLayout,f=0;this.usesPrefixDiscriminator&&(f=o.layout.span),r=this.makeDestinationObject(),r[o.property]=s,r[u.property]=u.decode(e,t+f)}else r=i.decode(e,t);return r}encode(e,t,r=0){let o=this.getSourceVariant(e);if(o===void 0){let s=this.discriminator,i=this.defaultLayout,u=0;return this.usesPrefixDiscriminator&&(u=s.layout.span),s.encode(e[s.property],t,r),u+i.encode(e[i.property],t,r+u)}return o.encode(e,t,r)}addVariant(e,t,r){let o=new go(this,e,t,r);return this.registry[e]=o,o}getVariant(e,t=0){let r;return e instanceof Uint8Array?r=this.discriminator.decode(e,t):r=e,this.registry[r]}};O.Union=Bn;var go=class extends ge{static{a(this,"VariantLayout")}constructor(e,t,r,o){if(!(e instanceof Bn))throw new TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)throw new TypeError("variant must be a (non-negative) integer");if(typeof r=="string"&&o===void 0&&(o=r,r=null),r){if(!(r instanceof ge))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof o!="string")throw new TypeError("variant must have a String property")}let s=e.span;0>e.span&&(s=r?r.span:0,0<=s&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span)),super(s,o),this.union=e,this.variant=t,this.layout=r||null}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let o=0;return this.layout&&(o=this.layout.getSpan(e,t+r)),r+o}decode(e,t=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let o=0;return this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,t+o):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,t,r=0){let o=0;if(this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,r);let s=o;if(this.layout&&(this.layout.encode(e[this.property],t,r+o),s+=this.layout.getSpan(t,r+o),0<=this.union.span&&s>this.union.span))throw new Error("encoded variant overruns containing union");return s}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};O.VariantLayout=go;function Xr(n){return 0>n&&(n+=4294967296),n}a(Xr,"fixBitwiseResult");var Un=class extends ge{static{a(this,"BitStructure")}constructor(e,t,r){if(!(e instanceof tt||e instanceof ct))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof t=="string"&&r===void 0&&(r=t,t=!1),4<e.span)throw new RangeError("word cannot exceed 32 bits");super(e.span,r),this.word=e,this.msb=!!t,this.fields=[];let o=0;this._packedSetValue=function(s){return o=Xr(s),this},this._packedGetValue=function(){return o}}decode(e,t=0){let r=this.makeDestinationObject(),o=this.word.decode(e,t);this._packedSetValue(o);for(let s of this.fields)s.property!==void 0&&(r[s.property]=s.decode(e));return r}encode(e,t,r=0){let o=this.word.decode(t,r);this._packedSetValue(o);for(let s of this.fields)if(s.property!==void 0){let i=e[s.property];i!==void 0&&s.encode(i)}return this.word.encode(this._packedGetValue(),t,r)}addField(e,t){let r=new Dn(this,e,t);return this.fields.push(r),r}addBoolean(e){let t=new _o(this,e);return this.fields.push(t),t}fieldFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}};O.BitStructure=Un;var Dn=class{static{a(this,"BitField")}constructor(e,t,r){if(!(e instanceof Un))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(t)||0>=t)throw new TypeError("bits must be positive integer");let o=8*e.span,s=e.fields.reduce((i,u)=>i+u.bits,0);if(t+s>o)throw new Error("bits too long for span remainder ("+(o-s)+" of "+o+" remain)");this.container=e,this.bits=t,this.valueMask=(1<<t)-1,t===32&&(this.valueMask=4294967295),this.start=s,this.container.msb&&(this.start=o-s-t),this.wordMask=Xr(this.valueMask<<this.start),this.property=r}decode(e,t){let r=this.container._packedGetValue();return Xr(r&this.wordMask)>>>this.start}encode(e){if(typeof e!="number"||!Number.isInteger(e)||e!==Xr(e&this.valueMask))throw new TypeError(_a("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let t=this.container._packedGetValue(),r=Xr(e<<this.start);this.container._packedSetValue(Xr(t&~this.wordMask)|r)}};O.BitField=Dn;var _o=class extends Dn{static{a(this,"Boolean")}constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){typeof e=="boolean"&&(e=+e),super.encode(e)}};O.Boolean=_o;var bo=class extends ge{static{a(this,"Blob")}constructor(e,t){if(!(e instanceof Ve&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof Ve||(r=e),super(r,t),this.length=e}getSpan(e,t){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),r}decode(e,t=0){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),pe(e).slice(t,t+r)}encode(e,t,r){let o=this.length;if(this.length instanceof Ve&&(o=e.length),!(e instanceof Uint8Array&&o===e.length))throw new TypeError(_a("Blob.encode",this)+" requires (length "+o+") Uint8Array as src");if(r+o>t.length)throw new RangeError("encoding overruns Uint8Array");let s=pe(e);return pe(t).write(s.toString("hex"),r,o,"hex"),this.length instanceof Ve&&this.length.encode(o,t,r),o}};O.Blob=bo;var wo=class extends ge{static{a(this,"CString")}constructor(e){super(-1,e)}getSpan(e,t=0){Zr(e);let r=t;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-t}decode(e,t=0){let r=this.getSpan(e,t);return pe(e).slice(t,t+r-1).toString("utf-8")}encode(e,t,r=0){typeof e!="string"&&(e=String(e));let o=ga.Buffer.from(e,"utf8"),s=o.length;if(r+s>t.length)throw new RangeError("encoding overruns Buffer");let i=pe(t);return o.copy(i,r),i[r+s]=0,s+1}};O.CString=wo;var Ro=class extends ge{static{a(this,"UTF8")}constructor(e,t){if(typeof e=="string"&&t===void 0&&(t=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,t),this.maxSpan=e}getSpan(e,t=0){return Zr(e),e.length-t}decode(e,t=0){let r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<r)throw new RangeError("text length exceeds maxSpan");return pe(e).slice(t,t+r).toString("utf-8")}encode(e,t,r=0){typeof e!="string"&&(e=String(e));let o=ga.Buffer.from(e,"utf8"),s=o.length;if(0<=this.maxSpan&&this.maxSpan<s)throw new RangeError("text length exceeds maxSpan");if(r+s>t.length)throw new RangeError("encoding overruns Buffer");return o.copy(pe(t),r),s}};O.UTF8=Ro;var Eo=class extends ge{static{a(this,"Constant")}constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,r){return 0}};O.Constant=Eo;O.greedy=(n,e)=>new oo(n,e);O.offset=(n,e,t)=>new Ln(n,e,t);O.u8=n=>new tt(1,n);O.u16=n=>new tt(2,n);O.u24=n=>new tt(3,n);O.u32=n=>new tt(4,n);O.u40=n=>new tt(5,n);O.u48=n=>new tt(6,n);O.nu64=n=>new io(n);O.u16be=n=>new ct(2,n);O.u24be=n=>new ct(3,n);O.u32be=n=>new ct(4,n);O.u40be=n=>new ct(5,n);O.u48be=n=>new ct(6,n);O.nu64be=n=>new ao(n);O.s8=n=>new Wt(1,n);O.s16=n=>new Wt(2,n);O.s24=n=>new Wt(3,n);O.s32=n=>new Wt(4,n);O.s40=n=>new Wt(5,n);O.s48=n=>new Wt(6,n);O.ns64=n=>new co(n);O.s16be=n=>new sr(2,n);O.s24be=n=>new sr(3,n);O.s32be=n=>new sr(4,n);O.s40be=n=>new sr(5,n);O.s48be=n=>new sr(6,n);O.ns64be=n=>new uo(n);O.f32=n=>new lo(n);O.f32be=n=>new fo(n);O.f64=n=>new ho(n);O.f64be=n=>new po(n);O.struct=(n,e,t)=>new mo(n,e,t);O.bits=(n,e,t)=>new Un(n,e,t);O.seq=(n,e,t)=>new yo(n,e,t);O.union=(n,e,t)=>new Bn(n,e,t);O.unionLayoutDiscriminator=(n,e)=>new Jr(n,e);O.blob=(n,e)=>new bo(n,e);O.cstr=n=>new wo(n);O.utf8=(n,e)=>new Ro(n,e);O.constant=(n,e)=>new Eo(n,e)});var ql=ce((lE,Kl)=>{"use strict";var ko=ae("path").sep||"/";Kl.exports=rg;function rg(n){if(typeof n!="string"||n.length<=7||n.substring(0,7)!="file://")throw new TypeError("must pass in a file:// URI to convert to a file path");var e=decodeURI(n.substring(7)),t=e.indexOf("/"),r=e.substring(0,t),o=e.substring(t+1);return r=="localhost"&&(r=""),r&&(r=ko+ko+r),o=o.replace(/^(.+)\|/,"$1:"),ko=="\\"&&(o=o.replace(/\//g,"\\")),/^.+\:/.test(o)||(o=ko+o),r+o}a(rg,"fileUriToPath")});var Yl=ce((Qr,Gl)=>{"use strict";var wa=ae("fs"),vo=ae("path"),ng=ql(),Io=vo.join,sg=vo.dirname,jl=wa.accessSync&&function(n){try{wa.accessSync(n)}catch{return!1}return!0}||wa.existsSync||vo.existsSync,Vl={arrow:process.env.NODE_BINDINGS_ARROW||" \u2192 ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};function og(n){typeof n=="string"?n={bindings:n}:n||(n={}),Object.keys(Vl).map(function(f){f in n||(n[f]=Vl[f])}),n.module_root||(n.module_root=Qr.getRoot(Qr.getFileName())),vo.extname(n.bindings)!=".node"&&(n.bindings+=".node");for(var e=typeof __webpack_require__=="function"?__non_webpack_require__:ae,t=[],r=0,o=n.try.length,s,i,u;r<o;r++){s=Io.apply(null,n.try[r].map(function(f){return n[f]||f})),t.push(s);try{return i=n.path?e.resolve(s):e(s),n.path||(i.path=s),i}catch(f){if(f.code!=="MODULE_NOT_FOUND"&&f.code!=="QUALIFIED_PATH_RESOLUTION_FAILED"&&!/not find/i.test(f.message))throw f}}throw u=new Error(`Could not locate the bindings file. Tried:
2
+ import{b as Il}from"./chunk-FMZDKD72.js";import{c as Sr,d as Nm,e as kl,g as Cm}from"./chunk-CQUL5GH2.js";import{a as Al}from"./chunk-IVMOWPFA.js";import{B as ia,Dd as El,Kc as Rl,Mc as Im,Nc as vm,Sb as Er,Td as Om,U as wl,gd as Gs,lc as aa,mc as Am,ne as Sl,sc as ca,tc as km,vd as Ys,wd as Tm}from"./chunk-VLD3QNSH.js";import{a,b as ae,c as Pe,d as ce,e as Cn,f as le,g as xn}from"./chunk-G5BIPHMS.js";var Pl=ce((la,Ll)=>{"use strict";var Js=ae("buffer"),Ot=Js.Buffer;function xl(n,e){for(var t in n)e[t]=n[t]}a(xl,"copyProps");Ot.from&&Ot.alloc&&Ot.allocUnsafe&&Ot.allocUnsafeSlow?Ll.exports=Js:(xl(Js,la),la.Buffer=Ar);function Ar(n,e,t){return Ot(n,e,t)}a(Ar,"SafeBuffer");Ar.prototype=Object.create(Ot.prototype);xl(Ot,Ar);Ar.from=function(n,e,t){if(typeof n=="number")throw new TypeError("Argument must not be a number");return Ot(n,e,t)};Ar.alloc=function(n,e,t){if(typeof n!="number")throw new TypeError("Argument must be a number");var r=Ot(n);return e!==void 0?typeof t=="string"?r.fill(e,t):r.fill(e):r.fill(0),r};Ar.allocUnsafe=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return Ot(n)};Ar.allocUnsafeSlow=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return Js.SlowBuffer(n)}});var Ul=ce((tE,Bl)=>{"use strict";var Zs=Pl().Buffer;function Dm(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),t=0;t<e.length;t++)e[t]=255;for(var r=0;r<n.length;r++){var o=n.charAt(r),s=o.charCodeAt(0);if(e[s]!==255)throw new TypeError(o+" is ambiguous");e[s]=r}var i=n.length,u=n.charAt(0),f=Math.log(i)/Math.log(256),y=Math.log(256)/Math.log(i);function d(R){if((Array.isArray(R)||R instanceof Uint8Array)&&(R=Zs.from(R)),!Zs.isBuffer(R))throw new TypeError("Expected Buffer");if(R.length===0)return"";for(var S=0,A=0,C=0,x=R.length;C!==x&&R[C]===0;)C++,S++;for(var w=(x-C)*y+1>>>0,L=new Uint8Array(w);C!==x;){for(var z=R[C],Y=0,ne=w-1;(z!==0||Y<A)&&ne!==-1;ne--,Y++)z+=256*L[ne]>>>0,L[ne]=z%i>>>0,z=z/i>>>0;if(z!==0)throw new Error("Non-zero carry");A=Y,C++}for(var re=w-A;re!==w&&L[re]===0;)re++;for(var Se=u.repeat(S);re<w;++re)Se+=n.charAt(L[re]);return Se}a(d,"encode");function _(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return Zs.alloc(0);for(var S=0,A=0,C=0;R[S]===u;)A++,S++;for(var x=(R.length-S)*f+1>>>0,w=new Uint8Array(x);R[S];){var L=e[R.charCodeAt(S)];if(L===255)return;for(var z=0,Y=x-1;(L!==0||z<C)&&Y!==-1;Y--,z++)L+=i*w[Y]>>>0,w[Y]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");C=z,S++}for(var ne=x-C;ne!==x&&w[ne]===0;)ne++;var re=Zs.allocUnsafe(A+(x-ne));re.fill(0,0,A);for(var Se=A;ne!==x;)re[Se++]=w[ne++];return re}a(_,"decodeUnsafe");function E(R){var S=_(R);if(S)return S;throw new Error("Non-base"+i+" character")}return a(E,"decode"),{encode:d,decodeUnsafe:_,decode:E}}a(Dm,"base");Bl.exports=Dm});var Gr=ce((nE,Dl)=>{"use strict";var Mm=Ul(),$m="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";Dl.exports=Mm($m)});var Ml=ce(ha=>{"use strict";function Ft(n,e,t){return e<=n&&n<=t}a(Ft,"inRange");function no(n){if(n===void 0)return{};if(n===Object(n))return n;throw TypeError("Could not convert argument to dictionary")}a(no,"ToDictionary");function Hm(n){for(var e=String(n),t=e.length,r=0,o=[];r<t;){var s=e.charCodeAt(r);if(s<55296||s>57343)o.push(s);else if(56320<=s&&s<=57343)o.push(65533);else if(55296<=s&&s<=56319)if(r===t-1)o.push(65533);else{var i=n.charCodeAt(r+1);if(56320<=i&&i<=57343){var u=s&1023,f=i&1023;o.push(65536+(u<<10)+f),r+=1}else o.push(65533)}r+=1}return o}a(Hm,"stringToCodePoints");function zm(n){for(var e="",t=0;t<n.length;++t){var r=n[t];r<=65535?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return e}a(zm,"codePointsToString");var Qs=-1;function da(n){this.tokens=[].slice.call(n)}a(da,"Stream");da.prototype={endOfStream:a(function(){return!this.tokens.length},"endOfStream"),read:a(function(){return this.tokens.length?this.tokens.shift():Qs},"read"),prepend:a(function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(n)},"prepend"),push:a(function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.push(e.shift());else this.tokens.push(n)},"push")};var Yr=-1;function fa(n,e){if(n)throw TypeError("Decoder error");return e||65533}a(fa,"decoderError");var eo="utf-8";function to(n,e){if(!(this instanceof to))return new to(n,e);if(n=n!==void 0?String(n).toLowerCase():eo,n!==eo)throw new Error("Encoding not supported. Only utf-8 is supported");e=no(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}a(to,"TextDecoder");to.prototype={decode:a(function(e,t){var r;typeof e=="object"&&e instanceof ArrayBuffer?r=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):r=new Uint8Array(0),t=no(t),this._streaming||(this._decoder=new Fm({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var o=new da(r),s=[],i;!o.endOfStream()&&(i=this._decoder.handler(o,o.read()),i!==Yr);)i!==null&&(Array.isArray(i)?s.push.apply(s,i):s.push(i));if(!this._streaming){do{if(i=this._decoder.handler(o,o.read()),i===Yr)break;i!==null&&(Array.isArray(i)?s.push.apply(s,i):s.push(i))}while(!o.endOfStream());this._decoder=null}return s.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(s[0]===65279?(this._BOMseen=!0,s.shift()):this._BOMseen=!0),zm(s)},"decode")};function ro(n,e){if(!(this instanceof ro))return new ro(n,e);if(n=n!==void 0?String(n).toLowerCase():eo,n!==eo)throw new Error("Encoding not supported. Only utf-8 is supported");e=no(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}a(ro,"TextEncoder");ro.prototype={encode:a(function(e,t){e=e?String(e):"",t=no(t),this._streaming||(this._encoder=new Wm(this._options)),this._streaming=!!t.stream;for(var r=[],o=new da(Hm(e)),s;!o.endOfStream()&&(s=this._encoder.handler(o,o.read()),s!==Yr);)Array.isArray(s)?r.push.apply(r,s):r.push(s);if(!this._streaming){for(;s=this._encoder.handler(o,o.read()),s!==Yr;)Array.isArray(s)?r.push.apply(r,s):r.push(s);this._encoder=null}return new Uint8Array(r)},"encode")};function Fm(n){var e=n.fatal,t=0,r=0,o=0,s=128,i=191;this.handler=function(u,f){if(f===Qs&&o!==0)return o=0,fa(e);if(f===Qs)return Yr;if(o===0){if(Ft(f,0,127))return f;if(Ft(f,194,223))o=1,t=f-192;else if(Ft(f,224,239))f===224&&(s=160),f===237&&(i=159),o=2,t=f-224;else if(Ft(f,240,244))f===240&&(s=144),f===244&&(i=143),o=3,t=f-240;else return fa(e);return t=t<<6*o,null}if(!Ft(f,s,i))return t=o=r=0,s=128,i=191,u.prepend(f),fa(e);if(s=128,i=191,r+=1,t+=f-128<<6*(o-r),r!==o)return null;var y=t;return t=o=r=0,y}}a(Fm,"UTF8Decoder");function Wm(n){var e=n.fatal;this.handler=function(t,r){if(r===Qs)return Yr;if(Ft(r,0,127))return r;var o,s;Ft(r,128,2047)?(o=1,s=192):Ft(r,2048,65535)?(o=2,s=224):Ft(r,65536,1114111)&&(o=3,s=240);for(var i=[(r>>6*o)+s];o>0;){var u=r>>6*(o-1);i.push(128|u&63),o-=1}return i}}a(Wm,"UTF8Encoder");ha.TextEncoder=ro;ha.TextDecoder=to});var Wl=ce(Ee=>{"use strict";var Km=Ee&&Ee.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t),Object.defineProperty(n,r,{enumerable:!0,get:a(function(){return e[t]},"get")})}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),qm=Ee&&Ee.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),Nt=Ee&&Ee.__decorate||function(n,e,t,r){var o=arguments.length,s=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var u=n.length-1;u>=0;u--)(i=n[u])&&(s=(o<3?i(s):o>3?i(e,t,s):i(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},jm=Ee&&Ee.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.hasOwnProperty.call(n,t)&&Km(e,n,t);return qm(e,n),e},$l=Ee&&Ee.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.deserializeUnchecked=Ee.deserialize=Ee.serialize=Ee.BinaryReader=Ee.BinaryWriter=Ee.BorshError=Ee.baseDecode=Ee.baseEncode=void 0;var nr=$l(Er()),Hl=$l(Gr()),Vm=jm(Ml()),Gm=typeof TextDecoder!="function"?Vm.TextDecoder:TextDecoder,Ym=new Gm("utf-8",{fatal:!0});function Xm(n){return typeof n=="string"&&(n=Buffer.from(n,"utf8")),Hl.default.encode(Buffer.from(n))}a(Xm,"baseEncode");Ee.baseEncode=Xm;function Jm(n){return Buffer.from(Hl.default.decode(n))}a(Jm,"baseDecode");Ee.baseDecode=Jm;var pa=1024,Ke=class extends Error{static{a(this,"BorshError")}constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}};Ee.BorshError=Ke;var so=class{static{a(this,"BinaryWriter")}constructor(){this.buf=Buffer.alloc(pa),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(pa)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(Buffer.from(new nr.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(Buffer.from(new nr.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(Buffer.from(new nr.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(Buffer.from(new nr.default(e).toArray("le",64)))}writeBuffer(e){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),e,Buffer.alloc(pa)]),this.length+=e.length}writeString(e){this.maybeResize();let t=Buffer.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(Buffer.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(let r of e)this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}};Ee.BinaryWriter=so;function Ct(n,e,t){let r=t.value;t.value=function(...o){try{return r.apply(this,o)}catch(s){if(s instanceof RangeError){let i=s.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(i)>=0)throw new Ke("Reached the end of buffer when deserializing")}throw s}}}a(Ct,"handlingRangeError");var Qe=class{static{a(this,"BinaryReader")}constructor(e){this.buf=e,this.offset=0}readU8(){let e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){let e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){let e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){let e=this.readBuffer(8);return new nr.default(e,"le")}readU128(){let e=this.readBuffer(16);return new nr.default(e,"le")}readU256(){let e=this.readBuffer(32);return new nr.default(e,"le")}readU512(){let e=this.readBuffer(64);return new nr.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new Ke(`Expected buffer length ${e} isn't within bounds`);let t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){let e=this.readU32(),t=this.readBuffer(e);try{return Ym.decode(t)}catch(r){throw new Ke(`Error decoding UTF-8 string: ${r}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){let t=this.readU32(),r=Array();for(let o=0;o<t;++o)r.push(e());return r}};Nt([Ct],Qe.prototype,"readU8",null);Nt([Ct],Qe.prototype,"readU16",null);Nt([Ct],Qe.prototype,"readU32",null);Nt([Ct],Qe.prototype,"readU64",null);Nt([Ct],Qe.prototype,"readU128",null);Nt([Ct],Qe.prototype,"readU256",null);Nt([Ct],Qe.prototype,"readU512",null);Nt([Ct],Qe.prototype,"readString",null);Nt([Ct],Qe.prototype,"readFixedArray",null);Nt([Ct],Qe.prototype,"readArray",null);Ee.BinaryReader=Qe;function zl(n){return n.charAt(0).toUpperCase()+n.slice(1)}a(zl,"capitalizeFirstLetter");function kr(n,e,t,r,o){try{if(typeof r=="string")o[`write${zl(r)}`](t);else if(r instanceof Array)if(typeof r[0]=="number"){if(t.length!==r[0])throw new Ke(`Expecting byte array of length ${r[0]}, but got ${t.length} bytes`);o.writeFixedArray(t)}else if(r.length===2&&typeof r[1]=="number"){if(t.length!==r[1])throw new Ke(`Expecting byte array of length ${r[1]}, but got ${t.length} bytes`);for(let s=0;s<r[1];s++)kr(n,null,t[s],r[0],o)}else o.writeArray(t,s=>{kr(n,e,s,r[0],o)});else if(r.kind!==void 0)switch(r.kind){case"option":{t==null?o.writeU8(0):(o.writeU8(1),kr(n,e,t,r.type,o));break}case"map":{o.writeU32(t.size),t.forEach((s,i)=>{kr(n,e,i,r.key,o),kr(n,e,s,r.value,o)});break}default:throw new Ke(`FieldType ${r} unrecognized`)}else Fl(n,t,o)}catch(s){throw s instanceof Ke&&s.addToFieldPath(e),s}}a(kr,"serializeField");function Fl(n,e,t){if(typeof e.borshSerialize=="function"){e.borshSerialize(t);return}let r=n.get(e.constructor);if(!r)throw new Ke(`Class ${e.constructor.name} is missing in schema`);if(r.kind==="struct")r.fields.map(([o,s])=>{kr(n,o,e[o],s,t)});else if(r.kind==="enum"){let o=e[r.field];for(let s=0;s<r.values.length;++s){let[i,u]=r.values[s];if(i===o){t.writeU8(s),kr(n,i,e[i],u,t);break}}}else throw new Ke(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}a(Fl,"serializeStruct");function Zm(n,e,t=so){let r=new t;return Fl(n,e,r),r.toArray()}a(Zm,"serialize");Ee.serialize=Zm;function Ir(n,e,t,r){try{if(typeof t=="string")return r[`read${zl(t)}`]();if(t instanceof Array){if(typeof t[0]=="number")return r.readFixedArray(t[0]);if(typeof t[1]=="number"){let o=[];for(let s=0;s<t[1];s++)o.push(Ir(n,null,t[0],r));return o}else return r.readArray(()=>Ir(n,e,t[0],r))}if(t.kind==="option")return r.readU8()?Ir(n,e,t.type,r):void 0;if(t.kind==="map"){let o=new Map,s=r.readU32();for(let i=0;i<s;i++){let u=Ir(n,e,t.key,r),f=Ir(n,e,t.value,r);o.set(u,f)}return o}return ya(n,t,r)}catch(o){throw o instanceof Ke&&o.addToFieldPath(e),o}}a(Ir,"deserializeField");function ya(n,e,t){if(typeof e.borshDeserialize=="function")return e.borshDeserialize(t);let r=n.get(e);if(!r)throw new Ke(`Class ${e.name} is missing in schema`);if(r.kind==="struct"){let o={};for(let[s,i]of n.get(e).fields)o[s]=Ir(n,s,i,t);return new e(o)}if(r.kind==="enum"){let o=t.readU8();if(o>=r.values.length)throw new Ke(`Enum index: ${o} is out of range`);let[s,i]=r.values[o],u=Ir(n,s,i,t);return new e({[s]:u})}throw new Ke(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}a(ya,"deserializeStruct");function Qm(n,e,t,r=Qe){let o=new r(t),s=ya(n,e,o);if(o.offset<t.length)throw new Ke(`Unexpected ${t.length-o.offset} bytes after deserialized data`);return s}a(Qm,"deserialize");Ee.deserialize=Qm;function eg(n,e,t,r=Qe){let o=new r(t);return ya(n,e,o)}a(eg,"deserializeUnchecked");Ee.deserializeUnchecked=eg});var ba=ce(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.s16=O.s8=O.nu64be=O.u48be=O.u40be=O.u32be=O.u24be=O.u16be=O.nu64=O.u48=O.u40=O.u32=O.u24=O.u16=O.u8=O.offset=O.greedy=O.Constant=O.UTF8=O.CString=O.Blob=O.Boolean=O.BitField=O.BitStructure=O.VariantLayout=O.Union=O.UnionLayoutDiscriminator=O.UnionDiscriminator=O.Structure=O.Sequence=O.DoubleBE=O.Double=O.FloatBE=O.Float=O.NearInt64BE=O.NearInt64=O.NearUInt64BE=O.NearUInt64=O.IntBE=O.Int=O.UIntBE=O.UInt=O.OffsetLayout=O.GreedyCount=O.ExternalLayout=O.bindConstructorLayout=O.nameWithProperty=O.Layout=O.uint8ArrayToBuffer=O.checkUint8Array=void 0;O.constant=O.utf8=O.cstr=O.blob=O.unionLayoutDiscriminator=O.union=O.seq=O.bits=O.struct=O.f64be=O.f64=O.f32be=O.f32=O.ns64be=O.s48be=O.s40be=O.s32be=O.s24be=O.s16be=O.ns64=O.s48=O.s40=O.s32=O.s24=void 0;var ga=ae("buffer");function Zr(n){if(!(n instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}a(Zr,"checkUint8Array");O.checkUint8Array=Zr;function pe(n){return Zr(n),ga.Buffer.from(n.buffer,n.byteOffset,n.length)}a(pe,"uint8ArrayToBuffer");O.uint8ArrayToBuffer=pe;var ge=class{static{a(this,"Layout")}constructor(e,t){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){let t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}};O.Layout=ge;function _a(n,e){return e.property?n+"["+e.property+"]":n}a(_a,"nameWithProperty");O.nameWithProperty=_a;function tg(n,e){if(typeof n!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(n,"layout_"))throw new Error("Class is already bound to a layout");if(!(e&&e instanceof ge))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(e,"boundConstructor_"))throw new Error("layout is already bound to a constructor");n.layout_=e,e.boundConstructor_=n,e.makeDestinationObject=()=>new n,Object.defineProperty(n.prototype,"encode",{value(t,r){return e.encode(this,t,r)},writable:!0}),Object.defineProperty(n,"decode",{value(t,r){return e.decode(t,r)},writable:!0})}a(tg,"bindConstructorLayout");O.bindConstructorLayout=tg;var Ve=class extends ge{static{a(this,"ExternalLayout")}isCount(){throw new Error("ExternalLayout is abstract")}};O.ExternalLayout=Ve;var oo=class extends Ve{static{a(this,"GreedyCount")}constructor(e=1,t){if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t=0){Zr(e);let r=e.length-t;return Math.floor(r/this.elementSpan)}encode(e,t,r){return 0}};O.GreedyCount=oo;var Ln=class extends Ve{static{a(this,"OffsetLayout")}constructor(e,t=0,r){if(!(e instanceof ge))throw new TypeError("layout must be a Layout");if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof tt||this.layout instanceof ct}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,r=0){return this.layout.encode(e,t,r+this.offset)}};O.OffsetLayout=Ln;var tt=class extends ge{static{a(this,"UInt")}constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return pe(e).readUIntLE(t,this.span)}encode(e,t,r=0){return pe(t).writeUIntLE(e,r,this.span),this.span}};O.UInt=tt;var ct=class extends ge{static{a(this,"UIntBE")}constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return pe(e).readUIntBE(t,this.span)}encode(e,t,r=0){return pe(t).writeUIntBE(e,r,this.span),this.span}};O.UIntBE=ct;var Wt=class extends ge{static{a(this,"Int")}constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return pe(e).readIntLE(t,this.span)}encode(e,t,r=0){return pe(t).writeIntLE(e,r,this.span),this.span}};O.Int=Wt;var sr=class extends ge{static{a(this,"IntBE")}constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return pe(e).readIntBE(t,this.span)}encode(e,t,r=0){return pe(t).writeIntBE(e,r,this.span),this.span}};O.IntBE=sr;var ma=Math.pow(2,32);function So(n){let e=Math.floor(n/ma),t=n-e*ma;return{hi32:e,lo32:t}}a(So,"divmodInt64");function Ao(n,e){return n*ma+e}a(Ao,"roundedInt64");var io=class extends ge{static{a(this,"NearUInt64")}constructor(e){super(8,e)}decode(e,t=0){let r=pe(e),o=r.readUInt32LE(t),s=r.readUInt32LE(t+4);return Ao(s,o)}encode(e,t,r=0){let o=So(e),s=pe(t);return s.writeUInt32LE(o.lo32,r),s.writeUInt32LE(o.hi32,r+4),8}};O.NearUInt64=io;var ao=class extends ge{static{a(this,"NearUInt64BE")}constructor(e){super(8,e)}decode(e,t=0){let r=pe(e),o=r.readUInt32BE(t),s=r.readUInt32BE(t+4);return Ao(o,s)}encode(e,t,r=0){let o=So(e),s=pe(t);return s.writeUInt32BE(o.hi32,r),s.writeUInt32BE(o.lo32,r+4),8}};O.NearUInt64BE=ao;var co=class extends ge{static{a(this,"NearInt64")}constructor(e){super(8,e)}decode(e,t=0){let r=pe(e),o=r.readUInt32LE(t),s=r.readInt32LE(t+4);return Ao(s,o)}encode(e,t,r=0){let o=So(e),s=pe(t);return s.writeUInt32LE(o.lo32,r),s.writeInt32LE(o.hi32,r+4),8}};O.NearInt64=co;var uo=class extends ge{static{a(this,"NearInt64BE")}constructor(e){super(8,e)}decode(e,t=0){let r=pe(e),o=r.readInt32BE(t),s=r.readUInt32BE(t+4);return Ao(o,s)}encode(e,t,r=0){let o=So(e),s=pe(t);return s.writeInt32BE(o.hi32,r),s.writeUInt32BE(o.lo32,r+4),8}};O.NearInt64BE=uo;var lo=class extends ge{static{a(this,"Float")}constructor(e){super(4,e)}decode(e,t=0){return pe(e).readFloatLE(t)}encode(e,t,r=0){return pe(t).writeFloatLE(e,r),4}};O.Float=lo;var fo=class extends ge{static{a(this,"FloatBE")}constructor(e){super(4,e)}decode(e,t=0){return pe(e).readFloatBE(t)}encode(e,t,r=0){return pe(t).writeFloatBE(e,r),4}};O.FloatBE=fo;var ho=class extends ge{static{a(this,"Double")}constructor(e){super(8,e)}decode(e,t=0){return pe(e).readDoubleLE(t)}encode(e,t,r=0){return pe(t).writeDoubleLE(e,r),8}};O.Double=ho;var po=class extends ge{static{a(this,"DoubleBE")}constructor(e){super(8,e)}decode(e,t=0){return pe(e).readDoubleBE(t)}encode(e,t,r=0){return pe(t).writeDoubleBE(e,r),8}};O.DoubleBE=po;var yo=class extends ge{static{a(this,"Sequence")}constructor(e,t,r){if(!(e instanceof ge))throw new TypeError("elementLayout must be a Layout");if(!(t instanceof Ve&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let o=-1;!(t instanceof Ve)&&0<e.span&&(o=t*e.span),super(o,r),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0,o=this.count;if(o instanceof Ve&&(o=o.decode(e,t)),0<this.elementLayout.span)r=o*this.elementLayout.span;else{let s=0;for(;s<o;)r+=this.elementLayout.getSpan(e,t+r),++s}return r}decode(e,t=0){let r=[],o=0,s=this.count;for(s instanceof Ve&&(s=s.decode(e,t));o<s;)r.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),o+=1;return r}encode(e,t,r=0){let o=this.elementLayout,s=e.reduce((i,u)=>i+o.encode(u,t,r+i),0);return this.count instanceof Ve&&this.count.encode(e.length,t,r),s}};O.Sequence=yo;var mo=class extends ge{static{a(this,"Structure")}constructor(e,t,r){if(!(Array.isArray(e)&&e.reduce((s,i)=>s&&i instanceof ge,!0)))throw new TypeError("fields must be array of Layout instances");typeof t=="boolean"&&r===void 0&&(r=t,t=void 0);for(let s of e)if(0>s.span&&s.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let o=-1;try{o=e.reduce((s,i)=>s+i.getSpan(),0)}catch{}super(o,t),this.fields=e,this.decodePrefixes=!!r}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((o,s)=>{let i=s.getSpan(e,t);return t+=i,o+i},0)}catch{throw new RangeError("indeterminate span")}return r}decode(e,t=0){Zr(e);let r=this.makeDestinationObject();for(let o of this.fields)if(o.property!==void 0&&(r[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r=0){let o=r,s=0,i=0;for(let u of this.fields){let f=u.span;if(i=0<f?f:0,u.property!==void 0){let y=e[u.property];y!==void 0&&(i=u.encode(y,t,r),0>f&&(f=u.getSpan(t,r)))}s=r,r+=f}return s+i-o}fromArray(e){let t=this.makeDestinationObject();for(let r of this.fields)r.property!==void 0&&0<e.length&&(t[r.property]=e.shift());return t}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let t=0;for(let r of this.fields){if(r.property===e)return t;0>r.span?t=-1:0<=t&&(t+=r.span)}}};O.Structure=mo;var Pn=class{static{a(this,"UnionDiscriminator")}constructor(e){this.property=e}decode(e,t){throw new Error("UnionDiscriminator is abstract")}encode(e,t,r){throw new Error("UnionDiscriminator is abstract")}};O.UnionDiscriminator=Pn;var Jr=class extends Pn{static{a(this,"UnionLayoutDiscriminator")}constructor(e,t){if(!(e instanceof Ve&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(t||e.property||"variant"),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,r){return this.layout.encode(e,t,r)}};O.UnionLayoutDiscriminator=Jr;var Bn=class extends ge{static{a(this,"Union")}constructor(e,t,r){let o;if(e instanceof tt||e instanceof ct)o=new Jr(new Ln(e));else if(e instanceof Ve&&e.isCount())o=new Jr(e);else if(e instanceof Pn)o=e;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(t===void 0&&(t=null),!(t===null||t instanceof ge))throw new TypeError("defaultLayout must be null or a Layout");if(t!==null){if(0>t.span)throw new Error("defaultLayout must have constant span");t.property===void 0&&(t=t.replicate("content"))}let s=-1;t&&(s=t.span,0<=s&&(e instanceof tt||e instanceof ct)&&(s+=o.layout.span)),super(s,r),this.discriminator=o,this.usesPrefixDiscriminator=e instanceof tt||e instanceof ct,this.defaultLayout=t,this.registry={};let i=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(u){return i(u)},this.configGetSourceVariant=function(u){i=u.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;let r=this.getVariant(e,t);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,t)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;let t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(let t in this.registry){let r=this.registry[t];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw new Error("unable to infer src variant")}decode(e,t=0){let r,o=this.discriminator,s=o.decode(e,t),i=this.registry[s];if(i===void 0){let u=this.defaultLayout,f=0;this.usesPrefixDiscriminator&&(f=o.layout.span),r=this.makeDestinationObject(),r[o.property]=s,r[u.property]=u.decode(e,t+f)}else r=i.decode(e,t);return r}encode(e,t,r=0){let o=this.getSourceVariant(e);if(o===void 0){let s=this.discriminator,i=this.defaultLayout,u=0;return this.usesPrefixDiscriminator&&(u=s.layout.span),s.encode(e[s.property],t,r),u+i.encode(e[i.property],t,r+u)}return o.encode(e,t,r)}addVariant(e,t,r){let o=new go(this,e,t,r);return this.registry[e]=o,o}getVariant(e,t=0){let r;return e instanceof Uint8Array?r=this.discriminator.decode(e,t):r=e,this.registry[r]}};O.Union=Bn;var go=class extends ge{static{a(this,"VariantLayout")}constructor(e,t,r,o){if(!(e instanceof Bn))throw new TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)throw new TypeError("variant must be a (non-negative) integer");if(typeof r=="string"&&o===void 0&&(o=r,r=null),r){if(!(r instanceof ge))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof o!="string")throw new TypeError("variant must have a String property")}let s=e.span;0>e.span&&(s=r?r.span:0,0<=s&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span)),super(s,o),this.union=e,this.variant=t,this.layout=r||null}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let o=0;return this.layout&&(o=this.layout.getSpan(e,t+r)),r+o}decode(e,t=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let o=0;return this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,t+o):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,t,r=0){let o=0;if(this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,r);let s=o;if(this.layout&&(this.layout.encode(e[this.property],t,r+o),s+=this.layout.getSpan(t,r+o),0<=this.union.span&&s>this.union.span))throw new Error("encoded variant overruns containing union");return s}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};O.VariantLayout=go;function Xr(n){return 0>n&&(n+=4294967296),n}a(Xr,"fixBitwiseResult");var Un=class extends ge{static{a(this,"BitStructure")}constructor(e,t,r){if(!(e instanceof tt||e instanceof ct))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof t=="string"&&r===void 0&&(r=t,t=!1),4<e.span)throw new RangeError("word cannot exceed 32 bits");super(e.span,r),this.word=e,this.msb=!!t,this.fields=[];let o=0;this._packedSetValue=function(s){return o=Xr(s),this},this._packedGetValue=function(){return o}}decode(e,t=0){let r=this.makeDestinationObject(),o=this.word.decode(e,t);this._packedSetValue(o);for(let s of this.fields)s.property!==void 0&&(r[s.property]=s.decode(e));return r}encode(e,t,r=0){let o=this.word.decode(t,r);this._packedSetValue(o);for(let s of this.fields)if(s.property!==void 0){let i=e[s.property];i!==void 0&&s.encode(i)}return this.word.encode(this._packedGetValue(),t,r)}addField(e,t){let r=new Dn(this,e,t);return this.fields.push(r),r}addBoolean(e){let t=new _o(this,e);return this.fields.push(t),t}fieldFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}};O.BitStructure=Un;var Dn=class{static{a(this,"BitField")}constructor(e,t,r){if(!(e instanceof Un))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(t)||0>=t)throw new TypeError("bits must be positive integer");let o=8*e.span,s=e.fields.reduce((i,u)=>i+u.bits,0);if(t+s>o)throw new Error("bits too long for span remainder ("+(o-s)+" of "+o+" remain)");this.container=e,this.bits=t,this.valueMask=(1<<t)-1,t===32&&(this.valueMask=4294967295),this.start=s,this.container.msb&&(this.start=o-s-t),this.wordMask=Xr(this.valueMask<<this.start),this.property=r}decode(e,t){let r=this.container._packedGetValue();return Xr(r&this.wordMask)>>>this.start}encode(e){if(typeof e!="number"||!Number.isInteger(e)||e!==Xr(e&this.valueMask))throw new TypeError(_a("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let t=this.container._packedGetValue(),r=Xr(e<<this.start);this.container._packedSetValue(Xr(t&~this.wordMask)|r)}};O.BitField=Dn;var _o=class extends Dn{static{a(this,"Boolean")}constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){typeof e=="boolean"&&(e=+e),super.encode(e)}};O.Boolean=_o;var bo=class extends ge{static{a(this,"Blob")}constructor(e,t){if(!(e instanceof Ve&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof Ve||(r=e),super(r,t),this.length=e}getSpan(e,t){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),r}decode(e,t=0){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),pe(e).slice(t,t+r)}encode(e,t,r){let o=this.length;if(this.length instanceof Ve&&(o=e.length),!(e instanceof Uint8Array&&o===e.length))throw new TypeError(_a("Blob.encode",this)+" requires (length "+o+") Uint8Array as src");if(r+o>t.length)throw new RangeError("encoding overruns Uint8Array");let s=pe(e);return pe(t).write(s.toString("hex"),r,o,"hex"),this.length instanceof Ve&&this.length.encode(o,t,r),o}};O.Blob=bo;var wo=class extends ge{static{a(this,"CString")}constructor(e){super(-1,e)}getSpan(e,t=0){Zr(e);let r=t;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-t}decode(e,t=0){let r=this.getSpan(e,t);return pe(e).slice(t,t+r-1).toString("utf-8")}encode(e,t,r=0){typeof e!="string"&&(e=String(e));let o=ga.Buffer.from(e,"utf8"),s=o.length;if(r+s>t.length)throw new RangeError("encoding overruns Buffer");let i=pe(t);return o.copy(i,r),i[r+s]=0,s+1}};O.CString=wo;var Ro=class extends ge{static{a(this,"UTF8")}constructor(e,t){if(typeof e=="string"&&t===void 0&&(t=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,t),this.maxSpan=e}getSpan(e,t=0){return Zr(e),e.length-t}decode(e,t=0){let r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<r)throw new RangeError("text length exceeds maxSpan");return pe(e).slice(t,t+r).toString("utf-8")}encode(e,t,r=0){typeof e!="string"&&(e=String(e));let o=ga.Buffer.from(e,"utf8"),s=o.length;if(0<=this.maxSpan&&this.maxSpan<s)throw new RangeError("text length exceeds maxSpan");if(r+s>t.length)throw new RangeError("encoding overruns Buffer");return o.copy(pe(t),r),s}};O.UTF8=Ro;var Eo=class extends ge{static{a(this,"Constant")}constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,r){return 0}};O.Constant=Eo;O.greedy=(n,e)=>new oo(n,e);O.offset=(n,e,t)=>new Ln(n,e,t);O.u8=n=>new tt(1,n);O.u16=n=>new tt(2,n);O.u24=n=>new tt(3,n);O.u32=n=>new tt(4,n);O.u40=n=>new tt(5,n);O.u48=n=>new tt(6,n);O.nu64=n=>new io(n);O.u16be=n=>new ct(2,n);O.u24be=n=>new ct(3,n);O.u32be=n=>new ct(4,n);O.u40be=n=>new ct(5,n);O.u48be=n=>new ct(6,n);O.nu64be=n=>new ao(n);O.s8=n=>new Wt(1,n);O.s16=n=>new Wt(2,n);O.s24=n=>new Wt(3,n);O.s32=n=>new Wt(4,n);O.s40=n=>new Wt(5,n);O.s48=n=>new Wt(6,n);O.ns64=n=>new co(n);O.s16be=n=>new sr(2,n);O.s24be=n=>new sr(3,n);O.s32be=n=>new sr(4,n);O.s40be=n=>new sr(5,n);O.s48be=n=>new sr(6,n);O.ns64be=n=>new uo(n);O.f32=n=>new lo(n);O.f32be=n=>new fo(n);O.f64=n=>new ho(n);O.f64be=n=>new po(n);O.struct=(n,e,t)=>new mo(n,e,t);O.bits=(n,e,t)=>new Un(n,e,t);O.seq=(n,e,t)=>new yo(n,e,t);O.union=(n,e,t)=>new Bn(n,e,t);O.unionLayoutDiscriminator=(n,e)=>new Jr(n,e);O.blob=(n,e)=>new bo(n,e);O.cstr=n=>new wo(n);O.utf8=(n,e)=>new Ro(n,e);O.constant=(n,e)=>new Eo(n,e)});var ql=ce((lE,Kl)=>{"use strict";var ko=ae("path").sep||"/";Kl.exports=rg;function rg(n){if(typeof n!="string"||n.length<=7||n.substring(0,7)!="file://")throw new TypeError("must pass in a file:// URI to convert to a file path");var e=decodeURI(n.substring(7)),t=e.indexOf("/"),r=e.substring(0,t),o=e.substring(t+1);return r=="localhost"&&(r=""),r&&(r=ko+ko+r),o=o.replace(/^(.+)\|/,"$1:"),ko=="\\"&&(o=o.replace(/\//g,"\\")),/^.+\:/.test(o)||(o=ko+o),r+o}a(rg,"fileUriToPath")});var Yl=ce((Qr,Gl)=>{"use strict";var wa=ae("fs"),vo=ae("path"),ng=ql(),Io=vo.join,sg=vo.dirname,jl=wa.accessSync&&function(n){try{wa.accessSync(n)}catch{return!1}return!0}||wa.existsSync||vo.existsSync,Vl={arrow:process.env.NODE_BINDINGS_ARROW||" \u2192 ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};function og(n){typeof n=="string"?n={bindings:n}:n||(n={}),Object.keys(Vl).map(function(f){f in n||(n[f]=Vl[f])}),n.module_root||(n.module_root=Qr.getRoot(Qr.getFileName())),vo.extname(n.bindings)!=".node"&&(n.bindings+=".node");for(var e=typeof __webpack_require__=="function"?__non_webpack_require__:ae,t=[],r=0,o=n.try.length,s,i,u;r<o;r++){s=Io.apply(null,n.try[r].map(function(f){return n[f]||f})),t.push(s);try{return i=n.path?e.resolve(s):e(s),n.path||(i.path=s),i}catch(f){if(f.code!=="MODULE_NOT_FOUND"&&f.code!=="QUALIFIED_PATH_RESOLUTION_FAILED"&&!/not find/i.test(f.message))throw f}}throw u=new Error(`Could not locate the bindings file. Tried:
3
3
  `+t.map(function(f){return n.arrow+f}).join(`
4
4
  `)),u.tries=t,u}a(og,"bindings");Gl.exports=Qr=og;Qr.getFileName=a(function(e){var t=Error.prepareStackTrace,r=Error.stackTraceLimit,o={},s;Error.stackTraceLimit=10,Error.prepareStackTrace=function(u,f){for(var y=0,d=f.length;y<d;y++)if(s=f[y].getFileName(),s!==__filename)if(e){if(s!==e)return}else return},Error.captureStackTrace(o),o.stack,Error.prepareStackTrace=t,Error.stackTraceLimit=r;var i="file://";return s.indexOf(i)===0&&(s=ng(s)),s},"getFileName");Qr.getRoot=a(function(e){for(var t=sg(e),r;;){if(t==="."&&(t=process.cwd()),jl(Io(t,"package.json"))||jl(Io(t,"node_modules")))return t;if(r===t)throw new Error('Could not find module root given file: "'+e+'". Do you have a `package.json` file? ');r=t,t=Io(t,"..")}},"getRoot")});var Xl=ce(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});var Kt;try{Kt=Yl()("bigint_buffer")}catch{console.warn("bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)")}function ig(n){if(Kt===void 0){let e=Buffer.from(n);e.reverse();let t=e.toString("hex");return t.length===0?BigInt(0):BigInt(`0x${t}`)}return Kt.toBigInt(n,!1)}a(ig,"toBigIntLE");en.toBigIntLE=ig;function ag(n){if(Kt===void 0){let e=n.toString("hex");return e.length===0?BigInt(0):BigInt(`0x${e}`)}return Kt.toBigInt(n,!0)}a(ag,"toBigIntBE");en.toBigIntBE=ag;function cg(n,e){if(Kt===void 0){let t=n.toString(16),r=Buffer.from(t.padStart(e*2,"0").slice(0,e*2),"hex");return r.reverse(),r}return Kt.fromBigInt(n,Buffer.allocUnsafe(e),!1)}a(cg,"toBufferLE");en.toBufferLE=cg;function ug(n,e){if(Kt===void 0){let t=n.toString(16);return Buffer.from(t.padStart(e*2,"0").slice(0,e*2),"hex")}return Kt.fromBigInt(n,Buffer.allocUnsafe(e),!0)}a(ug,"toBufferBE");en.toBufferBE=ug});function lg(n){return Mn(n)&&typeof n[Symbol.iterator]=="function"}function Mn(n){return typeof n=="object"&&n!=null}function To(n){return Mn(n)&&!Array.isArray(n)}function At(n){return typeof n=="symbol"?n.toString():typeof n=="string"?JSON.stringify(n):`${n}`}function fg(n){let{done:e,value:t}=n.next();return e?void 0:t}function dg(n,e,t,r){if(n===!0)return;n===!1?n={}:typeof n=="string"&&(n={message:n});let{path:o,branch:s}=e,{type:i}=t,{refinement:u,message:f=`Expected a value of type \`${i}\`${u?` with refinement \`${u}\``:""}, but received: \`${At(r)}\``}=n;return{value:r,type:i,refinement:u,key:o[o.length-1],path:o,branch:s,...n,message:f}}function*Jl(n,e,t,r){lg(n)||(n=[n]);for(let o of n){let s=dg(o,e,t,r);s&&(yield s)}}function*Ea(n,e,t={}){let{path:r=[],branch:o=[n],coerce:s=!1,mask:i=!1}=t,u={path:r,branch:o,mask:i};s&&(n=e.coercer(n,u));let f="valid";for(let y of e.validator(n,u))y.explanation=t.message,f="not_valid",yield[y,void 0];for(let[y,d,_]of e.entries(n,u)){let E=Ea(d,_,{path:y===void 0?r:[...r,y],branch:y===void 0?o:[...o,d],coerce:s,mask:i,message:t.message});for(let R of E)R[0]?(f=R[0].refinement!=null?"not_refined":"not_valid",yield[R[0],void 0]):s&&(d=R[1],y===void 0?n=d:n instanceof Map?n.set(y,d):n instanceof Set?n.add(d):Mn(n)&&(d!==void 0||y in n)&&(n[y]=d))}if(f!=="not_valid")for(let y of e.refiner(n,u))y.explanation=t.message,f="not_refined",yield[y,void 0];f==="valid"&&(yield[void 0,n])}function Sa(n,e,t){let r=$n(n,e,{message:t});if(r[0])throw r[0]}function H(n,e,t){let r=$n(n,e,{coerce:!0,message:t});if(r[0])throw r[0];return r[1]}function hg(n,e,t){let r=$n(n,e,{coerce:!0,mask:!0,message:t});if(r[0])throw r[0];return r[1]}function Zl(n,e){return!$n(n,e)[0]}function $n(n,e,t={}){let r=Ea(n,e,t),o=fg(r);return o[0]?[new Ra(o[0],function*(){for(let i of r)i[0]&&(yield i[0])}),void 0]:[void 0,o[1]]}function vr(n,e){return new mt({type:n,schema:null,validator:e})}function Ql(){return vr("any",()=>!0)}function W(n){return new mt({type:"array",schema:n,*entries(e){if(n&&Array.isArray(e))for(let[t,r]of e.entries())yield[t,r,n]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${At(e)}`}})}function kt(){return vr("boolean",n=>typeof n=="boolean")}function Oo(n){return vr("instance",e=>e instanceof n||`Expected a \`${n.name}\` instance, but received: ${At(e)}`)}function Te(n){let e=At(n),t=typeof n;return new mt({type:"literal",schema:t==="string"||t==="number"||t==="boolean"?n:null,validator(r){return r===n||`Expected the literal \`${e}\`, but received: ${At(r)}`}})}function pg(){return vr("never",()=>!1)}function K(n){return new mt({...n,validator:a((e,t)=>e===null||n.validator(e,t),"validator"),refiner:a((e,t)=>e===null||n.refiner(e,t),"refiner")})}function k(){return vr("number",n=>typeof n=="number"&&!isNaN(n)||`Expected a number, but received: ${At(n)}`)}function Z(n){return new mt({...n,validator:a((e,t)=>e===void 0||n.validator(e,t),"validator"),refiner:a((e,t)=>e===void 0||n.refiner(e,t),"refiner")})}function Aa(n,e){return new mt({type:"record",schema:null,*entries(t){if(Mn(t))for(let r in t){let o=t[r];yield[r,r,n],yield[r,o,e]}},validator(t){return To(t)||`Expected an object, but received: ${At(t)}`},coercer(t){return To(t)?{...t}:t}})}function $(){return vr("string",n=>typeof n=="string"||`Expected a string, but received: ${At(n)}`)}function No(n){let e=pg();return new mt({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){let r=Math.max(n.length,t.length);for(let o=0;o<r;o++)yield[o,t[o],n[o]||e]}},validator(t){return Array.isArray(t)||`Expected an array, but received: ${At(t)}`},coercer(t){return Array.isArray(t)?t.slice():t}})}function B(n){let e=Object.keys(n);return new mt({type:"type",schema:n,*entries(t){if(Mn(t))for(let r of e)yield[r,t[r],n[r]]},validator(t){return To(t)||`Expected an object, but received: ${At(t)}`},coercer(t){return To(t)?{...t}:t}})}function Ge(n){let e=n.map(t=>t.type).join(" | ");return new mt({type:"union",schema:null,coercer(t,r){for(let o of n){let[s,i]=o.validate(t,{coerce:!0,mask:r.mask});if(!s)return i}return t},validator(t,r){let o=[];for(let s of n){let[...i]=Ea(t,s,r),[u]=i;if(u[0])for(let[f]of i)f&&o.push(f);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${At(t)}`,...o]}})}function Tr(){return vr("unknown",()=>!0)}function tn(n,e,t){return new mt({...n,coercer:a((r,o)=>Zl(r,e)?n.coercer(t(r,o),o):n.coercer(r,o),"coercer")})}var Ra,mt,ef=Pe(()=>{"use strict";Ra=class extends TypeError{static{a(this,"StructError")}constructor(e,t){let r,{message:o,explanation:s,...i}=e,{path:u}=e,f=u.length===0?o:`At path: ${u.join(".")} -- ${o}`;super(s??f),s!=null&&(this.cause=f),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}};a(lg,"isIterable");a(Mn,"isObject");a(To,"isNonArrayObject");a(At,"print");a(fg,"shiftIterator");a(dg,"toFailure");a(Jl,"toFailures");a(Ea,"run");mt=class{static{a(this,"Struct")}constructor(e){let{type:t,schema:r,validator:o,refiner:s,coercer:i=a(f=>f,"coercer"),entries:u=a(function*(){},"entries")}=e;this.type=t,this.schema=r,this.entries=u,this.coercer=i,o?this.validator=(f,y)=>{let d=o(f,y);return Jl(d,y,this,f)}:this.validator=()=>[],s?this.refiner=(f,y)=>{let d=s(f,y);return Jl(d,y,this,f)}:this.refiner=()=>[]}assert(e,t){return Sa(e,this,t)}create(e,t){return H(e,this,t)}is(e){return Zl(e,this)}mask(e,t){return hg(e,this,t)}validate(e,t={}){return $n(e,this,t)}};a(Sa,"assert");a(H,"create");a(hg,"mask");a(Zl,"is");a($n,"validate");a(vr,"define");a(Ql,"any");a(W,"array");a(kt,"boolean");a(Oo,"instance");a(Te,"literal");a(pg,"never");a(K,"nullable");a(k,"number");a(Z,"optional");a(Aa,"record");a($,"string");a(No,"tuple");a(B,"type");a(Ge,"union");a(Tr,"unknown");a(tn,"coerce")});import yg from"crypto";function Hn(){return Co>xo.length-16&&(yg.randomFillSync(xo),Co=0),xo.slice(Co,Co+=16)}var xo,Co,ka=Pe(()=>{"use strict";xo=new Uint8Array(256),Co=xo.length;a(Hn,"rng")});var tf,rf=Pe(()=>{"use strict";tf=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function mg(n){return typeof n=="string"&&tf.test(n)}var or,zn=Pe(()=>{"use strict";rf();a(mg,"validate");or=mg});function gg(n,e=0){let t=(qe[n[e+0]]+qe[n[e+1]]+qe[n[e+2]]+qe[n[e+3]]+"-"+qe[n[e+4]]+qe[n[e+5]]+"-"+qe[n[e+6]]+qe[n[e+7]]+"-"+qe[n[e+8]]+qe[n[e+9]]+"-"+qe[n[e+10]]+qe[n[e+11]]+qe[n[e+12]]+qe[n[e+13]]+qe[n[e+14]]+qe[n[e+15]]).toLowerCase();if(!or(t))throw TypeError("Stringified UUID is invalid");return t}var qe,ir,Fn=Pe(()=>{"use strict";zn();qe=[];for(let n=0;n<256;++n)qe.push((n+256).toString(16).substr(1));a(gg,"stringify");ir=gg});function _g(n,e,t){let r=e&&t||0,o=e||new Array(16);n=n||{};let s=n.node||nf,i=n.clockseq!==void 0?n.clockseq:Ia;if(s==null||i==null){let E=n.random||(n.rng||Hn)();s==null&&(s=nf=[E[0]|1,E[1],E[2],E[3],E[4],E[5]]),i==null&&(i=Ia=(E[6]<<8|E[7])&16383)}let u=n.msecs!==void 0?n.msecs:Date.now(),f=n.nsecs!==void 0?n.nsecs:Ta+1,y=u-va+(f-Ta)/1e4;if(y<0&&n.clockseq===void 0&&(i=i+1&16383),(y<0||u>va)&&n.nsecs===void 0&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");va=u,Ta=f,Ia=i,u+=122192928e5;let d=((u&268435455)*1e4+f)%4294967296;o[r++]=d>>>24&255,o[r++]=d>>>16&255,o[r++]=d>>>8&255,o[r++]=d&255;let _=u/4294967296*1e4&268435455;o[r++]=_>>>8&255,o[r++]=_&255,o[r++]=_>>>24&15|16,o[r++]=_>>>16&255,o[r++]=i>>>8|128,o[r++]=i&255;for(let E=0;E<6;++E)o[r+E]=s[E];return e||ir(o)}var nf,Ia,va,Ta,sf,of=Pe(()=>{"use strict";ka();Fn();va=0,Ta=0;a(_g,"v1");sf=_g});function bg(n){if(!or(n))throw TypeError("Invalid UUID");let e,t=new Uint8Array(16);return t[0]=(e=parseInt(n.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=e&255,t}var Lo,Oa=Pe(()=>{"use strict";zn();a(bg,"parse");Lo=bg});function wg(n){n=unescape(encodeURIComponent(n));let e=[];for(let t=0;t<n.length;++t)e.push(n.charCodeAt(t));return e}function Wn(n,e,t){function r(o,s,i,u){if(typeof o=="string"&&(o=wg(o)),typeof s=="string"&&(s=Lo(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+o.length);if(f.set(s),f.set(o,s.length),f=t(f),f[6]=f[6]&15|e,f[8]=f[8]&63|128,i){u=u||0;for(let y=0;y<16;++y)i[u+y]=f[y];return i}return ir(f)}a(r,"generateUUID");try{r.name=n}catch{}return r.DNS=Rg,r.URL=Eg,r}var Rg,Eg,Na=Pe(()=>{"use strict";Fn();Oa();a(wg,"stringToBytes");Rg="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Eg="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(Wn,"default")});import Sg from"crypto";function Ag(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),Sg.createHash("md5").update(n).digest()}var af,cf=Pe(()=>{"use strict";a(Ag,"md5");af=Ag});var kg,uf,lf=Pe(()=>{"use strict";Na();cf();kg=Wn("v3",48,af),uf=kg});function Ig(n,e,t){n=n||{};let r=n.random||(n.rng||Hn)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){t=t||0;for(let o=0;o<16;++o)e[t+o]=r[o];return e}return ir(r)}var ff,df=Pe(()=>{"use strict";ka();Fn();a(Ig,"v4");ff=Ig});import vg from"crypto";function Tg(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),vg.createHash("sha1").update(n).digest()}var hf,pf=Pe(()=>{"use strict";a(Tg,"sha1");hf=Tg});var Og,yf,mf=Pe(()=>{"use strict";Na();pf();Og=Wn("v5",80,hf),yf=Og});var gf,_f=Pe(()=>{"use strict";gf="00000000-0000-0000-0000-000000000000"});function Ng(n){if(!or(n))throw TypeError("Invalid UUID");return parseInt(n.substr(14,1),16)}var bf,wf=Pe(()=>{"use strict";zn();a(Ng,"version");bf=Ng});var Ca={};Cn(Ca,{NIL:()=>gf,parse:()=>Lo,stringify:()=>ir,v1:()=>sf,v3:()=>uf,v4:()=>ff,v5:()=>yf,validate:()=>or,version:()=>bf});var xa=Pe(()=>{"use strict";of();lf();df();mf();_f();wf();zn();Fn();Oa()});var Ef=ce((hS,Rf)=>{"use strict";var Cg=(xa(),xn(Ca)).v4,xg=a(function(n,e,t,r){if(typeof n!="string")throw new TypeError(n+" must be a string");r=r||{};let o=typeof r.version=="number"?r.version:2;if(o!==1&&o!==2)throw new TypeError(o+" must be 1 or 2");let s={method:n};if(o===2&&(s.jsonrpc="2.0"),e){if(typeof e!="object"&&!Array.isArray(e))throw new TypeError(e+" must be an object, array or omitted");s.params=e}if(typeof t>"u"){let i=typeof r.generator=="function"?r.generator:function(){return Cg()};s.id=i(s,r)}else o===2&&t===null?r.notificationIdNull&&(s.id=null):s.id=t;return s},"generateRequest");Rf.exports=xg});var Af=ce((yS,Sf)=>{"use strict";var Lg=(xa(),xn(Ca)).v4,Pg=Ef(),Kn=a(function(n,e){if(!(this instanceof Kn))return new Kn(n,e);e||(e={}),this.options={reviver:typeof e.reviver<"u"?e.reviver:null,replacer:typeof e.replacer<"u"?e.replacer:null,generator:typeof e.generator<"u"?e.generator:function(){return Lg()},version:typeof e.version<"u"?e.version:2,notificationIdNull:typeof e.notificationIdNull=="boolean"?e.notificationIdNull:!1},this.callServer=n},"ClientBrowser");Sf.exports=Kn;Kn.prototype.request=function(n,e,t,r){let o=this,s=null,i=Array.isArray(n)&&typeof e=="function";if(this.options.version===1&&i)throw new TypeError("JSON-RPC 1.0 does not support batching");if(i||!i&&n&&typeof n=="object"&&typeof e=="function")r=e,s=n;else{typeof t=="function"&&(r=t,t=void 0);let y=typeof r=="function";try{s=Pg(n,e,t,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(d){if(y)return r(d);throw d}if(!y)return s}let f;try{f=JSON.stringify(s,this.options.replacer)}catch(y){return r(y)}return this.callServer(f,function(y,d){o._parseResponse(y,d,r)}),s};Kn.prototype._parseResponse=function(n,e,t){if(n){t(n);return}if(!e)return t();let r;try{r=JSON.parse(e,this.options.reviver)}catch(o){return t(o)}if(t.length===3)if(Array.isArray(r)){let o=a(function(i){return typeof i.error<"u"},"isError"),s=a(function(i){return!o(i)},"isNotError");return t(null,r.filter(o),r.filter(s))}else return t(null,r.error,r.result);t(null,r)}});var Tf=ce((gS,vf)=>{"use strict";var{Duplex:Bg}=ae("stream");function kf(n){n.emit("close")}a(kf,"emitClose");function Ug(){!this.destroyed&&this._writableState.finished&&this.destroy()}a(Ug,"duplexOnEnd");function If(n){this.removeListener("error",If),this.destroy(),this.listenerCount("error")===0&&this.emit("error",n)}a(If,"duplexOnError");function Dg(n,e){let t=!0,r=new Bg({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return n.on("message",a(function(s,i){let u=!i&&r._readableState.objectMode?s.toString():s;r.push(u)||n.pause()},"message")),n.once("error",a(function(s){r.destroyed||(t=!1,r.destroy(s))},"error")),n.once("close",a(function(){r.destroyed||r.push(null)},"close")),r._destroy=function(o,s){if(n.readyState===n.CLOSED){s(o),process.nextTick(kf,r);return}let i=!1;n.once("error",a(function(f){i=!0,s(f)},"error")),n.once("close",a(function(){i||s(o),process.nextTick(kf,r)},"close")),t&&n.terminate()},r._final=function(o){if(n.readyState===n.CONNECTING){n.once("open",a(function(){r._final(o)},"open"));return}n._socket!==null&&(n._socket._writableState.finished?(o(),r._readableState.endEmitted&&r.destroy()):(n._socket.once("finish",a(function(){o()},"finish")),n.close()))},r._read=function(){n.isPaused&&n.resume()},r._write=function(o,s,i){if(n.readyState===n.CONNECTING){n.once("open",a(function(){r._write(o,s,i)},"open"));return}n.send(o,i)},r.on("end",Ug),r.on("error",If),r}a(Dg,"createWebSocketStream");vf.exports=Dg});var ar=ce((bS,Of)=>{"use strict";Of.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:a(()=>{},"NOOP")}});var qf=ce((RS,Kf)=>{"use strict";var Lf=ae("fs"),qt=ae("path"),Pf=ae("os"),Bf=typeof __webpack_require__=="function"?__non_webpack_require__:ae,Mg=process.config&&process.config.variables||{},$g=!!process.env.PREBUILDS_ONLY,Nf=process.versions.modules,La=Fg()?"electron":zg()?"node-webkit":"node",Pa=process.env.npm_config_arch||Pf.arch(),Ba=process.env.npm_config_platform||Pf.platform(),Uf=process.env.LIBC||(Wg(Ba)?"musl":"glibc"),Ua=process.env.ARM_VERSION||(Pa==="arm64"?"8":Mg.arm_version)||"",Df=(process.versions.uv||"").split(".")[0];Kf.exports=xt;function xt(n){return Bf(xt.resolve(n))}a(xt,"load");xt.resolve=xt.path=function(n){n=qt.resolve(n||".");try{var e=Bf(qt.join(n,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(n=process.env[e+"_PREBUILD"])}catch{}if(!$g){var t=Cf(qt.join(n,"build/Release"),xf);if(t)return t;var r=Cf(qt.join(n,"build/Debug"),xf);if(r)return r}var o=u(n);if(o)return o;var s=u(qt.dirname(process.execPath));if(s)return s;var i=["platform="+Ba,"arch="+Pa,"runtime="+La,"abi="+Nf,"uv="+Df,Ua?"armv="+Ua:"","libc="+Uf,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+i+`
5
5
  loaded from: `+n+`
@@ -256,4 +256,4 @@ buffer-layout/lib/Layout.js:
256
256
  * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}
257
257
  *)
258
258
  */
259
- //# sourceMappingURL=chunk-D2L7KWZ2.js.map
259
+ //# sourceMappingURL=chunk-5NXOOGVA.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 F,e as Ne,f as h,g as M,i as Ae}from"./chunk-B3UDK7W6.js";import{a as S,b as Z}from"./chunk-4WNGQ3EZ.js";import{D as ce,E as ve,a as T,d as Y,f as B,i as Te,m as v,n as ie,o as ae,u as Ie,v as ye,w as Q}from"./chunk-4VKVPYSL.js";import{a as Fe}from"./chunk-IVMOWPFA.js";import{B as b,Ed as q,U as Oe,Ud as W,da as we,te as K,v as N,ve as w,xa as A}from"./chunk-CX3O4KA4.js";import{a,f as R}from"./chunk-G5BIPHMS.js";import{ListStateStorage as Je}from"@sentio/runtime";var p=R(W(),1);var Ze="0x0000000000000000000000000000000000000000000000000000000000000000";function f(n){return typeof n!="object"||n==null?!1:n.$kind==="GasCoin"||n.$kind==="Result"||n.$kind==="NestedResult"||n.$kind==="Input"}a(f,"isTransactionArgument");function Xe(n,e){return f(n)?n:e.object(n)}a(Xe,"transactionArgumentOrObject");function et(n,e){return f(n)?n:typeof n=="string"?e.pure.string(n):e.pure.u64(n)}a(et,"transactionArgumentOrPure");function tt(n,e){return f(n)?n:e.pure.address(n)}a(tt,"transactionArgumentOrPureAddress");function nt(n,e){return f(n)?n:e.pure.u8(n)}a(nt,"transactionArgumentOrPureU8");function rt(n,e){return f(n)?n:e.pure.u16(n)}a(rt,"transactionArgumentOrPureU16");function st(n,e){return f(n)?n:e.pure.u32(n)}a(st,"transactionArgumentOrPureU32");function ot(n,e){return f(n)?n:e.pure.u64(n)}a(ot,"transactionArgumentOrPureU64");function it(n,e){return f(n)?n:e.pure.u128(n)}a(it,"transactionArgumentOrPureU128");function at(n,e){return f(n)?n:e.pure.u256(n)}a(at,"transactionArgumentOrPureU256");function ct(n,e){return f(n)?n:e.pure.bool(n)}a(ct,"transactionArgumentOrPureBool");function ut(n,e){return f(n)?n:e.makeMoveVec({elements:n.map(t=>e.object(t))})}a(ut,"transactionArgumentOrVec");function z(n){return{address:n.address,exposedFunctions:Object.entries(n.exposedFunctions).map(([e,t])=>_e(e,t)),name:n.name,structs:Object.entries(n.structs).map(([e,t])=>Le(e,t))}}a(z,"toInternalModule");function _e(n,e){let t;switch(e.visibility){case"Private":t=Q.PRIVATE;break;case"Public":t=Q.PUBLIC;break;case"Friend":t=Q.FRIEND;break;default:throw Error("No visibility for function"+n)}return{typeParams:e.typeParameters.map(r=>({constraints:r.abilities})),isEntry:e.isEntry,name:n,params:e.parameters.map(j),return:e.return.map(j),visibility:t}}a(_e,"toInternalFunction");function Le(n,e){return{abilities:e.abilities.abilities,fields:e.fields.map(Ve),typeParams:e.typeParameters.map(t=>({constraints:t.constraints.abilities})),isNative:!1,isEvent:!1,name:n}}a(Le,"toInternalStruct");function Ve(n){return{name:n.name,type:j(n.type)}}a(Ve,"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||(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 F[i]();case"address":return F.Address;case"vector":return F.vector(t[0]);default:if(!r.includes("::"))throw`Unimplemented builtin type ${r}`}let u;try{u=await this.getMoveStruct(r)}catch(d){throw console.error("Invalid move address",r),d}let c={};for(let d of u.fields)if(d.type.qname.startsWith("T")&&t.length){let C=+d.type.qname.slice(1);c[d.name]=t[C]}else d.type.typeArgs.length&&t.length?c[d.name]=await this.getBCSTypeWithArgs(d.type,t):c[d.name]=await this.getBCSType(d.type);return F.struct(r,c)}async getBCSType(e){let t=await Promise.all(e.typeArgs.map(s=>this.getBCSType(s))),r=await this.getBCSTypeWithArgs(e,t);return this.bcsRegistry.set(e.getNormalizedSignature(),r),r}async registerBCSTypes(e){let t=e.getNormalizedSignature();if(this.bcsRegistered.has(t))return;this.bcsRegistered.add(t);let r=await this.getBCSType(e);this.bcsRegistry.set(e.getNormalizedSignature(),r)}async decodeBCS(e,t,r){if(await this.registerBCSTypes(e),typeof t=="string"){let o=Buffer.from(t,r);t=new Uint8Array(o,o.byteOffset,o.byteLength)}return this.bcsRegistry.get(e.getNormalizedSignature())?.parse(t)}async decodeDevInspectResult(e){let t=[];if(e.results!=null)for(let r of e.results)if(r.returnValues)for(let s of r.returnValues){let o=ie(s[1]),i=await this.decodeBCS(o,new Uint8Array(s[0])),u=await this.decodeType(i,o);t.push(u)}else t.push(null);return{...e,results_decoded:t}}},Ue="https://fullnode.mainnet.sui.io/",Me=new Map;function ke(n=Ue){let e=Me.get(n);return e||(e=new I(new Ne({url:n})),Me.set(n,e)),e}a(ke,"defaultMoveCoder");var Pe=new Map,ue;async function Ge(n){let e=Pe.get(n);if(!e){e=new I(n);let t=await n.getChainIdentifier(),r=ke();ue||(ue=await r.adapter.getChainId()),t===ue&&(e=r),Pe.set(n,e)}return e}a(Ge,"getMoveCoder");var Ee=new Map;function P(n=h.MAIN_NET){let e=Ee.get(n);return e||(e=new I(M(n)),Ee.set(n,e)),e}a(P,"defaultMoveCoder");import("node:process").then(n=>n.stdout.write(""));var m=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=P(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:q(t)}}get client(){return M(this.network)}},k=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=P(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:q(t)}}get client(){return M(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=P(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:q(t)}}get client(){return M(this.network)}getTimestamp(){return this.timestamp.getDate()}},ee=class extends de{static{a(this,"SuiObjectContext")}contractName="object";objectId;objectVersion;constructor(e,t,r,s,o,i){super(e,t,s,o,i),this.objectId=t,this.objectVersion=r}};import("node:process").then(n=>n.stdout.write(""));function De(n){let e=n.transaction?.data.transaction;if(!e)return[];let t=e.kind==="ProgrammableTransaction"?e:void 0;return t?t.transactions.flatMap(r=>{if("MoveCall"in r){let s=r.MoveCall;return s.package=Y(s.package),[s]}return[]}):[]}a(De,"getMoveCalls");import("node:process").then(n=>n.stdout.write(""));var _={resourceChanges:!1,allEvents:!1,inputs:!1};function fe(n){return{startCheckpoint:n.startCheckpoint||0n,address:n.address===w?w:B(n.address),network:n.network||h.MAIN_NET,baseLabels:n.baseLabels}}a(fe,"configure");var L=class n extends Je{static{a(this,"SuiProcessorState")}static INSTANCE=new n},V=class{static{a(this,"SuiBaseProcessor")}moduleName;config;eventHandlers=[];callHandlers=[];objectChangeHandlers=[];coder;constructor(e,t){return this.moduleName=e,this.config=fe(t),L.INSTANCE.addValue(this),this.coder=P(this.config.network),Z(this)}getChainId(){return this.config.network}onMoveEvent(e,t,r){let s=[],o=A.fromPartial({..._,...r});Array.isArray(t)?s=t:s.push(t);let i=this;return this.eventHandlers.push({handlerName:S(),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);if(!c.events||!c.events.length)throw new p.ServerError(p.Status.INVALID_ARGUMENT,"no event in the transactions");let d=JSON.parse(u.rawEvent),C=Number(d.id.eventSeq)||0,O=new m(i.moduleName,i.config.network,i.config.address,u.timestamp||new Date(0),u.slot,c,C,i.config.baseLabels),H=await i.coder.decodeEvent(d);return await e(H||d,O),O.stopAndGetResult()},"handler"),filters:s,fetchConfig:o}),this}onEntryFunctionCall(e,t,r){let s=[],o=A.fromPartial({..._,...r});Array.isArray(t)?s=t:s.push(t);let i=this,u=new Set(s.map(c=>c.function));return this.callHandlers.push({handlerName:S(),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 m(i.moduleName,i.config.network,i.config.address,c.timestamp||new Date(0),c.slot,d,0,i.config.baseLabels);if(d){let O=De(d),H=d.transaction?.data?.transaction;if(!H)throw new p.ServerError(p.Status.INVALID_ARGUMENT,"Unexpected getTransactionKind get empty");let He=H.kind==="ProgrammableTransaction"?H:void 0;for(let oe of O){let Re=[oe.module,oe.function].join(T);if(!u.has(Re))continue;let Be=await i.coder.decodeFunctionPayload(oe,He?.inputs||[]);await e(Be,C)}}return C.stopAndGetResult()},"handler"),filters:s,fetchConfig:o}),this}onEvent(e,t){return this.onMoveEvent(e,{type:""},t),this}onTransactionBlock(e,t,r){let s=A.fromPartial({..._,...r}),o=this;return this.callHandlers.push({handlerName:S(),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 m(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===h.TEST_NET)throw new p.ServerError(p.Status.INVALID_ARGUMENT,"object change not supported in testnet");let r=this;return this.objectChangeHandlers.push({handlerName:S(),handler:a(async function(s){let o=new k(r.config.network,r.config.address,s.timestamp||new Date(0),s.slot,s.txDigest,r.config.baseLabels);return await e(s.rawChanges.map(i=>JSON.parse(i)),o),o.stopAndGetResult()},"handler"),type:t}),this}},le=class n extends V{static{a(this,"SuiModulesProcessor")}static bind(e){return new n(w,e)}},pe=class n extends V{static{a(this,"SuiGlobalProcessor")}static bind(e){return new n(w,{...e,address:w})}onTransactionBlock(e,t,r){return super.onTransactionBlock(e,t,r)}onObjectChange(e,t){return super.onObjectChange(e,t)}};import("node:process").then(n=>n.stdout.write(""));import{ListStateStorage as $e}from"@sentio/runtime";var E=R(W(),1);var me={owned:!1},y=class n extends $e{static{a(this,"SuiAccountProcessorState")}static INSTANCE=new n},te=class{static{a(this,"SuiBaseObjectOrAddressProcessor")}config;ownerType;templateId;objectHandlers=[];objectChangeHandlers=[];constructor(e){return e.ownerType===N.TYPE?this.config={startCheckpoint:e.startCheckpoint||0n,address:e.address==="*"?"*":Y(e.address),network:e.network||h.MAIN_NET,baseLabels:e.baseLabels}:this.config=fe(e),this.ownerType=e.ownerType,y.INSTANCE.addValue(this),Z(this)}getChainId(){return this.config.network}onInterval(e,t,r,s,o){let i=this;return this.objectHandlers.push({handlerName:S(),handler:a(async function(u){let c=new ee(i.config.network,u.objectId,u.objectVersion,u.slot,u.timestamp||new Date(0),i.config.baseLabels);return await i.doHandle(e,u,c),c.stopAndGetResult()},"handler"),timeIntervalInMinutes:t,checkPointInterval:r,type:s,fetchConfig:{...me,...o}}),this}},U=class extends te{static{a(this,"SuiBaseObjectOrAddressProcessorInternal")}onTimeInterval(e,t=60,r=240,s,o){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,s,o)}onCheckpointInterval(e,t=1e5,r=4e5,s,o){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},s,o)}},x=class n extends U{static{a(this,"SuiAddressProcessor")}callHandlers=[];static bind(e){return new n({...e,ownerType:N.ADDRESS})}async doHandle(e,t,r){return e(t.rawObjects.map(s=>JSON.parse(s)),r)}onTransactionBlock(e,t,r){let s=A.fromPartial({..._,...r}),o={fromAndToAddress:{from:"",to:this.config.address},...t},i=this;return this.callHandlers.push({handlerName:S(),handler:a(async function(u){if(!u.rawTransaction)throw new E.ServerError(E.Status.INVALID_ARGUMENT,"transaction is null");let c=JSON.parse(u.rawTransaction),d=new m("object",i.config.network,i.config.address,u.timestamp||new Date(0),u.slot,c,0,i.config.baseLabels);return c&&await e(c,d),d.stopAndGetResult()},"handler"),filters:[{...o,function:""}],fetchConfig:s}),this}},G=class n extends U{static{a(this,"SuiObjectProcessor")}static bind(e){return new n({address:e.objectId,network:e.network,startCheckpoint:e.startCheckpoint,ownerType:N.OBJECT,baseLabels:e.baseLabels})}async doHandle(e,t,r){if(!t.rawSelf){console.log(`Sui object not existed in ${r.checkpoint}, please specific a start time`);return}return e(JSON.parse(t.rawSelf),t.rawObjects.map(s=>JSON.parse(s)),r)}},he=class n extends te{static{a(this,"SuiObjectTypeProcessor")}objectType;static bind(e){let t=new n({address:w,network:e.network,startCheckpoint:e.startCheckpoint,ownerType:N.TYPE,baseLabels:e.baseLabels});return t.objectType=e.objectType,t}async doHandle(e,t,r){if(!t.rawSelf){console.log(`Sui object not existed in ${r.checkpoint}, please specific a start time`);return}let s=await r.coder.filterAndDecodeObjects(this.objectType,[JSON.parse(t.rawSelf)]);return e(s[0],t.rawObjects.map(o=>JSON.parse(o)),r)}onObjectChange(e){if(this.config.network===h.TEST_NET)throw new E.ServerError(E.Status.INVALID_ARGUMENT,"object change not supported in testnet");let t=this;return this.objectChangeHandlers.push({handlerName:S(),handler:a(async function(r){let s=new k(t.config.network,t.config.address,r.timestamp||new Date(0),r.slot,r.txDigest,t.config.baseLabels);return await e(r.rawChanges.map(o=>JSON.parse(o)),s),s.stopAndGetResult()},"handler"),type:this.objectType.qname}),this}onTimeInterval(e,t=60,r=240,s){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,this.objectType.qname,s)}onCheckpointInterval(e,t=1e5,r=4e5,s){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},this.objectType.qname,s)}},J=class n extends U{static{a(this,"SuiWrappedObjectProcessor")}static bind(e){return new n({address:e.objectId,network:e.network,startCheckpoint:e.startCheckpoint,ownerType:N.WRAPPED_OBJECT,baseLabels:e.baseLabels})}async doHandle(e,t,r){return e(t.rawObjects.map(s=>JSON.parse(s)),r)}};import("node:process").then(n=>n.stdout.write(""));import{ListStateStorage as qe}from"@sentio/runtime";var g=R(W(),1);var D=class n extends qe{static{a(this,"SuiAccountProcessorTemplateState")}static INSTANCE=new n},$=class{static{a(this,"SuiObjectOrAddressProcessorTemplate")}id;objectHandlers=[];binds=new Set;constructor(){this.id=D.INSTANCE.getValues().length,D.INSTANCE.addValue(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 g.ServerError(g.Status.INVALID_ARGUMENT,"can't bind template instance with *");r=B(r);let s=[e.network,r].join("_");if(this.binds.has(s)){console.log(`Same object id can be bind to one template only once, ignore duplicate bind: ${s}`);return}this.binds.add(s);let o=this.createProcessor(e);for(let u of this.objectHandlers)o.onInterval(u.handler,u.timeIntervalInMinutes,u.checkpointInterval,u.type,u.fetchConfig);let i=o.config;t.update({states:{configUpdated:!0}}),K.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 g.ServerError(g.Status.INVALID_ARGUMENT,"can't delete template instance bind with *");r=B(r);let s=[e.network,r].join("_");if(!this.binds.has(s)){console.log(`the template instance ${s} not existed or already unbind`);return}this.binds.delete(s);let o=0,i=K.INSTANCE.unregister();for(let c of i){if(c.contract?.chainId===e.network&&c.contract.address==r){o++;continue}K.INSTANCE.addValue(c)}if(o!==1)throw new g.ServerError(g.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 g.ServerError(g.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({handler:e,timeIntervalInMinutes:t,checkpointInterval:r,type:s,fetchConfig:{...me,...o}}),this}onTimeInterval(e,t=60,r=240,s,o){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,s,o)}onCheckpointInterval(e,t=1e5,r=4e5,s,o){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},s,o)}};var ge=class extends ${static{a(this,"SuiAddressProcessorTemplate")}handlers=[];createProcessor(e){let t=x.bind(e);for(let r of this.handlers)t.onTransactionBlock(r.handler,r.filter,r.fetchConfig);return t.templateId=this.id,t}onTransactionBlock(e,t,r){return this.handlers.push({handler:e,filter:t,fetchConfig:r}),this}},be=class extends ${static{a(this,"SuiObjectProcessorTemplate")}createProcessor(e){let t=G.bind(e);return t.templateId=this.id,t}},Se=class extends ${static{a(this,"SuiWrappedObjectProcessorTemplate")}createProcessor(e){let t=J.bind(e);return t.templateId=this.id,t}};import("node:process").then(n=>n.stdout.write(""));import("node:process").then(n=>n.stdout.write(""));import{errorString as ne,mergeProcessResults as re,Plugin as We,PluginManager as Ke,USER_PROCESSOR as Ye}from"@sentio/runtime";var l=R(W(),1);var Ce=R(Fe(),1);var se=class extends We{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),D.INSTANCE.getValues()[r.templateId].bind({address:r.contract?.address||"",objectId:r.contract?.address||"",network:r.contract?.chainId||h.MAIN_NET,startCheckpoint:r.startBlock||0n,baseLabels:r.baseLabels},Qe)}}async configure(e){let t={suiCallHandlers:[],suiEventHandlers:[],suiObjectHandlers:[],suiObjectChangeHandlers:[]};for(let r of L.INSTANCE.getValues()){let s=Oe.fromPartial({transactionConfig:[],processorType:Ye,contract:{name:r.moduleName,chainId:r.config.network,address:r.config.address,abi:""},startBlock:r.config.startCheckpoint});for(let o of r.eventHandlers){let i=t.suiEventHandlers.push(o.handler)-1,u={filters:o.filters.map(c=>({type:c.type,account:c.account||""})),fetchConfig:o.fetchConfig,handlerId:i,handlerName:o.handlerName};s.moveEventConfigs.push(u)}for(let o of r.callHandlers){let i=t.suiCallHandlers.push(o.handler)-1,u={filters:o.filters.map(c=>({function:c.function,typeArguments:c.typeArguments||[],withTypeArguments:!!c.typeArguments,includeFailed:c.includeFailed||!1,publicKeyPrefix:c.publicKeyPrefix||"",fromAndToAddress:c.fromAndToAddress})),fetchConfig:o.fetchConfig,handlerId:i,handlerName:o.handlerName};s.moveCallConfigs.push(u)}for(let o of r.objectChangeHandlers){let i=t.suiObjectChangeHandlers.push(o.handler)-1,u={type:o.type,handlerId:i,handlerName:o.handlerName};s.moveResourceChangeConfigs.push(u)}e.contractConfigs.push(s)}for(let r of y.INSTANCE.getValues()){let s=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 F,e as Ne,f as h,g as M,i as Ae}from"./chunk-JUDV27KS.js";import{a as S,b as Z}from"./chunk-4WNGQ3EZ.js";import{D as ce,E as ve,a as T,d as Y,f as B,i as Te,m as v,n as ie,o as ae,u as Ie,v as ye,w as Q}from"./chunk-A3BBP3JY.js";import{a as Fe}from"./chunk-IVMOWPFA.js";import{B as b,Dd as q,Td as W,U as Oe,da as we,se as K,ue as w,v as N,xa as A}from"./chunk-VLD3QNSH.js";import{a,f as R}from"./chunk-G5BIPHMS.js";import{ListStateStorage as Je}from"@sentio/runtime";var p=R(W(),1);var Ze="0x0000000000000000000000000000000000000000000000000000000000000000";function f(n){return typeof n!="object"||n==null?!1:n.$kind==="GasCoin"||n.$kind==="Result"||n.$kind==="NestedResult"||n.$kind==="Input"}a(f,"isTransactionArgument");function Xe(n,e){return f(n)?n:e.object(n)}a(Xe,"transactionArgumentOrObject");function et(n,e){return f(n)?n:typeof n=="string"?e.pure.string(n):e.pure.u64(n)}a(et,"transactionArgumentOrPure");function tt(n,e){return f(n)?n:e.pure.address(n)}a(tt,"transactionArgumentOrPureAddress");function nt(n,e){return f(n)?n:e.pure.u8(n)}a(nt,"transactionArgumentOrPureU8");function rt(n,e){return f(n)?n:e.pure.u16(n)}a(rt,"transactionArgumentOrPureU16");function st(n,e){return f(n)?n:e.pure.u32(n)}a(st,"transactionArgumentOrPureU32");function ot(n,e){return f(n)?n:e.pure.u64(n)}a(ot,"transactionArgumentOrPureU64");function it(n,e){return f(n)?n:e.pure.u128(n)}a(it,"transactionArgumentOrPureU128");function at(n,e){return f(n)?n:e.pure.u256(n)}a(at,"transactionArgumentOrPureU256");function ct(n,e){return f(n)?n:e.pure.bool(n)}a(ct,"transactionArgumentOrPureBool");function ut(n,e){return f(n)?n:e.makeMoveVec({elements:n.map(t=>e.object(t))})}a(ut,"transactionArgumentOrVec");function z(n){return{address:n.address,exposedFunctions:Object.entries(n.exposedFunctions).map(([e,t])=>_e(e,t)),name:n.name,structs:Object.entries(n.structs).map(([e,t])=>Le(e,t))}}a(z,"toInternalModule");function _e(n,e){let t;switch(e.visibility){case"Private":t=Q.PRIVATE;break;case"Public":t=Q.PUBLIC;break;case"Friend":t=Q.FRIEND;break;default:throw Error("No visibility for function"+n)}return{typeParams:e.typeParameters.map(r=>({constraints:r.abilities})),isEntry:e.isEntry,name:n,params:e.parameters.map(j),return:e.return.map(j),visibility:t}}a(_e,"toInternalFunction");function Le(n,e){return{abilities:e.abilities.abilities,fields:e.fields.map(Ve),typeParams:e.typeParameters.map(t=>({constraints:t.constraints.abilities})),isNative:!1,isEvent:!1,name:n}}a(Le,"toInternalStruct");function Ve(n){return{name:n.name,type:j(n.type)}}a(Ve,"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||(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 F[i]();case"address":return F.Address;case"vector":return F.vector(t[0]);default:if(!r.includes("::"))throw`Unimplemented builtin type ${r}`}let u;try{u=await this.getMoveStruct(r)}catch(d){throw console.error("Invalid move address",r),d}let c={};for(let d of u.fields)if(d.type.qname.startsWith("T")&&t.length){let C=+d.type.qname.slice(1);c[d.name]=t[C]}else d.type.typeArgs.length&&t.length?c[d.name]=await this.getBCSTypeWithArgs(d.type,t):c[d.name]=await this.getBCSType(d.type);return F.struct(r,c)}async getBCSType(e){let t=await Promise.all(e.typeArgs.map(s=>this.getBCSType(s))),r=await this.getBCSTypeWithArgs(e,t);return this.bcsRegistry.set(e.getNormalizedSignature(),r),r}async registerBCSTypes(e){let t=e.getNormalizedSignature();if(this.bcsRegistered.has(t))return;this.bcsRegistered.add(t);let r=await this.getBCSType(e);this.bcsRegistry.set(e.getNormalizedSignature(),r)}async decodeBCS(e,t,r){if(await this.registerBCSTypes(e),typeof t=="string"){let o=Buffer.from(t,r);t=new Uint8Array(o,o.byteOffset,o.byteLength)}return this.bcsRegistry.get(e.getNormalizedSignature())?.parse(t)}async decodeDevInspectResult(e){let t=[];if(e.results!=null)for(let r of e.results)if(r.returnValues)for(let s of r.returnValues){let o=ie(s[1]),i=await this.decodeBCS(o,new Uint8Array(s[0])),u=await this.decodeType(i,o);t.push(u)}else t.push(null);return{...e,results_decoded:t}}},Ue="https://fullnode.mainnet.sui.io/",Me=new Map;function ke(n=Ue){let e=Me.get(n);return e||(e=new I(new Ne({url:n})),Me.set(n,e)),e}a(ke,"defaultMoveCoder");var Pe=new Map,ue;async function Ge(n){let e=Pe.get(n);if(!e){e=new I(n);let t=await n.getChainIdentifier(),r=ke();ue||(ue=await r.adapter.getChainId()),t===ue&&(e=r),Pe.set(n,e)}return e}a(Ge,"getMoveCoder");var Ee=new Map;function P(n=h.MAIN_NET){let e=Ee.get(n);return e||(e=new I(M(n)),Ee.set(n,e)),e}a(P,"defaultMoveCoder");import("node:process").then(n=>n.stdout.write(""));var m=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=P(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:q(t)}}get client(){return M(this.network)}},k=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=P(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:q(t)}}get client(){return M(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=P(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:q(t)}}get client(){return M(this.network)}getTimestamp(){return this.timestamp.getDate()}},ee=class extends de{static{a(this,"SuiObjectContext")}contractName="object";objectId;objectVersion;constructor(e,t,r,s,o,i){super(e,t,s,o,i),this.objectId=t,this.objectVersion=r}};import("node:process").then(n=>n.stdout.write(""));function De(n){let e=n.transaction?.data.transaction;if(!e)return[];let t=e.kind==="ProgrammableTransaction"?e:void 0;return t?t.transactions.flatMap(r=>{if("MoveCall"in r){let s=r.MoveCall;return s.package=Y(s.package),[s]}return[]}):[]}a(De,"getMoveCalls");import("node:process").then(n=>n.stdout.write(""));var _={resourceChanges:!1,allEvents:!1,inputs:!1};function fe(n){return{startCheckpoint:n.startCheckpoint||0n,address:n.address===w?w:B(n.address),network:n.network||h.MAIN_NET,baseLabels:n.baseLabels}}a(fe,"configure");var L=class n extends Je{static{a(this,"SuiProcessorState")}static INSTANCE=new n},V=class{static{a(this,"SuiBaseProcessor")}moduleName;config;eventHandlers=[];callHandlers=[];objectChangeHandlers=[];coder;constructor(e,t){return this.moduleName=e,this.config=fe(t),L.INSTANCE.addValue(this),this.coder=P(this.config.network),Z(this)}getChainId(){return this.config.network}onMoveEvent(e,t,r){let s=[],o=A.fromPartial({..._,...r});Array.isArray(t)?s=t:s.push(t);let i=this;return this.eventHandlers.push({handlerName:S(),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);if(!c.events||!c.events.length)throw new p.ServerError(p.Status.INVALID_ARGUMENT,"no event in the transactions");let d=JSON.parse(u.rawEvent),C=Number(d.id.eventSeq)||0,O=new m(i.moduleName,i.config.network,i.config.address,u.timestamp||new Date(0),u.slot,c,C,i.config.baseLabels),H=await i.coder.decodeEvent(d);return await e(H||d,O),O.stopAndGetResult()},"handler"),filters:s,fetchConfig:o}),this}onEntryFunctionCall(e,t,r){let s=[],o=A.fromPartial({..._,...r});Array.isArray(t)?s=t:s.push(t);let i=this,u=new Set(s.map(c=>c.function));return this.callHandlers.push({handlerName:S(),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 m(i.moduleName,i.config.network,i.config.address,c.timestamp||new Date(0),c.slot,d,0,i.config.baseLabels);if(d){let O=De(d),H=d.transaction?.data?.transaction;if(!H)throw new p.ServerError(p.Status.INVALID_ARGUMENT,"Unexpected getTransactionKind get empty");let He=H.kind==="ProgrammableTransaction"?H:void 0;for(let oe of O){let Re=[oe.module,oe.function].join(T);if(!u.has(Re))continue;let Be=await i.coder.decodeFunctionPayload(oe,He?.inputs||[]);await e(Be,C)}}return C.stopAndGetResult()},"handler"),filters:s,fetchConfig:o}),this}onEvent(e,t){return this.onMoveEvent(e,{type:""},t),this}onTransactionBlock(e,t,r){let s=A.fromPartial({..._,...r}),o=this;return this.callHandlers.push({handlerName:S(),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 m(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===h.TEST_NET)throw new p.ServerError(p.Status.INVALID_ARGUMENT,"object change not supported in testnet");let r=this;return this.objectChangeHandlers.push({handlerName:S(),handler:a(async function(s){let o=new k(r.config.network,r.config.address,s.timestamp||new Date(0),s.slot,s.txDigest,r.config.baseLabels);return await e(s.rawChanges.map(i=>JSON.parse(i)),o),o.stopAndGetResult()},"handler"),type:t}),this}},le=class n extends V{static{a(this,"SuiModulesProcessor")}static bind(e){return new n(w,e)}},pe=class n extends V{static{a(this,"SuiGlobalProcessor")}static bind(e){return new n(w,{...e,address:w})}onTransactionBlock(e,t,r){return super.onTransactionBlock(e,t,r)}onObjectChange(e,t){return super.onObjectChange(e,t)}};import("node:process").then(n=>n.stdout.write(""));import{ListStateStorage as $e}from"@sentio/runtime";var E=R(W(),1);var me={owned:!1},y=class n extends $e{static{a(this,"SuiAccountProcessorState")}static INSTANCE=new n},te=class{static{a(this,"SuiBaseObjectOrAddressProcessor")}config;ownerType;templateId;objectHandlers=[];objectChangeHandlers=[];constructor(e){return e.ownerType===N.TYPE?this.config={startCheckpoint:e.startCheckpoint||0n,address:e.address==="*"?"*":Y(e.address),network:e.network||h.MAIN_NET,baseLabels:e.baseLabels}:this.config=fe(e),this.ownerType=e.ownerType,y.INSTANCE.addValue(this),Z(this)}getChainId(){return this.config.network}onInterval(e,t,r,s,o){let i=this;return this.objectHandlers.push({handlerName:S(),handler:a(async function(u){let c=new ee(i.config.network,u.objectId,u.objectVersion,u.slot,u.timestamp||new Date(0),i.config.baseLabels);return await i.doHandle(e,u,c),c.stopAndGetResult()},"handler"),timeIntervalInMinutes:t,checkPointInterval:r,type:s,fetchConfig:{...me,...o}}),this}},U=class extends te{static{a(this,"SuiBaseObjectOrAddressProcessorInternal")}onTimeInterval(e,t=60,r=240,s,o){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,s,o)}onCheckpointInterval(e,t=1e5,r=4e5,s,o){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},s,o)}},x=class n extends U{static{a(this,"SuiAddressProcessor")}callHandlers=[];static bind(e){return new n({...e,ownerType:N.ADDRESS})}async doHandle(e,t,r){return e(t.rawObjects.map(s=>JSON.parse(s)),r)}onTransactionBlock(e,t,r){let s=A.fromPartial({..._,...r}),o={fromAndToAddress:{from:"",to:this.config.address},...t},i=this;return this.callHandlers.push({handlerName:S(),handler:a(async function(u){if(!u.rawTransaction)throw new E.ServerError(E.Status.INVALID_ARGUMENT,"transaction is null");let c=JSON.parse(u.rawTransaction),d=new m("object",i.config.network,i.config.address,u.timestamp||new Date(0),u.slot,c,0,i.config.baseLabels);return c&&await e(c,d),d.stopAndGetResult()},"handler"),filters:[{...o,function:""}],fetchConfig:s}),this}},G=class n extends U{static{a(this,"SuiObjectProcessor")}static bind(e){return new n({address:e.objectId,network:e.network,startCheckpoint:e.startCheckpoint,ownerType:N.OBJECT,baseLabels:e.baseLabels})}async doHandle(e,t,r){if(!t.rawSelf){console.log(`Sui object not existed in ${r.checkpoint}, please specific a start time`);return}return e(JSON.parse(t.rawSelf),t.rawObjects.map(s=>JSON.parse(s)),r)}},he=class n extends te{static{a(this,"SuiObjectTypeProcessor")}objectType;static bind(e){let t=new n({address:w,network:e.network,startCheckpoint:e.startCheckpoint,ownerType:N.TYPE,baseLabels:e.baseLabels});return t.objectType=e.objectType,t}async doHandle(e,t,r){if(!t.rawSelf){console.log(`Sui object not existed in ${r.checkpoint}, please specific a start time`);return}let s=await r.coder.filterAndDecodeObjects(this.objectType,[JSON.parse(t.rawSelf)]);return e(s[0],t.rawObjects.map(o=>JSON.parse(o)),r)}onObjectChange(e){if(this.config.network===h.TEST_NET)throw new E.ServerError(E.Status.INVALID_ARGUMENT,"object change not supported in testnet");let t=this;return this.objectChangeHandlers.push({handlerName:S(),handler:a(async function(r){let s=new k(t.config.network,t.config.address,r.timestamp||new Date(0),r.slot,r.txDigest,t.config.baseLabels);return await e(r.rawChanges.map(o=>JSON.parse(o)),s),s.stopAndGetResult()},"handler"),type:this.objectType.qname}),this}onTimeInterval(e,t=60,r=240,s){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,this.objectType.qname,s)}onCheckpointInterval(e,t=1e5,r=4e5,s){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},this.objectType.qname,s)}},J=class n extends U{static{a(this,"SuiWrappedObjectProcessor")}static bind(e){return new n({address:e.objectId,network:e.network,startCheckpoint:e.startCheckpoint,ownerType:N.WRAPPED_OBJECT,baseLabels:e.baseLabels})}async doHandle(e,t,r){return e(t.rawObjects.map(s=>JSON.parse(s)),r)}};import("node:process").then(n=>n.stdout.write(""));import{ListStateStorage as qe}from"@sentio/runtime";var g=R(W(),1);var D=class n extends qe{static{a(this,"SuiAccountProcessorTemplateState")}static INSTANCE=new n},$=class{static{a(this,"SuiObjectOrAddressProcessorTemplate")}id;objectHandlers=[];binds=new Set;constructor(){this.id=D.INSTANCE.getValues().length,D.INSTANCE.addValue(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 g.ServerError(g.Status.INVALID_ARGUMENT,"can't bind template instance with *");r=B(r);let s=[e.network,r].join("_");if(this.binds.has(s)){console.log(`Same object id can be bind to one template only once, ignore duplicate bind: ${s}`);return}this.binds.add(s);let o=this.createProcessor(e);for(let u of this.objectHandlers)o.onInterval(u.handler,u.timeIntervalInMinutes,u.checkpointInterval,u.type,u.fetchConfig);let i=o.config;t.update({states:{configUpdated:!0}}),K.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 g.ServerError(g.Status.INVALID_ARGUMENT,"can't delete template instance bind with *");r=B(r);let s=[e.network,r].join("_");if(!this.binds.has(s)){console.log(`the template instance ${s} not existed or already unbind`);return}this.binds.delete(s);let o=0,i=K.INSTANCE.unregister();for(let c of i){if(c.contract?.chainId===e.network&&c.contract.address==r){o++;continue}K.INSTANCE.addValue(c)}if(o!==1)throw new g.ServerError(g.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 g.ServerError(g.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({handler:e,timeIntervalInMinutes:t,checkpointInterval:r,type:s,fetchConfig:{...me,...o}}),this}onTimeInterval(e,t=60,r=240,s,o){return this.onInterval(e,{recentInterval:t,backfillInterval:r},void 0,s,o)}onCheckpointInterval(e,t=1e5,r=4e5,s,o){return this.onInterval(e,void 0,{recentInterval:t,backfillInterval:r},s,o)}};var ge=class extends ${static{a(this,"SuiAddressProcessorTemplate")}handlers=[];createProcessor(e){let t=x.bind(e);for(let r of this.handlers)t.onTransactionBlock(r.handler,r.filter,r.fetchConfig);return t.templateId=this.id,t}onTransactionBlock(e,t,r){return this.handlers.push({handler:e,filter:t,fetchConfig:r}),this}},be=class extends ${static{a(this,"SuiObjectProcessorTemplate")}createProcessor(e){let t=G.bind(e);return t.templateId=this.id,t}},Se=class extends ${static{a(this,"SuiWrappedObjectProcessorTemplate")}createProcessor(e){let t=J.bind(e);return t.templateId=this.id,t}};import("node:process").then(n=>n.stdout.write(""));import("node:process").then(n=>n.stdout.write(""));import{errorString as ne,mergeProcessResults as re,Plugin as We,PluginManager as Ke,USER_PROCESSOR as Ye}from"@sentio/runtime";var l=R(W(),1);var Ce=R(Fe(),1);var se=class extends We{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),D.INSTANCE.getValues()[r.templateId].bind({address:r.contract?.address||"",objectId:r.contract?.address||"",network:r.contract?.chainId||h.MAIN_NET,startCheckpoint:r.startBlock||0n,baseLabels:r.baseLabels},Qe)}}async configure(e){let t={suiCallHandlers:[],suiEventHandlers:[],suiObjectHandlers:[],suiObjectChangeHandlers:[]};for(let r of L.INSTANCE.getValues()){let s=Oe.fromPartial({transactionConfig:[],processorType:Ye,contract:{name:r.moduleName,chainId:r.config.network,address:r.config.address,abi:""},startBlock:r.config.startCheckpoint});for(let o of r.eventHandlers){let i=t.suiEventHandlers.push(o.handler)-1,u={filters:o.filters.map(c=>({type:c.type,account:c.account||""})),fetchConfig:o.fetchConfig,handlerId:i,handlerName:o.handlerName};s.moveEventConfigs.push(u)}for(let o of r.callHandlers){let i=t.suiCallHandlers.push(o.handler)-1,u={filters:o.filters.map(c=>({function:c.function,typeArguments:c.typeArguments||[],withTypeArguments:!!c.typeArguments,includeFailed:c.includeFailed||!1,publicKeyPrefix:c.publicKeyPrefix||"",fromAndToAddress:c.fromAndToAddress})),fetchConfig:o.fetchConfig,handlerId:i,handlerName:o.handlerName};s.moveCallConfigs.push(u)}for(let o of r.objectChangeHandlers){let i=t.suiObjectChangeHandlers.push(o.handler)-1,u={type:o.type,handlerId:i,handlerName:o.handlerName};s.moveResourceChangeConfigs.push(u)}e.contractConfigs.push(s)}for(let r of y.INSTANCE.getValues()){let s=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=[b.SUI_EVENT,b.SUI_CALL,b.SUI_OBJECT,b.SUI_OBJECT_CHANGE];processBinding(e){switch(e.handlerType){case b.SUI_EVENT:return this.processSuiEvent(e);case b.SUI_CALL:return this.processSuiFunctionCall(e);case b.SUI_OBJECT:return this.processSuiObject(e);case b.SUI_OBJECT_CHANGE:return this.processSuiObjectChange(e);default:throw new l.ServerError(l.Status.INVALID_ARGUMENT,"No handle type registered "+e.handlerType)}}};Ke.INSTANCE.register(new se);var Qe=new m("",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,Xe as b,et as c,tt as d,nt as e,rt as f,st as g,ot as h,it as i,at as j,ct as k,ut as l,I as m,Ge as n,P as o,m as p,k as q,de as r,ee as s,De as t,V as u,le as v,pe as w,x,G as y,he as z,J as A,ge as B,be as C,Se as D,se as E};
7
- //# sourceMappingURL=chunk-MD3T4H6B.js.map
7
+ //# sourceMappingURL=chunk-6P4HU4KH.js.map