@arcblock/payment-service 1.29.2 → 1.29.3-beta-frontend-serve.4

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 (608) hide show
  1. package/dist/cf.d.ts +104 -0
  2. package/dist/cf.js +598 -0
  3. package/dist/index.d.ts +37 -0
  4. package/dist/index.js +522 -292
  5. package/package.json +14 -7
  6. package/web/assets/Community-DjnKQ_eJ.js +1 -0
  7. package/web/assets/Holiday-B3mAiPaR.js +1 -0
  8. package/web/assets/Meeting-Boiro55U.js +1 -0
  9. package/web/assets/OffSick-CmlSODCj.js +1 -0
  10. package/web/assets/WorkingRemotely-CQReAoVA.js +1 -0
  11. package/web/assets/abtwallet-o1JAGJkW.png +0 -0
  12. package/web/assets/account-DETfFe4_.js +1 -0
  13. package/web/assets/action-B_DQJlip.js +1 -0
  14. package/web/assets/actions-BaDh4xWX.js +1 -0
  15. package/web/assets/actions-BknL4OyZ.js +1 -0
  16. package/web/assets/actions-Bt_jST94.js +1 -0
  17. package/web/assets/actions-BtaoyTWt.js +1 -0
  18. package/web/assets/actions-D9MHLBFH.js +1 -0
  19. package/web/assets/actions-DJyfN5OU.js +1 -0
  20. package/web/assets/actions-EPYeS5p4.js +1 -0
  21. package/web/assets/actions-QPa-8lfB.js +1 -0
  22. package/web/assets/actions-jxGAdGfb.js +1 -0
  23. package/web/assets/add-price-CD-utowo.js +1 -0
  24. package/web/assets/admin-_nEB-lHn.js +52 -0
  25. package/web/assets/aistro-NLUOUWwT.png +0 -0
  26. package/web/assets/android-Xe96zWxX.png +0 -0
  27. package/web/assets/assign-CkV5Q2LP.js +1 -0
  28. package/web/assets/attempts-DySeqBYU.js +1 -0
  29. package/web/assets/bedrock-yFRPpe__.png +0 -0
  30. package/web/assets/browser-Bb9g-cvG.js +1 -0
  31. package/web/assets/browser-DSLTxXlL.js +1 -0
  32. package/web/assets/cache-state-lld4zuDg.js +1 -0
  33. package/web/assets/change-payment-CPUCUEER.js +1 -0
  34. package/web/assets/change-plan-CxE-XfWc.js +1 -0
  35. package/web/assets/chrome-BPS46pXA.js +23 -0
  36. package/web/assets/click-boundary-y8dVA_tr.js +1 -0
  37. package/web/assets/collapse-BvbJGg1V.js +1 -0
  38. package/web/assets/collapse-CSrlJ0eG.js +1 -0
  39. package/web/assets/connect-CC_l_f6Q.js +5 -0
  40. package/web/assets/copyable-DpX04wZz.js +1 -0
  41. package/web/assets/create-3SsWCAOC.js +1 -0
  42. package/web/assets/create-BkQAaSvD.js +1 -0
  43. package/web/assets/create-BmcRybZ5.js +1 -0
  44. package/web/assets/create-Bs65p5Ne.js +1 -0
  45. package/web/assets/create-kG09X9gl.js +1 -0
  46. package/web/assets/create-tYebjhr9.js +1 -0
  47. package/web/assets/credit-grant-item-list-Bk27jIc7.js +1 -0
  48. package/web/assets/credit-overview-DmMSEs14.js +5 -0
  49. package/web/assets/currency-GstdXsJf.js +1 -0
  50. package/web/assets/currency-restrictions-DYLv4YyW.js +1 -0
  51. package/web/assets/currency-select-DGS-62-L.js +1 -0
  52. package/web/assets/dayjs-B9tvQIKg.js +1 -0
  53. package/web/assets/deepseek-C3x42pq3.png +0 -0
  54. package/web/assets/description-Ym17DL48.js +1 -0
  55. package/web/assets/detail-15zxCbV9.js +10 -0
  56. package/web/assets/detail-ASPdMJoW.js +1 -0
  57. package/web/assets/detail-BJTcK7mx.js +1 -0
  58. package/web/assets/detail-CIx9vkir.js +1 -0
  59. package/web/assets/detail-CT9Unyrf.js +1 -0
  60. package/web/assets/detail-Cb9HBSMw.js +1 -0
  61. package/web/assets/detail-Cr2wG4Th.js +1 -0
  62. package/web/assets/detail-CxYQYu_l.js +11 -0
  63. package/web/assets/detail-D5KRrQDx.js +1 -0
  64. package/web/assets/detail-D5NbV29V.js +1 -0
  65. package/web/assets/detail-DB56SG-k.js +1 -0
  66. package/web/assets/detail-DE3OOC5M.js +15 -0
  67. package/web/assets/detail-DG4l2CqN.js +1 -0
  68. package/web/assets/detail-DPCTQLOx.js +1 -0
  69. package/web/assets/detail-DVVzYhdV.js +1 -0
  70. package/web/assets/detail-Do9QO5L2.js +1 -0
  71. package/web/assets/detail-Dqc0OfCQ.js +1 -0
  72. package/web/assets/detail-DuO_Jn5X.js +1 -0
  73. package/web/assets/detail-DuWdZIyp.js +1 -0
  74. package/web/assets/detail-K9EVY3r2.js +1 -0
  75. package/web/assets/detail-OZeeKI69.js +24 -0
  76. package/web/assets/detail-cwHZbY62.js +1 -0
  77. package/web/assets/detail-uhlID8jD.js +15 -0
  78. package/web/assets/doubao-yPqHSkLx.png +0 -0
  79. package/web/assets/drawer-form-Cl0T1Yyt.js +24 -0
  80. package/web/assets/edit-3HUAnaXW.js +1 -0
  81. package/web/assets/editor-BF5I0siU.js +1 -0
  82. package/web/assets/embed-CsNqeCd0.js +1 -0
  83. package/web/assets/filter-toolbar-BydfQ-79.js +56 -0
  84. package/web/assets/form-BGm5NPDn.js +1 -0
  85. package/web/assets/form-BXAuSawq.js +9 -0
  86. package/web/assets/form-CKfKLGXP.js +16 -0
  87. package/web/assets/form-DSzMo9UD.js +66 -0
  88. package/web/assets/form-P4luyUpY.js +9 -0
  89. package/web/assets/gas-Qf0SSUfS.js +1 -0
  90. package/web/assets/gemini-DffKpc81.png +0 -0
  91. package/web/assets/generateCategoricalChart-BaWwaXky.js +55 -0
  92. package/web/assets/google-DT1VSJ0m.png +0 -0
  93. package/web/assets/header-ivXuPt06.js +1 -0
  94. package/web/assets/home-HbrLyxJL.js +2 -0
  95. package/web/assets/html2canvas.esm-3ybT_T2r.js +5 -0
  96. package/web/assets/ideogram-REIjy0Er.png +0 -0
  97. package/web/assets/index-0HK7CYm4.js +1 -0
  98. package/web/assets/index-1y9kjPIr.js +1 -0
  99. package/web/assets/index-2l22EYw9.js +1 -0
  100. package/web/assets/index-9xBRL_33.js +1 -0
  101. package/web/assets/index-B1pTTyGZ.js +1 -0
  102. package/web/assets/index-BFML4-2u.js +170 -0
  103. package/web/assets/index-BIoSdRvX.js +12 -0
  104. package/web/assets/index-BJ_E6bEO.js +1 -0
  105. package/web/assets/index-BMKZToMM.js +28 -0
  106. package/web/assets/index-BP53rZV9.js +1 -0
  107. package/web/assets/index-Bnyh4rlV.js +1 -0
  108. package/web/assets/index-BoQ7wf3O.js +1 -0
  109. package/web/assets/index-Br7_mvEw.js +1 -0
  110. package/web/assets/index-C0JaS08f.js +38 -0
  111. package/web/assets/index-C68x-aau.js +1 -0
  112. package/web/assets/index-C8s2QKoe.js +1 -0
  113. package/web/assets/index-CI_EY4YS.js +1 -0
  114. package/web/assets/index-CdkYrABk.js +1 -0
  115. package/web/assets/index-Clbt8nRm.js +1 -0
  116. package/web/assets/index-Cn7O-OP7.js +49 -0
  117. package/web/assets/index-Cw0ugaQL.js +1 -0
  118. package/web/assets/index-DE2KzqXl.js +1 -0
  119. package/web/assets/index-DPodCQ9c.js +1 -0
  120. package/web/assets/index-DU39aG5u.js +1 -0
  121. package/web/assets/index-DZpJPE1Z.js +1 -0
  122. package/web/assets/index-Dc954mDP.js +1 -0
  123. package/web/assets/index-DgSc1Qy8.js +684 -0
  124. package/web/assets/index-Dr_MwbKt.js +38 -0
  125. package/web/assets/index-Drav4oDH.js +61 -0
  126. package/web/assets/index-DtbqgSK4.js +1 -0
  127. package/web/assets/index-DuRu9NWB.js +14 -0
  128. package/web/assets/index-SYTpMMMH.js +13 -0
  129. package/web/assets/index-WMKOiUez.js +1 -0
  130. package/web/assets/index-dmHgoplS.js +1 -0
  131. package/web/assets/index-fByZjxLy.js +1 -0
  132. package/web/assets/index-fswPX_qe.js +1 -0
  133. package/web/assets/index-txVTkoDD.js +1 -0
  134. package/web/assets/index.es-BWnfUzLb.js +5 -0
  135. package/web/assets/info-card-C1yxhxJG.js +1 -0
  136. package/web/assets/info-metric-CNse3r66.js +1 -0
  137. package/web/assets/info-row-DOK2whMn.js +1 -0
  138. package/web/assets/info-row-group-BeUhWnnY.js +1 -0
  139. package/web/assets/ios-CBDmY-ic.png +0 -0
  140. package/web/assets/lexend-latin-400-normal-CHypAkT3.woff +0 -0
  141. package/web/assets/lexend-latin-400-normal-CwRJVcUA.woff2 +0 -0
  142. package/web/assets/lexend-latin-600-normal-DSBzZxpA.woff +0 -0
  143. package/web/assets/lexend-latin-600-normal-DdvlkEkX.woff2 +0 -0
  144. package/web/assets/lexend-latin-ext-400-normal-D38JI5AK.woff2 +0 -0
  145. package/web/assets/lexend-latin-ext-400-normal-D9P7pMo-.woff +0 -0
  146. package/web/assets/lexend-latin-ext-600-normal-BXtyp5LP.woff +0 -0
  147. package/web/assets/lexend-latin-ext-600-normal-hDcqLAH9.woff2 +0 -0
  148. package/web/assets/lexend-vietnamese-400-normal-DoLa7jNB.woff2 +0 -0
  149. package/web/assets/lexend-vietnamese-400-normal-mPlHoWg5.woff +0 -0
  150. package/web/assets/lexend-vietnamese-600-normal-BxEVPgxw.woff +0 -0
  151. package/web/assets/lexend-vietnamese-600-normal-Cr1ePs6O.woff2 +0 -0
  152. package/web/assets/libphonenumber-CyphiuxQ.js +7 -0
  153. package/web/assets/link-3eeclTeS.js +1 -0
  154. package/web/assets/link-DMWJcQvZ.js +1 -0
  155. package/web/assets/list-1OG83xc4.js +1 -0
  156. package/web/assets/list-C521zE_7.js +1 -0
  157. package/web/assets/list-CNmzJKIQ.js +1 -0
  158. package/web/assets/list-CO0X4L3-.js +1 -0
  159. package/web/assets/list-D-I0msRW.js +35 -0
  160. package/web/assets/list-D1aevUOI.js +5 -0
  161. package/web/assets/list-DnePqZ2K.js +1 -0
  162. package/web/assets/list-jHj_5yy3.js +1 -0
  163. package/web/assets/lodash-B4Ozcv0x.js +20 -0
  164. package/web/assets/lottie-error-DeJ4jU66.js +1 -0
  165. package/web/assets/lottie-loading-Npqo86wA.js +1 -0
  166. package/web/assets/lottie-react.esm-BuFP9VDV.js +256 -0
  167. package/web/assets/lottie-welcome-oyMgXGo-.js +1 -0
  168. package/web/assets/metadata-CMSHcSXi.js +55 -0
  169. package/web/assets/meter-event-lmNMgmIu.js +1 -0
  170. package/web/assets/metrics-C7U41HWk.js +1 -0
  171. package/web/assets/ollama-C7MZn2d_.png +0 -0
  172. package/web/assets/openai-DlpqJdrb.png +0 -0
  173. package/web/assets/overview-CH1HnSP-.js +1 -0
  174. package/web/assets/overview-Cs3-8n4e.js +6 -0
  175. package/web/assets/past-due-CGGRZmXY.js +5 -0
  176. package/web/assets/pay-CSpHBUh_.js +4 -0
  177. package/web/assets/payment-kit-DYSjmihw.png +0 -0
  178. package/web/assets/payment-method-info-BsOBbA3m.js +16 -0
  179. package/web/assets/poe-B588TgZu.png +0 -0
  180. package/web/assets/preview-CjYh9dTg.js +1 -0
  181. package/web/assets/preview-DjYRpRA8.js +1 -0
  182. package/web/assets/pricing-table-C3Lkhq46.js +36 -0
  183. package/web/assets/pricing-table-edE6TJGX.js +1 -0
  184. package/web/assets/product-select-0ScZE2e8.js +1 -0
  185. package/web/assets/react-stripe.esm-BZIKAsrR.js +2 -0
  186. package/web/assets/recharge-DcPtT8vt.js +14 -0
  187. package/web/assets/related-credit-grants-BygNGPfb.js +124 -0
  188. package/web/assets/roboto-latin-400-normal-BVyCgWwA.woff +0 -0
  189. package/web/assets/roboto-latin-400-normal-DXyFPIdK.woff2 +0 -0
  190. package/web/assets/roboto-latin-500-normal-C6iW8rdg.woff2 +0 -0
  191. package/web/assets/roboto-latin-500-normal-rpP1_v3s.woff +0 -0
  192. package/web/assets/roboto-latin-700-normal-BWcFiwQV.woff +0 -0
  193. package/web/assets/roboto-latin-700-normal-CbYYDfWS.woff2 +0 -0
  194. package/web/assets/roboto-latin-ext-400-normal-BSFkPfbf.woff +0 -0
  195. package/web/assets/roboto-latin-ext-400-normal-DgXbz5gU.woff2 +0 -0
  196. package/web/assets/roboto-latin-ext-500-normal-DvHxAkTn.woff +0 -0
  197. package/web/assets/roboto-latin-ext-500-normal-OQJhyaXd.woff2 +0 -0
  198. package/web/assets/roboto-latin-ext-700-normal-Ba-CAIIA.woff +0 -0
  199. package/web/assets/roboto-latin-ext-700-normal-DchBbzVz.woff2 +0 -0
  200. package/web/assets/safe-did-address-B0fFbUph.js +1 -0
  201. package/web/assets/source-data-viewer-By_Utay-.js +1 -0
  202. package/web/assets/status-l6pD08fw.js +1 -0
  203. package/web/assets/stripe.esm-BCCu7gPj.js +1 -0
  204. package/web/assets/style-BWb904Pt.css +1 -0
  205. package/web/assets/subscription-DcwhSOpa.js +1 -0
  206. package/web/assets/subscription-Dq22e3D1.js +1 -0
  207. package/web/assets/table-BRU4Enia.js +1 -0
  208. package/web/assets/tax-code-select-CWhIIiXi.js +1 -0
  209. package/web/assets/tax-utils-DqNX34-r.js +1 -0
  210. package/web/assets/tokenList-9PBdKlKn.js +1 -0
  211. package/web/assets/ubuntu-mono-cyrillic-400-normal-Di_0TARV.woff +0 -0
  212. package/web/assets/ubuntu-mono-cyrillic-400-normal-OGyu3tt3.woff2 +0 -0
  213. package/web/assets/ubuntu-mono-cyrillic-ext-400-normal-C5u8faa9.woff2 +0 -0
  214. package/web/assets/ubuntu-mono-cyrillic-ext-400-normal-CL-A5l1V.woff +0 -0
  215. package/web/assets/ubuntu-mono-greek-400-normal-CCUzT4Jh.woff2 +0 -0
  216. package/web/assets/ubuntu-mono-greek-400-normal-DR50Gfyl.woff +0 -0
  217. package/web/assets/ubuntu-mono-greek-ext-400-normal-BNZd3ZNJ.woff +0 -0
  218. package/web/assets/ubuntu-mono-greek-ext-400-normal-CUE8Ia0W.woff2 +0 -0
  219. package/web/assets/ubuntu-mono-latin-400-normal-DpWeehTz.woff +0 -0
  220. package/web/assets/ubuntu-mono-latin-400-normal-l4cqI2xd.woff2 +0 -0
  221. package/web/assets/ubuntu-mono-latin-ext-400-normal-C-izf5FM.woff +0 -0
  222. package/web/assets/ubuntu-mono-latin-ext-400-normal-Cadvr_Yo.woff2 +0 -0
  223. package/web/assets/uploader-DRXDz_r0.js +9 -0
  224. package/web/assets/usage-records-jjJMZ6DI.js +1 -0
  225. package/web/assets/util-mDHAL0lx.js +1 -0
  226. package/web/assets/vendor-arcblock-ChFCRdyx.js +175 -0
  227. package/web/assets/vendor-blocklet-D_i_QeSo.js +2742 -0
  228. package/web/assets/vendor-mui-BXZut9Pz.js +225 -0
  229. package/web/assets/vendor-react-BPknnnEA.js +1 -0
  230. package/web/currencies/0xBTC.png +0 -0
  231. package/web/currencies/1INCH.svg +1 -0
  232. package/web/currencies/AAVE.svg +1 -0
  233. package/web/currencies/ABT.svg +16 -0
  234. package/web/currencies/ACX.png +0 -0
  235. package/web/currencies/ADX.svg +12 -0
  236. package/web/currencies/AIKEK.png +0 -0
  237. package/web/currencies/AJNA.svg +12 -0
  238. package/web/currencies/AKIRA.png +0 -0
  239. package/web/currencies/ALEX.png +0 -0
  240. package/web/currencies/ALI.png +0 -0
  241. package/web/currencies/ALT.svg +12 -0
  242. package/web/currencies/AMKT.svg +5 -0
  243. package/web/currencies/AMP.svg +7 -0
  244. package/web/currencies/APU.png +0 -0
  245. package/web/currencies/APW.svg +21 -0
  246. package/web/currencies/APX.png +0 -0
  247. package/web/currencies/ARC.png +0 -0
  248. package/web/currencies/ARIA20.svg +1 -0
  249. package/web/currencies/ARPA.svg +1 -0
  250. package/web/currencies/ATH.svg +1 -0
  251. package/web/currencies/AVC.png +0 -0
  252. package/web/currencies/AVRK.png +0 -0
  253. package/web/currencies/AXGT.svg +1 -0
  254. package/web/currencies/AZUR.svg +20 -0
  255. package/web/currencies/BAL.png +0 -0
  256. package/web/currencies/BANK.png +0 -0
  257. package/web/currencies/BAXA.svg +3 -0
  258. package/web/currencies/BCAT.png +0 -0
  259. package/web/currencies/BEPRO.svg +1 -0
  260. package/web/currencies/BERRY.svg +1 -0
  261. package/web/currencies/BICO.svg +11 -0
  262. package/web/currencies/BITBOT.jpg +0 -0
  263. package/web/currencies/BITCOIN.png +0 -0
  264. package/web/currencies/BKN.svg +1 -0
  265. package/web/currencies/BLUE.png +0 -0
  266. package/web/currencies/BNB.png +0 -0
  267. package/web/currencies/BOBA.svg +16 -0
  268. package/web/currencies/BOBO.png +0 -0
  269. package/web/currencies/BOND.svg +10 -0
  270. package/web/currencies/BOTTO.svg +4 -0
  271. package/web/currencies/BRIGHT.svg +83 -0
  272. package/web/currencies/BTRST.svg +1 -0
  273. package/web/currencies/BURN.png +0 -0
  274. package/web/currencies/BitANT.png +0 -0
  275. package/web/currencies/BitBTC.png +0 -0
  276. package/web/currencies/CARD.svg +1 -0
  277. package/web/currencies/CBX.svg +1 -0
  278. package/web/currencies/CHI.svg +1 -0
  279. package/web/currencies/CIG.svg +21 -0
  280. package/web/currencies/CNG.svg +9 -0
  281. package/web/currencies/COC.svg +8 -0
  282. package/web/currencies/COLLAB.svg +8 -0
  283. package/web/currencies/COMP.svg +1 -0
  284. package/web/currencies/COW.svg +1 -0
  285. package/web/currencies/CRV.png +0 -0
  286. package/web/currencies/CRYO.svg +1 -0
  287. package/web/currencies/CTRAVL.svg +1 -0
  288. package/web/currencies/CTSI.svg +1 -0
  289. package/web/currencies/CTX.svg +1 -0
  290. package/web/currencies/CUSD.png +0 -0
  291. package/web/currencies/CXT.svg +11 -0
  292. package/web/currencies/D2D.svg +6 -0
  293. package/web/currencies/DAI.svg +13 -0
  294. package/web/currencies/DCN.svg +47 -0
  295. package/web/currencies/DF.svg +15 -0
  296. package/web/currencies/DHT.svg +1 -0
  297. package/web/currencies/DIMO.svg +1 -0
  298. package/web/currencies/DMS.png +0 -0
  299. package/web/currencies/DODO.svg +6 -0
  300. package/web/currencies/DOGEGF.png +0 -0
  301. package/web/currencies/DOLA.svg +1 -0
  302. package/web/currencies/DOSE.svg +1 -0
  303. package/web/currencies/DUCK.png +0 -0
  304. package/web/currencies/DYP.png +0 -0
  305. package/web/currencies/EIGEN.svg +13 -0
  306. package/web/currencies/ENS.png +0 -0
  307. package/web/currencies/EPOCH.svg +1 -0
  308. package/web/currencies/EQB.svg +4 -0
  309. package/web/currencies/EQZ.png +0 -0
  310. package/web/currencies/ERN.png +0 -0
  311. package/web/currencies/ERNTST.png +0 -0
  312. package/web/currencies/EST.png +0 -0
  313. package/web/currencies/ETH.svg +13 -0
  314. package/web/currencies/ETHIX.svg +1 -0
  315. package/web/currencies/EVERY.svg +13 -0
  316. package/web/currencies/F.svg +1 -0
  317. package/web/currencies/FACTR.png +0 -0
  318. package/web/currencies/FANS.svg +11 -0
  319. package/web/currencies/FARM.png +0 -0
  320. package/web/currencies/FCR.png +0 -0
  321. package/web/currencies/FET.svg +21 -0
  322. package/web/currencies/FIS.svg +22 -0
  323. package/web/currencies/FLASH.svg +22 -0
  324. package/web/currencies/FLy.png +0 -0
  325. package/web/currencies/FOAM.svg +23 -0
  326. package/web/currencies/FORTH.svg +1 -0
  327. package/web/currencies/FOX.svg +8 -0
  328. package/web/currencies/FRAX.png +0 -0
  329. package/web/currencies/FU.svg +17 -0
  330. package/web/currencies/FVT.svg +1 -0
  331. package/web/currencies/FXN.svg +25 -0
  332. package/web/currencies/FXS.png +0 -0
  333. package/web/currencies/Froglic.png +0 -0
  334. package/web/currencies/GALAXIS.svg +1 -0
  335. package/web/currencies/GCH.png +0 -0
  336. package/web/currencies/GENOME.svg +23 -0
  337. package/web/currencies/GGTK.svg +1 -0
  338. package/web/currencies/GHST.svg +15 -0
  339. package/web/currencies/GIGACHAD.png +0 -0
  340. package/web/currencies/GIV.svg +6 -0
  341. package/web/currencies/GLS.svg +22 -0
  342. package/web/currencies/GOLD.png +0 -0
  343. package/web/currencies/GRG.png +0 -0
  344. package/web/currencies/GROW.svg +1 -0
  345. package/web/currencies/GRT.svg +11 -0
  346. package/web/currencies/GTC.svg +5 -0
  347. package/web/currencies/GURU.svg +1 -0
  348. package/web/currencies/GYEN.svg +1 -0
  349. package/web/currencies/GYSR.png +0 -0
  350. package/web/currencies/HAIR.svg +1 -0
  351. package/web/currencies/HAN.svg +25 -0
  352. package/web/currencies/HANeP.svg +1 -0
  353. package/web/currencies/HAUS.png +0 -0
  354. package/web/currencies/HEU.svg +5 -0
  355. package/web/currencies/HOBA.png +0 -0
  356. package/web/currencies/HUNT.svg +1 -0
  357. package/web/currencies/IBEX.png +0 -0
  358. package/web/currencies/IDRISS.svg +4 -0
  359. package/web/currencies/IOTX.png +0 -0
  360. package/web/currencies/IPOR.svg +1 -0
  361. package/web/currencies/IPT.svg +7 -0
  362. package/web/currencies/IRARA.svg +1 -0
  363. package/web/currencies/ISK.png +0 -0
  364. package/web/currencies/IYKYK.svg +14 -0
  365. package/web/currencies/JAM.svg +20 -0
  366. package/web/currencies/JRT.svg +8 -0
  367. package/web/currencies/KAGE.png +0 -0
  368. package/web/currencies/KAI.svg +23 -0
  369. package/web/currencies/KIBSHI.png +0 -0
  370. package/web/currencies/KNC.png +0 -0
  371. package/web/currencies/KOMPETE.png +0 -0
  372. package/web/currencies/KROM.png +0 -0
  373. package/web/currencies/LCX.svg +6 -0
  374. package/web/currencies/LDO.svg +5 -0
  375. package/web/currencies/LIF3.svg +27 -0
  376. package/web/currencies/LINK.png +0 -0
  377. package/web/currencies/LIZ.png +0 -0
  378. package/web/currencies/LMEOW.png +0 -0
  379. package/web/currencies/LOCG.png +0 -0
  380. package/web/currencies/LORDS.png +0 -0
  381. package/web/currencies/LPF.svg +18 -0
  382. package/web/currencies/LQTY.svg +1 -0
  383. package/web/currencies/LRC.png +0 -0
  384. package/web/currencies/LRDS.svg +44 -0
  385. package/web/currencies/LSK.png +0 -0
  386. package/web/currencies/LUSD.svg +1 -0
  387. package/web/currencies/LYRA.png +0 -0
  388. package/web/currencies/MASK.svg +4 -0
  389. package/web/currencies/MASQ.png +0 -0
  390. package/web/currencies/MBS.png +0 -0
  391. package/web/currencies/MCADE.svg +26 -0
  392. package/web/currencies/MET.svg +15 -0
  393. package/web/currencies/MINDS.svg +32 -0
  394. package/web/currencies/MKR.png +0 -0
  395. package/web/currencies/MLN.svg +1 -0
  396. package/web/currencies/MOCHI.svg +1 -0
  397. package/web/currencies/MOM.svg +5 -0
  398. package/web/currencies/MONKE.png +0 -0
  399. package/web/currencies/MOOV.svg +5 -0
  400. package/web/currencies/MORPHO.svg +14 -0
  401. package/web/currencies/MPWR.svg +5 -0
  402. package/web/currencies/MTA.svg +15 -0
  403. package/web/currencies/MTL.png +0 -0
  404. package/web/currencies/MUGLOO.png +0 -0
  405. package/web/currencies/Mog.png +0 -0
  406. package/web/currencies/NAVI.svg +1 -0
  407. package/web/currencies/NCT.svg +49 -0
  408. package/web/currencies/NET.svg +11 -0
  409. package/web/currencies/NEURON.svg +38 -0
  410. package/web/currencies/NFD.png +0 -0
  411. package/web/currencies/NOGS.png +0 -0
  412. package/web/currencies/NOUNS.png +0 -0
  413. package/web/currencies/NOVA.png +0 -0
  414. package/web/currencies/NSTR.svg +4 -0
  415. package/web/currencies/Neiro.png +0 -0
  416. package/web/currencies/OCEAN.png +0 -0
  417. package/web/currencies/OGN.svg +8 -0
  418. package/web/currencies/OL.svg +21 -0
  419. package/web/currencies/OLAS.svg +7 -0
  420. package/web/currencies/OM.png +0 -0
  421. package/web/currencies/OMETA.svg +7 -0
  422. package/web/currencies/OMI.svg +42 -0
  423. package/web/currencies/OPENLOOT.svg +21 -0
  424. package/web/currencies/OPN.svg +1 -0
  425. package/web/currencies/OS.svg +1 -0
  426. package/web/currencies/OUTb.svg +4 -0
  427. package/web/currencies/OVR.png +0 -0
  428. package/web/currencies/PAGE.svg +1 -0
  429. package/web/currencies/PAL.svg +1 -0
  430. package/web/currencies/PAPER.svg +4 -0
  431. package/web/currencies/PENDLE.png +0 -0
  432. package/web/currencies/PEPE.png +0 -0
  433. package/web/currencies/PERP.png +0 -0
  434. package/web/currencies/PHTK.svg +14 -0
  435. package/web/currencies/PIP.svg +11 -0
  436. package/web/currencies/POGS.png +0 -0
  437. package/web/currencies/POOL.svg +22 -0
  438. package/web/currencies/POP.svg +8 -0
  439. package/web/currencies/PORK.png +0 -0
  440. package/web/currencies/PRE.svg +66 -0
  441. package/web/currencies/PREMIA.svg +4 -0
  442. package/web/currencies/PRF.png +0 -0
  443. package/web/currencies/PRO.svg +1 -0
  444. package/web/currencies/PSP.svg +35 -0
  445. package/web/currencies/PSTAKE.png +0 -0
  446. package/web/currencies/PSY.svg +26 -0
  447. package/web/currencies/RAC.png +0 -0
  448. package/web/currencies/RAI.svg +1 -0
  449. package/web/currencies/RAZOR.svg +1 -0
  450. package/web/currencies/REKT.png +0 -0
  451. package/web/currencies/RFKJ.png +0 -0
  452. package/web/currencies/RFWSTETH.svg +36 -0
  453. package/web/currencies/RGT.png +0 -0
  454. package/web/currencies/RICE.svg +22 -0
  455. package/web/currencies/RIZE.svg +21 -0
  456. package/web/currencies/RPL.svg +1 -0
  457. package/web/currencies/RSC.svg +6 -0
  458. package/web/currencies/RSR.png +0 -0
  459. package/web/currencies/RSS3.png +0 -0
  460. package/web/currencies/Reach.svg +17 -0
  461. package/web/currencies/SAIL.png +0 -0
  462. package/web/currencies/SALD.png +0 -0
  463. package/web/currencies/SARCO.png +0 -0
  464. package/web/currencies/SCM.svg +1 -0
  465. package/web/currencies/SCRY.svg +13 -0
  466. package/web/currencies/SDL.svg +1 -0
  467. package/web/currencies/SEAM.svg +5 -0
  468. package/web/currencies/SEXY.svg +1 -0
  469. package/web/currencies/SHU.png +0 -0
  470. package/web/currencies/SIPHER.png +0 -0
  471. package/web/currencies/SKAI.svg +1 -0
  472. package/web/currencies/SLN.png +0 -0
  473. package/web/currencies/SMT.svg +1 -0
  474. package/web/currencies/SMURFCAT.png +0 -0
  475. package/web/currencies/SNT.svg +14 -0
  476. package/web/currencies/SNX.svg +20 -0
  477. package/web/currencies/SOFI.png +0 -0
  478. package/web/currencies/SOFT.svg +1 -0
  479. package/web/currencies/SOVRN.svg +13 -0
  480. package/web/currencies/SPANK.png +0 -0
  481. package/web/currencies/SPC.png +0 -0
  482. package/web/currencies/SPOT.svg +1 -0
  483. package/web/currencies/SQD.png +0 -0
  484. package/web/currencies/SQT.svg +14 -0
  485. package/web/currencies/STNT.svg +38 -0
  486. package/web/currencies/STPT.png +0 -0
  487. package/web/currencies/SUDO.svg +6 -0
  488. package/web/currencies/SUKU.png +0 -0
  489. package/web/currencies/SUPER.svg +6 -0
  490. package/web/currencies/SUSHI.svg +19 -0
  491. package/web/currencies/SYNTH.svg +1 -0
  492. package/web/currencies/ShibDoge.png +0 -0
  493. package/web/currencies/Silo.svg +4 -0
  494. package/web/currencies/StaFi.svg +65 -0
  495. package/web/currencies/T.svg +4 -0
  496. package/web/currencies/TEN.svg +1 -0
  497. package/web/currencies/TETU.svg +6 -0
  498. package/web/currencies/THALES.png +0 -0
  499. package/web/currencies/THING.png +0 -0
  500. package/web/currencies/THX.svg +22 -0
  501. package/web/currencies/TKAI.svg +1 -0
  502. package/web/currencies/TKN.png +0 -0
  503. package/web/currencies/TODL.png +0 -0
  504. package/web/currencies/TOWER.svg +1 -0
  505. package/web/currencies/TRAC.png +0 -0
  506. package/web/currencies/TRB.png +0 -0
  507. package/web/currencies/TRUE.svg +11 -0
  508. package/web/currencies/TRX.svg +4 -0
  509. package/web/currencies/TSC.png +0 -0
  510. package/web/currencies/TT.png +0 -0
  511. package/web/currencies/TUSD.png +0 -0
  512. package/web/currencies/TYBENG.png +0 -0
  513. package/web/currencies/TheDAO.svg +1 -0
  514. package/web/currencies/U.png +0 -0
  515. package/web/currencies/UBI.svg +5 -0
  516. package/web/currencies/UCASH.svg +1 -0
  517. package/web/currencies/UDT.svg +4 -0
  518. package/web/currencies/UMA.png +0 -0
  519. package/web/currencies/UNI.png +0 -0
  520. package/web/currencies/USA.png +0 -0
  521. package/web/currencies/USC.svg +23 -0
  522. package/web/currencies/USD3.svg +13 -0
  523. package/web/currencies/USDD.png +0 -0
  524. package/web/currencies/USDS.png +0 -0
  525. package/web/currencies/USDbC.png +0 -0
  526. package/web/currencies/UST.png +0 -0
  527. package/web/currencies/VALX.png +0 -0
  528. package/web/currencies/VIDYA.png +0 -0
  529. package/web/currencies/VITA.svg +10 -0
  530. package/web/currencies/VSP.svg +15 -0
  531. package/web/currencies/VUSD.svg +1 -0
  532. package/web/currencies/WAAC.png +0 -0
  533. package/web/currencies/WAD.png +0 -0
  534. package/web/currencies/WALLET.svg +1 -0
  535. package/web/currencies/WAMPL.svg +53 -0
  536. package/web/currencies/WBTC.png +0 -0
  537. package/web/currencies/WCT.svg +5 -0
  538. package/web/currencies/WEXO.png +0 -0
  539. package/web/currencies/WLD.jpeg +0 -0
  540. package/web/currencies/WMC.png +0 -0
  541. package/web/currencies/WOO.png +0 -0
  542. package/web/currencies/Wildfire.svg +1 -0
  543. package/web/currencies/XCHF.png +0 -0
  544. package/web/currencies/XCN.svg +1 -0
  545. package/web/currencies/XMT.svg +1 -0
  546. package/web/currencies/XYO.svg +1 -0
  547. package/web/currencies/YFI.svg +4 -0
  548. package/web/currencies/YFX.svg +11 -0
  549. package/web/currencies/YGG.svg +11 -0
  550. package/web/currencies/YOKAI.png +0 -0
  551. package/web/currencies/YYY.svg +1 -0
  552. package/web/currencies/ZENT.svg +12 -0
  553. package/web/currencies/ZRX.png +0 -0
  554. package/web/currencies/ZUN.svg +24 -0
  555. package/web/currencies/ZUSD.svg +1 -0
  556. package/web/currencies/ZYN.png +0 -0
  557. package/web/currencies/aCRV.png +0 -0
  558. package/web/currencies/btc.png +0 -0
  559. package/web/currencies/bwAJNA.svg +1 -0
  560. package/web/currencies/cSTONE.svg +23 -0
  561. package/web/currencies/cbETH.svg +9 -0
  562. package/web/currencies/crvUSD.png +0 -0
  563. package/web/currencies/cvxFXS.png +0 -0
  564. package/web/currencies/dai.png +0 -0
  565. package/web/currencies/dollar.png +0 -0
  566. package/web/currencies/ePendle.png +0 -0
  567. package/web/currencies/frxETH.png +0 -0
  568. package/web/currencies/fxUSD.svg +5 -0
  569. package/web/currencies/iFARM.png +0 -0
  570. package/web/currencies/iZi.png +0 -0
  571. package/web/currencies/imgnAI.svg +1 -0
  572. package/web/currencies/mpETH.svg +4 -0
  573. package/web/currencies/nETH.svg +11 -0
  574. package/web/currencies/rETH.svg +1 -0
  575. package/web/currencies/rgUSD.svg +5 -0
  576. package/web/currencies/rnETH.svg +11 -0
  577. package/web/currencies/sDAI.svg +13 -0
  578. package/web/currencies/sFRAX.png +0 -0
  579. package/web/currencies/sUSDS.png +0 -0
  580. package/web/currencies/scWETHv2.svg +1 -0
  581. package/web/currencies/send.svg +12 -0
  582. package/web/currencies/stETH.png +1 -0
  583. package/web/currencies/stZENT.svg +12 -0
  584. package/web/currencies/stkLYRA.svg +26 -0
  585. package/web/currencies/tGS.png +0 -0
  586. package/web/currencies/tSTAR.png +0 -0
  587. package/web/currencies/usdc.png +0 -0
  588. package/web/currencies/usdt.png +0 -0
  589. package/web/currencies/veKWENTA.svg +24 -0
  590. package/web/currencies/wHOGE.svg +14 -0
  591. package/web/currencies/wOpenX.svg +140 -0
  592. package/web/currencies/wPOKT.svg +17 -0
  593. package/web/currencies/wTBT.svg +1 -0
  594. package/web/currencies/weETH.svg +23 -0
  595. package/web/currencies/wstETH.svg +11 -0
  596. package/web/currencies/yETH.svg +8 -0
  597. package/web/currencies/zunETH.svg +46 -0
  598. package/web/currencies/zunUSD.svg +33 -0
  599. package/web/fonts/noto-sans-sc-chinese-simplified-500-normal.ttf +0 -0
  600. package/web/index.html +72 -0
  601. package/web/methods/arcblock.png +0 -0
  602. package/web/methods/base.png +0 -0
  603. package/web/methods/binance.png +0 -0
  604. package/web/methods/coinbase.png +0 -0
  605. package/web/methods/default.png +0 -0
  606. package/web/methods/ethereum.jpg +0 -0
  607. package/web/methods/ethereum.png +0 -0
  608. package/web/methods/stripe.png +0 -0
@@ -0,0 +1,13 @@
1
+ import{g as nc}from"./vendor-mui-BXZut9Pz.js";import{ar as Xu}from"./vendor-blocklet-D_i_QeSo.js";import"./vendor-react-BPknnnEA.js";var Je;(function(t){t.NUMBER="NUMBER_NUMBER",t.HEX="NUMBER_HEX",t.STR="NUMBER_STR",t.BIGINT="NUMBER_BIGINT"})(Je||(Je={}));var At;(function(t){t.HEX="BYTES_HEX",t.UINT8ARRAY="BYTES_UINT8ARRAY"})(At||(At={}));const Ne={number:Je.BIGINT,bytes:At.HEX},W={number:Je.HEX,bytes:At.HEX};var it;(function(t){t.EARLIEST="earliest",t.LATEST="latest",t.PENDING="pending",t.SAFE="safe",t.FINALIZED="finalized",t.COMMITTED="committed"})(it||(it={}));var ar;(function(t){t.chainstart="chainstart",t.frontier="frontier",t.homestead="homestead",t.dao="dao",t.tangerineWhistle="tangerineWhistle",t.spuriousDragon="spuriousDragon",t.byzantium="byzantium",t.constantinople="constantinople",t.petersburg="petersburg",t.istanbul="istanbul",t.muirGlacier="muirGlacier",t.berlin="berlin",t.london="london",t.altair="altair",t.arrowGlacier="arrowGlacier",t.grayGlacier="grayGlacier",t.bellatrix="bellatrix",t.merge="merge",t.capella="capella",t.shanghai="shanghai"})(ar||(ar={}));const ao=Object.getPrototypeOf(Uint8Array);var ed=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const td=Symbol.for("web3/base-provider");class Br{static isWeb3Provider(e){return e instanceof Br||!!(e&&e[td])}get[td](){return!0}send(e,n){this.request(e).then(r=>{n(null,r)}).catch(r=>{n(r)})}sendAsync(e){return ed(this,void 0,void 0,function*(){return this.request(e)})}asEIP1193Provider(){const e=Object.create(this),n=e.request;return e.request=function(i){return ed(this,void 0,void 0,function*(){return(yield n(i)).result})},e.asEIP1193Provider=void 0,e}}class Wd extends Array{constructor(e){super(),this._accountProvider=e}}const TI=Object.freeze(Object.defineProperty({__proto__:null,get BlockTags(){return it},DEFAULT_RETURN_FORMAT:Ne,ETH_DATA_FORMAT:W,get FMT_BYTES(){return At},get FMT_NUMBER(){return Je},get HardforksOrdered(){return ar},TypedArray:ao,Web3BaseProvider:Br,Web3BaseWallet:Wd},Symbol.toStringTag,{value:"Module"})),Kd=100,Zd=101,Yd=200,Xd=201,el=202,tl=203,nl=204,rl=205,il=206,sl=207,ol=208,al=300,cl=301,ul=302,dl=303,ll=304,fl=305,hl=306,ml=307,pl=308,gl=309,yl=310,vl=311,bl=400,Al=401,wl=402,_l=403,El=404,xl=405,Il=406,Tl=407,Sl=408,Rl=409,kl=410,Bl=411,Pl=412,Cl=413,Nl=414,Ol=415,Ml=416,Ll=417,Fl=418,Dl=419,jl=420,Hl=421,Ul=422,Gl=423,ql=424,$l=425,Ql=426,Vl=427,zl=428,Jl=429,Wl=430,Kl=431,Zl=432,Yl=433,Xl=434,ef=435,tf=436,nf=437,rf=438,sf=439,of=440,af=441,cf=500,uf=501,df=502,lf=503,ff=504,hf=505,mf=506,pf=507,gf=600,yf=601,vf=602,bf=603,Af=604,wf=701,_f=702,Ef=703,xf=704,If=705,Tf=706,Sf=707,jy=708,Rf=709,kf=801,Bf=802,Hy="0x0",Pf=4001,Cf=4100,Nf=4200,Of=4900,Mf=4901,Lf=901,Ff=902,Df=903,jf=1001,Hf=1002,Uf=1003,Gf=1004,qf=1005,$f=1006,Qf=1007,Vf=1008,zf=1009,Jf=1010,Wf=1011,Kf=1012,Zf=1013,Yf=1014,Xf=1015,eh=1100,rc=1101,Uy=1102,th=1200,zr=-32700,Jr=-32600,Wr=-32601,Kr=-32602,Zr=-32603,Yr=-32e3,Xr=-32001,ei=-32002,ti=-32003,ni=-32004,ri=-32005,ii=-32006;class j extends Error{get innerError(){return this.cause instanceof cr?this.cause.errors:this.cause}set innerError(e){Array.isArray(e)?this.cause=new cr(e):this.cause=e}constructor(e,n){super(e),Array.isArray(n)?this.cause=new cr(n):this.cause=n,this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(new.target.constructor):this.stack=new Error().stack}static convertToString(e,n=!1){if(e==null)return"undefined";const r=JSON.stringify(e,(i,s)=>typeof s=="bigint"?s.toString():s);return n&&["bigint","string"].includes(typeof e)?r.replace(/['\\"]+/g,""):r}toJSON(){return{name:this.name,code:this.code,message:this.message,cause:this.cause,innerError:this.cause}}}class cr extends j{constructor(e){super(`Multiple errors occurred: [${e.map(n=>n.message).join("], [")}]`),this.code=ol,this.errors=e}}class Y extends j{constructor(e,n){super(`Invalid value given "${j.convertToString(e,!0)}". Error: ${n}.`),this.name=this.constructor.name}}class la extends j{constructor(){super("Private key must be 32 bytes."),this.code=wf}}class nh extends j{constructor(){super("Invalid Private Key, Not a valid string or uint8Array"),this.code=_f}}class rh extends j{constructor(e){super(`"${e}"`),this.code=Bf}}class ic extends j{constructor(){super("Invalid key derivation function"),this.code=Ef}}class ih extends j{constructor(){super("Key derivation failed - possibly wrong password"),this.code=xf}}class sh extends j{constructor(){super("Unsupported key store version"),this.code=If}}class oh extends j{constructor(){super("Password cannot be empty"),this.code=Tf}}class ah extends j{constructor(){super("Initialization vector must be 16 bytes"),this.code=Sf}}class ch extends j{constructor(){super("c > 1000, pbkdf2 is less secure with less iterations"),this.code=Rf}}class Ht extends j{constructor(e,n){super(e),this.code=cf,n&&(this.errorCode=n.code,this.errorReason=n.reason)}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{errorCode:this.errorCode,errorReason:this.errorReason})}}class Gy extends Ht{constructor(e,n){super(`CONNECTION ERROR: Couldn't connect to node ${e}.`,n),this.host=e,this.code=uf}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{host:this.host})}}class qy extends Ht{constructor(e){super(`CONNECTION TIMEOUT: timeout of ${e}ms achieved`),this.duration=e,this.code=df}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{duration:this.duration})}}class As extends Ht{constructor(e){super("Connection not open",e),this.code=lf}}class $y extends Ht{constructor(e){var n,r;super(`CONNECTION ERROR: The connection got closed with the close code ${(n=e?.code)!==null&&n!==void 0?n:""} and the following reason string ${(r=e?.reason)!==null&&r!==void 0?r:""}`,e),this.code=ff}}class uh extends Ht{constructor(e){super(`Maximum number of reconnect attempts reached! (${e})`),this.code=hf}}class dh extends Ht{constructor(){super("CONNECTION ERROR: Provider started to reconnect before the response got received!"),this.code=mf}}class lh extends Ht{constructor(e){super(`Request already sent with following id: ${e}`),this.code=pf}}class Oe extends j{constructor(e,n){super(e),this.code=al,this.receipt=n}}class fa extends j{constructor(e,n){super(`The resolver at ${e} does not implement requested method: "${n}".`),this.address=e,this.name=n,this.code=cl}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{address:this.address,name:this.name})}}class Qy extends j{constructor(){super("You must provide the json interface of the contract when instantiating a contract object."),this.code=ul}}class Vy extends j{constructor(){super("Once requires a callback as the second parameter."),this.code=dl}}class zy extends j{constructor(e){super(`Event "${e}" doesn't exist in this contract.`),this.eventName=e,this.code=ll}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{eventName:this.eventName})}}class Jy extends j{constructor(e){super(`Event "${e}" doesn't exist in this contract.`),this.type=e,this.code=fl}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}}class Wy extends j{constructor(){super('No "data" specified in neither the given options, nor the default options.'),this.code=hl}}class Ky extends j{constructor(){super("This contract object doesn't have address set yet, please set an address first."),this.code=ml}}class Zy extends j{constructor(){super('No "from" address specified in neither the given options, nor the default options.'),this.code=pl}}class Yy extends j{constructor(){super(...arguments),this.code=gl}}class Ui extends Oe{constructor(e){if(super(e.message||"Error"),this.name="name"in e&&e.name||this.constructor.name,this.stack="stack"in e&&e.stack||void 0,this.code=e.code,typeof e.data=="object"){let n;e.data&&"originalError"in e.data?n=e.data.originalError:n=e.data,this.data=n.data,this.cause=new Ui(n)}else this.data=e.data}setDecodedProperties(e,n,r){this.errorName=e,this.errorSignature=n,this.errorArgs=r}toJSON(){let e=Object.assign(Object.assign({},super.toJSON()),{data:this.data});return this.errorName&&(e=Object.assign(Object.assign({},e),{errorName:this.errorName,errorSignature:this.errorSignature,errorArgs:this.errorArgs})),e}}class en extends Oe{constructor(e){super("Error happened while trying to execute a function inside a smart contract"),this.code=yl,this.cause=new Ui(e)}}class fh extends Y{constructor(e){var n,r;super(`data: ${(n=e.data)!==null&&n!==void 0?n:"undefined"}, input: ${(r=e.input)!==null&&r!==void 0?r:"undefined"}`,`You can't have "data" and "input" as properties of a contract at the same time, please use either "data" or "input" instead.`),this.code=vl}}class Xy extends j{constructor(e){super(`ENS resolver check interface support error. "${e}"`),this.code=Lf}}class hh extends j{constructor(e){super(`ENS is not supported on network ${e}`),this.code=Ff}}class mh extends j{constructor(){super("Network not synced"),this.code=Df}}class ev extends j{constructor(e,n,r){super(`Invalid number of parameters for "${r}". Got "${e}" expected "${n}"!`),this.got=e,this.expected=n,this.method=r,this.code=Yd}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{got:this.got,expected:this.expected,method:this.method})}}class si extends j{constructor(e){super(`Invalid parameters passed. "${typeof e<"u"?e:""}"`),this.hint=e,this.code=sl}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{hint:this.hint})}}class Ft extends j{constructor(){super(...arguments),this.code=Xd}}class ft extends j{constructor(){super("The method you're trying to call is not implemented."),this.code=el}}class sc extends j{constructor(){super(...arguments),this.code=tl}}class ph extends j{constructor(){super(...arguments),this.code=nl}}class ee extends j{constructor(e,n){super(e),this.code=rl,this.props=n??{}}}class gh extends j{constructor(e){super(`A plugin with the namespace: ${e} has already been registered.`),this.code=il}}class qr extends j{constructor(){super(...arguments),this.code=gf}}class tv extends j{constructor(e){super(`Provider with url "${e}" is not set or invalid`),this.clientUrl=e,this.code=yf}}class ws extends j{constructor(e){super(`Client URL "${e}" is invalid.`),this.code=vf}}class ht extends j{constructor(){super(...arguments),this.code=bf}}class yh extends j{constructor(){super(...arguments),this.code=Af}}class vh extends Y{constructor(){super(...arguments),this.code=kf}}class Gn extends j{constructor(e,n){super(e),this.receipt=n,this.code=bl}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{receipt:this.receipt})}}class nv extends j{constructor(e,n){super(`Your request got reverted with the following reason string: ${e}`),this.reason=e,this.signature=n,this.code=Al}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,signature:this.signature})}}class oi extends j{constructor(e,n,r,i){super(`Transaction has been reverted by the EVM${r===void 0?"":`:
2
+ ${j.convertToString(r)}`}`),this.reason=e,this.signature=n,this.receipt=r,this.data=i,this.code=wl}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,signature:this.signature,receipt:this.receipt,data:this.data})}}class oc extends oi{constructor(e,n,r,i,s,o,a){super(e),this.reason=e,this.customErrorName=n,this.customErrorDecodedSignature=r,this.customErrorArguments=i,this.signature=s,this.receipt=o,this.data=a,this.code=rf}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,customErrorName:this.customErrorName,customErrorDecodedSignature:this.customErrorDecodedSignature,customErrorArguments:this.customErrorArguments,signature:this.signature,receipt:this.receipt,data:this.data})}}class rv extends Gn{constructor(e){super("The transaction receipt didn't contain a contract address.",e),this.code=_l}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{receipt:this.receipt})}}class iv extends Gn{constructor(e){super("The contract code couldn't be stored, please check your gas limit.",e),this.code=El}}class ac extends Gn{constructor(e){super(`Transaction has been reverted by the EVM${e===void 0?"":`:
3
+ ${j.convertToString(e)}`}`,e),this.code=xl}}class sv extends Gn{constructor(e){super(`Transaction ran out of gas. Please provide more gas:
4
+ ${JSON.stringify(e,void 0,2)}`,e),this.code=Il}}class bh extends Gn{constructor(){super("Raw transaction undefined"),this.code=Tl}}class ha extends Gn{constructor(){super("Transaction not found"),this.code=Wl}}class cc extends Y{constructor(e){super(e,"invalid transaction with invalid sender"),this.code=Sl}}class Ah extends Y{constructor(e){super(e,"invalid transaction with invalid receiver"),this.code=nf}}class wh extends Y{constructor(e){super(e,"invalid transaction call"),this.code=Rl}}class _h extends Y{constructor(){super("MissingCustomChainError","If tx.common is provided it must have tx.common.customChain"),this.code=kl}}class Eh extends Y{constructor(){super("MissingCustomChainIdError","If tx.common is provided it must have tx.common.customChain and tx.common.customChain.chainId"),this.code=Bl}}class xh extends Y{constructor(e){super(JSON.stringify(e),"Chain Id doesnt match in tx.chainId tx.common.customChain.chainId"),this.code=Pl}}class Ih extends Y{constructor(e){super(JSON.stringify(e),"Chain doesnt match in tx.chain tx.common.basechain"),this.code=ef}}class Th extends Y{constructor(e){super(JSON.stringify(e),"hardfork doesnt match in tx.hardfork tx.common.hardfork"),this.code=tf}}class Sh extends Y{constructor(){super("CommonOrChainAndHardforkError","Please provide the common object or the chain and hardfork property but not all together."),this.code=Cl}}class Rh extends Y{constructor(e){var n,r;super("MissingChainOrHardforkError",`When specifying chain and hardfork, both values must be defined. Received "chain": ${(n=e.chain)!==null&&n!==void 0?n:"undefined"}, "hardfork": ${(r=e.hardfork)!==null&&r!==void 0?r:"undefined"}`),this.code=Nl}}class kh extends j{constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions'),this.code=of}}class Bh extends Y{constructor(e){var n,r,i,s;super(`gas: ${(n=e.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=e.gasPrice)!==null&&r!==void 0?r:"undefined"}, maxPriorityFeePerGas: ${(i=e.maxPriorityFeePerGas)!==null&&i!==void 0?i:"undefined"}, maxFeePerGas: ${(s=e.maxFeePerGas)!==null&&s!==void 0?s:"undefined"}`,'"gas" is missing'),this.code=Ol,this.cause=new kh}}class Ph extends j{constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions, not both'),this.code=af}}class Ch extends Y{constructor(e){var n,r,i,s;super(`gas: ${(n=e.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=e.gasPrice)!==null&&r!==void 0?r:"undefined"}, maxPriorityFeePerGas: ${(i=e.maxPriorityFeePerGas)!==null&&i!==void 0?i:"undefined"}, maxFeePerGas: ${(s=e.maxFeePerGas)!==null&&s!==void 0?s:"undefined"}`,"transaction must specify legacy or fee market gas properties, not both"),this.code=Xl,this.cause=new Ph}}class Nh extends Y{constructor(e){var n,r;super(`gas: ${(n=e.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=e.gasPrice)!==null&&r!==void 0?r:"undefined"}`,"Gas or gasPrice is lower than 0"),this.code=Ml}}class Oh extends Y{constructor(e){var n,r;super(`maxPriorityFeePerGas: ${(n=e.maxPriorityFeePerGas)!==null&&n!==void 0?n:"undefined"}, maxFeePerGas: ${(r=e.maxFeePerGas)!==null&&r!==void 0?r:"undefined"}`,"maxPriorityFeePerGas or maxFeePerGas is lower than 0"),this.code=Ll}}class Mh extends Y{constructor(e){super(e,"eip-1559 transactions don't support gasPrice"),this.code=Fl}}class uc extends Y{constructor(e){var n,r;super(`maxPriorityFeePerGas: ${(n=e.maxPriorityFeePerGas)!==null&&n!==void 0?n:"undefined"}, maxFeePerGas: ${(r=e.maxFeePerGas)!==null&&r!==void 0?r:"undefined"}`,"pre-eip-1559 transaction don't support maxFeePerGas/maxPriorityFeePerGas"),this.code=Dl}}class Lh extends Y{constructor(e){super(e,"invalid transaction object"),this.code=jl}}class Fh extends Y{constructor(e){var n,r;super(`nonce: ${(n=e.nonce)!==null&&n!==void 0?n:"undefined"}, chainId: ${(r=e.chainId)!==null&&r!==void 0?r:"undefined"}`,"Nonce or chainId is lower than 0"),this.code=Hl}}class Dh extends Y{constructor(){super("UnableToPopulateNonceError","unable to populate nonce, no from address available"),this.code=Ul}}class jh extends Y{constructor(){super("Eip1559NotSupportedError","Network doesn't support eip-1559"),this.code=Gl}}class ma extends Y{constructor(e){super(e,"unsupported transaction type"),this.code=ql}}class dc extends Y{constructor(e){var n,r;super(`data: ${(n=e.data)!==null&&n!==void 0?n:"undefined"}, input: ${(r=e.input)!==null&&r!==void 0?r:"undefined"}`,`You can't have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.`),this.code=$l}}class Hh extends j{constructor(e){super(`The connected Ethereum Node did not respond within ${e.numberOfSeconds} seconds, please make sure your transaction was properly sent and you are connected to a healthy Node. Be aware that transaction might still be pending or mined!
5
+ Transaction Hash: ${e.transactionHash?e.transactionHash.toString():"not available"}`),this.code=Kl}}function Uh(t){return`Please make sure your transaction was properly sent and there are no previous pending transaction for the same account. However, be aware that it might still be mined!
6
+ Transaction Hash: ${t?t.toString():"not available"}`}class lc extends j{constructor(e){super(`Transaction was not mined within ${e.numberOfSeconds} seconds. ${Uh(e.transactionHash)}`),this.code=Ql}}class fc extends j{constructor(e){super(`Transaction started at ${e.starterBlockNumber} but was not mined within ${e.numberOfBlocks} blocks. ${Uh(e.transactionHash)}`),this.code=Zl}}class Gh extends Y{constructor(e){var n,r;super(`receipt: ${JSON.stringify(e.receipt)}, blockHash: ${(n=e.blockHash)===null||n===void 0?void 0:n.toString()}, transactionHash: ${(r=e.transactionHash)===null||r===void 0?void 0:r.toString()}`,"Receipt missing or blockHash null"),this.code=Vl}}class qh extends Y{constructor(e){super(`receipt: ${JSON.stringify(e.receipt)}`,"Receipt missing block number"),this.code=zl}}class _s extends j{constructor(e){super(`Invalid signature. "${e}"`),this.code=Yl}}class pa extends Y{constructor(){super("LocalWalletNotAvailableError","Attempted to index account in local wallet, but no wallet is available"),this.code=Jl}}class $h extends j{constructor(e,n){const r=[];e.forEach(i=>r.push(i.keyword)),super(`The following properties are invalid for the transaction type ${n}: ${r.join(", ")}`),this.code=sf}}class xn extends Y{constructor(e){super(e,"can not parse as byte data"),this.code=Hf}}class Gi extends Y{constructor(e){super(e,"can not parse as number data"),this.code=Uf}}class Pr extends Y{constructor(e){super(e,"invalid ethereum address"),this.code=qf}}class Qh extends Y{constructor(e){super(e,"not a valid string"),this.code=jf}}class hc extends Y{constructor(e){super(e,"invalid unit"),this.code=Gf}}class mc extends Y{constructor(e){super(e,"not a valid unit. Must be a positive integer"),this.code=Xf}}class Vh extends Y{constructor(e){super(e,"can not be converted to hex"),this.code=$f}}class pc extends Y{constructor(e){super(e,"value greater than the nibble width"),this.code=Yf}}class ov extends Y{constructor(e){super(e,"invalid type, type not supported"),this.code=Qf}}class co extends Y{constructor(e){super(e,"not a valid boolean."),this.code=Vf}}class zh extends Y{constructor(e){super(e,"not a valid unsigned integer."),this.code=zf}}class ga extends Y{constructor(e){super(e,"invalid size given."),this.code=Jf}}class ya extends Y{constructor(e){super(e,"value is larger than size."),this.code=Wf}}class Jh extends Y{constructor(e){super(e,"invalid string given"),this.code=Kf}}class av extends Y{constructor(e){super(e,"components found but type is not tuple"),this.code=Zf}}const cv=t=>!Array.isArray(t)&&t.jsonrpc==="2.0"&&!!t&&(t.result===void 0||t.result===null)&&"error"in t&&(typeof t.id=="number"||typeof t.id=="string"),nd=t=>cv(t)?t.error.message:"";class st extends j{constructor(e,n,r,i){var s;super(n??`Returned error: ${Array.isArray(e)?e.map(a=>nd(a)).join(","):nd(e)}`),this.code=Kd,n||(this.data=Array.isArray(e)?e.map(a=>{var d;return(d=a.error)===null||d===void 0?void 0:d.data}):(s=e?.error)===null||s===void 0?void 0:s.data),this.statusCode=i,this.request=r;let o;"error"in e?o=e.error:e instanceof Array&&(o=e.filter(a=>a.error).map(a=>a.error)),Array.isArray(o)&&o.length>0?this.cause=new cr(o):this.cause=o}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{data:this.data,request:this.request,statusCode:this.statusCode})}}class qi extends st{constructor(e,n){super(e,void 0,n),this.code=Zd;let r;"error"in e?r=e.error:e instanceof Array&&(r=e.map(i=>i.error)),Array.isArray(r)?this.cause=new cr(r):this.cause=r}}class va extends j{constructor(e,n){super(`Web3Config hardfork doesnt match in defaultHardfork ${e} and common.hardfork ${n}`),this.code=rc}}class ba extends j{constructor(e,n){super(`Web3Config chain doesnt match in defaultHardfork ${e} and common.hardfork ${n}`),this.code=rc}}const gc="An Rpc error has occured with a code of *code*",ke={[zr]:{message:"Parse error",description:"Invalid JSON"},[Jr]:{message:"Invalid request",description:"JSON is not a valid request object "},[Wr]:{message:"Method not found",description:"Method does not exist "},[Kr]:{message:"Invalid params",description:"Invalid method parameters"},[Zr]:{message:"Internal error",description:"Internal JSON-RPC error"},[Yr]:{message:"Invalid input",description:"Missing or invalid parameters"},[Xr]:{message:"Resource not found",description:"Requested resource not found"},[ei]:{message:"Resource unavailable",description:"Requested resource not available"},[ti]:{message:"Transaction rejected",description:"Transaction creation failed"},[ni]:{message:"Method not supported",description:"Method is not implemented"},[ri]:{message:"Limit exceeded",description:"Request exceeds defined limit"},[ii]:{message:"JSON-RPC version not supported",description:"Version of JSON-RPC protocol is not supported"},[Pf]:{name:"User Rejected Request",message:"The user rejected the request."},[Cf]:{name:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[Nf]:{name:"Unsupported Method",message:"The Provider does not support the requested method."},[Of]:{name:"Disconnected",message:"The Provider is disconnected from all chains."},[Mf]:{name:"Chain Disconnected",message:"The Provider is not connected to the requested chain."},"0-999":{name:"",message:"Not used."},1e3:{name:"Normal Closure",message:"The connection successfully completed the purpose for which it was created."},1001:{name:"Going Away",message:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{name:"Protocol error",message:"The endpoint is terminating the connection due to a protocol error."},1003:{name:"Unsupported Data",message:"The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)"},1004:{name:"Reserved",message:"Reserved. A meaning might be defined in the future."},1005:{name:"No Status Rcvd",message:"Reserved. Indicates that no status code was provided even though one was expected."},1006:{name:"Abnormal Closure",message:"Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{name:"Invalid frame payload data",message:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{name:"Policy Violation",message:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{name:"Message Too Big",message:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{name:"Mandatory Ext.",message:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{name:"Internal Error",message:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{name:"Service Restart",message:"The server is terminating the connection because it is restarting."},1013:{name:"Try Again Later",message:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{name:"Bad Gateway",message:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{name:"TLS handshake",message:"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},"1016-2999":{name:"",message:"For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications."},"3000-3999":{name:"",message:"For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol."},"4000-4999":{name:"",message:"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol."}};class Ve extends j{constructor(e,n){super(n??gc.replace("*code*",e.error.code.toString())),this.code=e.error.code,this.id=e.id,this.jsonrpc=e.jsonrpc,this.jsonRpcError=e.error}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{error:this.jsonRpcError,id:this.id,jsonRpc:this.jsonrpc})}}class Wh extends j{constructor(e,n){var r,i,s,o;if(!e)super();else if(!((r=ke[e])===null||r===void 0)&&r.message)super(ke[e].message);else{const a=Object.keys(ke).find(d=>typeof d=="string"&&e>=parseInt(d.split("-")[0],10)&&e<=parseInt(d.split("-")[1],10));super((s=(i=ke[a??""])===null||i===void 0?void 0:i.message)!==null&&s!==void 0?s:gc.replace("*code*",(o=e?.toString())!==null&&o!==void 0?o:'""'))}this.code=e,this.data=n}}class Kh extends Ve{constructor(e){super(e,ke[zr].message),this.code=zr}}class Zh extends Ve{constructor(e){super(e,ke[Jr].message),this.code=Jr}}class Yh extends Ve{constructor(e){super(e,ke[Wr].message),this.code=Wr}}class Xh extends Ve{constructor(e){super(e,ke[Kr].message),this.code=Kr}}class em extends Ve{constructor(e){super(e,ke[Zr].message),this.code=Zr}}class tm extends Ve{constructor(e){super(e,ke[Yr].message),this.code=Yr}}class nm extends Ve{constructor(e){super(e,ke[ni].message),this.code=ni}}class rm extends Ve{constructor(e){super(e,ke[ei].message),this.code=ei}}class im extends Ve{constructor(e){super(e,ke[Xr].message),this.code=Xr}}class sm extends Ve{constructor(e){super(e,ke[ii].message),this.code=ii}}class om extends Ve{constructor(e){super(e,ke[ti].message),this.code=ti}}class am extends Ve{constructor(e){super(e,ke[ri].message),this.code=ri}}const Me=new Map;Me.set(zr,{error:Kh});Me.set(Jr,{error:Zh});Me.set(Wr,{error:Yh});Me.set(Kr,{error:Xh});Me.set(Zr,{error:em});Me.set(Yr,{error:tm});Me.set(ni,{error:nm});Me.set(ei,{error:rm});Me.set(ti,{error:om});Me.set(Xr,{error:im});Me.set(ii,{error:sm});Me.set(ri,{error:am});class cm extends j{constructor(e){super(`Format for the type ${e} is unsupported`),this.type=e,this.code=th}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}}const SI=Object.freeze(Object.defineProperty({__proto__:null,AbiError:ee,BaseWeb3Error:j,ChainIdMismatchError:xh,ChainMismatchError:Ih,CommonOrChainAndHardforkError:Sh,ConfigChainMismatchError:ba,ConfigHardforkMismatchError:va,ConnectionCloseError:$y,ConnectionError:Ht,ConnectionNotOpenError:As,ConnectionTimeoutError:qy,ContractCodeNotStoredError:iv,ContractEventDoesNotExistError:zy,ContractExecutionError:en,ContractInstantiationError:Yy,ContractMissingABIError:Qy,ContractMissingDeployDataError:Wy,ContractNoAddressDefinedError:Ky,ContractNoFromAddressDefinedError:Zy,ContractOnceRequiresCallbackError:Vy,ContractReservedEventError:Jy,ContractTransactionDataAndInputError:fh,EIP1193ProviderRpcError:Wh,ENSCheckInterfaceSupportError:Xy,ENSNetworkNotSyncedError:mh,ENSUnsupportedNetworkError:hh,ERR_ABI_ENCODING:rl,ERR_CONN:cf,ERR_CONN_CLOSE:ff,ERR_CONN_INVALID:uf,ERR_CONN_MAX_ATTEMPTS:hf,ERR_CONN_NOT_OPEN:lf,ERR_CONN_PENDING_REQUESTS:mf,ERR_CONN_TIMEOUT:df,ERR_CONTRACT:al,ERR_CONTRACT_ABI_MISSING:ul,ERR_CONTRACT_EVENT_NOT_EXISTS:ll,ERR_CONTRACT_EXECUTION_REVERTED:yl,ERR_CONTRACT_INSTANTIATION:gl,ERR_CONTRACT_MISSING_ADDRESS:ml,ERR_CONTRACT_MISSING_DEPLOY_DATA:hl,ERR_CONTRACT_MISSING_FROM_ADDRESS:pl,ERR_CONTRACT_REQUIRED_CALLBACK:dl,ERR_CONTRACT_RESERVED_EVENT:fl,ERR_CONTRACT_RESOLVER_MISSING:cl,ERR_CONTRACT_TX_DATA_AND_INPUT:vl,ERR_CORE_CHAIN_MISMATCH:Uy,ERR_CORE_HARDFORK_MISMATCH:rc,ERR_ENS_CHECK_INTERFACE_SUPPORT:Lf,ERR_ENS_NETWORK_NOT_SYNCED:Df,ERR_ENS_UNSUPPORTED_NETWORK:Ff,ERR_EXISTING_PLUGIN_NAMESPACE:il,ERR_FORMATTERS:Xd,ERR_INVALID_ADDRESS:qf,ERR_INVALID_BLOCK:Kf,ERR_INVALID_BOOLEAN:Vf,ERR_INVALID_BYTES:Hf,ERR_INVALID_CLIENT:vf,ERR_INVALID_HEX:$f,ERR_INVALID_INTEGER:Xf,ERR_INVALID_KEYSTORE:jy,ERR_INVALID_LARGE_VALUE:Wf,ERR_INVALID_METHOD_PARAMS:sl,ERR_INVALID_NIBBLE_WIDTH:Yf,ERR_INVALID_NUMBER:Uf,ERR_INVALID_PASSWORD:Tf,ERR_INVALID_PRIVATE_KEY:_f,ERR_INVALID_PROVIDER:yf,ERR_INVALID_RESPONSE:Zd,ERR_INVALID_SIGNATURE:Bf,ERR_INVALID_SIZE:Jf,ERR_INVALID_STRING:jf,ERR_INVALID_TYPE:Qf,ERR_INVALID_TYPE_ABI:Zf,ERR_INVALID_UNIT:Gf,ERR_INVALID_UNSIGNED_INTEGER:zf,ERR_IV_LENGTH:Sf,ERR_KEY_DERIVATION_FAIL:xf,ERR_KEY_VERSION_UNSUPPORTED:If,ERR_METHOD_NOT_IMPLEMENTED:el,ERR_MULTIPLE_ERRORS:ol,ERR_OPERATION_ABORT:nl,ERR_OPERATION_TIMEOUT:tl,ERR_PARAM:Yd,ERR_PBKDF2_ITERATIONS:Rf,ERR_PRIVATE_KEY_LENGTH:wf,ERR_PROVIDER:gf,ERR_RAW_TX_UNDEFINED:Tl,ERR_REQ_ALREADY_SENT:pf,ERR_RESPONSE:Kd,ERR_RPC_INTERNAL_ERROR:Zr,ERR_RPC_INVALID_INPUT:Yr,ERR_RPC_INVALID_JSON:zr,ERR_RPC_INVALID_METHOD:Wr,ERR_RPC_INVALID_PARAMS:Kr,ERR_RPC_INVALID_REQUEST:Jr,ERR_RPC_LIMIT_EXCEEDED:ri,ERR_RPC_MISSING_RESOURCE:Xr,ERR_RPC_NOT_SUPPORTED:ii,ERR_RPC_TRANSACTION_REJECTED:ti,ERR_RPC_UNAVAILABLE_RESOURCE:ei,ERR_RPC_UNSUPPORTED_METHOD:ni,ERR_SCHEMA_FORMAT:th,ERR_SIGNATURE_FAILED:kf,ERR_SUBSCRIPTION:bf,ERR_TX:bl,ERR_TX_BLOCK_TIMEOUT:Zl,ERR_TX_CHAIN_ID_MISMATCH:Pl,ERR_TX_CHAIN_MISMATCH:ef,ERR_TX_CONTRACT_NOT_STORED:El,ERR_TX_DATA_AND_INPUT:$l,ERR_TX_GAS_MISMATCH:Xl,ERR_TX_GAS_MISMATCH_INNER_ERROR:af,ERR_TX_HARDFORK_MISMATCH:tf,ERR_TX_INVALID_CALL:Rl,ERR_TX_INVALID_CHAIN_INFO:Cl,ERR_TX_INVALID_FEE_MARKET_GAS:Ll,ERR_TX_INVALID_FEE_MARKET_GAS_PRICE:Fl,ERR_TX_INVALID_LEGACY_FEE_MARKET:Dl,ERR_TX_INVALID_LEGACY_GAS:Ml,ERR_TX_INVALID_NONCE_OR_CHAIN_ID:Hl,ERR_TX_INVALID_OBJECT:jl,ERR_TX_INVALID_PROPERTIES_FOR_TYPE:sf,ERR_TX_INVALID_RECEIVER:nf,ERR_TX_INVALID_SENDER:Sl,ERR_TX_LOCAL_WALLET_NOT_AVAILABLE:Jl,ERR_TX_MISSING_CHAIN_INFO:Nl,ERR_TX_MISSING_CUSTOM_CHAIN:kl,ERR_TX_MISSING_CUSTOM_CHAIN_ID:Bl,ERR_TX_MISSING_GAS:Ol,ERR_TX_MISSING_GAS_INNER_ERROR:of,ERR_TX_NOT_FOUND:Wl,ERR_TX_NO_CONTRACT_ADDRESS:_l,ERR_TX_OUT_OF_GAS:Il,ERR_TX_POLLING_TIMEOUT:Ql,ERR_TX_RECEIPT_MISSING_BLOCK_NUMBER:zl,ERR_TX_RECEIPT_MISSING_OR_BLOCKHASH_NULL:Vl,ERR_TX_REVERT_INSTRUCTION:Al,ERR_TX_REVERT_TRANSACTION:wl,ERR_TX_REVERT_TRANSACTION_CUSTOM_ERROR:rf,ERR_TX_REVERT_WITHOUT_REASON:xl,ERR_TX_SEND_TIMEOUT:Kl,ERR_TX_SIGNING:Yl,ERR_TX_UNABLE_TO_POPULATE_NONCE:Ul,ERR_TX_UNSUPPORTED_EIP_1559:Gl,ERR_TX_UNSUPPORTED_TYPE:ql,ERR_UNSUPPORTED_KDF:Ef,ERR_VALIDATION:eh,ERR_WS_PROVIDER:Af,Eip1559GasPriceError:Mh,Eip1559NotSupportedError:jh,Eip838ExecutionError:Ui,ExistingPluginNamespaceError:gh,FormatterError:Ft,GENESIS_BLOCK_NUMBER:Hy,HardforkMismatchError:Th,HexProcessingError:Vh,IVLengthError:ah,InternalError:em,InvalidAddressError:Pr,InvalidBlockError:Jh,InvalidBooleanError:co,InvalidBytesError:xn,InvalidClientError:ws,InvalidConnectionError:Gy,InvalidGasOrGasPrice:Nh,InvalidInputError:tm,InvalidIntegerError:mc,InvalidKdfError:ic,InvalidLargeValueError:ya,InvalidMaxPriorityFeePerGasOrMaxFeePerGas:Oh,InvalidMethodParamsError:si,InvalidNonceOrChainIdError:Fh,InvalidNumberError:Gi,InvalidNumberOfParamsError:ev,InvalidParamsError:Xh,InvalidPasswordError:oh,InvalidPrivateKeyError:nh,InvalidPropertiesForTransactionTypeError:$h,InvalidProviderError:tv,InvalidRequestError:Zh,InvalidResponseError:qi,InvalidSignatureError:rh,InvalidSizeError:ga,InvalidStringError:Qh,InvalidTransactionCall:wh,InvalidTransactionObjectError:Lh,InvalidTransactionWithReceiver:Ah,InvalidTransactionWithSender:cc,InvalidTypeAbiInputError:av,InvalidTypeError:ov,InvalidUnitError:hc,InvalidUnsignedIntegerError:zh,InvalidValueError:Y,JSONRPC_ERR_CHAIN_DISCONNECTED:Mf,JSONRPC_ERR_DISCONNECTED:Of,JSONRPC_ERR_REJECTED_REQUEST:Pf,JSONRPC_ERR_UNAUTHORIZED:Cf,JSONRPC_ERR_UNSUPPORTED_METHOD:Nf,KeyDerivationError:ih,KeyStoreVersionError:sh,LimitExceededError:am,LocalWalletNotAvailableError:pa,MaxAttemptsReachedOnReconnectingError:uh,MethodNotFoundError:Yh,MethodNotImplementedError:ft,MethodNotSupported:nm,MissingChainOrHardforkError:Rh,MissingCustomChainError:_h,MissingCustomChainIdError:Eh,MissingGasError:Bh,MissingGasInnerError:kh,MultipleErrors:cr,NibbleWidthError:pc,NoContractAddressFoundError:rv,OperationAbortError:ph,OperationTimeoutError:sc,PBKDF2IterationsError:ch,ParseError:Kh,PendingRequestsOnReconnectingError:dh,PrivateKeyLengthError:la,ProviderError:qr,RequestAlreadySentError:lh,ResolverMethodMissingError:fa,ResourceUnavailableError:rm,ResourcesNotFoundError:im,ResponseError:st,RevertInstructionError:nv,RpcError:Ve,RpcErrorMessages:ke,SchemaFormatError:cm,SignatureError:vh,SubscriptionError:ht,TransactionBlockTimeoutError:fc,TransactionDataAndInputError:dc,TransactionError:Gn,TransactionGasMismatchError:Ch,TransactionGasMismatchInnerError:Ph,TransactionMissingReceiptOrBlockHashError:Gh,TransactionNotFound:ha,TransactionOutOfGasError:sv,TransactionPollingTimeoutError:lc,TransactionReceiptMissingBlockNumberError:qh,TransactionRejectedError:om,TransactionRevertInstructionError:oi,TransactionRevertWithCustomError:oc,TransactionRevertedWithoutReasonError:ac,TransactionSendTimeoutError:Hh,TransactionSigningError:_s,UnableToPopulateNonceError:Dh,UndefinedRawTransactionError:bh,UnsupportedFeeMarketError:uc,UnsupportedTransactionTypeError:ma,VersionNotSupportedError:sm,Web3ContractError:Oe,Web3WSProviderError:yh,genericRpcErrorMessageTemplate:gc,rpcErrorsMap:Me},Symbol.toStringTag,{value:"Module"}));function qe(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function uv(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function dv(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function Cr(t,...e){if(!dv(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function yc(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");qe(t.outputLen),qe(t.blockLen)}function Rn(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function vc(t,e){Cr(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const um={number:qe,bool:uv,bytes:Cr,hash:yc,exists:Rn,output:vc},as=BigInt(2**32-1),rd=BigInt(32);function lv(t,e=!1){return e?{h:Number(t&as),l:Number(t>>rd&as)}:{h:Number(t>>rd&as)|0,l:Number(t&as)|0}}function fv(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=lv(t[i],e);[n[i],r[i]]=[s,o]}return[n,r]}const hv=(t,e,n)=>t<<n|e>>>32-n,mv=(t,e,n)=>e<<n|t>>>32-n,pv=(t,e,n)=>e<<n-32|t>>>64-n,gv=(t,e,n)=>t<<n-32|e>>>64-n,fs=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;const hs=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),ms=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),lt=(t,e)=>t<<32-e|t>>>e,ae=(t,e)=>t<<e|t>>>32-e>>>0,Es=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,yv=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function xs(t){for(let e=0;e<t.length;e++)t[e]=yv(t[e])}function hr(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function mr(t){return typeof t=="string"&&(t=hr(t)),Cr(t),t}function Is(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];Cr(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}class bc{clone(){return this._cloneInto()}}const vv={}.toString;function dm(t,e){if(e!==void 0&&vv.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function lm(t){const e=r=>t().update(mr(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function fm(t=32){if(fs&&typeof fs.getRandomValues=="function")return fs.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}const hm=[],mm=[],pm=[],bv=BigInt(0),Lr=BigInt(1),Av=BigInt(2),wv=BigInt(7),_v=BigInt(256),Ev=BigInt(113);for(let t=0,e=Lr,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],hm.push(2*(5*r+n)),mm.push((t+1)*(t+2)/2%64);let i=bv;for(let s=0;s<7;s++)e=(e<<Lr^(e>>wv)*Ev)%_v,e&Av&&(i^=Lr<<(Lr<<BigInt(s))-Lr);pm.push(i)}const[xv,Iv]=fv(pm,!0),id=(t,e,n)=>n>32?pv(t,e,n):hv(t,e,n),sd=(t,e,n)=>n>32?gv(t,e,n):mv(t,e,n);function Tv(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,d=(o+2)%10,u=n[d],c=n[d+1],l=id(u,c,1)^n[a],h=sd(u,c,1)^n[a+1];for(let p=0;p<50;p+=10)t[o+p]^=l,t[o+p+1]^=h}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=mm[o],d=id(i,s,a),u=sd(i,s,a),c=hm[o];i=t[c],s=t[c+1],t[c]=d,t[c+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=xv[r],t[1]^=Iv[r]}n.fill(0)}class Ac extends bc{constructor(e,n,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,qe(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=hs(this.state)}keccak(){Es||xs(this.state32),Tv(this.state32,this.rounds),Es||xs(this.state32),this.posOut=0,this.pos=0}update(e){Rn(this);const{blockLen:n,state:r}=this;e=mr(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=e[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,(n&128)!==0&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Rn(this,!1),Cr(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return qe(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(vc(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new Ac(n,r,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Sv=(t,e,n)=>lm(()=>new Ac(e,t,n)),od=Sv(1,136,256/8),Ts=um.bytes;function gm(t){if(!(t instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof t}`);return new TextDecoder().decode(t)}function Rv(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function kv(t){return e=>(um.bytes(e),t(e))}(()=>{const t=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,e=typeof module<"u"&&typeof Xu=="function"&&Xu.bind(module);return{node:e&&!t?e("crypto"):void 0,web:t}})();const Fe=(()=>{const t=kv(od);return t.create=od.create,t})();var ie;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(ie||(ie={}));var Aa;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Aa||(Aa={}));const M=ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pt=t=>{switch(typeof t){case"undefined":return M.undefined;case"string":return M.string;case"number":return Number.isNaN(t)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":return Array.isArray(t)?M.array:t===null?M.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?M.promise:typeof Map<"u"&&t instanceof Map?M.map:typeof Set<"u"&&t instanceof Set?M.set:typeof Date<"u"&&t instanceof Date?M.date:M.object;default:return M.unknown}},S=ie.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Bv=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class We extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,d=0;for(;d<o.path.length;){const u=o.path[d];d===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(o))):a[u]=a[u]||{_errors:[]},a=a[u],d++}}};return i(this),r}static assert(e){if(!(e instanceof We))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];n[s]=n[s]||[],n[s].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}We.create=t=>new We(t);const pr=(t,e)=>{let n;switch(t.code){case S.invalid_type:t.received===M.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case S.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ie.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:n=`Unrecognized key(s) in object: ${ie.joinValues(t.keys,", ")}`;break;case S.invalid_union:n="Invalid input";break;case S.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ie.joinValues(t.options)}`;break;case S.invalid_enum_value:n=`Invalid enum value. Expected ${ie.joinValues(t.options)}, received '${t.received}'`;break;case S.invalid_arguments:n="Invalid function arguments";break;case S.invalid_return_type:n="Invalid function return type";break;case S.invalid_date:n="Invalid date";break;case S.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ie.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case S.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case S.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case S.custom:n="Invalid input";break;case S.invalid_intersection_types:n="Intersection results could not be merged";break;case S.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case S.not_finite:n="Number must be finite";break;default:n=e.defaultError,ie.assertNever(t)}return{message:n}};let ym=pr;function Pv(t){ym=t}function Ss(){return ym}const Rs=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const d=r.filter(u=>!!u).slice().reverse();for(const u of d)a=u(o,{data:e,defaultError:a}).message;return{...i,path:s,message:a}},Cv=[];function C(t,e){const n=Ss(),r=Rs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===pr?void 0:pr].filter(i=>!!i)});t.common.issues.push(r)}class Le{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return V;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return Le.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return V;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const V=Object.freeze({status:"aborted"}),sr=t=>({status:"dirty",value:t}),je=t=>({status:"valid",value:t}),wa=t=>t.status==="aborted",_a=t=>t.status==="dirty",kn=t=>t.status==="valid",ai=t=>typeof Promise<"u"&&t instanceof Promise;var H;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(H||(H={}));class wt{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ad=(t,e)=>{if(kn(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new We(t.common.issues);return this._error=n,this._error}}};function X(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>{const{message:d}=t;return o.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:d??r??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:d??n??a.defaultError}},description:i}}class te{get description(){return this._def.description}_getType(e){return Pt(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Pt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Le,ctx:{common:e.parent.common,data:e.data,parsedType:Pt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(ai(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pt(e)},i=this._parseSync({data:e,path:r.path,parent:r});return ad(r,i)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pt(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return kn(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>kn(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pt(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(ai(i)?i:Promise.resolve(i));return ad(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:S.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new ut({schema:this,typeName:J.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return vt.create(this,this._def)}nullable(){return un.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ct.create(this)}promise(){return yr.create(this,this._def)}or(e){return li.create([this,e],this._def)}and(e){return fi.create(this,e,this._def)}transform(e){return new ut({...X(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new yi({...X(this._def),innerType:this,defaultValue:n,typeName:J.ZodDefault})}brand(){return new wc({typeName:J.ZodBranded,type:this,...X(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new vi({...X(this._def),innerType:this,catchValue:n,typeName:J.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return $i.create(this,e)}readonly(){return bi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Nv=/^c[^\s-]{8,}$/i,Ov=/^[0-9a-z]+$/,Mv=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Lv=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Fv=/^[a-z0-9_-]{21}$/i,Dv=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,jv=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Hv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Uv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Qo;const Gv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,$v=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Qv=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vv=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,zv=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vm="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Jv=new RegExp(`^${vm}$`);function bm(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Wv(t){return new RegExp(`^${bm(t)}$`)}function Am(t){let e=`${vm}T${bm(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Kv(t,e){return!!((e==="v4"||!e)&&Gv.test(t)||(e==="v6"||!e)&&$v.test(t))}function Zv(t,e){if(!Dv.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Yv(t,e){return!!((e==="v4"||!e)&&qv.test(t)||(e==="v6"||!e)&&Qv.test(t))}class at extends te{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==M.string){const s=this._getOrReturnCtx(e);return C(s,{code:S.invalid_type,expected:M.string,received:s.parsedType}),V}const r=new Le;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),C(i,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),C(i,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?C(i,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&C(i,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Hv.test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"email",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Qo||(Qo=new RegExp(Uv,"u")),Qo.test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"emoji",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")Lv.test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"uuid",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")Fv.test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"nanoid",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")Nv.test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"cuid",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Ov.test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"cuid2",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")Mv.test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"ulid",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),C(i,{validation:"url",code:S.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"regex",code:S.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),C(i,{code:S.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),C(i,{code:S.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),C(i,{code:S.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Am(s).test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{code:S.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?Jv.test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{code:S.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?Wv(s).test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{code:S.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?jv.test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"duration",code:S.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Kv(e.data,s.version)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"ip",code:S.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?Zv(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"jwt",code:S.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?Yv(e.data,s.version)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"cidr",code:S.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?Vv.test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"base64",code:S.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?zv.test(e.data)||(i=this._getOrReturnCtx(e,i),C(i,{validation:"base64url",code:S.invalid_string,message:s.message}),r.dirty()):ie.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:S.invalid_string,...H.errToObj(r)})}_addCheck(e){return new at({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...H.errToObj(e)})}url(e){return this._addCheck({kind:"url",...H.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...H.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...H.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...H.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...H.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...H.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...H.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...H.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...H.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...H.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...H.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...H.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...H.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...H.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...H.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...H.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...H.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...H.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...H.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...H.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...H.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...H.errToObj(n)})}nonempty(e){return this.min(1,H.errToObj(e))}trim(){return new at({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new at({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new at({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}at.create=t=>new at({checks:[],typeName:J.ZodString,coerce:t?.coerce??!1,...X(t)});function Xv(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return s%o/10**i}class on extends te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==M.number){const s=this._getOrReturnCtx(e);return C(s,{code:S.invalid_type,expected:M.number,received:s.parsedType}),V}let r;const i=new Le;for(const s of this._def.checks)s.kind==="int"?ie.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{code:S.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),C(r,{code:S.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),C(r,{code:S.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Xv(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),C(r,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),C(r,{code:S.not_finite,message:s.message}),i.dirty()):ie.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,H.toString(n))}gt(e,n){return this.setLimit("min",e,!1,H.toString(n))}lte(e,n){return this.setLimit("max",e,!0,H.toString(n))}lt(e,n){return this.setLimit("max",e,!1,H.toString(n))}setLimit(e,n,r,i){return new on({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:H.toString(i)}]})}_addCheck(e){return new on({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:H.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:H.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:H.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:H.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:H.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ie.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}on.create=t=>new on({checks:[],typeName:J.ZodNumber,coerce:t?.coerce||!1,...X(t)});class an extends te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==M.bigint)return this._getInvalidInput(e);let r;const i=new Le;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),C(r,{code:S.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),C(r,{code:S.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),C(r,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):ie.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return C(n,{code:S.invalid_type,expected:M.bigint,received:n.parsedType}),V}gte(e,n){return this.setLimit("min",e,!0,H.toString(n))}gt(e,n){return this.setLimit("min",e,!1,H.toString(n))}lte(e,n){return this.setLimit("max",e,!0,H.toString(n))}lt(e,n){return this.setLimit("max",e,!1,H.toString(n))}setLimit(e,n,r,i){return new an({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:H.toString(i)}]})}_addCheck(e){return new an({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:H.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}an.create=t=>new an({checks:[],typeName:J.ZodBigInt,coerce:t?.coerce??!1,...X(t)});class ci extends te{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==M.boolean){const r=this._getOrReturnCtx(e);return C(r,{code:S.invalid_type,expected:M.boolean,received:r.parsedType}),V}return je(e.data)}}ci.create=t=>new ci({typeName:J.ZodBoolean,coerce:t?.coerce||!1,...X(t)});class Bn extends te{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==M.date){const s=this._getOrReturnCtx(e);return C(s,{code:S.invalid_type,expected:M.date,received:s.parsedType}),V}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return C(s,{code:S.invalid_date}),V}const r=new Le;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),C(i,{code:S.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),C(i,{code:S.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ie.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Bn({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:H.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:H.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Bn.create=t=>new Bn({checks:[],coerce:t?.coerce||!1,typeName:J.ZodDate,...X(t)});class ks extends te{_parse(e){if(this._getType(e)!==M.symbol){const r=this._getOrReturnCtx(e);return C(r,{code:S.invalid_type,expected:M.symbol,received:r.parsedType}),V}return je(e.data)}}ks.create=t=>new ks({typeName:J.ZodSymbol,...X(t)});class ui extends te{_parse(e){if(this._getType(e)!==M.undefined){const r=this._getOrReturnCtx(e);return C(r,{code:S.invalid_type,expected:M.undefined,received:r.parsedType}),V}return je(e.data)}}ui.create=t=>new ui({typeName:J.ZodUndefined,...X(t)});class di extends te{_parse(e){if(this._getType(e)!==M.null){const r=this._getOrReturnCtx(e);return C(r,{code:S.invalid_type,expected:M.null,received:r.parsedType}),V}return je(e.data)}}di.create=t=>new di({typeName:J.ZodNull,...X(t)});class gr extends te{constructor(){super(...arguments),this._any=!0}_parse(e){return je(e.data)}}gr.create=t=>new gr({typeName:J.ZodAny,...X(t)});class In extends te{constructor(){super(...arguments),this._unknown=!0}_parse(e){return je(e.data)}}In.create=t=>new In({typeName:J.ZodUnknown,...X(t)});class Dt extends te{_parse(e){const n=this._getOrReturnCtx(e);return C(n,{code:S.invalid_type,expected:M.never,received:n.parsedType}),V}}Dt.create=t=>new Dt({typeName:J.ZodNever,...X(t)});class Bs extends te{_parse(e){if(this._getType(e)!==M.undefined){const r=this._getOrReturnCtx(e);return C(r,{code:S.invalid_type,expected:M.void,received:r.parsedType}),V}return je(e.data)}}Bs.create=t=>new Bs({typeName:J.ZodVoid,...X(t)});class ct extends te{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==M.array)return C(n,{code:S.invalid_type,expected:M.array,received:n.parsedType}),V;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(C(n,{code:o?S.too_big:S.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(C(n,{code:S.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(C(n,{code:S.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new wt(n,o,n.path,a)))).then(o=>Le.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new wt(n,o,n.path,a)));return Le.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new ct({...this._def,minLength:{value:e,message:H.toString(n)}})}max(e,n){return new ct({...this._def,maxLength:{value:e,message:H.toString(n)}})}length(e,n){return new ct({...this._def,exactLength:{value:e,message:H.toString(n)}})}nonempty(e){return this.min(1,e)}}ct.create=(t,e)=>new ct({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...X(e)});function tr(t){if(t instanceof ve){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=vt.create(tr(r))}return new ve({...t._def,shape:()=>e})}else return t instanceof ct?new ct({...t._def,type:tr(t.element)}):t instanceof vt?vt.create(tr(t.unwrap())):t instanceof un?un.create(tr(t.unwrap())):t instanceof _t?_t.create(t.items.map(e=>tr(e))):t}class ve extends te{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=ie.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==M.object){const u=this._getOrReturnCtx(e);return C(u,{code:S.invalid_type,expected:M.object,received:u.parsedType}),V}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Dt&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||a.push(u);const d=[];for(const u of o){const c=s[u],l=i.data[u];d.push({key:{status:"valid",value:u},value:c._parse(new wt(i,l,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Dt){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)d.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")a.length>0&&(C(i,{code:S.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const l=i.data[c];d.push({key:{status:"valid",value:c},value:u._parse(new wt(i,l,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of d){const l=await c.key,h=await c.value;u.push({key:l,value:h,alwaysSet:c.alwaysSet})}return u}).then(u=>Le.mergeObjectSync(r,u)):Le.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(e){return H.errToObj,new ve({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:H.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new ve({...this._def,unknownKeys:"strip"})}passthrough(){return new ve({...this._def,unknownKeys:"passthrough"})}extend(e){return new ve({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ve({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:J.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ve({...this._def,catchall:e})}pick(e){const n={};for(const r of ie.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new ve({...this._def,shape:()=>n})}omit(e){const n={};for(const r of ie.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new ve({...this._def,shape:()=>n})}deepPartial(){return tr(this)}partial(e){const n={};for(const r of ie.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new ve({...this._def,shape:()=>n})}required(e){const n={};for(const r of ie.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof vt;)s=s._def.innerType;n[r]=s}return new ve({...this._def,shape:()=>n})}keyof(){return wm(ie.objectKeys(this.shape))}}ve.create=(t,e)=>new ve({shape:()=>t,unknownKeys:"strip",catchall:Dt.create(),typeName:J.ZodObject,...X(e)});ve.strictCreate=(t,e)=>new ve({shape:()=>t,unknownKeys:"strict",catchall:Dt.create(),typeName:J.ZodObject,...X(e)});ve.lazycreate=(t,e)=>new ve({shape:t,unknownKeys:"strip",catchall:Dt.create(),typeName:J.ZodObject,...X(e)});class li extends te{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new We(a.ctx.common.issues));return C(n,{code:S.invalid_union,unionErrors:o}),V}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const d of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=d._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(d=>new We(d));return C(n,{code:S.invalid_union,unionErrors:a}),V}}get options(){return this._def.options}}li.create=(t,e)=>new li({options:t,typeName:J.ZodUnion,...X(e)});const Bt=t=>t instanceof mi?Bt(t.schema):t instanceof ut?Bt(t.innerType()):t instanceof pi?[t.value]:t instanceof cn?t.options:t instanceof gi?ie.objectValues(t.enum):t instanceof yi?Bt(t._def.innerType):t instanceof ui?[void 0]:t instanceof di?[null]:t instanceof vt?[void 0,...Bt(t.unwrap())]:t instanceof un?[null,...Bt(t.unwrap())]:t instanceof wc||t instanceof bi?Bt(t.unwrap()):t instanceof vi?Bt(t._def.innerType):[];class uo extends te{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.object)return C(n,{code:S.invalid_type,expected:M.object,received:n.parsedType}),V;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(C(n,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),V)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const o=Bt(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new uo({typeName:J.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...X(r)})}}function Ea(t,e){const n=Pt(t),r=Pt(e);if(t===e)return{valid:!0,data:t};if(n===M.object&&r===M.object){const i=ie.objectKeys(e),s=ie.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(const a of s){const d=Ea(t[a],e[a]);if(!d.valid)return{valid:!1};o[a]=d.data}return{valid:!0,data:o}}else if(n===M.array&&r===M.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const o=t[s],a=e[s],d=Ea(o,a);if(!d.valid)return{valid:!1};i.push(d.data)}return{valid:!0,data:i}}else return n===M.date&&r===M.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class fi extends te{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,o)=>{if(wa(s)||wa(o))return V;const a=Ea(s.value,o.value);return a.valid?((_a(s)||_a(o))&&n.dirty(),{status:n.value,value:a.data}):(C(r,{code:S.invalid_intersection_types}),V)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}fi.create=(t,e,n)=>new fi({left:t,right:e,typeName:J.ZodIntersection,...X(n)});class _t extends te{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.array)return C(r,{code:S.invalid_type,expected:M.array,received:r.parsedType}),V;if(r.data.length<this._def.items.length)return C(r,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;!this._def.rest&&r.data.length>this._def.items.length&&(C(r,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const d=this._def.items[a]||this._def.rest;return d?d._parse(new wt(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>Le.mergeArray(n,o)):Le.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new _t({...this._def,rest:e})}}_t.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _t({items:t,typeName:J.ZodTuple,rest:null,...X(e)})};class hi extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.object)return C(r,{code:S.invalid_type,expected:M.object,received:r.parsedType}),V;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new wt(r,a,r.path,a)),value:o._parse(new wt(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Le.mergeObjectAsync(n,i):Le.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof te?new hi({keyType:e,valueType:n,typeName:J.ZodRecord,...X(r)}):new hi({keyType:at.create(),valueType:e,typeName:J.ZodRecord,...X(n)})}}class Ps extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.map)return C(r,{code:S.invalid_type,expected:M.map,received:r.parsedType}),V;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,d],u)=>({key:i._parse(new wt(r,a,r.path,[u,"key"])),value:s._parse(new wt(r,d,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const d of o){const u=await d.key,c=await d.value;if(u.status==="aborted"||c.status==="aborted")return V;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const d of o){const u=d.key,c=d.value;if(u.status==="aborted"||c.status==="aborted")return V;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}}}}Ps.create=(t,e,n)=>new Ps({valueType:e,keyType:t,typeName:J.ZodMap,...X(n)});class Pn extends te{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.set)return C(r,{code:S.invalid_type,expected:M.set,received:r.parsedType}),V;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(C(r,{code:S.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(C(r,{code:S.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(d){const u=new Set;for(const c of d){if(c.status==="aborted")return V;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((d,u)=>s._parse(new wt(r,d,r.path,u)));return r.common.async?Promise.all(a).then(d=>o(d)):o(a)}min(e,n){return new Pn({...this._def,minSize:{value:e,message:H.toString(n)}})}max(e,n){return new Pn({...this._def,maxSize:{value:e,message:H.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Pn.create=(t,e)=>new Pn({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...X(e)});class ur extends te{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.function)return C(n,{code:S.invalid_type,expected:M.function,received:n.parsedType}),V;function r(a,d){return Rs({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ss(),pr].filter(u=>!!u),issueData:{code:S.invalid_arguments,argumentsError:d}})}function i(a,d){return Rs({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ss(),pr].filter(u=>!!u),issueData:{code:S.invalid_return_type,returnTypeError:d}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof yr){const a=this;return je(async function(...d){const u=new We([]),c=await a._def.args.parseAsync(d,s).catch(p=>{throw u.addIssue(r(d,p)),u}),l=await Reflect.apply(o,this,c);return await a._def.returns._def.type.parseAsync(l,s).catch(p=>{throw u.addIssue(i(l,p)),u})})}else{const a=this;return je(function(...d){const u=a._def.args.safeParse(d,s);if(!u.success)throw new We([r(d,u.error)]);const c=Reflect.apply(o,this,u.data),l=a._def.returns.safeParse(c,s);if(!l.success)throw new We([i(c,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ur({...this._def,args:_t.create(e).rest(In.create())})}returns(e){return new ur({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new ur({args:e||_t.create([]).rest(In.create()),returns:n||In.create(),typeName:J.ZodFunction,...X(r)})}}class mi extends te{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}mi.create=(t,e)=>new mi({getter:t,typeName:J.ZodLazy,...X(e)});class pi extends te{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return C(n,{received:n.data,code:S.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:e.data}}get value(){return this._def.value}}pi.create=(t,e)=>new pi({value:t,typeName:J.ZodLiteral,...X(e)});function wm(t,e){return new cn({values:t,typeName:J.ZodEnum,...X(e)})}class cn extends te{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return C(n,{expected:ie.joinValues(r),received:n.parsedType,code:S.invalid_type}),V}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return C(n,{received:n.data,code:S.invalid_enum_value,options:r}),V}return je(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return cn.create(e,{...this._def,...n})}exclude(e,n=this._def){return cn.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}cn.create=wm;class gi extends te{_parse(e){const n=ie.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==M.string&&r.parsedType!==M.number){const i=ie.objectValues(n);return C(r,{expected:ie.joinValues(i),received:r.parsedType,code:S.invalid_type}),V}if(this._cache||(this._cache=new Set(ie.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=ie.objectValues(n);return C(r,{received:r.data,code:S.invalid_enum_value,options:i}),V}return je(e.data)}get enum(){return this._def.values}}gi.create=(t,e)=>new gi({values:t,typeName:J.ZodNativeEnum,...X(e)});class yr extends te{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.promise&&n.common.async===!1)return C(n,{code:S.invalid_type,expected:M.promise,received:n.parsedType}),V;const r=n.parsedType===M.promise?n.data:Promise.resolve(n.data);return je(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}yr.create=(t,e)=>new yr({type:t,typeName:J.ZodPromise,...X(e)});class ut extends te{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{C(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return V;const d=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return d.status==="aborted"?V:d.status==="dirty"||n.value==="dirty"?sr(d.value):d});{if(n.value==="aborted")return V;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?V:a.status==="dirty"||n.value==="dirty"?sr(a.value):a}}if(i.type==="refinement"){const o=a=>{const d=i.refinement(a,s);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?V:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?V:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!kn(o))return V;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>kn(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):V);ie.assertNever(i)}}ut.create=(t,e,n)=>new ut({schema:t,typeName:J.ZodEffects,effect:e,...X(n)});ut.createWithPreprocess=(t,e,n)=>new ut({schema:e,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...X(n)});class vt extends te{_parse(e){return this._getType(e)===M.undefined?je(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}vt.create=(t,e)=>new vt({innerType:t,typeName:J.ZodOptional,...X(e)});class un extends te{_parse(e){return this._getType(e)===M.null?je(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}un.create=(t,e)=>new un({innerType:t,typeName:J.ZodNullable,...X(e)});class yi extends te{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===M.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}yi.create=(t,e)=>new yi({innerType:t,typeName:J.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...X(e)});class vi extends te{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ai(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new We(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new We(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}vi.create=(t,e)=>new vi({innerType:t,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...X(e)});class Cs extends te{_parse(e){if(this._getType(e)!==M.nan){const r=this._getOrReturnCtx(e);return C(r,{code:S.invalid_type,expected:M.nan,received:r.parsedType}),V}return{status:"valid",value:e.data}}}Cs.create=t=>new Cs({typeName:J.ZodNaN,...X(t)});const eb=Symbol("zod_brand");class wc extends te{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class $i extends te{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?V:s.status==="dirty"?(n.dirty(),sr(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?V:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new $i({in:e,out:n,typeName:J.ZodPipeline})}}class bi extends te{_parse(e){const n=this._def.innerType._parse(e),r=i=>(kn(i)&&(i.value=Object.freeze(i.value)),i);return ai(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}bi.create=(t,e)=>new bi({innerType:t,typeName:J.ZodReadonly,...X(e)});function cd(t,e){const n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function _m(t,e={},n){return t?gr.create().superRefine((r,i)=>{const s=t(r);if(s instanceof Promise)return s.then(o=>{if(!o){const a=cd(e,r),d=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:d})}});if(!s){const o=cd(e,r),a=o.fatal??n??!0;i.addIssue({code:"custom",...o,fatal:a})}}):gr.create()}const tb={object:ve.lazycreate};var J;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(J||(J={}));const nb=(t,e={message:`Input not instance of ${t.name}`})=>_m(n=>n instanceof t,e),Em=at.create,xm=on.create,rb=Cs.create,ib=an.create,Im=ci.create,sb=Bn.create,ob=ks.create,ab=ui.create,cb=di.create,xa=gr.create,ub=In.create,db=Dt.create,lb=Bs.create,Tm=ct.create,ps=ve.create,fb=ve.strictCreate,Sm=li.create,hb=uo.create,mb=fi.create,Rm=_t.create,pb=hi.create,gb=Ps.create,yb=Pn.create,vb=ur.create,bb=mi.create,Ab=pi.create,wb=cn.create,_b=gi.create,Eb=yr.create,ud=ut.create,xb=vt.create,Ib=un.create,Tb=ut.createWithPreprocess,Sb=$i.create,Rb=()=>Em().optional(),kb=()=>xm().optional(),Bb=()=>Im().optional(),Pb={string:(t=>at.create({...t,coerce:!0})),number:(t=>on.create({...t,coerce:!0})),boolean:(t=>ci.create({...t,coerce:!0})),bigint:(t=>an.create({...t,coerce:!0})),date:(t=>Bn.create({...t,coerce:!0}))},Cb=V,dd=Object.freeze(Object.defineProperty({__proto__:null,BRAND:eb,DIRTY:sr,EMPTY_PATH:Cv,INVALID:V,NEVER:Cb,OK:je,ParseStatus:Le,Schema:te,ZodAny:gr,ZodArray:ct,ZodBigInt:an,ZodBoolean:ci,ZodBranded:wc,ZodCatch:vi,ZodDate:Bn,ZodDefault:yi,ZodDiscriminatedUnion:uo,ZodEffects:ut,ZodEnum:cn,ZodError:We,get ZodFirstPartyTypeKind(){return J},ZodFunction:ur,ZodIntersection:fi,ZodIssueCode:S,ZodLazy:mi,ZodLiteral:pi,ZodMap:Ps,ZodNaN:Cs,ZodNativeEnum:gi,ZodNever:Dt,ZodNull:di,ZodNullable:un,ZodNumber:on,ZodObject:ve,ZodOptional:vt,ZodParsedType:M,ZodPipeline:$i,ZodPromise:yr,ZodReadonly:bi,ZodRecord:hi,ZodSchema:te,ZodSet:Pn,ZodString:at,ZodSymbol:ks,ZodTransformer:ut,ZodTuple:_t,ZodType:te,ZodUndefined:ui,ZodUnion:li,ZodUnknown:In,ZodVoid:Bs,addIssueToContext:C,any:xa,array:Tm,bigint:ib,boolean:Im,coerce:Pb,custom:_m,date:sb,datetimeRegex:Am,defaultErrorMap:pr,discriminatedUnion:hb,effect:ud,enum:wb,function:vb,getErrorMap:Ss,getParsedType:Pt,instanceof:nb,intersection:mb,isAborted:wa,isAsync:ai,isDirty:_a,isValid:kn,late:tb,lazy:bb,literal:Ab,makeIssue:Rs,map:gb,nan:rb,nativeEnum:_b,never:db,null:cb,nullable:Ib,number:xm,object:ps,get objectUtil(){return Aa},oboolean:Bb,onumber:kb,optional:xb,ostring:Rb,pipeline:Sb,preprocess:Tb,promise:Eb,quotelessJson:Bv,record:pb,set:yb,setErrorMap:Pv,strictObject:fb,string:Em,symbol:ob,transformer:ud,tuple:Rm,undefined:ab,union:Sm,unknown:ub,get util(){return ie},void:lb},Symbol.toStringTag,{value:"Module"})),Nb=t=>t.message?t.message:"unspecified error";class Cn extends j{constructor(e){super(),this.code=eh,this.errors=e,super.message=`Web3 validator found ${e.length} error[s]:
7
+ ${this._compileErrors().join(`
8
+ `)}`}_compileErrors(){return this.errors.map(Nb)}}const km=["bool","int","uint","bytes","string","address","tuple"],Bm=t=>typeof t=="object"&&"type"in t&&"name"in t,lo=t=>typeof t=="string",z=t=>typeof t=="string"&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(t);function Nn(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e<"u"&&e>0&&t.length!==2+2*e)}const dn=t=>typeof t=="number"||typeof t=="bigint"||typeof t=="string"&&/^((-0x|0x|-)?[0-9a-f]+|(0x))$/i.test(t),Ob=(t,e=!0)=>e?z(t)&&t.length===18:dn(t)&&t.length===16,Pm=(t,e=!0)=>e?z(t)&&t.length===66:dn(t)&&t.length===64;function fo(t){if(typeof t!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof t}`);return t.startsWith("0x")}const ho=function(t){for(const[e,n]of Object.entries(t))if(n!==void 0&&n.length>0&&n[0]===0)throw new Error(`${e} cannot have leading zeroes, received: ${n.toString()}`)},Mb=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],mn=t=>{let e=t.replace(/ /,""),n,r=!1,i=[];if(t.includes("[")&&(e=e.slice(0,e.indexOf("[")),i=[...t.matchAll(/(?:\[(\d*)\])/g)].map(s=>parseInt(s[1],10)).map(s=>Number.isNaN(s)?-1:s),r=i.length>0),km.includes(e))return{baseType:e,isArray:r,baseTypeSize:n,arraySizes:i};if(e.startsWith("int"))n=parseInt(e.substring(3),10),e="int";else if(e.startsWith("uint"))n=parseInt(t.substring(4),10),e="uint";else if(e.startsWith("bytes"))n=parseInt(e.substring(5),10),e="bytes";else return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:i};return{baseType:e,isArray:r,baseTypeSize:n,arraySizes:i}},Vo=(t,e={})=>{if(Object.keys(e).includes("type"))throw new Cn([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:t},instancePath:"",schemaPath:""}]);const{baseType:r,baseTypeSize:i}=mn(t);if(!r&&!Mb.includes(t))throw new Cn([{keyword:"eth",message:`Eth data type "${t}" is not valid`,params:{eth:t},instancePath:"",schemaPath:""}]);if(r){if(r==="tuple")throw new Error('"tuple" type is not implemented directly.');return{format:`${r}${i??""}`,required:!0}}return t?{format:t,required:!0}:{}},Ns=(t,e="/0")=>{const n={type:"array",items:[],maxItems:t.length,minItems:t.length};for(const[r,i]of t.entries()){let s,o,a=[];Bm(i)?(s=i.type,o=i.name||`${e}/${r}`,a=i.components):typeof i=="string"?(s=i,o=`${e}/${r}`):Array.isArray(i)&&(i[0]&&typeof i[0]=="string"&&i[0].startsWith("tuple")&&!Array.isArray(i[0])&&i[1]&&Array.isArray(i[1])?(s=i[0],o=`${e}/${r}`,a=i[1]):(s="tuple",o=`${e}/${r}`,a=i));const{baseType:d,isArray:u,arraySizes:c}=mn(s);let l,h=n;for(let p=c.length-1;p>0;p-=1)l={type:"array",$id:o,items:[],maxItems:c[p],minItems:c[p]},c[p]<0&&(delete l.maxItems,delete l.minItems),Array.isArray(h.items)?h.items.length===0?h.items=[l]:h.items.push(l):h.items=[h.items,l],h=l;if(d==="tuple"&&!u){const p=Ns(a,o);p.$id=o,h.items.push(p)}else if(d==="tuple"&&u){const p=c[0],v=Object.assign({type:"array",$id:o,items:Ns(a,o)},p>=0&&{minItems:p,maxItems:p});h.items.push(v)}else if(u){const p=c[0],v=Object.assign({type:"array",$id:o,items:Vo(s)},p>=0&&{minItems:p,maxItems:p});h.items.push(v)}else Array.isArray(h.items)?h.items.push(Object.assign({$id:o},Vo(s))):h.items.push(Object.assign({$id:o},Vo(s)));h=n}return n},_c=t=>Ns(t),Ec=(t,e)=>e===1?t:Ec(t[0],e-1),$r=(t,e,n)=>{const r=[];for(const[i,s]of t.entries()){let o,a,d=[];Bm(s)?(o=s.type,a=s.name,d=s.components):typeof s=="string"?o=s:Array.isArray(s)&&(s[1]&&Array.isArray(s[1])?(o=s[0],d=s[1]):(o="tuple",d=s));const{baseType:u,isArray:c,arraySizes:l}=mn(o),h=Array.isArray(e)?e[i]:e[a];if(u==="tuple"&&!c)r.push($r(d,h,n));else if(u==="tuple"&&c){const p=[];for(const v of h)if(l.length>1){const m=Ec(v,l.length-1),y=[];for(const f of m)y.push($r(d,f,n));p.push(y)}else p.push($r(d,v,n));r.push(p)}else r.push(h)}return n=n??[],n.push(...r),n},Cm=t=>{if(t>=48&&t<=57)return t-48;if(t>=65&&t<=70)return t-55;if(t>=97&&t<=102)return t-87;throw new Error(`Invalid code point: ${t}`)},mo=t=>{if(!z(t))throw new Error("Invalid hex string");const[e,n]=t.startsWith("-")?[!0,t.slice(1)]:[!1,t],r=BigInt(n);return r>Number.MAX_SAFE_INTEGER?e?-r:r:r<Number.MIN_SAFE_INTEGER?r:e?-1*Number(r):Number(r)},po=t=>{if((typeof t=="number"||typeof t=="bigint")&&t<0)return`-0x${t.toString(16).slice(1)}`;if((typeof t=="number"||typeof t=="bigint")&&t>=0)return`0x${t.toString(16)}`;if(typeof t=="string"&&z(t)){const[e,n]=t.startsWith("-")?[!0,t.slice(1)]:[!1,t],r=n.split(/^(-)?0(x|X)/).slice(-1)[0];return`${e?"-":""}0x${r.replace(/^0+/,"").toLowerCase()}`}if(typeof t=="string"&&!z(t))return po(BigInt(t));throw new Gi(t)},Os=(t,e,n="0")=>{if(typeof t=="string"&&!z(t))return t.padStart(e,n);const r=typeof t=="string"&&z(t)?t:po(t),[i,s]=r.startsWith("-")?["-0x",r.slice(3)]:["0x",r.slice(2)];return`${i}${s.padStart(e,n)}`};function Ut(t){let e="0x";for(const n of t){const r=n.toString(16);e+=r.length===1?`0${r}`:r}return e}const Tt={zero:48,nine:57,A:65,F:70,a:97,f:102};function ld(t){if(t>=Tt.zero&&t<=Tt.nine)return t-Tt.zero;if(t>=Tt.A&&t<=Tt.F)return t-(Tt.A-10);if(t>=Tt.a&&t<=Tt.f)return t-(Tt.a-10)}function qn(t){let e=0;if(t.startsWith("0")&&(t[1]==="x"||t[1]==="X")&&(e=2),t.length%2!==0)throw new xn(`hex string has odd length: ${t}`);const n=(t.length-e)/2,r=new Uint8Array(n);for(let i=0,s=e;i<n;i+=1){const o=ld(t.charCodeAt(s++)),a=ld(t.charCodeAt(s++));if(o===void 0||a===void 0)throw new xn(`Invalid byte sequence ("${t[s-2]}${t[s-1]}" in "${t}").`);r[i]=o*16+a}return r}function go(t){var e;return!(t instanceof Uint8Array)&&((e=t?.constructor)===null||e===void 0?void 0:e.name)==="Uint8Array"?Uint8Array.from(t):t}const xc=Object.freeze(Object.defineProperty({__proto__:null,abiSchemaToJsonSchema:Ns,codePointToInt:Cm,ensureIfUint8Array:go,ethAbiToJsonSchema:_c,fetchArrayElement:Ec,hexToNumber:mo,hexToUint8Array:qn,numberToHex:po,padLeft:Os,parseBaseType:mn,transformJsonDataToAbiFormat:$r,uint8ArrayToHexString:Ut},Symbol.toStringTag,{value:"Module"})),Ms=t=>{var e,n;return t instanceof Uint8Array||((e=t?.constructor)===null||e===void 0?void 0:e.name)==="Uint8Array"||((n=t?.constructor)===null||n===void 0?void 0:n.name)==="Buffer"},Gt=(t,e={abiType:"bytes"})=>{if(typeof t!="string"&&!Array.isArray(t)&&!Ms(t)||typeof t=="string"&&z(t)&&t.startsWith("-")||typeof t=="string"&&!z(t))return!1;let n;if(typeof t=="string"){if(t.length%2!==0)return!1;n=qn(t)}else if(Array.isArray(t)){if(t.some(r=>r<0||r>255||!Number.isInteger(r)))return!1;n=new Uint8Array(t)}else n=t;if(e?.abiType){const{baseTypeSize:r}=mn(e.abiType);return r?n.length===r:!0}return e?.size?n.length===e?.size:!0},Ic=t=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(t))return!1;const e=t.slice(2),n=hr(e.toLowerCase()),r=Ut(Fe(go(n))).slice(2);for(let i=0;i<40;i+=1)if(parseInt(r[i],16)>7&&e[i].toUpperCase()!==e[i]||parseInt(r[i],16)<=7&&e[i].toLowerCase()!==e[i])return!1;return!0},_e=(t,e=!0)=>{if(typeof t!="string"&&!Ms(t))return!1;let n;return Ms(t)?n=Ut(t):typeof t=="string"&&!z(t)?n=t.toLowerCase().startsWith("0x")?t:`0x${t}`:n=t,/^(0x)?[0-9a-f]{40}$/i.test(n)?/^(0x|0X)?[0-9a-f]{40}$/.test(n)||/^(0x|0X)?[0-9A-F]{40}$/.test(n)?!0:e?Ic(n):!0:!1},Lb=t=>typeof t=="bigint",ln=(t,e)=>{if(e===BigInt(0))return BigInt(1);let n=t;for(let r=1;r<e;r+=1)n*=t;return n},Et=(t,e={abiType:"uint"})=>{if(!["number","string","bigint"].includes(typeof t)||typeof t=="string"&&t.length===0)return!1;let n;if(e?.abiType){const{baseTypeSize:i}=mn(e.abiType);i&&(n=i)}else e.bitSize&&(n=e.bitSize);const r=ln(BigInt(2),BigInt(n??256))-BigInt(1);try{const i=typeof t=="string"&&z(t)?BigInt(mo(t)):BigInt(t);return i>=0&&i<=r}catch{return!1}},vr=(t,e={abiType:"int"})=>{if(!["number","string","bigint"].includes(typeof t)||typeof t=="number"&&t>Number.MAX_SAFE_INTEGER)return!1;let n;if(e?.abiType){const{baseTypeSize:s,baseType:o}=mn(e.abiType);if(o!=="int")return!1;s&&(n=s)}else e.bitSize&&(n=e.bitSize);const r=ln(BigInt(2),BigInt((n??256)-1)),i=BigInt(-1)*ln(BigInt(2),BigInt((n??256)-1));try{const s=typeof t=="string"&&z(t)?BigInt(mo(t)):BigInt(t);return s>=i&&s<=r}catch{return!1}},Tc=t=>!!(vr(t)||typeof t=="string"&&/[0-9.]/.test(t)&&t.indexOf(".")===t.lastIndexOf(".")||typeof t=="number"),Sc=t=>Et(t),xe=t=>Object.values(it).includes(t),Ls=t=>xe(t)||Sc(t),$n=t=>typeof t!="string"||!/^(0x)?[0-9a-f]{512}$/i.test(t)?!1:!!(/^(0x)?[0-9a-f]{512}$/.test(t)||/^(0x)?[0-9A-F]{512}$/.test(t)),Qi=(t,e)=>{if(typeof e=="string"&&!z(e)||!$n(t))return!1;const n=typeof e=="string"?qn(e):e,r=Ut(Fe(n)).slice(2);for(let i=0;i<12;i+=4){const s=(parseInt(r.slice(i,i+2),16)<<8)+parseInt(r.slice(i+2,i+4),16)&2047,o=Cm(t.charCodeAt(t.length-1-Math.floor(s/4))),a=1<<s%4;if((o&a)!==a)return!1}return!0},Nm=(t,e)=>{if(!$n(t)||!_e(e))return!1;const n=Os(e,64);return Qi(t,n)},Om=(t,e)=>!$n(t)||!_e(e)?!1:Qi(t,e),Mm=t=>["number","string","boolean"].includes(typeof t)?typeof t=="boolean"?!0:typeof t=="string"&&!z(t)?t==="1"||t==="0":typeof t=="string"&&z(t)?t==="0x1"||t==="0x0":t===1||t===0:!1,A=t=>t==null,On=t=>typeof t=="object"&&!A(t)&&!Array.isArray(t)&&!(t instanceof ao),Ai=t=>typeof t!="string"||!/^(0x)?[0-9a-f]{64}$/i.test(t)?!1:!!(/^(0x)?[0-9a-f]{64}$/.test(t)||/^(0x)?[0-9A-F]{64}$/.test(t)),Lm=(t,e)=>!$n(t)||!Ai(e)?!1:Qi(t,e),Fm=t=>{const e=["fromBlock","toBlock","address","topics","blockHash"];if(A(t)||typeof t!="object"||!Object.keys(t).every(n=>e.includes(n))||!A(t.fromBlock)&&!Ls(t.fromBlock)||!A(t.toBlock)&&!Ls(t.toBlock))return!1;if(!A(t.address)){if(Array.isArray(t.address)){if(!t.address.every(n=>_e(n)))return!1}else if(!_e(t.address))return!1}return!(!A(t.topics)&&!t.topics.every(n=>A(n)?!0:Array.isArray(n)?n.every(r=>Ai(r)):!!Ai(n)))},Mn={address:t=>_e(t),bloom:t=>$n(t),blockNumber:t=>Sc(t),blockTag:t=>xe(t),blockNumberOrTag:t=>Ls(t),bool:t=>Mm(t),bytes:t=>Gt(t),filter:t=>Fm(t),hex:t=>z(t),uint:t=>Et(t),int:t=>vr(t),number:t=>Tc(t),string:t=>lo(t)};for(let t=8;t<=256;t+=8)Mn[`int${t}`]=e=>vr(e,{bitSize:t}),Mn[`uint${t}`]=e=>Et(e,{bitSize:t});for(let t=1;t<=32;t+=1)Mn[`bytes${t}`]=e=>Gt(e,{size:t});Mn.bytes256=Mn.bytes;const Ur=t=>{if((!t?.type||t?.type==="object")&&t?.properties){const e={};for(const n of Object.keys(t.properties)){const r=Ur(t.properties[n]);r&&(e[n]=r)}return Array.isArray(t.required)?ps(e).partial().required(t.required.reduce((n,r)=>Object.assign(Object.assign({},n),{[r]:!0}),{})):ps(e).partial()}if(t?.type==="array"&&t?.items){if(Array.isArray(t.items)&&t.items.length>1&&t.maxItems!==void 0&&new Set(t.items.map(r=>r.$id)).size===t.items.length){const r=[];for(const i of t.items){const s=Ur(i);s&&r.push(s)}return Rm(r)}const e=Array.isArray(t.items)?t.items[0]:t.items;let n=Tm(Ur(e));return n=t.minItems!==void 0?n.min(t.minItems):n,n=t.maxItems!==void 0?n.max(t.maxItems):n,n}if(t.oneOf&&Array.isArray(t.oneOf))return Sm(t.oneOf.map(e=>Ur(e)));if(t?.format){if(!Mn[t.format])throw new cm(t.format);return xa().refine(Mn[t.format],e=>({params:{value:e,format:t.format}}))}return t?.type&&t?.type!=="object"&&typeof dd[String(t.type)]=="function"?dd[String(t.type)]():ps({data:xa()}).partial()};class or{static factory(){return or.validatorInstance||(or.validatorInstance=new or),or.validatorInstance}validate(e,n,r){var i,s;const a=Ur(e).safeParse(n);if(!a.success){const d=this.convertErrors((s=(i=a.error)===null||i===void 0?void 0:i.issues)!==null&&s!==void 0?s:[]);if(d){if(r?.silent)return d;throw new Cn(d)}}}convertErrors(e){if(e&&Array.isArray(e)&&e.length>0)return e.map(n=>{var r;let i,s,o,a;a=n.path.join("/");const d=String(n.path[n.path.length-1]),u=n.path.join("/");if(n.code===S.too_big)s="maxItems",a=`${u}/maxItems`,o={limit:n.maximum},i=`must NOT have more than ${n.maximum} items`;else if(n.code===S.too_small)s="minItems",a=`${u}/minItems`,o={limit:n.minimum},i=`must NOT have fewer than ${n.minimum} items`;else if(n.code===S.custom){const{value:c,format:l}=(r=n.params)!==null&&r!==void 0?r:{};typeof c>"u"?i=`value at "/${a}" is required`:i=`value "${typeof c=="object"?JSON.stringify(c):c}" at "/${a}" must pass "${l}" validation`,o={value:c}}return{keyword:s??d,instancePath:u?`/${u}`:"",schemaPath:a?`#${a}`:"#",params:o??{value:n.message},message:i??n.message}})}}class Dm{constructor(){this._validator=or.factory()}validateJSONSchema(e,n,r){return this._validator.validate(e,n,r)}validate(e,n,r={silent:!1}){var i,s;const o=_c(e);if(!(Array.isArray(o.items)&&((i=o.items)===null||i===void 0?void 0:i.length)===0&&n.length===0)){if(Array.isArray(o.items)&&((s=o.items)===null||s===void 0?void 0:s.length)===0&&n.length!==0)throw new Cn([{instancePath:"/0",schemaPath:"/",keyword:"required",message:"empty schema against data can not be validated",params:n}]);return this._validator.validate(o,n,r)}}}const q=new Dm,Fb=t=>{const{baseType:e,baseTypeSize:n}=mn(t);return e?e===t?!0:!((e==="int"||e==="uint")&&n&&!(n<=256&&n%8===0)||e==="bytes"&&n&&!(n>=1&&n<=32)):!1},RI=Object.freeze(Object.defineProperty({__proto__:null,VALID_ETH_BASE_TYPES:km,Web3Validator:Dm,Web3ValidatorError:Cn,bigintPower:ln,checkAddressCheckSum:Ic,isAddress:_e,isBigInt:Lb,isBlockNumber:Sc,isBlockNumberOrTag:Ls,isBlockTag:xe,isBloom:$n,isBoolean:Mm,isBytes:Gt,isContractAddressInBloom:Om,isFilterObject:Fm,isHex:dn,isHexPrefixed:fo,isHexStrict:z,isHexString:Nn,isHexString32Bytes:Pm,isHexString8Bytes:Ob,isInBloom:Qi,isInt:vr,isNullish:A,isNumber:Tc,isObject:On,isString:lo,isTopic:Ai,isTopicInBloom:Lm,isUInt:Et,isUint8Array:Ms,isUserEthereumAddressInBloom:Nm,isValidEthBaseType:Fb,utils:xc,validateNoLeadingZeroes:ho,validator:q},Symbol.toStringTag,{value:"Module"}));function qt(t){var e,n;return t instanceof Uint8Array||((e=t?.constructor)===null||e===void 0?void 0:e.name)==="Uint8Array"||((n=t?.constructor)===null||n===void 0?void 0:n.name)==="Buffer"}function He(...t){const e=t.reduce((i,s)=>i+s.length,0),n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return n}function yo(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let n=0;n<t.byteLength;n+=1)if(t[n]!==e[n])return!1;return!0}const vo={noether:BigInt(0),wei:BigInt(1),kwei:BigInt(1e3),Kwei:BigInt(1e3),babbage:BigInt(1e3),femtoether:BigInt(1e3),mwei:BigInt(1e6),Mwei:BigInt(1e6),lovelace:BigInt(1e6),picoether:BigInt(1e6),gwei:BigInt(1e9),Gwei:BigInt(1e9),shannon:BigInt(1e9),nanoether:BigInt(1e9),nano:BigInt(1e9),szabo:BigInt(1e12),microether:BigInt(1e12),micro:BigInt(1e12),finney:BigInt(1e15),milliether:BigInt(1e15),milli:BigInt(1e15),ether:BigInt("1000000000000000000"),kether:BigInt("1000000000000000000000"),grand:BigInt("1000000000000000000000"),mether:BigInt("1000000000000000000000000"),gether:BigInt("1000000000000000000000000000"),tether:BigInt("1000000000000000000000000000000")},Ia="Warning: Using type `number` with values that are large or contain many decimals may cause loss of precision, it is recommended to use type `string` or `BigInt` when using conversion methods",xt=t=>{if(q.validate(["bytes"],[t]),qt(t))return t;if(Array.isArray(t))return new Uint8Array(t);if(typeof t=="string")return qn(t);throw new xn(t)},{uint8ArrayToHexString:Db}=xc,ne=t=>Db(xt(t)),fe=t=>typeof t=="string"&&t.slice(0,2).toLowerCase()!=="0x"?xt(`0x${t}`):xt(t),se=t=>(q.validate(["hex"],[t]),mo(t)),jb=se,he=(t,e)=>{typeof t!="bigint"&&q.validate(["int"],[t]);let n=po(t);return e&&(!n.startsWith("-")&&n.length%2===1?n="0x0".concat(n.slice(2)):n.length%2===0&&n.startsWith("-")&&(n="-0x0".concat(n.slice(3)))),n},Hb=he,Ta=t=>se(t).toString(),et=t=>{q.validate(["string"],[t]);let e=t.replace(/^(?:\u0000)/,"");return e=e.replace(/(?:\u0000)$/,""),ne(new TextEncoder().encode(e))},bo=et,Ub=et,Ao=t=>gm(fe(t)),jm=t=>typeof t=="string"?Ao(t):(q.validate(["bytes"],[t]),gm(t)),Rc=hr,Gb=Ao,Hm=t=>{q.validate(["string"],[t]);let e="";for(let n=0;n<t.length;n+=1){const r=t.charCodeAt(n).toString(16);e+=r.length%2!==0?`0${r}`:r}return`0x${e}`},qb=Hm,Um=t=>new TextDecoder("ascii").decode(fe(t)),$b=Um,It=(t,e)=>{if(typeof t=="string"&&_e(t))return e?"address":`0x${t.toLowerCase().replace(/^0x/i,"")}`;if(typeof t=="boolean")return e?"bool":t?"0x01":"0x00";if(typeof t=="number")return e?t<0?"int256":"uint256":he(t);if(typeof t=="bigint")return e?"bigint":he(t);if(qt(t))return e?"bytes":ne(t);if(typeof t=="object"&&t)return e?"string":et(JSON.stringify(t));if(typeof t=="string"){if(t.startsWith("-0x")||t.startsWith("-0X"))return e?"int256":he(t);if(z(t))return e?"bytes":t;if(dn(t)&&!vr(t)&&!Et(t))return e?"bytes":`0x${t}`;if(dn(t)&&!vr(t)&&Et(t))return e?"uint":he(t);if(!Number.isFinite(t))return e?"string":et(t)}throw new Vh(t)},Pe=t=>{if(typeof t=="number")return t>1e20?(console.warn(Ia),BigInt(t)):t;if(typeof t=="bigint")return t>=Number.MIN_SAFE_INTEGER&&t<=Number.MAX_SAFE_INTEGER?Number(t):t;if(typeof t=="string"&&z(t))return se(t);try{return Pe(BigInt(t))}catch{throw new Gi(t)}},wn=t=>{if(typeof t=="number")return BigInt(t);if(typeof t=="bigint")return t;if(typeof t=="string"&&dn(t))return t.startsWith("-")?-BigInt(t.substring(1)):BigInt(t);throw new Gi(t)},Qb=(t,e)=>{let n;if(typeof e=="string"){if(n=vo[e],!n)throw new hc(e)}else{if(e<0||!Number.isInteger(e))throw new mc(e);n=ln(BigInt(10),BigInt(e))}const r=String(Pe(t)),i=n.toString().length-1;if(i<=0)return r.toString();const s=r.padStart(i,"0"),o=s.slice(0,-i),a=s.slice(-i).replace(/\.?0+$/,"");return o===""?a?`0.${a}`:"0":a===""?o:`${o}.${a}`.slice(0,o.length+i+1)},Vb=(t,e)=>{q.validate(["number"],[t]);let n;if(typeof e=="string"){if(n=vo[e],!n)throw new hc(e)}else{if(e<0||!Number.isInteger(e))throw new mc(e);n=ln(BigInt(10),BigInt(e))}let r=t;typeof r=="number"&&(r<1e-15&&console.warn(Ia),r>1e20?(console.warn(Ia),r=BigInt(r)):r=r.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20}));const[i,s]=String(typeof r=="string"&&!z(r)?r:Pe(r)).split(".").concat(""),a=BigInt(`${i}${s}`)*n,d=s.length;return d===0?a.toString():a.toString().slice(0,-d)},Se=t=>{if(!_e(t,!1))throw new Pr(t);const e=t.toLowerCase().replace(/^0x/i,""),n=Ut(Fe(go(Rc(e))));if(A(n)||n==="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")return"";let r="0x";const i=n.replace(/^0x/i,"");for(let s=0;s<e.length;s+=1)parseInt(i[s],16)>7?r+=e[s].toUpperCase():r+=e[s];return r},Gm=t=>{if(typeof t=="boolean")return t;if(typeof t=="number"&&(t===0||t===1)||typeof t=="bigint"&&(t===BigInt(0)||t===BigInt(1)))return!!t;if(typeof t=="string"&&!z(t)&&(t==="1"||t==="0"||t==="false"||t==="true"))return t==="true"?!0:t==="false"?!1:!!Number(t);if(typeof t=="string"&&z(t)&&(t==="0x1"||t==="0x0"))return!!Pe(t);throw new co(t)};var zo={exports:{}},fd;function zb(){return fd||(fd=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(d,u,c){this.fn=d,this.context=u,this.once=c||!1}function s(d,u,c,l,h){if(typeof c!="function")throw new TypeError("The listener must be a function");var p=new i(c,l||d,h),v=n?n+u:u;return d._events[v]?d._events[v].fn?d._events[v]=[d._events[v],p]:d._events[v].push(p):(d._events[v]=p,d._eventsCount++),d}function o(d,u){--d._eventsCount===0?d._events=new r:delete d._events[u]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],c,l;if(this._eventsCount===0)return u;for(l in c=this._events)e.call(c,l)&&u.push(n?l.slice(1):l);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},a.prototype.listeners=function(u){var c=n?n+u:u,l=this._events[c];if(!l)return[];if(l.fn)return[l.fn];for(var h=0,p=l.length,v=new Array(p);h<p;h++)v[h]=l[h].fn;return v},a.prototype.listenerCount=function(u){var c=n?n+u:u,l=this._events[c];return l?l.fn?1:l.length:0},a.prototype.emit=function(u,c,l,h,p,v){var m=n?n+u:u;if(!this._events[m])return!1;var y=this._events[m],f=arguments.length,b,w;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),f){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,c),!0;case 3:return y.fn.call(y.context,c,l),!0;case 4:return y.fn.call(y.context,c,l,h),!0;case 5:return y.fn.call(y.context,c,l,h,p),!0;case 6:return y.fn.call(y.context,c,l,h,p,v),!0}for(w=1,b=new Array(f-1);w<f;w++)b[w-1]=arguments[w];y.fn.apply(y.context,b)}else{var I=y.length,x;for(w=0;w<I;w++)switch(y[w].once&&this.removeListener(u,y[w].fn,void 0,!0),f){case 1:y[w].fn.call(y[w].context);break;case 2:y[w].fn.call(y[w].context,c);break;case 3:y[w].fn.call(y[w].context,c,l);break;case 4:y[w].fn.call(y[w].context,c,l,h);break;default:if(!b)for(x=1,b=new Array(f-1);x<f;x++)b[x-1]=arguments[x];y[w].fn.apply(y[w].context,b)}}return!0},a.prototype.on=function(u,c,l){return s(this,u,c,l,!1)},a.prototype.once=function(u,c,l){return s(this,u,c,l,!0)},a.prototype.removeListener=function(u,c,l,h){var p=n?n+u:u;if(!this._events[p])return this;if(!c)return o(this,p),this;var v=this._events[p];if(v.fn)v.fn===c&&(!h||v.once)&&(!l||v.context===l)&&o(this,p);else{for(var m=0,y=[],f=v.length;m<f;m++)(v[m].fn!==c||h&&!v[m].once||l&&v[m].context!==l)&&y.push(v[m]);y.length?this._events[p]=y.length===1?y[0]:y:o(this,p)}return this},a.prototype.removeAllListeners=function(u){var c;return u?(c=n?n+u:u,this._events[c]&&o(this,c)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(zo)),zo.exports}var Jb=zb();const qm=nc(Jb);class kc extends qm{constructor(){super(...arguments),this.maxListeners=Number.MAX_SAFE_INTEGER}setMaxListeners(e){return this.maxListeners=e,this}getMaxListeners(){return this.maxListeners}}const Tn=z,Wb=dn,Kb=Ic,Bc=_e,Zb=$n,Yb=Qi,Xb=Nm,eA=Om,tA=Ai,nA=Lm,rA=(t,e)=>{const n=typeof t=="string"&&xe(t),r=typeof e=="string"&&xe(e);if(t===e||(t==="earliest"||t===0)&&(e==="earliest"||e===0))return 0;if(t==="earliest")return-1;if(e==="earliest")return 1;if(n&&r){const o={[it.EARLIEST]:1,[it.FINALIZED]:2,[it.SAFE]:3,[it.LATEST]:4,[it.PENDING]:5};return o[t]<o[e]?-1:1}if(n&&!r||!n&&r)throw new Jh("Cannot compare blocktag with provided non-blocktag input.");const i=BigInt(t),s=BigInt(e);return i<s?-1:i===s?0:1},Zt=t=>typeof t=="object"&&!A(t)&&Object.keys(t).length!==0&&["input","data","from","gas","gasPrice","gasLimit","address","jsonInterface","syncWithContext","dataInputFill"].some(e=>e in t),$=A,hd=t=>typeof t=="object"&&!A(t)&&!Array.isArray(t)&&!(t instanceof ao),$t=(t,...e)=>{if(!hd(t))return t;const n=Object.assign({},t);for(const r of e)for(const i in r)hd(r[i])?(n[i]||(n[i]={}),n[i]=$t(n[i],r[i])):!A(r[i])&&Object.hasOwnProperty.call(r,i)&&(Array.isArray(r[i])||r[i]instanceof ao?n[i]=r[i].slice(0):n[i]=r[i]);return n},br=(t,e,n="0")=>typeof t=="string"?z(t)?Os(t,e,n):t.padStart(e,n):(q.validate(["int"],[t]),Os(t,e,n)),$m=(t,e,n="0")=>{if(typeof t=="string"&&!z(t))return t.padEnd(e,n);const r=typeof t=="string"&&z(t)?t:he(t),i=r.startsWith("-")?3:2;return q.validate([r.startsWith("-")?"int":"uint"],[t]),r.padEnd(e+i,n)},Pc=$m,Ar=br,Qm=(t,e=64)=>{q.validate(["int"],[t]);const n=Pe(t);if(n>=0)return br(It(n),e);const r=ln(BigInt(2),BigInt(e*4));if(-n>=r)throw new pc(`value: ${t}, nibbleWidth: ${e}`);const s=BigInt(n)+r;return br(he(s),e)},iA=(t,e=64)=>{q.validate(["int"],[t]);const n=Pe(t);if(n<0)return n;const r=Math.ceil(Math.log(Number(n))/Math.log(2));if(r>e*4)throw new pc(`value: "${t}", nibbleWidth: "${e}"`);if(e*4!==r)return n;const i=ln(BigInt(2),BigInt(e)*BigInt(4));return Pe(BigInt(n)-i)},{parseBaseType:sA}=xc,Ct=t=>typeof t=="object"&&!A(t)&&"number"in t&&"bytes"in t,oA=(t,e,n=[])=>{let r=Object.assign({},t),i;for(const s of e){if(r.oneOf&&i){const o=i,a=n.find(([d])=>d===o);a&&a[0]===i&&(r=r.oneOf[a[1]])}if(!r.properties&&!r.items)return;r.properties?r=r.properties[s]:r.items&&r.items.properties?r=r.items.properties[s]:r.items&&On(r.items)?r=r.items:r.items&&Array.isArray(r.items)&&(r=r.items[parseInt(s,10)]),r&&s&&(i=s)}return r},wi=(t,e,n)=>{try{const{baseType:r,baseTypeSize:i}=sA(e);if(r==="int"||r==="uint")switch(n.number){case Je.NUMBER:return Number(wn(t));case Je.HEX:return he(wn(t));case Je.STR:return wn(t).toString();case Je.BIGINT:return wn(t);default:throw new Ft(`Invalid format: ${String(n.number)}`)}if(r==="bytes"){let s;switch(i?typeof t=="string"?s=br(t,i*2):qt(t)&&(s=He(new Uint8Array(i-t.length),t)):s=t,n.bytes){case At.HEX:return ne(xt(s));case At.UINT8ARRAY:return xt(s);default:throw new Ft(`Invalid format: ${String(n.bytes)}`)}}if(r==="string")return String(t)}catch{return t}return t},md=({value:t,schemaProp:e,schema:n,object:r,key:i,dataPath:s,format:o,oneOfPath:a=[]})=>{var d,u;if(Array.isArray(t)){let c=e;if(e?.oneOf!==void 0&&e.oneOf.forEach((l,h)=>{var p,v;!Array.isArray(e?.items)&&(typeof t[0]=="object"&&((p=l?.items)===null||p===void 0?void 0:p.type)==="object"||typeof t[0]=="string"&&((v=l?.items)===null||v===void 0?void 0:v.type)!=="object")&&(c=l,a.push([i,h]))}),A(c?.items))return delete r[i],s.pop(),!0;if(On(c.items)&&!A(c.items.format)){for(let l=0;l<t.length;l+=1)r[i][l]=wi(t[l],(d=c?.items)===null||d===void 0?void 0:d.format,o);return s.pop(),!0}if(!Array.isArray(c?.items)&&((u=c?.items)===null||u===void 0?void 0:u.type)==="object"){for(const l of t)wo(l,n,s,o,a);return s.pop(),!0}if(Array.isArray(c?.items)){for(let l=0;l<t.length;l+=1)r[i][l]=wi(t[l],c.items[l].format,o);return s.pop(),!0}}return!1},wo=(t,e,n,r,i=[])=>{var s;if(!On(t)&&!Array.isArray(t))return wi(t,e?.format,r);const o=t;if(Array.isArray(o)&&e?.type==="array"&&((s=e?.items)===null||s===void 0?void 0:s.type)==="object")md({value:o,schemaProp:e,schema:e,object:o,key:"",dataPath:n,format:r,oneOfPath:i});else for(const[a,d]of Object.entries(o)){n.push(a);let u=oA(e,n,i);if(A(u)){delete o[a],n.pop();continue}if(On(d)){wo(d,e,n,r,i),n.pop();continue}if(!md({value:d,schemaProp:u,schema:e,object:o,key:a,dataPath:n,format:r,oneOfPath:i})){if(u?.format===void 0&&u?.oneOf!==void 0){for(const[c,l]of u.oneOf.entries())if(l?.format!==void 0){u=l;break}}o[a]=wi(d,u.format,r),n.pop()}}return o},T=(t,e,n=Ne)=>{let r;On(e)?r=$t({},e):Array.isArray(e)?r=[...e]:r=e;const i=On(t)?t:_c(t);if(!i.properties&&!i.items&&!i.format)throw new Ft("Invalid json schema for formatting");return wo(r,i,[],n)},Vm="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",De=t=>{let e;return typeof t=="bigint"||typeof t=="number"?e=hr(t.toString()):Array.isArray(t)?e=new Uint8Array(t):typeof t=="string"&&!z(t)?e=hr(t):e=xt(t),ne(Fe(go(e)))},Vi=t=>{let e;typeof t=="string"?t.startsWith("0x")&&z(t)?e=fe(t):e=hr(t):e=t;const n=De(e);return n===Vm?void 0:n},Qe=t=>{const e=Vi(t);return A(e)?Vm:e},aA=t=>{if(Array.isArray(t))throw new Error("Autodetection of array types is not supported.");let e,n;if(typeof t=="object"&&("t"in t||"type"in t)&&("v"in t||"value"in t))e="t"in t?t.t:t.type,n="v"in t?t.v:t.value,e=e.toLowerCase()==="bigint"?"int":e;else{if(typeof t=="bigint")return["int",t];e=It(t,!0),n=It(t),!e.startsWith("int")&&!e.startsWith("uint")&&(e="bytes")}return(e.startsWith("int")||e.startsWith("uint"))&&typeof n=="string"&&!/^(-)?0x/i.test(n)&&(n=wn(n)),[e,n]},cA=t=>t.startsWith("int[")?`int256${t.slice(3)}`:t==="int"?"int256":t.startsWith("uint[")?`uint256'${t.slice(4)}`:t==="uint"?"uint256":t,Jo=(t,e)=>{const n=/^(\d+).*$/.exec(t.slice(e));return n?parseInt(n[1],10):0},pd=t=>t.toString(2).length,gd=(t,e)=>{const n=e.toString();if(t==="string"){if(typeof e=="string")return et(e);throw new Qh(e)}if(t==="bool"||t==="boolean"){if(typeof e=="boolean")return e?"01":"00";throw new co(e)}if(t==="address"){if(!_e(n))throw new Pr(n);return n}const r=cA(t);if(t.startsWith("uint")){const i=Jo(r,4);if(i%8||i<8||i>256)throw new ga(n);const s=Pe(n);if(pd(s)>i)throw new ya(n);if(s<BigInt(0))throw new zh(n);return i?Ar(s.toString(16),i/8*2):s.toString(16)}if(t.startsWith("int")){const i=Jo(r,3);if(i%8||i<8||i>256)throw new ga(t);const s=Pe(n);if(pd(s)>i)throw new ya(n);return s<BigInt(0)?Qm(s.toString(),i/8*2):i?Ar(s.toString(16),i/4):s.toString(16)}if(r==="bytes"){if(n.replace(/^0x/i,"").length%2!==0)throw new xn(n);return n}if(t.startsWith("bytes")){if(n.replace(/^0x/i,"").length%2!==0)throw new xn(n);const i=Jo(t,5);if(!i||i<1||i>64||i<n.replace(/^0x/i,"").length/2)throw new xn(n);return Pc(n,i*2)}return""},zm=t=>{const[e,n]=aA(t);return Array.isArray(n)?n.map(s=>gd(e,s).replace("0x","")).join(""):gd(e,n).replace("0x","")},Cc=(...t)=>`0x${t.map(zm).join("").toLowerCase()}`,uA=(...t)=>Vi(Cc(...t)),dA=(...t)=>Qe(Cc(...t)),lA=t=>Vi(`0x${(typeof t=="number"?t.toString():t).padStart(64,"0")}`);function fA(t){return fm(t)}const _i=t=>fA(t),hA=t=>ne(_i(t));var _o=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};function Jm(t){return(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function Wm(t,e,n){return _o(this,void 0,void 0,function*(){let r;const i=yield Promise.race([t instanceof Promise?t:t(),new Promise((s,o)=>{r=setTimeout(()=>n?o(n):s(void 0),e)})]);if(r&&clearTimeout(r),i instanceof Error)throw i;return i})}function Nc(t,e){let n;return[new Promise((i,s)=>{n=setInterval((function o(){return _o(this,void 0,void 0,function*(){try{const a=yield Wm(t,e);A(a)||(clearInterval(n),i(a))}catch(a){clearInterval(n),s(a)}}),o})(),e)}),n]}function mA(t,e){return _o(this,void 0,void 0,function*(){return Nc(t,e)[0]})}function Oc(t,e){let n;const r=new Promise((i,s)=>{n=setTimeout(()=>{s(e)},t)});return[n,r]}function Km(t,e){let n;const r=new Promise((i,s)=>{n=setInterval(()=>{_o(this,void 0,void 0,function*(){const o=yield t();o&&(clearInterval(n),s(o))})},e)});return[n,r]}const Mc=()=>{const t=_i(16);t[6]=t[6]&15|64,t[8]=t[8]&63|128;const e=ne(t);return[e.substring(2,10),e.substring(10,14),e.substring(14,18),e.substring(18,22),e.substring(22,34)].join("-")},Lc=t=>{const e=t.error.code;return Me.has(e)||e>=-32099&&e<=-32e3},tn=t=>!Array.isArray(t)&&!!t&&t.jsonrpc==="2.0"&&"result"in t&&A(t.error)&&(typeof t.id=="number"||typeof t.id=="string"),nn=t=>!Array.isArray(t)&&t.jsonrpc==="2.0"&&!!t&&A(t.result)&&"error"in t&&(typeof t.id=="number"||typeof t.id=="string"),Eo=t=>!Array.isArray(t)&&!!t&&t.jsonrpc==="2.0"&&!A(t.params)&&!A(t.method),Zm=t=>!Array.isArray(t)&&!!t&&t.jsonrpc==="2.0"&&"id"in t&&"result"in t,Fs=t=>tn(t)||nn(t),Fc=t=>Array.isArray(t)?t.every(Fs):Fs(t),Ei=t=>Array.isArray(t)&&t.length>0&&Fc(t);let gs;const Ym=t=>{gs=t},Ln=t=>{var e,n,r,i;return typeof gs<"u"&&(gs+=1),{jsonrpc:(e=t.jsonrpc)!==null&&e!==void 0?e:"2.0",id:(r=(n=t.id)!==null&&n!==void 0?n:gs)!==null&&r!==void 0?r:Mc(),method:t.method,params:(i=t.params)!==null&&i!==void 0?i:void 0}},Dc=t=>t.map(e=>Ln(e)),mt=t=>Array.isArray(t)&&t.length>0,pA=Object.freeze(Object.defineProperty({__proto__:null,isBatchRequest:mt,isBatchResponse:Ei,isResponseRpcError:Lc,isResponseWithError:nn,isResponseWithNotification:Eo,isResponseWithResult:tn,isSubscriptionResult:Zm,isValidResponse:Fc,setRequestIdStart:Ym,toBatchPayload:Dc,toPayload:Ln,validateResponse:Fs},Symbol.toStringTag,{value:"Module"}));var Wo=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})},Xm;class Ds{constructor({timeout:e,eagerStart:n,timeoutMessage:r}={timeout:0,eagerStart:!1,timeoutMessage:"DeferredPromise timed out"}){this[Xm]="Promise",this._state="pending",this._promise=new Promise((i,s)=>{this._resolve=i,this._reject=s}),this._timeoutMessage=r,this._timeoutInterval=e,n&&this.startTimer()}get state(){return this._state}then(e,n){return Wo(this,void 0,void 0,function*(){return this._promise.then(e,n)})}catch(e){return Wo(this,void 0,void 0,function*(){return this._promise.catch(e)})}finally(e){return Wo(this,void 0,void 0,function*(){return this._promise.finally(e)})}resolve(e){this._resolve(e),this._state="fulfilled",this._clearTimeout()}reject(e){this._reject(e),this._state="rejected",this._clearTimeout()}startTimer(){this._timeoutInterval&&this._timeoutInterval>0&&(this._timeoutId=setTimeout(this._checkTimeout.bind(this),this._timeoutInterval))}_checkTimeout(){this._state==="pending"&&this._timeoutId&&this.reject(new sc(this._timeoutMessage))}_clearTimeout(){this._timeoutId&&clearTimeout(this._timeoutId)}}Xm=Symbol.toStringTag;class ep{constructor(e,n){this.eventEmitter=e,this.autoReconnect=n,this.chunkTimeout=1e3*15}clearQueues(){typeof this._clearQueues=="function"&&this._clearQueues()}onError(e){this._clearQueues=e}parseResponse(e){const n=[];return e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(i=>{let s=i;this.lastChunk&&(s=this.lastChunk+s);let o;try{o=JSON.parse(s)}catch{this.lastChunk=s,this.lastChunkTimeout&&clearTimeout(this.lastChunkTimeout),this.lastChunkTimeout=setTimeout(()=>{this.autoReconnect||(this.clearQueues(),this.eventEmitter.emit("error",new qi({id:1,jsonrpc:"2.0",error:{code:2,message:"Chunk timeout"}})))},this.chunkTimeout);return}clearTimeout(this.lastChunkTimeout),this.lastChunk=void 0,o&&n.push(o)}),n}}var yd=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};class xo extends Br{constructor(){super(...arguments),this._eventEmitter=new qm,this._chainId="",this._accounts=[]}_getChainId(){return yd(this,void 0,void 0,function*(){var e;const n=yield this.request(Ln({method:"eth_chainId",params:[]}));return(e=n?.result)!==null&&e!==void 0?e:""})}_getAccounts(){return yd(this,void 0,void 0,function*(){var e;const n=yield this.request(Ln({method:"eth_accounts",params:[]}));return(e=n?.result)!==null&&e!==void 0?e:[]})}_onConnect(){Promise.all([this._getChainId().then(e=>{e!==this._chainId&&(this._chainId=e,this._eventEmitter.emit("chainChanged",this._chainId))}).catch(e=>{console.error(e)}),this._getAccounts().then(e=>{this._accounts.length===e.length&&e.every(n=>e.includes(n))||(this._accounts=e,this._onAccountsChanged())}).catch(e=>{console.error(e)})]).then(()=>this._eventEmitter.emit("connect",{chainId:this._chainId})).catch(e=>{console.error(e)})}_onDisconnect(e,n){this._eventEmitter.emit("disconnect",new Wh(e,n))}_onAccountsChanged(){this._eventEmitter.emit("accountsChanged",this._accounts)}}var Ko=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const gA={autoReconnect:!0,delay:5e3,maxAttempts:5},yA=1e3;class jc extends xo{get SocketConnection(){return this._socketConnection}constructor(e,n,r){if(super(),this._connectionStatus="connecting",this._onMessageHandler=this._onMessage.bind(this),this._onOpenHandler=this._onConnect.bind(this),this._onCloseHandler=this._onCloseEvent.bind(this),this._onErrorHandler=this._onError.bind(this),!this._validateProviderPath(e))throw new ws(e);this._socketPath=e,this._socketOptions=n,this._reconnectOptions=Object.assign(Object.assign({},gA),r??{}),this._pendingRequestsQueue=new Map,this._sentRequestsQueue=new Map,this._init(),this.connect(),this.chunkResponseParser=new ep(this._eventEmitter,this._reconnectOptions.autoReconnect),this.chunkResponseParser.onError(()=>{this._clearQueues()}),this.isReconnecting=!1}_init(){this._reconnectAttempts=0}connect(){try{this._openSocketConnection(),this._connectionStatus="connecting",this._addSocketListeners()}catch(e){if(this.isReconnecting)setImmediate(()=>{this._reconnect()});else throw this._connectionStatus="disconnected",e&&e.message?new Ht(`Error while connecting to ${this._socketPath}. Reason: ${e.message}`):new ws(this._socketPath)}}_validateProviderPath(e){return!!e}getPendingRequestQueueSize(){return this._pendingRequestsQueue.size}getSentRequestsQueueSize(){return this._sentRequestsQueue.size}supportsSubscriptions(){return!0}on(e,n){this._eventEmitter.on(e,n)}once(e,n){this._eventEmitter.once(e,n)}removeListener(e,n){this._eventEmitter.removeListener(e,n)}_onDisconnect(e,n){this._connectionStatus="disconnected",super._onDisconnect(e,n)}disconnect(e,n){const r=e??yA;this._removeSocketListeners(),this.getStatus()!=="disconnected"&&this._closeSocketConnection(r,n),this._onDisconnect(r,n)}safeDisconnect(e,n){return Ko(this,arguments,void 0,function*(r,i,s=!1,o=1e3){let a=0;yield Ko(this,void 0,void 0,function*(){return new Promise(u=>{const c=setInterval(()=>{s&&a>=5&&this.clearQueues(),this.getPendingRequestQueueSize()===0&&this.getSentRequestsQueueSize()===0&&(clearInterval(c),u(!0)),a+=1},o)})}),this.disconnect(r,i)})}removeAllListeners(e){this._eventEmitter.removeAllListeners(e)}_onError(e){this.isReconnecting?this._reconnect():this._eventEmitter.emit("error",e)}reset(){this._sentRequestsQueue.clear(),this._pendingRequestsQueue.clear(),this._init(),this._removeSocketListeners(),this._addSocketListeners()}_reconnect(){this.isReconnecting||(this.isReconnecting=!0,this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((e,n)=>{e.deferredPromise.reject(new dh),this._sentRequestsQueue.delete(n)}),this._reconnectAttempts<this._reconnectOptions.maxAttempts?(this._reconnectAttempts+=1,setTimeout(()=>{this._removeSocketListeners(),this.connect(),this.isReconnecting=!1},this._reconnectOptions.delay)):(this.isReconnecting=!1,this._clearQueues(),this._removeSocketListeners(),this._eventEmitter.emit("error",new uh(this._reconnectOptions.maxAttempts))))}request(e){return Ko(this,void 0,void 0,function*(){if($(this._socketConnection))throw new Error("Connection is undefined");this.getStatus()==="disconnected"&&this.connect();const n=mt(e)?e[0].id:e.id;if(!n)throw new yh("Request Id not defined");if(this._sentRequestsQueue.has(n))throw new lh(n);const r=new Ds;r.catch(s=>{this._eventEmitter.emit("error",s)});const i={payload:e,deferredPromise:r};if(this.getStatus()==="connecting")return this._pendingRequestsQueue.set(n,i),i.deferredPromise;this._sentRequestsQueue.set(n,i);try{this._sendToSocket(i.payload)}catch(s){this._sentRequestsQueue.delete(n),this._eventEmitter.emit("error",s)}return r})}_onConnect(){this._connectionStatus="connected",this._reconnectAttempts=0,super._onConnect(),this._sendPendingRequests()}_sendPendingRequests(){for(const[e,n]of this._pendingRequestsQueue.entries())try{this._sendToSocket(n.payload),this._pendingRequestsQueue.delete(e),this._sentRequestsQueue.set(e,n)}catch(r){this._pendingRequestsQueue.delete(e),this._eventEmitter.emit("error",r)}}_onMessage(e){const n=this._parseResponses(e);if(!($(n)||n.length===0))for(const r of n){if(Eo(r)&&r.method.endsWith("_subscription")){this._eventEmitter.emit("message",r);return}const i=Ei(r)?r[0].id:r.id,s=this._sentRequestsQueue.get(i);if(!s)return;(Ei(r)||tn(r)||nn(r))&&(this._eventEmitter.emit("message",r),s.deferredPromise.resolve(r)),this._sentRequestsQueue.delete(i)}}clearQueues(e){this._clearQueues(e)}_clearQueues(e){this._pendingRequestsQueue.size>0&&this._pendingRequestsQueue.forEach((n,r)=>{n.deferredPromise.reject(new As(e)),this._pendingRequestsQueue.delete(r)}),this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((n,r)=>{n.deferredPromise.reject(new As(e)),this._sentRequestsQueue.delete(r)}),this._removeSocketListeners()}}const tp=Object.freeze(Object.defineProperty({__proto__:null,ChunkResponseParser:ep,Eip1193Provider:xo,EventEmitter:kc,SocketProvider:jc,Web3DeferredPromise:Ds,asciiToHex:Hm,bytesToHex:ne,bytesToUint8Array:xt,checkAddressCheckSum:Kb,compareBlockNumbers:rA,convert:wo,convertScalarValue:wi,encodePacked:Cc,ethUnitMap:vo,format:T,fromAscii:qb,fromDecimal:Hb,fromTwosComplement:iA,fromUtf8:bo,fromWei:Qb,getStorageSlotNumForLongString:lA,hexToAscii:Um,hexToBytes:fe,hexToNumber:se,hexToNumberString:Ta,hexToString:Gb,hexToUtf8:Ao,isAddress:Bc,isBatchRequest:mt,isBatchResponse:Ei,isBloom:Zb,isContractAddressInBloom:eA,isContractInitOptions:Zt,isDataFormat:Ct,isHex:Wb,isHexStrict:Tn,isInBloom:Yb,isNullish:$,isPromise:Jm,isResponseRpcError:Lc,isResponseWithError:nn,isResponseWithNotification:Eo,isResponseWithResult:tn,isSubscriptionResult:Zm,isTopic:tA,isTopicInBloom:nA,isUint8Array:qt,isUserEthereumAddressInBloom:Xb,isValidResponse:Fc,jsonRpc:pA,keccak256:De,keccak256Wrapper:De,leftPad:Ar,mergeDeep:$t,numberToHex:he,padLeft:br,padRight:$m,pollTillDefined:mA,pollTillDefinedAndReturnIntervalId:Nc,processSolidityEncodePackedArgs:zm,randomBytes:_i,randomHex:hA,rejectIfConditionAtInterval:Km,rejectIfTimeout:Oc,rightPad:Pc,setRequestIdStart:Ym,sha3:Vi,sha3Raw:Qe,soliditySha3:uA,soliditySha3Raw:dA,stringToHex:Ub,toAscii:$b,toBatchPayload:Dc,toBigInt:wn,toBool:Gm,toChecksumAddress:Se,toDecimal:jb,toHex:It,toNumber:Pe,toPayload:Ln,toTwosComplement:Qm,toUtf8:jm,toWei:Vb,uint8ArrayConcat:He,uint8ArrayEquals:yo,utf8ToBytes:Rc,utf8ToHex:et,uuidV4:Mc,validateResponse:Fs,waitWithTimeout:Wm},Symbol.toStringTag,{value:"Module"}));class zi{constructor(){this._emitter=new kc}on(e,n){this._emitter.on(e,n)}once(e,n){this._emitter.once(e,n)}off(e,n){this._emitter.off(e,n)}emit(e,n){this._emitter.emit(e,n)}listenerCount(e){return this._emitter.listenerCount(e)}listeners(e){return this._emitter.listeners(e)}eventNames(){return this._emitter.eventNames()}removeAllListeners(){return this._emitter.removeAllListeners()}setMaxListenerWarningThreshold(e){this._emitter.setMaxListeners(e)}getMaxListeners(){return this._emitter.getMaxListeners()}}var fn;(function(t){t.CONFIG_CHANGE="CONFIG_CHANGE"})(fn||(fn={}));class np extends zi{constructor(e){super(),this.config={handleRevert:!1,defaultAccount:void 0,defaultBlock:"latest",transactionBlockTimeout:50,transactionConfirmationBlocks:24,transactionPollingInterval:1e3,transactionPollingTimeout:750*1e3,transactionReceiptPollingInterval:void 0,transactionSendTimeout:750*1e3,transactionConfirmationPollingInterval:void 0,blockHeaderTimeout:10,maxListenersWarningThreshold:100,contractDataInputFill:"data",defaultNetworkId:void 0,defaultChain:"mainnet",defaultHardfork:"london",defaultCommon:void 0,defaultTransactionType:"0x2",defaultMaxPriorityFeePerGas:It(25e8),enableExperimentalFeatures:{useSubscriptionWhenCheckingBlockTimeout:!1,useRpcCallSpecification:!1},transactionBuilder:void 0,transactionTypeParser:void 0,customTransactionSchema:void 0,defaultReturnFormat:Ne,ignoreGasPricing:!1},this.setConfig(e??{})}setConfig(e){const n=Object.keys(e);for(const r of n)this._triggerConfigChange(r,e[r]),!$(e[r])&&typeof e[r]=="number"&&r==="maxListenersWarningThreshold"&&this.setMaxListenerWarningThreshold(Number(e[r]));Object.assign(this.config,e)}get handleRevert(){return this.config.handleRevert}set handleRevert(e){this._triggerConfigChange("handleRevert",e),this.config.handleRevert=e}get contractDataInputFill(){return this.config.contractDataInputFill}set contractDataInputFill(e){this._triggerConfigChange("contractDataInputFill",e),this.config.contractDataInputFill=e}get defaultAccount(){return this.config.defaultAccount}set defaultAccount(e){this._triggerConfigChange("defaultAccount",e),this.config.defaultAccount=e}get defaultBlock(){return this.config.defaultBlock}set defaultBlock(e){this._triggerConfigChange("defaultBlock",e),this.config.defaultBlock=e}get transactionSendTimeout(){return this.config.transactionSendTimeout}set transactionSendTimeout(e){this._triggerConfigChange("transactionSendTimeout",e),this.config.transactionSendTimeout=e}get transactionBlockTimeout(){return this.config.transactionBlockTimeout}set transactionBlockTimeout(e){this._triggerConfigChange("transactionBlockTimeout",e),this.config.transactionBlockTimeout=e}get transactionConfirmationBlocks(){return this.config.transactionConfirmationBlocks}set transactionConfirmationBlocks(e){this._triggerConfigChange("transactionConfirmationBlocks",e),this.config.transactionConfirmationBlocks=e}get transactionPollingInterval(){return this.config.transactionPollingInterval}set transactionPollingInterval(e){this._triggerConfigChange("transactionPollingInterval",e),this.config.transactionPollingInterval=e,this.transactionReceiptPollingInterval=e,this.transactionConfirmationPollingInterval=e}get transactionPollingTimeout(){return this.config.transactionPollingTimeout}set transactionPollingTimeout(e){this._triggerConfigChange("transactionPollingTimeout",e),this.config.transactionPollingTimeout=e}get transactionReceiptPollingInterval(){return this.config.transactionReceiptPollingInterval}set transactionReceiptPollingInterval(e){this._triggerConfigChange("transactionReceiptPollingInterval",e),this.config.transactionReceiptPollingInterval=e}get transactionConfirmationPollingInterval(){return this.config.transactionConfirmationPollingInterval}set transactionConfirmationPollingInterval(e){this._triggerConfigChange("transactionConfirmationPollingInterval",e),this.config.transactionConfirmationPollingInterval=e}get blockHeaderTimeout(){return this.config.blockHeaderTimeout}set blockHeaderTimeout(e){this._triggerConfigChange("blockHeaderTimeout",e),this.config.blockHeaderTimeout=e}get enableExperimentalFeatures(){return this.config.enableExperimentalFeatures}set enableExperimentalFeatures(e){this._triggerConfigChange("enableExperimentalFeatures",e),this.config.enableExperimentalFeatures=e}get maxListenersWarningThreshold(){return this.config.maxListenersWarningThreshold}set maxListenersWarningThreshold(e){this._triggerConfigChange("maxListenersWarningThreshold",e),this.setMaxListenerWarningThreshold(e),this.config.maxListenersWarningThreshold=e}get defaultReturnFormat(){return this.config.defaultReturnFormat}set defaultReturnFormat(e){this._triggerConfigChange("defaultReturnFormat",e),this.config.defaultReturnFormat=e}get defaultNetworkId(){return this.config.defaultNetworkId}set defaultNetworkId(e){this._triggerConfigChange("defaultNetworkId",e),this.config.defaultNetworkId=e}get defaultChain(){return this.config.defaultChain}set defaultChain(e){if(!$(this.config.defaultCommon)&&!$(this.config.defaultCommon.baseChain)&&e!==this.config.defaultCommon.baseChain)throw new ba(this.config.defaultChain,e);this._triggerConfigChange("defaultChain",e),this.config.defaultChain=e}get defaultHardfork(){return this.config.defaultHardfork}set defaultHardfork(e){if(!$(this.config.defaultCommon)&&!$(this.config.defaultCommon.hardfork)&&e!==this.config.defaultCommon.hardfork)throw new va(this.config.defaultCommon.hardfork,e);this._triggerConfigChange("defaultHardfork",e),this.config.defaultHardfork=e}get defaultCommon(){return this.config.defaultCommon}set defaultCommon(e){if(!$(this.config.defaultHardfork)&&!$(e)&&!$(e.hardfork)&&this.config.defaultHardfork!==e.hardfork)throw new va(this.config.defaultHardfork,e.hardfork);if(!$(this.config.defaultChain)&&!$(e)&&!$(e.baseChain)&&this.config.defaultChain!==e.baseChain)throw new ba(this.config.defaultChain,e.baseChain);this._triggerConfigChange("defaultCommon",e),this.config.defaultCommon=e}get ignoreGasPricing(){return this.config.ignoreGasPricing}set ignoreGasPricing(e){this._triggerConfigChange("ignoreGasPricing",e),this.config.ignoreGasPricing=e}get defaultTransactionType(){return this.config.defaultTransactionType}set defaultTransactionType(e){this._triggerConfigChange("defaultTransactionType",e),this.config.defaultTransactionType=e}get defaultMaxPriorityFeePerGas(){return this.config.defaultMaxPriorityFeePerGas}set defaultMaxPriorityFeePerGas(e){this._triggerConfigChange("defaultMaxPriorityFeePerGas",e),this.config.defaultMaxPriorityFeePerGas=e}get transactionBuilder(){return this.config.transactionBuilder}set transactionBuilder(e){this._triggerConfigChange("transactionBuilder",e),this.config.transactionBuilder=e}get transactionTypeParser(){return this.config.transactionTypeParser}set transactionTypeParser(e){this._triggerConfigChange("transactionTypeParser",e),this.config.transactionTypeParser=e}get customTransactionSchema(){return this.config.customTransactionSchema}set customTransactionSchema(e){this._triggerConfigChange("customTransactionSchema",e),this.config.customTransactionSchema=e}_triggerConfigChange(e,n){this.emit(fn.CONFIG_CHANGE,{name:e,oldValue:this.config[e],newValue:n})}}var cs={exports:{}},vd;function vA(){return vd||(vd=1,(function(t,e){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis,r=(function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s})();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof s<"u"&&s||{},d={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function u(g){return g&&DataView.prototype.isPrototypeOf(g)}if(d.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(g){return g&&c.indexOf(Object.prototype.toString.call(g))>-1};function h(g){if(typeof g!="string"&&(g=String(g)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(g)||g==="")throw new TypeError('Invalid character in header field name: "'+g+'"');return g.toLowerCase()}function p(g){return typeof g!="string"&&(g=String(g)),g}function v(g){var _={next:function(){var B=g.shift();return{done:B===void 0,value:B}}};return d.iterable&&(_[Symbol.iterator]=function(){return _}),_}function m(g){this.map={},g instanceof m?g.forEach(function(_,B){this.append(B,_)},this):Array.isArray(g)?g.forEach(function(_){if(_.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+_.length);this.append(_[0],_[1])},this):g&&Object.getOwnPropertyNames(g).forEach(function(_){this.append(_,g[_])},this)}m.prototype.append=function(g,_){g=h(g),_=p(_);var B=this.map[g];this.map[g]=B?B+", "+_:_},m.prototype.delete=function(g){delete this.map[h(g)]},m.prototype.get=function(g){return g=h(g),this.has(g)?this.map[g]:null},m.prototype.has=function(g){return this.map.hasOwnProperty(h(g))},m.prototype.set=function(g,_){this.map[h(g)]=p(_)},m.prototype.forEach=function(g,_){for(var B in this.map)this.map.hasOwnProperty(B)&&g.call(_,this.map[B],B,this)},m.prototype.keys=function(){var g=[];return this.forEach(function(_,B){g.push(B)}),v(g)},m.prototype.values=function(){var g=[];return this.forEach(function(_){g.push(_)}),v(g)},m.prototype.entries=function(){var g=[];return this.forEach(function(_,B){g.push([B,_])}),v(g)},d.iterable&&(m.prototype[Symbol.iterator]=m.prototype.entries);function y(g){if(!g._noBody){if(g.bodyUsed)return Promise.reject(new TypeError("Already read"));g.bodyUsed=!0}}function f(g){return new Promise(function(_,B){g.onload=function(){_(g.result)},g.onerror=function(){B(g.error)}})}function b(g){var _=new FileReader,B=f(_);return _.readAsArrayBuffer(g),B}function w(g){var _=new FileReader,B=f(_),F=/charset=([A-Za-z0-9_-]+)/.exec(g.type),U=F?F[1]:"utf-8";return _.readAsText(g,U),B}function I(g){for(var _=new Uint8Array(g),B=new Array(_.length),F=0;F<_.length;F++)B[F]=String.fromCharCode(_[F]);return B.join("")}function x(g){if(g.slice)return g.slice(0);var _=new Uint8Array(g.byteLength);return _.set(new Uint8Array(g)),_.buffer}function k(){return this.bodyUsed=!1,this._initBody=function(g){this.bodyUsed=this.bodyUsed,this._bodyInit=g,g?typeof g=="string"?this._bodyText=g:d.blob&&Blob.prototype.isPrototypeOf(g)?this._bodyBlob=g:d.formData&&FormData.prototype.isPrototypeOf(g)?this._bodyFormData=g:d.searchParams&&URLSearchParams.prototype.isPrototypeOf(g)?this._bodyText=g.toString():d.arrayBuffer&&d.blob&&u(g)?(this._bodyArrayBuffer=x(g.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):d.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(g)||l(g))?this._bodyArrayBuffer=x(g):this._bodyText=g=Object.prototype.toString.call(g):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof g=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):d.searchParams&&URLSearchParams.prototype.isPrototypeOf(g)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},d.blob&&(this.blob=function(){var g=y(this);if(g)return g;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var g=y(this);return g||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(d.blob)return this.blob().then(b);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var g=y(this);if(g)return g;if(this._bodyBlob)return w(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(I(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},d.formData&&(this.formData=function(){return this.text().then(R)}),this.json=function(){return this.text().then(JSON.parse)},this}var P=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function E(g){var _=g.toUpperCase();return P.indexOf(_)>-1?_:g}function G(g,_){if(!(this instanceof G))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');_=_||{};var B=_.body;if(g instanceof G){if(g.bodyUsed)throw new TypeError("Already read");this.url=g.url,this.credentials=g.credentials,_.headers||(this.headers=new m(g.headers)),this.method=g.method,this.mode=g.mode,this.signal=g.signal,!B&&g._bodyInit!=null&&(B=g._bodyInit,g.bodyUsed=!0)}else this.url=String(g);if(this.credentials=_.credentials||this.credentials||"same-origin",(_.headers||!this.headers)&&(this.headers=new m(_.headers)),this.method=E(_.method||this.method||"GET"),this.mode=_.mode||this.mode||null,this.signal=_.signal||this.signal||(function(){if("AbortController"in a){var D=new AbortController;return D.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&B)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(B),(this.method==="GET"||this.method==="HEAD")&&(_.cache==="no-store"||_.cache==="no-cache")){var F=/([?&])_=[^&]*/;if(F.test(this.url))this.url=this.url.replace(F,"$1_="+new Date().getTime());else{var U=/\?/;this.url+=(U.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}G.prototype.clone=function(){return new G(this,{body:this._bodyInit})};function R(g){var _=new FormData;return g.trim().split("&").forEach(function(B){if(B){var F=B.split("="),U=F.shift().replace(/\+/g," "),D=F.join("=").replace(/\+/g," ");_.append(decodeURIComponent(U),decodeURIComponent(D))}}),_}function O(g){var _=new m,B=g.replace(/\r?\n[\t ]+/g," ");return B.split("\r").map(function(F){return F.indexOf(`
9
+ `)===0?F.substr(1,F.length):F}).forEach(function(F){var U=F.split(":"),D=U.shift().trim();if(D){var de=U.join(":").trim();try{_.append(D,de)}catch(Ae){console.warn("Response "+Ae.message)}}}),_}k.call(G.prototype);function L(g,_){if(!(this instanceof L))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(_||(_={}),this.type="default",this.status=_.status===void 0?200:_.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=_.statusText===void 0?"":""+_.statusText,this.headers=new m(_.headers),this.url=_.url||"",this._initBody(g)}k.call(L.prototype),L.prototype.clone=function(){return new L(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new m(this.headers),url:this.url})},L.error=function(){var g=new L(null,{status:200,statusText:""});return g.ok=!1,g.status=0,g.type="error",g};var Z=[301,302,303,307,308];L.redirect=function(g,_){if(Z.indexOf(_)===-1)throw new RangeError("Invalid status code");return new L(null,{status:_,headers:{location:g}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(_,B){this.message=_,this.name=B;var F=Error(_);this.stack=F.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function ye(g,_){return new Promise(function(B,F){var U=new G(g,_);if(U.signal&&U.signal.aborted)return F(new o.DOMException("Aborted","AbortError"));var D=new XMLHttpRequest;function de(){D.abort()}D.onload=function(){var ce={statusText:D.statusText,headers:O(D.getAllResponseHeaders()||"")};U.url.indexOf("file://")===0&&(D.status<200||D.status>599)?ce.status=200:ce.status=D.status,ce.url="responseURL"in D?D.responseURL:ce.headers.get("X-Request-URL");var Be="response"in D?D.response:D.responseText;setTimeout(function(){B(new L(Be,ce))},0)},D.onerror=function(){setTimeout(function(){F(new TypeError("Network request failed"))},0)},D.ontimeout=function(){setTimeout(function(){F(new TypeError("Network request timed out"))},0)},D.onabort=function(){setTimeout(function(){F(new o.DOMException("Aborted","AbortError"))},0)};function Ae(ce){try{return ce===""&&a.location.href?a.location.href:ce}catch{return ce}}if(D.open(U.method,Ae(U.url),!0),U.credentials==="include"?D.withCredentials=!0:U.credentials==="omit"&&(D.withCredentials=!1),"responseType"in D&&(d.blob?D.responseType="blob":d.arrayBuffer&&(D.responseType="arraybuffer")),_&&typeof _.headers=="object"&&!(_.headers instanceof m||a.Headers&&_.headers instanceof a.Headers)){var tt=[];Object.getOwnPropertyNames(_.headers).forEach(function(ce){tt.push(h(ce)),D.setRequestHeader(ce,p(_.headers[ce]))}),U.headers.forEach(function(ce,Be){tt.indexOf(Be)===-1&&D.setRequestHeader(Be,ce)})}else U.headers.forEach(function(ce,Be){D.setRequestHeader(Be,ce)});U.signal&&(U.signal.addEventListener("abort",de),D.onreadystatechange=function(){D.readyState===4&&U.signal.removeEventListener("abort",de)}),D.send(typeof U._bodyInit>"u"?null:U._bodyInit)})}return ye.polyfill=!0,a.fetch||(a.fetch=ye,a.Headers=m,a.Request=G,a.Response=L),o.Headers=m,o.Request=G,o.Response=L,o.fetch=ye,o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(cs,cs.exports)),cs.exports}var bA=vA();const AA=nc(bA);var wA=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};class wr extends Br{constructor(e,n){if(super(),!wr.validateClientUrl(e))throw new ws(e);this.clientUrl=e,this.httpProviderOptions=n}static validateClientUrl(e){return typeof e=="string"?/^http(s)?:\/\//i.test(e):!1}getStatus(){throw new ft}supportsSubscriptions(){return!1}request(e,n){var r;return wA(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},(r=this.httpProviderOptions)===null||r===void 0?void 0:r.providerOptions),n),s=yield AA(this.clientUrl,Object.assign(Object.assign({},i),{method:"POST",headers:Object.assign(Object.assign({},i.headers),{"Content-Type":"application/json"}),body:JSON.stringify(e)}));if(!s.ok)throw new st(yield s.json(),void 0,void 0,s.status);return yield s.json()})}on(){throw new ft}removeListener(){throw new ft}once(){throw new ft}removeAllListeners(){throw new ft}connect(){throw new ft}disconnect(){throw new ft}reset(){throw new ft}reconnect(){throw new ft}}const _A=Object.freeze(Object.defineProperty({__proto__:null,HttpProvider:wr,default:wr},Symbol.toStringTag,{value:"Module"}));var nr=null;typeof WebSocket<"u"?nr=WebSocket:typeof MozWebSocket<"u"?nr=MozWebSocket:typeof globalThis<"u"?nr=globalThis.WebSocket||globalThis.MozWebSocket:typeof window<"u"?nr=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(nr=self.WebSocket||self.MozWebSocket);class js extends jc{constructor(e,n,r){super(e,n,r)}_validateProviderPath(e){return typeof e=="string"?/^ws(s)?:\/\//i.test(e):!1}getStatus(){if(this._socketConnection&&!$(this._socketConnection))switch(this._socketConnection.readyState){case this._socketConnection.CONNECTING:return"connecting";case this._socketConnection.OPEN:return"connected";default:return"disconnected"}return"disconnected"}_openSocketConnection(){this._socketConnection=new nr(this._socketPath,void 0,this._socketOptions&&Object.keys(this._socketOptions).length===0?void 0:this._socketOptions)}_closeSocketConnection(e,n){var r;(r=this._socketConnection)===null||r===void 0||r.close(e,n)}_sendToSocket(e){var n;if(this.getStatus()==="disconnected")throw new As;(n=this._socketConnection)===null||n===void 0||n.send(JSON.stringify(e))}_parseResponses(e){return this.chunkResponseParser.parseResponse(e.data)}_addSocketListeners(){var e,n,r,i;(e=this._socketConnection)===null||e===void 0||e.addEventListener("open",this._onOpenHandler),(n=this._socketConnection)===null||n===void 0||n.addEventListener("message",this._onMessageHandler),(r=this._socketConnection)===null||r===void 0||r.addEventListener("close",s=>this._onCloseHandler(s)),(i=this._socketConnection)===null||i===void 0||i.addEventListener("error",this._onErrorHandler)}_removeSocketListeners(){var e,n,r;(e=this._socketConnection)===null||e===void 0||e.removeEventListener("message",this._onMessageHandler),(n=this._socketConnection)===null||n===void 0||n.removeEventListener("open",this._onOpenHandler),(r=this._socketConnection)===null||r===void 0||r.removeEventListener("close",this._onCloseHandler)}_onCloseEvent(e){var n;if(this._reconnectOptions.autoReconnect&&(![1e3,1001].includes(e.code)||!e.wasClean)){this._reconnect();return}this._clearQueues(e),this._removeSocketListeners(),this._onDisconnect(e.code,e.reason),(n=this._socketConnection)===null||n===void 0||n.removeEventListener("error",this._onErrorHandler)}}const EA=Object.freeze(Object.defineProperty({__proto__:null,WebSocketProvider:js,default:js},Symbol.toStringTag,{value:"Module"})),Hc=t=>Br.isWeb3Provider(t),xA=t=>typeof t!="string"&&"request"in t&&t.request.constructor.name==="AsyncFunction"&&"isMetaMask"in t&&t.isMetaMask,Uc=t=>typeof t!="string"&&"request"in t&&t.request.constructor.name==="Function",Gc=t=>typeof t!="string"&&"request"in t&&t.request.constructor.name==="AsyncFunction",qc=t=>typeof t!="string"&&"send"in t,$c=t=>typeof t!="string"&&"sendAsync"in t,xi=t=>t&&(Hc(t)||Gc(t)||Uc(t)||$c(t)||qc(t)),rp=t=>t&&"supportsSubscriptions"in t?t.supportsSubscriptions():!!(t&&typeof t!="string"&&"on"in t);var Zo=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})},Fn;(function(t){t.PROVIDER_CHANGED="PROVIDER_CHANGED",t.BEFORE_PROVIDER_CHANGE="BEFORE_PROVIDER_CHANGE"})(Fn||(Fn={}));const bd={HttpProvider:wr,WebsocketProvider:js};class rn extends zi{constructor(e,n,r){super(),$(e)||this.setProvider(e),this.useRpcCallSpecification=n,$(r)||(this.middleware=r)}static get providers(){return bd}get provider(){return this._provider}get providers(){return bd}setProvider(e){let n;if(e&&typeof e=="string"&&this.providers)if(/^http(s)?:\/\//i.test(e))n=new this.providers.HttpProvider(e);else if(/^ws(s)?:\/\//i.test(e))n=new this.providers.WebsocketProvider(e);else throw new qr(`Can't autodetect provider for "${e}"`);else $(e)?n=void 0:n=e;return this.emit(Fn.BEFORE_PROVIDER_CHANGE,this._provider),this._provider=n,this.emit(Fn.PROVIDER_CHANGED,this._provider),!0}setMiddleware(e){this.middleware=e}send(e){return Zo(this,void 0,void 0,function*(){const n=Object.assign({},e);let r=yield this._sendRequest(n);if($(this.middleware)||(r=yield this.middleware.processResponse(r)),tn(r))return r.result;throw new st(r)})}sendBatch(e){return Zo(this,void 0,void 0,function*(){return yield this._sendRequest(e)})}_sendRequest(e){return Zo(this,void 0,void 0,function*(){const{provider:n}=this;if($(n))throw new qr("Provider not available. Use `.setProvider` or `.provider=` to initialize the provider.");let r=mt(e)?Dc(e):Ln(e);if($(this.middleware)||(r=yield this.middleware.processRequest(r)),Hc(n)){let i;try{i=yield n.request(r)}catch(s){i=s}return this._processJsonRpcResponse(r,i,{legacy:!1,error:!1})}if(Gc(n))return n.request(r).then(i=>this._processJsonRpcResponse(r,i,{legacy:!0,error:!1})).catch(i=>this._processJsonRpcResponse(r,i,{legacy:!0,error:!0}));if(Uc(n))return new Promise((i,s)=>{const o=u=>{s(this._processJsonRpcResponse(r,u,{legacy:!0,error:!0}))},a=u=>i(this._processJsonRpcResponse(r,u,{legacy:!0,error:!1})),d=n.request(r,(u,c)=>u?o(u):a(c));Jm(d)&&d.then(a).catch(c=>{try{const l=this._processJsonRpcResponse(r,c,{legacy:!0,error:!0});s(l)}catch(l){s(l)}})});if(qc(n))return new Promise((i,s)=>{n.send(r,(o,a)=>{if(o)return s(this._processJsonRpcResponse(r,o,{legacy:!0,error:!0}));if($(a))throw new st({},'Got a "nullish" response from provider.');return i(this._processJsonRpcResponse(r,a,{legacy:!0,error:!1}))})});if($c(n))return n.sendAsync(r).then(i=>this._processJsonRpcResponse(r,i,{legacy:!0,error:!1})).catch(i=>this._processJsonRpcResponse(r,i,{legacy:!0,error:!0}));throw new qr("Provider does not have a request or send method to use.")})}_processJsonRpcResponse(e,n,{legacy:r,error:i}){if($(n))return this._buildResponse(e,null,i);if(nn(n)){if(this.useRpcCallSpecification&&Lc(n)){const s=n;if(Me.get(s.error.code)){const o=Me.get(s.error.code).error;throw new o(s)}else throw new Ve(s)}else if(!rn._isReverted(n))throw new qi(n,e)}if(tn(n))return n;if(n instanceof Error)throw rn._isReverted(n),n;if(!r&&mt(e)&&Ei(n)||r&&!i&&mt(e))return n;if(r&&i&&mt(e))throw n;if(r&&!nn(n)&&!tn(n))return this._buildResponse(e,n,i);throw mt(e)&&!Array.isArray(n)?new st(n,"Got normal response for a batch request."):!mt(e)&&Array.isArray(n)?new st(n,"Got batch response for a normal request."):new st(n,"Invalid response")}static _isReverted(e){let n;if(nn(e)?n=e.error:e instanceof Error&&(n=e),n?.message.includes("revert"))throw new en(n);return!1}_buildResponse(e,n,r){const i={jsonrpc:"2.0",id:mt(e)?e[0].id:"id"in e?e.id:null};return r?Object.assign(Object.assign({},i),{error:n}):Object.assign(Object.assign({},i),{result:n})}}var Fr=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};class Ii{constructor(e,n,r=!1){this.requestManager=e,this.registeredSubscriptions=n,this.tolerateUnlinkedSubscription=r,this._subscriptions=new Map,this.requestManager.on(Fn.BEFORE_PROVIDER_CHANGE,()=>Fr(this,void 0,void 0,function*(){yield this.unsubscribe()})),this.requestManager.on(Fn.PROVIDER_CHANGED,()=>{this.clear(),this.listenToProviderEvents()}),this.listenToProviderEvents()}listenToProviderEvents(){const e=this.requestManager.provider;!this.requestManager.provider||typeof e?.supportsSubscriptions=="function"&&!e?.supportsSubscriptions()||typeof this.requestManager.provider.on=="function"&&(typeof this.requestManager.provider.request=="function"?this.requestManager.provider.on("message",n=>this.messageListener(n)):e.on("data",n=>this.messageListener(n)))}messageListener(e){var n,r,i;if(!e)throw new ht("Should not call messageListener with no data. Type was");const s=((n=e.params)===null||n===void 0?void 0:n.subscription)||((r=e.data)===null||r===void 0?void 0:r.subscription)||((i=e.id)===null||i===void 0?void 0:i.toString(16));if(s){const o=this._subscriptions.get(s);o?.processSubscriptionData(e)}}subscribe(e,n){return Fr(this,arguments,void 0,function*(r,i,s=Ne){const o=this.registeredSubscriptions[r];if(!o)throw new ht("Invalid subscription type");const a=new o(i??void 0,{subscriptionManager:this,returnFormat:s});return yield this.addSubscription(a),a})}get subscriptions(){return this._subscriptions}addSubscription(e){return Fr(this,void 0,void 0,function*(){if(!this.requestManager.provider)throw new qr("Provider not available");if(!this.supportsSubscriptions())throw new ht("The current provider does not support subscriptions");if(e.id&&this._subscriptions.has(e.id))throw new ht(`Subscription with id "${e.id}" already exists`);if(yield e.sendSubscriptionRequest(),$(e.id))throw new ht("Subscription is not subscribed yet.");return this._subscriptions.set(e.id,e),e.id})}removeSubscription(e){return Fr(this,void 0,void 0,function*(){const{id:n}=e;if($(n))throw new ht("Subscription is not subscribed yet. Or, had already been unsubscribed but not through the Subscription Manager.");if(!this._subscriptions.has(n)&&!this.tolerateUnlinkedSubscription)throw new ht(`Subscription with id "${n.toString()}" does not exists`);return yield e.sendUnsubscribeRequest(),this._subscriptions.delete(n),n})}unsubscribe(e){return Fr(this,void 0,void 0,function*(){const n=[];for(const[r,i]of this.subscriptions.entries())(!e||typeof e=="function"&&e({id:r,sub:i}))&&n.push(this.removeSubscription(i));return Promise.all(n)})}clear(){this._subscriptions.clear()}supportsSubscriptions(){return $(this.requestManager.provider)?!1:rp(this.requestManager.provider)}}var Dr=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};class Nr extends zi{constructor(e,n){var r;super(),this.args=e;const{requestManager:i}=n,{subscriptionManager:s}=n;i?this._subscriptionManager=new Ii(i,{},!0):this._subscriptionManager=s,this._returnFormat=(r=n?.returnFormat)!==null&&r!==void 0?r:Ne}get id(){return this._id}get lastBlock(){return this._lastBlock}subscribe(){return Dr(this,void 0,void 0,function*(){return this._subscriptionManager.addSubscription(this)})}processSubscriptionData(e){var n,r;e?.data?this._processSubscriptionResult((r=(n=e?.data)===null||n===void 0?void 0:n.result)!==null&&r!==void 0?r:e?.data):e&&Eo(e)&&this._processSubscriptionResult(e?.params.result)}sendSubscriptionRequest(){return Dr(this,void 0,void 0,function*(){return this._id=yield this._subscriptionManager.requestManager.send({method:"eth_subscribe",params:this._buildSubscriptionParams()}),this.emit("connected",this._id),this._id})}get returnFormat(){return this._returnFormat}get subscriptionManager(){return this._subscriptionManager}resubscribe(){return Dr(this,void 0,void 0,function*(){yield this.unsubscribe(),yield this.subscribe()})}unsubscribe(){return Dr(this,void 0,void 0,function*(){this.id&&(yield this._subscriptionManager.removeSubscription(this))})}sendUnsubscribeRequest(){return Dr(this,void 0,void 0,function*(){yield this._subscriptionManager.requestManager.send({method:"eth_unsubscribe",params:[this.id]}),this._id=void 0})}formatSubscriptionResult(e){return e}_processSubscriptionResult(e){this.emit("data",this.formatSubscriptionResult(e))}_processSubscriptionError(e){this.emit("error",e)}_buildSubscriptionParams(){throw new Error("Implement in the child class")}}var Zn=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};class Ti extends Wd{constructor(){super(...arguments),this._addressMap=new Map,this._defaultKeyName="web3js_wallet"}static getStorage(){let e;try{e=window.localStorage;const n="__storage_test__";return e.setItem(n,n),e.removeItem(n),e}catch(n){return n&&(n.code===22||n.code===1014||n.name==="QuotaExceededError"||n.name==="NS_ERROR_DOM_QUOTA_REACHED")&&!A(e)&&e.length!==0?e:void 0}}create(e){for(let n=0;n<e;n+=1)this.add(this._accountProvider.create());return this}add(e){var n;if(typeof e=="string")return this.add(this._accountProvider.privateKeyToAccount(e));let r=this.length;return this.get(e.address)&&(console.warn(`Account ${e.address.toLowerCase()} already exists.`),r=(n=this._addressMap.get(e.address.toLowerCase()))!==null&&n!==void 0?n:r),this._addressMap.set(e.address.toLowerCase(),r),this[r]=e,this}get(e){if(typeof e=="string"){const n=this._addressMap.get(e.toLowerCase());return A(n)?void 0:this[n]}return this[e]}remove(e){if(typeof e=="string"){const n=this._addressMap.get(e.toLowerCase());return A(n)?!1:(this._addressMap.delete(e.toLowerCase()),this.splice(n,1),!0)}return this[e]?(this.splice(e,1),!0):!1}clear(){return this._addressMap.clear(),this.length=0,this}encrypt(e,n){return Zn(this,void 0,void 0,function*(){return Promise.all(this.map(r=>Zn(this,void 0,void 0,function*(){return r.encrypt(e,n)})))})}decrypt(e,n,r){return Zn(this,void 0,void 0,function*(){const i=yield Promise.all(e.map(s=>Zn(this,void 0,void 0,function*(){return this._accountProvider.decrypt(s,n,r)})));for(const s of i)this.add(s);return this})}save(e,n){return Zn(this,void 0,void 0,function*(){const r=Ti.getStorage();if(!r)throw new Error("Local storage not available.");return r.setItem(n??this._defaultKeyName,JSON.stringify(yield this.encrypt(e))),!0})}load(e,n){return Zn(this,void 0,void 0,function*(){const r=Ti.getStorage();if(!r)throw new Error("Local storage not available.");const i=r.getItem(n??this._defaultKeyName);return i&&(yield this.decrypt(JSON.parse(i)||[],e)),this})}}const yt={web:fs};function ip(t,e,n){if(!n.startsWith("aes-"))throw new Error(`AES submodule doesn't support mode ${n}`);if(e.length!==16)throw new Error("AES: wrong IV length");if(n.startsWith("aes-128")&&t.length!==16||n.startsWith("aes-256")&&t.length!==32)throw new Error("AES: wrong key length")}async function sp(t,e,n){if(!yt.web)throw new Error("Browser crypto not available.");let r;if(["aes-128-cbc","aes-256-cbc"].includes(t)&&(r="cbc"),["aes-128-ctr","aes-256-ctr"].includes(t)&&(r="ctr"),!r)throw new Error("AES: unsupported mode");return[await yt.web.subtle.importKey("raw",e,{name:`AES-${r.toUpperCase()}`,length:e.length*8},!0,["encrypt","decrypt"]),{name:`aes-${r}`,iv:n,counter:n,length:128}]}async function Qc(t,e,n,r="aes-128-ctr",i=!0){if(ip(e,n,r),yt.web){const[s,o]=await sp(r,e,n),a=await yt.web.subtle.encrypt(o,s,t);let d=new Uint8Array(a);return!i&&o.name==="aes-cbc"&&!(t.length%16)&&(d=d.slice(0,-16)),d}else if(yt.node){const s=yt.node.createCipheriv(r,e,n);return s.setAutoPadding(i),Is(s.update(t),s.final())}else throw new Error("The environment doesn't have AES module")}async function IA(t,e,n,r){const i=t.slice(-16);for(let o=0;o<16;o++)i[o]^=n[o]^16;return(await Qc(i,e,n,r)).slice(0,16)}async function TA(t,e,n,r="aes-128-ctr",i=!0){if(ip(e,n,r),yt.web){const[s,o]=await sp(r,e,n);if(!i&&o.name==="aes-cbc"){const u=await IA(t,e,n,r);t=Is(t,u)}const a=await yt.web.subtle.decrypt(o,s,t),d=new Uint8Array(a);if(o.name==="aes-cbc"){const u=await Qc(d,e,n,r);if(!Rv(u,t))throw new Error("AES: wrong padding")}return d}else if(yt.node){const s=yt.node.createDecipheriv(r,e,n);return s.setAutoPadding(i),Is(s.update(t),s.final())}else throw new Error("The environment doesn't have AES module")}class op extends bc{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,yc(e);const r=mr(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(e){return Rn(this),this.iHash.update(e),this}digestInto(e){Rn(this),Cr(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Vc=(t,e,n)=>new op(t,e).update(n).digest();Vc.create=(t,e)=>new op(t,e);function SA(t,e,n,r){yc(t);const i=dm({dkLen:32,asyncTick:10},r),{c:s,dkLen:o,asyncTick:a}=i;if(qe(s),qe(o),qe(a),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const d=mr(e),u=mr(n),c=new Uint8Array(o),l=Vc.create(t,d),h=l._cloneInto().update(u);return{c:s,dkLen:o,asyncTick:a,DK:c,PRF:l,PRFSalt:h}}function RA(t,e,n,r,i){return t.destroy(),e.destroy(),r&&r.destroy(),i.fill(0),n}function zc(t,e,n,r){const{c:i,dkLen:s,DK:o,PRF:a,PRFSalt:d}=SA(t,e,n,r);let u;const c=new Uint8Array(4),l=ms(c),h=new Uint8Array(a.outputLen);for(let p=1,v=0;v<s;p++,v+=a.outputLen){const m=o.subarray(v,v+a.outputLen);l.setInt32(0,p,!1),(u=d._cloneInto(u)).update(c).digestInto(h),m.set(h.subarray(0,m.length));for(let y=1;y<i;y++){a._cloneInto(u).update(h).digestInto(h);for(let f=0;f<m.length;f++)m[f]^=h[f]}}return RA(a,d,o,u,h)}function kA(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),d=r?4:0,u=r?0:4;t.setUint32(e+d,o,r),t.setUint32(e+u,a,r)}const BA=(t,e,n)=>t&e^~t&n,PA=(t,e,n)=>t&e^t&n^e&n;class CA extends bc{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ms(this.buffer)}update(e){Rn(this);const{view:n,buffer:r,blockLen:i}=this;e=mr(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const d=ms(e);for(;i<=s-o;o+=i)this.process(d,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Rn(this),vc(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(r,0),o=0);for(let l=o;l<i;l++)n[l]=0;kA(r,i-8,BigInt(this.length*8),s),this.process(r,0);const a=ms(e),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=d/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<u;l++)a.setUint32(4*l,c[l],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%n&&e.buffer.set(r),e}}const NA=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Wt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Kt=new Uint32Array(64);class OA extends CA{constructor(){super(64,32,8,!1),this.A=Wt[0]|0,this.B=Wt[1]|0,this.C=Wt[2]|0,this.D=Wt[3]|0,this.E=Wt[4]|0,this.F=Wt[5]|0,this.G=Wt[6]|0,this.H=Wt[7]|0}get(){const{A:e,B:n,C:r,D:i,E:s,F:o,G:a,H:d}=this;return[e,n,r,i,s,o,a,d]}set(e,n,r,i,s,o,a,d){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=d|0}process(e,n){for(let l=0;l<16;l++,n+=4)Kt[l]=e.getUint32(n,!1);for(let l=16;l<64;l++){const h=Kt[l-15],p=Kt[l-2],v=lt(h,7)^lt(h,18)^h>>>3,m=lt(p,17)^lt(p,19)^p>>>10;Kt[l]=m+Kt[l-7]+v+Kt[l-16]|0}let{A:r,B:i,C:s,D:o,E:a,F:d,G:u,H:c}=this;for(let l=0;l<64;l++){const h=lt(a,6)^lt(a,11)^lt(a,25),p=c+h+BA(a,d,u)+NA[l]+Kt[l]|0,m=(lt(r,2)^lt(r,13)^lt(r,22))+PA(r,i,s)|0;c=u,u=d,d=a,a=o+p|0,o=s,s=i,i=r,r=p+m|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,d=d+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,i,s,o,a,d,u,c)}roundClean(){Kt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Io=lm(()=>new OA);function ap(t,e,n,r,i){if(!["sha256","sha512"].includes(i))throw new Error("Only sha256 and sha512 are supported");return Ts(t),Ts(e),zc(Io,t,e,{c:n,dkLen:r})}function Ad(t,e,n,r,i,s){let o=t[e++]^n[r++],a=t[e++]^n[r++],d=t[e++]^n[r++],u=t[e++]^n[r++],c=t[e++]^n[r++],l=t[e++]^n[r++],h=t[e++]^n[r++],p=t[e++]^n[r++],v=t[e++]^n[r++],m=t[e++]^n[r++],y=t[e++]^n[r++],f=t[e++]^n[r++],b=t[e++]^n[r++],w=t[e++]^n[r++],I=t[e++]^n[r++],x=t[e++]^n[r++],k=o,P=a,E=d,G=u,R=c,O=l,L=h,Z=p,ye=v,g=m,_=y,B=f,F=b,U=w,D=I,de=x;for(let Ae=0;Ae<8;Ae+=2)R^=ae(k+F|0,7),ye^=ae(R+k|0,9),F^=ae(ye+R|0,13),k^=ae(F+ye|0,18),g^=ae(O+P|0,7),U^=ae(g+O|0,9),P^=ae(U+g|0,13),O^=ae(P+U|0,18),D^=ae(_+L|0,7),E^=ae(D+_|0,9),L^=ae(E+D|0,13),_^=ae(L+E|0,18),G^=ae(de+B|0,7),Z^=ae(G+de|0,9),B^=ae(Z+G|0,13),de^=ae(B+Z|0,18),P^=ae(k+G|0,7),E^=ae(P+k|0,9),G^=ae(E+P|0,13),k^=ae(G+E|0,18),L^=ae(O+R|0,7),Z^=ae(L+O|0,9),R^=ae(Z+L|0,13),O^=ae(R+Z|0,18),B^=ae(_+g|0,7),ye^=ae(B+_|0,9),g^=ae(ye+B|0,13),_^=ae(g+ye|0,18),F^=ae(de+D|0,7),U^=ae(F+de|0,9),D^=ae(U+F|0,13),de^=ae(D+U|0,18);i[s++]=o+k|0,i[s++]=a+P|0,i[s++]=d+E|0,i[s++]=u+G|0,i[s++]=c+R|0,i[s++]=l+O|0,i[s++]=h+L|0,i[s++]=p+Z|0,i[s++]=v+ye|0,i[s++]=m+g|0,i[s++]=y+_|0,i[s++]=f+B|0,i[s++]=b+F|0,i[s++]=w+U|0,i[s++]=I+D|0,i[s++]=x+de|0}function Yo(t,e,n,r,i){let s=r+0,o=r+16*i;for(let a=0;a<16;a++)n[o+a]=t[e+(2*i-1)*16+a];for(let a=0;a<i;a++,s+=16,e+=16)Ad(n,o,t,e,n,s),a>0&&(o+=16),Ad(n,s,t,e+=16,n,o)}function MA(t,e,n){const r=dm({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:i,r:s,p:o,dkLen:a,asyncTick:d,maxmem:u,onProgress:c}=r;if(qe(i),qe(s),qe(o),qe(a),qe(d),qe(u),c!==void 0&&typeof c!="function")throw new Error("progressCb should be function");const l=128*s,h=l/4;if(i<=1||(i&i-1)!==0||i>=2**(l/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/l)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const p=l*(i+o);if(p>u)throw new Error(`Scrypt: parameters too large, ${p} (128 * r * (N + p)) > ${u} (maxmem)`);const v=zc(Io,t,e,{c:1,dkLen:l*o}),m=hs(v),y=hs(new Uint8Array(l*i)),f=hs(new Uint8Array(l));let b=()=>{};if(c){const w=2*i*o,I=Math.max(Math.floor(w/1e4),1);let x=0;b=()=>{x++,c&&(!(x%I)||x===w)&&c(x/w)}}return{N:i,r:s,p:o,dkLen:a,blockSize32:h,V:y,B32:m,B:v,tmp:f,blockMixCb:b,asyncTick:d}}function LA(t,e,n,r,i){const s=zc(Io,t,n,{c:1,dkLen:e});return n.fill(0),r.fill(0),i.fill(0),s}function FA(t,e,n){const{N:r,r:i,p:s,dkLen:o,blockSize32:a,V:d,B32:u,B:c,tmp:l,blockMixCb:h}=MA(t,e,n);Es||xs(u);for(let p=0;p<s;p++){const v=a*p;for(let m=0;m<a;m++)d[m]=u[v+m];for(let m=0,y=0;m<r-1;m++)Yo(d,y,d,y+=a,i),h();Yo(d,(r-1)*a,u,v,i),h();for(let m=0;m<r;m++){const y=u[v+a-16]%r;for(let f=0;f<a;f++)l[f]=u[v+f]^d[y*a+f];Yo(l,0,u,v,i),h()}}return Es||xs(u),LA(t,o,c,d,l)}function cp(t,e,n,r,i,s,o){return Ts(t),Ts(e),FA(t,e,{N:n,r:i,p:r,dkLen:s,onProgress:o})}const DA=BigInt(1),jA=BigInt(2);function Dn(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function Ji(t){if(!Dn(t))throw new Error("Uint8Array expected")}const HA=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function _r(t){Ji(t);let e="";for(let n=0;n<t.length;n++)e+=HA[t[n]];return e}function Jc(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}const St={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function wd(t){if(t>=St._0&&t<=St._9)return t-St._0;if(t>=St._A&&t<=St._F)return t-(St._A-10);if(t>=St._a&&t<=St._f)return t-(St._a-10)}function Si(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,n=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const o=wd(t.charCodeAt(s)),a=wd(t.charCodeAt(s+1));if(o===void 0||a===void 0){const d=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+d+'" at index '+s)}r[i]=o*16+a}return r}function Sn(t){return Jc(_r(t))}function Wc(t){return Ji(t),Jc(_r(Uint8Array.from(t).reverse()))}function Er(t,e){return Si(t.toString(16).padStart(e*2,"0"))}function Kc(t,e){return Er(t,e).reverse()}function rt(t,e,n){let r;if(typeof e=="string")try{r=Si(e)}catch(s){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${s}`)}else if(Dn(e))r=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(`${t} expected ${n} bytes, got ${i}`);return r}function Ri(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];Ji(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}const Zc=t=>(jA<<BigInt(t-1))-DA,Xo=t=>new Uint8Array(t),_d=t=>Uint8Array.from(t);function up(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Xo(t),i=Xo(t),s=0;const o=()=>{r.fill(1),i.fill(0),s=0},a=(...l)=>n(i,r,...l),d=(l=Xo())=>{i=a(_d([0]),l),r=a(),l.length!==0&&(i=a(_d([1]),l),r=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let l=0;const h=[];for(;l<e;){r=a();const p=r.slice();h.push(p),l+=r.length}return Ri(...h)};return(l,h)=>{o(),d(l);let p;for(;!(p=h(u()));)d();return o(),p}}const UA={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Dn(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Wi(t,e,n={}){const r=(i,s,o)=>{const a=UA[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const d=t[i];if(!(o&&d===void 0)&&!a(d,t))throw new Error(`Invalid param ${String(i)}=${d} (${typeof d}), expected ${s}`)};for(const[i,s]of Object.entries(e))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return t}const GA=Object.freeze(Object.defineProperty({__proto__:null,abytes:Ji,bitMask:Zc,bytesToHex:_r,bytesToNumberBE:Sn,bytesToNumberLE:Wc,concatBytes:Ri,createHmacDrbg:up,ensureBytes:rt,hexToBytes:Si,hexToNumber:Jc,isBytes:Dn,numberToBytesBE:Er,numberToBytesLE:Kc,validateObject:Wi},Symbol.toStringTag,{value:"Module"}));const Te=BigInt(0),we=BigInt(1),An=BigInt(2),qA=BigInt(3),Sa=BigInt(4),Ed=BigInt(5),xd=BigInt(8);BigInt(9);BigInt(16);function Ge(t,e){const n=t%e;return n>=Te?n:e+n}function $A(t,e,n){if(n<=Te||e<Te)throw new Error("Expected power/modulo > 0");if(n===we)return Te;let r=we;for(;e>Te;)e&we&&(r=r*t%n),t=t*t%n,e>>=we;return r}function Ke(t,e,n){let r=t;for(;e-- >Te;)r*=r,r%=n;return r}function Ra(t,e){if(t===Te||e<=Te)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=Ge(t,e),r=e,i=Te,s=we;for(;n!==Te;){const a=r/n,d=r%n,u=i-s*a;r=n,n=d,i=s,s=u}if(r!==we)throw new Error("invert: does not exist");return Ge(i,e)}function QA(t){const e=(t-we)/An;let n,r,i;for(n=t-we,r=0;n%An===Te;n/=An,r++);for(i=An;i<t&&$A(i,e,t)!==t-we;i++);if(r===1){const o=(t+we)/Sa;return function(d,u){const c=d.pow(u,o);if(!d.eql(d.sqr(c),u))throw new Error("Cannot find square root");return c}}const s=(n+we)/An;return function(a,d){if(a.pow(d,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=r,c=a.pow(a.mul(a.ONE,i),n),l=a.pow(d,s),h=a.pow(d,n);for(;!a.eql(h,a.ONE);){if(a.eql(h,a.ZERO))return a.ZERO;let p=1;for(let m=a.sqr(h);p<u&&!a.eql(m,a.ONE);p++)m=a.sqr(m);const v=a.pow(c,we<<BigInt(u-p-1));c=a.sqr(v),l=a.mul(l,v),h=a.mul(h,c),u=p}return l}}function VA(t){if(t%Sa===qA){const e=(t+we)/Sa;return function(r,i){const s=r.pow(i,e);if(!r.eql(r.sqr(s),i))throw new Error("Cannot find square root");return s}}if(t%xd===Ed){const e=(t-Ed)/xd;return function(r,i){const s=r.mul(i,An),o=r.pow(s,e),a=r.mul(i,o),d=r.mul(r.mul(a,An),o),u=r.mul(a,r.sub(d,r.ONE));if(!r.eql(r.sqr(u),i))throw new Error("Cannot find square root");return u}}return QA(t)}const zA=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function JA(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=zA.reduce((r,i)=>(r[i]="function",r),e);return Wi(t,n)}function WA(t,e,n){if(n<Te)throw new Error("Expected power > 0");if(n===Te)return t.ONE;if(n===we)return e;let r=t.ONE,i=e;for(;n>Te;)n&we&&(r=t.mul(r,i)),i=t.sqr(i),n>>=we;return r}function KA(t,e){const n=new Array(e.length),r=e.reduce((s,o,a)=>t.is0(o)?s:(n[a]=s,t.mul(s,o)),t.ONE),i=t.inv(r);return e.reduceRight((s,o,a)=>t.is0(o)?s:(n[a]=t.mul(s,n[a]),t.mul(s,o)),i),n}function dp(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function ZA(t,e,n=!1,r={}){if(t<=Te)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=dp(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=VA(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:Zc(i),ZERO:Te,ONE:we,create:d=>Ge(d,t),isValid:d=>{if(typeof d!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof d}`);return Te<=d&&d<t},is0:d=>d===Te,isOdd:d=>(d&we)===we,neg:d=>Ge(-d,t),eql:(d,u)=>d===u,sqr:d=>Ge(d*d,t),add:(d,u)=>Ge(d+u,t),sub:(d,u)=>Ge(d-u,t),mul:(d,u)=>Ge(d*u,t),pow:(d,u)=>WA(a,d,u),div:(d,u)=>Ge(d*Ra(u,t),t),sqrN:d=>d*d,addN:(d,u)=>d+u,subN:(d,u)=>d-u,mulN:(d,u)=>d*u,inv:d=>Ra(d,t),sqrt:r.sqrt||(d=>o(a,d)),invertBatch:d=>KA(a,d),cmov:(d,u,c)=>c?u:d,toBytes:d=>n?Kc(d,s):Er(d,s),fromBytes:d=>{if(d.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${d.length}`);return n?Wc(d):Sn(d)}});return Object.freeze(a)}function lp(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function fp(t){const e=lp(t);return e+Math.ceil(e/2)}function YA(t,e,n=!1){const r=t.length,i=lp(e),s=fp(e);if(r<16||r<s||r>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${r}`);const o=n?Sn(t):Wc(t),a=Ge(o,e-we)+we;return n?Kc(a,i):Er(a,i)}const XA=BigInt(0),ea=BigInt(1);function ew(t,e){const n=(i,s)=>{const o=s.negate();return i?o:s},r=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:n,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>XA;)s&ea&&(o=o.add(a)),a=a.double(),s>>=ea;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=r(s),d=[];let u=i,c=u;for(let l=0;l<o;l++){c=u,d.push(c);for(let h=1;h<a;h++)c=c.add(u),d.push(c);u=c.double()}return d},wNAF(i,s,o){const{windows:a,windowSize:d}=r(i);let u=t.ZERO,c=t.BASE;const l=BigInt(2**i-1),h=2**i,p=BigInt(i);for(let v=0;v<a;v++){const m=v*d;let y=Number(o&l);o>>=p,y>d&&(y-=h,o+=ea);const f=m,b=m+Math.abs(y)-1,w=v%2!==0,I=y<0;y===0?c=c.add(n(w,s[f])):u=u.add(n(I,s[b]))}return{p:u,f:c}},wNAFCached(i,s,o,a){const d=i._WINDOW_SIZE||1;let u=s.get(i);return u||(u=this.precomputeWindow(i,d),d!==1&&s.set(i,a(u))),this.wNAF(d,u,o)}}}function hp(t){return JA(t.Fp),Wi(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...dp(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}function tw(t){const e=hp(t);Wi(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:nw,hexToBytes:rw}=GA,_n={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=_n;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:nw(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=_n,n=typeof t=="string"?rw(t):t;Ji(n);let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=_n._parseInt(n.subarray(2)),{d:o,l:a}=_n._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const c=u.toString(16);return c.length&1?`0${c}`:c},r=e(n(t.s)),i=e(n(t.r)),s=r.length/2,o=i.length/2,a=n(s),d=n(o);return`30${n(o+s+4)}02${d}${i}02${a}${r}`}},Nt=BigInt(0),Ye=BigInt(1);BigInt(2);const Id=BigInt(3);BigInt(4);function iw(t){const e=tw(t),{Fp:n}=e,r=e.toBytes||((v,m,y)=>{const f=m.toAffine();return Ri(Uint8Array.from([4]),n.toBytes(f.x),n.toBytes(f.y))}),i=e.fromBytes||(v=>{const m=v.subarray(1),y=n.fromBytes(m.subarray(0,n.BYTES)),f=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:y,y:f}});function s(v){const{a:m,b:y}=e,f=n.sqr(v),b=n.mul(f,v);return n.add(n.add(b,n.mul(v,m)),y)}if(!n.eql(n.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(v){return typeof v=="bigint"&&Nt<v&&v<e.n}function a(v){if(!o(v))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function d(v){const{allowedPrivateKeyLengths:m,nByteLength:y,wrapPrivateKey:f,n:b}=e;if(m&&typeof v!="bigint"){if(Dn(v)&&(v=_r(v)),typeof v!="string"||!m.includes(v.length))throw new Error("Invalid key");v=v.padStart(y*2,"0")}let w;try{w=typeof v=="bigint"?v:Sn(rt("private key",v,y))}catch{throw new Error(`private key must be ${y} bytes, hex or bigint, not ${typeof v}`)}return f&&(w=Ge(w,b)),a(w),w}const u=new Map;function c(v){if(!(v instanceof l))throw new Error("ProjectivePoint expected")}class l{constructor(m,y,f){if(this.px=m,this.py=y,this.pz=f,m==null||!n.isValid(m))throw new Error("x required");if(y==null||!n.isValid(y))throw new Error("y required");if(f==null||!n.isValid(f))throw new Error("z required")}static fromAffine(m){const{x:y,y:f}=m||{};if(!m||!n.isValid(y)||!n.isValid(f))throw new Error("invalid affine point");if(m instanceof l)throw new Error("projective point not allowed");const b=w=>n.eql(w,n.ZERO);return b(y)&&b(f)?l.ZERO:new l(y,f,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const y=n.invertBatch(m.map(f=>f.pz));return m.map((f,b)=>f.toAffine(y[b])).map(l.fromAffine)}static fromHex(m){const y=l.fromAffine(i(rt("pointHex",m)));return y.assertValidity(),y}static fromPrivateKey(m){return l.BASE.multiply(d(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y}=this.toAffine();if(!n.isValid(m)||!n.isValid(y))throw new Error("bad point: x or y not FE");const f=n.sqr(y),b=s(m);if(!n.eql(f,b))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){c(m);const{px:y,py:f,pz:b}=this,{px:w,py:I,pz:x}=m,k=n.eql(n.mul(y,x),n.mul(w,b)),P=n.eql(n.mul(f,x),n.mul(I,b));return k&&P}negate(){return new l(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:y}=e,f=n.mul(y,Id),{px:b,py:w,pz:I}=this;let x=n.ZERO,k=n.ZERO,P=n.ZERO,E=n.mul(b,b),G=n.mul(w,w),R=n.mul(I,I),O=n.mul(b,w);return O=n.add(O,O),P=n.mul(b,I),P=n.add(P,P),x=n.mul(m,P),k=n.mul(f,R),k=n.add(x,k),x=n.sub(G,k),k=n.add(G,k),k=n.mul(x,k),x=n.mul(O,x),P=n.mul(f,P),R=n.mul(m,R),O=n.sub(E,R),O=n.mul(m,O),O=n.add(O,P),P=n.add(E,E),E=n.add(P,E),E=n.add(E,R),E=n.mul(E,O),k=n.add(k,E),R=n.mul(w,I),R=n.add(R,R),E=n.mul(R,O),x=n.sub(x,E),P=n.mul(R,G),P=n.add(P,P),P=n.add(P,P),new l(x,k,P)}add(m){c(m);const{px:y,py:f,pz:b}=this,{px:w,py:I,pz:x}=m;let k=n.ZERO,P=n.ZERO,E=n.ZERO;const G=e.a,R=n.mul(e.b,Id);let O=n.mul(y,w),L=n.mul(f,I),Z=n.mul(b,x),ye=n.add(y,f),g=n.add(w,I);ye=n.mul(ye,g),g=n.add(O,L),ye=n.sub(ye,g),g=n.add(y,b);let _=n.add(w,x);return g=n.mul(g,_),_=n.add(O,Z),g=n.sub(g,_),_=n.add(f,b),k=n.add(I,x),_=n.mul(_,k),k=n.add(L,Z),_=n.sub(_,k),E=n.mul(G,g),k=n.mul(R,Z),E=n.add(k,E),k=n.sub(L,E),E=n.add(L,E),P=n.mul(k,E),L=n.add(O,O),L=n.add(L,O),Z=n.mul(G,Z),g=n.mul(R,g),L=n.add(L,Z),Z=n.sub(O,Z),Z=n.mul(G,Z),g=n.add(g,Z),O=n.mul(L,g),P=n.add(P,O),O=n.mul(_,g),k=n.mul(ye,k),k=n.sub(k,O),O=n.mul(ye,L),E=n.mul(_,E),E=n.add(E,O),new l(k,P,E)}subtract(m){return this.add(m.negate())}is0(){return this.equals(l.ZERO)}wNAF(m){return p.wNAFCached(this,u,m,y=>{const f=n.invertBatch(y.map(b=>b.pz));return y.map((b,w)=>b.toAffine(f[w])).map(l.fromAffine)})}multiplyUnsafe(m){const y=l.ZERO;if(m===Nt)return y;if(a(m),m===Ye)return this;const{endo:f}=e;if(!f)return p.unsafeLadder(this,m);let{k1neg:b,k1:w,k2neg:I,k2:x}=f.splitScalar(m),k=y,P=y,E=this;for(;w>Nt||x>Nt;)w&Ye&&(k=k.add(E)),x&Ye&&(P=P.add(E)),E=E.double(),w>>=Ye,x>>=Ye;return b&&(k=k.negate()),I&&(P=P.negate()),P=new l(n.mul(P.px,f.beta),P.py,P.pz),k.add(P)}multiply(m){a(m);let y=m,f,b;const{endo:w}=e;if(w){const{k1neg:I,k1:x,k2neg:k,k2:P}=w.splitScalar(y);let{p:E,f:G}=this.wNAF(x),{p:R,f:O}=this.wNAF(P);E=p.constTimeNegate(I,E),R=p.constTimeNegate(k,R),R=new l(n.mul(R.px,w.beta),R.py,R.pz),f=E.add(R),b=G.add(O)}else{const{p:I,f:x}=this.wNAF(y);f=I,b=x}return l.normalizeZ([f,b])[0]}multiplyAndAddUnsafe(m,y,f){const b=l.BASE,w=(x,k)=>k===Nt||k===Ye||!x.equals(b)?x.multiplyUnsafe(k):x.multiply(k),I=w(this,y).add(w(m,f));return I.is0()?void 0:I}toAffine(m){const{px:y,py:f,pz:b}=this,w=this.is0();m==null&&(m=w?n.ONE:n.inv(b));const I=n.mul(y,m),x=n.mul(f,m),k=n.mul(b,m);if(w)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:I,y:x}}isTorsionFree(){const{h:m,isTorsionFree:y}=e;if(m===Ye)return!0;if(y)return y(l,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:y}=e;return m===Ye?this:y?y(l,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),r(l,this,m)}toHex(m=!0){return _r(this.toRawBytes(m))}}l.BASE=new l(e.Gx,e.Gy,n.ONE),l.ZERO=new l(n.ZERO,n.ONE,n.ZERO);const h=e.nBitLength,p=ew(l,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:l,normPrivateKeyToScalar:d,weierstrassEquation:s,isWithinCurveOrder:o}}function sw(t){const e=hp(t);return Wi(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function ow(t){const e=sw(t),{Fp:n,n:r}=e,i=n.BYTES+1,s=2*n.BYTES+1;function o(g){return Nt<g&&g<n.ORDER}function a(g){return Ge(g,r)}function d(g){return Ra(g,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:l,isWithinCurveOrder:h}=iw({...e,toBytes(g,_,B){const F=_.toAffine(),U=n.toBytes(F.x),D=Ri;return B?D(Uint8Array.from([_.hasEvenY()?2:3]),U):D(Uint8Array.from([4]),U,n.toBytes(F.y))},fromBytes(g){const _=g.length,B=g[0],F=g.subarray(1);if(_===i&&(B===2||B===3)){const U=Sn(F);if(!o(U))throw new Error("Point is not on curve");const D=l(U);let de;try{de=n.sqrt(D)}catch(ce){const Be=ce instanceof Error?": "+ce.message:"";throw new Error("Point is not on curve"+Be)}const Ae=(de&Ye)===Ye;return(B&1)===1!==Ae&&(de=n.neg(de)),{x:U,y:de}}else if(_===s&&B===4){const U=n.fromBytes(F.subarray(0,n.BYTES)),D=n.fromBytes(F.subarray(n.BYTES,2*n.BYTES));return{x:U,y:D}}else throw new Error(`Point of length ${_} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),p=g=>_r(Er(g,e.nByteLength));function v(g){const _=r>>Ye;return g>_}function m(g){return v(g)?a(-g):g}const y=(g,_,B)=>Sn(g.slice(_,B));class f{constructor(_,B,F){this.r=_,this.s=B,this.recovery=F,this.assertValidity()}static fromCompact(_){const B=e.nByteLength;return _=rt("compactSignature",_,B*2),new f(y(_,0,B),y(_,B,2*B))}static fromDER(_){const{r:B,s:F}=_n.toSig(rt("DER",_));return new f(B,F)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(_){return new f(this.r,this.s,_)}recoverPublicKey(_){const{r:B,s:F,recovery:U}=this,D=P(rt("msgHash",_));if(U==null||![0,1,2,3].includes(U))throw new Error("recovery id invalid");const de=U===2||U===3?B+e.n:B;if(de>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const Ae=(U&1)===0?"02":"03",tt=u.fromHex(Ae+p(de)),ce=d(de),Be=a(-D*ce),Mr=a(F*ce),Jt=u.BASE.multiplyAndAddUnsafe(tt,Be,Mr);if(!Jt)throw new Error("point at infinify");return Jt.assertValidity(),Jt}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new f(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Si(this.toDERHex())}toDERHex(){return _n.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Si(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}const b={isValidPrivateKey(g){try{return c(g),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const g=fp(e.n);return YA(e.randomBytes(g),e.n)},precompute(g=8,_=u.BASE){return _._setWindowSize(g),_.multiply(BigInt(3)),_}};function w(g,_=!0){return u.fromPrivateKey(g).toRawBytes(_)}function I(g){const _=Dn(g),B=typeof g=="string",F=(_||B)&&g.length;return _?F===i||F===s:B?F===2*i||F===2*s:g instanceof u}function x(g,_,B=!0){if(I(g))throw new Error("first arg must be private key");if(!I(_))throw new Error("second arg must be public key");return u.fromHex(_).multiply(c(g)).toRawBytes(B)}const k=e.bits2int||function(g){const _=Sn(g),B=g.length*8-e.nBitLength;return B>0?_>>BigInt(B):_},P=e.bits2int_modN||function(g){return a(k(g))},E=Zc(e.nBitLength);function G(g){if(typeof g!="bigint")throw new Error("bigint expected");if(!(Nt<=g&&g<E))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Er(g,e.nByteLength)}function R(g,_,B=O){if(["recovered","canonical"].some(pn=>pn in B))throw new Error("sign() legacy options not supported");const{hash:F,randomBytes:U}=e;let{lowS:D,prehash:de,extraEntropy:Ae}=B;D==null&&(D=!0),g=rt("msgHash",g),de&&(g=rt("prehashed msgHash",F(g)));const tt=P(g),ce=c(_),Be=[G(ce),G(tt)];if(Ae!=null&&Ae!==!1){const pn=Ae===!0?U(n.BYTES):Ae;Be.push(rt("extraEntropy",pn))}const Mr=Ri(...Be),Jt=tt;function $o(pn){const Wn=k(pn);if(!h(Wn))return;const Ku=d(Wn),dt=u.BASE.multiply(Wn).toAffine(),Kn=a(dt.x);if(Kn===Nt)return;const os=a(Ku*a(Jt+Kn*ce));if(os===Nt)return;let Zu=(dt.x===Kn?0:2)|Number(dt.y&Ye),Yu=os;return D&&v(os)&&(Yu=m(os),Zu^=1),new f(Kn,Yu,Zu)}return{seed:Mr,k2sig:$o}}const O={lowS:e.lowS,prehash:!1},L={lowS:e.lowS,prehash:!1};function Z(g,_,B=O){const{seed:F,k2sig:U}=R(g,_,B),D=e;return up(D.hash.outputLen,D.nByteLength,D.hmac)(F,U)}u.BASE._setWindowSize(8);function ye(g,_,B,F=L){const U=g;if(_=rt("msgHash",_),B=rt("publicKey",B),"strict"in F)throw new Error("options.strict was renamed to lowS");const{lowS:D,prehash:de}=F;let Ae,tt;try{if(typeof U=="string"||Dn(U))try{Ae=f.fromDER(U)}catch(dt){if(!(dt instanceof _n.Err))throw dt;Ae=f.fromCompact(U)}else if(typeof U=="object"&&typeof U.r=="bigint"&&typeof U.s=="bigint"){const{r:dt,s:Kn}=U;Ae=new f(dt,Kn)}else throw new Error("PARSE");tt=u.fromHex(B)}catch(dt){if(dt.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(D&&Ae.hasHighS())return!1;de&&(_=e.hash(_));const{r:ce,s:Be}=Ae,Mr=P(_),Jt=d(Be),$o=a(Mr*Jt),pn=a(ce*Jt),Wn=u.BASE.multiplyAndAddUnsafe(tt,$o,pn)?.toAffine();return Wn?a(Wn.x)===ce:!1}return{CURVE:e,getPublicKey:w,getSharedSecret:x,sign:Z,verify:ye,ProjectivePoint:u,Signature:f,utils:b}}function aw(t){return{hash:t,hmac:(e,...n)=>Vc(t,e,Is(...n)),randomBytes:fm}}function cw(t,e){const n=r=>ow({...t,...aw(r)});return Object.freeze({...n(e),create:n})}const mp=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Td=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),uw=BigInt(1),ka=BigInt(2),Sd=(t,e)=>(t+e/ka)/e;function dw(t){const e=mp,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),d=BigInt(88),u=t*t*t%e,c=u*u*t%e,l=Ke(c,n,e)*c%e,h=Ke(l,n,e)*c%e,p=Ke(h,ka,e)*u%e,v=Ke(p,i,e)*p%e,m=Ke(v,s,e)*v%e,y=Ke(m,a,e)*m%e,f=Ke(y,d,e)*y%e,b=Ke(f,a,e)*m%e,w=Ke(b,n,e)*c%e,I=Ke(w,o,e)*v%e,x=Ke(I,r,e)*u%e,k=Ke(x,ka,e);if(!Ba.eql(Ba.sqr(k),t))throw new Error("Cannot find square root");return k}const Ba=ZA(mp,void 0,void 0,{sqrt:dw}),Yc=cw({a:BigInt(0),b:BigInt(7),Fp:Ba,n:Td,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=Td,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-uw*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,o=BigInt("0x100000000000000000000000000000000"),a=Sd(s*t,e),d=Sd(-r*t,e);let u=Ge(t-a*n-d*i,e),c=Ge(-a*r-d*s,e);const l=u>o,h=c>o;if(l&&(u=e-u),h&&(c=e-c),u>o||c>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:l,k1:u,k2neg:h,k2:c}}}},Io);BigInt(0);Yc.ProjectivePoint;const lw=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Yc},Symbol.toStringTag,{value:"Module"}));var ta;const Qt=(ta=Yc)!==null&&ta!==void 0?ta:lw,Rd=BigInt("0xffffffffffffffff"),ki=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),fw=Qt.CURVE.n,hw=fw/BigInt(2),pp={type:"object",required:["crypto","id","version","address"],properties:{crypto:{type:"object",required:["cipher","ciphertext","cipherparams","kdf","kdfparams","mac"],properties:{cipher:{type:"string"},ciphertext:{type:"string"},cipherparams:{type:"object"},kdf:{type:"string"},kdfparams:{type:"object"},salt:{type:"string"},mac:{type:"string"}}},id:{type:"string"},version:{type:"number"},address:{type:"string"}}};var Bi;(function(t){t[t.Mainnet=1]="Mainnet",t[t.Goerli=5]="Goerli",t[t.Sepolia=11155111]="Sepolia"})(Bi||(Bi={}));var le;(function(t){t.Chainstart="chainstart",t.Homestead="homestead",t.Dao="dao",t.TangerineWhistle="tangerineWhistle",t.SpuriousDragon="spuriousDragon",t.Byzantium="byzantium",t.Constantinople="constantinople",t.Petersburg="petersburg",t.Istanbul="istanbul",t.MuirGlacier="muirGlacier",t.Berlin="berlin",t.London="london",t.ArrowGlacier="arrowGlacier",t.GrayGlacier="grayGlacier",t.MergeForkIdTransition="mergeForkIdTransition",t.Merge="merge",t.Shanghai="shanghai",t.ShardingForkDev="shardingFork"})(le||(le={}));var Pa;(function(t){t.ProofOfStake="pos",t.ProofOfWork="pow",t.ProofOfAuthority="poa"})(Pa||(Pa={}));var Ca;(function(t){t.Ethash="ethash",t.Clique="clique",t.Casper="casper"})(Ca||(Ca={}));var Re;(function(t){t.PolygonMainnet="polygon-mainnet",t.PolygonMumbai="polygon-mumbai",t.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",t.ArbitrumOne="arbitrum-one",t.xDaiChain="x-dai-chain",t.OptimisticKovan="optimistic-kovan",t.OptimisticEthereum="optimistic-ethereum"})(Re||(Re={}));var ze;(function(t){t[t.Number=0]="Number",t[t.BigInt=1]="BigInt",t[t.Uint8Array=2]="Uint8Array",t[t.PrefixedHexString=3]="PrefixedHexString"})(ze||(ze={}));const Xc=t=>{if(typeof t!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof t}`);return fo(t)?t.slice(2):t};function mw(t){return!t||t==="0x0"?"0x0000000000000000":fo(t)?`0x${Xc(t).padStart(16,"0")}`:`0x${t.padStart(16,"0")}`}const gp=function(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Received an invalid integer type: ${t}`);return`0x${t.toString(16)}`};function pw(t,e=!0){var n,r;const{name:i,config:s,difficulty:o,mixHash:a,gasLimit:d,coinbase:u,baseFeePerGas:c}=t;let{extraData:l,timestamp:h,nonce:p}=t;const v=Number(h),{chainId:m}=s;if(l===""&&(l="0x"),fo(h)||(h=gp(parseInt(h))),p.length!==18&&(p=mw(p)),s.eip155Block!==s.eip158Block)throw new Error("EIP155 block number must equal EIP 158 block number since both are part of SpuriousDragon hardfork and the client only supports activating the full hardfork");const y={name:i,chainId:m,networkId:m,genesis:{timestamp:h,gasLimit:parseInt(d),difficulty:parseInt(o),nonce:p,extraData:l,mixHash:a,coinbase:u,baseFeePerGas:c},hardfork:void 0,hardforks:[],bootstrapNodes:[],consensus:s.clique!==void 0?{type:"poa",algorithm:"clique",clique:{period:(n=s.clique.period)!==null&&n!==void 0?n:s.clique.blockperiodseconds,epoch:(r=s.clique.epoch)!==null&&r!==void 0?r:s.clique.epochlength}}:{type:"pow",algorithm:"ethash",ethash:{}}},f={[le.Homestead]:{name:"homesteadBlock"},[le.Dao]:{name:"daoForkBlock"},[le.TangerineWhistle]:{name:"eip150Block"},[le.SpuriousDragon]:{name:"eip155Block"},[le.Byzantium]:{name:"byzantiumBlock"},[le.Constantinople]:{name:"constantinopleBlock"},[le.Petersburg]:{name:"petersburgBlock"},[le.Istanbul]:{name:"istanbulBlock"},[le.MuirGlacier]:{name:"muirGlacierBlock"},[le.Berlin]:{name:"berlinBlock"},[le.London]:{name:"londonBlock"},[le.MergeForkIdTransition]:{name:"mergeForkBlock",postMerge:e},[le.Shanghai]:{name:"shanghaiTime",postMerge:!0,isTimestamp:!0},[le.ShardingForkDev]:{name:"shardingForkTime",postMerge:!0,isTimestamp:!0}},b=Object.keys(f).reduce((x,k)=>(x[f[k].name]=k,x),{}),w=Object.keys(s).filter(x=>b[x]!==void 0&&s[x]!==void 0&&s[x]!==null);if(y.hardforks=w.map(x=>({name:b[x],block:f[b[x]].isTimestamp===!0||typeof s[x]!="number"?null:s[x],timestamp:f[b[x]].isTimestamp===!0&&typeof s[x]=="number"?s[x]:void 0})).filter(x=>x.block!==null||x.timestamp!==void 0),y.hardforks.sort((x,k)=>{var P,E;return((P=x.block)!==null&&P!==void 0?P:1/0)-((E=k.block)!==null&&E!==void 0?E:1/0)}),y.hardforks.sort((x,k)=>{var P,E;return((P=x.timestamp)!==null&&P!==void 0?P:v)-((E=k.timestamp)!==null&&E!==void 0?E:v)}),s.terminalTotalDifficulty!==void 0){const x={name:le.Merge,ttd:s.terminalTotalDifficulty,block:null},k=y.hardforks.findIndex(P=>{var E;return((E=f[P.name])===null||E===void 0?void 0:E.postMerge)===!0});k!==-1?y.hardforks.splice(k,0,x):y.hardforks.push(x)}const I=y.hardforks.length>0?y.hardforks.slice(-1)[0]:void 0;return y.hardfork=I?.name,y.hardforks.unshift({name:le.Chainstart,block:0}),y}function yp(t,e,n){try{if(["config","difficulty","gasLimit","alloc"].some(r=>!(r in t)))throw new Error("Invalid format, expected geth genesis fields missing");return e!==void 0&&(t.name=e),pw(t,n)}catch(r){throw new Error(`Error parsing parameters file: ${r.message}`)}}function eu(t){let e=t;if(typeof e!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof e}`);return e.length%2&&(e=`0${e}`),e}const vp=function(t){const e=gp(t);return fe(`0x${eu(e.slice(2))}`)},pe=function(t){var e;if(t==null)return new Uint8Array;if(t instanceof Uint8Array)return t;if(((e=t?.constructor)===null||e===void 0?void 0:e.name)==="Uint8Array"||Array.isArray(t))return Uint8Array.from(t);if(typeof t=="string"){if(!Nn(t))throw new Error(`Cannot convert string to Uint8Array. only supports 0x-prefixed hex strings and this string was given: ${t}`);return fe(eu(Xc(t)))}if(typeof t=="number")return pe(he(t));if(typeof t=="bigint"){if(t<BigInt(0))throw new Error(`Cannot convert negative bigint to Uint8Array. Given: ${t}`);let n=t.toString(16);return n.length%2&&(n=`0${n}`),pe(`0x${n}`)}if(t.toArray)return Uint8Array.from(t.toArray());throw new Error("invalid type")};function ue(t){const e=ne(t);return BigInt(e==="0x"?0:e)}function bp(t){return pe(`0x${t.toString(16)}`)}const tu=function(t){return new Uint8Array(t).fill(0)},gw=function(t,e,n){const r=tu(e);return t.length<e?(r.set(t,e-t.length),r):t.subarray(-e)};function To(t){if(!qt(t)){const e=`This method only supports Uint8Array but input was: ${t}`;throw new Error(e)}}const Na=function(t,e){return To(t),gw(t,e)};function Ap(t){let e=t[0];for(;t.length>0&&e.toString()==="0";)t=t.slice(1),e=t[0];return t}const Pi=function(t){return To(t),Ap(t)},ge=t=>`0x${t.toString(16)}`;function re(t){return Pi(bp(t))}function yw(t,e){return t===BigInt(0)||t===BigInt(1)?t:e===void 0?t-BigInt(27):t-(e*BigInt(2)+BigInt(35))}function vw(t){return t===BigInt(0)||t===BigInt(1)}const So=function(t,e,n,r,i){const s=yw(e,i);if(!vw(s))throw new Error("Invalid signature v value");return new Qt.Signature(ue(n),ue(r)).addRecoveryBit(Number(s)).recoverPublicKey(t).toRawBytes(!1).slice(1)};function vn(t,e){if(t===null)return null;if(t===void 0)return;if(typeof t=="string"&&!Nn(t))throw new Error(`A string must be provided with a 0x-prefix, given: ${t}`);if(typeof t=="number"&&!Number.isSafeInteger(t))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const n=pe(t);switch(e){case ze.Uint8Array:return n;case ze.BigInt:return ue(n);case ze.Number:{const r=ue(n);if(r>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(r)}case ze.PrefixedHexString:return ne(n);default:throw new Error("unknown outputType")}}var nt={},kd;function bw(){if(kd)return nt;kd=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.RLP=nt.utils=nt.decode=nt.encode=void 0;function t(f){if(Array.isArray(f)){const w=[];let I=0;for(let x=0;x<f.length;x++){const k=t(f[x]);w.push(k),I+=k.length}return c(r(I,192),...w)}const b=y(f);return b.length===1&&b[0]<128?b:c(r(b.length,128),b)}nt.encode=t;function e(f,b,w){if(w>f.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return f.slice(b,w)}function n(f){if(f[0]===0)throw new Error("invalid RLP: extra zeros");return d(a(f))}function r(f,b){if(f<56)return Uint8Array.from([f+b]);const w=h(f),I=w.length/2,x=h(b+55+I);return Uint8Array.from(u(x+w))}function i(f,b=!1){if(typeof f>"u"||f===null||f.length===0)return Uint8Array.from([]);const w=y(f),I=s(w);if(b)return I;if(I.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return I.data}nt.decode=i;function s(f){let b,w,I,x,k;const P=[],E=f[0];if(E<=127)return{data:f.slice(0,1),remainder:f.slice(1)};if(E<=183){if(b=E-127,E===128?I=Uint8Array.from([]):I=e(f,1,b),b===2&&I[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:I,remainder:f.slice(b)}}else if(E<=191){if(w=E-182,f.length-1<w)throw new Error("invalid RLP: not enough bytes for string length");if(b=n(e(f,1,w)),b<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return I=e(f,w,b+w),{data:I,remainder:f.slice(b+w)}}else if(E<=247){for(b=E-191,x=e(f,1,b);x.length;)k=s(x),P.push(k.data),x=k.remainder;return{data:P,remainder:f.slice(b)}}else{if(w=E-246,b=n(e(f,1,w)),b<56)throw new Error("invalid RLP: encoded list too short");const G=w+b;if(G>f.length)throw new Error("invalid RLP: total length is larger than the data");for(x=e(f,w,G);x.length;)k=s(x),P.push(k.data),x=k.remainder;return{data:P,remainder:f.slice(G)}}}const o=Array.from({length:256},(f,b)=>b.toString(16).padStart(2,"0"));function a(f){let b="";for(let w=0;w<f.length;w++)b+=o[f[w]];return b}function d(f){const b=Number.parseInt(f,16);if(Number.isNaN(b))throw new Error("Invalid byte sequence");return b}function u(f){if(typeof f!="string")throw new TypeError("hexToBytes: expected string, got "+typeof f);if(f.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const b=new Uint8Array(f.length/2);for(let w=0;w<b.length;w++){const I=w*2;b[w]=d(f.slice(I,I+2))}return b}function c(...f){if(f.length===1)return f[0];const b=f.reduce((I,x)=>I+x.length,0),w=new Uint8Array(b);for(let I=0,x=0;I<f.length;I++){const k=f[I];w.set(k,x),x+=k.length}return w}function l(f){return new TextEncoder().encode(f)}function h(f){if(f<0)throw new Error("Invalid integer as argument, must be unsigned!");const b=f.toString(16);return b.length%2?`0${b}`:b}function p(f){return f.length%2?`0${f}`:f}function v(f){return f.length>=2&&f[0]==="0"&&f[1]==="x"}function m(f){return typeof f!="string"?f:v(f)?f.slice(2):f}function y(f){if(f instanceof Uint8Array)return f;if(typeof f=="string")return v(f)?u(p(m(f))):l(f);if(typeof f=="number"||typeof f=="bigint")return f?u(h(f)):Uint8Array.from([]);if(f==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof f)}return nt.utils={bytesToHex:a,concatBytes:c,hexToBytes:u,utf8ToBytes:l},nt.RLP={encode:t,decode:i},nt}var Xe=bw(),na={};var Bd;function Aw(){return Bd||(Bd=1,(function(t){(function(e){e(typeof DO_NOT_EXPORT_CRC>"u"?t:{})})(function(e){e.version="1.2.2";function n(){for(var E=0,G=new Array(256),R=0;R!=256;++R)E=R,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,G[R]=E;return typeof Int32Array<"u"?new Int32Array(G):G}var r=n();function i(E){var G=0,R=0,O=0,L=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(O=0;O!=256;++O)L[O]=E[O];for(O=0;O!=256;++O)for(R=E[O],G=256+O;G<4096;G+=256)R=L[G]=R>>>8^E[R&255];var Z=[];for(O=1;O!=16;++O)Z[O-1]=typeof Int32Array<"u"?L.subarray(O*256,O*256+256):L.slice(O*256,O*256+256);return Z}var s=i(r),o=s[0],a=s[1],d=s[2],u=s[3],c=s[4],l=s[5],h=s[6],p=s[7],v=s[8],m=s[9],y=s[10],f=s[11],b=s[12],w=s[13],I=s[14];function x(E,G){for(var R=G^-1,O=0,L=E.length;O<L;)R=R>>>8^r[(R^E.charCodeAt(O++))&255];return~R}function k(E,G){for(var R=G^-1,O=E.length-15,L=0;L<O;)R=I[E[L++]^R&255]^w[E[L++]^R>>8&255]^b[E[L++]^R>>16&255]^f[E[L++]^R>>>24]^y[E[L++]]^m[E[L++]]^v[E[L++]]^p[E[L++]]^h[E[L++]]^l[E[L++]]^c[E[L++]]^u[E[L++]]^d[E[L++]]^a[E[L++]]^o[E[L++]]^r[E[L++]];for(O+=15;L<O;)R=R>>>8^r[(R^E[L++])&255];return~R}function P(E,G){for(var R=G^-1,O=0,L=E.length,Z=0,ye=0;O<L;)Z=E.charCodeAt(O++),Z<128?R=R>>>8^r[(R^Z)&255]:Z<2048?(R=R>>>8^r[(R^(192|Z>>6&31))&255],R=R>>>8^r[(R^(128|Z&63))&255]):Z>=55296&&Z<57344?(Z=(Z&1023)+64,ye=E.charCodeAt(O++)&1023,R=R>>>8^r[(R^(240|Z>>8&7))&255],R=R>>>8^r[(R^(128|Z>>2&63))&255],R=R>>>8^r[(R^(128|ye>>6&15|(Z&3)<<4))&255],R=R>>>8^r[(R^(128|ye&63))&255]):(R=R>>>8^r[(R^(224|Z>>12&15))&255],R=R>>>8^r[(R^(128|Z>>6&63))&255],R=R>>>8^r[(R^(128|Z&63))&255]);return~R}e.table=r,e.bstr=x,e.buf=k,e.str=P})})(na)),na}var ww=Aw();const _w=nc(ww),Ew={name:"goerli",chainId:5,networkId:5,defaultHardfork:"merge",consensus:{type:"poa",algorithm:"clique",clique:{period:15,epoch:3e4}},comment:"Cross-client PoA test network",url:"https://github.com/goerli/testnet",genesis:{timestamp:"0x5c51a607",gasLimit:10485760,difficulty:1,nonce:"0x0000000000000000",extraData:"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},hardforks:[{name:"chainstart",block:0,forkHash:"0xa3f5ab08"},{name:"homestead",block:0,forkHash:"0xa3f5ab08"},{name:"tangerineWhistle",block:0,forkHash:"0xa3f5ab08"},{name:"spuriousDragon",block:0,forkHash:"0xa3f5ab08"},{name:"byzantium",block:0,forkHash:"0xa3f5ab08"},{name:"constantinople",block:0,forkHash:"0xa3f5ab08"},{name:"petersburg",block:0,forkHash:"0xa3f5ab08"},{name:"istanbul",block:1561651,forkHash:"0xc25efa5c"},{name:"berlin",block:4460644,forkHash:"0x757a1c47"},{name:"london",block:5062605,forkHash:"0xb8c6299d"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://goerli.etherscan.io/block/7382818",name:"merge",ttd:"10790000",block:7382819,forkHash:"0xb8c6299d"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]},xw={name:"mainnet",chainId:1,networkId:1,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"The Ethereum main chain",url:"https://ethstats.net/",genesis:{gasLimit:5e3,difficulty:17179869184,nonce:"0x0000000000000042",extraData:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfc64ec04"},{name:"homestead",block:115e4,forkHash:"0x97c2c34c"},{name:"dao",block:192e4,forkHash:"0x91d1f948"},{name:"tangerineWhistle",block:2463e3,forkHash:"0x7a64da13"},{name:"spuriousDragon",block:2675e3,forkHash:"0x3edd5b10"},{name:"byzantium",block:437e4,forkHash:"0xa00bc324"},{name:"constantinople",block:728e4,forkHash:"0x668db0af"},{name:"petersburg",block:728e4,forkHash:"0x668db0af"},{name:"istanbul",block:9069e3,forkHash:"0x879d6e30"},{name:"muirGlacier",block:92e5,forkHash:"0xe029e991"},{name:"berlin",block:12244e3,forkHash:"0x0eb440f6"},{name:"london",block:12965e3,forkHash:"0xb715077d"},{name:"arrowGlacier",block:13773e3,forkHash:"0x20c327fc"},{name:"grayGlacier",block:1505e4,forkHash:"0xf0afd0e3"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://etherscan.io/block/15537393",name:"merge",ttd:"58750000000000000000000",block:15537394,forkHash:"0xf0afd0e3"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]},Iw={name:"sepolia",chainId:11155111,networkId:11155111,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"PoW test network to replace Ropsten",url:"https://github.com/ethereum/go-ethereum/pull/23730",genesis:{timestamp:"0x6159af19",gasLimit:3e7,difficulty:131072,nonce:"0x0000000000000000",extraData:"0x5365706f6c69612c20417468656e732c204174746963612c2047726565636521"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfe3366e7"},{name:"homestead",block:0,forkHash:"0xfe3366e7"},{name:"tangerineWhistle",block:0,forkHash:"0xfe3366e7"},{name:"spuriousDragon",block:0,forkHash:"0xfe3366e7"},{name:"byzantium",block:0,forkHash:"0xfe3366e7"},{name:"constantinople",block:0,forkHash:"0xfe3366e7"},{name:"petersburg",block:0,forkHash:"0xfe3366e7"},{name:"istanbul",block:0,forkHash:"0xfe3366e7"},{name:"muirGlacier",block:0,forkHash:"0xfe3366e7"},{name:"berlin",block:0,forkHash:"0xfe3366e7"},{name:"london",block:0,forkHash:"0xfe3366e7"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://sepolia.etherscan.io/block/1450408",name:"merge",ttd:"17000000000000000",block:1450409,forkHash:"0xfe3366e7"},{name:"mergeForkIdTransition",block:1735371,forkHash:"0xb96cbd13"},{name:"shanghai",block:null,timestamp:"1677557088",forkHash:"0xf7f9bc08"}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net"]},Tw={name:"EIP-1153",number:1153,comment:"Transient Storage",url:"https://eips.ethereum.org/EIPS/eip-1153",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{tstore:{v:100,d:"Base fee of the TSTORE opcode"},tload:{v:100,d:"Base fee of the TLOAD opcode"}},vm:{},pow:{}},Sw={name:"EIP-1559",number:1559,comment:"Fee market change for ETH 1.0 chain",url:"https://eips.ethereum.org/EIPS/eip-1559",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2930],gasConfig:{baseFeeMaxChangeDenominator:{v:8,d:"Maximum base fee change denominator"},elasticityMultiplier:{v:2,d:"Maximum block gas target elasticity"},initialBaseFee:{v:1e9,d:"Initial base fee on first EIP1559 block"}},gasPrices:{},vm:{},pow:{}},Rw={name:"EIP-2315",number:2315,comment:"Simple subroutines for the EVM",url:"https://eips.ethereum.org/EIPS/eip-2315",status:"Draft",minimumHardfork:"istanbul",gasConfig:{},gasPrices:{beginsub:{v:2,d:"Base fee of the BEGINSUB opcode"},returnsub:{v:5,d:"Base fee of the RETURNSUB opcode"},jumpsub:{v:10,d:"Base fee of the JUMPSUB opcode"}},vm:{},pow:{}},kw={name:"EIP-2537",number:2537,comment:"BLS12-381 precompiles",url:"https://eips.ethereum.org/EIPS/eip-2537",status:"Draft",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{Bls12381G1AddGas:{v:600,d:"Gas cost of a single BLS12-381 G1 addition precompile-call"},Bls12381G1MulGas:{v:12e3,d:"Gas cost of a single BLS12-381 G1 multiplication precompile-call"},Bls12381G2AddGas:{v:4500,d:"Gas cost of a single BLS12-381 G2 addition precompile-call"},Bls12381G2MulGas:{v:55e3,d:"Gas cost of a single BLS12-381 G2 multiplication precompile-call"},Bls12381PairingBaseGas:{v:115e3,d:"Base gas cost of BLS12-381 pairing check"},Bls12381PairingPerPairGas:{v:23e3,d:"Per-pair gas cost of BLS12-381 pairing check"},Bls12381MapG1Gas:{v:5500,d:"Gas cost of BLS12-381 map field element to G1"},Bls12381MapG2Gas:{v:11e4,d:"Gas cost of BLS12-381 map field element to G2"},Bls12381MultiExpGasDiscount:{v:[[1,1200],[2,888],[3,764],[4,641],[5,594],[6,547],[7,500],[8,453],[9,438],[10,423],[11,408],[12,394],[13,379],[14,364],[15,349],[16,334],[17,330],[18,326],[19,322],[20,318],[21,314],[22,310],[23,306],[24,302],[25,298],[26,294],[27,289],[28,285],[29,281],[30,277],[31,273],[32,269],[33,268],[34,266],[35,265],[36,263],[37,262],[38,260],[39,259],[40,257],[41,256],[42,254],[43,253],[44,251],[45,250],[46,248],[47,247],[48,245],[49,244],[50,242],[51,241],[52,239],[53,238],[54,236],[55,235],[56,233],[57,232],[58,231],[59,229],[60,228],[61,226],[62,225],[63,223],[64,222],[65,221],[66,220],[67,219],[68,219],[69,218],[70,217],[71,216],[72,216],[73,215],[74,214],[75,213],[76,213],[77,212],[78,211],[79,211],[80,210],[81,209],[82,208],[83,208],[84,207],[85,206],[86,205],[87,205],[88,204],[89,203],[90,202],[91,202],[92,201],[93,200],[94,199],[95,199],[96,198],[97,197],[98,196],[99,196],[100,195],[101,194],[102,193],[103,193],[104,192],[105,191],[106,191],[107,190],[108,189],[109,188],[110,188],[111,187],[112,186],[113,185],[114,185],[115,184],[116,183],[117,182],[118,182],[119,181],[120,180],[121,179],[122,179],[123,178],[124,177],[125,176],[126,176],[127,175],[128,174]],d:"Discount gas costs of calls to the MultiExp precompiles with `k` (point, scalar) pair"}},vm:{},pow:{}},Bw={name:"EIP-2565",number:2565,comment:"ModExp gas cost",url:"https://eips.ethereum.org/EIPS/eip-2565",status:"Final",minimumHardfork:"byzantium",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:3,d:"Gquaddivisor from modexp precompile for gas calculation"}},vm:{},pow:{}},Pw={name:"EIP-2718",comment:"Typed Transaction Envelope",url:"https://eips.ethereum.org/EIPS/eip-2718",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{},vm:{},pow:{}},Cw={name:"EIP-2929",comment:"Gas cost increases for state access opcodes",url:"https://eips.ethereum.org/EIPS/eip-2929",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{coldsload:{v:2100,d:"Gas cost of the first read of storage from a given location (per transaction)"},coldaccountaccess:{v:2600,d:"Gas cost of the first read of a given address (per transaction)"},warmstorageread:{v:100,d:"Gas cost of reading storage locations which have already loaded 'cold'"},sstoreCleanGasEIP2200:{v:2900,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreNoopGasEIP2200:{v:100,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:100,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitRefundEIP2200:{v:19900,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanRefundEIP2200:{v:4900,d:"Once per SSTORE operation for resetting to the original non-zero value"},call:{v:0,d:"Base fee of the CALL opcode"},callcode:{v:0,d:"Base fee of the CALLCODE opcode"},delegatecall:{v:0,d:"Base fee of the DELEGATECALL opcode"},staticcall:{v:0,d:"Base fee of the STATICCALL opcode"},balance:{v:0,d:"Base fee of the BALANCE opcode"},extcodesize:{v:0,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:0,d:"Base fee of the EXTCODECOPY opcode"},extcodehash:{v:0,d:"Base fee of the EXTCODEHASH opcode"},sload:{v:0,d:"Base fee of the SLOAD opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"}},vm:{},pow:{}},Nw={name:"EIP-2930",comment:"Optional access lists",url:"https://eips.ethereum.org/EIPS/eip-2930",status:"Final",minimumHardfork:"istanbul",requiredEIPs:[2718,2929],gasConfig:{},gasPrices:{accessListStorageKeyCost:{v:1900,d:"Gas cost per storage key in an Access List transaction"},accessListAddressCost:{v:2400,d:"Gas cost per storage key in an Access List transaction"}},vm:{},pow:{}},Ow={name:"EIP-3198",number:3198,comment:"BASEFEE opcode",url:"https://eips.ethereum.org/EIPS/eip-3198",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{basefee:{v:2,d:"Gas cost of the BASEFEE opcode"}},vm:{},pow:{}},Mw={name:"EIP-3529",comment:"Reduction in refunds",url:"https://eips.ethereum.org/EIPS/eip-3529",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2929],gasConfig:{maxRefundQuotient:{v:5,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{selfdestructRefund:{v:0,d:"Refunded following a selfdestruct operation"},sstoreClearRefundEIP2200:{v:4800,d:"Once per SSTORE operation for clearing an originally existing storage slot"}},vm:{},pow:{}},Lw={name:"EIP-3540",number:3540,comment:"EVM Object Format (EOF) v1",url:"https://eips.ethereum.org/EIPS/eip-3540",status:"Review",minimumHardfork:"london",requiredEIPs:[3541],gasConfig:{},gasPrices:{},vm:{},pow:{}},Fw={name:"EIP-3541",comment:"Reject new contracts starting with the 0xEF byte",url:"https://eips.ethereum.org/EIPS/eip-3541",status:"Final",minimumHardfork:"berlin",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},Dw={name:"EIP-3554",comment:"Reduction in refunds",url:"Difficulty Bomb Delay to December 1st 2021",status:"Final",minimumHardfork:"muirGlacier",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:95e5,d:"the amount of blocks to delay the difficulty bomb with"}}},jw={name:"EIP-3607",number:3607,comment:"Reject transactions from senders with deployed code",url:"https://eips.ethereum.org/EIPS/eip-3607",status:"Final",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},Hw={name:"EIP-3651",number:3198,comment:"Warm COINBASE",url:"https://eips.ethereum.org/EIPS/eip-3651",status:"Review",minimumHardfork:"london",requiredEIPs:[2929],gasConfig:{},gasPrices:{},vm:{},pow:{}},Uw={name:"EIP-3670",number:3670,comment:"EOF - Code Validation",url:"https://eips.ethereum.org/EIPS/eip-3670",status:"Review",minimumHardfork:"london",requiredEIPs:[3540],gasConfig:{},gasPrices:{},vm:{},pow:{}},Gw={name:"EIP-3675",number:3675,comment:"Upgrade consensus to Proof-of-Stake",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Final",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},qw={name:"EIP-3855",number:3855,comment:"PUSH0 instruction",url:"https://eips.ethereum.org/EIPS/eip-3855",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{push0:{v:2,d:"Base fee of the PUSH0 opcode"}},vm:{},pow:{}},$w={name:"EIP-3860",number:3860,comment:"Limit and meter initcode",url:"https://eips.ethereum.org/EIPS/eip-3860",status:"Review",minimumHardfork:"spuriousDragon",requiredEIPs:[],gasConfig:{},gasPrices:{initCodeWordCost:{v:2,d:"Gas to pay for each word (32 bytes) of initcode when creating a contract"}},vm:{maxInitCodeSize:{v:49152,d:"Maximum length of initialization code when creating a contract"}},pow:{}},Qw={name:"EIP-4345",number:4345,comment:"Difficulty Bomb Delay to June 2022",url:"https://eips.ethereum.org/EIPS/eip-4345",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:107e5,d:"the amount of blocks to delay the difficulty bomb with"}}},Vw={name:"EIP-4399",number:4399,comment:"Supplant DIFFICULTY opcode with PREVRANDAO",url:"https://eips.ethereum.org/EIPS/eip-4399",status:"Review",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},zw={name:"EIP-5133",number:5133,comment:"Delaying Difficulty Bomb to mid-September 2022",url:"https://eips.ethereum.org/EIPS/eip-5133",status:"Draft",minimumHardfork:"grayGlacier",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:114e5,d:"the amount of blocks to delay the difficulty bomb with"}}},Yn={1153:Tw,1559:Sw,2315:Rw,2537:kw,2565:Bw,2718:Pw,2929:Cw,2930:Nw,3198:Ow,3529:Mw,3540:Lw,3541:Fw,3554:Dw,3607:jw,3651:Hw,3670:Uw,3675:Gw,3855:qw,3860:$w,4345:Qw,4399:Vw,5133:zw},Jw={name:"chainstart",comment:"Start of the Ethereum main chain",url:"",status:"",gasConfig:{minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be"},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations"},maxRefundQuotient:{v:2,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{base:{v:2,d:"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},tierStep:{v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them"},exp:{v:10,d:"Base fee of the EXP opcode"},expByte:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction"},sha3:{v:30,d:"Base fee of the SHA3 opcode"},sha3Word:{v:6,d:"Once per word of the SHA3 operation's data"},sload:{v:50,d:"Base fee of the SLOAD opcode"},sstoreSet:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero"},sstoreReset:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero"},sstoreRefund:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero"},jumpdest:{v:1,d:"Base fee of the JUMPDEST opcode"},log:{v:375,d:"Base fee of the LOG opcode"},logData:{v:8,d:"Per byte in a LOG* operation's data"},logTopic:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},create:{v:32e3,d:"Base fee of the CREATE opcode"},call:{v:40,d:"Base fee of the CALL opcode"},callStipend:{v:2300,d:"Free gas given at beginning of call"},callValueTransfer:{v:9e3,d:"Paid for CALL when the value transfor is non-zero"},callNewAccount:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior"},selfdestructRefund:{v:24e3,d:"Refunded following a selfdestruct operation"},memory:{v:3,d:"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL"},quadCoeffDiv:{v:512,d:"Divisor for the quadratic particle of the memory cost equation"},createData:{v:200,d:""},tx:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions"},txCreation:{v:32e3,d:"The cost of creating a contract via tx"},txDataZero:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},txDataNonZero:{v:68,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},copy:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},ecRecover:{v:3e3,d:""},sha256:{v:60,d:""},sha256Word:{v:12,d:""},ripemd160:{v:600,d:""},ripemd160Word:{v:120,d:""},identity:{v:15,d:""},identityWord:{v:3,d:""},stop:{v:0,d:"Base fee of the STOP opcode"},add:{v:3,d:"Base fee of the ADD opcode"},mul:{v:5,d:"Base fee of the MUL opcode"},sub:{v:3,d:"Base fee of the SUB opcode"},div:{v:5,d:"Base fee of the DIV opcode"},sdiv:{v:5,d:"Base fee of the SDIV opcode"},mod:{v:5,d:"Base fee of the MOD opcode"},smod:{v:5,d:"Base fee of the SMOD opcode"},addmod:{v:8,d:"Base fee of the ADDMOD opcode"},mulmod:{v:8,d:"Base fee of the MULMOD opcode"},signextend:{v:5,d:"Base fee of the SIGNEXTEND opcode"},lt:{v:3,d:"Base fee of the LT opcode"},gt:{v:3,d:"Base fee of the GT opcode"},slt:{v:3,d:"Base fee of the SLT opcode"},sgt:{v:3,d:"Base fee of the SGT opcode"},eq:{v:3,d:"Base fee of the EQ opcode"},iszero:{v:3,d:"Base fee of the ISZERO opcode"},and:{v:3,d:"Base fee of the AND opcode"},or:{v:3,d:"Base fee of the OR opcode"},xor:{v:3,d:"Base fee of the XOR opcode"},not:{v:3,d:"Base fee of the NOT opcode"},byte:{v:3,d:"Base fee of the BYTE opcode"},address:{v:2,d:"Base fee of the ADDRESS opcode"},balance:{v:20,d:"Base fee of the BALANCE opcode"},origin:{v:2,d:"Base fee of the ORIGIN opcode"},caller:{v:2,d:"Base fee of the CALLER opcode"},callvalue:{v:2,d:"Base fee of the CALLVALUE opcode"},calldataload:{v:3,d:"Base fee of the CALLDATALOAD opcode"},calldatasize:{v:2,d:"Base fee of the CALLDATASIZE opcode"},calldatacopy:{v:3,d:"Base fee of the CALLDATACOPY opcode"},codesize:{v:2,d:"Base fee of the CODESIZE opcode"},codecopy:{v:3,d:"Base fee of the CODECOPY opcode"},gasprice:{v:2,d:"Base fee of the GASPRICE opcode"},extcodesize:{v:20,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:20,d:"Base fee of the EXTCODECOPY opcode"},blockhash:{v:20,d:"Base fee of the BLOCKHASH opcode"},coinbase:{v:2,d:"Base fee of the COINBASE opcode"},timestamp:{v:2,d:"Base fee of the TIMESTAMP opcode"},number:{v:2,d:"Base fee of the NUMBER opcode"},difficulty:{v:2,d:"Base fee of the DIFFICULTY opcode"},gaslimit:{v:2,d:"Base fee of the GASLIMIT opcode"},pop:{v:2,d:"Base fee of the POP opcode"},mload:{v:3,d:"Base fee of the MLOAD opcode"},mstore:{v:3,d:"Base fee of the MSTORE opcode"},mstore8:{v:3,d:"Base fee of the MSTORE8 opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"},jump:{v:8,d:"Base fee of the JUMP opcode"},jumpi:{v:10,d:"Base fee of the JUMPI opcode"},pc:{v:2,d:"Base fee of the PC opcode"},msize:{v:2,d:"Base fee of the MSIZE opcode"},gas:{v:2,d:"Base fee of the GAS opcode"},push:{v:3,d:"Base fee of the PUSH opcode"},dup:{v:3,d:"Base fee of the DUP opcode"},swap:{v:3,d:"Base fee of the SWAP opcode"},callcode:{v:40,d:"Base fee of the CALLCODE opcode"},return:{v:0,d:"Base fee of the RETURN opcode"},invalid:{v:0,d:"Base fee of the INVALID opcode"},selfdestruct:{v:0,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{stackLimit:{v:1024,d:"Maximum size of VM stack allowed"},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack"},maxExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis"}},pow:{minimumDifficulty:{v:131072,d:"The minimum that the difficulty may ever be"},difficultyBoundDivisor:{v:2048,d:"The bound divisor of the difficulty, used in the update calculations"},durationLimit:{v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not"},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},minerReward:{v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:0,d:"the amount of blocks to delay the difficulty bomb with"}}},Ww={name:"dao",comment:"DAO rescue hardfork",url:"https://eips.ethereum.org/EIPS/eip-779",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{}},Kw={name:"homestead",comment:"Homestead hardfork with protocol and network changes",url:"https://eips.ethereum.org/EIPS/eip-606",status:"Final",gasConfig:{},gasPrices:{delegatecall:{v:40,d:"Base fee of the DELEGATECALL opcode"}},vm:{},pow:{}},Zw={name:"tangerineWhistle",comment:"Hardfork with gas cost changes for IO-heavy operations",url:"https://eips.ethereum.org/EIPS/eip-608",status:"Final",gasConfig:{},gasPrices:{sload:{v:200,d:"Once per SLOAD operation"},call:{v:700,d:"Once per CALL operation & message call transaction"},extcodesize:{v:700,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:700,d:"Base fee of the EXTCODECOPY opcode"},balance:{v:400,d:"Base fee of the BALANCE opcode"},delegatecall:{v:700,d:"Base fee of the DELEGATECALL opcode"},callcode:{v:700,d:"Base fee of the CALLCODE opcode"},selfdestruct:{v:5e3,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{},pow:{}},Yw={name:"spuriousDragon",comment:"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit",url:"https://eips.ethereum.org/EIPS/eip-607",status:"Final",gasConfig:{},gasPrices:{expByte:{v:50,d:"Times ceil(log256(exponent)) for the EXP instruction"}},vm:{maxCodeSize:{v:24576,d:"Maximum length of contract code"}},pow:{}},Xw={name:"byzantium",comment:"Hardfork with new precompiles, instructions and other protocol changes",url:"https://eips.ethereum.org/EIPS/eip-609",status:"Final",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:20,d:"Gquaddivisor from modexp precompile for gas calculation"},ecAdd:{v:500,d:"Gas costs for curve addition precompile"},ecMul:{v:4e4,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:1e5,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:8e4,d:"Gas costs regarding curve pairing precompile input length"},revert:{v:0,d:"Base fee of the REVERT opcode"},staticcall:{v:700,d:"Base fee of the STATICCALL opcode"},returndatasize:{v:2,d:"Base fee of the RETURNDATASIZE opcode"},returndatacopy:{v:3,d:"Base fee of the RETURNDATACOPY opcode"}},vm:{},pow:{minerReward:{v:"3000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:3e6,d:"the amount of blocks to delay the difficulty bomb with"}}},e_={name:"constantinople",comment:"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)",url:"https://eips.ethereum.org/EIPS/eip-1013",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:200,d:"Once per SSTORE operation if the value doesn't change"},netSstoreInitGas:{v:2e4,d:"Once per SSTORE operation from clean zero"},netSstoreCleanGas:{v:5e3,d:"Once per SSTORE operation from clean non-zero"},netSstoreDirtyGas:{v:200,d:"Once per SSTORE operation from dirty"},netSstoreClearRefund:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},netSstoreResetRefund:{v:4800,d:"Once per SSTORE operation for resetting to the original non-zero value"},netSstoreResetClearRefund:{v:19800,d:"Once per SSTORE operation for resetting to the original zero value"},shl:{v:3,d:"Base fee of the SHL opcode"},shr:{v:3,d:"Base fee of the SHR opcode"},sar:{v:3,d:"Base fee of the SAR opcode"},extcodehash:{v:400,d:"Base fee of the EXTCODEHASH opcode"},create2:{v:32e3,d:"Base fee of the CREATE2 opcode"}},vm:{},pow:{minerReward:{v:"2000000000000000000",d:"The amount a miner gets rewarded for mining a block"},difficultyBombDelay:{v:5e6,d:"the amount of blocks to delay the difficulty bomb with"}}},t_={name:"petersburg",comment:"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople",url:"https://eips.ethereum.org/EIPS/eip-1716",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:null,d:"Removed along EIP-1283"},netSstoreInitGas:{v:null,d:"Removed along EIP-1283"},netSstoreCleanGas:{v:null,d:"Removed along EIP-1283"},netSstoreDirtyGas:{v:null,d:"Removed along EIP-1283"},netSstoreClearRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetClearRefund:{v:null,d:"Removed along EIP-1283"}},vm:{},pow:{}},n_={name:"istanbul",comment:"HF targeted for December 2019 following the Constantinople/Petersburg HF",url:"https://eips.ethereum.org/EIPS/eip-1679",status:"Final",gasConfig:{},gasPrices:{blake2Round:{v:1,d:"Gas cost per round for the Blake2 F precompile"},ecAdd:{v:150,d:"Gas costs for curve addition precompile"},ecMul:{v:6e3,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:45e3,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:34e3,d:"Gas costs regarding curve pairing precompile input length"},txDataNonZero:{v:16,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},sstoreSentryGasEIP2200:{v:2300,d:"Minimum gas required to be present for an SSTORE call, not consumed"},sstoreNoopGasEIP2200:{v:800,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:800,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitGasEIP2200:{v:2e4,d:"Once per SSTORE operation from clean zero to non-zero"},sstoreInitRefundEIP2200:{v:19200,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanGasEIP2200:{v:5e3,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreCleanRefundEIP2200:{v:4200,d:"Once per SSTORE operation for resetting to the original non-zero value"},sstoreClearRefundEIP2200:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},balance:{v:700,d:"Base fee of the BALANCE opcode"},extcodehash:{v:700,d:"Base fee of the EXTCODEHASH opcode"},chainid:{v:2,d:"Base fee of the CHAINID opcode"},selfbalance:{v:5,d:"Base fee of the SELFBALANCE opcode"},sload:{v:800,d:"Base fee of the SLOAD opcode"}},vm:{},pow:{}},r_={name:"muirGlacier",comment:"HF to delay the difficulty bomb",url:"https://eips.ethereum.org/EIPS/eip-2384",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:9e6,d:"the amount of blocks to delay the difficulty bomb with"}}},i_={name:"berlin",comment:"HF targeted for July 2020 following the Muir Glacier HF",url:"https://eips.ethereum.org/EIPS/eip-2070",status:"Final",eips:[2565,2929,2718,2930]},s_={name:"london",comment:"HF targeted for July 2021 following the Berlin fork",url:"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md",status:"Final",eips:[1559,3198,3529,3541]},o_={name:"shanghai",comment:"Next feature hardfork after the merge hardfork having withdrawals, warm coinbase, push0, limit/meter initcode",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md",status:"Final",eips:[3651,3855,3860,4895]},a_={name:"arrowGlacier",comment:"HF to delay the difficulty bomb",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md",status:"Final",eips:[4345],gasConfig:{},gasPrices:{},vm:{},pow:{}},c_={name:"grayGlacier",comment:"Delaying the difficulty bomb to Mid September 2022",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md",status:"Draft",eips:[5133],gasConfig:{},gasPrices:{},vm:{},pow:{}},u_={name:"mergeForkIdTransition",comment:"Pre-merge hardfork to fork off non-upgraded clients",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Draft",eips:[]},d_={name:"merge",comment:"Hardfork to upgrade the consensus mechanism to Proof-of-Stake",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/merge.md",status:"Final",consensus:{type:"pos",algorithm:"casper",casper:{}},eips:[3675,4399]},l_={chainstart:Jw,homestead:Kw,dao:Ww,tangerineWhistle:Zw,spuriousDragon:Yw,byzantium:Xw,constantinople:e_,petersburg:t_,istanbul:n_,muirGlacier:r_,berlin:i_,london:s_,shanghai:o_,arrowGlacier:a_,grayGlacier:c_,mergeForkIdTransition:u_,merge:d_},{buf:f_}=_w;class Ee extends kc{static custom(e,n={}){var r;const i=(r=n.baseChain)!==null&&r!==void 0?r:"mainnet",s=Object.assign({},Ee._getChainParams(i));if(s.name="custom-chain",typeof e!="string")return new Ee(Object.assign({chain:Object.assign(Object.assign({},s),e)},n));if(e===Re.PolygonMainnet)return Ee.custom({name:Re.PolygonMainnet,chainId:137,networkId:137},n);if(e===Re.PolygonMumbai)return Ee.custom({name:Re.PolygonMumbai,chainId:80001,networkId:80001},n);if(e===Re.ArbitrumRinkebyTestnet)return Ee.custom({name:Re.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611},n);if(e===Re.ArbitrumOne)return Ee.custom({name:Re.ArbitrumOne,chainId:42161,networkId:42161},n);if(e===Re.xDaiChain)return Ee.custom({name:Re.xDaiChain,chainId:100,networkId:100},n);if(e===Re.OptimisticKovan)return Ee.custom({name:Re.OptimisticKovan,chainId:69,networkId:69},Object.assign({hardfork:le.Berlin},n));if(e===Re.OptimisticEthereum)return Ee.custom({name:Re.OptimisticEthereum,chainId:10,networkId:10},Object.assign({hardfork:le.Berlin},n));throw new Error(`Custom chain ${e} not supported`)}static fromGethGenesis(e,{chain:n,eips:r,genesisHash:i,hardfork:s,mergeForkIdPostMerge:o}){var a;const d=yp(e,n,o),u=new Ee({chain:(a=d.name)!==null&&a!==void 0?a:"custom",customChains:[d],eips:r,hardfork:s??d.hardfork});return i!==void 0&&u.setForkHashes(i),u}static isSupportedChainId(e){return!!this._getInitializedChains().names[e.toString()]}static _getChainParams(e,n){let r=e;const i=this._getInitializedChains(n);if(typeof r=="number"||typeof r=="bigint"){if(r=r.toString(),i.names[r]){const s=i.names[r];return i[s]}throw new Error(`Chain with ID ${r} not supported`)}if(i[r]!==void 0)return i[r];throw new Error(`Chain with name ${r} not supported`)}constructor(e){var n,r;super(),this._eips=[],this._customChains=(n=e.customChains)!==null&&n!==void 0?n:[],this._chainParams=this.setChain(e.chain),this.DEFAULT_HARDFORK=(r=this._chainParams.defaultHardfork)!==null&&r!==void 0?r:le.Merge,this.HARDFORK_CHANGES=this.hardforks().map(i=>[i.name,l_[i.name]]),this._hardfork=this.DEFAULT_HARDFORK,e.hardfork!==void 0&&this.setHardfork(e.hardfork),e.eips&&this.setEIPs(e.eips)}setChain(e){if(typeof e=="number"||typeof e=="bigint"||typeof e=="string")this._chainParams=Ee._getChainParams(e,this._customChains);else if(typeof e=="object"){if(this._customChains.length>0)throw new Error("Chain must be a string, number, or bigint when initialized with customChains passed in");const n=["networkId","genesis","hardforks","bootstrapNodes"];for(const r of n)if(!(r in e))throw new Error(`Missing required chain parameter: ${r}`);this._chainParams=e}else throw new Error("Wrong input format");for(const n of this.hardforks())if(n.block===void 0)throw new Error("Hardfork cannot have undefined block number");return this._chainParams}setHardfork(e){let n=!1;for(const r of this.HARDFORK_CHANGES)r[0]===e&&(this._hardfork!==e&&(this._hardfork=e,this.emit("hardforkChanged",e)),n=!0);if(!n)throw new Error(`Hardfork with name ${e} not supported`)}getHardforkByBlockNumber(e,n,r){const i=vn(e,ze.BigInt),s=vn(n,ze.BigInt),o=vn(r,ze.Number),a=this.hardforks().filter(p=>p.block!==null||p.ttd!==null&&p.ttd!==void 0||p.timestamp!==void 0),d=a.findIndex(p=>p.ttd!==null&&p.ttd!==void 0);if(a.slice(d+1).findIndex(p=>p.ttd!==null&&p.ttd!==void 0)>=0)throw Error("More than one merge hardforks found with ttd specified");let c=a.findIndex(p=>p.block!==null&&p.block>i||o!==void 0&&Number(p.timestamp)>o);if(c===-1)c=a.length;else if(c===0)throw Error("Must have at least one hardfork at block 0");if(o===void 0){const p=a.slice(0,c).reverse().findIndex(v=>v.block!==null||v.ttd!==void 0);c-=p}if(c-=1,a[c].block===null&&a[c].timestamp===void 0)(s==null||BigInt(a[c].ttd)>s)&&(c-=1);else if(d>=0&&s!==void 0&&s!==null){if(c>=d&&BigInt(a[d].ttd)>s)throw Error("Maximum HF determined by total difficulty is lower than the block number HF");if(c<d&&BigInt(a[d].ttd)<=s)throw Error("HF determined by block number is lower than the minimum total difficulty HF")}const l=c;for(;c<a.length-1&&!(a[c].block!==a[c+1].block||a[c].timestamp!==a[c+1].timestamp);c+=1);if(o){if(a.slice(0,l).reduce((m,y)=>{var f;return Math.max(Number((f=y.timestamp)!==null&&f!==void 0?f:"0"),m)},0)>o)throw Error("Maximum HF determined by timestamp is lower than the block number/ttd HF");if(a.slice(c+1).reduce((m,y)=>{var f;return Math.min(Number((f=y.timestamp)!==null&&f!==void 0?f:o),m)},o)<o)throw Error("Maximum HF determined by block number/ttd is lower than timestamp HF")}return a[c].name}setHardforkByBlockNumber(e,n,r){const i=this.getHardforkByBlockNumber(e,n,r);return this.setHardfork(i),i}_getHardfork(e){const n=this.hardforks();for(const r of n)if(r.name===e)return r;return null}setEIPs(e=[]){for(const n of e){if(!(n in Yn))throw new Error(`${n} not supported`);const r=this.gteHardfork(Yn[n].minimumHardfork);if(!r)throw new Error(`${n} cannot be activated on hardfork ${this.hardfork()}, minimumHardfork: ${r}`);if(Yn[n].requiredEIPs!==void 0){for(const i of Yn[n].requiredEIPs)if(!(e.includes(i)||this.isActivatedEIP(i)))throw new Error(`${n} requires EIP ${i}, but is not included in the EIP list`)}}this._eips=e}param(e,n){let r;for(const i of this._eips)if(r=this.paramByEIP(e,n,i),r!==void 0)return r;return this.paramByHardfork(e,n,this._hardfork)}paramByHardfork(e,n,r){let i=null;for(const s of this.HARDFORK_CHANGES){if("eips"in s[1]){const o=s[1].eips;for(const a of o){const d=this.paramByEIP(e,n,a);i=typeof d=="bigint"?d:i}}else{if(s[1][e]===void 0)throw new Error(`Topic ${e} not defined`);s[1][e][n]!==void 0&&(i=s[1][e][n].v)}if(s[0]===r)break}return BigInt(i??0)}paramByEIP(e,n,r){if(!(r in Yn))throw new Error(`${r} not supported`);const i=Yn[r];if(!(e in i))throw new Error(`Topic ${e} not defined`);if(i[e][n]===void 0)return;const s=i[e][n].v;return BigInt(s)}paramByBlock(e,n,r,i,s){const o=this.getHardforkByBlockNumber(r,i,s);return this.paramByHardfork(e,n,o)}isActivatedEIP(e){if(this.eips().includes(e))return!0;for(const n of this.HARDFORK_CHANGES){const r=n[1];if(this.gteHardfork(r.name)&&"eips"in r&&r.eips.includes(e))return!0}return!1}hardforkIsActiveOnBlock(e,n){const r=vn(n,ze.BigInt),i=e??this._hardfork,s=this.hardforkBlock(i);return typeof s=="bigint"&&s!==BigInt(0)&&r>=s}activeOnBlock(e){return this.hardforkIsActiveOnBlock(null,e)}hardforkGteHardfork(e,n){const r=e??this._hardfork,i=this.hardforks();let s=-1,o=-1,a=0;for(const d of i)d.name===r&&(s=a),d.name===n&&(o=a),a+=1;return s>=o&&o!==-1}gteHardfork(e){return this.hardforkGteHardfork(null,e)}hardforkBlock(e){var n;const r=e??this._hardfork,i=(n=this._getHardfork(r))===null||n===void 0?void 0:n.block;return i==null?null:BigInt(i)}hardforkTimestamp(e){var n;const r=e??this._hardfork,i=(n=this._getHardfork(r))===null||n===void 0?void 0:n.timestamp;return i==null?null:BigInt(i)}eipBlock(e){for(const n of this.HARDFORK_CHANGES){const r=n[1];if("eips"in r&&r.eips.includes(e))return this.hardforkBlock(typeof n[0]=="number"?String(n[0]):n[0])}return null}hardforkTTD(e){var n;const r=e??this._hardfork,i=(n=this._getHardfork(r))===null||n===void 0?void 0:n.ttd;return i==null?null:BigInt(i)}isHardforkBlock(e,n){const r=vn(e,ze.BigInt),i=n??this._hardfork,s=this.hardforkBlock(i);return typeof s=="bigint"&&s!==BigInt(0)?s===r:!1}nextHardforkBlockOrTimestamp(e){var n,r,i;const s=(n=e)!==null&&n!==void 0?n:this._hardfork,o=this.hardforks();let a=o.findIndex(l=>l.name===s);if(s===le.Merge&&(a-=1),a<0)return null;let d=(r=o[a].timestamp)!==null&&r!==void 0?r:o[a].block;d=d!=null?Number(d):null;const u=o.slice(a+1).find(l=>{var h;let p=(h=l.timestamp)!==null&&h!==void 0?h:l.block;return p=p!=null?Number(p):null,l.name!==le.Merge&&p!==null&&p!==void 0&&p!==d});if(u===void 0)return null;const c=(i=u.timestamp)!==null&&i!==void 0?i:u.block;return c==null?null:BigInt(c)}nextHardforkBlock(e){var n;const r=(n=e)!==null&&n!==void 0?n:this._hardfork;let i=this.hardforkBlock(r);if(i===null&&r===le.Merge){const o=this.hardforks(),a=o.findIndex(d=>d.ttd!==null&&d.ttd!==void 0);if(a<0)throw Error("Merge hardfork should have been found");i=this.hardforkBlock(o[a-1].name)}return i===null?null:this.hardforks().reduce((o,a)=>{const d=BigInt(a.block===null||a.ttd!==void 0&&a.ttd!==null?0:a.block);return d>i&&o===null?d:o},null)}isNextHardforkBlock(e,n){const r=vn(e,ze.BigInt),i=n??this._hardfork,s=this.nextHardforkBlock(i);return s===null?!1:s===r}_calcForkHash(e,n){let r=new Uint8Array,i=0;for(const a of this.hardforks()){const{block:d,timestamp:u,name:c}=a;let l=u??d;if(l=l!==null?Number(l):null,typeof l=="number"&&l!==0&&l!==i&&c!==le.Merge){const h=fe(l.toString(16).padStart(16,"0"));r=He(r,h),i=l}if(a.name===e)break}const s=He(n,r);return ne(vp(f_(s)>>>0))}forkHash(e,n){const r=e??this._hardfork,i=this._getHardfork(r);if(i===null||i?.block===null&&i?.timestamp===void 0&&i?.ttd===void 0){const s="No fork hash calculation possible for future hardfork";throw new Error(s)}if(i?.forkHash!==null&&i?.forkHash!==void 0)return i.forkHash;if(!n)throw new Error("genesisHash required for forkHash calculation");return this._calcForkHash(r,n)}hardforkForForkHash(e){const n=this.hardforks().filter(r=>r.forkHash===e);return n.length>=1?n[n.length-1]:null}setForkHashes(e){var n;for(const r of this.hardforks()){const i=(n=r.timestamp)!==null&&n!==void 0?n:r.block;(r.forkHash===null||r.forkHash===void 0)&&(i!=null||typeof r.ttd<"u")&&(r.forkHash=this.forkHash(r.name,e))}}genesis(){return this._chainParams.genesis}hardforks(){return this._chainParams.hardforks}bootstrapNodes(){return this._chainParams.bootstrapNodes}dnsNetworks(){return this._chainParams.dnsNetworks}hardfork(){return this._hardfork}chainId(){return BigInt(this._chainParams.chainId)}chainName(){return this._chainParams.name}networkId(){return BigInt(this._chainParams.networkId)}eips(){return this._eips}consensusType(){const e=this.hardfork();let n;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(n=r[1].consensus.type),r[0]===e)break;return n??this._chainParams.consensus.type}consensusAlgorithm(){const e=this.hardfork();let n;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(n=r[1].consensus.algorithm),r[0]===e)break;return n??this._chainParams.consensus.algorithm}consensusConfig(){var e;const n=this.hardfork();let r;for(const i of this.HARDFORK_CHANGES)if("consensus"in i[1]&&(r=i[1].consensus[i[1].consensus.algorithm]),i[0]===n)break;return(e=r??this._chainParams.consensus[this.consensusAlgorithm()])!==null&&e!==void 0?e:{}}copy(){const e=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return e.removeAllListeners(),e}static _getInitializedChains(e){const n={};for(const[i,s]of Object.entries(Bi))n[s]=i.toLowerCase();const r={mainnet:xw,goerli:Ew,sepolia:Iw};if(e)for(const i of e){const{name:s}=i;n[i.chainId.toString()]=s,r[s]=i}return r.names=n,r}}var ot;(function(t){t[t.EIP155ReplayProtection=155]="EIP155ReplayProtection",t[t.EIP1559FeeMarket=1559]="EIP1559FeeMarket",t[t.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",t[t.EIP2930AccessLists=2930]="EIP2930AccessLists"})(ot||(ot={}));function wp(t){if(t.length===0)return!0;const e=t[0];return!!Array.isArray(e)}function _p(t){return!wp(t)}class dr{constructor(e){if(e.length!==20)throw new Error("Invalid address length");this.buf=e}static zero(){return new dr(tu(20))}equals(e){return yo(this.buf,e.buf)}isZero(){return this.equals(dr.zero())}toString(){return ne(this.buf)}toArray(){return this.buf}static publicToAddress(e,n=!1){let r=e;if(To(r),n&&r.length!==64&&(r=Qt.ProjectivePoint.fromHex(r).toRawBytes(!1).slice(1)),r.length!==64)throw new Error("Expected pubKey to be of length 64");return Fe(r).slice(-20)}}const Ep=(t,e)=>{const n=t.param("vm","maxInitCodeSize");if(n&&BigInt(e)>n)throw new Error(`the initcode size of this transaction is too large: it is ${e} while the max is ${t.param("vm","maxInitCodeSize")}`)},nu=t=>{let e,n;if(_p(t)){e=t;const r=[];for(let i=0;i<t.length;i+=1){const s=t[i],o=pe(s.address),a=[];for(let d=0;d<s.storageKeys.length;d+=1)a.push(pe(s.storageKeys[d]));r.push([o,a])}n=r}else{n=t??[];const r=[];for(let i=0;i<n.length;i+=1){const s=n[i],o=ne(s[0]),a=[];for(let u=0;u<s[1].length;u+=1)a.push(ne(s[1][u]));const d={address:o,storageKeys:a};r.push(d)}e=r}return{AccessListJSON:e,accessList:n}},ru=t=>{for(let e=0;e<t.length;e+=1){const n=t[e],r=n[0],i=n[1];if(n[2]!==void 0)throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(r.length!==20)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(let s=0;s<i.length;s+=1)if(i[s].length!==32)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}},iu=t=>{const e=[];for(let n=0;n<t.length;n+=1){const r=t[n],i={address:ne(Na(r[0],20)),storageKeys:[]},s=r&&r[1];for(let o=0;o<s.length;o+=1){const a=s[o];i.storageKeys.push(ne(Na(a,32)))}e.push(i)}return e},su=(t,e)=>{const n=e.param("gasPrices","accessListStorageKeyCost"),r=e.param("gasPrices","accessListAddressCost");let i=0;for(let o=0;o<t.length;o+=1){const d=t[o][1];i+=d.length}return t.length*Number(r)+i*Number(n)},h_=Object.freeze(Object.defineProperty({__proto__:null,checkMaxInitCodeSize:Ep,getAccessListData:nu,getAccessListJSON:iu,getDataFeeEIP2930:su,verifyAccessList:ru},Symbol.toStringTag,{value:"Module"}));class jn{constructor(e,n){var r,i;this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=Bi.Mainnet,this.DEFAULT_HARDFORK=le.Merge;const{nonce:s,gasLimit:o,to:a,value:d,data:u,v:c,r:l,s:h,type:p}=e;this._type=Number(ue(pe(p))),this.txOptions=n;const v=pe(a===""?"0x":a),m=pe(c===""?"0x":c),y=pe(l===""?"0x":l),f=pe(h===""?"0x":h);this.nonce=ue(pe(s===""?"0x":s)),this.gasLimit=ue(pe(o===""?"0x":o)),this.to=v.length>0?new dr(v):void 0,this.value=ue(pe(d===""?"0x":d)),this.data=pe(u===""?"0x":u),this.v=m.length>0?ue(m):void 0,this.r=y.length>0?ue(y):void 0,this.s=f.length>0?ue(f):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0);const b=this.to===void 0||this.to===null,w=(r=n.allowUnlimitedInitCodeSize)!==null&&r!==void 0?r:!1,I=(i=n.common)!==null&&i!==void 0?i:this._getCommon();b&&I.isActivatedEIP(3860)&&!w&&Ep(I,this.data.length)}get type(){return this._type}supports(e){return this.activeCapabilities.includes(e)}validate(e=!1){const n=[];return this.getBaseFee()>this.gasLimit&&n.push(`gasLimit is too low. given ${this.gasLimit}, need at least ${this.getBaseFee()}`),this.isSigned()&&!this.verifySignature()&&n.push("Invalid Signature"),e?n:n.length===0}_validateYParity(){const{v:e}=this;if(e!==void 0&&e!==BigInt(0)&&e!==BigInt(1)){const n=this._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(n)}}_validateHighS(){const{s:e}=this;if(this.common.gteHardfork("homestead")&&e!==void 0&&e>hw){const n=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(n)}}getBaseFee(){const e=this.common.param("gasPrices","tx");let n=this.getDataFee();if(e&&(n+=e),this.common.gteHardfork("homestead")&&this.toCreationAddress()){const r=this.common.param("gasPrices","txCreation");r&&(n+=r)}return n}getDataFee(){const e=this.common.param("gasPrices","txDataZero"),n=this.common.param("gasPrices","txDataNonZero");let r=BigInt(0);for(let i=0;i<this.data.length;i+=1)this.data[i]===0?r+=e:r+=n;if((this.to===void 0||this.to===null)&&this.common.isActivatedEIP(3860)){const i=BigInt(Math.ceil(this.data.length/32)),s=this.common.param("gasPrices","initCodeWordCost")*i;r+=s}return r}toCreationAddress(){return this.to===void 0||this.to.buf.length===0}isSigned(){const{v:e,r:n,s:r}=this;return!(e===void 0||n===void 0||r===void 0)}verifySignature(){try{const e=this.getSenderPublicKey();return Pi(e).length!==0}catch{return!1}}getSenderAddress(){return new dr(dr.publicToAddress(this.getSenderPublicKey()))}sign(e){if(e.length!==32){const d=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(d)}let n=!1;this.type===0&&this.common.gteHardfork("spuriousDragon")&&!this.supports(ot.EIP155ReplayProtection)&&(this.activeCapabilities.push(ot.EIP155ReplayProtection),n=!0);const r=this.getMessageToSign(!0),{v:i,r:s,s:o}=this._ecsign(r,e),a=this._processSignature(i,s,o);if(n){const d=this.activeCapabilities.indexOf(ot.EIP155ReplayProtection);d>-1&&this.activeCapabilities.splice(d,1)}return a}_getCommon(e,n){var r,i,s,o;if(n!==void 0){const a=ue(pe(n));if(e){if(e.chainId()!==a){const d=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(d)}return e.copy()}return Ee.isSupportedChainId(a)?new Ee({chain:a,hardfork:this.DEFAULT_HARDFORK}):Ee.custom({name:"custom-chain",networkId:a,chainId:a},{baseChain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}if(e?.copy&&typeof e?.copy=="function")return e.copy();if(e){const a=typeof e.hardfork=="function"?e.hardfork():e.hardfork;return Ee.custom({name:"custom-chain",networkId:e.networkId?e.networkId():(i=BigInt((r=e.customChain)===null||r===void 0?void 0:r.networkId))!==null&&i!==void 0?i:void 0,chainId:e.chainId?e.chainId():(o=BigInt((s=e.customChain)===null||s===void 0?void 0:s.chainId))!==null&&o!==void 0?o:void 0},{baseChain:this.DEFAULT_CHAIN,hardfork:a||this.DEFAULT_HARDFORK})}return new Ee({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}_validateCannotExceedMaxInteger(e,n=256,r=!1){for(const[i,s]of Object.entries(e))switch(n){case 64:if(r){if(s!==void 0&&s>=Rd){const o=this._errorMsg(`${i} cannot equal or exceed MAX_UINT64 (2^64-1), given ${s}`);throw new Error(o)}}else if(s!==void 0&&s>Rd){const o=this._errorMsg(`${i} cannot exceed MAX_UINT64 (2^64-1), given ${s}`);throw new Error(o)}break;case 256:if(r){if(s!==void 0&&s>=ki){const o=this._errorMsg(`${i} cannot equal or exceed MAX_INTEGER (2^256-1), given ${s}`);throw new Error(o)}}else if(s!==void 0&&s>ki){const o=this._errorMsg(`${i} cannot exceed MAX_INTEGER (2^256-1), given ${s}`);throw new Error(o)}break;default:{const o=this._errorMsg("unimplemented bits value");throw new Error(o)}}}static _validateNotArray(e){const n=["nonce","gasPrice","gasLimit","to","value","data","v","r","s","type","baseFee","maxFeePerGas","chainId"];for(const[r,i]of Object.entries(e))if(n.includes(r)&&Array.isArray(i))throw new Error(`${r} cannot be an array`)}_getSharedErrorPostfix(){let e="";try{e=this.isSigned()?ne(this.hash()):"not available (unsigned)"}catch{e="error"}let n="";try{n=this.isSigned().toString()}catch{e="error"}let r="";try{r=this.common.hardfork()}catch{r="error"}let i=`tx type=${this.type} hash=${e} nonce=${this.nonce} value=${this.value} `;return i+=`signed=${n} hf=${r}`,i}_ecsign(e,n,r){const i=Qt.sign(e,n),s=i.toCompactRawBytes(),o=s.subarray(0,32),a=s.subarray(32,64),d=r===void 0?BigInt(i.recovery+27):BigInt(i.recovery+35)+BigInt(r)*BigInt(2);return{r:o,s:a,v:d}}static fromSerializedTx(e,n={}){}static fromTxData(e,n={}){}}const Oa=2,ra=fe(Oa.toString(16).padStart(2,"0"));class Yt extends jn{static fromTxData(e,n={}){return new Yt(e,n)}static fromSerializedTx(e,n={}){if(!yo(e.subarray(0,1),ra))throw new Error(`Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ${Oa}, received: ${ne(e.subarray(0,1))}`);const r=Xe.RLP.decode(e.subarray(1));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return Yt.fromValuesArray(r,n)}static fromValuesArray(e,n={}){if(e.length!==9&&e.length!==12)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");const[r,i,s,o,a,d,u,c,l,h,p,v]=e;return this._validateNotArray({chainId:r,v:h}),ho({nonce:i,maxPriorityFeePerGas:s,maxFeePerGas:o,gasLimit:a,value:u,v:h,r:p,s:v}),new Yt({chainId:ue(r),nonce:i,maxPriorityFeePerGas:s,maxFeePerGas:o,gasLimit:a,to:d,value:u,data:c,accessList:l??[],v:h!==void 0?ue(h):void 0,r:p,s:v},n)}constructor(e,n={}){var r;super(Object.assign(Object.assign({},e),{type:Oa}),n),this.DEFAULT_HARDFORK="london";const{chainId:i,accessList:s,maxFeePerGas:o,maxPriorityFeePerGas:a}=e;if(this.common=this._getCommon(n.common,i),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);const d=nu(s??[]);if(this.accessList=d.accessList,this.AccessListJSON=d.AccessListJSON,ru(this.accessList),this.maxFeePerGas=ue(pe(o===""?"0x":o)),this.maxPriorityFeePerGas=ue(pe(a===""?"0x":a)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),jn._validateNotArray(e),this.gasLimit*this.maxFeePerGas>ki){const c=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(c)}if(this.maxFeePerGas<this.maxPriorityFeePerGas){const c=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(c)}this._validateYParity(),this._validateHighS(),(!((r=n?.freeze)!==null&&r!==void 0)||r)&&Object.freeze(this)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let e=super.getDataFee();return e+=BigInt(su(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:e,hardfork:this.common.hardfork()}),e}getUpfrontCost(e=BigInt(0)){const n=this.maxPriorityFeePerGas,r=this.maxFeePerGas-e,s=(n<r?n:r)+e;return this.gasLimit*s+this.value}raw(){return[re(this.chainId),re(this.nonce),re(this.maxPriorityFeePerGas),re(this.maxFeePerGas),re(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),re(this.value),this.data,this.accessList,this.v!==void 0?re(this.v):Uint8Array.from([]),this.r!==void 0?re(this.r):Uint8Array.from([]),this.s!==void 0?re(this.s):Uint8Array.from([])]}serialize(){const e=this.raw();return He(ra,Xe.RLP.encode(e))}getMessageToSign(e=!0){const n=this.raw().slice(0,9),r=He(ra,Xe.RLP.encode(n));return e?Fe(r):r}hash(){if(!this.isSigned()){const e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Fe(this.serialize())),this.cache.hash):Fe(this.serialize())}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const s=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(s)}const e=this.getMessageToVerifySignature(),{v:n,r,s:i}=this;this._validateHighS();try{return So(e,n+BigInt(27),re(r),re(i))}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(e,n,r){const i=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Yt.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:e-BigInt(27),r:ue(n),s:ue(r)},i)}toJSON(){const e=iu(this.accessList);return{chainId:ge(this.chainId),nonce:ge(this.nonce),maxPriorityFeePerGas:ge(this.maxPriorityFeePerGas),maxFeePerGas:ge(this.maxFeePerGas),gasLimit:ge(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:ge(this.value),data:ne(this.data),accessList:e,v:this.v!==void 0?ge(this.v):void 0,r:this.r!==void 0?ge(this.r):void 0,s:this.s!==void 0?ge(this.s):void 0}}errorStr(){let e=this._getSharedErrorPostfix();return e+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,e}_errorMsg(e){return`${e} (${this.errorStr()})`}}const Ma=1,ia=fe(Ma.toString(16).padStart(2,"0"));class Xt extends jn{static fromTxData(e,n={}){return new Xt(e,n)}static fromSerializedTx(e,n={}){if(!yo(e.subarray(0,1),ia))throw new Error(`Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ${Ma}, received: ${ne(e.subarray(0,1))}`);const r=Xe.RLP.decode(Uint8Array.from(e.subarray(1)));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return Xt.fromValuesArray(r,n)}static fromValuesArray(e,n={}){if(e.length!==8&&e.length!==11)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");const[r,i,s,o,a,d,u,c,l,h,p]=e;this._validateNotArray({chainId:r,v:l}),ho({nonce:i,gasPrice:s,gasLimit:o,value:d,v:l,r:h,s:p});const v=[];return new Xt({chainId:ue(r),nonce:i,gasPrice:s,gasLimit:o,to:a,value:d,data:u,accessList:c??v,v:l!==void 0?ue(l):void 0,r:h,s:p},n)}constructor(e,n={}){var r;super(Object.assign(Object.assign({},e),{type:Ma}),n),this.DEFAULT_HARDFORK="berlin";const{chainId:i,accessList:s,gasPrice:o}=e;if(this.common=this._getCommon(n.common,i),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([2718,2930]);const a=nu(s??[]);if(this.accessList=a.accessList,this.AccessListJSON=a.AccessListJSON,ru(this.accessList),this.gasPrice=ue(pe(o===""?"0x":o)),this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),jn._validateNotArray(e),this.gasPrice*this.gasLimit>ki){const u=this._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(u)}this._validateYParity(),this._validateHighS(),(!((r=n?.freeze)!==null&&r!==void 0)||r)&&Object.freeze(this)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let e=super.getDataFee();return e+=BigInt(su(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:e,hardfork:this.common.hardfork()}),e}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}raw(){return[re(this.chainId),re(this.nonce),re(this.gasPrice),re(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),re(this.value),this.data,this.accessList,this.v!==void 0?re(this.v):Uint8Array.from([]),this.r!==void 0?re(this.r):Uint8Array.from([]),this.s!==void 0?re(this.s):Uint8Array.from([])]}serialize(){const e=this.raw();return He(ia,Xe.RLP.encode(e))}getMessageToSign(e=!0){const n=this.raw().slice(0,8),r=He(ia,Xe.RLP.encode(n));return e?Fe(r):r}hash(){if(!this.isSigned()){const e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Fe(this.serialize())),this.cache.hash):Fe(this.serialize())}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const s=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(s)}const e=this.getMessageToVerifySignature(),{v:n,r,s:i}=this;this._validateHighS();try{return So(e,n+BigInt(27),re(r),re(i))}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(e,n,r){const i=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Xt.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:e-BigInt(27),r:ue(n),s:ue(r)},i)}toJSON(){const e=iu(this.accessList);return{chainId:ge(this.chainId),nonce:ge(this.nonce),gasPrice:ge(this.gasPrice),gasLimit:ge(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:ge(this.value),data:ne(this.data),accessList:e,v:this.v!==void 0?ge(this.v):void 0,r:this.r!==void 0?ge(this.r):void 0,s:this.s!==void 0?ge(this.s):void 0}}errorStr(){var e,n;let r=this._getSharedErrorPostfix();return r+=` gasPrice=${this.gasPrice} accessListCount=${(n=(e=this.accessList)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0}`,r}_errorMsg(e){return`${e} (${this.errorStr()})`}}const m_=0;function Pd(t,e){const n=Number(t),r=Number(e)*2;return n===r+35||n===r+36}class Ot extends jn{static fromTxData(e,n={}){return new Ot(e,n)}static fromSerializedTx(e,n={}){const r=Xe.RLP.decode(e);if(!Array.isArray(r))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(r,n)}static fromValuesArray(e,n={}){if(e.length!==6&&e.length!==9)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");const[r,i,s,o,a,d,u,c,l]=e;return ho({nonce:r,gasPrice:i,gasLimit:s,value:a,v:u,r:c,s:l}),new Ot({nonce:r,gasPrice:i,gasLimit:s,to:o,value:a,data:d,v:u,r:c,s:l},n)}constructor(e,n={}){var r;if(super(Object.assign(Object.assign({},e),{type:m_}),n),this.common=this._validateTxV(this.v,n.common),this.gasPrice=ue(pe(e.gasPrice===""?"0x":e.gasPrice)),this.gasPrice*this.gasLimit>ki){const s=this._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(s)}this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),jn._validateNotArray(e),this.common.gteHardfork("spuriousDragon")&&(this.isSigned()?Pd(this.v,this.common.chainId())&&this.activeCapabilities.push(ot.EIP155ReplayProtection):this.activeCapabilities.push(ot.EIP155ReplayProtection)),(!((r=n?.freeze)!==null&&r!==void 0)||r)&&Object.freeze(this)}raw(){return[re(this.nonce),re(this.gasPrice),re(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),re(this.value),this.data,this.v!==void 0?re(this.v):Uint8Array.from([]),this.r!==void 0?re(this.r):Uint8Array.from([]),this.s!==void 0?re(this.s):Uint8Array.from([])]}serialize(){return Xe.RLP.encode(this.raw())}_getMessageToSign(){const e=[re(this.nonce),re(this.gasPrice),re(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),re(this.value),this.data];return this.supports(ot.EIP155ReplayProtection)&&(e.push(pe(this.common.chainId())),e.push(Pi(pe(0))),e.push(Pi(pe(0)))),e}getMessageToSign(e=!0){const n=this._getMessageToSign();return e?Fe(Xe.RLP.encode(n)):n}getDataFee(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:super.getDataFee(),hardfork:this.common.hardfork()}),super.getDataFee())}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}hash(){if(!this.isSigned()){const e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Fe(Xe.RLP.encode(this.raw()))),this.cache.hash):Fe(Xe.RLP.encode(this.raw()))}getMessageToVerifySignature(){if(!this.isSigned()){const n=this._errorMsg("This transaction is not signed");throw new Error(n)}const e=this._getMessageToSign();return Fe(Xe.RLP.encode(e))}getSenderPublicKey(){const e=this.getMessageToVerifySignature(),{v:n,r,s:i}=this;this._validateHighS();try{return So(e,n,re(r),re(i),this.supports(ot.EIP155ReplayProtection)?this.common.chainId():void 0)}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(e,n,r){let i=e;this.supports(ot.EIP155ReplayProtection)&&(i+=this.common.chainId()*BigInt(2)+BigInt(8));const s=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Ot.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:i,r:ue(n),s:ue(r)},s)}toJSON(){return{nonce:ge(this.nonce),gasPrice:ge(this.gasPrice),gasLimit:ge(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:ge(this.value),data:ne(this.data),v:this.v!==void 0?ge(this.v):void 0,r:this.r!==void 0?ge(this.r):void 0,s:this.s!==void 0?ge(this.s):void 0}}_validateTxV(e,n){let r;const i=e!==void 0?Number(e):void 0;if(i!==void 0&&i<37&&i!==27&&i!==28)throw new Error(`Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ${i}`);if(i!==void 0&&i!==0&&(!n||n.gteHardfork("spuriousDragon"))&&i!==27&&i!==28)if(n){if(!Pd(BigInt(i),n.chainId()))throw new Error(`Incompatible EIP155-based V ${i} and chain id ${n.chainId()}. See the Common parameter of the Transaction constructor to set the chain id.`)}else{let s;(i-35)%2===0?s=35:s=36,r=BigInt(i-s)/BigInt(2)}return this._getCommon(n,r)}errorStr(){let e=this._getSharedErrorPostfix();return e+=` gasPrice=${this.gasPrice}`,e}_errorMsg(e){return`${e} (${this.errorStr()})`}}const sa=new Map;class jt{constructor(){}static typeToInt(e){return Number(ue(pe(e)))}static registerTransactionType(e,n){const r=jt.typeToInt(e);sa.set(r,n)}static fromTxData(e,n={}){if(!("type"in e)||e.type===void 0)return Ot.fromTxData(e,n);const r=jt.typeToInt(e.type);if(r===0)return Ot.fromTxData(e,n);if(r===1)return Xt.fromTxData(e,n);if(r===2)return Yt.fromTxData(e,n);const i=sa.get(r);if(i?.fromTxData)return i.fromTxData(e,n);throw new Error(`Tx instantiation with type ${r} not supported`)}static fromSerializedData(e,n={}){if(e[0]<=127)switch(e[0]){case 1:return Xt.fromSerializedTx(e,n);case 2:return Yt.fromSerializedTx(e,n);default:{const r=sa.get(Number(e[0]));if(r?.fromSerializedTx)return r.fromSerializedTx(e,n);throw new Error(`TypedTransaction with ID ${e[0]} unknown`)}}else return Ot.fromSerializedTx(e,n)}static fromBlockBodyData(e,n={}){if(qt(e))return this.fromSerializedData(e,n);if(Array.isArray(e))return Ot.fromValuesArray(e,n);throw new Error("Cannot decode transaction: unknown type input")}}var Ro=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const Qn=(t,e)=>{let n;if(!e&&typeof t=="string"&&z(t)&&t.length!==66)throw new la;try{n=qt(t)?t:xt(t)}catch{throw new nh}if(!e&&n.byteLength!==32)throw new la;return n},Ki=(t,e=!1)=>{const n=z(t)?t:et(t),r=fe(n),i=fe(bo(`Ethereum Signed Message:
10
+ ${r.byteLength}`)),s=e?r:He(i,r);return Qe(s)},ou=(t,e)=>{const n=Qn(e),r=Qt.sign(t.substring(2),n),i=r.toCompactRawBytes(),s=r.r.toString(16).padStart(64,"0"),o=r.s.toString(16).padStart(64,"0"),a=r.recovery+27;return{messageHash:t,v:he(a),r:`0x${s}`,s:`0x${o}`,signature:`${ne(i)}${a.toString(16)}`}},au=(t,e)=>{const n=Ki(t),{messageHash:r,v:i,r:s,s:o,signature:a}=ou(n,e);return{message:t,messageHash:r,v:i,r:s,s:o,signature:a}},p_=(t,e)=>{const n=Ki(t,!0),{messageHash:r,v:i,r:s,s:o,signature:a}=ou(n,e);return{message:t,messageHash:r,v:i,r:s,s:o,signature:a}},xp=(t,e)=>Ro(void 0,void 0,void 0,function*(){const n=t.sign(fe(e));if(A(n.v)||A(n.r)||A(n.s))throw new _s("Signer Error");const r=n.validate(!0);if(r.length>0){let o="Signer Error ";for(const a of r)o+=`${o} ${a}.`;throw new _s(o)}const i=ne(n.serialize()),s=Qe(i);return{messageHash:ne(n.getMessageToSign(!0)),v:`0x${n.v.toString(16)}`,r:`0x${n.r.toString(16).padStart(64,"0")}`,s:`0x${n.s.toString(16).padStart(64,"0")}`,rawTransaction:i,transactionHash:ne(s)}}),Ip=t=>{if(A(t))throw new bh;const e=jt.fromSerializedData(fe(t));return Se(e.getSenderAddress().toString())},Hs=(t,e,n,r,i)=>{if(typeof t=="object"){const l=`${t.r}${t.s.slice(2)}${t.v.slice(2)}`;return Hs(t.messageHash,l,n)}if(typeof e=="string"&&typeof n=="string"&&!A(r)){const l=`${n}${r.slice(2)}${e.slice(2)}`;return Hs(t,l,i)}if(A(e))throw new rh("signature string undefined");const s=130,o=n?t:Ki(t);let a=parseInt(e.substring(s),16);a>26&&(a-=27);const d=Qt.Signature.fromCompact(e.slice(2,s)).addRecoveryBit(a).recoverPublicKey(o.replace("0x","")).toRawBytes(!1),u=Qe(d.subarray(1));return Se(`0x${u.slice(-40)}`)},Zi=t=>{const e=Qn(t),n=Qt.getPublicKey(e,!1),i=Qe(n.slice(1)).slice(-40);return Se(`0x${i}`)},Tp=(t,e)=>{const n=Qn(t);return`0x${ne(Qt.getPublicKey(n,e)).slice(4)}`},cu=(t,e,n)=>Ro(void 0,void 0,void 0,function*(){var r,i,s,o,a,d,u;const c=Qn(t);let l;if(n?.salt?l=typeof n.salt=="string"?fe(n.salt):n.salt:l=_i(32),!(lo(e)||qt(e)))throw new oh;const h=typeof e=="string"?fe(et(e)):e;let p;if(n?.iv){if(p=typeof n.iv=="string"?fe(n.iv):n.iv,p.length!==16)throw new ah}else p=_i(16);const v=(r=n?.kdf)!==null&&r!==void 0?r:"scrypt";let m,y;if(v==="pbkdf2"){if(y={dklen:(i=n?.dklen)!==null&&i!==void 0?i:32,salt:ne(l).replace("0x",""),c:(s=n?.c)!==null&&s!==void 0?s:262144,prf:"hmac-sha256"},y.c<1e3)throw new ch;m=ap(h,l,y.c,y.dklen,"sha256")}else if(v==="scrypt")y={n:(o=n?.n)!==null&&o!==void 0?o:8192,r:(a=n?.r)!==null&&a!==void 0?a:8,p:(d=n?.p)!==null&&d!==void 0?d:1,dklen:(u=n?.dklen)!==null&&u!==void 0?u:32,salt:ne(l).replace("0x","")},m=cp(h,l,y.n,y.p,y.r,y.dklen);else throw new ic;const f=yield Qc(c,m.slice(0,16),p,"aes-128-ctr"),b=ne(f).slice(2),w=Qe(He(m.slice(16,32),f)).replace("0x","");return{version:3,id:Mc(),address:Zi(c).toLowerCase().replace("0x",""),crypto:{ciphertext:b,cipherparams:{iv:ne(p).replace("0x","")},cipher:"aes-128-ctr",kdf:v,kdfparams:y,mac:w}}}),ko=(t,e)=>{const n=Qn(t,e);return{address:Zi(n),privateKey:ne(n),signTransaction:r=>{throw new _s("Do not have network access to sign the transaction")},sign:r=>au(typeof r=="string"?r:JSON.stringify(r),n),encrypt:(r,i)=>Ro(void 0,void 0,void 0,function*(){return cu(n,r,i)})}},Sp=()=>{const t=Qt.utils.randomPrivateKey();return ko(`${ne(t)}`)},Rp=(t,e,n)=>Ro(void 0,void 0,void 0,function*(){const r=typeof t=="object"?t:JSON.parse(n?t.toLowerCase():t);if(q.validateJSONSchema(pp,r),r.version!==3)throw new sh;const i=typeof e=="string"?fe(et(e)):e;q.validate(["bytes"],[i]);let s;if(r.crypto.kdf==="scrypt"){const u=r.crypto.kdfparams,c=typeof u.salt=="string"?fe(u.salt):u.salt;s=cp(i,c,u.n,u.p,u.r,u.dklen)}else if(r.crypto.kdf==="pbkdf2"){const u=r.crypto.kdfparams,c=typeof u.salt=="string"?fe(u.salt):u.salt;s=ap(i,c,u.c,u.dklen,"sha256")}else throw new ic;const o=fe(r.crypto.ciphertext);if(Qe(He(s.slice(16,32),o)).replace("0x","")!==r.crypto.mac)throw new ih;const d=yield TA(fe(r.crypto.ciphertext),s.slice(0,16),fe(r.crypto.cipherparams.iv));return ko(d)}),g_=Object.freeze(Object.defineProperty({__proto__:null,AccessListEIP2930Transaction:Xt,BaseTransaction:jn,get Capability(){return ot},get Chain(){return Bi},Common:Ee,get ConsensusAlgorithm(){return Ca},get ConsensusType(){return Pa},get CustomChain(){return Re},FeeMarketEIP1559Transaction:Yt,get Hardfork(){return le},Transaction:Ot,TransactionFactory:jt,get TypeOutput(){return ze},Wallet:Ti,assertIsUint8Array:To,bigIntToHex:ge,bigIntToUint8Array:bp,bigIntToUnpaddedUint8Array:re,create:Sp,decrypt:Rp,ecrecover:So,encrypt:cu,hashMessage:Ki,intToUint8Array:vp,isAccessList:_p,isAccessListUint8Array:wp,keyStoreSchema:pp,padToEven:eu,parseAndValidatePrivateKey:Qn,parseGethGenesis:yp,privateKeyToAccount:ko,privateKeyToAddress:Zi,privateKeyToPublicKey:Tp,recover:Hs,recoverTransaction:Ip,setLengthLeft:Na,sign:au,signMessageWithPrivateKey:ou,signRaw:p_,signTransaction:xp,stripHexPrefix:Xc,stripZeros:Ap,toType:vn,toUint8Array:pe,txUtils:h_,uint8ArrayToBigInt:ue,unpadUint8Array:Pi,zeros:tu},Symbol.toStringTag,{value:"Module"}));var Cd=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const kp=1e3;class Bp{constructor(e){this._requestManager=e,this._requests=new Map}get requests(){return[...this._requests.values()].map(e=>e.payload)}add(e){const n=Ln(e),r=new Ds;return this._requests.set(n.id,{payload:n,promise:r}),r}execute(e){return Cd(this,void 0,void 0,function*(){var n;if(this.requests.length===0)return Promise.resolve([]);const r=new Ds({timeout:(n=e?.timeout)!==null&&n!==void 0?n:kp,eagerStart:!0,timeoutMessage:"Batch request timeout"});return this._processBatchRequest(r).catch(i=>r.reject(i)),r.catch(i=>{i instanceof sc&&this._abortAllRequests("Batch request timeout"),r.reject(i)}),r})}_processBatchRequest(e){return Cd(this,void 0,void 0,function*(){var n,r;const i=yield this._requestManager.sendBatch([...this._requests.values()].map(a=>a.payload));if(i.length!==this._requests.size)throw this._abortAllRequests("Invalid batch response"),new st(i,`Batch request size mismatch the results size. Requests: ${this._requests.size}, Responses: ${i.length}`);const s=this.requests.map(a=>a.id).map(Number).sort((a,d)=>a-d),o=i.map(a=>a.id).map(Number).sort((a,d)=>a-d);if(JSON.stringify(s)!==JSON.stringify(o))throw this._abortAllRequests("Invalid batch response"),new st(i,`Batch request mismatch the results. Requests: [${s.join()}], Responses: [${o.join()}]`);for(const a of i)tn(a)?(n=this._requests.get(a.id))===null||n===void 0||n.promise.resolve(a.result):nn(a)&&((r=this._requests.get(a.id))===null||r===void 0||r.promise.reject(a.error));e.resolve(i)})}_abortAllRequests(e){for(const{promise:n}of this._requests.values())n.reject(new ph(e))}}var y_=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,[])).next())})};class Ce extends np{constructor(e){var n;if(super(),this.providers=rn.providers,$(e)||typeof e=="string"&&e.trim()!==""||xi(e)){this._requestManager=new rn(e),this._subscriptionManager=new Ii(this._requestManager,{});return}const{config:r,provider:i,requestManager:s,subscriptionManager:o,registeredSubscriptions:a,accountProvider:d,wallet:u,requestManagerMiddleware:c}=e;this.setConfig(r??{}),this._requestManager=s??new rn(i,(n=r?.enableExperimentalFeatures)===null||n===void 0?void 0:n.useSubscriptionWhenCheckingBlockTimeout,c),o?this._subscriptionManager=o:this._subscriptionManager=new Ii(this.requestManager,a??{}),d&&(this._accountProvider=d),u&&(this._wallet=u)}get requestManager(){return this._requestManager}get subscriptionManager(){return this._subscriptionManager}get wallet(){return this._wallet}get accountProvider(){return this._accountProvider}static fromContextObject(...e){return new this(...e.reverse())}getContextObject(){var e;return{config:this.config,provider:this.provider,requestManager:this.requestManager,subscriptionManager:this.subscriptionManager,registeredSubscriptions:(e=this.subscriptionManager)===null||e===void 0?void 0:e.registeredSubscriptions,providers:this.providers,wallet:this.wallet,accountProvider:this.accountProvider}}use(e,...n){const r=new e(...n,this.getContextObject());return this.on(fn.CONFIG_CHANGE,i=>{r.setConfig({[i.name]:i.newValue})}),this[e.name]=r,r}link(e){this.setConfig(e.config),this._requestManager=e.requestManager,this.provider=e.provider,this._subscriptionManager=e.subscriptionManager,this._wallet=e.wallet,this._accountProvider=e._accountProvider,e.on(fn.CONFIG_CHANGE,n=>{this.setConfig({[n.name]:n.newValue})})}registerPlugin(e){if(this[e.pluginNamespace]!==void 0)throw new gh(e.pluginNamespace);const n={[e.pluginNamespace]:e};n[e.pluginNamespace].link(this),Object.assign(this,n)}get provider(){return this.currentProvider}set provider(e){this.requestManager.setProvider(e)}get currentProvider(){return this.requestManager.provider}set currentProvider(e){this.requestManager.setProvider(e)}get givenProvider(){return Ce.givenProvider}setProvider(e){return this.provider=e,!0}setRequestManagerMiddleware(e){this.requestManager.setMiddleware(e)}get BatchRequest(){return Bp.bind(void 0,this._requestManager)}extend(e){var n;return e.property&&!this[e.property]&&(this[e.property]={}),(n=e.methods)===null||n===void 0||n.forEach(r=>{const i=(...s)=>y_(this,void 0,void 0,function*(){return this.requestManager.send({method:r.call,params:s})});e.property?this[e.property][r.name]=i:this[r.name]=i}),this}}Ce.providers=rn.providers;class Pp extends Ce{registerNewTransactionType(e,n){jt.registerTransactionType(e,n)}}class v_ extends Pp{}class me{constructor(e){if(this.toAddress=()=>{if(this.isDirect()){const n=this._iban.slice(4),r=me._parseInt(n,36),i=Ar(r,40);return Se(i)}throw new Error("Iban is indirect and cannot be converted. Must be length of 34 or 35")},me.isIndirect(e)||me.isDirect(e))this._iban=e;else throw new Error("Invalid IBAN was provided")}static isDirect(e){return e.length===34||e.length===35}isDirect(){return me.isDirect(this._iban)}static isIndirect(e){return e.length===20}isIndirect(){return me.isIndirect(this._iban)}static isValid(e){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(e)&&me._mod9710(me._iso13616Prepare(e))===1}isValid(){return me.isValid(this._iban)}static fromBban(e){const i=`0${(98-this._mod9710(this._iso13616Prepare(`XE00${e}`))).toString()}`.slice(-2);return new me(`XE${i}${e}`)}static createIndirect(e){return me.fromBban(`ETH${e.institution}${e.identifier}`)}static fromAddress(e){if(!_e(e))throw new Pr(e);const r=BigInt(se(e)).toString(36),i=Ar(r,15);return me.fromBban(i.toUpperCase())}static toIban(e){return me.fromAddress(e).toString()}client(){return this.isIndirect()?this._iban.slice(11):""}checksum(){return this._iban.slice(2,4)}institution(){return this.isIndirect()?this._iban.slice(7,11):""}toString(){return this._iban}}me._iso13616Prepare=t=>{const r=t.toUpperCase();return`${r.slice(4)}${r.slice(0,4)}`.split("").map(s=>{const o=s.charCodeAt(0);return o>=65&&o<=90?o-65+10:s}).join("")};me._parseInt=(t,e)=>[...t].reduce((n,r)=>BigInt(parseInt(r,e))+BigInt(e)*n,BigInt(0));me._mod9710=t=>{let e=t,n;for(;e.length>2;)n=e.slice(0,9),e=`${(parseInt(n,10)%97).toString()}${e.slice(n.length)}`;return parseInt(e,10)%97};me.toAddress=t=>new me(t).toAddress();const b_=Object.freeze(Object.defineProperty({__proto__:null,Iban:me,default:me},Symbol.toStringTag,{value:"Module"})),Cp=t=>t.map(e=>he(e)),Np=t=>({address:Se(t.address),nonce:Ta(t.nonce),balance:Ta(t.balance)}),Mt=t=>Pe(t),xr=t=>{if(!A(t))return typeof t=="string"&&xe(t)?t:t==="genesis"?"0x0":typeof t=="string"&&Tn(t)?t.toLowerCase():he(t)},Op=(t,e)=>xr(t||e),Hn=t=>{if(me.isValid(t)&&me.isDirect(t))return new me(t).toAddress().toLowerCase();if(Bc(t))return`0x${t.toLowerCase().replace("0x","")}`;throw new Ft(`Provided address ${t} is invalid, the capitalization checksum test failed, or it's an indirect IBAN address which can't be converted.`)},Bo=t=>{var e;const n=Object.assign({},t);if(t.to&&(n.to=Hn(t.to)),t.data&&t.input)throw new Ft(`You can't have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.`);if(!t.input&&t.data&&(n.input=t.data,delete n.data),t.input&&!t.input.startsWith("0x")&&(n.input=`0x${t.input}`),n.input&&!Tn(n.input))throw new Ft("The input field must be HEX encoded data.");return(t.gas||t.gasLimit)&&(n.gas=Pe((e=t.gas)!==null&&e!==void 0?e:t.gasLimit)),(t.maxPriorityFeePerGas||t.maxFeePerGas)&&delete n.gasPrice,["gasPrice","gas","value","maxPriorityFeePerGas","maxFeePerGas","nonce","chainId"].filter(r=>!A(n[r])).forEach(r=>{n[r]=he(n[r])}),n},Mp=(t,e)=>{var n;const r=Bo(t),i=(n=r.from)!==null&&n!==void 0?n:e;return i&&(r.from=Hn(i)),r},Lp=(t,e)=>{var n;const r=Bo(t);if(typeof r.from!="number"&&!(r.from&&typeof r.from=="object")){if(r.from=(n=r.from)!==null&&n!==void 0?n:e,!t.from&&typeof t.from!="number")throw new Ft('The send transactions "from" field must be defined!');r.from=Hn(t.from)}return r},Fp=t=>Tn(t)?t:et(t),uu=t=>{const e=Object.assign({},t);return t.blockNumber&&(e.blockNumber=se(t.blockNumber)),t.transactionIndex&&(e.transactionIndex=se(t.transactionIndex)),e.nonce=se(t.nonce),e.gas=se(t.gas),t.gasPrice&&(e.gasPrice=Mt(t.gasPrice)),t.maxFeePerGas&&(e.maxFeePerGas=Mt(t.maxFeePerGas)),t.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=Mt(t.maxPriorityFeePerGas)),t.type&&(e.type=se(t.type)),e.value=Mt(t.value),t.to&&Bc(t.to)?e.to=Se(t.to):e.to=void 0,t.from&&(e.from=Se(t.from)),e},Us=t=>{if(A(t))return null;const e=String(t);return dn(e)?e:bo(e)},Dp=t=>{var e;const n=A(t)?{}:$t({},t);return A(n.fromBlock)&&(n.fromBlock=it.LATEST),n.fromBlock=xr(n.fromBlock),A(n.toBlock)||(n.toBlock=xr(n.toBlock)),n.topics=(e=n.topics)!==null&&e!==void 0?e:[],n.topics=n.topics.map(r=>Array.isArray(r)?r.map(Us):Us(r)),n.address&&(n.address=Array.isArray(n.address)?n.address.map(r=>Hn(r)):Hn(n.address)),n},du=t=>{const e=Object.assign({},t),n=typeof t.logIndex=="string"?t.logIndex:he(t.logIndex);if(typeof t.blockHash=="string"&&typeof t.transactionHash=="string"){const r=Qe(`${t.blockHash.replace("0x","")}${t.transactionHash.replace("0x","")}${n.replace("0x","")}`);e.id=`log_${r.replace("0x","").slice(0,8)}`}else t.id||(e.id=void 0);return t.blockNumber&&Tn(t.blockNumber)&&(e.blockNumber=se(t.blockNumber)),t.transactionIndex&&Tn(t.transactionIndex)&&(e.transactionIndex=se(t.transactionIndex)),t.logIndex&&Tn(t.logIndex)&&(e.logIndex=se(t.logIndex)),t.address&&(e.address=Se(t.address)),e},jp=t=>{if(typeof t!="object")throw new Ft(`Received receipt is invalid: ${String(t)}`);const e=Object.assign({},t);return t.blockNumber&&(e.blockNumber=se(t.blockNumber)),t.transactionIndex&&(e.transactionIndex=se(t.transactionIndex)),e.cumulativeGasUsed=se(t.cumulativeGasUsed),e.gasUsed=se(t.gasUsed),t.logs&&Array.isArray(t.logs)&&(e.logs=t.logs.map(du)),t.effectiveGasPrice&&(e.effectiveGasPrice=se(t.effectiveGasPrice)),t.contractAddress&&(e.contractAddress=Se(t.contractAddress)),t.status&&(e.status=!!parseInt(t.status,10)),e},Hp=t=>{const e=Object.assign({},t);return e.gasLimit=se(t.gasLimit),e.gasUsed=se(t.gasUsed),e.size=se(t.size),e.timestamp=se(t.timestamp),t.number&&(e.number=se(t.number)),t.difficulty&&(e.difficulty=Mt(t.difficulty)),t.totalDifficulty&&(e.totalDifficulty=Mt(t.totalDifficulty)),t.transactions&&Array.isArray(t.transactions)&&(e.transactions=t.transactions.map(uu)),t.miner&&(e.miner=Se(t.miner)),t.baseFeePerGas&&(e.baseFeePerGas=Mt(t.baseFeePerGas)),e},Up=t=>{var e;const n=Object.assign({},t);return t.ttl&&(n.ttl=he(t.ttl)),t.workToProve&&(n.workToProve=he(t.workToProve)),t.priority&&(n.priority=he(t.priority)),t.topics&&!Array.isArray(t.topics)&&(n.topics=t.topics?[t.topics]:[]),n.topics=(e=n.topics)===null||e===void 0?void 0:e.map(r=>r.startsWith("0x")?r:bo(r)),n},Gp=t=>{var e;const n=Object.assign({},t);return t.expiry&&(n.expiry=se(t.expiry)),t.sent&&(n.sent=se(t.sent)),t.ttl&&(n.ttl=se(t.ttl)),t.workProved&&(n.workProved=se(t.workProved)),t.topics||(n.topics=[]),n.topics=(e=n.topics)===null||e===void 0?void 0:e.map(jm),n},qp=t=>{const e=Object.assign({},t);return e.startingBlock=se(t.startingBlock),e.currentBlock=se(t.currentBlock),e.highestBlock=se(t.highestBlock),t.knownStates&&(e.knownStates=se(t.knownStates)),t.pulledStates&&(e.pulledStates=se(t.pulledStates)),e},A_=Object.freeze(Object.defineProperty({__proto__:null,inputAddressFormatter:Hn,inputBlockNumberFormatter:xr,inputCallFormatter:Mp,inputDefaultBlockNumberFormatter:Op,inputLogFormatter:Dp,inputPostFormatter:Up,inputSignFormatter:Fp,inputStorageKeysFormatter:Cp,inputTopicFormatter:Us,inputTransactionFormatter:Lp,outputBigIntegerFormatter:Mt,outputBlockFormatter:Hp,outputLogFormatter:du,outputPostFormatter:Gp,outputProofFormatter:Np,outputSyncingFormatter:qp,outputTransactionFormatter:uu,outputTransactionReceiptFormatter:jp,txInputOptionsFormatter:Bo},Symbol.toStringTag,{value:"Module"}));var oa=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})},$p;class lu extends zi{constructor(e){super(),this[$p]="Promise",this._promise=new Promise(e)}then(e,n){return oa(this,void 0,void 0,function*(){return this._promise.then(e,n)})}catch(e){return oa(this,void 0,void 0,function*(){return this._promise.catch(e)})}finally(e){return oa(this,void 0,void 0,function*(){return this._promise.finally(e)})}on(e,n){return super.on(e,n),this}once(e,n){return super.once(e,n),this}}$p=Symbol.toStringTag;const BI=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_BATCH_REQUEST_TIMEOUT:kp,Web3BatchRequest:Bp,Web3Config:np,get Web3ConfigEvent(){return fn},Web3Context:Ce,Web3EthPluginBase:v_,Web3EventEmitter:zi,Web3PluginBase:Pp,Web3PromiEvent:lu,Web3RequestManager:rn,get Web3RequestManagerEvent(){return Fn},Web3Subscription:Nr,Web3SubscriptionManager:Ii,formatters:A_,inputAddressFormatter:Hn,inputBlockNumberFormatter:xr,inputCallFormatter:Mp,inputDefaultBlockNumberFormatter:Op,inputLogFormatter:Dp,inputPostFormatter:Up,inputSignFormatter:Fp,inputStorageKeysFormatter:Cp,inputTopicFormatter:Us,inputTransactionFormatter:Lp,isEIP1193Provider:Gc,isLegacyRequestProvider:Uc,isLegacySendAsyncProvider:$c,isLegacySendProvider:qc,isMetaMaskProvider:xA,isSupportSubscriptions:rp,isSupportedProvider:xi,isWeb3Provider:Hc,outputBigIntegerFormatter:Mt,outputBlockFormatter:Hp,outputLogFormatter:du,outputPostFormatter:Gp,outputProofFormatter:Np,outputSyncingFormatter:qp,outputTransactionFormatter:uu,outputTransactionReceiptFormatter:jp,txInputOptionsFormatter:Bo},Symbol.toStringTag,{value:"Module"}));(function(t,e){if(t.setImmediate)return;var n=1,r={},i=!1,s=t.document,o;function a(b){typeof b!="function"&&(b=new Function(""+b));for(var w=new Array(arguments.length-1),I=0;I<w.length;I++)w[I]=arguments[I+1];var x={callback:b,args:w};return r[n]=x,o(n),n++}function d(b){delete r[b]}function u(b){var w=b.callback,I=b.args;switch(I.length){case 0:w();break;case 1:w(I[0]);break;case 2:w(I[0],I[1]);break;case 3:w(I[0],I[1],I[2]);break;default:w.apply(e,I);break}}function c(b){if(i)setTimeout(c,0,b);else{var w=r[b];if(w){i=!0;try{u(w)}finally{d(b),i=!1}}}}function l(){o=function(b){process.nextTick(function(){c(b)})}}function h(){if(t.postMessage&&!t.importScripts){var b=!0,w=t.onmessage;return t.onmessage=function(){b=!1},t.postMessage("","*"),t.onmessage=w,b}}function p(){var b="setImmediate$"+Math.random()+"$",w=function(I){I.source===t&&typeof I.data=="string"&&I.data.indexOf(b)===0&&c(+I.data.slice(b.length))};t.addEventListener?t.addEventListener("message",w,!1):t.attachEvent("onmessage",w),o=function(I){t.postMessage(b+I,"*")}}function v(){var b=new MessageChannel;b.port1.onmessage=function(w){var I=w.data;c(I)},o=function(w){b.port2.postMessage(w)}}function m(){var b=s.documentElement;o=function(w){var I=s.createElement("script");I.onreadystatechange=function(){c(w),I.onreadystatechange=null,b.removeChild(I),I=null},b.appendChild(I)}}function y(){o=function(b){setTimeout(c,0,b)}}var f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,{}.toString.call(t.process)==="[object process]"?l():h()?p():t.MessageChannel?v():s&&"onreadystatechange"in s.createElement("script")?m():y(),f.setImmediate=a,f.clearImmediate=d})(typeof self>"u"?typeof globalThis>"u"?void 0:globalThis:self);var Q=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};function fu(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_protocolVersion",params:[]})})}function hu(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_syncing",params:[]})})}function mu(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_coinbase",params:[]})})}function pu(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_mining",params:[]})})}function Qp(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_hashrate",params:[]})})}function Vp(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_gasPrice",params:[]})})}function zp(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_maxPriorityFeePerGas",params:[]})})}function Jp(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_accounts",params:[]})})}function Wp(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_blockNumber",params:[]})})}function Kp(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["address","blockNumberOrTag"],[e,n]),t.send({method:"eth_getBalance",params:[e,n]})})}function Zp(t,e,n,r){return Q(this,void 0,void 0,function*(){return q.validate(["address","hex","blockNumberOrTag"],[e,n,r]),t.send({method:"eth_getStorageAt",params:[e,n,r]})})}function Yp(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["address","blockNumberOrTag"],[e,n]),t.send({method:"eth_getTransactionCount",params:[e,n]})})}function Xp(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["bytes32"],[e]),t.send({method:"eth_getBlockTransactionCountByHash",params:[e]})})}function eg(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["blockNumberOrTag"],[e]),t.send({method:"eth_getBlockTransactionCountByNumber",params:[e]})})}function tg(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["bytes32"],[e]),t.send({method:"eth_getUncleCountByBlockHash",params:[e]})})}function ng(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["blockNumberOrTag"],[e]),t.send({method:"eth_getUncleCountByBlockNumber",params:[e]})})}function rg(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["address","blockNumberOrTag"],[e,n]),t.send({method:"eth_getCode",params:[e,n]})})}function ig(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["address","hex"],[e,n]),t.send({method:"eth_sign",params:[e,n]})})}function sg(t,e){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_signTransaction",params:[e]})})}function og(t,e){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_sendTransaction",params:[e]})})}function gu(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["hex"],[e]),t.send({method:"eth_sendRawTransaction",params:[e]})})}function ag(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["blockNumberOrTag"],[n]),t.send({method:"eth_call",params:[e,n]})})}function cg(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["blockNumberOrTag"],[n]),t.send({method:"eth_estimateGas",params:[e,n]})})}function ug(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["bytes32","bool"],[e,n]),t.send({method:"eth_getBlockByHash",params:[e,n]})})}function yu(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["blockNumberOrTag","bool"],[e,n]),t.send({method:"eth_getBlockByNumber",params:[e,n]})})}function dg(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["bytes32"],[e]),t.send({method:"eth_getTransactionByHash",params:[e]})})}function lg(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["bytes32","hex"],[e,n]),t.send({method:"eth_getTransactionByBlockHashAndIndex",params:[e,n]})})}function fg(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["blockNumberOrTag","hex"],[e,n]),t.send({method:"eth_getTransactionByBlockNumberAndIndex",params:[e,n]})})}function hg(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["bytes32"],[e]),t.send({method:"eth_getTransactionReceipt",params:[e]})})}function mg(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["bytes32","hex"],[e,n]),t.send({method:"eth_getUncleByBlockHashAndIndex",params:[e,n]})})}function pg(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["blockNumberOrTag","hex"],[e,n]),t.send({method:"eth_getUncleByBlockNumberAndIndex",params:[e,n]})})}function w_(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_getCompilers",params:[]})})}function __(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["string"],[e]),t.send({method:"eth_compileSolidity",params:[e]})})}function E_(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["string"],[e]),t.send({method:"eth_compileLLL",params:[e]})})}function x_(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["string"],[e]),t.send({method:"eth_compileSerpent",params:[e]})})}function gg(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["filter"],[e]),t.send({method:"eth_newFilter",params:[e]})})}function yg(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_newBlockFilter",params:[]})})}function vg(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_newPendingTransactionFilter",params:[]})})}function bg(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["hex"],[e]),t.send({method:"eth_uninstallFilter",params:[e]})})}function Ag(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["hex"],[e]),t.send({method:"eth_getFilterChanges",params:[e]})})}function wg(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["hex"],[e]),t.send({method:"eth_getFilterLogs",params:[e]})})}function _g(t,e){return Q(this,void 0,void 0,function*(){return q.validate(["filter"],[e]),t.send({method:"eth_getLogs",params:[e]})})}function Eg(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_getWork",params:[]})})}function xg(t,e,n,r){return Q(this,void 0,void 0,function*(){return q.validate(["bytes8","bytes32","bytes32"],[e,n,r]),t.send({method:"eth_submitWork",params:[e,n,r]})})}function I_(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["bytes32","bytes32"],[e,n]),t.send({method:"eth_submitHashrate",params:[e,n]})})}function Ig(t,e,n,r){return Q(this,void 0,void 0,function*(){q.validate(["hex","blockNumberOrTag"],[e,n]);for(const i of r)q.validate(["number"],[i]);return t.send({method:"eth_feeHistory",params:[e,n,r]})})}function Tg(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_pendingTransactions",params:[]})})}function Sg(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_requestAccounts",params:[]})})}function Rg(t){return Q(this,void 0,void 0,function*(){return t.send({method:"eth_chainId",params:[]})})}function kg(t,e,n,r){return Q(this,void 0,void 0,function*(){return q.validate(["address","bytes32[]","blockNumberOrTag"],[e,n,r]),t.send({method:"eth_getProof",params:[e,n,r]})})}function Bg(t){return Q(this,void 0,void 0,function*(){return t.send({method:"web3_clientVersion",params:[]})})}function Pg(t,e,n){return Q(this,void 0,void 0,function*(){return q.validate(["blockNumberOrTag"],[n]),t.send({method:"eth_createAccessList",params:[e,n]})})}function Cg(t,e,n,r=!1){return Q(this,void 0,void 0,function*(){return q.validate(["address"],[e]),t.send({method:`eth_signTypedData${r?"":"_v4"}`,params:[e,n]})})}const T_=Object.freeze(Object.defineProperty({__proto__:null,call:ag,compileLLL:E_,compileSerpent:x_,compileSolidity:__,createAccessList:Pg,estimateGas:cg,getAccounts:Jp,getBalance:Kp,getBlockByHash:ug,getBlockByNumber:yu,getBlockNumber:Wp,getBlockTransactionCountByHash:Xp,getBlockTransactionCountByNumber:eg,getChainId:Rg,getCode:rg,getCoinbase:mu,getCompilers:w_,getFeeHistory:Ig,getFilterChanges:Ag,getFilterLogs:wg,getGasPrice:Vp,getHashRate:Qp,getLogs:_g,getMaxPriorityFeePerGas:zp,getMining:pu,getNodeInfo:Bg,getPendingTransactions:Tg,getProof:kg,getProtocolVersion:fu,getStorageAt:Zp,getSyncing:hu,getTransactionByBlockHashAndIndex:lg,getTransactionByBlockNumberAndIndex:fg,getTransactionByHash:dg,getTransactionCount:Yp,getTransactionReceipt:hg,getUncleByBlockHashAndIndex:mg,getUncleByBlockNumberAndIndex:pg,getUncleCountByBlockHash:tg,getUncleCountByBlockNumber:ng,getWork:Eg,newBlockFilter:yg,newFilter:gg,newPendingTransactionFilter:vg,requestAccounts:Sg,sendRawTransaction:gu,sendTransaction:og,sign:ig,signTransaction:sg,signTypedData:Cg,submitHashrate:I_,submitWork:xg,uninstallFilter:bg},Symbol.toStringTag,{value:"Module"}));var vu=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};function Ng(t){return vu(this,void 0,void 0,function*(){return t.send({method:"net_version",params:[]})})}function Og(t){return vu(this,void 0,void 0,function*(){return t.send({method:"net_peerCount",params:[]})})}function Mg(t){return vu(this,void 0,void 0,function*(){return t.send({method:"net_listening",params:[]})})}const S_=Object.freeze(Object.defineProperty({__proto__:null,getId:Ng,getPeerCount:Og,isListening:Mg},Symbol.toStringTag,{value:"Module"}));var Vt=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const Lg=t=>Vt(void 0,void 0,void 0,function*(){return t.send({method:"personal_listAccounts",params:[]})}),Fg=(t,e)=>Vt(void 0,void 0,void 0,function*(){return t.send({method:"personal_newAccount",params:[e]})}),Dg=(t,e,n,r)=>Vt(void 0,void 0,void 0,function*(){return t.send({method:"personal_unlockAccount",params:[e,n,r]})}),jg=(t,e)=>Vt(void 0,void 0,void 0,function*(){return t.send({method:"personal_lockAccount",params:[e]})}),Hg=(t,e,n)=>Vt(void 0,void 0,void 0,function*(){return t.send({method:"personal_importRawKey",params:[e,n]})}),Ug=(t,e,n)=>Vt(void 0,void 0,void 0,function*(){return t.send({method:"personal_sendTransaction",params:[e,n]})}),Gg=(t,e,n)=>Vt(void 0,void 0,void 0,function*(){return t.send({method:"personal_signTransaction",params:[e,n]})}),qg=(t,e,n,r)=>Vt(void 0,void 0,void 0,function*(){return t.send({method:"personal_sign",params:[e,n,r]})}),$g=(t,e,n)=>Vt(void 0,void 0,void 0,function*(){return t.send({method:"personal_ecRecover",params:[e,n]})}),R_=Object.freeze(Object.defineProperty({__proto__:null,ecRecover:$g,getAccounts:Lg,importRawKey:Hg,lockAccount:jg,newAccount:Fg,sendTransaction:Ug,sign:qg,signTransaction:Gg,unlockAccount:Dg},Symbol.toStringTag,{value:"Module"})),PI=Object.freeze(Object.defineProperty({__proto__:null,ethRpcMethods:T_,netRpcMethods:S_,personalRpcMethods:R_},Symbol.toStringTag,{value:"Module"})),Nd={type:"object",properties:{accessList:{type:"null"},maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},Od={type:"object",properties:{maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},Md={type:"object",properties:{gasPrice:{type:"null"}}},us=(t,e,n)=>{try{q.validateJSONSchema(t,e)}catch(r){throw r instanceof Cn?new $h(r.errors,n):r}},k_=t=>{var e,n;const r=t;if(!A(r.type)){let s;switch(r.type){case"0x0":s=Nd;break;case"0x1":s=Od;break;case"0x2":s=Md;break;default:return T({format:"uint"},r.type,W)}return us(s,r,r.type),T({format:"uint"},r.type,W)}if(!A(r.maxFeePerGas)||!A(r.maxPriorityFeePerGas))return us(Md,r,"0x2"),"0x2";if(!A(r.accessList))return us(Od,r,"0x1"),"0x1";const i=(e=r.hardfork)!==null&&e!==void 0?e:(n=r.common)===null||n===void 0?void 0:n.hardfork;if(!A(i)){const s=Object.keys(ar).indexOf(i);if(s>=Object.keys(ar).indexOf("london"))return A(r.gasPrice)?"0x2":"0x0";if(s===Object.keys(ar).indexOf("berlin"))return"0x0"}if(!A(r.gasPrice))return us(Nd,r,"0x0"),"0x0"},Qg=(t,e)=>{var n;return((n=e?.transactionTypeParser)!==null&&n!==void 0?n:k_)(t)},B_=t=>t[0]>127?"0x0":It(t[0]),Vg={type:"object",properties:{address:{format:"address"},storageKeys:{type:"array",items:{format:"bytes32"}}}},Po={type:"array",items:Object.assign({},Vg)},zg={type:"object",properties:{accessList:Object.assign({},Po),gasUsed:{type:"string"}}},La={type:"string",enum:["goerli","kovan","mainnet","rinkeby","ropsten","sepolia"]},Fa={type:"string",enum:["arrowGlacier","berlin","byzantium","chainstart","constantinople","dao","homestead","istanbul","london","merge","muirGlacier","petersburg","shanghai","spuriousDragon","tangerineWhistle"]},Jg={type:"object",properties:{name:{format:"string"},networkId:{format:"uint"},chainId:{format:"uint"}}},bu={type:"object",properties:{from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},Po),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},chain:Object.assign({},La),hardfork:Object.assign({},Fa),chainId:{format:"uint"},networkId:{format:"uint"},common:{type:"object",properties:{customChain:Object.assign({},Jg),baseChain:Object.assign({},La),hardfork:Object.assign({},Fa)}},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}}},Gs={type:"object",properties:Object.assign(Object.assign({},bu.properties),{blockHash:{format:"bytes32"},blockNumber:{format:"uint"},hash:{format:"bytes32"},transactionIndex:{format:"uint"},from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},Po),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}})},Au={type:"object",properties:{index:{format:"uint"},validatorIndex:{format:"uint"},address:{format:"address"},amount:{format:"uint"}}},Ci={type:"object",properties:{baseFeePerGas:{format:"uint"},blobGasUsed:{format:"uint"},difficulty:{format:"uint"},excessBlobGas:{format:"uint"},extraData:{format:"bytes"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},hash:{format:"bytes32"},logsBloom:{format:"bytes256"},miner:{format:"bytes"},mixHash:{format:"bytes32"},nonce:{format:"uint"},number:{format:"uint"},parentBeaconBlockRoot:{format:"bytes32"},parentHash:{format:"bytes32"},receiptsRoot:{format:"bytes32"},sha3Uncles:{format:"bytes32"},size:{format:"uint"},stateRoot:{format:"bytes32"},timestamp:{format:"uint"},totalDifficulty:{format:"uint"},transactions:{oneOf:[{type:"array",items:Object.assign({},Gs)},{type:"array",items:{format:"bytes32"}}]},transactionsRoot:{format:"bytes32"},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},Au)},withdrawalsRoot:{format:"bytes32"}}},Wg={type:"object",properties:{author:{format:"bytes32"},excessDataGas:{format:"uint"},baseFeePerGas:{format:"uint"},blobGasUsed:{format:"uint"},difficulty:{format:"uint"},excessBlobGas:{format:"uint"},extraData:{format:"bytes"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},hash:{format:"bytes32"},logsBloom:{format:"bytes256"},miner:{format:"bytes"},mixHash:{format:"bytes32"},nonce:{format:"uint"},number:{format:"uint"},parentBeaconBlockRoot:{format:"bytes32"},parentHash:{format:"bytes32"},receiptsRoot:{format:"bytes32"},sha3Uncles:{format:"bytes32"},size:{format:"uint"},stateRoot:{format:"bytes32"},timestamp:{format:"uint"},totalDifficulty:{format:"uint"},transactions:{type:"array",items:{format:"bytes32"}},transactionsRoot:{format:"bytes32"},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},Au)},withdrawalsRoot:{format:"bytes32"}}},Vn={type:"object",properties:{removed:{format:"bool"},logIndex:{format:"uint"},transactionIndex:{format:"uint"},transactionHash:{format:"bytes32"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},address:{format:"address"},data:{format:"bytes"},topics:{type:"array",items:{format:"bytes32"}}}},Kg={type:"object",properties:{startingBlock:{format:"string"},currentBlock:{format:"string"},highestBlock:{format:"string"},knownStates:{format:"string"},pulledStates:{format:"string"}}},zn={type:"object",properties:{transactionHash:{format:"bytes32"},transactionIndex:{format:"uint"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},from:{format:"address"},to:{format:"address"},cumulativeGasUsed:{format:"uint"},gasUsed:{format:"uint"},effectiveGasPrice:{format:"uint"},contractAddress:{format:"address"},logs:{type:"array",items:Object.assign({},Vn)},logsBloom:{format:"bytes"},root:{format:"bytes"},status:{format:"uint"},type:{format:"uint"}}},Zg={type:"object",properties:{messageHash:{format:"bytes"},r:{format:"bytes32"},s:{format:"bytes32"},v:{format:"bytes"},message:{format:"bytes"},signature:{format:"bytes"}}},Yg={type:"object",properties:{oldestBlock:{format:"uint"},baseFeePerGas:{type:"array",items:{format:"uint"}},reward:{type:"array",items:{type:"array",items:{format:"uint"}}},gasUsedRatio:{type:"array",items:{type:"number"}}}},Xg={type:"object",properties:{key:{format:"bytes32"},value:{format:"uint"},proof:{type:"array",items:{format:"bytes32"}}}},e0={type:"object",properties:{balance:{format:"uint"},codeHash:{format:"bytes32"},nonce:{format:"uint"},storageHash:{format:"bytes32"},accountProof:{type:"array",items:{format:"bytes32"}},storageProof:{type:"array",items:Object.assign({},Xg)}}};function Ue(t,e=Ne,n={transactionSchema:Gs,fillInputAndData:!1}){var r,i;let s=$t({},t);if(A(t?.common)||(s.common=Object.assign({},t.common),A((r=t.common)===null||r===void 0?void 0:r.customChain)||(s.common.customChain=Object.assign({},t.common.customChain))),s=T((i=n.transactionSchema)!==null&&i!==void 0?i:Gs,s,e),!A(s.data)&&!A(s.input)&&It(s.data)!==It(s.input))throw new dc({data:ne(s.data),input:ne(s.input)});return n.fillInputAndData&&(A(s.data)?A(s.input)||(s.data=s.input):s.input=s.data),A(s.gasLimit)||(s.gas=s.gasLimit,delete s.gasLimit),s}function P_(t,e,n={fillInputAndData:!1}){return{raw:T({format:"bytes"},t,e),tx:Ue(Object.assign(Object.assign({},jt.fromSerializedData(fe(t)).toJSON()),{hash:ne(De(fe(t))),type:B_(fe(t))}),e,{fillInputAndData:n.fillInputAndData,transactionSchema:n.transactionSchema})}}var wu=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};function Co(t,e){return wu(this,void 0,void 0,function*(){const n=yield Ng(t.requestManager);return T({format:"uint"},n,e)})}function t0(t,e){return wu(this,void 0,void 0,function*(){const n=yield Og(t.requestManager);return T({format:"uint"},n,e)})}const n0=t=>wu(void 0,void 0,void 0,function*(){return Mg(t.requestManager)});var aa=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};class qs extends Ce{getId(e=this.defaultReturnFormat){return aa(this,void 0,void 0,function*(){return Co(this,e)})}getPeerCount(e=this.defaultReturnFormat){return aa(this,void 0,void 0,function*(){return t0(this,e)})}isListening(){return aa(this,void 0,void 0,function*(){return n0(this)})}}const CI=Object.freeze(Object.defineProperty({__proto__:null,Net:qs,default:qs,getId:Co,getPeerCount:t0,isListening:n0},Symbol.toStringTag,{value:"Module"})),Un="ALLEVENTS",$s={name:Un,signature:"",type:"event",inputs:[]},Yi={bytes:At.HEX,number:Je.NUMBER};var r0=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};function C_(t,e,n){return r0(this,void 0,void 0,function*(){var r,i,s,o;const a=yield Ou(e,e.defaultBlock,!1,W);if(A(a.baseFeePerGas))throw new jh;let d;if(A(t.gasPrice)&&BigInt(a.baseFeePerGas)===BigInt(0)&&(d=yield Fo(e,n)),!A(t.gasPrice)||!A(d)){const u=T({format:"uint"},(r=t.gasPrice)!==null&&r!==void 0?r:d,n);return{maxPriorityFeePerGas:u,maxFeePerGas:u}}return{maxPriorityFeePerGas:T({format:"uint"},(i=t.maxPriorityFeePerGas)!==null&&i!==void 0?i:e.defaultMaxPriorityFeePerGas,n),maxFeePerGas:T({format:"uint"},(s=t.maxFeePerGas)!==null&&s!==void 0?s:BigInt(a.baseFeePerGas)*BigInt(2)+BigInt((o=t.maxPriorityFeePerGas)!==null&&o!==void 0?o:e.defaultMaxPriorityFeePerGas),n)}})}function i0(t,e,n){return r0(this,void 0,void 0,function*(){const r=s0(t,e);if(!A(r)){if(r.startsWith("-"))throw new ma(r);if(Number(r)<0||Number(r)>127)throw new ma(r);if(A(t.gasPrice)&&(r==="0x0"||r==="0x1"))return{gasPrice:yield Fo(e,n),maxPriorityFeePerGas:void 0,maxFeePerGas:void 0};if(r==="0x2")return Object.assign({gasPrice:void 0},yield C_(t,e,n))}})}var _u=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const Qs=(t,e,n,r)=>{if(n!==void 0&&t in n&&n[t]!==void 0){if(typeof n[t]=="string"&&_e(n[t]))return n[t];if(!z(n[t])&&Tc(n[t])){if(e.wallet){const i=e.wallet.get(T({format:"uint"},n[t],Yi));if(!A(i))return i.address;throw new pa}throw new pa}else throw t==="from"?new cc(n.from):new Ah(n.to)}if(t==="from"){if(!A(r))return Zi(r);if(!A(e.defaultAccount))return e.defaultAccount}},N_=(t,e,...n)=>_u(void 0,[t,e,...n],void 0,function*(r,i,s=r.defaultReturnFormat){if(A(i))throw new Dh;return Lu(r,i,r.defaultBlock,s)}),s0=(t,e)=>{const n=Qg(t,e);if(!A(n))return n;if(!A(e.defaultTransactionType))return T({format:"uint"},e.defaultTransactionType,W)};function O_(t){return _u(this,void 0,void 0,function*(){var e,n;let r=T(bu,t.transaction,t.web3Context.defaultReturnFormat);if(A(r.from)&&(r.from=Qs("from",t.web3Context,void 0,t.privateKey)),A(r.nonce)&&(r.nonce=yield N_(t.web3Context,r.from,W)),A(r.value)&&(r.value="0x0"),A(r.data))A(r.input)?r.input="0x":r.input.startsWith("0x")||(r.input=`0x${r.input}`);else{if(!A(r.input)&&r.data!==r.input)throw new dc({data:ne(r.data),input:ne(r.input)});r.data.startsWith("0x")||(r.data=`0x${r.data}`)}if(A(r.common)){if(t.web3Context.defaultCommon){const i=t.web3Context.defaultCommon,s=i.customChain.chainId,o=i.customChain.networkId,a=i.customChain.name;r.common=Object.assign(Object.assign({},i),{customChain:{chainId:s,networkId:o,name:a}})}A(r.chain)&&(r.chain=t.web3Context.defaultChain),A(r.hardfork)&&(r.hardfork=t.web3Context.defaultHardfork)}if(A(r.chainId)&&A((e=r.common)===null||e===void 0?void 0:e.customChain.chainId)&&(r.chainId=yield Du(t.web3Context,W)),A(r.networkId)&&(r.networkId=(n=t.web3Context.defaultNetworkId)!==null&&n!==void 0?n:yield Co(t.web3Context,W)),A(r.gasLimit)&&!A(r.gas)&&(r.gasLimit=r.gas),r.type=s0(r,t.web3Context),A(r.accessList)&&(r.type==="0x1"||r.type==="0x2")&&(r.accessList=[]),t.fillGasPrice&&(r=Object.assign(Object.assign({},r),yield i0(r,t.web3Context,W))),A(r.gas)&&A(r.gasLimit)&&t.fillGasLimit){const i=yield Ho(t.web3Context,r,"latest",W);r=Object.assign(Object.assign({},r),{gas:T({format:"uint"},i,W)})}return r})}const o0=t=>_u(void 0,void 0,void 0,function*(){var e;return((e=t.web3Context.transactionBuilder)!==null&&e!==void 0?e:O_)(Object.assign(Object.assign({},t),{transaction:t.transaction}))});var Eu=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};function Da(t,e,n){const r=t.transactionPollingInterval,[i,s]=Km(()=>Eu(this,void 0,void 0,function*(){let a;try{a=yield Do(t,Yi)}catch(u){console.warn("An error happen while trying to get the block number",u);return}const d=a-e;if(d>=t.transactionBlockTimeout)return new fc({starterBlockNumber:e,numberOfBlocks:d,transactionHash:n})}),r);return[s,{clean:()=>{clearInterval(i)}}]}function M_(t,e,n){return Eu(this,void 0,void 0,function*(){var r;let i=!0,s,o;function a(u,c){c&&console.warn("error happened at subscription. So revert to polling...",c),o.clean(),i=!1;const[l,h]=Da(t,e,n);o.clean=h.clean,l.catch(p=>u(p))}try{s=yield(r=t.subscriptionManager)===null||r===void 0?void 0:r.subscribe("newHeads"),o={clean:()=>{var u;s.id&&((u=t.subscriptionManager)===null||u===void 0||u.removeSubscription(s).then(()=>{}).catch(()=>{}))}}}catch{return Da(t,e,n)}return[new Promise((u,c)=>{try{s.on("data",l=>{if(i=!1,!l?.number)return;const h=Number(BigInt(l.number)-BigInt(e));h>=t.transactionBlockTimeout&&c(new fc({starterBlockNumber:e,numberOfBlocks:h,transactionHash:n}))}),s.on("error",l=>{a(c,l)})}catch(l){a(c,l)}setTimeout(()=>{i&&a(c)},t.blockHeaderTimeout*1e3)}),o]})}function a0(t,e){return Eu(this,void 0,void 0,function*(){var n,r;const{provider:i}=t.requestManager;let s;const o=yield Do(t,Yi);return!((r=(n=i).supportsSubscriptions)===null||r===void 0)&&r.call(n)&&t.enableExperimentalFeatures.useSubscriptionWhenCheckingBlockTimeout?s=yield M_(t,o,e):s=Da(t,o,e),s})}var L_=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};function Vs(t,e,n){return L_(this,void 0,void 0,function*(){const[r,i]=Oc(t.transactionSendTimeout,new Hh({numberOfSeconds:t.transactionSendTimeout/1e3,transactionHash:n})),[s,o]=yield a0(t,n);try{return yield Promise.race([e(),i,s])}finally{clearTimeout(r),o.clean()}})}var Ld=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};function xu(t,e,n,r){return Ld(this,void 0,void 0,function*(){var i;const s=(i=t.transactionReceiptPollingInterval)!==null&&i!==void 0?i:t.transactionPollingInterval,[o,a]=Nc(()=>Ld(this,void 0,void 0,function*(){try{return(r??Mu)(t,e,n)}catch(h){console.warn("An error happen while trying to get the transaction receipt",h);return}}),s),[d,u]=Oc(t.transactionPollingTimeout,new lc({numberOfSeconds:t.transactionPollingTimeout/1e3,transactionHash:e})),[c,l]=yield a0(t,e);try{return yield Promise.race([o,u,c])}finally{d&&clearTimeout(d),a&&clearInterval(a),l.clean()}})}var F_=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const ys=({web3Context:t,transactionReceipt:e,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:i})=>{var s;let o=1;const a=setInterval(()=>{F_(void 0,void 0,void 0,function*(){if(o>=t.transactionConfirmationBlocks){clearInterval(a);return}const d=yield yu(t.requestManager,he(BigInt(e.blockNumber)+BigInt(o)),!1);d?.hash&&(o+=1,n.emit("confirmation",{confirmations:T({format:"uint"},o,i),receipt:T(r??zn,e,i),latestBlockHash:T({format:"bytes32"},d.hash,i)}))})},(s=t.transactionReceiptPollingInterval)!==null&&s!==void 0?s:t.transactionPollingInterval)};var Fd=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const D_=({web3Context:t,transactionReceipt:e,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:i})=>{let s=!0,o;setImmediate(()=>{var a;(a=t.subscriptionManager)===null||a===void 0||a.subscribe("newHeads").then(d=>{d.on("data",u=>Fd(void 0,void 0,void 0,function*(){var c;if(s=!1,!u?.number||o===u?.parentHash)return;o=u?.parentHash;const l=BigInt(u.number)-BigInt(e.blockNumber)+BigInt(1);n.emit("confirmation",{confirmations:T({format:"uint"},l,i),receipt:T(r??zn,e,i),latestBlockHash:T({format:"bytes32"},u.parentHash,i)}),l>=t.transactionConfirmationBlocks&&(yield(c=t.subscriptionManager)===null||c===void 0?void 0:c.removeSubscription(d))})),d.on("error",()=>Fd(void 0,void 0,void 0,function*(){var u;yield(u=t.subscriptionManager)===null||u===void 0?void 0:u.removeSubscription(d),s=!1,ys({web3Context:t,transactionReceipt:e,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:i})}))}).catch(()=>{s=!1,ys({web3Context:t,transactionReceipt:e,customTransactionReceiptSchema:r,transactionPromiEvent:n,returnFormat:i})})}),setTimeout(()=>{s&&ys({web3Context:t,transactionReceipt:e,transactionPromiEvent:n,returnFormat:i})},t.blockHeaderTimeout*1e3)};function j_(t,e,n,r,i,s){if(A(n)||A(n.blockHash))throw new Gh({receipt:n,blockHash:T({format:"bytes32"},n?.blockHash,i),transactionHash:T({format:"bytes32"},r,i)});if(!n.blockNumber)throw new qh({receipt:n});e.emit("confirmation",{confirmations:T({format:"uint"},1,i),receipt:T(s??zn,n,i),latestBlockHash:T({format:"bytes32"},n.blockHash,i)});const o=t.requestManager.provider;o&&"supportsSubscriptions"in o&&o.supportsSubscriptions()?D_({web3Context:t,transactionReceipt:n,transactionPromiEvent:e,customTransactionReceiptSchema:s,returnFormat:i}):ys({web3Context:t,transactionReceipt:n,transactionPromiEvent:e,customTransactionReceiptSchema:s,returnFormat:i})}const H_=t=>!$(t)&&typeof t=="object"&&!$(t.type)&&["function","event","constructor","error"].includes(t.type),Xi=t=>!$(t)&&typeof t=="object"&&!$(t.type)&&t.type==="error",No=t=>!$(t)&&typeof t=="object"&&!$(t.type)&&t.type==="event",es=t=>!$(t)&&typeof t=="object"&&!$(t.type)&&t.type==="function",c0=t=>!$(t)&&typeof t=="object"&&!$(t.type)&&t.type==="constructor",Iu=t=>typeof t=="object"&&typeof t.components>"u"&&typeof t.name>"u",Oo=t=>t.includes("[]")?{type:"tuple[]",name:t.slice(0,-2)}:{type:"tuple",name:t},Mo=t=>{const e=[];for(const n of Object.keys(t)){const r=t[n];typeof r=="object"?e.push(Object.assign(Object.assign({},Oo(n)),{components:Mo(r)})):e.push({name:n,type:t[n]})}return e},U_=t=>{const e=[];for(const n of t){let r=n;if(typeof n=="object"&&(r=Object.assign({},n)),typeof n=="object"&&n.type==="function"&&(r=Object.assign(Object.assign({},n),{type:"bytes24"})),Iu(r)){const i=Object.keys(r)[0];e.push(Object.assign(Object.assign({},Oo(i)),{components:Mo(r[i])}))}else e.push(r)}return e},u0=t=>typeof t=="string"&&/^(-)?0x[0-9a-f]*$/i.test(t)&&t.length%2===1,ja=t=>u0(t)?`0x0${t.substring(2)}`:t,G_=/^bytes([0-9]*)$/,q_=/^bytes([0-9]*)\[\]$/,$_=/^(u?int)([0-9]*)$/,Q_=/^(u?int)([0-9]*)\[\]$/,d0=(t,e)=>{const n=typeof e=="object"&&!Array.isArray(e)?Object.assign({},e):e;if(n instanceof BigInt||typeof n=="bigint")return n.toString(10);if(q_.exec(t)||Q_.exec(t))return[...n].map(s=>d0(t.replace("[]",""),s));let r=$_.exec(t);if(r){const i=parseInt(r[2]?r[2]:"256",10);if(i/8<n.length)return Ar(n,i)}if(r=G_.exec(t),r){const i=qt(n)?It(n):n,s=parseInt(r[1],10);if(s){let o=s*2;n.startsWith("0x")&&(o+=2);const a=i.length<o?Pc(n,s*2):i;return ja(a)}return ja(i)}return n},zs=(t,e)=>{const n=[];return e.forEach(r=>{if(typeof r.components=="object"){if(!r.type.startsWith("tuple"))throw new ee(`Invalid value given "${r.type}". Error: components found but type is not tuple.`);const i=r.type.indexOf("["),s=i>=0?r.type.substring(i):"",o=zs(t,r.components);Array.isArray(o)&&t?n.push(`tuple(${o.join(",")})${s}`):t?n.push(`(${o.join()})`):n.push(`(${o.join(",")})${s}`)}else n.push(r.type)}),n},bt=t=>{var e,n,r,i;return Xi(t)||No(t)||es(t)?!((e=t.name)===null||e===void 0)&&e.includes("(")?t.name:`${(n=t.name)!==null&&n!==void 0?n:""}(${zs(!1,(r=t.inputs)!==null&&r!==void 0?r:[]).join(",")})`:`(${zs(!1,(i=t.inputs)!==null&&i!==void 0?i:[]).join(",")})`},l0=t=>{if(typeof t!="string"&&!Xi(t))throw new ee("Invalid parameter value in encodeErrorSignature");let e;return t&&(typeof t=="function"||typeof t=="object")?e=bt(t):e=t,Qe(e)},Lo=t=>{if(typeof t!="string"&&!No(t))throw new ee("Invalid parameter value in encodeEventSignature");let e;return t&&(typeof t=="function"||typeof t=="object")?e=bt(t):e=t,Qe(e)};function Tu(t,e){return t.exec(e)?.groups}var f0=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,h0=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,m0=/^\(.+?\).*?$/,V_=Object.defineProperty,z_=(t,e,n)=>e in t?V_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,jr=(t,e,n)=>(z_(t,typeof e!="symbol"?e+"":e,n),n),J_="abitype",W_="0.7.1",$e=class extends Error{constructor(t,e={}){const n=e.cause instanceof $e?e.cause.details:e.cause?.message?e.cause.message:e.details,r=e.cause instanceof $e&&e.cause.docsPath||e.docsPath,i=[t||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...n?[`Details: ${n}`]:[],`Version: ${J_}@${W_}`].join(`
11
+ `);super(i),jr(this,"details"),jr(this,"docsPath"),jr(this,"metaMessages"),jr(this,"shortMessage"),jr(this,"name","AbiTypeError"),e.cause&&(this.cause=e.cause),this.details=n,this.docsPath=r,this.metaMessages=e.metaMessages,this.shortMessage=t}},p0=/^struct (?<name>[a-zA-Z0-9_]+) \{(?<properties>.*?)\}$/;function g0(t){return p0.test(t)}function K_(t){return Tu(p0,t)}var Dd=new Set(["memory","indexed","storage","calldata"]),Z_=new Set(["calldata","memory","storage"]);function Y_(t,e){return e?`${e}:${t}`:t}var ca=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),X_=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,eE=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,tE=/^u?int$/;function Js(t,e){const n=Y_(t,e?.type);if(ca.has(n))return ca.get(n);const r=m0.test(t),i=Tu(r?eE:X_,t);if(!i)throw new $e("Invalid ABI parameter.",{details:t});if(i.name&&rE(i.name))throw new $e("Invalid ABI parameter.",{details:t,metaMessages:[`"${i.name}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]});const s=i.name?{name:i.name}:{},o=i.modifier==="indexed"?{indexed:!0}:{},a=e?.structs??{};let d,u={};if(r){d="tuple";const l=rr(i.type),h=[],p=l.length;for(let v=0;v<p;v++)h.push(Js(l[v],{structs:a}));u={components:h}}else if(i.type in a)d="tuple",u={components:a[i.type]};else if(tE.test(i.type))d=`${i.type}256`;else if(d=i.type,e?.type!=="struct"&&!y0(d))throw new $e("Unknown type.",{metaMessages:[`Type "${d}" is not a valid ABI type.`]});if(i.modifier){if(!e?.modifiers?.has?.(i.modifier))throw new $e("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${i.modifier}" not allowed${e?.type?` in "${e.type}" type`:""}.`]});if(Z_.has(i.modifier)&&!iE(d,!!i.array))throw new $e("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${i.modifier}" not allowed${e?.type?` in "${e.type}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${i.modifier}" was given.`]})}const c={type:`${d}${i.array??""}`,...s,...o,...u};return ca.set(n,c),c}function rr(t,e=[],n="",r=0){if(t===""){if(n==="")return e;if(r!==0)throw new $e("Unbalanced parentheses.",{metaMessages:[`"${n.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`});return[...e,n.trim()]}const i=t.length;for(let s=0;s<i;s++){const o=t[s],a=t.slice(s+1);switch(o){case",":return r===0?rr(a,[...e,n.trim()]):rr(a,e,`${n}${o}`,r);case"(":return rr(a,e,`${n}${o}`,r+1);case")":return rr(a,e,`${n}${o}`,r-1);default:return rr(a,e,`${n}${o}`,r)}}return[]}function y0(t){return t==="address"||t==="bool"||t==="function"||t==="string"||f0.test(t)||h0.test(t)}var nE=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function rE(t){return t==="address"||t==="bool"||t==="function"||t==="string"||t==="tuple"||f0.test(t)||h0.test(t)||nE.test(t)}function iE(t,e){return e||t==="bytes"||t==="string"||t==="tuple"}function sE(t){const e={},n=t.length;for(let o=0;o<n;o++){const a=t[o];if(!g0(a))continue;const d=K_(a);if(!d)throw new $e("Invalid struct signature.",{details:a});const u=d.properties.split(";"),c=[],l=u.length;for(let h=0;h<l;h++){const v=u[h].trim();if(!v)continue;const m=Js(v,{type:"struct"});c.push(m)}if(!c.length)throw new $e("Invalid struct signature.",{details:a,metaMessages:["No properties exist."]});e[d.name]=c}const r={},i=Object.entries(e),s=i.length;for(let o=0;o<s;o++){const[a,d]=i[o];r[a]=v0(d,e)}return r}var oE=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?$/;function v0(t,e,n=new Set){const r=[],i=t.length;for(let s=0;s<i;s++){const o=t[s];if(m0.test(o.type))r.push(o);else{const d=Tu(oE,o.type);if(!d?.type)throw new $e("Invalid ABI parameter.",{details:JSON.stringify(o,null,2),metaMessages:["ABI parameter type is invalid."]});const{array:u,type:c}=d;if(c in e){if(n.has(c))throw new $e("Circular reference detected.",{metaMessages:[`Struct "${c}" is a circular reference.`]});r.push({...o,type:`tuple${u??""}`,components:v0(e[c]??[],e,new Set([...n,c]))})}else if(y0(c))r.push(o);else throw new $e("Unknown type.",{metaMessages:[`Type "${c}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]})}}return r}function aE(t){let e;if(typeof t=="string")e=Js(t,{modifiers:Dd});else{const n=sE(t),r=t.length;for(let i=0;i<r;i++){const s=t[i];if(!g0(s)){e=Js(s,{modifiers:Dd,structs:n});break}}}if(!e)throw new $e("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(t,null,2)})`,docsPath:"/api/human.html#parseabiparameter-1"});return e}const be=32;function Ha(t=0){var e;if(((e=globalThis.Buffer)===null||e===void 0?void 0:e.alloc)!==void 0){const n=globalThis.Buffer.alloc(t);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}return new Uint8Array(t)}function b0(t){var e,n;return Object.assign(Object.assign({},t),{name:(e=t.name)!==null&&e!==void 0?e:"",components:(n=t.components)===null||n===void 0?void 0:n.map(r=>b0(r))})}function cE(t){return!$(t)&&typeof t=="object"&&!$(t.type)&&typeof t.type=="string"}function A0(t){return t.map(e=>{var n;if(cE(e))return e;if(typeof e=="string")return b0(aE(e.replace(/tuple/,"")));if(Iu(e)){const r=Object.keys(e)[0],i=Oo(r);return i.name=(n=i.name)!==null&&n!==void 0?n:"",Object.assign(Object.assign({},i),{components:Mo(e[r])})}throw new ee("Invalid abi")})}function Su(t){const e=t.type.lastIndexOf("["),n=t.type.substring(0,e),r=t.type.substring(e);let i=-1;if(r!=="[]"&&(i=Number(r.slice(1,-1)),isNaN(i)))throw new ee("Invalid fixed array size",{size:r});return{param:{type:n,name:"",components:t.components},size:i}}function Ws(t){var e,n;return t.type==="string"||t.type==="bytes"||t.type.endsWith("[]")?!0:t.type==="tuple"?(n=(e=t.components)===null||e===void 0?void 0:e.some(Ws))!==null&&n!==void 0?n:!1:t.type.endsWith("]")?Ws(Su(t).param):!1}const w0=20,_0=be-w0;function uE(t,e){if(typeof e!="string")throw new ee("address type expects string as input type",{value:e,name:t.name,type:t.type});let n=e.toLowerCase();if(n.startsWith("0x")||(n=`0x${n}`),!_e(n))throw new ee("provided input is not valid address",{value:e,name:t.name,type:t.type});const r=qn(n),i=Ha(be);return i.set(r,_0),{dynamic:!1,encoded:i}}function dE(t,e){const n=e.subarray(_0,be);if(n.length!==w0)throw new ee("Invalid decoding input, not enough bytes to decode address",{bytes:e});const r=Ut(n);return{result:Se(r),encoded:e.subarray(be),consumed:be}}const hn=new Map;let ds=BigInt(256);for(let t=8;t<=256;t+=8)hn.set(`uint${t}`,{min:BigInt(0),max:ds-BigInt(1)}),hn.set(`int${t}`,{min:-ds/BigInt(2),max:ds/BigInt(2)-BigInt(1)}),ds*=BigInt(256);hn.set("int",hn.get("int256"));hn.set("uint",hn.get("uint256"));const E0=BigInt(1)<<BigInt(256);function lE(t,e=be){let n;return t<0?n=(E0+t).toString(16):n=t.toString(16),n=br(n,e*2),qn(n)}function fE(t,e){const n=Ut(t),r=BigInt(n);return r<=e?r:r-E0}function ts(t,e){let n;try{n=wn(e)}catch{throw new ee("provided input is not number value",{type:t.type,value:e,name:t.name})}const r=hn.get(t.type);if(!r)throw new ee("provided abi contains invalid number datatype",{type:t.type});if(n<r.min)throw new ee("provided input is less then minimum for given type",{type:t.type,value:e,name:t.name,minimum:r.min.toString()});if(n>r.max)throw new ee("provided input is greater then maximum for given type",{type:t.type,value:e,name:t.name,maximum:r.max.toString()});return{dynamic:!1,encoded:lE(n)}}function Ir(t,e){if(e.length<be)throw new ee("Not enough bytes left to decode",{param:t,bytesLeft:e.length});const n=e.subarray(0,be),r=hn.get(t.type);if(!r)throw new ee("provided abi contains invalid number datatype",{type:t.type});const i=fE(n,r.max);if(i<r.min)throw new ee("decoded value is less then minimum for given type",{type:t.type,value:i,name:t.name,minimum:r.min.toString()});if(i>r.max)throw new ee("decoded value is greater then maximum for given type",{type:t.type,value:i,name:t.name,maximum:r.max.toString()});return{result:i,encoded:e.subarray(be),consumed:be}}function hE(t,e){let n;try{n=Gm(e)}catch(r){if(r instanceof co)throw new ee("provided input is not valid boolean value",{type:t.type,value:e,name:t.name})}return ts({type:"uint8",name:""},Number(n))}function mE(t,e){const n=Ir({type:"uint8",name:""},e);if(n.result>1||n.result<0)throw new ee("Invalid boolean value encoded",{boolBytes:e.subarray(0,be),numberResult:n});return{result:n.result===BigInt(1),encoded:n.encoded,consumed:be}}const pE=32;function x0(t,e){if(typeof e=="string"&&e.length%2!==0&&(e+="0"),!Gt(e))throw new ee("provided input is not valid bytes value",{type:t.type,value:e,name:t.name});const n=xt(e),[,r]=t.type.split("bytes");if(r){if(Number(r)>pE||Number(r)<1)throw new ee("invalid bytes type. Static byte type can have between 1 and 32 bytes",{type:t.type});if(Number(r)<n.length)throw new ee("provided input size is different than type size",{type:t.type,value:e,name:t.name});const o=Ha(be);return o.set(n),{dynamic:!1,encoded:o}}const i=Math.ceil(n.length/be),s=Ha(be+i*be);return s.set(ts({type:"uint32",name:""},n.length).encoded),s.set(n,be),{dynamic:!0,encoded:s}}function I0(t,e){const[,n]=t.type.split("bytes");let r=Number(n),i=e,s=1,o=0;if(!r){const a=Ir({type:"uint32",name:""},i);r=Number(a.result),o+=a.consumed,i=a.encoded,s=Math.ceil(r/be)}if(r>e.length)throw new ee("there is not enough data to decode",{type:t.type,encoded:e,size:r});return{result:ne(i.subarray(0,r)),encoded:i.subarray(s*be),consumed:o+s*be}}function gE(t,e){if(typeof e!="string")throw new ee("invalid input, should be string",{input:e});const n=Rc(e);return x0({type:"bytes",name:""},n)}function yE(t,e){const n=I0({type:"bytes"},e);return{result:Ao(n.result),encoded:n.encoded,consumed:n.consumed}}function T0(t){let e=0,n=0;const r=[],i=[];for(const s of t)s.dynamic?e+=be:e+=s.encoded.length;for(const s of t)s.dynamic?(r.push(ts({type:"uint256",name:""},e+n)),i.push(s),n+=s.encoded.length):r.push(s);return He(...r.map(s=>s.encoded),...i.map(s=>s.encoded))}function vE(t,e){if(!Array.isArray(e))throw new ee("Expected value to be array",{abi:t,values:e});const{size:n,param:r}=Su(t),i=e.map(a=>Ua(r,a)),s=n===-1,o=i.length>0&&i[0].dynamic;if(!s&&e.length!==n)throw new ee("Given arguments count doesn't match array length",{arrayLength:n,argumentsLength:e.length});if(s||o){const a=T0(i);if(s){const d=ts({type:"uint256",name:""},i.length).encoded;return{dynamic:!0,encoded:i.length>0?He(d,a):d}}return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:He(...i.map(a=>a.encoded))}}function bE(t,e){let{size:n,param:r}=Su(t);const i=n===-1;let s=0;const o=[];let a=e;if(i){const u=Ir({type:"uint32",name:""},e);n=Number(u.result),s=u.consumed,a=u.encoded}if(Ws(r)){for(let u=0;u<n;u+=1){const c=Ir({type:"uint32",name:""},a.subarray(u*be));s+=c.consumed;const l=Ks(r,a.subarray(Number(c.result)));s+=l.consumed,o.push(l.result)}return{result:o,encoded:a.subarray(s),consumed:s}}for(let u=0;u<n;u+=1){const c=Ks(r,e.subarray(s));s+=c.consumed,o.push(c.result)}return{result:o,encoded:e.subarray(s),consumed:s}}function Ua(t,e){if(t.type==="string")return gE(t,e);if(t.type==="bool")return hE(t,e);if(t.type==="address")return uE(t,e);if(t.type==="tuple")return Ru(t,e);if(t.type.endsWith("]"))return vE(t,e);if(t.type.startsWith("bytes"))return x0(t,e);if(t.type.startsWith("uint")||t.type.startsWith("int"))return ts(t,e);throw new ee("Unsupported",{param:t,value:e})}function Ks(t,e){if(t.type==="string")return yE(t,e);if(t.type==="bool")return mE(t,e);if(t.type==="address")return dE(t,e);if(t.type==="tuple")return S0(t,e);if(t.type.endsWith("]"))return bE(t,e);if(t.type.startsWith("bytes"))return I0(t,e);if(t.type.startsWith("uint")||t.type.startsWith("int"))return Ir(t,e);throw new ee("Unsupported",{param:t,bytes:e})}function Ru(t,e){var n,r,i;let s=!1;if(!Array.isArray(e)&&typeof e!="object")throw new ee("param must be either Array or Object",{param:t,input:e});const o=e,a=[];for(let d=0;d<((r=(n=t.components)===null||n===void 0?void 0:n.length)!==null&&r!==void 0?r:0);d+=1){const u=t.components[d];let c;if(Array.isArray(o)){if(d>=o.length)throw new ee("input param length missmatch",{param:t,input:e});c=Ua(u,o[d])}else{const l=o[(i=u.name)!==null&&i!==void 0?i:""];if(l==null)throw new ee("missing input defined in abi",{param:t,input:e,paramName:u.name});c=Ua(u,l)}c.dynamic&&(s=!0),a.push(c)}return s?{dynamic:!0,encoded:T0(a)}:{dynamic:!1,encoded:He(...a.map(d=>d.encoded))}}function S0(t,e){const n={__length__:0};let r=0;if(!t.components)return{result:n,encoded:e,consumed:r};let i=0;for(const[s,o]of t.components.entries()){let a;if(Ws(o)){const d=Ir({type:"uint32",name:""},e.subarray(r));a=Ks(o,e.subarray(Number(d.result))),r+=d.consumed,i+=a.consumed}else a=Ks(o,e.subarray(r)),r+=a.consumed;n.__length__+=1,n[s]=a.result,o.name&&o.name!==""&&(n[o.name]=a.result)}return{encoded:e.subarray(r+i),result:n,consumed:r+i}}function AE(t,e,n){const r=A0(t),i=qn(e);return S0({components:r},i).result}function R0(t){const e=[];return t.forEach(n=>{if(Array.isArray(n)){const r=R0(n);e.push({type:"tuple",components:r,name:""})}else e.push({type:It(n,!0)})}),e}function Jn(t,e){if(t?.length!==e.length)throw new ee("Invalid number of values received for given ABI",{expected:t?.length,received:e.length});const n=A0(t);return Ut(Ru({type:"tuple",name:"",components:n},e).encoded)}function k0(t){try{const e=R0(t);return Ut(Ru({type:"tuple",name:"",components:e},t).encoded)}catch{throw new ee("Could not infer types from given params",{params:t})}}const Zs=(t,e)=>Jn([t],[e]),ku=(t,e,n)=>{try{if(t.length>0&&(!e||e==="0x"||e==="0X"))throw new ee("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");return AE(t,`0x${e.replace(/0x/i,"")}`,n)}catch(r){throw new ee(`Parameter decoding error: ${r.message}`,{internalErr:r})}},sn=(t,e)=>ku(t,e,!1),Bu=(t,e)=>sn([t],e)[0],Tr=t=>{if(typeof t!="string"&&!es(t))throw new ee("Invalid parameter value in encodeFunctionSignature");let e;return t&&(typeof t=="function"||typeof t=="object")?e=bt(t):e=t,Qe(e).slice(0,10)},B0=(t,e)=>{var n;if(!es(t))throw new ee("Invalid parameter value in encodeFunctionCall");return`${Tr(t)}${Jn((n=t.inputs)!==null&&n!==void 0?n:[],e??[]).replace("0x","")}`},Ni=(t,e,n=!0)=>{const r=n&&e&&e.length>=10&&e.startsWith("0x")?e.slice(10):e;if(!t.inputs)throw new Oe("No inputs found in the ABI");const i=sn([...t.inputs],r);return Object.assign(Object.assign({},i),{__method__:bt(t)})},Pu=(t,e)=>{if(t.type==="constructor")return e;if(!e)return null;const n=e.length>=2?e.slice(2):e;if(!t.outputs)return null;const r=sn([...t.outputs],n);return r.__length__===1?r[0]:r},wE=["bool","string","int","uint","address","fixed","ufixed"],_E=(t,e)=>t==="string"?e:Bu(t,e),Cu=(t,e,n)=>{const r=Array.isArray(n)?n:[n],i={},s={};for(const[h,p]of t.entries())p.indexed?i[h]=p:s[h]=p;const o=e?ku(Object.values(s),e,!0):{__length__:0},a=r.length-Object.keys(i).length,d=Object.values(i).map((h,p)=>wE.some(v=>h.type.startsWith(v))?_E(h.type,r[p+a]):r[p+a]),u={__length__:0};let c=0,l=0;for(const[h,p]of t.entries())u[h]=p.type==="string"?"":void 0,i[h]&&(u[h]=d[c],c+=1),s[h]&&(u[h]=o[String(l)],l+=1),p.name&&(u[p.name]=u[h]),u.__length__+=1;return u},Qr=(t,e)=>{if(e?.data){let n,r,i;try{const s=e.data.slice(0,10),o=t.find(a=>l0(a).startsWith(s));o?.inputs?(n=o.name,r=bt(o),i=sn([...o.inputs],e.data.substring(10))):e.data.startsWith("0x08c379a0")?(n="Error",r="Error(string)",i=sn([{name:"message",type:"string"}],e.data.substring(10))):e.data.startsWith("0x4e487b71")?(n="Panic",r="Panic(uint256)",i=sn([{name:"code",type:"uint256"}],e.data.substring(10))):console.error("No matching error abi found for error data",e.data)}catch(s){console.error(s)}n&&e.setDecodedProperties(n,r,i)}},EE=/^\w+/,xE=/^(.*)\[([0-9]*?)]$/,P0=(t,e,n=[])=>{const i=e.match(EE)[0];return n.includes(i)||!t.types[i]?n:[i,...t.types[i].reduce((s,o)=>[...s,...P0(t,o.type,s).filter(a=>!s.includes(a))],[])]},IE=(t,e)=>{const[n,...r]=P0(t,e);return[n,...r.sort()].map(s=>`${s}(${t.types[s].map(o=>`${o.type} ${o.name}`)})`).join("")},TE=(t,e)=>De(IE(t,e)),Ga=(t,e,n)=>De(RE(t,e,n)),SE=(t,e)=>{const r=`0x1901${Ga(t,"EIP712Domain",t.domain).substring(2)}${Ga(t,t.primaryType,t.message).substring(2)}`;return e?De(r):r},C0=(t,e,n)=>{const r=e.match(xE);if(r){const i=r[1],s=Number(r[2])||void 0;if(!Array.isArray(n))throw new ee("Cannot encode data: value is not of array type",{data:n});if(s&&n.length!==s)throw new ee(`Cannot encode data: expected length of ${s}, but got ${n.length}`,{data:n});const o=n.map(u=>C0(t,i,u)),a=o.map(u=>u[0]),d=o.map(u=>u[1]);return["bytes32",De(Jn(a,d))]}return t.types[e]?["bytes32",Ga(t,e,n)]:e==="string"?["bytes32",De(n)]:e==="bytes"?["bytes32",De(n)]:[e,n]},RE=(t,e,n)=>{const[r,i]=t.types[e].reduce(([s,o],a)=>{if($(n[a.name])||$(a.type))throw new ee(`Cannot encode data: missing data for '${a.name}'`,{data:n,field:a});const d=n[a.name],[u,c]=C0(t,a.type,d);return[[...s,u],[...o,c]]},[["bytes32"],[TE(t,e)]]);return Jn(r,i)},kE=Object.freeze(Object.defineProperty({__proto__:null,decodeContractErrorData:Qr,decodeFunctionCall:Ni,decodeFunctionReturn:Pu,decodeLog:Cu,decodeParameter:Bu,decodeParameters:sn,decodeParametersWith:ku,encodeErrorSignature:l0,encodeEventSignature:Lo,encodeFunctionCall:B0,encodeFunctionSignature:Tr,encodeParameter:Zs,encodeParameters:Jn,flattenTypes:zs,formatOddHexstrings:ja,formatParam:d0,getEncodedEip712Data:SE,inferTypesAndEncodeParameters:k0,isAbiConstructorFragment:c0,isAbiErrorFragment:Xi,isAbiEventFragment:No,isAbiFragment:H_,isAbiFunctionFragment:es,isOddHexstring:u0,isSimplifiedStructFormat:Iu,jsonInterfaceMethodToString:bt,mapStructNameAndType:Oo,mapStructToCoderFormat:Mo,mapTypes:U_},Symbol.toStringTag,{value:"Module"}));var BE=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const PE=(t,e)=>{var n,r,i,s,o;if(t instanceof en&&t.cause instanceof Ui){if(e!==void 0){const a=e.filter(d=>Xi(d));return Qr(a,t.cause),{reason:t.cause.message,signature:(n=t.cause.data)===null||n===void 0?void 0:n.slice(0,10),data:(r=t.cause.data)===null||r===void 0?void 0:r.substring(10),customErrorName:t.cause.errorName,customErrorDecodedSignature:t.cause.errorSignature,customErrorArguments:t.cause.errorArgs}}return{reason:t.cause.message,signature:(i=t.cause.data)===null||i===void 0?void 0:i.slice(0,10),data:(s=t.cause.data)===null||s===void 0?void 0:s.substring(10)}}if(t instanceof qi&&!Array.isArray((o=t.cause)===null||o===void 0?void 0:o.errors)&&t.cause!==void 0)return t.cause.message;throw t};function N0(t,e,n){return BE(this,arguments,void 0,function*(r,i,s,o=r.defaultReturnFormat){try{yield jo(r,i,r.defaultBlock,o);return}catch(a){return PE(a,s)}})}var CE=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};function ua(t,e,n,r,i,s){return CE(this,void 0,void 0,function*(){let o=s;o===void 0&&t.handleRevert&&e!==void 0&&(o=yield N0(t,e,i));let a;if(o===void 0)a=new ac(n);else if(typeof o=="string")a=new oi(o,void 0,n);else if(o.customErrorName!==void 0&&o.customErrorDecodedSignature!==void 0&&o.customErrorArguments!==void 0){const d=o;a=new oc(d.reason,d.customErrorName,d.customErrorDecodedSignature,d.customErrorArguments,d.signature,n,d.data)}else a=new oi(o.reason,o.signature,n,o.data);return a})}const ns=(t,e,n,r=Ne)=>{var i,s,o,a,d,u;let c=Object.assign({},t);const l=T(Vn,e,r);if([Un,"allEvents"].includes(c.name)){const p=n.find(v=>v.signature===e.topics[0]);p?c=p:c={anonymous:!0}}if(c.inputs=(s=(i=c.inputs)!==null&&i!==void 0?i:t.inputs)!==null&&s!==void 0?s:[],!c.anonymous){let p=0;((o=c.inputs)!==null&&o!==void 0?o:[]).forEach(v=>{v.indexed&&(p+=1)}),p>0&&e?.topics&&e?.topics.length!==p+1&&(c=Object.assign(Object.assign({},c),{anonymous:!0,inputs:[]}))}const h=c.anonymous?e.topics:((a=e.topics)!==null&&a!==void 0?a:[]).slice(1);return Object.assign(Object.assign({},l),{returnValues:Cu([...(d=c.inputs)!==null&&d!==void 0?d:[]],e.data,h),event:c.name,signature:!c.anonymous&&((u=e.topics)===null||u===void 0?void 0:u.length)>0&&e.topics[0]?e.topics[0]:void 0,raw:{data:e.data,topics:e.topics}})};var gn=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};class Nu{constructor({options:e,web3Context:n,promiEvent:r,returnFormat:i}){this.options={checkRevertBeforeSending:!0},this.options=e,this.web3Context=n,this.promiEvent=r,this.returnFormat=i}getReceiptWithEvents(e){var n,r;const i=Object.assign({},e??{});if(!((n=this.options)===null||n===void 0)&&n.contractAbi&&i.logs&&i.logs.length>0){i.events={};for(const s of i.logs){const o=ns($s,s,(r=this.options)===null||r===void 0?void 0:r.contractAbi,this.returnFormat);o.event&&(i.events[o.event]=o)}}return i}checkRevertBeforeSending(e){return gn(this,void 0,void 0,function*(){if(this.options.checkRevertBeforeSending!==!1){let n=e;A(e.data)&&A(e.input)&&A(e.gas)&&(n=Object.assign(Object.assign({},e),{gas:21e3}));const r=yield N0(this.web3Context,n,this.options.contractAbi);if(r!==void 0)throw yield ua(this.web3Context,e,void 0,void 0,this.options.contractAbi,r)}})}emitSending(e){this.promiEvent.listenerCount("sending")>0&&this.promiEvent.emit("sending",e)}populateGasPrice(e){return gn(this,arguments,void 0,function*({transactionFormatted:n,transaction:r}){var i;let s=n;return!this.web3Context.config.ignoreGasPricing&&!(!((i=this.options)===null||i===void 0)&&i.ignoreGasPricing)&&A(n.gasPrice)&&(A(r.maxPriorityFeePerGas)||A(r.maxFeePerGas))&&(s=Object.assign(Object.assign({},n),yield i0(n,this.web3Context,W))),s})}signAndSend(e){return gn(this,arguments,void 0,function*({wallet:n,tx:r}){if(n){const i=yield n.signTransaction(r);return Vs(this.web3Context,()=>gn(this,void 0,void 0,function*(){return gu(this.web3Context.requestManager,i.rawTransaction)}),i.transactionHash)}return Vs(this.web3Context,()=>gn(this,void 0,void 0,function*(){return og(this.web3Context.requestManager,r)}))})}emitSent(e){this.promiEvent.listenerCount("sent")>0&&this.promiEvent.emit("sent",e)}emitTransactionHash(e){this.promiEvent.listenerCount("transactionHash")>0&&this.promiEvent.emit("transactionHash",e)}emitReceipt(e){this.promiEvent.listenerCount("receipt")>0&&this.promiEvent.emit("receipt",e)}handleError(e){return gn(this,arguments,void 0,function*({error:n,tx:r}){var i;let s=n;return s instanceof en&&this.web3Context.handleRevert&&(s=yield ua(this.web3Context,r,void 0,void 0,(i=this.options)===null||i===void 0?void 0:i.contractAbi)),(s instanceof qi||s instanceof en||s instanceof oc||s instanceof ac||s instanceof oi||s instanceof lc)&&this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",s),s})}emitConfirmation({receipt:e,transactionHash:n,customTransactionReceiptSchema:r}){this.promiEvent.listenerCount("confirmation")>0&&j_(this.web3Context,this.promiEvent,e,n,this.returnFormat,r)}handleResolve(e){return gn(this,arguments,void 0,function*({receipt:n,tx:r}){var i,s,o;if(!((i=this.options)===null||i===void 0)&&i.transactionResolver)return(s=this.options)===null||s===void 0?void 0:s.transactionResolver(n);if(n.status===BigInt(0)){const a=yield ua(this.web3Context,r,n,void 0,(o=this.options)===null||o===void 0?void 0:o.contractAbi);throw this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",a),a}else return n})}}var oe=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})},NE=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const OE=t=>oe(void 0,void 0,void 0,function*(){return fu(t.requestManager)}),O0=t=>oe(void 0,void 0,void 0,function*(){return hu(t.requestManager)}),ME=t=>oe(void 0,void 0,void 0,function*(){return mu(t.requestManager)}),LE=t=>oe(void 0,void 0,void 0,function*(){return pu(t.requestManager)});function M0(t,e){return oe(this,void 0,void 0,function*(){const n=yield Qp(t.requestManager);return T({format:"uint"},n,e??t.defaultReturnFormat)})}function Fo(t,e){return oe(this,void 0,void 0,function*(){const n=yield Vp(t.requestManager);return T({format:"uint"},n,e??t.defaultReturnFormat)})}function L0(t,e){return oe(this,void 0,void 0,function*(){const n=yield zp(t.requestManager);return T({format:"uint"},n,e??t.defaultReturnFormat)})}function Do(t,e){return oe(this,void 0,void 0,function*(){const n=yield Wp(t.requestManager);return T({format:"uint"},n,e??t.defaultReturnFormat)})}function F0(t,e){return oe(this,arguments,void 0,function*(n,r,i=n.defaultBlock,s){const o=xe(i)?i:T({format:"uint"},i,W),a=yield Kp(n.requestManager,r,o);return T({format:"uint"},a,s??n.defaultReturnFormat)})}function D0(t,e,n){return oe(this,arguments,void 0,function*(r,i,s,o=r.defaultBlock,a){const d=T({format:"uint"},s,W),u=xe(o)?o:T({format:"uint"},o,W),c=yield Zp(r.requestManager,i,d,u);return T({format:"bytes"},c,a??r.defaultReturnFormat)})}function j0(t,e){return oe(this,arguments,void 0,function*(n,r,i=n.defaultBlock,s){const o=xe(i)?i:T({format:"uint"},i,W),a=yield rg(n.requestManager,r,o);return T({format:"bytes"},a,s??n.defaultReturnFormat)})}function Ou(t){return oe(this,arguments,void 0,function*(e,n=e.defaultBlock,r=!1,i){var s;let o;if(Gt(n)){const d=T({format:"bytes32"},n,W);o=yield ug(e.requestManager,d,r)}else{const d=xe(n)?n:T({format:"uint"},n,W);o=yield yu(e.requestManager,d,r)}const a=T(Ci,o,i??e.defaultReturnFormat);return A(a)?a:Object.assign(Object.assign({},a),{transactions:(s=a.transactions)!==null&&s!==void 0?s:[]})})}function H0(t){return oe(this,arguments,void 0,function*(e,n=e.defaultBlock,r){let i;if(Gt(n)){const s=T({format:"bytes32"},n,W);i=yield Xp(e.requestManager,s)}else{const s=xe(n)?n:T({format:"uint"},n,W);i=yield eg(e.requestManager,s)}return T({format:"uint"},i,r??e.defaultReturnFormat)})}function U0(t){return oe(this,arguments,void 0,function*(e,n=e.defaultBlock,r){let i;if(Gt(n)){const s=T({format:"bytes32"},n,W);i=yield tg(e.requestManager,s)}else{const s=xe(n)?n:T({format:"uint"},n,W);i=yield ng(e.requestManager,s)}return T({format:"uint"},i,r??e.defaultReturnFormat)})}function G0(t){return oe(this,arguments,void 0,function*(e,n=e.defaultBlock,r,i){const s=T({format:"uint"},r,W);let o;if(Gt(n)){const a=T({format:"bytes32"},n,W);o=yield mg(e.requestManager,a,s)}else{const a=xe(n)?n:T({format:"uint"},n,W);o=yield pg(e.requestManager,a,s)}return T(Ci,o,i??e.defaultReturnFormat)})}function q0(t,e){return oe(this,arguments,void 0,function*(n,r,i=n.defaultReturnFormat){const s=T({format:"bytes32"},r,Ne),o=yield dg(n.requestManager,s);return A(o)?o:Ue(o,i,{transactionSchema:n.config.customTransactionSchema,fillInputAndData:!0})})}function $0(t,e){return oe(this,void 0,void 0,function*(){return(yield Tg(t.requestManager)).map(r=>Ue(r,e??t.defaultReturnFormat,{transactionSchema:t.config.customTransactionSchema,fillInputAndData:!0}))})}function Q0(t){return oe(this,arguments,void 0,function*(e,n=e.defaultBlock,r,i){const s=T({format:"uint"},r,W);let o;if(Gt(n)){const a=T({format:"bytes32"},n,W);o=yield lg(e.requestManager,a,s)}else{const a=xe(n)?n:T({format:"uint"},n,W);o=yield fg(e.requestManager,a,s)}return A(o)?o:Ue(o,i??e.defaultReturnFormat,{transactionSchema:e.config.customTransactionSchema,fillInputAndData:!0})})}function Mu(t,e,n){return oe(this,void 0,void 0,function*(){const r=T({format:"bytes32"},e,Ne);let i;try{i=yield hg(t.requestManager,r)}catch(s){if(typeof s=="object"&&!A(s)&&"message"in s&&s.message==="transaction indexing is in progress")console.warn("Transaction indexing is in progress.");else throw s}return A(i)?i:T(zn,i,n??t.defaultReturnFormat)})}function Lu(t,e){return oe(this,arguments,void 0,function*(n,r,i=n.defaultBlock,s){const o=xe(i)?i:T({format:"uint"},i,W),a=yield Yp(n.requestManager,r,o);return T({format:"uint"},a,s??n.defaultReturnFormat)})}function Sr(t,e,n,r={checkRevertBeforeSending:!0},i){const s=new lu((o,a)=>{setImmediate(()=>{oe(this,void 0,void 0,function*(){const d=new Nu({web3Context:t,promiEvent:s,options:r,returnFormat:n});let u=Object.assign({},e);A(i)||(u=yield i.processTransaction(u));let c=Ue(Object.assign(Object.assign({},u),{from:Qs("from",t,u),to:Qs("to",t,u)}),W,{transactionSchema:t.config.customTransactionSchema});try{c=yield d.populateGasPrice({transaction:u,transactionFormatted:c}),yield d.checkRevertBeforeSending(c),d.emitSending(c);let l;t.wallet&&!A(c.from)&&(l=t.wallet.get(c.from));const h=yield d.signAndSend({wallet:l,tx:c}),p=T({format:"bytes32"},h,n??t.defaultReturnFormat);d.emitSent(c),d.emitTransactionHash(p);const v=yield xu(t,h,n??t.defaultReturnFormat),m=d.getReceiptWithEvents(T(zn,v,n??t.defaultReturnFormat));d.emitReceipt(m),o(yield d.handleResolve({receipt:m,tx:c})),d.emitConfirmation({receipt:m,transactionHash:h})}catch(l){a(yield d.handleError({error:l,tx:c}))}})})});return s}function V0(t,e,n,r={checkRevertBeforeSending:!0}){const i=new lu((s,o)=>{setImmediate(()=>{oe(this,void 0,void 0,function*(){const a=new Nu({web3Context:t,promiEvent:i,options:r,returnFormat:n}),d=T({format:"bytes"},e,W),u=jt.fromSerializedData(xt(fe(d))),c=Object.assign(Object.assign({},u.toJSON()),{from:u.getSenderAddress().toString()});try{const{v:l,r:h,s:p}=c,v=NE(c,["v","r","s"]);yield a.checkRevertBeforeSending(v),a.emitSending(d);const m=yield Vs(t,()=>oe(this,void 0,void 0,function*(){return gu(t.requestManager,d)}));a.emitSent(d);const y=T({format:"bytes32"},m,n??t.defaultReturnFormat);a.emitTransactionHash(y);const f=yield xu(t,m,n??t.defaultReturnFormat),b=a.getReceiptWithEvents(T(zn,f,n??t.defaultReturnFormat));a.emitReceipt(b),s(yield a.handleResolve({receipt:b,tx:c})),a.emitConfirmation({receipt:b,transactionHash:m})}catch(l){o(yield a.handleError({error:l,tx:c}))}})})});return i}function z0(t,e,n){return oe(this,arguments,void 0,function*(r,i,s,o=r.defaultReturnFormat){var a;const d=T({format:"bytes"},i,Ne);if(!((a=r.wallet)===null||a===void 0)&&a.get(s)){const l=r.wallet.get(s).sign(d);return T(Zg,l,o)}if(typeof s=="number")throw new vh(i,'RPC method "eth_sign" does not support index signatures');const u=yield ig(r.requestManager,s,d);return T({format:"bytes"},u,o)})}function J0(t,e){return oe(this,arguments,void 0,function*(n,r,i=n.defaultReturnFormat){const s=yield sg(n.requestManager,Ue(r,W,{transactionSchema:n.config.customTransactionSchema}));return lo(s)?P_(s,i,{fillInputAndData:!0}):{raw:T({format:"bytes"},s.raw,i),tx:Ue(s.tx,i,{transactionSchema:n.config.customTransactionSchema,fillInputAndData:!0})}})}function jo(t,e){return oe(this,arguments,void 0,function*(n,r,i=n.defaultBlock,s=n.defaultReturnFormat){const o=xe(i)?i:T({format:"uint"},i,W),a=yield ag(n.requestManager,Ue(r,W,{transactionSchema:n.config.customTransactionSchema}),o);return T({format:"bytes"},a,s)})}function Ho(t,e){return oe(this,arguments,void 0,function*(n,r,i=n.defaultBlock,s){const o=Ue(r,W,{transactionSchema:n.config.customTransactionSchema}),a=xe(i)?i:T({format:"uint"},i,W),d=yield cg(n.requestManager,o,a);return T({format:"uint"},d,s??n.defaultReturnFormat)})}function Fu(t,e,n){return oe(this,void 0,void 0,function*(){let{toBlock:r,fromBlock:i}=e;A(r)||(typeof r=="number"||typeof r=="bigint")&&(r=he(r)),A(i)||(typeof i=="number"||typeof i=="bigint")&&(i=he(i));const s=Object.assign(Object.assign({},e),{fromBlock:i,toBlock:r});return(yield _g(t.requestManager,s)).map(d=>typeof d=="string"?d:T(Vn,d,n??t.defaultReturnFormat))})}function Du(t,e){return oe(this,void 0,void 0,function*(){const n=yield Rg(t.requestManager);return T({format:"uint"},n,e??t.defaultReturnFormat)})}function W0(t,e,n){return oe(this,arguments,void 0,function*(r,i,s,o=r.defaultBlock,a){const d=s.map(l=>T({format:"bytes"},l,W)),u=xe(o)?o:T({format:"uint"},o,W),c=yield kg(r.requestManager,i,d,u);return T(e0,c,a??r.defaultReturnFormat)})}function K0(t,e){return oe(this,arguments,void 0,function*(n,r,i=n.defaultBlock,s,o){const a=T({format:"uint"},r,W),d=xe(i)?i:T({format:"uint"},i,W),u=T({type:"array",items:{format:"uint"}},s,Yi),c=yield Ig(n.requestManager,a,d,u);return T(Yg,c,o??n.defaultReturnFormat)})}function ju(t,e){return oe(this,arguments,void 0,function*(n,r,i=n.defaultBlock,s){const o=xe(i)?i:T({format:"uint"},i,W),a=yield Pg(n.requestManager,Ue(r,W,{transactionSchema:n.config.customTransactionSchema}),o);return T(zg,a,s??n.defaultReturnFormat)})}function Z0(t,e,n,r,i){return oe(this,void 0,void 0,function*(){const s=yield Cg(t.requestManager,e,n,r);return T({format:"bytes"},s,i??t.defaultReturnFormat)})}var Or=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};function FE(t,e){return Or(this,void 0,void 0,function*(){const n=yield vg(t.requestManager);return T({format:"uint"},n,e??t.defaultReturnFormat)})}function DE(t,e,n){return Or(this,void 0,void 0,function*(){let{toBlock:r,fromBlock:i}=e;A(r)||(typeof r=="number"||typeof r=="bigint")&&(r=he(r)),A(i)||(typeof i=="number"||typeof i=="bigint")&&(i=he(i));const s=Object.assign(Object.assign({},e),{fromBlock:i,toBlock:r}),o=yield gg(t.requestManager,s);return T({format:"uint"},o,n??t.defaultReturnFormat)})}function jE(t,e){return Or(this,void 0,void 0,function*(){const n=yield yg(t.requestManager);return T({format:"uint"},n,e??t.defaultReturnFormat)})}function HE(t,e){return Or(this,void 0,void 0,function*(){return yield bg(t.requestManager,he(e))})}function UE(t,e,n){return Or(this,void 0,void 0,function*(){return(yield Ag(t.requestManager,he(e))).map(s=>typeof s=="string"?s:T(Vn,s,n??t.defaultReturnFormat))})}function GE(t,e,n){return Or(this,void 0,void 0,function*(){return(yield wg(t.requestManager,he(e))).map(s=>typeof s=="string"?s:T(Vn,s,n??t.defaultReturnFormat))})}let Hu=class extends Nr{_buildSubscriptionParams(){return["logs",this.args]}formatSubscriptionResult(e){return T(Vn,e,super.returnFormat)}};class qa extends Nr{_buildSubscriptionParams(){return["newPendingTransactions"]}formatSubscriptionResult(e){return T({format:"string"},e,super.returnFormat)}}class Oi extends Nr{_buildSubscriptionParams(){return["newHeads"]}formatSubscriptionResult(e){return T(Wg,e,super.returnFormat)}}class Uu extends Nr{_buildSubscriptionParams(){return["syncing"]}_processSubscriptionResult(e){if(typeof e=="boolean")this.emit("changed",e);else{const n=Object.fromEntries(Object.entries(e?.status||e).map(([r,i])=>[r.charAt(0).toLowerCase()+r.substring(1),i]));this.emit("changed",e.syncing),this.emit("data",T(Kg,n,super.returnFormat))}}}var K=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const Ys={logs:Hu,newPendingTransactions:qa,newHeads:Oi,syncing:Uu,pendingTransactions:qa,newBlockHeaders:Oi};class rs extends Ce{constructor(e){if(typeof e=="string"||xi(e)){super({provider:e,registeredSubscriptions:Ys});return}if(e.registeredSubscriptions){super(e);return}super(Object.assign(Object.assign({},e),{registeredSubscriptions:Ys})),this.getFeeData=this.calculateFeeData}setTransactionMiddleware(e){this.transactionMiddleware=e}getTransactionMiddleware(){return this.transactionMiddleware}getProtocolVersion(){return K(this,void 0,void 0,function*(){return fu(this.requestManager)})}isSyncing(){return K(this,void 0,void 0,function*(){return hu(this.requestManager)})}getCoinbase(){return K(this,void 0,void 0,function*(){return mu(this.requestManager)})}isMining(){return K(this,void 0,void 0,function*(){return pu(this.requestManager)})}getHashrate(e){return K(this,void 0,void 0,function*(){var n;return e===void 0&&(e=(n=this.defaultReturnFormat)!==null&&n!==void 0?n:Ne),this.getHashRate(e)})}getHashRate(){return K(this,arguments,void 0,function*(e=this.defaultReturnFormat){return M0(this,e)})}getGasPrice(){return K(this,arguments,void 0,function*(e=this.defaultReturnFormat){return Fo(this,e)})}getMaxPriorityFeePerGas(){return K(this,arguments,void 0,function*(e=this.defaultReturnFormat){return L0(this,e)})}calculateFeeData(){return K(this,arguments,void 0,function*(e=BigInt(2),n=vo.Gwei){var r;const i=yield this.getBlock(void 0,!1),s=(r=i?.baseFeePerGas)!==null&&r!==void 0?r:void 0;let o;try{o=yield this.getGasPrice()}catch{}let a;try{a=yield this.getMaxPriorityFeePerGas()}catch{}let d;if(s){a=a??n;let u;typeof e=="number"?u=BigInt(Math.floor(e*1e3))/BigInt(1e3):u=e,d=s*u+a}return{gasPrice:o,maxFeePerGas:d,maxPriorityFeePerGas:a,baseFeePerGas:s}})}getAccounts(){return K(this,void 0,void 0,function*(){var e;return((e=yield Jp(this.requestManager))!==null&&e!==void 0?e:[]).map(r=>Se(r))})}getBlockNumber(){return K(this,arguments,void 0,function*(e=this.defaultReturnFormat){return Do(this,e)})}getBalance(e){return K(this,arguments,void 0,function*(n,r=this.defaultBlock,i=this.defaultReturnFormat){return F0(this,n,r,i)})}getStorageAt(e,n){return K(this,arguments,void 0,function*(r,i,s=this.defaultBlock,o=this.defaultReturnFormat){return D0(this,r,i,s,o)})}getCode(e){return K(this,arguments,void 0,function*(n,r=this.defaultBlock,i=this.defaultReturnFormat){return j0(this,n,r,i)})}getBlock(){return K(this,arguments,void 0,function*(e=this.defaultBlock,n=!1,r=this.defaultReturnFormat){return Ou(this,e,n,r)})}getBlockTransactionCount(){return K(this,arguments,void 0,function*(e=this.defaultBlock,n=this.defaultReturnFormat){return H0(this,e,n)})}getBlockUncleCount(){return K(this,arguments,void 0,function*(e=this.defaultBlock,n=this.defaultReturnFormat){return U0(this,e,n)})}getUncle(){return K(this,arguments,void 0,function*(e=this.defaultBlock,n,r=this.defaultReturnFormat){return G0(this,e,n,r)})}getTransaction(e){return K(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){const i=yield q0(this,n,r);if(!i)throw new ha;return i})}getPendingTransactions(){return K(this,arguments,void 0,function*(e=this.defaultReturnFormat){return $0(this,e)})}getTransactionFromBlock(){return K(this,arguments,void 0,function*(e=this.defaultBlock,n,r=this.defaultReturnFormat){return Q0(this,e,n,r)})}getTransactionReceipt(e){return K(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){const i=yield Mu(this,n,r);if(!i)throw new ha;return i})}getTransactionCount(e){return K(this,arguments,void 0,function*(n,r=this.defaultBlock,i=this.defaultReturnFormat){return Lu(this,n,r,i)})}sendTransaction(e,n=this.defaultReturnFormat,r){return Sr(this,e,n,r,this.transactionMiddleware)}sendSignedTransaction(e,n=this.defaultReturnFormat,r){return V0(this,e,n,r)}sign(e,n){return K(this,arguments,void 0,function*(r,i,s=this.defaultReturnFormat){return z0(this,r,i,s)})}signTransaction(e){return K(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return J0(this,n,r)})}call(e){return K(this,arguments,void 0,function*(n,r=this.defaultBlock,i=this.defaultReturnFormat){return jo(this,n,r,i)})}estimateGas(e){return K(this,arguments,void 0,function*(n,r=this.defaultBlock,i=this.defaultReturnFormat){return Ho(this,n,r,i)})}getPastLogs(e){return K(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return Fu(this,n,r)})}getWork(){return K(this,void 0,void 0,function*(){return Eg(this.requestManager)})}submitWork(e,n,r){return K(this,void 0,void 0,function*(){return xg(this.requestManager,e,n,r)})}requestAccounts(){return K(this,void 0,void 0,function*(){return Sg(this.requestManager)})}getChainId(){return K(this,arguments,void 0,function*(e=this.defaultReturnFormat){return Du(this,e)})}getNodeInfo(){return K(this,void 0,void 0,function*(){return Bg(this.requestManager)})}getProof(e,n){return K(this,arguments,void 0,function*(r,i,s=this.defaultBlock,o=this.defaultReturnFormat){return W0(this,r,i,s,o)})}getFeeHistory(e){return K(this,arguments,void 0,function*(n,r=this.defaultBlock,i,s=this.defaultReturnFormat){return K0(this,n,r,i,s)})}createAccessList(e){return K(this,arguments,void 0,function*(n,r=this.defaultBlock,i=this.defaultReturnFormat){return ju(this,n,r,i)})}signTypedData(e,n,r,i){return K(this,void 0,void 0,function*(){var s;return r===void 0&&(r=!1),i===void 0&&(i=(s=this.defaultReturnFormat)!==null&&s!==void 0?s:Ne),Z0(this,e,n,r,i)})}subscribe(e,n,r){return K(this,void 0,void 0,function*(){var i,s;r===void 0&&(r=(i=this.defaultReturnFormat)!==null&&i!==void 0?i:Ne);const o=yield(s=this.subscriptionManager)===null||s===void 0?void 0:s.subscribe(e,n,r);return o instanceof Hu&&e==="logs"&&typeof n=="object"&&!$(n.fromBlock)&&Number.isFinite(Number(n.fromBlock))&&setImmediate(()=>{this.getPastLogs(n).then(a=>{for(const d of a)o._processSubscriptionResult(d)}).catch(a=>{o._processSubscriptionError(a)})}),o})}static shouldClearSubscription({sub:e}){return!(e instanceof Uu)}clearSubscriptions(e=!1){var n;return(n=this.subscriptionManager)===null||n===void 0?void 0:n.unsubscribe(e?rs.shouldClearSubscription:void 0)}createNewPendingTransactionFilter(){return K(this,arguments,void 0,function*(e=this.defaultReturnFormat){return FE(this,e)})}createNewFilter(e){return K(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return DE(this,n,r)})}createNewBlockFilter(){return K(this,arguments,void 0,function*(e=this.defaultReturnFormat){return jE(this,e)})}uninstallFilter(e){return K(this,void 0,void 0,function*(){return HE(this,e)})}getFilterChanges(e){return K(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return UE(this,n,r)})}getFilterLogs(e){return K(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return GE(this,n,r)})}}function is(t){return!(!A(t.to)&&!_e(t.to)||!z(t.type)&&!A(t.type)&&t.type.length!==2||!z(t.nonce)||!z(t.gas)||!z(t.value)||!z(t.input)||t.chainId&&!z(t.chainId))}function Y0(t){return!(!A(t.address)&&!_e(t.address)||!A(t.storageKeys)&&!t.storageKeys.every(e=>Pm(e)))}function Gu(t){return!(!Array.isArray(t)||!t.every(e=>Y0(e)))}function qu(t){return!(!is(t)||!z(t.maxFeePerGas)||!z(t.maxPriorityFeePerGas)||!Gu(t.accessList))}function $u(t){return!(!is(t)||!z(t.gasPrice)||!Gu(t.accessList))}function X0(t){return!(!is(t)||!z(t.gasPrice))}function ey(t){return!(!_e(t.from)||!is(t)||!qu(t)&&!$u(t)&&!X0(t))}function qE(t){if(!ey(t))throw new cc(t)}function ty(t){return!(!A(t.from)&&!_e(t.from)||!_e(t.to)||!A(t.gas)&&!z(t.gas)||!A(t.gasPrice)&&!z(t.gasPrice)||!A(t.value)&&!z(t.value)||!A(t.data)&&!z(t.data)||!A(t.input)&&!z(t.input)||!A(t.type)||qu(t)||$u(t))}function $E(t){if(!ty(t))throw new wh(t)}const ny=t=>{if(!A(t.common)){if(A(t.common.customChain))throw new _h;if(A(t.common.customChain.chainId))throw new Eh;if(!A(t.chainId)&&t.chainId!==t.common.customChain.chainId)throw new xh({txChainId:t.chainId,customChainId:t.common.customChain.chainId})}},ry=t=>{if(!A(t.common)&&!A(t.chain)&&!A(t.hardfork))throw new Sh;if(!A(t.chain)&&A(t.hardfork)||!A(t.hardfork)&&A(t.chain))throw new Rh({chain:t.chain,hardfork:t.hardfork})},iy=t=>{if(!A(t.common)&&!A(t.common.baseChain)&&!A(t.chain)&&t.chain!==t.common.baseChain)throw new Ih({txChain:t.chain,baseChain:t.common.baseChain})},sy=t=>{if(!A(t.common)&&!A(t.common.hardfork)&&!A(t.hardfork)&&t.hardfork!==t.common.hardfork)throw new Th({txHardfork:t.hardfork,commonHardfork:t.common.hardfork})},$a=t=>{if(A(t.gas)||!Et(t.gas)||A(t.gasPrice)||!Et(t.gasPrice))throw new Nh({gas:t.gas,gasPrice:t.gasPrice});if(!A(t.maxFeePerGas)||!A(t.maxPriorityFeePerGas))throw new uc({maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas})},Qa=t=>{if(!A(t.gasPrice)&&t.type==="0x2")throw new Mh(t.gasPrice);if(t.type==="0x0"||t.type==="0x1")throw new uc({maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas});if(A(t.maxFeePerGas)||!Et(t.maxFeePerGas)||A(t.maxPriorityFeePerGas)||!Et(t.maxPriorityFeePerGas))throw new Oh({maxPriorityFeePerGas:t.maxPriorityFeePerGas,maxFeePerGas:t.maxFeePerGas})},oy=t=>{const e=!A(t.gas)||!A(t.gasLimit),n=e&&!A(t.gasPrice),r=e&&!A(t.maxPriorityFeePerGas)&&!A(t.maxFeePerGas);if(!n&&!r)throw new Bh({gas:t.gas,gasPrice:t.gasPrice,maxPriorityFeePerGas:t.maxPriorityFeePerGas,maxFeePerGas:t.maxFeePerGas});if(n&&r)throw new Ch({gas:t.gas,gasPrice:t.gasPrice,maxPriorityFeePerGas:t.maxPriorityFeePerGas,maxFeePerGas:t.maxFeePerGas});(n?$a:Qa)(t),(!A(t.type)&&t.type>"0x1"?Qa:$a)(t)},ay=(t,e,n={transactionSchema:void 0})=>{if(!A(e)){e(t);return}if(typeof t!="object"||A(t))throw new Lh(t);ny(t),ry(t),iy(t),sy(t);const r=Ue(t,W,{transactionSchema:n.transactionSchema});if(oy(r),A(r.nonce)||A(r.chainId)||r.nonce.startsWith("-")||r.chainId.startsWith("-"))throw new Fh({nonce:t.nonce,chainId:t.chainId})};var QE=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const VE=t=>{var e,n;return Object.assign(Object.assign({},t),{nonce:t.nonce,gasPrice:t.gasPrice,gasLimit:(e=t.gasLimit)!==null&&e!==void 0?e:t.gas,to:t.to,value:t.value,data:(n=t.data)!==null&&n!==void 0?n:t.input,type:t.type,chainId:t.chainId,accessList:t.accessList,maxPriorityFeePerGas:t.maxPriorityFeePerGas,maxFeePerGas:t.maxFeePerGas})},zE=(t,e)=>{var n,r,i,s,o,a,d,u,c,l,h,p,v,m,y,f,b,w;const I=!A(t.chain)&&!A(t.hardfork)||!A(t.common);let x;if(!I)e.defaultCommon?(x=Object.assign({},e.defaultCommon),A(x.hardfork)&&(x.hardfork=(n=t.hardfork)!==null&&n!==void 0?n:e.defaultHardfork),A(x.baseChain)&&(x.baseChain=e.defaultChain)):x=Ee.custom({name:"custom-network",chainId:Pe(t.chainId),networkId:A(t.networkId)?void 0:Pe(t.networkId),defaultHardfork:(r=t.hardfork)!==null&&r!==void 0?r:e.defaultHardfork},{baseChain:e.defaultChain});else{const k=(a=(o=(s=(i=t?.common)===null||i===void 0?void 0:i.customChain)===null||s===void 0?void 0:s.name)!==null&&o!==void 0?o:t.chain)!==null&&a!==void 0?a:"custom-network",P=Pe((c=(u=(d=t?.common)===null||d===void 0?void 0:d.customChain)===null||u===void 0?void 0:u.chainId)!==null&&c!==void 0?c:t?.chainId),E=Pe((p=(h=(l=t?.common)===null||l===void 0?void 0:l.customChain)===null||h===void 0?void 0:h.networkId)!==null&&p!==void 0?p:t?.networkId),G=(y=(m=(v=t?.common)===null||v===void 0?void 0:v.hardfork)!==null&&m!==void 0?m:t?.hardfork)!==null&&y!==void 0?y:e.defaultHardfork,R=(w=(b=(f=t.common)===null||f===void 0?void 0:f.baseChain)!==null&&b!==void 0?b:t.chain)!==null&&w!==void 0?w:e.defaultChain;P&&E&&k&&(x=Ee.custom({name:k,chainId:P,networkId:E,defaultHardfork:G},{baseChain:R}))}return{common:x}},cy=(t,e,n,...r)=>QE(void 0,[t,e,n,...r],void 0,function*(i,s,o,a=!1,d=!0){const u=yield o0({transaction:i,web3Context:s,privateKey:o,fillGasPrice:a,fillGasLimit:d}),c=Ue(u,W,{transactionSchema:s.config.customTransactionSchema});return ay(c,void 0,{transactionSchema:s.config.customTransactionSchema}),jt.fromTxData(VE(c),zE(c,s))}),Va=({address:t},e,n)=>{var r,i;const s=n?.topics,o=(r=n?.filter)!==null&&r!==void 0?r:{},a={};if($(n?.fromBlock)||(a.fromBlock=T(Ci.properties.number,n?.fromBlock,{number:Je.HEX,bytes:At.HEX})),$(n?.toBlock)||(a.toBlock=T(Ci.properties.number,n?.toBlock,{number:Je.HEX,bytes:At.HEX})),s&&Array.isArray(s))a.topics=[...s];else if(a.topics=[],e&&!e.anonymous&&![Un,"allEvents"].includes(e.name)&&a.topics.push((i=e.signature)!==null&&i!==void 0?i:Lo(bt(e))),![Un,"allEvents"].includes(e.name)&&e.inputs)for(const d of e.inputs){if(!d.indexed)continue;const u=o[d.name];if(!u){a.topics.push(null);continue}Array.isArray(u)?a.topics.push(u.map(c=>Zs(d.type,c))):d.type==="string"?a.topics.push(De(u)):a.topics.push(Zs(d.type,u))}return a.topics.length||delete a.topics,t&&(a.address=t.toLowerCase()),a},lr=(t,e,n)=>{const r=Array.isArray(t.inputs)?t.inputs.length:0;if(t.inputs&&r!==e.length)throw new Oe(`The number of arguments is not matching the methods required number. You need to pass ${r} arguments.`);let i;if(t.inputs?i=Jn(Array.isArray(t.inputs)?t.inputs:[],e).replace("0x",""):i=k0(e).replace("0x",""),c0(t)){if(!n)throw new Oe("The contract has no contract data option set. This is necessary to append the constructor parameters.");return n.startsWith("0x")?`${n}${i}`:`0x${n}${i}`}return`${Tr(t)}${i}`},JE=Ni,WE=Pu;class Uo extends Nr{constructor(e,n){super(e,n),this.address=e.address,this.topics=e.topics,this.abi=e.abi,this.jsonInterface=e.jsonInterface}_buildSubscriptionParams(){return["logs",{address:this.address,topics:this.topics}]}formatSubscriptionResult(e){return ns(this.abi,e,this.jsonInterface,super.returnFormat)}}const KE=Uo;function uy(t){if(Array.isArray(t)){const n=[];let r=0;for(let i=0;i<t.length;i++){const s=uy(t[i]);n.push(s),r+=s.length}return Ud(Hd(r,192),...n)}const e=fy(t);return e.length===1&&e[0]<128?e:Ud(Hd(e.length,128),e)}function Xn(t,e,n){if(n>t.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return t.slice(e,n)}function jd(t){if(t[0]===0)throw new Error("invalid RLP: extra zeros");return dy(XE(t))}function Hd(t,e){if(t<56)return Uint8Array.from([t+e]);const n=Wa(t),r=n.length/2,i=Wa(e+55+r);return Uint8Array.from(Ja(i+n))}function ZE(t,e=!1){if(typeof t>"u"||t===null||t.length===0)return Uint8Array.from([]);const n=fy(t),r=za(n);if(e)return{data:r.data,remainder:r.remainder.slice()};if(r.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return r.data}function za(t){let e,n,r,i,s;const o=[],a=t[0];if(a<=127)return{data:t.slice(0,1),remainder:t.subarray(1)};if(a<=183){if(e=a-127,a===128?r=Uint8Array.from([]):r=Xn(t,1,e),e===2&&r[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:r,remainder:t.subarray(e)}}else if(a<=191){if(n=a-182,t.length-1<n)throw new Error("invalid RLP: not enough bytes for string length");if(e=jd(Xn(t,1,n)),e<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return r=Xn(t,n,e+n),{data:r,remainder:t.subarray(e+n)}}else if(a<=247){for(e=a-191,i=Xn(t,1,e);i.length;)s=za(i),o.push(s.data),i=s.remainder;return{data:o,remainder:t.subarray(e)}}else{if(n=a-246,e=jd(Xn(t,1,n)),e<56)throw new Error("invalid RLP: encoded list too short");const d=n+e;if(d>t.length)throw new Error("invalid RLP: total length is larger than the data");for(i=Xn(t,n,d);i.length;)s=za(i),o.push(s.data),i=s.remainder;return{data:o,remainder:t.subarray(d)}}}const YE=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function XE(t){let e="";for(let n=0;n<t.length;n++)e+=YE[t[n]];return e}function dy(t){const e=Number.parseInt(t,16);if(Number.isNaN(e))throw new Error("Invalid byte sequence");return e}function Ja(t){if(typeof t!="string")throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++){const r=n*2;e[n]=dy(t.slice(r,r+2))}return e}function Ud(...t){if(t.length===1)return t[0];const e=t.reduce((r,i)=>r+i.length,0),n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}function ex(t){return new TextEncoder().encode(t)}function Wa(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");const e=t.toString(16);return e.length%2?`0${e}`:e}function tx(t){return t.length%2?`0${t}`:t}function ly(t){return t.length>=2&&t[0]==="0"&&t[1]==="x"}function nx(t){return typeof t!="string"?t:ly(t)?t.slice(2):t}function fy(t){if(t instanceof Uint8Array)return t;if(typeof t=="string")return ly(t)?Ja(tx(nx(t))):ex(t);if(typeof t=="number"||typeof t=="bigint")return t?Ja(Wa(t)):Uint8Array.from([]);if(t==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof t)}const rx={encode:uy,decode:ZE},Go=(t,e,n,r)=>{var i,s;const o={};return(!$(t.data)||r==="both")&&(o.data=lr(e,n,(i=t.data)!==null&&i!==void 0?i:t.input)),(!$(t.input)||r==="both")&&(o.input=lr(e,n,(s=t.input)!==null&&s!==void 0?s:t.data)),$(o.input)&&$(o.data)&&(o[r]=lr(e,n)),{data:o.data,input:o.input}},Xs=({abi:t,params:e,options:n,contractOptions:r})=>{var i,s,o;if(!((o=(s=(i=n?.input)!==null&&i!==void 0?i:n?.data)!==null&&s!==void 0?s:r.input)!==null&&o!==void 0?o:r.data)&&!n?.to&&!r.address)throw new Oe("Contract address not specified");if(!n?.from&&!r.from)throw new Oe('Contract "from" address not specified');let d=$t({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const u=Go(d,t,e,n?.dataInputFill);return d=Object.assign(Object.assign({},d),{data:u.data,input:u.input}),d},hy=({abi:t,params:e,options:n,contractOptions:r})=>{if(!n?.to&&!r.address)throw new Oe("Contract address not specified");let i=$t({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const s=Go(i,t,e,n?.dataInputFill);return i=Object.assign(Object.assign({},i),{data:s.data,input:s.input}),i},my=({abi:t,params:e,options:n,contractOptions:r})=>{let i=$t({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,data:r.data},n);const s=Go(i,t,e,n?.dataInputFill);return i=Object.assign(Object.assign({},i),{data:s.data,input:s.input}),i},Ka=t=>typeof t=="object"&&!$(t)&&Object.keys(t).length!==0&&!Zt(t),py=({abi:t,params:e,options:n,contractOptions:r})=>{if(!n?.to&&!r.address)throw new Oe("Contract address not specified");if(!n?.from&&!r.from)throw new Oe('Contract "from" address not specified');let i=$t({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const s=Go(i,t,e,n?.dataInputFill);return i=Object.assign(Object.assign({},i),{data:s.data,input:s.input}),i},ix=(t,e)=>{if(!_e(t))throw new Pr(`Invalid address given ${t}`);let n=e;if(typeof e=="string"&&Nn(e))n=se(e);else if(typeof e=="string"&&!Nn(e))throw new Gi("Invalid nonce value format");const r=rx.encode([t,n]),i=De(r),s="0x".concat(i.substring(26));return Se(s)},sx=(t,e,n)=>{if(!_e(t))throw new Pr(`Invalid address given ${t}`);if(!Nn(e))throw new si(`Invalid salt value ${e}`);if(!Nn(n))throw new si(`Invalid initCode value ${n}`);const i=De(n).padStart(64,"0"),o=`0x${["0xff",t,e,i].map(a=>a.replace(/0x/,"")).join("")}`;return Se(`0x${De(o).slice(26)}`)};var ox=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};class gy{_contractMethodDeploySend(e){const n={transactionResolver:r=>{if(r.status===BigInt(0))throw new Oe("code couldn't be stored",r);const i=this.parent.clone();return i.options.address=r.contractAddress,i},contractAbi:this.parent.options.jsonInterface,checkRevertBeforeSending:!1};return A(this.parent.getTransactionMiddleware())?Sr(this.parent,e,this.parent.defaultReturnFormat,n):Sr(this.parent,e,this.parent.defaultReturnFormat,n,this.parent.getTransactionMiddleware())}constructor(e,n){this.parent=e,this.deployOptions=n;const{args:r,abi:i,contractOptions:s,deployData:o}=this.calculateDeployParams();this.args=r,this.constructorAbi=i,this.contractOptions=s,this.deployData=o}send(e){const n=Object.assign({},e),r=this.populateTransaction(n);return this._contractMethodDeploySend(r)}populateTransaction(e){var n,r;const i=Object.assign(Object.assign({},this.contractOptions),{from:(r=(n=this.contractOptions.from)!==null&&n!==void 0?n:this.parent.defaultAccount)!==null&&r!==void 0?r:void 0}),s=Xs({abi:this.constructorAbi,params:this.args,options:Object.assign(Object.assign({},e),{dataInputFill:this.parent.contractDataInputFill}),contractOptions:i});return s.dataInputFill&&delete s.dataInputFill,s}calculateDeployParams(){var e,n,r,i,s,o;let a=this.parent.options.jsonInterface.find(p=>p.type==="constructor");a||(a={type:"constructor",stateMutability:""});const d=T({format:"bytes"},(n=(e=this.deployOptions)===null||e===void 0?void 0:e.input)!==null&&n!==void 0?n:this.parent.options.input,Ne),u=T({format:"bytes"},(i=(r=this.deployOptions)===null||r===void 0?void 0:r.data)!==null&&i!==void 0?i:this.parent.options.data,Ne);if((!d||d.trim()==="0x")&&(!u||u.trim()==="0x"))throw new Oe("contract creation without any data provided.");const c=(o=(s=this.deployOptions)===null||s===void 0?void 0:s.arguments)!==null&&o!==void 0?o:[],l=Object.assign(Object.assign({},this.parent.options),{input:d,data:u});return{args:c,abi:a,contractOptions:l,deployData:d??u}}estimateGas(e){return ox(this,arguments,void 0,function*(n,r=this.parent.defaultReturnFormat){const i=Object.assign({},n);return this.parent.contractMethodEstimateGas({abi:this.constructorAbi,params:this.args,returnFormat:r,options:i,contractOptions:this.contractOptions})})}encodeABI(){return lr(this.constructorAbi,this.args,T({format:"bytes"},this.deployData,this.parent.defaultReturnFormat))}decodeData(e){return Object.assign(Object.assign({},Ni(this.constructorAbi,e.replace(this.deployData,""),!1)),{__method__:this.constructorAbi.type})}}var ax=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};class cx extends Ii{constructor(e,n){super(e.requestManager,e.registeredSubscriptions),this.parentContract=n}subscribe(e,n){const r=Object.create(null,{subscribe:{get:()=>super.subscribe}});return ax(this,arguments,void 0,function*(i,s,o=Ne){return r.subscribe.call(this,i,s??this.parentContract.options,o)})}}var yn=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const ux={logs:Uo,newHeads:Oi,newBlockHeaders:Oi};class Lt extends Ce{get subscriptionManager(){return this._subscriptionManager}constructor(e,n,r,i,s){var o,a,d;const u=Zt(n)?n:Zt(r)?r:void 0;let c;Ka(n)?c=n:Ka(r)?c=r:c=i;let l;if(typeof n=="object"&&"provider"in n?l=n.provider:typeof r=="object"&&"provider"in r?l=r.provider:typeof i=="object"&&"provider"in i?l=i.provider:l=Lt.givenProvider,super(Object.assign(Object.assign({},c),{provider:l,registeredSubscriptions:ux})),this.syncWithContext=!1,this._functions={},this._subscriptionManager=new cx(super.subscriptionManager,this),c?.wallet&&(this._wallet=c.wallet),c?.accountProvider&&(this._accountProvider=c.accountProvider),!A(u)&&!A(u.data)&&!A(u.input)&&this.config.contractDataInputFill!=="both")throw new fh({data:u.data,input:u.input});this._overloadedMethodAbis=new Map;const h=Ct(i)?i:Ct(r)?r:s??this.defaultReturnFormat,p=typeof n=="string"?n:void 0;this.config.contractDataInputFill=(o=u?.dataInputFill)!==null&&o!==void 0?o:this.config.contractDataInputFill,this._parseAndSetJsonInterface(e,h),this.defaultReturnFormat!==h&&(this.defaultReturnFormat=h),A(p)||this._parseAndSetAddress(p,h),this.options={address:p,jsonInterface:this._jsonInterface,gas:(a=u?.gas)!==null&&a!==void 0?a:u?.gasLimit,gasPrice:u?.gasPrice,from:u?.from,input:u?.input,data:u?.data},this.syncWithContext=(d=u?.syncWithContext)!==null&&d!==void 0?d:!1,c instanceof Ce&&this.subscribeToContextEvents(c),Object.defineProperty(this.options,"address",{set:v=>this._parseAndSetAddress(v,h),get:()=>this._address}),Object.defineProperty(this.options,"jsonInterface",{set:v=>this._parseAndSetJsonInterface(v,h),get:()=>this._jsonInterface}),c instanceof Ce&&c.on(fn.CONFIG_CHANGE,v=>{this.setConfig({[v.name]:v.newValue})})}setTransactionMiddleware(e){this.transactionMiddleware=e}getTransactionMiddleware(){return this.transactionMiddleware}get events(){return this._events}get methods(){return this._methods}clone(){let e;return this.options.address?e=new Lt([...this._jsonInterface,...this._errorsInterface],this.options.address,{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()):e=new Lt([...this._jsonInterface,...this._errorsInterface],{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()),this.context&&e.subscribeToContextEvents(this.context),e}deploy(e){return new gy(this,e)}getPastEvents(e,n,r){return yn(this,void 0,void 0,function*(){var i;const s=typeof e=="string"?e:Un,o=typeof e!="string"&&!Ct(e)?e:Ct(n)?{}:n,a=Ct(e)?e:Ct(n)?n:r??this.defaultReturnFormat,d=s==="allEvents"||s===Un?$s:this._jsonInterface.find(f=>"name"in f&&f.name===s);if(!d)throw new Oe(`Event ${String(s)} not found.`);const{fromBlock:u,toBlock:c,topics:l,address:h}=Va(this.options,d,o??{}),p=yield Fu(this,{fromBlock:u,toBlock:c,topics:l,address:h},a),v=p?p.map(f=>typeof f=="string"?f:ns(d,f,this._jsonInterface,a)):[],m=(i=o?.filter)!==null&&i!==void 0?i:{},y=Object.keys(m);return y.length>0?v.filter(f=>typeof f=="string"?!0:y.every(b=>{var w;if(Array.isArray(m[b]))return m[b].some(x=>String(f.returnValues[b]).toUpperCase()===String(x).toUpperCase());const I=(w=d.inputs)===null||w===void 0?void 0:w.filter(x=>x.name===b)[0];return I?.indexed&&I.type==="string"&&De(m[b])===String(f.returnValues[b])?!0:String(f.returnValues[b]).toUpperCase()===String(m[b]).toUpperCase()})):v})}_parseAndSetAddress(e,n=this.defaultReturnFormat){this._address=e&&Se(T({format:"address"},e,n))}decodeMethodData(e){const n=e.slice(0,10),i=this._jsonInterface.filter(s=>s.type!=="error").find(s=>n===Tr(bt(s)));if(!i)throw new Oe(`The ABI for the provided method signature ${n} was not found.`);return Ni(i,e)}_parseAndSetJsonInterface(e,n=this.defaultReturnFormat){var r,i;this._functions={},this._methods={},this._events={};let s=[];const o=e.filter(d=>d.type!=="error"),a=e.filter(d=>Xi(d));for(const d of o){const u=Object.assign(Object.assign({},d),{signature:""});if(es(u)){const c=bt(u),l=Tr(c);u.methodNameWithInputs=c,u.signature=l,u.constant=u.stateMutability==="view"||u.stateMutability==="pure"||u.constant,u.payable=u.stateMutability==="payable"||u.payable,this._overloadedMethodAbis.set(u.name,[...(r=this._overloadedMethodAbis.get(u.name))!==null&&r!==void 0?r:[],u]);const h=(i=this._overloadedMethodAbis.get(u.name))!==null&&i!==void 0?i:[],p=this._createContractMethod(h,a),v=this._createContractMethod(h,a,!0);this._functions[c]={signature:l,method:v},this._methods[u.name]=p,this._methods[c]=v,this._methods[l]=v}else if(No(u)){const c=bt(u),l=Lo(c),h=this._createContractEvent(u,n);u.signature=l,(!(c in this._events)||u.name==="bound")&&(this._events[c]=h),this._events[u.name]=h,this._events[l]=h}s=[...s,u]}this._events.allEvents=this._createContractEvent($s,n),this._jsonInterface=[...s],this._errorsInterface=a}_getAbiParams(e,n){var r;try{return $r((r=e.inputs)!==null&&r!==void 0?r:[],n)}catch(i){throw new Oe(`Invalid parameters for method ${e.name}: ${i.message}`)}}_createContractMethod(e,n,r=!1){const i=e[e.length-1];return(...s)=>{var o,a,d;let u;const c=(a=r?(o=this._overloadedMethodAbis.get(i.name))===null||o===void 0?void 0:o.filter(m=>m.signature===i.signature):this._overloadedMethodAbis.get(i.name))!==null&&a!==void 0?a:[];let l=c[0];const h=n,p=c.filter(m=>{var y;return((y=m.inputs)!==null&&y!==void 0?y:[]).length===s.length});if(c.length===1||p.length===0)u=this._getAbiParams(l,s),q.validate((d=i.inputs)!==null&&d!==void 0?d:[],u);else{const m=[],y=[];for(const f of p)try{u=this._getAbiParams(f,s),q.validate(f.inputs,u),y.push(f)}catch(b){m.push(b)}if(y.length===1?[l]=y:y.length>1&&([l]=y,console.warn(`Multiple methods found that is compatible with the given inputs.
12
+ Found ${y.length} compatible methods: ${JSON.stringify(y.map(f=>`${f.methodNameWithInputs} (signature: ${f.signature})`))}
13
+ The first one will be used: ${l.methodNameWithInputs}`)),m.length===p.length)throw new Cn(m)}const v={arguments:u,call:(m,y)=>yn(this,void 0,void 0,function*(){return this._contractMethodCall(l,u,h,m,y)}),send:m=>this._contractMethodSend(l,u,h,m),populateTransaction:(m,y)=>{var f,b;let w=y??this.options;w=Object.assign(Object.assign({},w),{input:void 0,from:(b=(f=w?.from)!==null&&f!==void 0?f:this.defaultAccount)!==null&&b!==void 0?b:void 0});const I=Xs({abi:i,params:s,options:Object.assign(Object.assign({},m),{dataInputFill:this.config.contractDataInputFill}),contractOptions:w});return I.dataInputFill&&delete I.dataInputFill,I},estimateGas:(m,...y)=>yn(this,[m,...y],void 0,function*(f,b=this.defaultReturnFormat){return this.contractMethodEstimateGas({abi:l,params:u,returnFormat:b,options:f})}),encodeABI:()=>lr(l,u),decodeData:m=>Ni(l,m),createAccessList:(m,y)=>yn(this,void 0,void 0,function*(){return this._contractMethodCreateAccessList(l,u,h,m,y)})};return l.stateMutability==="payable",v}}_contractMethodCall(e,n,r,i,s){return yn(this,void 0,void 0,function*(){var o;const a=hy({abi:e,params:n,options:Object.assign(Object.assign({},i),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(o=this.options.from)!==null&&o!==void 0?o:this.config.defaultAccount})});try{const d=yield jo(this,a,s,this.defaultReturnFormat);return Pu(e,d)}catch(d){throw d instanceof en&&Qr(r,d.cause),d}})}_contractMethodCreateAccessList(e,n,r,i,s){return yn(this,void 0,void 0,function*(){var o;const a=py({abi:e,params:n,options:Object.assign(Object.assign({},i),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(o=this.options.from)!==null&&o!==void 0?o:this.config.defaultAccount})});try{return ju(this,a,s,this.defaultReturnFormat)}catch(d){throw d instanceof en&&Qr(r,d.cause),d}})}_contractMethodSend(e,n,r,i,s){var o,a;let d=s??this.options;d=Object.assign(Object.assign({},d),{input:void 0,from:(a=(o=d.from)!==null&&o!==void 0?o:this.defaultAccount)!==null&&a!==void 0?a:void 0});const u=Xs({abi:e,params:n,options:Object.assign(Object.assign({},i),{dataInputFill:this.config.contractDataInputFill}),contractOptions:d}),c=A(this.transactionMiddleware)?Sr(this,u,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface}):Sr(this,u,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface},this.transactionMiddleware);return c.on("error",l=>{l instanceof en&&Qr(r,l.cause)}),c}contractMethodEstimateGas(e){return yn(this,arguments,void 0,function*({abi:n,params:r,returnFormat:i,options:s,contractOptions:o}){const a=my({abi:n,params:r,options:Object.assign(Object.assign({},s),{dataInputFill:this.config.contractDataInputFill}),contractOptions:o??this.options});return Ho(this,a,it.LATEST,i??this.defaultReturnFormat)})}_createContractEvent(e,n=this.defaultReturnFormat){return(...r)=>{var i;const{topics:s,fromBlock:o}=Va(this.options,e,r[0]),a=new Uo({address:this.options.address,topics:s,abi:e,jsonInterface:this._jsonInterface},{subscriptionManager:this.subscriptionManager,returnFormat:n});return A(o)||this.getPastEvents(e.name,{fromBlock:o,topics:s},n).then(d=>{d&&d.forEach(u=>a.emit("data",u))}).catch(d=>{a.emit("error",new ht("Failed to get past events.",d))}),(i=this.subscriptionManager)===null||i===void 0||i.addSubscription(a).catch(d=>{a.emit("error",new ht("Failed to subscribe.",d))}),a}}subscribeToContextEvents(e){const n=this;this.context=e,n.syncWithContext&&e.on(fn.CONFIG_CHANGE,r=>{n.setConfig({[r.name]:r.newValue})})}}const dx=Object.freeze(Object.defineProperty({__proto__:null,Contract:Lt,ContractLogsSubscription:Uo,DeployerMethodClass:gy,LogsSubscription:KE,create2ContractAddress:sx,createContractAddress:ix,decodeEventABI:ns,decodeMethodParams:JE,decodeMethodReturn:WE,default:Lt,encodeEventABI:Va,encodeMethodABI:lr,getCreateAccessListParams:py,getEstimateGasParams:my,getEthTxCallParams:hy,getSendTxParams:Xs,isWeb3ContractContext:Ka},Symbol.toStringTag,{value:"Module"})),Gd={addr:"0x3b3b57de",name:"0x691f3431",abi:"0x2203ab56",pubkey:"0xc8690233",text:"0x59d1d43c",contenthash:"0xbc1c58d1"},er={setAddr:"addr",addr:"addr",pubkey:"pubkey",contenthash:"contenthash",text:"text",name:"name"},Mi={main:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",goerli:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},lx={"0x1":"main","0x5":"goerli"},fx=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"label",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"NewOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"resolver",type:"address"}],name:"NewResolver",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"recordExists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"resolver",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"ttl",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"}],hx=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"},{indexed:!1,internalType:"bytes",name:"record",type:"bytes"}],name:"DNSRecordChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"}],name:"DNSRecordDeleted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"}],name:"DNSZoneCleared",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"lastzonehash",type:"bytes"},{indexed:!1,internalType:"bytes",name:"zonehash",type:"bytes"}],name:"DNSZonehashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"}],name:"TextChanged",type:"event"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address payable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint16",name:"resource",type:"uint16"}],name:"dnsRecord",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],name:"hasDNSRecords",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"zonehash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"}];var mx="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";const qd=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),$d=4;function px(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,s=[0,1];for(let x=1;x<r;x++)s.push(i+=n());let o=n(),a=e;e+=o;let d=0,u=0;function c(){return d==0&&(u=u<<8|t[e++],d=8),u>>--d&1}const l=31,h=2**l,p=h>>>1,v=p>>1,m=h-1;let y=0;for(let x=0;x<l;x++)y=y<<1|c();let f=[],b=0,w=h;for(;;){let x=Math.floor(((y-b+1)*i-1)/w),k=0,P=r;for(;P-k>1;){let R=k+P>>>1;x<s[R]?P=R:k=R}if(k==0)break;f.push(k);let E=b+Math.floor(w*s[k]/i),G=b+Math.floor(w*s[k+1]/i)-1;for(;((E^G)&p)==0;)y=y<<1&m|c(),E=E<<1&m,G=G<<1&m|1;for(;E&~G&v;)y=y&p|y<<1&m>>>1|c(),E=E<<1^p,G=(G^p)<<1|p|1;b=E,w=1+G-E}let I=r-4;return f.map(x=>{switch(x-I){case 3:return I+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return I+256+(t[a++]<<8|t[a++]);case 1:return I+t[a++];default:return x-1}})}function gx(t){let e=0;return()=>t[e++]}function yy(t){return gx(px(yx(t)))}function yx(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let n=t.length,r=new Uint8Array(6*n>>3);for(let i=0,s=0,o=0,a=0;i<n;i++)a=a<<6|e[t.charCodeAt(i)],o+=6,o>=8&&(r[s++]=a>>(o-=8));return r}function vx(t){return t&1?~t>>1:t>>1}function bx(t,e){let n=Array(t);for(let r=0,i=0;r<t;r++)n[r]=i+=vx(e());return n}function Li(t,e=0){let n=[];for(;;){let r=t(),i=t();if(!i)break;e+=r;for(let s=0;s<i;s++)n.push(e+s);e+=i+1}return n}function vy(t){return Fi(()=>{let e=Li(t);if(e.length)return e})}function by(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(Ax(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(wx(n,t))}return e.flat()}function Fi(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function Ay(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;i<e;i++)bx(t,n).forEach((s,o)=>r[o].push(s));return r}function Ax(t,e){let n=1+e(),r=e(),i=Fi(e);return Ay(i.length,1+t,e).flatMap((o,a)=>{let[d,...u]=o;return Array(i[a]).fill().map((c,l)=>{let h=l*r;return[d+l*n,u.map(p=>p+h)]})})}function wx(t,e){let n=1+e();return Ay(n,1+t,e).map(i=>[i[0],i.slice(1)])}function _x(t){let e=[],n=Li(t);return i(r([]),[]),e;function r(s){let o=t(),a=Fi(()=>{let d=Li(t).map(u=>n[u]);if(d.length)return r(d)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,d){if(!(s&4&&d===a[a.length-1])){s&2&&(d=a[a.length-1]),s&1&&e.push(a);for(let u of o)for(let c of u.Q)i(u,[...a,c],d)}}}function Ex(t){return t.toString(16).toUpperCase().padStart(2,"0")}function wy(t){return`{${Ex(t)}}`}function xx(t){let e=[];for(let n=0,r=t.length;n<r;){let i=t.codePointAt(n);n+=i<65536?1:2,e.push(i)}return e}function Rr(t){let n=t.length;if(n<4096)return String.fromCodePoint(...t);let r=[];for(let i=0;i<n;)r.push(String.fromCodePoint(...t.slice(i,i+=4096)));return r.join("")}function Ix(t,e){let n=t.length,r=n-e.length;for(let i=0;r==0&&i<n;i++)r=t[i]-e[i];return r}var Tx="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";const Di=44032,eo=4352,to=4449,no=4519,_y=19,Ey=21,kr=28,ro=Ey*kr,Sx=_y*ro,Rx=Di+Sx,kx=eo+_y,Bx=to+Ey,Px=no+kr;function Gr(t){return t>>24&255}function xy(t){return t&16777215}let Za,Qd,Ya,vs;function Cx(){let t=yy(Tx);Za=new Map(vy(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),Qd=new Set(Li(t)),Ya=new Map,vs=new Map;for(let[e,n]of by(t)){if(!Qd.has(e)&&n.length==2){let[r,i]=n,s=vs.get(r);s||(s=new Map,vs.set(r,s)),s.set(i,e)}Ya.set(e,n.reverse())}}function Iy(t){return t>=Di&&t<Rx}function Nx(t,e){if(t>=eo&&t<kx&&e>=to&&e<Bx)return Di+(t-eo)*ro+(e-to)*kr;if(Iy(t)&&e>no&&e<Px&&(t-Di)%kr==0)return t+(e-no);{let n=vs.get(t);return n&&(n=n.get(e),n)?n:-1}}function Ty(t){Za||Cx();let e=[],n=[],r=!1;function i(s){let o=Za.get(s);o&&(r=!0,s|=o),e.push(s)}for(let s of t)for(;;){if(s<128)e.push(s);else if(Iy(s)){let o=s-Di,a=o/ro|0,d=o%ro/kr|0,u=o%kr;i(eo+a),i(to+d),u>0&&i(no+u)}else{let o=Ya.get(s);o?n.push(...o):i(s)}if(!n.length)break;s=n.pop()}if(r&&e.length>1){let s=Gr(e[0]);for(let o=1;o<e.length;o++){let a=Gr(e[o]);if(a==0||s<=a){s=a;continue}let d=o-1;for(;;){let u=e[d+1];if(e[d+1]=e[d],e[d]=u,!d||(s=Gr(e[--d]),s<=a))break}s=Gr(e[o])}}return e}function Ox(t){let e=[],n=[],r=-1,i=0;for(let s of t){let o=Gr(s),a=xy(s);if(r==-1)o==0?r=a:e.push(a);else if(i>0&&i>=o)o==0?(e.push(r,...n),n.length=0,r=a):n.push(a),i=o;else{let d=Nx(r,a);d>=0?r=d:i==0&&o==0?(e.push(r),r=a):(n.push(a),i=o)}}return r>=0&&e.push(r,...n),e}function Sy(t){return Ty(t).map(xy)}function Mx(t){return Ox(Ty(t))}const Vd=45,Ry=".",ky=65039,By=1,io=t=>Array.from(t);function ji(t,e){return t.P.has(e)||t.Q.has(e)}class Lx extends Array{get is_emoji(){return!0}}let Xa,Py,En,ec,Cy,fr,da,ir,bn,zd,tc;function Qu(){if(Xa)return;let t=yy(mx);const e=()=>Li(t),n=()=>new Set(e()),r=(c,l)=>l.forEach(h=>c.add(h));Xa=new Map(by(t)),Py=n(),En=e(),ec=new Set(e().map(c=>En[c])),En=new Set(En),Cy=n(),n();let i=vy(t),s=t();const o=()=>{let c=new Set;return e().forEach(l=>r(c,i[l])),r(c,e()),c};fr=Fi(c=>{let l=Fi(t).map(h=>h+96);if(l.length){let h=c>=s;l[0]-=32,l=Rr(l),h&&(l=`Restricted[${l}]`);let p=o(),v=o(),m=!t();return{N:l,P:p,Q:v,M:m,R:h}}}),da=n(),ir=new Map;let a=e().concat(io(da)).sort((c,l)=>c-l);a.forEach((c,l)=>{let h=t(),p=a[l]=h?a[l-h]:{V:[],M:new Map};p.V.push(c),da.has(c)||ir.set(c,p)});for(let{V:c,M:l}of new Set(ir.values())){let h=[];for(let v of c){let m=fr.filter(f=>ji(f,v)),y=h.find(({G:f})=>m.some(b=>f.has(b)));y||(y={G:new Set,V:[]},h.push(y)),y.V.push(v),r(y.G,m)}let p=h.flatMap(v=>io(v.G));for(let{G:v,V:m}of h){let y=new Set(p.filter(f=>!v.has(f)));for(let f of m)l.set(f,y)}}bn=new Set;let d=new Set;const u=c=>bn.has(c)?d.add(c):bn.add(c);for(let c of fr){for(let l of c.P)u(l);for(let l of c.Q)u(l)}for(let c of bn)!ir.has(c)&&!d.has(c)&&ir.set(c,By);r(bn,Sy(bn)),zd=_x(t).map(c=>Lx.from(c)).sort(Ix),tc=new Map;for(let c of zd){let l=[tc];for(let h of c){let p=l.map(v=>{let m=v.get(h);return m||(m=new Map,v.set(h,m)),m});h===ky?l.push(...p):l=p}for(let h of l)h.V=c}}function Vu(t){return(Ny(t)?"":`${zu(qo([t]))} `)+wy(t)}function zu(t){return`"${t}"‎`}function Fx(t){if(t.length>=4&&t[2]==Vd&&t[3]==Vd)throw new Error(`invalid label extension: "${Rr(t.slice(0,4))}"`)}function Dx(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function jx(t){let e=t[0],n=qd.get(e);if(n)throw Vr(`leading ${n}`);let r=t.length,i=-1;for(let s=1;s<r;s++){e=t[s];let o=qd.get(e);if(o){if(i==s)throw Vr(`${n} + ${o}`);i=s+1,n=o}}if(i==r)throw Vr(`trailing ${n}`)}function qo(t,e=1/0,n=wy){let r=[];Hx(t[0])&&r.push("◌"),t.length>e&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,s=t.length;for(let o=0;o<s;o++){let a=t[o];Ny(a)&&(r.push(Rr(t.slice(i,o))),r.push(n(a)),i=o+1)}return r.push(Rr(t.slice(i,s))),r.join("")}function Hx(t,e){return Qu(),En.has(t)}function Ny(t){return Qu(),Cy.has(t)}function Ux(t){return Qx(Gx(t,Mx,Jx))}function Gx(t,e,n){if(!t)return[];Qu();let r=0;return t.split(Ry).map(i=>{let s=xx(i),o={input:s,offset:r};r+=s.length+1;try{let a=o.tokens=zx(s,e,n),d=a.length,u;if(!d)throw new Error("empty label");let c=o.output=a.flat();if(Dx(c),!(o.emoji=d>1||a[0].is_emoji)&&c.every(h=>h<128))Fx(c),u="ASCII";else{let h=a.flatMap(p=>p.is_emoji?[]:p);if(!h.length)u="Emoji";else{if(En.has(c[0]))throw Vr("leading combining mark");for(let m=1;m<d;m++){let y=a[m];if(!y.is_emoji&&En.has(y[0]))throw Vr(`emoji + combining mark: "${Rr(a[m-1])} + ${qo([y[0]])}"`)}jx(c);let p=io(new Set(h)),[v]=$x(p);Vx(v,h),qx(v,p),u=v.N}}o.type=u}catch(a){o.error=a}return o})}function qx(t,e){let n,r=[];for(let i of e){let s=ir.get(i);if(s===By)return;if(s){let o=s.M.get(i);if(n=n?n.filter(a=>o.has(a)):io(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(s=>ji(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function $x(t){let e=fr;for(let n of t){let r=e.filter(i=>ji(i,n));if(!r.length)throw fr.some(i=>ji(i,n))?My(e[0],n):Oy(n);if(e=r,r.length==1)break}return e}function Qx(t){return t.map(({input:e,error:n,output:r})=>{if(n){let i=n.message;throw new Error(t.length==1?i:`Invalid label ${zu(qo(e,63))}: ${i}`)}return Rr(r)}).join(Ry)}function Oy(t){return new Error(`disallowed character: ${Vu(t)}`)}function My(t,e){let n=Vu(e),r=fr.find(i=>i.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function Vr(t){return new Error(`illegal placement: ${t}`)}function Vx(t,e){for(let n of e)if(!ji(t,n))throw My(t,n);if(t.M){let n=Sy(e);for(let r=1,i=n.length;r<i;r++)if(ec.has(n[r])){let s=r+1;for(let o;s<i&&ec.has(o=n[s]);s++)for(let a=r;a<s;a++)if(n[a]==o)throw new Error(`duplicate non-spacing marks: ${Vu(o)}`);if(s-r>$d)throw new Error(`excessive non-spacing marks: ${zu(qo(n.slice(r-1,s)))} (${s-r}/${$d})`);r=s}}}function zx(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let s=Wx(t);if(s)i.length&&(r.push(e(i)),i=[]),r.push(n(s));else{let o=t.pop();if(bn.has(o))i.push(o);else{let a=Xa.get(o);if(a)i.push(...a);else if(!Py.has(o))throw Oy(o)}}}return i.length&&r.push(e(i)),r}function Jx(t){return t.filter(e=>e!=ky)}function Wx(t,e){let n=tc,r,i=t.length;for(;i&&(n=n.get(t[--i]),!!n);){let{V:s}=n;s&&(r=s,t.length=i)}return r}const Kx=t=>Ux(t),pt=t=>{let e="";for(let n=0;n<32;n+=1)e+="00";if(t){const r=Kx(t).split(".");for(let i=r.length-1;i>=0;i-=1){const s=Qe(r[i]).slice(2);e=Qe(`0x${e}${s}`).slice(2)}}return`0x${e}`};var ls=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};class Zx{constructor(e,n){this.contract=new Lt(fx,n??Mi.main,e),this.context=e}getOwner(e){return ls(this,void 0,void 0,function*(){try{return this.contract.methods.owner(pt(e)).call()}catch{throw new Error}})}getTTL(e){return ls(this,void 0,void 0,function*(){try{return this.contract.methods.ttl(pt(e)).call()}catch{throw new Error}})}recordExists(e){return ls(this,void 0,void 0,function*(){try{return this.contract.methods.recordExists(pt(e)).call()}catch{throw new Error}})}getResolver(e){return ls(this,void 0,void 0,function*(){try{return this.contract.methods.resolver(pt(e)).call().then(n=>{if(typeof n=="string")return new Lt(hx,n,this.context);throw new Error})}catch{throw new Error}})}get events(){return this.contract.events}}var Rt=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};class Yx{constructor(e){this.registry=e}getResolverContractAdapter(e){return Rt(this,void 0,void 0,function*(){return this.registry.getResolver(e)})}checkInterfaceSupport(e,n){var r,i;return Rt(this,void 0,void 0,function*(){if($(Gd[n]))throw new fa((r=e.options.address)!==null&&r!==void 0?r:"",n);if(!(yield e.methods.supportsInterface(Gd[n]).call()))throw new fa((i=e.options.address)!==null&&i!==void 0?i:"",n)})}supportsInterface(e,n){var r;return Rt(this,void 0,void 0,function*(){const i=yield this.getResolverContractAdapter(e);let s=n;if(!z(s)){if(s=(r=Vi(n))!==null&&r!==void 0?r:"",n==="")throw new Error("Invalid interface Id");s=s.slice(0,10)}return i.methods.supportsInterface(s).call()})}getAddress(e,n=60){return Rt(this,void 0,void 0,function*(){const r=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(r,er.addr),r.methods.addr(pt(e),n).call()})}getPubkey(e){return Rt(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(n,er.pubkey),n.methods.pubkey(pt(e)).call()})}getContenthash(e){return Rt(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(n,er.contenthash),n.methods.contenthash(pt(e)).call()})}setAddress(e,n,r){return Rt(this,void 0,void 0,function*(){const i=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(i,er.setAddr),i.methods.setAddr(pt(e),n).send(r)})}getText(e,n){return Rt(this,void 0,void 0,function*(){const r=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(r,er.text),r.methods.text(pt(e),n).call()})}getName(e,n=!0){return Rt(this,void 0,void 0,function*(){const r=`${e.toLowerCase().substring(2)}.addr.reverse`,i=yield this.getResolverContractAdapter(r);return n&&(yield this.checkInterfaceSupport(i,er.name)),i.methods.name(pt(r)).call()})}}var Ze=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,[])).next())})};class Ju extends Ce{constructor(e,n){super(n??""),this.registryAddress=e??Mi.main,this._registry=new Zx(this.getContextObject(),e),this._resolver=new Yx(this._registry)}getResolver(e){return Ze(this,void 0,void 0,function*(){return this._registry.getResolver(e)})}recordExists(e){return Ze(this,void 0,void 0,function*(){return this._registry.recordExists(e)})}getTTL(e){return Ze(this,void 0,void 0,function*(){return this._registry.getTTL(e)})}getOwner(e){return Ze(this,void 0,void 0,function*(){return this._registry.getOwner(e)})}getAddress(e,n=60){return Ze(this,void 0,void 0,function*(){return this._resolver.getAddress(e,n)})}getText(e,n){return Ze(this,void 0,void 0,function*(){return _e(e)?this._resolver.getText(yield this._resolver.getName(e,!1),n):this._resolver.getText(e,n)})}getName(e,n=!0){return Ze(this,void 0,void 0,function*(){return this._resolver.getName(e,n)})}getPubkey(e){return Ze(this,void 0,void 0,function*(){return this._resolver.getPubkey(e)})}getContenthash(e){return Ze(this,void 0,void 0,function*(){return this._resolver.getContenthash(e)})}checkNetwork(){return Ze(this,void 0,void 0,function*(){const e=Date.now()/1e3;if(!this._lastSyncCheck||e-this._lastSyncCheck>3600){const i=yield O0(this);if(!(typeof i=="boolean"&&!i))throw new mh;this._lastSyncCheck=e}if(this._detectedAddress)return this._detectedAddress;const n=yield Co(this,Object.assign(Object.assign({},this.defaultReturnFormat),{number:Je.HEX})),r=Mi[lx[n]];if(typeof r>"u")throw new hh(n);return this._detectedAddress=r,this._detectedAddress})}supportsInterface(e,n){return Ze(this,void 0,void 0,function*(){return this._resolver.supportsInterface(e,n)})}get events(){return this._registry.events}setAddress(e,n,r){return Ze(this,void 0,void 0,function*(){return this._resolver.setAddress(e,n,r)})}}const Xx=Object.freeze(Object.defineProperty({__proto__:null,ENS:Ju,registryAddresses:Mi},Symbol.toStringTag,{value:"Module"}));var zt=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const eI=t=>zt(void 0,void 0,void 0,function*(){return(yield Lg(t)).map(Se)}),tI=(t,e)=>zt(void 0,void 0,void 0,function*(){q.validate(["string"],[e]);const n=yield Fg(t,e);return Se(n)}),nI=(t,e,n,r)=>zt(void 0,void 0,void 0,function*(){return q.validate(["address","string","uint"],[e,n,r]),Dg(t,e,n,r)}),rI=(t,e)=>zt(void 0,void 0,void 0,function*(){return q.validate(["address"],[e]),jg(t,e)}),iI=(t,e,n)=>zt(void 0,void 0,void 0,function*(){return q.validate(["string","string"],[e,n]),Hg(t,e,n)}),sI=(t,e,n,r)=>zt(void 0,void 0,void 0,function*(){const i=Ue(e,W,{transactionSchema:r?.customTransactionSchema});return Ug(t,i,n)}),oI=(t,e,n,r)=>zt(void 0,void 0,void 0,function*(){const i=Ue(e,W,{transactionSchema:r?.customTransactionSchema});return Gg(t,i,n)}),aI=(t,e,n,r)=>zt(void 0,void 0,void 0,function*(){q.validate(["string","address","string"],[e,n,r]);const i=z(e)?e:et(e);return qg(t,i,n,r)}),cI=(t,e,n)=>zt(void 0,void 0,void 0,function*(){q.validate(["string","string"],[e,n]);const r=z(e)?e:et(e);return $g(t,r,n)});var kt=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};class so extends Ce{getAccounts(){return kt(this,void 0,void 0,function*(){return eI(this.requestManager)})}newAccount(e){return kt(this,void 0,void 0,function*(){return tI(this.requestManager,e)})}unlockAccount(e,n,r){return kt(this,void 0,void 0,function*(){return nI(this.requestManager,e,n,r)})}lockAccount(e){return kt(this,void 0,void 0,function*(){return rI(this.requestManager,e)})}importRawKey(e,n){return kt(this,void 0,void 0,function*(){return iI(this.requestManager,e,n)})}sendTransaction(e,n){return kt(this,void 0,void 0,function*(){return sI(this.requestManager,e,n,this.config)})}signTransaction(e,n){return kt(this,void 0,void 0,function*(){return oI(this.requestManager,e,n,this.config)})}sign(e,n,r){return kt(this,void 0,void 0,function*(){return aI(this.requestManager,e,n,r)})}ecRecover(e,n){return kt(this,void 0,void 0,function*(){return cI(this.requestManager,e,n)})}}const uI=Object.freeze(Object.defineProperty({__proto__:null,Personal:so,default:so},Symbol.toStringTag,{value:"Module"}));var gt;(function(t){t.HTTPS="https",t.WebSocket="wss"})(gt||(gt={}));var N;(function(t){t.ETH_MAINNET="eth_mainnet",t.ETH_SEPOLIA="eth_sepolia",t.ETH_HOLESKY="eth_holesky",t.POLYGON_MAINNET="polygon_mainnet",t.POLYGON_AMOY="polygon_amoy",t.AVALANCHE_C_MAINNET="avalanche_c_mainnet",t.AVALANCHE_P_MAINNET="avalanche_p_mainnet",t.AVALANCHE_X_MAINNET="avalanche_x_mainnet",t.ARBITRUM_MAINNET="arbitrum_mainnet",t.ARBITRUM_SEPOLIA="arbitrum_sepolia",t.BASE_MAINNET="base_mainnet",t.BASE_SEPOLIA="base_sepolia",t.OPTIMISM_MAINNET="optimism_mainnet",t.OPTIMISM_SEPOLIA="optimism_sepolia",t.FANTOM_MAINNET="fantom_mainnet",t.FANTOM_TESTNET="fantom_testnet",t.DYMENSION_MAINNET="dymension_mainnet",t.DYMENSION_TESTNET="dymension_testnet",t.BNB_MAINNET="bnb_mainnet",t.BNB_TESTNET="bnb_testnet",t.BSC_MAINNET="bsc_mainnet",t.BSC_TESTNET="bsc_testnet",t.ARBITRUM_ONE="arbitrum_one",t.ARBITRUM_NOVA="arbitrum_nova",t.AVALANCHE_FUJI_C="avalanche_fuji_c",t.AVALANCHE_FUJI_P="avalanche_fuji_p",t.AVALANCHE_FUJI_X="avalanche_fuji_x",t.BLAST_MAINNET="blast_mainnet",t.OPBNB_MAINNET="opbnb_mainnet",t.OPBNB_TESTNET="opbnb_testnet",t.GNOSIS_MAINNET="gnosis_mainnet",t.GNOSIS_CHIADO="gnosis_chiado",t.PULSECHAIN_MAINNET="pulsechain_mainnet",t.PULSECHAIN_TESTNET="pulsechain_testnet",t.KAVA_MAINNET="kava_mainnet",t.CRONOS_MAINNET="cronos_mainnet",t.MANTLE_MAINNET="mantle_mainnet",t.CHILIZ_MAINNET="chiliz_mainnet",t.CHILIZ_SPICY="chiliz_spicy",t.MOONBEAM_MAINNET="moonbeam_mainnet",t.TAIKO_MAINNET="taiko_mainnet",t.TAIKO_HEKLA="taiko_hekla",t.LINEA_MAINNET="linea_mainnet",t.LINEA_SEPOLIA="linea_sepolia",t.BAHAMUT_MAINNET="bahamut_mainnet",t.SCROLL_MAINNET="scroll_mainnet",t.SCROLL_SEPOLIA="scroll_sepolia",t.TRON_MAINNET="tron_mainnet",t.SYSCOIN_MAINNET="syscoin_mainnet",t.SYSCOIN_TANENBAUM="syscoin_tanenbaum",t.MOONRIVER_MAINNET="moonriver_mainnet",t.HAQQ_MAINNET="haqq_mainnet",t.EVMOS_MAINNET="evmos_mainnet",t.EVMOS_TESTNET="evmos_testnet",t.BERACHAIN_TESTNET="berachain_testnet"})(N||(N={}));const dI=1300;class lI extends j{constructor(e){super("You've reach the rate limit of free RPC calls from our Partner Quick Nodes. There are two options you can either create a paid Quick Nodes account and get 20% off for 2 months using WEB3JS referral code, or use Free public RPC endpoint.",e),this.code=dI}}const fI=1301;class Jd extends j{constructor(e){super(`Invalid provider config options given for ${e}`),this.code=fI}}var hI=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};class Ly extends xo{constructor(e,n,r,i,s){if(super(),s!==void 0&&n===gt.HTTPS&&!("providerOptions"in s))throw new Jd("HTTP Provider");if(s!==void 0&&n===gt.WebSocket&&!("socketOptions"in s||"reconnectOptions"in s))throw new Jd("Websocket Provider");this.transport=n,n===gt.HTTPS?this.provider=new wr(this.getRPCURL(e,n,r,i),s):n===gt.WebSocket&&(this.provider=new js(this.getRPCURL(e,n,r,i),s?.socketOptions,s?.reconnectOptions))}request(e,n){return hI(this,void 0,void 0,function*(){return this.transport===gt.HTTPS?yield this.provider.request(e,n):this.provider.request(e)})}getStatus(){return this.provider.getStatus()}supportsSubscriptions(){return this.provider.supportsSubscriptions()}once(e,n){var r;!((r=this.provider)===null||r===void 0)&&r.once&&this.provider.once(e,n)}removeAllListeners(e){var n;!((n=this.provider)===null||n===void 0)&&n.removeAllListeners&&this.provider.removeAllListeners(e)}connect(){var e;!((e=this.provider)===null||e===void 0)&&e.connect&&this.provider.connect()}disconnect(e,n){var r;!((r=this.provider)===null||r===void 0)&&r.disconnect&&this.provider.disconnect(e,n)}reset(){var e;!((e=this.provider)===null||e===void 0)&&e.reset&&this.provider.reset()}on(e,n){this.provider&&this.provider.on(e,n)}removeListener(e,n){this.provider&&this.provider.removeListener(e,n)}}var mI=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const Ie=t=>t!==void 0&&t.trim().length>0;class pI extends Ly{constructor(e=N.ETH_MAINNET,n=gt.HTTPS,r="",i="",s){super(e,n,r,i,s)}request(e,n){const r=Object.create(null,{request:{get:()=>super.request}});return mI(this,void 0,void 0,function*(){try{return yield r.request.call(this,e,n)}catch(i){throw i instanceof st&&i.statusCode===429?new lI(i):i}})}getRPCURL(e,n,r,i){let s="",o="";switch(e){case N.ETH_MAINNET:s=Ie(i)?i:"powerful-holy-bush.quiknode.pro",o=Ie(r)?r:"3240624a343867035925ff7561eb60dfdba2a668";break;case N.ETH_SEPOLIA:s=Ie(i)?i:"dimensional-fabled-glitter.ethereum-sepolia.quiknode.pro",o=Ie(r)?r:"382a3b5a4b938f2d6e8686c19af4b22921fde2cd";break;case N.ETH_HOLESKY:s=Ie(i)?i:"yolo-morning-card.ethereum-holesky.quiknode.pro",o=Ie(r)?r:"481ebe70638c4dcf176af617a16d02ab866b9af9";break;case N.ARBITRUM_MAINNET:s=Ie(i)?i:"autumn-divine-dinghy.arbitrum-mainnet.quiknode.pro",o=Ie(r)?r:"a5d7bfbf60b5ae9ce3628e53d69ef50d529e9a8c";break;case N.ARBITRUM_SEPOLIA:s=Ie(i)?i:"few-patient-pond.arbitrum-sepolia.quiknode.pro",o=Ie(r)?r:"3be985450970628c860b959c65cd2642dcafe53c";break;case N.BNB_MAINNET:s=Ie(i)?i:"purple-empty-reel.bsc.quiknode.pro",o=Ie(r)?r:"ebf6c532961e21f092ff2facce1ec4c89c540158";break;case N.BNB_TESTNET:s=Ie(i)?i:"floral-rough-scion.bsc-testnet.quiknode.pro",o=Ie(r)?r:"5b297e5acff5f81f4c37ebf6f235f7299b6f9d28";break;case N.POLYGON_MAINNET:s=Ie(i)?i:"small-chaotic-moon.matic.quiknode.pro",o=Ie(r)?r:"847569f8a017e84d985e10d0f44365d965a951f1";break;case N.POLYGON_AMOY:s=Ie(i)?i:"prettiest-side-shape.matic-amoy.quiknode.pro",o=Ie(r)?r:"79a9476eea661d4f82de614db1d8a895b14b881c";break;default:throw new Error("Network info not avalible.")}return`${n}://${s}/${o}`}}const gI=t=>t!==void 0&&t.trim().length>0,yI=[N.DYMENSION_MAINNET,N.DYMENSION_TESTNET,N.KAVA_MAINNET,N.CRONOS_MAINNET,N.POLYGON_MAINNET];class oo extends Ly{constructor(e=N.ETH_MAINNET,n=gt.HTTPS,r="",i){super(e,n,"",r,i)}getRPCURL(e,n,r,i){if(!oo.networkHostMap[e])throw new Error("Network info not avalible.");const s=`${oo.networkHostMap[e]}.publicnode.com`,o=gI(i)?i:s;return yI.includes(e)&&n===gt.WebSocket?`${n}://${o}/websocket`:`${n}://${o}`}}oo.networkHostMap={[N.POLYGON_AMOY]:"polygon-amoy-bor-rpc",[N.DYMENSION_MAINNET]:"dymension-evm-rpc",[N.DYMENSION_TESTNET]:"dymension-testnet-evm-rpc",[N.BLAST_MAINNET]:"blast-rpc",[N.GNOSIS_MAINNET]:"gnosis-rpc",[N.PULSECHAIN_MAINNET]:"pulsechain-rpc",[N.PULSECHAIN_TESTNET]:"pulsechain-testnet-rpc",[N.KAVA_MAINNET]:"kava-evm-rpc",[N.CRONOS_MAINNET]:"cronos-evm-rpc",[N.MANTLE_MAINNET]:"mantle-rpc",[N.TAIKO_MAINNET]:"taiko-rpc",[N.TAIKO_HEKLA]:"taiko-hekla-rpc",[N.LINEA_MAINNET]:"linea-rpc",[N.LINEA_SEPOLIA]:"linea-sepolia-rpc",[N.SCROLL_MAINNET]:"scroll-rpc",[N.SCROLL_SEPOLIA]:"scroll-sepolia-rpc",[N.SYSCOIN_MAINNET]:"syscoin-evm-rpc",[N.SYSCOIN_TANENBAUM]:"syscoin-tanenbaum-evm-rpc",[N.HAQQ_MAINNET]:"haqq-evm-rpc",[N.EVMOS_MAINNET]:"evmos-evm-rpc",[N.EVMOS_TESTNET]:"evmos-testnet-evm-rpc",[N.BERACHAIN_TESTNET]:"berachain-testnet-evm-rpc",[N.ETH_MAINNET]:"ethereum-rpc",[N.ETH_SEPOLIA]:"ethereum-sepolia-rpc",[N.ETH_HOLESKY]:"ethereum-holesky-rpc",[N.BSC_MAINNET]:"bsc-rpc",[N.BSC_TESTNET]:"bsc-testnet-rpc",[N.POLYGON_MAINNET]:"polygon-bor-rpc",[N.BASE_MAINNET]:"base-rpc",[N.BASE_SEPOLIA]:"base-sepolia-rpc",[N.ARBITRUM_ONE]:"arbitrum-one-rpc",[N.ARBITRUM_NOVA]:"arbitrum-nova-rpc",[N.ARBITRUM_SEPOLIA]:"arbitrum-sepolia-rpc",[N.AVALANCHE_C_MAINNET]:"avalanche-c-chain-rpc",[N.AVALANCHE_P_MAINNET]:"avalanche-p-chain-rpc",[N.AVALANCHE_X_MAINNET]:"avalanche-x-chain-rpc",[N.AVALANCHE_FUJI_C]:"avalanche-fuji-c-chain-rpc",[N.AVALANCHE_FUJI_P]:"avalanche-fuji-p-chain-rpc",[N.AVALANCHE_FUJI_X]:"avalanche-fuji-x-chain-rpc",[N.OPTIMISM_MAINNET]:"optimism-rpc",[N.OPTIMISM_SEPOLIA]:"optimism-sepolia-rpc",[N.FANTOM_MAINNET]:"fantom-rpc",[N.FANTOM_TESTNET]:"fantom-testnet-rpc",[N.OPBNB_MAINNET]:"opbnb-rpc",[N.OPBNB_TESTNET]:"opbnb-testnet-rpc",[N.GNOSIS_CHIADO]:"gnosis-chiado-rpc",[N.CHILIZ_MAINNET]:"chiliz-rpc",[N.CHILIZ_SPICY]:"chiliz-spicy-rpc",[N.MOONBEAM_MAINNET]:"moonbeam-rpc",[N.BAHAMUT_MAINNET]:"bahamut-rpc",[N.TRON_MAINNET]:"tron-evm-rpc",[N.MOONRIVER_MAINNET]:"moonriver-rpc"};const vI=new pI,bI={encodeEventSignature:Lo,encodeFunctionCall:B0,encodeFunctionSignature:Tr,encodeParameter:Zs,encodeParameters:Jn,decodeParameter:Bu,decodeParameters:sn,decodeLog:Cu};var Hr=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})};const AI=t=>{const e=(o,a)=>Hr(void 0,void 0,void 0,function*(){const d=yield cy(o,t),u=T({format:"bytes"},a,W);return xp(d,u)}),n=o=>{const a=ko(o);return Object.assign(Object.assign({},a),{signTransaction:d=>Hr(void 0,void 0,void 0,function*(){return e(d,a.privateKey)})})},r=(o,a,d)=>Hr(void 0,void 0,void 0,function*(){var u;const c=yield Rp(o,a,(u=d?.nonStrict)!==null&&u!==void 0?u:!0);return Object.assign(Object.assign({},c),{signTransaction:l=>Hr(void 0,void 0,void 0,function*(){return e(l,c.privateKey)})})}),i=()=>{const o=Sp();return Object.assign(Object.assign({},o),{signTransaction:a=>Hr(void 0,void 0,void 0,function*(){return e(a,o.privateKey)})})},s=new Ti({create:i,privateKeyToAccount:n,decrypt:r});return{signTransaction:e,create:i,privateKeyToAccount:n,decrypt:r,recoverTransaction:Ip,hashMessage:Ki,sign:au,recover:Hs,encrypt:cu,wallet:s,privateKeyToAddress:Zi,parseAndValidatePrivateKey:Qn,privateKeyToPublicKey:Tp}},wI={version:"4.16.0"};var _I=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(l){o(l)}}function d(c){try{u(r.throw(c))}catch(l){o(l)}}function u(c){c.done?s(c.value):i(c.value).then(a,d)}u((r=r.apply(t,e||[])).next())})},Hi;(function(t){t.eip6963announceProvider="eip6963:announceProvider",t.eip6963requestProvider="eip6963:requestProvider"})(Hi||(Hi={}));const bs=new Map,Wu="web3:providersMapUpdated",Fy=()=>_I(void 0,void 0,void 0,function*(){return new Promise((t,e)=>{typeof window>"u"&&e(new Error("window object not available, EIP-6963 is intended to be used within a browser")),window.addEventListener(Hi.eip6963announceProvider,(n=>{bs.set(n.detail.info.uuid,n.detail);const r=new CustomEvent(Wu,{detail:bs});window.dispatchEvent(r),t(bs)})),window.dispatchEvent(new Event(Hi.eip6963requestProvider))})}),Dy=t=>{if(typeof window>"u")throw new Error("window object not available, EIP-6963 is intended to be used within a browser");window.addEventListener(Wu,t)};class ss extends Ce{constructor(e=vI){var n;($(e)||typeof e=="string"&&e.trim()===""||typeof e!="string"&&!xi(e)&&!e.provider)&&console.warn("NOTE: web3.js is running without provider. You need to pass a provider in order to interact with the network!");let r={};typeof e=="string"||xi(e)?r.provider=e:e?r=e:r={},r.registeredSubscriptions=Object.assign(Object.assign({},Ys),(n=r.registeredSubscriptions)!==null&&n!==void 0?n:{}),super(r);const i=AI(this);this._wallet=i.wallet,this._accountProvider=i,this.utils=tp;const s=this;class o extends Lt{constructor(u,c,l,h,p){if(Zt(c)&&Zt(l))throw new si("Should not provide options at both 2nd and 3rd parameters");let v,m={},y,f;if(!$(c)&&typeof c!="object"&&typeof c!="string")throw new si;if(typeof c=="string"&&(v=c),Zt(c)?m=c:Zt(l)?m=l:m={},c instanceof Ce?y=c:l instanceof Ce?y=l:h instanceof Ce?y=h:y=s.getContextObject(),p?f=p:Ct(l)?f=l:Ct(h)&&(f=h),super(u,v,m,y,f),super.subscribeToContextEvents(s),!$(a)){const b=a.getTransactionMiddleware();$(b)||super.setTransactionMiddleware(b)}}}const a=s.use(rs);this.eth=Object.assign(a,{ens:s.use(Ju,Mi.main),Iban:me,net:s.use(qs),personal:s.use(so),Contract:o,abi:bI,accounts:i})}}ss.version=wI.version;ss.utils=tp;ss.requestEIP6963Providers=Fy;ss.onNewProviderDiscovered=Dy;ss.modules={Web3Eth:rs,Iban:me,Net:qs,ENS:Ju,Personal:so};const OI=Object.freeze(Object.defineProperty({__proto__:null,ALL_EVENTS:Un,ALL_EVENTS_ABI:$s,LogsSubscription:Hu,NUMBER_DATA_FORMAT:Yi,NewHeadsSubscription:Oi,NewPendingTransactionsSubscription:qa,SendTxHelper:Nu,SignatureObjectSchema:Zg,SyncingSubscription:Uu,Web3Eth:rs,abi:kE,accessListItemSchema:Vg,accessListResultSchema:zg,accessListSchema:Po,accountSchema:e0,accounts:g_,blockHeaderSchema:Wg,blockSchema:Ci,call:jo,chainSchema:La,contract:dx,createAccessList:ju,customChainSchema:Jg,decodeEventABI:ns,detectTransactionType:Qg,ens:Xx,estimateGas:Ho,feeHistorySchema:Yg,formatTransaction:Ue,getBalance:F0,getBlock:Ou,getBlockNumber:Do,getBlockTransactionCount:H0,getBlockUncleCount:U0,getChainId:Du,getCode:j0,getCoinbase:ME,getFeeHistory:K0,getGasPrice:Fo,getHashRate:M0,getLogs:Fu,getMaxPriorityFeePerGas:L0,getPendingTransactions:$0,getProof:W0,getProtocolVersion:OE,getStorageAt:D0,getTransaction:q0,getTransactionCount:Lu,getTransactionFromBlock:Q0,getTransactionFromOrToAttr:Qs,getTransactionReceipt:Mu,getUncle:G0,hardforkSchema:Fa,iban:b_,isAccessList:Gu,isAccessListEntry:Y0,isBaseTransaction:is,isMining:LE,isSyncing:O0,isTransaction1559Unsigned:qu,isTransaction2930Unsigned:$u,isTransactionCall:ty,isTransactionLegacyUnsigned:X0,isTransactionWithSender:ey,logSchema:Vn,personal:uI,prepareTransactionForSigning:cy,registeredSubscriptions:Ys,sendSignedTransaction:V0,sendTransaction:Sr,sign:z0,signTransaction:J0,signTypedData:Z0,storageProofSchema:Xg,syncSchema:Kg,transactionBuilder:o0,transactionInfoSchema:Gs,transactionReceiptSchema:zn,transactionSchema:bu,trySendTransaction:Vs,validateBaseChain:iy,validateChainInfo:ry,validateCustomChainInfo:ny,validateFeeMarketGas:Qa,validateGas:oy,validateHardfork:sy,validateLegacyGas:$a,validateTransactionCall:$E,validateTransactionForSigning:ay,validateTransactionWithSender:qE,waitForTransactionReceipt:xu,withdrawalsSchema:Au},Symbol.toStringTag,{value:"Module"})),MI=Object.freeze(Object.defineProperty({__proto__:null,Eip1193Provider:xo,get Eip6963EventName(){return Hi},SocketProvider:jc,eip6963ProvidersMap:bs,http:_A,onNewProviderDiscovered:Dy,requestEIP6963Providers:Fy,web3ProvidersMapUpdated:Wu,ws:EA},Symbol.toStringTag,{value:"Module"}));export{ee as AbiError,j as BaseWeb3Error,it as BlockTags,xh as ChainIdMismatchError,Ih as ChainMismatchError,Sh as CommonOrChainAndHardforkError,ba as ConfigChainMismatchError,va as ConfigHardforkMismatchError,$y as ConnectionCloseError,Ht as ConnectionError,As as ConnectionNotOpenError,qy as ConnectionTimeoutError,Lt as Contract,iv as ContractCodeNotStoredError,zy as ContractEventDoesNotExistError,en as ContractExecutionError,Yy as ContractInstantiationError,Qy as ContractMissingABIError,Wy as ContractMissingDeployDataError,Ky as ContractNoAddressDefinedError,Zy as ContractNoFromAddressDefinedError,Vy as ContractOnceRequiresCallbackError,Jy as ContractReservedEventError,fh as ContractTransactionDataAndInputError,Ne as DEFAULT_RETURN_FORMAT,Wh as EIP1193ProviderRpcError,Xy as ENSCheckInterfaceSupportError,mh as ENSNetworkNotSyncedError,hh as ENSUnsupportedNetworkError,rl as ERR_ABI_ENCODING,cf as ERR_CONN,ff as ERR_CONN_CLOSE,uf as ERR_CONN_INVALID,hf as ERR_CONN_MAX_ATTEMPTS,lf as ERR_CONN_NOT_OPEN,mf as ERR_CONN_PENDING_REQUESTS,df as ERR_CONN_TIMEOUT,al as ERR_CONTRACT,ul as ERR_CONTRACT_ABI_MISSING,ll as ERR_CONTRACT_EVENT_NOT_EXISTS,yl as ERR_CONTRACT_EXECUTION_REVERTED,gl as ERR_CONTRACT_INSTANTIATION,ml as ERR_CONTRACT_MISSING_ADDRESS,hl as ERR_CONTRACT_MISSING_DEPLOY_DATA,pl as ERR_CONTRACT_MISSING_FROM_ADDRESS,dl as ERR_CONTRACT_REQUIRED_CALLBACK,fl as ERR_CONTRACT_RESERVED_EVENT,cl as ERR_CONTRACT_RESOLVER_MISSING,vl as ERR_CONTRACT_TX_DATA_AND_INPUT,Uy as ERR_CORE_CHAIN_MISMATCH,rc as ERR_CORE_HARDFORK_MISMATCH,Lf as ERR_ENS_CHECK_INTERFACE_SUPPORT,Df as ERR_ENS_NETWORK_NOT_SYNCED,Ff as ERR_ENS_UNSUPPORTED_NETWORK,il as ERR_EXISTING_PLUGIN_NAMESPACE,Xd as ERR_FORMATTERS,qf as ERR_INVALID_ADDRESS,Kf as ERR_INVALID_BLOCK,Vf as ERR_INVALID_BOOLEAN,Hf as ERR_INVALID_BYTES,vf as ERR_INVALID_CLIENT,$f as ERR_INVALID_HEX,Xf as ERR_INVALID_INTEGER,jy as ERR_INVALID_KEYSTORE,Wf as ERR_INVALID_LARGE_VALUE,sl as ERR_INVALID_METHOD_PARAMS,Yf as ERR_INVALID_NIBBLE_WIDTH,Uf as ERR_INVALID_NUMBER,Tf as ERR_INVALID_PASSWORD,_f as ERR_INVALID_PRIVATE_KEY,yf as ERR_INVALID_PROVIDER,Zd as ERR_INVALID_RESPONSE,Bf as ERR_INVALID_SIGNATURE,Jf as ERR_INVALID_SIZE,jf as ERR_INVALID_STRING,Qf as ERR_INVALID_TYPE,Zf as ERR_INVALID_TYPE_ABI,Gf as ERR_INVALID_UNIT,zf as ERR_INVALID_UNSIGNED_INTEGER,Sf as ERR_IV_LENGTH,xf as ERR_KEY_DERIVATION_FAIL,If as ERR_KEY_VERSION_UNSUPPORTED,el as ERR_METHOD_NOT_IMPLEMENTED,ol as ERR_MULTIPLE_ERRORS,nl as ERR_OPERATION_ABORT,tl as ERR_OPERATION_TIMEOUT,Yd as ERR_PARAM,Rf as ERR_PBKDF2_ITERATIONS,wf as ERR_PRIVATE_KEY_LENGTH,gf as ERR_PROVIDER,Tl as ERR_RAW_TX_UNDEFINED,pf as ERR_REQ_ALREADY_SENT,Kd as ERR_RESPONSE,Zr as ERR_RPC_INTERNAL_ERROR,Yr as ERR_RPC_INVALID_INPUT,zr as ERR_RPC_INVALID_JSON,Wr as ERR_RPC_INVALID_METHOD,Kr as ERR_RPC_INVALID_PARAMS,Jr as ERR_RPC_INVALID_REQUEST,ri as ERR_RPC_LIMIT_EXCEEDED,Xr as ERR_RPC_MISSING_RESOURCE,ii as ERR_RPC_NOT_SUPPORTED,ti as ERR_RPC_TRANSACTION_REJECTED,ei as ERR_RPC_UNAVAILABLE_RESOURCE,ni as ERR_RPC_UNSUPPORTED_METHOD,th as ERR_SCHEMA_FORMAT,kf as ERR_SIGNATURE_FAILED,bf as ERR_SUBSCRIPTION,bl as ERR_TX,Zl as ERR_TX_BLOCK_TIMEOUT,Pl as ERR_TX_CHAIN_ID_MISMATCH,ef as ERR_TX_CHAIN_MISMATCH,El as ERR_TX_CONTRACT_NOT_STORED,$l as ERR_TX_DATA_AND_INPUT,Xl as ERR_TX_GAS_MISMATCH,af as ERR_TX_GAS_MISMATCH_INNER_ERROR,tf as ERR_TX_HARDFORK_MISMATCH,Rl as ERR_TX_INVALID_CALL,Cl as ERR_TX_INVALID_CHAIN_INFO,Ll as ERR_TX_INVALID_FEE_MARKET_GAS,Fl as ERR_TX_INVALID_FEE_MARKET_GAS_PRICE,Dl as ERR_TX_INVALID_LEGACY_FEE_MARKET,Ml as ERR_TX_INVALID_LEGACY_GAS,Hl as ERR_TX_INVALID_NONCE_OR_CHAIN_ID,jl as ERR_TX_INVALID_OBJECT,sf as ERR_TX_INVALID_PROPERTIES_FOR_TYPE,nf as ERR_TX_INVALID_RECEIVER,Sl as ERR_TX_INVALID_SENDER,Jl as ERR_TX_LOCAL_WALLET_NOT_AVAILABLE,Nl as ERR_TX_MISSING_CHAIN_INFO,kl as ERR_TX_MISSING_CUSTOM_CHAIN,Bl as ERR_TX_MISSING_CUSTOM_CHAIN_ID,Ol as ERR_TX_MISSING_GAS,of as ERR_TX_MISSING_GAS_INNER_ERROR,Wl as ERR_TX_NOT_FOUND,_l as ERR_TX_NO_CONTRACT_ADDRESS,Il as ERR_TX_OUT_OF_GAS,Ql as ERR_TX_POLLING_TIMEOUT,zl as ERR_TX_RECEIPT_MISSING_BLOCK_NUMBER,Vl as ERR_TX_RECEIPT_MISSING_OR_BLOCKHASH_NULL,Al as ERR_TX_REVERT_INSTRUCTION,wl as ERR_TX_REVERT_TRANSACTION,rf as ERR_TX_REVERT_TRANSACTION_CUSTOM_ERROR,xl as ERR_TX_REVERT_WITHOUT_REASON,Kl as ERR_TX_SEND_TIMEOUT,Yl as ERR_TX_SIGNING,Ul as ERR_TX_UNABLE_TO_POPULATE_NONCE,Gl as ERR_TX_UNSUPPORTED_EIP_1559,ql as ERR_TX_UNSUPPORTED_TYPE,Ef as ERR_UNSUPPORTED_KDF,eh as ERR_VALIDATION,Af as ERR_WS_PROVIDER,W as ETH_DATA_FORMAT,Mh as Eip1559GasPriceError,jh as Eip1559NotSupportedError,Hi as Eip6963EventName,Ui as Eip838ExecutionError,gh as ExistingPluginNamespaceError,At as FMT_BYTES,Je as FMT_NUMBER,Ft as FormatterError,Hy as GENESIS_BLOCK_NUMBER,Th as HardforkMismatchError,ar as HardforksOrdered,Vh as HexProcessingError,wr as HttpProvider,ah as IVLengthError,me as Iban,em as InternalError,Pr as InvalidAddressError,Jh as InvalidBlockError,co as InvalidBooleanError,xn as InvalidBytesError,ws as InvalidClientError,Gy as InvalidConnectionError,Nh as InvalidGasOrGasPrice,tm as InvalidInputError,mc as InvalidIntegerError,ic as InvalidKdfError,ya as InvalidLargeValueError,Oh as InvalidMaxPriorityFeePerGasOrMaxFeePerGas,si as InvalidMethodParamsError,Fh as InvalidNonceOrChainIdError,Gi as InvalidNumberError,ev as InvalidNumberOfParamsError,Xh as InvalidParamsError,oh as InvalidPasswordError,nh as InvalidPrivateKeyError,$h as InvalidPropertiesForTransactionTypeError,tv as InvalidProviderError,Zh as InvalidRequestError,qi as InvalidResponseError,rh as InvalidSignatureError,ga as InvalidSizeError,Qh as InvalidStringError,wh as InvalidTransactionCall,Lh as InvalidTransactionObjectError,Ah as InvalidTransactionWithReceiver,cc as InvalidTransactionWithSender,av as InvalidTypeAbiInputError,ov as InvalidTypeError,hc as InvalidUnitError,zh as InvalidUnsignedIntegerError,Y as InvalidValueError,Mf as JSONRPC_ERR_CHAIN_DISCONNECTED,Of as JSONRPC_ERR_DISCONNECTED,Pf as JSONRPC_ERR_REJECTED_REQUEST,Cf as JSONRPC_ERR_UNAUTHORIZED,Nf as JSONRPC_ERR_UNSUPPORTED_METHOD,ih as KeyDerivationError,sh as KeyStoreVersionError,am as LimitExceededError,pa as LocalWalletNotAvailableError,uh as MaxAttemptsReachedOnReconnectingError,Yh as MethodNotFoundError,ft as MethodNotImplementedError,nm as MethodNotSupported,Rh as MissingChainOrHardforkError,_h as MissingCustomChainError,Eh as MissingCustomChainIdError,Bh as MissingGasError,kh as MissingGasInnerError,cr as MultipleErrors,qs as Net,pc as NibbleWidthError,rv as NoContractAddressFoundError,ph as OperationAbortError,sc as OperationTimeoutError,ch as PBKDF2IterationsError,Kh as ParseError,dh as PendingRequestsOnReconnectingError,so as Personal,la as PrivateKeyLengthError,qr as ProviderError,lh as RequestAlreadySentError,fa as ResolverMethodMissingError,rm as ResourceUnavailableError,im as ResourcesNotFoundError,st as ResponseError,nv as RevertInstructionError,Ve as RpcError,ke as RpcErrorMessages,cm as SchemaFormatError,vh as SignatureError,ht as SubscriptionError,fc as TransactionBlockTimeoutError,dc as TransactionDataAndInputError,Gn as TransactionError,Ch as TransactionGasMismatchError,Ph as TransactionGasMismatchInnerError,Gh as TransactionMissingReceiptOrBlockHashError,ha as TransactionNotFound,sv as TransactionOutOfGasError,lc as TransactionPollingTimeoutError,qh as TransactionReceiptMissingBlockNumberError,om as TransactionRejectedError,oi as TransactionRevertInstructionError,oc as TransactionRevertWithCustomError,ac as TransactionRevertedWithoutReasonError,Hh as TransactionSendTimeoutError,_s as TransactionSigningError,ao as TypedArray,Dh as UnableToPopulateNonceError,bh as UndefinedRawTransactionError,uc as UnsupportedFeeMarketError,ma as UnsupportedTransactionTypeError,sm as VersionNotSupportedError,ss as Web3,Br as Web3BaseProvider,Wd as Web3BaseWallet,Ce as Web3Context,Oe as Web3ContractError,rs as Web3Eth,v_ as Web3EthPluginBase,Pp as Web3PluginBase,lu as Web3PromiEvent,Dm as Web3Validator,yh as Web3WSProviderError,js as WebSocketProvider,BI as core,ss as default,bs as eip6963ProvidersMap,SI as errors,OI as eth,gc as genericRpcErrorMessageTemplate,CI as net,Dy as onNewProviderDiscovered,MI as providers,Fy as requestEIP6963Providers,Me as rpcErrorsMap,PI as rpcMethods,TI as types,tp as utils,RI as validator,Wu as web3ProvidersMapUpdated};