browser-rpc 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/dist/index.js +4187 -0
  2. package/package.json +34 -0
  3. package/web-dist/assets/Arc-R3PUWRPJ-CUdEQO8X.js +1 -0
  4. package/web-dist/assets/Brave-24BM36UM-C6C5mkTK.js +1 -0
  5. package/web-dist/assets/Browser-4R4QKTV2-D3ON1q-S.js +1 -0
  6. package/web-dist/assets/Chrome-TLI42HDP-BgiVz-ma.js +1 -0
  7. package/web-dist/assets/Edge-AZ34LAFM-EBh9cG_z.js +1 -0
  8. package/web-dist/assets/Firefox-ZDK7RHKK-5nyhB0sj.js +1 -0
  9. package/web-dist/assets/Linux-VYP66PDO--MOvpQUa.js +1 -0
  10. package/web-dist/assets/Macos-5QL4JBJE-DLNYPiln.js +1 -0
  11. package/web-dist/assets/Opera-BKMCKUXC-CCypmVaM.js +1 -0
  12. package/web-dist/assets/Safari-PXQIVS6N-B-Lfxb9r.js +1 -0
  13. package/web-dist/assets/Windows-GTAT3OTE-K9Pt3pUF.js +1 -0
  14. package/web-dist/assets/add-Bt6ug9as.js +15 -0
  15. package/web-dist/assets/all-wallets-ClkSG7YV.js +6 -0
  16. package/web-dist/assets/app-store-BnzgCmML.js +17 -0
  17. package/web-dist/assets/apple-D3CNMHuT.js +18 -0
  18. package/web-dist/assets/ar_AR-ZRPPM56D-d2WEfzQ_.js +1349 -0
  19. package/web-dist/assets/arbitrum-IA4OWRTN-B0aI2PBQ.js +1 -0
  20. package/web-dist/assets/arrow-bottom-BrYwqDZR.js +8 -0
  21. package/web-dist/assets/arrow-bottom-circle-CBoHFkqN.js +11 -0
  22. package/web-dist/assets/arrow-left-CHVgplmz.js +8 -0
  23. package/web-dist/assets/arrow-right-Do5EdrXQ.js +8 -0
  24. package/web-dist/assets/arrow-top-BOPLd2d5.js +8 -0
  25. package/web-dist/assets/assets-NU2OP443-COMs-Mo6.js +1 -0
  26. package/web-dist/assets/avalanche-MXEFEDSW-DcC5FNt3.js +1 -0
  27. package/web-dist/assets/bank-DafdJl1O.js +14 -0
  28. package/web-dist/assets/base-Z4LFBE5D-DHfqMzJC.js +1 -0
  29. package/web-dist/assets/basic-CLeG2Fx1.js +2124 -0
  30. package/web-dist/assets/blast-TN2WIMWF-BUZNbRBy.js +1 -0
  31. package/web-dist/assets/browser-DRuHXezx.js +14 -0
  32. package/web-dist/assets/bsc-RVE67I5L-DVYEF0vl.js +1 -0
  33. package/web-dist/assets/card-YgaTGJnf.js +14 -0
  34. package/web-dist/assets/ccip-B4x4TU0w.js +1 -0
  35. package/web-dist/assets/ccip-ConwrR6S.js +1 -0
  36. package/web-dist/assets/celo-E6XU57FO-C5IguUgF.js +1 -0
  37. package/web-dist/assets/checkmark-Dgr_oUfC.js +11 -0
  38. package/web-dist/assets/checkmark-bold-b4BEKMa-.js +8 -0
  39. package/web-dist/assets/chevron-bottom-BlzLXicX.js +8 -0
  40. package/web-dist/assets/chevron-left-DWsjEedN.js +8 -0
  41. package/web-dist/assets/chevron-right-B-GnUH_e.js +8 -0
  42. package/web-dist/assets/chevron-top-lK6t2THp.js +8 -0
  43. package/web-dist/assets/chrome-store-CbBGk8YS.js +61 -0
  44. package/web-dist/assets/clock-ByEA0e_s.js +8 -0
  45. package/web-dist/assets/close-BxDaavrr.js +8 -0
  46. package/web-dist/assets/coinPlaceholder-B9aaOU5j.js +8 -0
  47. package/web-dist/assets/coinbaseWallet-WWX6LF36-BMRj6mTC.js +1 -0
  48. package/web-dist/assets/compass-CBP6oSW9.js +8 -0
  49. package/web-dist/assets/connect-MR6XDLIE-BET5HMNk.js +1 -0
  50. package/web-dist/assets/copy-Dp304nbr.js +15 -0
  51. package/web-dist/assets/core-Bf6VrE6v.js +896 -0
  52. package/web-dist/assets/create-X4WFHLCW-De9pC3ym.js +1 -0
  53. package/web-dist/assets/cronos-ROYR77VZ-Prn3LRPZ.js +1 -0
  54. package/web-dist/assets/cursor-WUohjLCE.js +3 -0
  55. package/web-dist/assets/cursor-transparent-CutfCQQz.js +12 -0
  56. package/web-dist/assets/de_DE-GYZFZXWH-CYZf24IR.js +1349 -0
  57. package/web-dist/assets/desktop-kZiy9C-p.js +9 -0
  58. package/web-dist/assets/disconnect-CG5TDY_m.js +8 -0
  59. package/web-dist/assets/discord-JyHSI7q0.js +17 -0
  60. package/web-dist/assets/es_419-OGVOQEFZ-D6BJPTeQ.js +1349 -0
  61. package/web-dist/assets/ethereum-RFBAMUVK-WsW8NXqo.js +1 -0
  62. package/web-dist/assets/etherscan-CyB1NBm9.js +6 -0
  63. package/web-dist/assets/events-DQ172AOg.js +1 -0
  64. package/web-dist/assets/exclamation-triangle-7y5nglSL.js +4 -0
  65. package/web-dist/assets/extension-BjB3--xE.js +8 -0
  66. package/web-dist/assets/external-link-BW0O7z6_.js +8 -0
  67. package/web-dist/assets/facebook-682BXGmP.js +26 -0
  68. package/web-dist/assets/farcaster-BOaaCMAh.js +12 -0
  69. package/web-dist/assets/filters-DFWbfLJh.js +8 -0
  70. package/web-dist/assets/flow-NBCRNYVF-D2XasjKk.js +1 -0
  71. package/web-dist/assets/fr_FR-Q5QBQBX2-lQoTmpTH.js +1349 -0
  72. package/web-dist/assets/github-DpRqYyal.js +18 -0
  73. package/web-dist/assets/gnosis-T7U5EW2Q-CoPEM_sI.js +1 -0
  74. package/web-dist/assets/google-CgUt7hYq.js +18 -0
  75. package/web-dist/assets/hardhat-NEEC6JX7-DzuWQYyS.js +1 -0
  76. package/web-dist/assets/help-circle-DwVgKpjs.js +12 -0
  77. package/web-dist/assets/hi_IN-7I7LRHGW-CTQjmeYe.js +1349 -0
  78. package/web-dist/assets/id-BaTvs6Gs.js +12 -0
  79. package/web-dist/assets/id_ID-ZMGZ2JFV-CgKQKAmU.js +1349 -0
  80. package/web-dist/assets/image-BieDxoY2.js +4 -0
  81. package/web-dist/assets/index-Burh8TwV.js +47 -0
  82. package/web-dist/assets/index-C4Lbscxg.js +1532 -0
  83. package/web-dist/assets/index-C5m0fBnu.js +7 -0
  84. package/web-dist/assets/index-CteTNahN.js +50 -0
  85. package/web-dist/assets/index-DgKl8WD4.js +9 -0
  86. package/web-dist/assets/index-GJH9xypQ.css +1 -0
  87. package/web-dist/assets/index-My90LZL7.js +1 -0
  88. package/web-dist/assets/index-aVimijSo.js +359 -0
  89. package/web-dist/assets/index.es-Me6_HSoS.js +13 -0
  90. package/web-dist/assets/info-CaUhPhOk.js +3 -0
  91. package/web-dist/assets/info-circle-Dgdf-_kY.js +12 -0
  92. package/web-dist/assets/ja_JP-NYBCHQTZ-CMaBl8Za.js +1349 -0
  93. package/web-dist/assets/klaytn-QTDBZIB3-DyuKTpxX.js +1 -0
  94. package/web-dist/assets/ko_KR-67WE736M-DHWhIjcm.js +1349 -0
  95. package/web-dist/assets/lightbulb-h5NbP99t.js +3 -0
  96. package/web-dist/assets/login-CWDTIDNK-DhDUYE4b.js +1 -0
  97. package/web-dist/assets/mail-DUTW6gdU.js +8 -0
  98. package/web-dist/assets/manta-5V6W5D7G-BnjsGzeJ.js +1 -0
  99. package/web-dist/assets/mantle-KBL3OIYT-DIpe0poV.js +1 -0
  100. package/web-dist/assets/metaMaskWallet-YFHEHW7V-BggUDXad.js +1 -0
  101. package/web-dist/assets/mobile-BFFFlSgH.js +9 -0
  102. package/web-dist/assets/more-s9g8TvGr.js +11 -0
  103. package/web-dist/assets/ms_MY-65AJIBUS-BLlUrxe6.js +1349 -0
  104. package/web-dist/assets/network-placeholder-DBVOULy6.js +14 -0
  105. package/web-dist/assets/nftPlaceholder-D8q6GiE5.js +8 -0
  106. package/web-dist/assets/off-7mG5bayL.js +8 -0
  107. package/web-dist/assets/optimism-VD7XDD2W-DpJY1TMb.js +1 -0
  108. package/web-dist/assets/play-store-BFa605Jk.js +32 -0
  109. package/web-dist/assets/plus-BgZ-WP7A.js +13 -0
  110. package/web-dist/assets/polygon-WWEUOMKW-CNBYSB1T.js +1 -0
  111. package/web-dist/assets/pt_BR-DMJANC65-DMs4DrlC.js +1349 -0
  112. package/web-dist/assets/qr-code-B_1WHzPs.js +6 -0
  113. package/web-dist/assets/rainbowWallet-2SR6TVBF-kimcGeuf.js +1 -0
  114. package/web-dist/assets/recycle-horizontal-CuuA7YIy.js +9 -0
  115. package/web-dist/assets/refresh-CSXbxAuT.js +8 -0
  116. package/web-dist/assets/refresh-HJGJRASX-D0rkc63_.js +1 -0
  117. package/web-dist/assets/reown-logo-OK1pdOfH.js +12 -0
  118. package/web-dist/assets/ronin-PNHX5V6H-BS-WPXjQ.js +1 -0
  119. package/web-dist/assets/ru_RU-WER7RQ6A-DsJK55uv.js +1349 -0
  120. package/web-dist/assets/safeWallet-VUYZPLY4-CXnodgMs.js +1 -0
  121. package/web-dist/assets/scan-DEOT2M37-1-mJ5OyF.js +1 -0
  122. package/web-dist/assets/scroll-NMZWDUQH-fIxBV-y0.js +1 -0
  123. package/web-dist/assets/search-b77MGgNN.js +8 -0
  124. package/web-dist/assets/secp256k1-CqlnLpBV.js +1 -0
  125. package/web-dist/assets/secp256k1-xC50DJGj.js +1 -0
  126. package/web-dist/assets/send-DlJtxaMX.js +15 -0
  127. package/web-dist/assets/sign-A7IJEUT5-CGsRnPrd.js +1 -0
  128. package/web-dist/assets/swapHorizontal-BmG4i-CJ.js +8 -0
  129. package/web-dist/assets/swapHorizontalBold-CrnzAaq6.js +8 -0
  130. package/web-dist/assets/swapHorizontalMedium-DuPE93B2.js +16 -0
  131. package/web-dist/assets/swapHorizontalRoundedBold-clkEaP-W.js +8 -0
  132. package/web-dist/assets/swapVertical-DXvCmf9g.js +8 -0
  133. package/web-dist/assets/telegram-uHX2mx77.js +16 -0
  134. package/web-dist/assets/th_TH-JOSHEZ6D-Cp87mIRZ.js +1349 -0
  135. package/web-dist/assets/three-dots-BoFVtYRM.js +5 -0
  136. package/web-dist/assets/tr_TR-EAMG2YPO-C52_xfsf.js +1349 -0
  137. package/web-dist/assets/twitch-BbZVXa-k.js +18 -0
  138. package/web-dist/assets/twitterIcon-DTDEnPwP.js +6 -0
  139. package/web-dist/assets/uk_UA-GO2TRVWA-C1C1400t.js +1349 -0
  140. package/web-dist/assets/verify-DSwt0ow9.js +8 -0
  141. package/web-dist/assets/verify-filled-Dd2saJZ0.js +8 -0
  142. package/web-dist/assets/vi_VN-5HLLSOJA-Dj7ferOp.js +1349 -0
  143. package/web-dist/assets/w3m-modal-Dkca-GXY.js +642 -0
  144. package/web-dist/assets/wallet-DFQUKIzv.js +8 -0
  145. package/web-dist/assets/wallet-placeholder-DBESmMOJ.js +14 -0
  146. package/web-dist/assets/walletConnectWallet-FNSU4KNU-B0ci71fU.js +1 -0
  147. package/web-dist/assets/walletconnect-Byk_h0ya.js +30 -0
  148. package/web-dist/assets/warning-circle-BjOhgUMO.js +12 -0
  149. package/web-dist/assets/x-qhswnC92.js +12 -0
  150. package/web-dist/assets/xdc-X7V4QFNF-CSGs0o6M.js +1 -0
  151. package/web-dist/assets/zetachain-BMJKVYBN-IK2CZBr3.js +1 -0
  152. package/web-dist/assets/zh_CN-THPIFVWJ-Cbp71xMR.js +1349 -0
  153. package/web-dist/assets/zh_HK-R7XP4TGF-CyJtfKGw.js +1349 -0
  154. package/web-dist/assets/zh_TW-F5LD752V-AHFgsYw-.js +1349 -0
  155. package/web-dist/assets/zkSync-JL26RB7U-BYMs9Lzo.js +1 -0
  156. package/web-dist/assets/zora-YZH32HP3-CY3tp3EJ.js +1 -0
  157. package/web-dist/index.html +13 -0
@@ -0,0 +1,47 @@
1
+ import{j as uv,h as dv}from"./index-C4Lbscxg.js";import{r as fv}from"./index-My90LZL7.js";import{r as lv}from"./events-DQ172AOg.js";function bv(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function mv(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}const hv=mv(),yv=Object.freeze(Object.defineProperty({__proto__:null,WebSocket:hv},Symbol.toStringTag,{value:"Module"}));var yd={},Rn={},St={},Zr={},Er={},Bn={},On={},il;function L1(){if(il)return On;il=1,Object.defineProperty(On,"__esModule",{value:!0}),On.getSDKVersion=void 0;const e=()=>"9.1.0";return On.getSDKVersion=e,On}var xn={},al;function pv(){if(al)return xn;al=1,Object.defineProperty(xn,"__esModule",{value:!0}),xn.generateRequestId=void 0;const e=r=>r.toString(16).padStart(2,"0"),t=r=>{const o=new Uint8Array(r/2);return window.crypto.getRandomValues(o),Array.from(o,e).join("")},n=()=>typeof window<"u"?t(10):new Date().getTime().toString(36);return xn.generateRequestId=n,xn}var sl;function D1(){if(sl)return Bn;sl=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.MessageFormatter=void 0;const e=L1(),t=pv();class n{}return Bn.MessageFormatter=n,n.makeRequest=(r,o)=>({id:(0,t.generateRequestId)(),method:r,params:o,env:{sdkVersion:(0,e.getSDKVersion)()}}),n.makeResponse=(r,o,s)=>({id:r,success:!0,version:s,data:o}),n.makeErrorResponse=(r,o,s)=>({id:r,success:!1,error:o,version:s}),Bn}var jr={},cl;function Fr(){if(cl)return jr;cl=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.RestrictedMethods=jr.Methods=void 0;var e;(function(n){n.sendTransactions="sendTransactions",n.rpcCall="rpcCall",n.getChainInfo="getChainInfo",n.getSafeInfo="getSafeInfo",n.getTxBySafeTxHash="getTxBySafeTxHash",n.getSafeBalances="getSafeBalances",n.signMessage="signMessage",n.signTypedMessage="signTypedMessage",n.getEnvironmentInfo="getEnvironmentInfo",n.getOffChainSignature="getOffChainSignature",n.requestAddressBook="requestAddressBook",n.wallet_getPermissions="wallet_getPermissions",n.wallet_requestPermissions="wallet_requestPermissions"})(e||(jr.Methods=e={}));var t;return(function(n){n.requestAddressBook="requestAddressBook"})(t||(jr.RestrictedMethods=t={})),jr}var ul;function gv(){return ul||(ul=1,(function(e){var t=Er&&Er.__createBinding||(Object.create?(function(s,i,a,c){c===void 0&&(c=a);var u=Object.getOwnPropertyDescriptor(i,a);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(s,c,u)}):(function(s,i,a,c){c===void 0&&(c=a),s[c]=i[a]})),n=Er&&Er.__exportStar||function(s,i){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,s,a)};Object.defineProperty(e,"__esModule",{value:!0});const r=D1();class o{constructor(i=null,a=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:c,data:u,source:l})=>{const f=!u,b=!this.isServer&&l===window.parent,y=typeof u.version<"u"&&parseInt(u.version.split(".")[0]),h=typeof y=="number"&&y>=1;let m=!0;return Array.isArray(this.allowedOrigins)&&(m=this.allowedOrigins.find(E=>E.test(c))!==void 0),!f&&b&&h&&m},this.logIncomingMessage=c=>{console.info(`Safe Apps SDK v1: A message was received from origin ${c.origin}. `,c.data)},this.onParentMessage=c=>{this.isValidMessage(c)&&(this.debugMode&&this.logIncomingMessage(c),this.handleIncomingMessage(c.data))},this.handleIncomingMessage=c=>{const{id:u}=c,l=this.callbacks.get(u);l&&(l(c),this.callbacks.delete(u))},this.send=(c,u)=>{const l=r.MessageFormatter.makeRequest(c,u);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(l,"*"),new Promise((f,b)=>{this.callbacks.set(l.id,y=>{if(!y.success){b(new Error(y.error));return}f(y)})})},this.allowedOrigins=i,this.debugMode=a,this.isServer||window.addEventListener("message",this.onParentMessage)}}e.default=o,n(Fr(),e)})(Er)),Er}var Cn={},wr={},qn={},dl;function _v(){if(dl)return qn;dl=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.isObjectEIP712TypedData=void 0;const e=t=>typeof t=="object"&&t!=null&&"domain"in t&&"types"in t&&"message"in t;return qn.isObjectEIP712TypedData=e,qn}var pd={},fl;function vv(){return fl||(fl=1,Object.defineProperty(pd,"__esModule",{value:!0})),pd}var gd={},ll;function Ev(){return ll||(ll=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TransferDirection=e.TransactionStatus=e.TokenType=e.Operation=void 0;var t=fv();Object.defineProperty(e,"Operation",{enumerable:!0,get:function(){return t.Operation}}),Object.defineProperty(e,"TokenType",{enumerable:!0,get:function(){return t.TokenType}}),Object.defineProperty(e,"TransactionStatus",{enumerable:!0,get:function(){return t.TransactionStatus}}),Object.defineProperty(e,"TransferDirection",{enumerable:!0,get:function(){return t.TransferDirection}})})(gd)),gd}var _d={},bl;function jv(){return bl||(bl=1,Object.defineProperty(_d,"__esModule",{value:!0}),Fr()),_d}var ml;function Kd(){return ml||(ml=1,(function(e){var t=wr&&wr.__createBinding||(Object.create?(function(r,o,s,i){i===void 0&&(i=s);var a=Object.getOwnPropertyDescriptor(o,s);(!a||("get"in a?!o.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(r,i,a)}):(function(r,o,s,i){i===void 0&&(i=s),r[i]=o[s]})),n=wr&&wr.__exportStar||function(r,o){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&t(o,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(_v(),e),n(vv(),e),n(Ev(),e),n(jv(),e)})(wr)),wr}var hl;function wv(){if(hl)return Cn;hl=1,Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.TXs=void 0;const e=Fr(),t=Kd();class n{constructor(o){this.communicator=o}async getBySafeTxHash(o){if(!o)throw new Error("Invalid safeTxHash");return(await this.communicator.send(e.Methods.getTxBySafeTxHash,{safeTxHash:o})).data}async signMessage(o){const s={message:o};return(await this.communicator.send(e.Methods.signMessage,s)).data}async signTypedMessage(o){if(!(0,t.isObjectEIP712TypedData)(o))throw new Error("Invalid typed data");return(await this.communicator.send(e.Methods.signTypedMessage,{typedData:o})).data}async send({txs:o,params:s}){if(!o||!o.length)throw new Error("No transactions were passed");const i={txs:o,params:s};return(await this.communicator.send(e.Methods.sendTransactions,i)).data}}return Cn.TXs=n,Cn}var Mn={},Hn={},yl;function Zd(){return yl||(yl=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.RPC_CALLS=void 0,Hn.RPC_CALLS={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"}),Hn}var pl;function Pv(){if(pl)return Mn;pl=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.Eth=void 0;const e=Zd(),t=Fr(),n={defaultBlockParam:(o="latest")=>o,returnFullTxObjectParam:(o=!1)=>o,blockNumberToHex:o=>Number.isInteger(o)?`0x${o.toString(16)}`:o};class r{constructor(s){this.communicator=s,this.call=this.buildRequest({call:e.RPC_CALLS.eth_call,formatters:[null,n.defaultBlockParam]}),this.getBalance=this.buildRequest({call:e.RPC_CALLS.eth_getBalance,formatters:[null,n.defaultBlockParam]}),this.getCode=this.buildRequest({call:e.RPC_CALLS.eth_getCode,formatters:[null,n.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:e.RPC_CALLS.eth_getStorageAt,formatters:[null,n.blockNumberToHex,n.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:e.RPC_CALLS.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:e.RPC_CALLS.eth_getBlockByHash,formatters:[null,n.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:e.RPC_CALLS.eth_getBlockByNumber,formatters:[n.blockNumberToHex,n.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:e.RPC_CALLS.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:e.RPC_CALLS.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:e.RPC_CALLS.eth_getTransactionCount,formatters:[null,n.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:e.RPC_CALLS.eth_gasPrice}),this.getEstimateGas=i=>this.buildRequest({call:e.RPC_CALLS.eth_estimateGas})([i]),this.setSafeSettings=this.buildRequest({call:e.RPC_CALLS.safe_setSettings})}buildRequest(s){const{call:i,formatters:a}=s;return async c=>{a&&Array.isArray(c)&&a.forEach((f,b)=>{f&&(c[b]=f(c[b]))});const u={call:i,params:c||[]};return(await this.communicator.send(t.Methods.rpcCall,u)).data}}}return Mn.Eth=r,Mn}var Rt={},vd={},Ed={},kn={},Fn={},gl;function Av(){return gl||(gl=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.version=void 0,Fn.version="1.2.3"),Fn}var _l;function yn(){if(_l)return kn;_l=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.BaseError=void 0;const e=Av();class t extends Error{constructor(r,o={}){const s=o.cause instanceof t?o.cause.details:o.cause?.message?o.cause.message:o.details,i=o.cause instanceof t&&o.cause.docsPath||o.docsPath,a=[r||"An error occurred.","",...o.metaMessages?[...o.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...s?[`Details: ${s}`]:[],`Version: abitype@${e.version}`].join(`
2
+ `);super(a),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),o.cause&&(this.cause=o.cause),this.details=s,this.docsPath=i,this.metaMessages=o.metaMessages,this.shortMessage=r}}return kn.BaseError=t,kn}var ui={},vl;function Tv(){if(vl)return ui;vl=1,Object.defineProperty(ui,"__esModule",{value:!0}),ui.narrow=e;function e(t){return t}return ui}var di={},fi={},li={},bi={},Pt={},El;function wu(){if(El)return Pt;El=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.isTupleRegex=Pt.integerRegex=Pt.bytesRegex=void 0,Pt.execTyped=e;function e(t,n){return t.exec(n)?.groups}return Pt.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Pt.integerRegex=/^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)?$/,Pt.isTupleRegex=/^\(.+?\).*?$/,Pt}var jl;function G1(){if(jl)return bi;jl=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.formatAbiParameter=n;const e=wu(),t=/^tuple(?<array>(\[(\d*)\])*)$/;function n(r){let o=r.type;if(t.test(r.type)&&"components"in r){o="(";const s=r.components.length;for(let a=0;a<s;a++){const c=r.components[a];o+=n(c),a<s-1&&(o+=", ")}const i=(0,e.execTyped)(t,r.type);return o+=`)${i?.array||""}`,n({...r,type:o})}return"indexed"in r&&r.indexed&&(o=`${o} indexed`),r.name?`${o} ${r.name}`:o}return bi}var wl;function V1(){if(wl)return li;wl=1,Object.defineProperty(li,"__esModule",{value:!0}),li.formatAbiParameters=t;const e=G1();function t(n){let r="";const o=n.length;for(let s=0;s<o;s++){const i=n[s];r+=(0,e.formatAbiParameter)(i),s!==o-1&&(r+=", ")}return r}return li}var Pl;function W1(){if(Pl)return fi;Pl=1,Object.defineProperty(fi,"__esModule",{value:!0}),fi.formatAbiItem=t;const e=V1();function t(n){return n.type==="function"?`function ${n.name}(${(0,e.formatAbiParameters)(n.inputs)})${n.stateMutability&&n.stateMutability!=="nonpayable"?` ${n.stateMutability}`:""}${n.outputs?.length?` returns (${(0,e.formatAbiParameters)(n.outputs)})`:""}`:n.type==="event"?`event ${n.name}(${(0,e.formatAbiParameters)(n.inputs)})`:n.type==="error"?`error ${n.name}(${(0,e.formatAbiParameters)(n.inputs)})`:n.type==="constructor"?`constructor(${(0,e.formatAbiParameters)(n.inputs)})${n.stateMutability==="payable"?" payable":""}`:n.type==="fallback"?`fallback() external${n.stateMutability==="payable"?" payable":""}`:"receive() external payable"}return fi}var Al;function Iv(){if(Al)return di;Al=1,Object.defineProperty(di,"__esModule",{value:!0}),di.formatAbi=t;const e=W1();function t(n){const r=[],o=n.length;for(let s=0;s<o;s++){const i=n[s],a=(0,e.formatAbiItem)(i);r.push(a)}return r}return di}var mi={},Se={},Tl;function pn(){if(Tl)return Se;Tl=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.functionModifiers=Se.eventModifiers=Se.modifiers=void 0,Se.isErrorSignature=n,Se.execErrorSignature=r,Se.isEventSignature=s,Se.execEventSignature=i,Se.isFunctionSignature=c,Se.execFunctionSignature=u,Se.isStructSignature=f,Se.execStructSignature=b,Se.isConstructorSignature=h,Se.execConstructorSignature=m,Se.isFallbackSignature=v,Se.execFallbackSignature=_,Se.isReceiveSignature=d;const e=wu(),t=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function n(j){return t.test(j)}function r(j){return(0,e.execTyped)(t,j)}const o=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function s(j){return o.test(j)}function i(j){return(0,e.execTyped)(o,j)}const a=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function c(j){return a.test(j)}function u(j){return(0,e.execTyped)(a,j)}const l=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function f(j){return l.test(j)}function b(j){return(0,e.execTyped)(l,j)}const y=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function h(j){return y.test(j)}function m(j){return(0,e.execTyped)(y,j)}const E=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function v(j){return E.test(j)}function _(j){return(0,e.execTyped)(E,j)}const P=/^receive\(\) external payable$/;function d(j){return P.test(j)}return Se.modifiers=new Set(["memory","indexed","storage","calldata"]),Se.eventModifiers=new Set(["indexed"]),Se.functionModifiers=new Set(["calldata","memory","storage"]),Se}var hi={},Bt={},Il;function Pu(){if(Il)return Bt;Il=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.UnknownSolidityTypeError=Bt.UnknownTypeError=Bt.InvalidAbiItemError=void 0;const e=yn();class t extends e.BaseError{constructor({signature:s}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(s,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}Bt.InvalidAbiItemError=t;class n extends e.BaseError{constructor({type:s}){super("Unknown type.",{metaMessages:[`Type "${s}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}Bt.UnknownTypeError=n;class r extends e.BaseError{constructor({type:s}){super("Unknown type.",{metaMessages:[`Type "${s}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}return Bt.UnknownSolidityTypeError=r,Bt}var Me={},Sl;function Oo(){if(Sl)return Me;Sl=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.InvalidAbiTypeParameterError=Me.InvalidFunctionModifierError=Me.InvalidModifierError=Me.SolidityProtectedKeywordError=Me.InvalidParameterError=Me.InvalidAbiParametersError=Me.InvalidAbiParameterError=void 0;const e=yn();class t extends e.BaseError{constructor({param:u}){super("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(u,null,2)})`,docsPath:"/api/human#parseabiparameter-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParameterError"})}}Me.InvalidAbiParameterError=t;class n extends e.BaseError{constructor({params:u}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(u,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}Me.InvalidAbiParametersError=n;class r extends e.BaseError{constructor({param:u}){super("Invalid ABI parameter.",{details:u}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}Me.InvalidParameterError=r;class o extends e.BaseError{constructor({param:u,name:l}){super("Invalid ABI parameter.",{details:u,metaMessages:[`"${l}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}Me.SolidityProtectedKeywordError=o;class s extends e.BaseError{constructor({param:u,type:l,modifier:f}){super("Invalid ABI parameter.",{details:u,metaMessages:[`Modifier "${f}" not allowed${l?` in "${l}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}Me.InvalidModifierError=s;class i extends e.BaseError{constructor({param:u,type:l,modifier:f}){super("Invalid ABI parameter.",{details:u,metaMessages:[`Modifier "${f}" not allowed${l?` in "${l}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${f}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}Me.InvalidFunctionModifierError=i;class a extends e.BaseError{constructor({abiParameter:u}){super("Invalid ABI parameter.",{details:JSON.stringify(u,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}return Me.InvalidAbiTypeParameterError=a,Me}var Ot={},Rl;function Yd(){if(Rl)return Ot;Rl=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.InvalidStructSignatureError=Ot.UnknownSignatureError=Ot.InvalidSignatureError=void 0;const e=yn();class t extends e.BaseError{constructor({signature:s,type:i}){super(`Invalid ${i} signature.`,{details:s}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}Ot.InvalidSignatureError=t;class n extends e.BaseError{constructor({signature:s}){super("Unknown signature.",{details:s}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}Ot.UnknownSignatureError=n;class r extends e.BaseError{constructor({signature:s}){super("Invalid struct signature.",{details:s,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}return Ot.InvalidStructSignatureError=r,Ot}var Nn={},Bl;function K1(){if(Bl)return Nn;Bl=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.CircularReferenceError=void 0;const e=yn();class t extends e.BaseError{constructor({type:r}){super("Circular reference detected.",{metaMessages:[`Struct "${r}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}return Nn.CircularReferenceError=t,Nn}var Ve={},zn={},Ol;function Z1(){if(Ol)return zn;Ol=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.InvalidParenthesisError=void 0;const e=yn();class t extends e.BaseError{constructor({current:r,depth:o}){super("Unbalanced parentheses.",{metaMessages:[`"${r.trim()}" has too many ${o>0?"opening":"closing"} parentheses.`],details:`Depth "${o}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}return zn.InvalidParenthesisError=t,zn}var Yr={},xl;function Sv(){if(xl)return Yr;xl=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.parameterCache=void 0,Yr.getParameterCacheKey=e;function e(t,n,r){let o="";if(r)for(const s of Object.entries(r)){if(!s)continue;let i="";for(const a of s[1])i+=`[${a.type}${a.name?`:${a.name}`:""}]`;o+=`(${s[0]}{${i}})`}return n?`${n}:${t}${o}`:`${t}${o}`}return Yr.parameterCache=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}]]),Yr}var Cl;function hn(){if(Cl)return Ve;Cl=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.parseSignature=a,Ve.parseFunctionSignature=c,Ve.parseEventSignature=u,Ve.parseErrorSignature=l,Ve.parseConstructorSignature=f,Ve.parseFallbackSignature=b,Ve.parseAbiParameter=E,Ve.splitParameters=v,Ve.isSolidityType=_,Ve.isSolidityKeyword=d,Ve.isValidDataLocation=j;const e=wu(),t=Pu(),n=Oo(),r=Yd(),o=Z1(),s=Sv(),i=pn();function a(g,p={}){if((0,i.isFunctionSignature)(g))return c(g,p);if((0,i.isEventSignature)(g))return u(g,p);if((0,i.isErrorSignature)(g))return l(g,p);if((0,i.isConstructorSignature)(g))return f(g,p);if((0,i.isFallbackSignature)(g))return b(g);if((0,i.isReceiveSignature)(g))return{type:"receive",stateMutability:"payable"};throw new r.UnknownSignatureError({signature:g})}function c(g,p={}){const T=(0,i.execFunctionSignature)(g);if(!T)throw new r.InvalidSignatureError({signature:g,type:"function"});const w=v(T.parameters),A=[],C=w.length;for(let S=0;S<C;S++)A.push(E(w[S],{modifiers:i.functionModifiers,structs:p,type:"function"}));const R=[];if(T.returns){const S=v(T.returns),x=S.length;for(let F=0;F<x;F++)R.push(E(S[F],{modifiers:i.functionModifiers,structs:p,type:"function"}))}return{name:T.name,type:"function",stateMutability:T.stateMutability??"nonpayable",inputs:A,outputs:R}}function u(g,p={}){const T=(0,i.execEventSignature)(g);if(!T)throw new r.InvalidSignatureError({signature:g,type:"event"});const w=v(T.parameters),A=[],C=w.length;for(let R=0;R<C;R++)A.push(E(w[R],{modifiers:i.eventModifiers,structs:p,type:"event"}));return{name:T.name,type:"event",inputs:A}}function l(g,p={}){const T=(0,i.execErrorSignature)(g);if(!T)throw new r.InvalidSignatureError({signature:g,type:"error"});const w=v(T.parameters),A=[],C=w.length;for(let R=0;R<C;R++)A.push(E(w[R],{structs:p,type:"error"}));return{name:T.name,type:"error",inputs:A}}function f(g,p={}){const T=(0,i.execConstructorSignature)(g);if(!T)throw new r.InvalidSignatureError({signature:g,type:"constructor"});const w=v(T.parameters),A=[],C=w.length;for(let R=0;R<C;R++)A.push(E(w[R],{structs:p,type:"constructor"}));return{type:"constructor",stateMutability:T.stateMutability??"nonpayable",inputs:A}}function b(g){const p=(0,i.execFallbackSignature)(g);if(!p)throw new r.InvalidSignatureError({signature:g,type:"fallback"});return{type:"fallback",stateMutability:p.stateMutability??"nonpayable"}}const y=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,h=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,m=/^u?int$/;function E(g,p){const T=(0,s.getParameterCacheKey)(g,p?.type,p?.structs);if(s.parameterCache.has(T))return s.parameterCache.get(T);const w=e.isTupleRegex.test(g),A=(0,e.execTyped)(w?h:y,g);if(!A)throw new n.InvalidParameterError({param:g});if(A.name&&d(A.name))throw new n.SolidityProtectedKeywordError({param:g,name:A.name});const C=A.name?{name:A.name}:{},R=A.modifier==="indexed"?{indexed:!0}:{},S=p?.structs??{};let x,F={};if(w){x="tuple";const I=v(A.type),k=[],B=I.length;for(let q=0;q<B;q++)k.push(E(I[q],{structs:S}));F={components:k}}else if(A.type in S)x="tuple",F={components:S[A.type]};else if(m.test(A.type))x=`${A.type}256`;else if(A.type==="address payable")x="address";else if(x=A.type,p?.type!=="struct"&&!_(x))throw new t.UnknownSolidityTypeError({type:x});if(A.modifier){if(!p?.modifiers?.has?.(A.modifier))throw new n.InvalidModifierError({param:g,type:p?.type,modifier:A.modifier});if(i.functionModifiers.has(A.modifier)&&!j(x,!!A.array))throw new n.InvalidFunctionModifierError({param:g,type:p?.type,modifier:A.modifier})}const M={type:`${x}${A.array??""}`,...C,...R,...F};return s.parameterCache.set(T,M),M}function v(g,p=[],T="",w=0){const A=g.trim().length;for(let C=0;C<A;C++){const R=g[C],S=g.slice(C+1);switch(R){case",":return w===0?v(S,[...p,T.trim()]):v(S,p,`${T}${R}`,w);case"(":return v(S,p,`${T}${R}`,w+1);case")":return v(S,p,`${T}${R}`,w-1);default:return v(S,p,`${T}${R}`,w)}}if(T==="")return p;if(w!==0)throw new o.InvalidParenthesisError({current:T,depth:w});return p.push(T.trim()),p}function _(g){return g==="address"||g==="bool"||g==="function"||g==="string"||e.bytesRegex.test(g)||e.integerRegex.test(g)}const P=/^(?: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 d(g){return g==="address"||g==="bool"||g==="function"||g==="string"||g==="tuple"||e.bytesRegex.test(g)||e.integerRegex.test(g)||P.test(g)}function j(g,p){return p||g==="bytes"||g==="string"||g==="tuple"}return Ve}var ql;function Au(){if(ql)return hi;ql=1,Object.defineProperty(hi,"__esModule",{value:!0}),hi.parseStructs=a;const e=wu(),t=Pu(),n=Oo(),r=Yd(),o=K1(),s=pn(),i=hn();function a(l){const f={},b=l.length;for(let E=0;E<b;E++){const v=l[E];if(!(0,s.isStructSignature)(v))continue;const _=(0,s.execStructSignature)(v);if(!_)throw new r.InvalidSignatureError({signature:v,type:"struct"});const P=_.properties.split(";"),d=[],j=P.length;for(let g=0;g<j;g++){const T=P[g].trim();if(!T)continue;const w=(0,i.parseAbiParameter)(T,{type:"struct"});d.push(w)}if(!d.length)throw new r.InvalidStructSignatureError({signature:v});f[_.name]=d}const y={},h=Object.entries(f),m=h.length;for(let E=0;E<m;E++){const[v,_]=h[E];y[v]=u(_,f)}return y}const c=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function u(l=[],f={},b=new Set){const y=[],h=l.length;for(let m=0;m<h;m++){const E=l[m];if(e.isTupleRegex.test(E.type))y.push(E);else{const _=(0,e.execTyped)(c,E.type);if(!_?.type)throw new n.InvalidAbiTypeParameterError({abiParameter:E});const{array:P,type:d}=_;if(d in f){if(b.has(d))throw new o.CircularReferenceError({type:d});y.push({...E,type:`tuple${P??""}`,components:u(f[d],f,new Set([...b,d]))})}else if((0,i.isSolidityType)(d))y.push(E);else throw new t.UnknownTypeError({type:d})}}return y}return hi}var Ml;function Rv(){if(Ml)return mi;Ml=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.parseAbi=r;const e=pn(),t=Au(),n=hn();function r(o){const s=(0,t.parseStructs)(o),i=[],a=o.length;for(let c=0;c<a;c++){const u=o[c];(0,e.isStructSignature)(u)||i.push((0,n.parseSignature)(u,s))}return i}return mi}var yi={},Hl;function Bv(){if(Hl)return yi;Hl=1,Object.defineProperty(yi,"__esModule",{value:!0}),yi.parseAbiItem=o;const e=Pu(),t=pn(),n=Au(),r=hn();function o(s){let i;if(typeof s=="string")i=(0,r.parseSignature)(s);else{const a=(0,n.parseStructs)(s),c=s.length;for(let u=0;u<c;u++){const l=s[u];if(!(0,t.isStructSignature)(l)){i=(0,r.parseSignature)(l,a);break}}}if(!i)throw new e.InvalidAbiItemError({signature:s});return i}return yi}var pi={},kl;function Ov(){if(kl)return pi;kl=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.parseAbiParameter=o;const e=Oo(),t=pn(),n=Au(),r=hn();function o(s){let i;if(typeof s=="string")i=(0,r.parseAbiParameter)(s,{modifiers:t.modifiers});else{const a=(0,n.parseStructs)(s),c=s.length;for(let u=0;u<c;u++){const l=s[u];if(!(0,t.isStructSignature)(l)){i=(0,r.parseAbiParameter)(l,{modifiers:t.modifiers,structs:a});break}}}if(!i)throw new e.InvalidAbiParameterError({param:s});return i}return pi}var gi={},Fl;function xv(){if(Fl)return gi;Fl=1,Object.defineProperty(gi,"__esModule",{value:!0}),gi.parseAbiParameters=s;const e=Oo(),t=pn(),n=Au(),r=hn(),o=hn();function s(i){const a=[];if(typeof i=="string"){const c=(0,r.splitParameters)(i),u=c.length;for(let l=0;l<u;l++)a.push((0,o.parseAbiParameter)(c[l],{modifiers:t.modifiers}))}else{const c=(0,n.parseStructs)(i),u=i.length;for(let l=0;l<u;l++){const f=i[l];if((0,t.isStructSignature)(f))continue;const b=(0,r.splitParameters)(f),y=b.length;for(let h=0;h<y;h++)a.push((0,o.parseAbiParameter)(b[h],{modifiers:t.modifiers,structs:c}))}}if(a.length===0)throw new e.InvalidAbiParametersError({params:i});return a}return gi}var Nl;function rr(){return Nl||(Nl=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CircularReferenceError=e.InvalidParenthesisError=e.UnknownSignatureError=e.InvalidSignatureError=e.InvalidStructSignatureError=e.InvalidAbiParameterError=e.InvalidAbiParametersError=e.InvalidParameterError=e.SolidityProtectedKeywordError=e.InvalidModifierError=e.InvalidFunctionModifierError=e.InvalidAbiTypeParameterError=e.UnknownSolidityTypeError=e.InvalidAbiItemError=e.UnknownTypeError=e.parseAbiParameters=e.parseAbiParameter=e.parseAbiItem=e.parseAbi=e.formatAbiParameters=e.formatAbiParameter=e.formatAbiItem=e.formatAbi=e.narrow=e.BaseError=void 0;var t=yn();Object.defineProperty(e,"BaseError",{enumerable:!0,get:function(){return t.BaseError}});var n=Tv();Object.defineProperty(e,"narrow",{enumerable:!0,get:function(){return n.narrow}});var r=Iv();Object.defineProperty(e,"formatAbi",{enumerable:!0,get:function(){return r.formatAbi}});var o=W1();Object.defineProperty(e,"formatAbiItem",{enumerable:!0,get:function(){return o.formatAbiItem}});var s=G1();Object.defineProperty(e,"formatAbiParameter",{enumerable:!0,get:function(){return s.formatAbiParameter}});var i=V1();Object.defineProperty(e,"formatAbiParameters",{enumerable:!0,get:function(){return i.formatAbiParameters}});var a=Rv();Object.defineProperty(e,"parseAbi",{enumerable:!0,get:function(){return a.parseAbi}});var c=Bv();Object.defineProperty(e,"parseAbiItem",{enumerable:!0,get:function(){return c.parseAbiItem}});var u=Ov();Object.defineProperty(e,"parseAbiParameter",{enumerable:!0,get:function(){return u.parseAbiParameter}});var l=xv();Object.defineProperty(e,"parseAbiParameters",{enumerable:!0,get:function(){return l.parseAbiParameters}});var f=Pu();Object.defineProperty(e,"UnknownTypeError",{enumerable:!0,get:function(){return f.UnknownTypeError}}),Object.defineProperty(e,"InvalidAbiItemError",{enumerable:!0,get:function(){return f.InvalidAbiItemError}}),Object.defineProperty(e,"UnknownSolidityTypeError",{enumerable:!0,get:function(){return f.UnknownSolidityTypeError}});var b=Oo();Object.defineProperty(e,"InvalidAbiTypeParameterError",{enumerable:!0,get:function(){return b.InvalidAbiTypeParameterError}}),Object.defineProperty(e,"InvalidFunctionModifierError",{enumerable:!0,get:function(){return b.InvalidFunctionModifierError}}),Object.defineProperty(e,"InvalidModifierError",{enumerable:!0,get:function(){return b.InvalidModifierError}}),Object.defineProperty(e,"SolidityProtectedKeywordError",{enumerable:!0,get:function(){return b.SolidityProtectedKeywordError}}),Object.defineProperty(e,"InvalidParameterError",{enumerable:!0,get:function(){return b.InvalidParameterError}}),Object.defineProperty(e,"InvalidAbiParametersError",{enumerable:!0,get:function(){return b.InvalidAbiParametersError}}),Object.defineProperty(e,"InvalidAbiParameterError",{enumerable:!0,get:function(){return b.InvalidAbiParameterError}});var y=Yd();Object.defineProperty(e,"InvalidStructSignatureError",{enumerable:!0,get:function(){return y.InvalidStructSignatureError}}),Object.defineProperty(e,"InvalidSignatureError",{enumerable:!0,get:function(){return y.InvalidSignatureError}}),Object.defineProperty(e,"UnknownSignatureError",{enumerable:!0,get:function(){return y.UnknownSignatureError}});var h=Z1();Object.defineProperty(e,"InvalidParenthesisError",{enumerable:!0,get:function(){return h.InvalidParenthesisError}});var m=K1();Object.defineProperty(e,"CircularReferenceError",{enumerable:!0,get:function(){return m.CircularReferenceError}})})(Ed)),Ed}var Jr={},_i={},zl;function me(){if(zl)return _i;zl=1,Object.defineProperty(_i,"__esModule",{value:!0}),_i.getAction=e;function e(t,n,r){const o=t[n.name];if(typeof o=="function")return o;const s=t[r];return typeof s=="function"?s:i=>n(t,i)}return _i}var vi={},Ei={},ne={},Un={},Ul;function Lt(){if(Ul)return Un;Ul=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.formatAbiItem=t,Un.formatAbiParams=n;const e=Te();function t(o,{includeName:s=!1}={}){if(o.type!=="function"&&o.type!=="event"&&o.type!=="error")throw new e.InvalidDefinitionTypeError(o.type);return`${o.name}(${n(o.inputs,{includeName:s})})`}function n(o,{includeName:s=!1}={}){return o?o.map(i=>r(i,{includeName:s})).join(s?", ":","):""}function r(o,{includeName:s}){return o.type.startsWith("tuple")?`(${n(o.components,{includeName:s})})${o.type.slice(5)}`:o.type+(s&&o.name?` ${o.name}`:"")}return Un}var ji={},wi={},Ll;function De(){if(Ll)return wi;Ll=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.isHex=e;function e(t,{strict:n=!0}={}){return!t||typeof t!="string"?!1:n?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}return wi}var Dl;function Ke(){if(Dl)return ji;Dl=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.size=t;const e=De();function t(n){return(0,e.isHex)(n,{strict:!1})?Math.ceil((n.length-2)/2):n.length}return ji}var Xr={},Ln={},Gl;function Cv(){return Gl||(Gl=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.version=void 0,Ln.version="2.44.1"),Ln}var Vl;function ue(){if(Vl)return Xr;Vl=1,Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.BaseError=void 0,Xr.setErrorConfig=n;const e=Cv();let t={getDocsUrl:({docsBaseUrl:s,docsPath:i="",docsSlug:a})=>i?`${s??"https://viem.sh"}${i}${a?`#${a}`:""}`:void 0,version:`viem@${e.version}`};function n(s){t=s}class r extends Error{constructor(i,a={}){const c=a.cause instanceof r?a.cause.details:a.cause?.message?a.cause.message:a.details,u=a.cause instanceof r&&a.cause.docsPath||a.docsPath,l=t.getDocsUrl?.({...a,docsPath:u}),f=[i||"An error occurred.","",...a.metaMessages?[...a.metaMessages,""]:[],...l?[`Docs: ${l}`]:[],...c?[`Details: ${c}`]:[],...t.version?[`Version: ${t.version}`]:[]].join(`
3
+ `);super(f,a.cause?{cause:a.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=c,this.docsPath=u,this.metaMessages=a.metaMessages,this.name=a.name??this.name,this.shortMessage=i,this.version=e.version}walk(i){return o(this,i)}}Xr.BaseError=r;function o(s,i){return i?.(s)?s:s&&typeof s=="object"&&"cause"in s&&s.cause!==void 0?o(s.cause,i):i?null:s}return Xr}var Wl;function Te(){if(Wl)return ne;Wl=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.UnsupportedPackedAbiType=ne.InvalidDefinitionTypeError=ne.InvalidArrayError=ne.InvalidAbiDecodingTypeError=ne.InvalidAbiEncodingTypeError=ne.DecodeLogTopicsMismatch=ne.DecodeLogDataMismatch=ne.BytesSizeMismatchError=ne.AbiItemAmbiguityError=ne.AbiFunctionSignatureNotFoundError=ne.AbiFunctionOutputsNotFoundError=ne.AbiFunctionNotFoundError=ne.AbiEventNotFoundError=ne.AbiEventSignatureNotFoundError=ne.AbiEventSignatureEmptyTopicsError=ne.AbiErrorSignatureNotFoundError=ne.AbiErrorNotFoundError=ne.AbiErrorInputsNotFoundError=ne.AbiEncodingLengthMismatchError=ne.AbiEncodingBytesSizeMismatchError=ne.AbiEncodingArrayLengthMismatchError=ne.AbiDecodingZeroDataError=ne.AbiDecodingDataSizeTooSmallError=ne.AbiDecodingDataSizeInvalidError=ne.AbiConstructorParamsNotFoundError=ne.AbiConstructorNotFoundError=void 0;const e=Lt(),t=Ke(),n=ue();class r extends n.BaseError{constructor({docsPath:x}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
4
+ `),{docsPath:x,name:"AbiConstructorNotFoundError"})}}ne.AbiConstructorNotFoundError=r;class o extends n.BaseError{constructor({docsPath:x}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
5
+ `),{docsPath:x,name:"AbiConstructorParamsNotFoundError"})}}ne.AbiConstructorParamsNotFoundError=o;class s extends n.BaseError{constructor({data:x,size:F}){super([`Data size of ${F} bytes is invalid.`,"Size must be in increments of 32 bytes (size % 32 === 0)."].join(`
6
+ `),{metaMessages:[`Data: ${x} (${F} bytes)`],name:"AbiDecodingDataSizeInvalidError"})}}ne.AbiDecodingDataSizeInvalidError=s;class i extends n.BaseError{constructor({data:x,params:F,size:M}){super([`Data size of ${M} bytes is too small for given parameters.`].join(`
7
+ `),{metaMessages:[`Params: (${(0,e.formatAbiParams)(F,{includeName:!0})})`,`Data: ${x} (${M} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=x,this.params=F,this.size=M}}ne.AbiDecodingDataSizeTooSmallError=i;class a extends n.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}ne.AbiDecodingZeroDataError=a;class c extends n.BaseError{constructor({expectedLength:x,givenLength:F,type:M}){super([`ABI encoding array length mismatch for type ${M}.`,`Expected length: ${x}`,`Given length: ${F}`].join(`
8
+ `),{name:"AbiEncodingArrayLengthMismatchError"})}}ne.AbiEncodingArrayLengthMismatchError=c;class u extends n.BaseError{constructor({expectedSize:x,value:F}){super(`Size of bytes "${F}" (bytes${(0,t.size)(F)}) does not match expected size (bytes${x}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}ne.AbiEncodingBytesSizeMismatchError=u;class l extends n.BaseError{constructor({expectedLength:x,givenLength:F}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${x}`,`Given length (values): ${F}`].join(`
9
+ `),{name:"AbiEncodingLengthMismatchError"})}}ne.AbiEncodingLengthMismatchError=l;class f extends n.BaseError{constructor(x,{docsPath:F}){super([`Arguments (\`args\`) were provided to "${x}", but "${x}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
10
+ `),{docsPath:F,name:"AbiErrorInputsNotFoundError"})}}ne.AbiErrorInputsNotFoundError=f;class b extends n.BaseError{constructor(x,{docsPath:F}={}){super([`Error ${x?`"${x}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
11
+ `),{docsPath:F,name:"AbiErrorNotFoundError"})}}ne.AbiErrorNotFoundError=b;class y extends n.BaseError{constructor(x,{docsPath:F}){super([`Encoded error signature "${x}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${x}.`].join(`
12
+ `),{docsPath:F,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=x}}ne.AbiErrorSignatureNotFoundError=y;class h extends n.BaseError{constructor({docsPath:x}){super("Cannot extract event signature from empty topics.",{docsPath:x,name:"AbiEventSignatureEmptyTopicsError"})}}ne.AbiEventSignatureEmptyTopicsError=h;class m extends n.BaseError{constructor(x,{docsPath:F}){super([`Encoded event signature "${x}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${x}.`].join(`
13
+ `),{docsPath:F,name:"AbiEventSignatureNotFoundError"})}}ne.AbiEventSignatureNotFoundError=m;class E extends n.BaseError{constructor(x,{docsPath:F}={}){super([`Event ${x?`"${x}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
14
+ `),{docsPath:F,name:"AbiEventNotFoundError"})}}ne.AbiEventNotFoundError=E;class v extends n.BaseError{constructor(x,{docsPath:F}={}){super([`Function ${x?`"${x}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
15
+ `),{docsPath:F,name:"AbiFunctionNotFoundError"})}}ne.AbiFunctionNotFoundError=v;class _ extends n.BaseError{constructor(x,{docsPath:F}){super([`Function "${x}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
16
+ `),{docsPath:F,name:"AbiFunctionOutputsNotFoundError"})}}ne.AbiFunctionOutputsNotFoundError=_;class P extends n.BaseError{constructor(x,{docsPath:F}){super([`Encoded function signature "${x}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${x}.`].join(`
17
+ `),{docsPath:F,name:"AbiFunctionSignatureNotFoundError"})}}ne.AbiFunctionSignatureNotFoundError=P;class d extends n.BaseError{constructor(x,F){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${x.type}\` in \`${(0,e.formatAbiItem)(x.abiItem)}\`, and`,`\`${F.type}\` in \`${(0,e.formatAbiItem)(F.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}ne.AbiItemAmbiguityError=d;class j extends n.BaseError{constructor({expectedSize:x,givenSize:F}){super(`Expected bytes${x}, got bytes${F}.`,{name:"BytesSizeMismatchError"})}}ne.BytesSizeMismatchError=j;class g extends n.BaseError{constructor({abiItem:x,data:F,params:M,size:I}){super([`Data size of ${I} bytes is too small for non-indexed event parameters.`].join(`
18
+ `),{metaMessages:[`Params: (${(0,e.formatAbiParams)(M,{includeName:!0})})`,`Data: ${F} (${I} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=x,this.data=F,this.params=M,this.size=I}}ne.DecodeLogDataMismatch=g;class p extends n.BaseError{constructor({abiItem:x,param:F}){super([`Expected a topic for indexed event parameter${F.name?` "${F.name}"`:""} on event "${(0,e.formatAbiItem)(x,{includeName:!0})}".`].join(`
19
+ `),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=x}}ne.DecodeLogTopicsMismatch=p;class T extends n.BaseError{constructor(x,{docsPath:F}){super([`Type "${x}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
20
+ `),{docsPath:F,name:"InvalidAbiEncodingType"})}}ne.InvalidAbiEncodingTypeError=T;class w extends n.BaseError{constructor(x,{docsPath:F}){super([`Type "${x}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
21
+ `),{docsPath:F,name:"InvalidAbiDecodingType"})}}ne.InvalidAbiDecodingTypeError=w;class A extends n.BaseError{constructor(x){super([`Value "${x}" is not a valid array.`].join(`
22
+ `),{name:"InvalidArrayError"})}}ne.InvalidArrayError=A;class C extends n.BaseError{constructor(x){super([`"${x}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
23
+ `),{name:"InvalidDefinitionTypeError"})}}ne.InvalidDefinitionTypeError=C;class R extends n.BaseError{constructor(x){super(`Type "${x}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}return ne.UnsupportedPackedAbiType=R,ne}var Dn={},Kl;function Y1(){if(Kl)return Dn;Kl=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.FilterTypeNotSupportedError=void 0;const e=ue();class t extends e.BaseError{constructor(r){super(`Filter type "${r}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}return Dn.FilterTypeNotSupportedError=t,Dn}var Yt={},Qr={},xt={},Zl;function Tu(){if(Zl)return xt;Zl=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.InvalidBytesLengthError=xt.SizeExceedsPaddingSizeError=xt.SliceOffsetOutOfBoundsError=void 0;const e=ue();class t extends e.BaseError{constructor({offset:s,position:i,size:a}){super(`Slice ${i==="start"?"starting":"ending"} at offset "${s}" is out-of-bounds (size: ${a}).`,{name:"SliceOffsetOutOfBoundsError"})}}xt.SliceOffsetOutOfBoundsError=t;class n extends e.BaseError{constructor({size:s,targetSize:i,type:a}){super(`${a.charAt(0).toUpperCase()}${a.slice(1).toLowerCase()} size (${s}) exceeds padding size (${i}).`,{name:"SizeExceedsPaddingSizeError"})}}xt.SizeExceedsPaddingSizeError=n;class r extends e.BaseError{constructor({size:s,targetSize:i,type:a}){super(`${a.charAt(0).toUpperCase()}${a.slice(1).toLowerCase()} is expected to be ${i} ${a} long, but is ${s} ${a} long.`,{name:"InvalidBytesLengthError"})}}return xt.InvalidBytesLengthError=r,xt}var Yl;function nr(){if(Yl)return Qr;Yl=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.pad=t,Qr.padHex=n,Qr.padBytes=r;const e=Tu();function t(o,{dir:s,size:i=32}={}){return typeof o=="string"?n(o,{dir:s,size:i}):r(o,{dir:s,size:i})}function n(o,{dir:s,size:i=32}={}){if(i===null)return o;const a=o.replace("0x","");if(a.length>i*2)throw new e.SizeExceedsPaddingSizeError({size:Math.ceil(a.length/2),targetSize:i,type:"hex"});return`0x${a[s==="right"?"padEnd":"padStart"](i*2,"0")}`}function r(o,{dir:s,size:i=32}={}){if(i===null)return o;if(o.length>i)throw new e.SizeExceedsPaddingSizeError({size:o.length,targetSize:i,type:"bytes"});const a=new Uint8Array(i);for(let c=0;c<i;c++){const u=s==="right";a[u?c:i-c-1]=o[u?c:o.length-c-1]}return a}return Qr}var Ct={},Qe={},Jl;function gn(){if(Jl)return Qe;Jl=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.SizeOverflowError=Qe.InvalidHexValueError=Qe.InvalidHexBooleanError=Qe.InvalidBytesBooleanError=Qe.IntegerOutOfRangeError=void 0;const e=ue();class t extends e.BaseError{constructor({max:a,min:c,signed:u,size:l,value:f}){super(`Number "${f}" is not in safe ${l?`${l*8}-bit ${u?"signed":"unsigned"} `:""}integer range ${a?`(${c} to ${a})`:`(above ${c})`}`,{name:"IntegerOutOfRangeError"})}}Qe.IntegerOutOfRangeError=t;class n extends e.BaseError{constructor(a){super(`Bytes value "${a}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}Qe.InvalidBytesBooleanError=n;class r extends e.BaseError{constructor(a){super(`Hex value "${a}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}Qe.InvalidHexBooleanError=r;class o extends e.BaseError{constructor(a){super(`Hex value "${a}" is an odd length (${a.length}). It must be an even length.`,{name:"InvalidHexValueError"})}}Qe.InvalidHexValueError=o;class s extends e.BaseError{constructor({givenSize:a,maxSize:c}){super(`Size cannot exceed ${c} bytes. Given size: ${a} bytes.`,{name:"SizeOverflowError"})}}return Qe.SizeOverflowError=s,Qe}var Pi={},Xl;function Dt(){if(Xl)return Pi;Xl=1,Object.defineProperty(Pi,"__esModule",{value:!0}),Pi.trim=e;function e(t,{dir:n="left"}={}){let r=typeof t=="string"?t.replace("0x",""):t,o=0;for(let s=0;s<r.length-1&&r[n==="left"?s:r.length-s-1].toString()==="0";s++)o++;return r=n==="left"?r.slice(o):r.slice(0,r.length-o),typeof t=="string"?(r.length===1&&n==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}return Pi}var Ql;function Re(){if(Ql)return Ct;Ql=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.assertSize=o,Ct.fromHex=s,Ct.hexToBigInt=i,Ct.hexToBool=a,Ct.hexToNumber=c,Ct.hexToString=u;const e=gn(),t=Ke(),n=Dt(),r=_e();function o(l,{size:f}){if((0,t.size)(l)>f)throw new e.SizeOverflowError({givenSize:(0,t.size)(l),maxSize:f})}function s(l,f){const b=typeof f=="string"?{to:f}:f,y=b.to;return y==="number"?c(l,b):y==="bigint"?i(l,b):y==="string"?u(l,b):y==="boolean"?a(l,b):(0,r.hexToBytes)(l,b)}function i(l,f={}){const{signed:b}=f;f.size&&o(l,{size:f.size});const y=BigInt(l);if(!b)return y;const h=(l.length-2)/2,m=(1n<<BigInt(h)*8n-1n)-1n;return y<=m?y:y-BigInt(`0x${"f".padStart(h*2,"f")}`)-1n}function a(l,f={}){let b=l;if(f.size&&(o(b,{size:f.size}),b=(0,n.trim)(b)),(0,n.trim)(b)==="0x00")return!1;if((0,n.trim)(b)==="0x01")return!0;throw new e.InvalidHexBooleanError(b)}function c(l,f={}){return Number(i(l,f))}function u(l,f={}){let b=(0,r.hexToBytes)(l);return f.size&&(o(b,{size:f.size}),b=(0,n.trim)(b,{dir:"right"})),new TextDecoder().decode(b)}return Ct}var Jt={},$l;function te(){if($l)return Jt;$l=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.toHex=o,Jt.boolToHex=s,Jt.bytesToHex=i,Jt.numberToHex=a,Jt.stringToHex=u;const e=gn(),t=nr(),n=Re(),r=Array.from({length:256},(l,f)=>f.toString(16).padStart(2,"0"));function o(l,f={}){return typeof l=="number"||typeof l=="bigint"?a(l,f):typeof l=="string"?u(l,f):typeof l=="boolean"?s(l,f):i(l,f)}function s(l,f={}){const b=`0x${Number(l)}`;return typeof f.size=="number"?((0,n.assertSize)(b,{size:f.size}),(0,t.pad)(b,{size:f.size})):b}function i(l,f={}){let b="";for(let h=0;h<l.length;h++)b+=r[l[h]];const y=`0x${b}`;return typeof f.size=="number"?((0,n.assertSize)(y,{size:f.size}),(0,t.pad)(y,{dir:"right",size:f.size})):y}function a(l,f={}){const{signed:b,size:y}=f,h=BigInt(l);let m;y?b?m=(1n<<BigInt(y)*8n-1n)-1n:m=2n**(BigInt(y)*8n)-1n:typeof l=="number"&&(m=BigInt(Number.MAX_SAFE_INTEGER));const E=typeof m=="bigint"&&b?-m-1n:0;if(m&&h>m||h<E){const _=typeof l=="bigint"?"n":"";throw new e.IntegerOutOfRangeError({max:m?`${m}${_}`:void 0,min:`${E}${_}`,signed:b,size:y,value:`${l}${_}`})}const v=`0x${(b&&h<0?(1n<<BigInt(y*8))+BigInt(h):h).toString(16)}`;return y?(0,t.pad)(v,{size:y}):v}const c=new TextEncoder;function u(l,f={}){const b=c.encode(l);return i(b,f)}return Jt}var e0;function _e(){if(e0)return Yt;e0=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.toBytes=i,Yt.boolToBytes=a,Yt.hexToBytes=l,Yt.numberToBytes=f,Yt.stringToBytes=b;const e=ue(),t=De(),n=nr(),r=Re(),o=te(),s=new TextEncoder;function i(y,h={}){return typeof y=="number"||typeof y=="bigint"?f(y,h):typeof y=="boolean"?a(y,h):(0,t.isHex)(y)?l(y,h):b(y,h)}function a(y,h={}){const m=new Uint8Array(1);return m[0]=Number(y),typeof h.size=="number"?((0,r.assertSize)(m,{size:h.size}),(0,n.pad)(m,{size:h.size})):m}const c={zero:48,nine:57,A:65,F:70,a:97,f:102};function u(y){if(y>=c.zero&&y<=c.nine)return y-c.zero;if(y>=c.A&&y<=c.F)return y-(c.A-10);if(y>=c.a&&y<=c.f)return y-(c.a-10)}function l(y,h={}){let m=y;h.size&&((0,r.assertSize)(m,{size:h.size}),m=(0,n.pad)(m,{dir:"right",size:h.size}));let E=m.slice(2);E.length%2&&(E=`0${E}`);const v=E.length/2,_=new Uint8Array(v);for(let P=0,d=0;P<v;P++){const j=u(E.charCodeAt(d++)),g=u(E.charCodeAt(d++));if(j===void 0||g===void 0)throw new e.BaseError(`Invalid byte sequence ("${E[d-2]}${E[d-1]}" in "${E}").`);_[P]=j*16+g}return _}function f(y,h){const m=(0,o.numberToHex)(y,h);return l(m)}function b(y,h={}){const m=s.encode(y);return typeof h.size=="number"?((0,r.assertSize)(m,{size:h.size}),(0,n.pad)(m,{dir:"right",size:h.size})):m}return Yt}var Ai={},ve={},ce={},t0;function J1(){if(t0)return ce;t0=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.toBig=ce.shrSL=ce.shrSH=ce.rotrSL=ce.rotrSH=ce.rotrBL=ce.rotrBH=ce.rotr32L=ce.rotr32H=ce.rotlSL=ce.rotlSH=ce.rotlBL=ce.rotlBH=ce.add5L=ce.add5H=ce.add4L=ce.add4H=ce.add3L=ce.add3H=void 0,ce.add=v,ce.fromBig=n,ce.split=r;const e=BigInt(2**32-1),t=BigInt(32);function n(w,A=!1){return A?{h:Number(w&e),l:Number(w>>t&e)}:{h:Number(w>>t&e)|0,l:Number(w&e)|0}}function r(w,A=!1){const C=w.length;let R=new Uint32Array(C),S=new Uint32Array(C);for(let x=0;x<C;x++){const{h:F,l:M}=n(w[x],A);[R[x],S[x]]=[F,M]}return[R,S]}const o=(w,A)=>BigInt(w>>>0)<<t|BigInt(A>>>0);ce.toBig=o;const s=(w,A,C)=>w>>>C;ce.shrSH=s;const i=(w,A,C)=>w<<32-C|A>>>C;ce.shrSL=i;const a=(w,A,C)=>w>>>C|A<<32-C;ce.rotrSH=a;const c=(w,A,C)=>w<<32-C|A>>>C;ce.rotrSL=c;const u=(w,A,C)=>w<<64-C|A>>>C-32;ce.rotrBH=u;const l=(w,A,C)=>w>>>C-32|A<<64-C;ce.rotrBL=l;const f=(w,A)=>A;ce.rotr32H=f;const b=(w,A)=>w;ce.rotr32L=b;const y=(w,A,C)=>w<<C|A>>>32-C;ce.rotlSH=y;const h=(w,A,C)=>A<<C|w>>>32-C;ce.rotlSL=h;const m=(w,A,C)=>A<<C-32|w>>>64-C;ce.rotlBH=m;const E=(w,A,C)=>w<<C-32|A>>>64-C;ce.rotlBL=E;function v(w,A,C,R){const S=(A>>>0)+(R>>>0);return{h:w+C+(S/2**32|0)|0,l:S|0}}const _=(w,A,C)=>(w>>>0)+(A>>>0)+(C>>>0);ce.add3L=_;const P=(w,A,C,R)=>A+C+R+(w/2**32|0)|0;ce.add3H=P;const d=(w,A,C,R)=>(w>>>0)+(A>>>0)+(C>>>0)+(R>>>0);ce.add4L=d;const j=(w,A,C,R,S)=>A+C+R+S+(w/2**32|0)|0;ce.add4H=j;const g=(w,A,C,R,S)=>(w>>>0)+(A>>>0)+(C>>>0)+(R>>>0)+(S>>>0);ce.add5L=g;const p=(w,A,C,R,S,x)=>A+C+R+S+x+(w/2**32|0)|0;ce.add5H=p;const T={fromBig:n,split:r,toBig:o,shrSH:s,shrSL:i,rotrSH:a,rotrSL:c,rotrBH:u,rotrBL:l,rotr32H:f,rotr32L:b,rotlSH:y,rotlSL:h,rotlBH:m,rotlBL:E,add:v,add3L:_,add3H:P,add4L:d,add4H:j,add5H:p,add5L:g};return ce.default=T,ce}var jd={},Gn={},r0;function qv(){return r0||(r0=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.crypto=void 0,Gn.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),Gn}var n0;function or(){return n0||(n0=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.Hash=e.nextTick=e.swap32IfBE=e.byteSwapIfBE=e.swap8IfBE=e.isLE=void 0,e.isBytes=n,e.anumber=r,e.abytes=o,e.ahash=s,e.aexists=i,e.aoutput=a,e.u8=c,e.u32=u,e.clean=l,e.createView=f,e.rotr=b,e.rotl=y,e.byteSwap=h,e.byteSwap32=m,e.bytesToHex=_,e.hexToBytes=j,e.asyncLoop=p,e.utf8ToBytes=T,e.bytesToUtf8=w,e.toBytes=A,e.kdfInputToBytes=C,e.concatBytes=R,e.checkOpts=S,e.createHasher=F,e.createOptHasher=M,e.createXOFer=I,e.randomBytes=k;const t=qv();function n(B){return B instanceof Uint8Array||ArrayBuffer.isView(B)&&B.constructor.name==="Uint8Array"}function r(B){if(!Number.isSafeInteger(B)||B<0)throw new Error("positive integer expected, got "+B)}function o(B,...q){if(!n(B))throw new Error("Uint8Array expected");if(q.length>0&&!q.includes(B.length))throw new Error("Uint8Array expected of length "+q+", got length="+B.length)}function s(B){if(typeof B!="function"||typeof B.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");r(B.outputLen),r(B.blockLen)}function i(B,q=!0){if(B.destroyed)throw new Error("Hash instance has been destroyed");if(q&&B.finished)throw new Error("Hash#digest() has already been called")}function a(B,q){o(B);const O=q.outputLen;if(B.length<O)throw new Error("digestInto() expects output buffer of length at least "+O)}function c(B){return new Uint8Array(B.buffer,B.byteOffset,B.byteLength)}function u(B){return new Uint32Array(B.buffer,B.byteOffset,Math.floor(B.byteLength/4))}function l(...B){for(let q=0;q<B.length;q++)B[q].fill(0)}function f(B){return new DataView(B.buffer,B.byteOffset,B.byteLength)}function b(B,q){return B<<32-q|B>>>q}function y(B,q){return B<<q|B>>>32-q>>>0}e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function h(B){return B<<24&4278190080|B<<8&16711680|B>>>8&65280|B>>>24&255}e.swap8IfBE=e.isLE?B=>B:B=>h(B),e.byteSwapIfBE=e.swap8IfBE;function m(B){for(let q=0;q<B.length;q++)B[q]=h(B[q]);return B}e.swap32IfBE=e.isLE?B=>B:m;const E=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",v=Array.from({length:256},(B,q)=>q.toString(16).padStart(2,"0"));function _(B){if(o(B),E)return B.toHex();let q="";for(let O=0;O<B.length;O++)q+=v[B[O]];return q}const P={_0:48,_9:57,A:65,F:70,a:97,f:102};function d(B){if(B>=P._0&&B<=P._9)return B-P._0;if(B>=P.A&&B<=P.F)return B-(P.A-10);if(B>=P.a&&B<=P.f)return B-(P.a-10)}function j(B){if(typeof B!="string")throw new Error("hex string expected, got "+typeof B);if(E)return Uint8Array.fromHex(B);const q=B.length,O=q/2;if(q%2)throw new Error("hex string expected, got unpadded hex of length "+q);const H=new Uint8Array(O);for(let N=0,U=0;N<O;N++,U+=2){const z=d(B.charCodeAt(U)),G=d(B.charCodeAt(U+1));if(z===void 0||G===void 0){const V=B[U]+B[U+1];throw new Error('hex string expected, got non-hex character "'+V+'" at index '+U)}H[N]=z*16+G}return H}const g=async()=>{};e.nextTick=g;async function p(B,q,O){let H=Date.now();for(let N=0;N<B;N++){O(N);const U=Date.now()-H;U>=0&&U<q||(await(0,e.nextTick)(),H+=U)}}function T(B){if(typeof B!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(B))}function w(B){return new TextDecoder().decode(B)}function A(B){return typeof B=="string"&&(B=T(B)),o(B),B}function C(B){return typeof B=="string"&&(B=T(B)),o(B),B}function R(...B){let q=0;for(let H=0;H<B.length;H++){const N=B[H];o(N),q+=N.length}const O=new Uint8Array(q);for(let H=0,N=0;H<B.length;H++){const U=B[H];O.set(U,N),N+=U.length}return O}function S(B,q){if(q!==void 0&&{}.toString.call(q)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(B,q)}class x{}e.Hash=x;function F(B){const q=H=>B().update(A(H)).digest(),O=B();return q.outputLen=O.outputLen,q.blockLen=O.blockLen,q.create=()=>B(),q}function M(B){const q=(H,N)=>B(N).update(A(H)).digest(),O=B({});return q.outputLen=O.outputLen,q.blockLen=O.blockLen,q.create=H=>B(H),q}function I(B){const q=(H,N)=>B(N).update(A(H)).digest(),O=B({});return q.outputLen=O.outputLen,q.blockLen=O.blockLen,q.create=H=>B(H),q}e.wrapConstructor=F,e.wrapConstructorWithOpts=M,e.wrapXOFConstructorWithOpts=I;function k(B=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(B));if(t.crypto&&typeof t.crypto.randomBytes=="function")return Uint8Array.from(t.crypto.randomBytes(B));throw new Error("crypto.getRandomValues must be defined")}})(jd)),jd}var o0;function X1(){if(o0)return ve;o0=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.shake256=ve.shake128=ve.keccak_512=ve.keccak_384=ve.keccak_256=ve.keccak_224=ve.sha3_512=ve.sha3_384=ve.sha3_256=ve.sha3_224=ve.Keccak=void 0,ve.keccakP=E;const e=J1(),t=or(),n=BigInt(0),r=BigInt(1),o=BigInt(2),s=BigInt(7),i=BigInt(256),a=BigInt(113),c=[],u=[],l=[];for(let d=0,j=r,g=1,p=0;d<24;d++){[g,p]=[p,(2*g+3*p)%5],c.push(2*(5*p+g)),u.push((d+1)*(d+2)/2%64);let T=n;for(let w=0;w<7;w++)j=(j<<r^(j>>s)*a)%i,j&o&&(T^=r<<(r<<BigInt(w))-r);l.push(T)}const f=(0,e.split)(l,!0),b=f[0],y=f[1],h=(d,j,g)=>g>32?(0,e.rotlBH)(d,j,g):(0,e.rotlSH)(d,j,g),m=(d,j,g)=>g>32?(0,e.rotlBL)(d,j,g):(0,e.rotlSL)(d,j,g);function E(d,j=24){const g=new Uint32Array(10);for(let p=24-j;p<24;p++){for(let A=0;A<10;A++)g[A]=d[A]^d[A+10]^d[A+20]^d[A+30]^d[A+40];for(let A=0;A<10;A+=2){const C=(A+8)%10,R=(A+2)%10,S=g[R],x=g[R+1],F=h(S,x,1)^g[C],M=m(S,x,1)^g[C+1];for(let I=0;I<50;I+=10)d[A+I]^=F,d[A+I+1]^=M}let T=d[2],w=d[3];for(let A=0;A<24;A++){const C=u[A],R=h(T,w,C),S=m(T,w,C),x=c[A];T=d[x],w=d[x+1],d[x]=R,d[x+1]=S}for(let A=0;A<50;A+=10){for(let C=0;C<10;C++)g[C]=d[A+C];for(let C=0;C<10;C++)d[A+C]^=~g[(C+2)%10]&g[(C+4)%10]}d[0]^=b[p],d[1]^=y[p]}(0,t.clean)(g)}class v extends t.Hash{constructor(j,g,p,T=!1,w=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=j,this.suffix=g,this.outputLen=p,this.enableXOF=T,this.rounds=w,(0,t.anumber)(p),!(0<j&&j<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,t.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,t.swap32IfBE)(this.state32),E(this.state32,this.rounds),(0,t.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(j){(0,t.aexists)(this),j=(0,t.toBytes)(j),(0,t.abytes)(j);const{blockLen:g,state:p}=this,T=j.length;for(let w=0;w<T;){const A=Math.min(g-this.pos,T-w);for(let C=0;C<A;C++)p[this.pos++]^=j[w++];this.pos===g&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:j,suffix:g,pos:p,blockLen:T}=this;j[p]^=g,(g&128)!==0&&p===T-1&&this.keccak(),j[T-1]^=128,this.keccak()}writeInto(j){(0,t.aexists)(this,!1),(0,t.abytes)(j),this.finish();const g=this.state,{blockLen:p}=this;for(let T=0,w=j.length;T<w;){this.posOut>=p&&this.keccak();const A=Math.min(p-this.posOut,w-T);j.set(g.subarray(this.posOut,this.posOut+A),T),this.posOut+=A,T+=A}return j}xofInto(j){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(j)}xof(j){return(0,t.anumber)(j),this.xofInto(new Uint8Array(j))}digestInto(j){if((0,t.aoutput)(j,this),this.finished)throw new Error("digest() was already called");return this.writeInto(j),this.destroy(),j}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,t.clean)(this.state)}_cloneInto(j){const{blockLen:g,suffix:p,outputLen:T,rounds:w,enableXOF:A}=this;return j||(j=new v(g,p,T,A,w)),j.state32.set(this.state32),j.pos=this.pos,j.posOut=this.posOut,j.finished=this.finished,j.rounds=w,j.suffix=p,j.outputLen=T,j.enableXOF=A,j.destroyed=this.destroyed,j}}ve.Keccak=v;const _=(d,j,g)=>(0,t.createHasher)(()=>new v(j,d,g));ve.sha3_224=_(6,144,224/8),ve.sha3_256=_(6,136,256/8),ve.sha3_384=_(6,104,384/8),ve.sha3_512=_(6,72,512/8),ve.keccak_224=_(1,144,224/8),ve.keccak_256=_(1,136,256/8),ve.keccak_384=_(1,104,384/8),ve.keccak_512=_(1,72,512/8);const P=(d,j,g)=>(0,t.createXOFer)((p={})=>new v(j,d,p.dkLen===void 0?g:p.dkLen,!0));return ve.shake128=P(31,168,128/8),ve.shake256=P(31,136,256/8),ve}var i0;function Ze(){if(i0)return Ai;i0=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.keccak256=o;const e=X1(),t=De(),n=_e(),r=te();function o(s,i){const a=i||"hex",c=(0,e.keccak_256)((0,t.isHex)(s,{strict:!1})?(0,n.toBytes)(s):s);return a==="bytes"?c:(0,r.toHex)(c)}return Ai}var Vn={},Ti={},Ii={},a0;function Mv(){if(a0)return Ii;a0=1,Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.hashSignature=r;const e=_e(),t=Ze(),n=o=>(0,t.keccak256)((0,e.toBytes)(o));function r(o){return n(o)}return Ii}var Wn={},Si={},s0;function Hv(){if(s0)return Si;s0=1,Object.defineProperty(Si,"__esModule",{value:!0}),Si.normalizeSignature=t;const e=ue();function t(n){let r=!0,o="",s=0,i="",a=!1;for(let c=0;c<n.length;c++){const u=n[c];if(["(",")",","].includes(u)&&(r=!0),u==="("&&s++,u===")"&&s--,!!r){if(s===0){if(u===" "&&["event","function",""].includes(i))i="";else if(i+=u,u===")"){a=!0;break}continue}if(u===" "){n[c-1]!==","&&o!==","&&o!==",("&&(o="",r=!1);continue}i+=u,o+=u}}if(!a)throw new e.BaseError("Unable to normalize signature.");return i}return Si}var c0;function Jd(){if(c0)return Wn;c0=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.toSignature=void 0;const e=rr(),t=Hv(),n=r=>{const o=typeof r=="string"?r:(0,e.formatAbiItem)(r);return(0,t.normalizeSignature)(o)};return Wn.toSignature=n,Wn}var u0;function Iu(){if(u0)return Ti;u0=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.toSignatureHash=n;const e=Mv(),t=Jd();function n(r){return(0,e.hashSignature)((0,t.toSignature)(r))}return Ti}var d0;function _n(){if(d0)return Vn;d0=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.toEventSelector=void 0;const e=Iu();return Vn.toEventSelector=e.toSignatureHash,Vn}var Kn={},Zn={},f0;function yt(){if(f0)return Zn;f0=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.InvalidAddressError=void 0;const e=ue();class t extends e.BaseError{constructor({address:r}){super(`Address "${r}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}return Zn.InvalidAddressError=t,Zn}var wd={},Yn={},l0;function Nr(){if(l0)return Yn;l0=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.LruMap=void 0;class e extends Map{constructor(n){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=n}get(n){const r=super.get(n);return super.has(n)&&r!==void 0&&(this.delete(n),super.set(n,r)),r}set(n,r){if(super.set(n,r),this.maxSize&&this.size>this.maxSize){const o=this.keys().next().value;o&&this.delete(o)}return this}}return Yn.LruMap=e,Yn}var Jn={},b0;function nt(){if(b0)return Jn;b0=1,Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.checksumAddress=i,Jn.getAddress=a;const e=yt(),t=_e(),n=Ze(),r=Nr(),o=Ye(),s=new r.LruMap(8192);function i(c,u){if(s.has(`${c}.${u}`))return s.get(`${c}.${u}`);const l=u?`${u}${c.toLowerCase()}`:c.substring(2).toLowerCase(),f=(0,n.keccak256)((0,t.stringToBytes)(l),"bytes"),b=(u?l.substring(`${u}0x`.length):l).split("");for(let h=0;h<40;h+=2)f[h>>1]>>4>=8&&b[h]&&(b[h]=b[h].toUpperCase()),(f[h>>1]&15)>=8&&b[h+1]&&(b[h+1]=b[h+1].toUpperCase());const y=`0x${b.join("")}`;return s.set(`${c}.${u}`,y),y}function a(c,u){if(!(0,o.isAddress)(c,{strict:!1}))throw new e.InvalidAddressError({address:c});return i(c,u)}return Jn}var m0;function Ye(){return m0||(m0=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isAddressCache=void 0,e.isAddress=o;const t=Nr(),n=nt(),r=/^0x[a-fA-F0-9]{40}$/;e.isAddressCache=new t.LruMap(8192);function o(s,i){const{strict:a=!0}=i??{},c=`${s}.${a}`;if(e.isAddressCache.has(c))return e.isAddressCache.get(c);const u=r.test(s)?s.toLowerCase()===s?!0:a?(0,n.checksumAddress)(s)===s:!0:!1;return e.isAddressCache.set(c,u),u}})(wd)),wd}var $r={},h0;function Ce(){if(h0)return $r;h0=1,Object.defineProperty($r,"__esModule",{value:!0}),$r.concat=e,$r.concatBytes=t,$r.concatHex=n;function e(r){return typeof r[0]=="string"?n(r):t(r)}function t(r){let o=0;for(const a of r)o+=a.length;const s=new Uint8Array(o);let i=0;for(const a of r)s.set(a,i),i+=a.length;return s}function n(r){return`0x${r.reduce((o,s)=>o+s.replace("0x",""),"")}`}return $r}var en={},y0;function at(){if(y0)return en;y0=1,Object.defineProperty(en,"__esModule",{value:!0}),en.slice=r,en.sliceBytes=i,en.sliceHex=a;const e=Tu(),t=De(),n=Ke();function r(c,u,l,{strict:f}={}){return(0,t.isHex)(c,{strict:!1})?a(c,u,l,{strict:f}):i(c,u,l,{strict:f})}function o(c,u){if(typeof u=="number"&&u>0&&u>(0,n.size)(c)-1)throw new e.SliceOffsetOutOfBoundsError({offset:u,position:"start",size:(0,n.size)(c)})}function s(c,u,l){if(typeof u=="number"&&typeof l=="number"&&(0,n.size)(c)!==l-u)throw new e.SliceOffsetOutOfBoundsError({offset:l,position:"end",size:(0,n.size)(c)})}function i(c,u,l,{strict:f}={}){o(c,u);const b=c.slice(u,l);return f&&s(b,u,l),b}function a(c,u,l,{strict:f}={}){o(c,u);const b=`0x${c.replace("0x","").slice((u??0)*2,(l??c.length)*2)}`;return f&&s(b,u,l),b}return en}var qt={},p0;function Su(){return p0||(p0=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.integerRegex=qt.bytesRegex=qt.arrayRegex=void 0,qt.arrayRegex=/^(.*)\[([0-9]*)\]$/,qt.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,qt.integerRegex=/^(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)?$/),qt}var g0;function pt(){if(g0)return Kn;g0=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.encodeAbiParameters=f,Kn.getArrayComponents=g;const e=Te(),t=yt(),n=ue(),r=gn(),o=Ye(),s=Ce(),i=nr(),a=Ke(),c=at(),u=te(),l=Su();function f(p,T){if(p.length!==T.length)throw new e.AbiEncodingLengthMismatchError({expectedLength:p.length,givenLength:T.length});const w=b({params:p,values:T}),A=h(w);return A.length===0?"0x":A}function b({params:p,values:T}){const w=[];for(let A=0;A<p.length;A++)w.push(y({param:p[A],value:T[A]}));return w}function y({param:p,value:T}){const w=g(p.type);if(w){const[A,C]=w;return E(T,{length:A,param:{...p,type:C}})}if(p.type==="tuple")return j(T,{param:p});if(p.type==="address")return m(T);if(p.type==="bool")return _(T);if(p.type.startsWith("uint")||p.type.startsWith("int")){const A=p.type.startsWith("int"),[,,C="256"]=l.integerRegex.exec(p.type)??[];return P(T,{signed:A,size:Number(C)})}if(p.type.startsWith("bytes"))return v(T,{param:p});if(p.type==="string")return d(T);throw new e.InvalidAbiEncodingTypeError(p.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function h(p){let T=0;for(let R=0;R<p.length;R++){const{dynamic:S,encoded:x}=p[R];S?T+=32:T+=(0,a.size)(x)}const w=[],A=[];let C=0;for(let R=0;R<p.length;R++){const{dynamic:S,encoded:x}=p[R];S?(w.push((0,u.numberToHex)(T+C,{size:32})),A.push(x),C+=(0,a.size)(x)):w.push(x)}return(0,s.concat)([...w,...A])}function m(p){if(!(0,o.isAddress)(p))throw new t.InvalidAddressError({address:p});return{dynamic:!1,encoded:(0,i.padHex)(p.toLowerCase())}}function E(p,{length:T,param:w}){const A=T===null;if(!Array.isArray(p))throw new e.InvalidArrayError(p);if(!A&&p.length!==T)throw new e.AbiEncodingArrayLengthMismatchError({expectedLength:T,givenLength:p.length,type:`${w.type}[${T}]`});let C=!1;const R=[];for(let S=0;S<p.length;S++){const x=y({param:w,value:p[S]});x.dynamic&&(C=!0),R.push(x)}if(A||C){const S=h(R);if(A){const x=(0,u.numberToHex)(R.length,{size:32});return{dynamic:!0,encoded:R.length>0?(0,s.concat)([x,S]):x}}if(C)return{dynamic:!0,encoded:S}}return{dynamic:!1,encoded:(0,s.concat)(R.map(({encoded:S})=>S))}}function v(p,{param:T}){const[,w]=T.type.split("bytes"),A=(0,a.size)(p);if(!w){let C=p;return A%32!==0&&(C=(0,i.padHex)(C,{dir:"right",size:Math.ceil((p.length-2)/2/32)*32})),{dynamic:!0,encoded:(0,s.concat)([(0,i.padHex)((0,u.numberToHex)(A,{size:32})),C])}}if(A!==Number.parseInt(w,10))throw new e.AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt(w,10),value:p});return{dynamic:!1,encoded:(0,i.padHex)(p,{dir:"right"})}}function _(p){if(typeof p!="boolean")throw new n.BaseError(`Invalid boolean value: "${p}" (type: ${typeof p}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,i.padHex)((0,u.boolToHex)(p))}}function P(p,{signed:T,size:w=256}){if(typeof w=="number"){const A=2n**(BigInt(w)-(T?1n:0n))-1n,C=T?-A-1n:0n;if(p>A||p<C)throw new r.IntegerOutOfRangeError({max:A.toString(),min:C.toString(),signed:T,size:w/8,value:p.toString()})}return{dynamic:!1,encoded:(0,u.numberToHex)(p,{size:32,signed:T})}}function d(p){const T=(0,u.stringToHex)(p),w=Math.ceil((0,a.size)(T)/32),A=[];for(let C=0;C<w;C++)A.push((0,i.padHex)((0,c.slice)(T,C*32,(C+1)*32),{dir:"right"}));return{dynamic:!0,encoded:(0,s.concat)([(0,i.padHex)((0,u.numberToHex)((0,a.size)(T),{size:32})),...A])}}function j(p,{param:T}){let w=!1;const A=[];for(let C=0;C<T.components.length;C++){const R=T.components[C],S=Array.isArray(p)?C:R.name,x=y({param:R,value:p[S]});A.push(x),x.dynamic&&(w=!0)}return{dynamic:w,encoded:w?h(A):(0,s.concat)(A.map(({encoded:C})=>C))}}function g(p){const T=p.match(/^(.*)\[(\d+)?\]$/);return T?[T[2]?Number(T[2]):null,T[1]]:void 0}return Kn}var tn={},Xn={},_0;function zr(){if(_0)return Xn;_0=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.toFunctionSelector=void 0;const e=at(),t=Iu(),n=r=>(0,e.slice)((0,t.toSignatureHash)(r),0,4);return Xn.toFunctionSelector=n,Xn}var v0;function Gt(){if(v0)return tn;v0=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.getAbiItem=s,tn.isArgOfType=i,tn.getAmbiguousTypes=a;const e=Te(),t=De(),n=Ye(),r=_n(),o=zr();function s(c){const{abi:u,args:l=[],name:f}=c,b=(0,t.isHex)(f,{strict:!1}),y=u.filter(m=>b?m.type==="function"?(0,o.toFunctionSelector)(m)===f:m.type==="event"?(0,r.toEventSelector)(m)===f:!1:"name"in m&&m.name===f);if(y.length===0)return;if(y.length===1)return y[0];let h;for(const m of y){if(!("inputs"in m))continue;if(!l||l.length===0){if(!m.inputs||m.inputs.length===0)return m;continue}if(!m.inputs||m.inputs.length===0||m.inputs.length!==l.length)continue;if(l.every((v,_)=>{const P="inputs"in m&&m.inputs[_];return P?i(v,P):!1})){if(h&&"inputs"in h&&h.inputs){const v=a(m.inputs,h.inputs,l);if(v)throw new e.AbiItemAmbiguityError({abiItem:m,type:v[0]},{abiItem:h,type:v[1]})}h=m}}return h||y[0]}function i(c,u){const l=typeof c,f=u.type;switch(f){case"address":return(0,n.isAddress)(c,{strict:!1});case"bool":return l==="boolean";case"function":return l==="string";case"string":return l==="string";default:return f==="tuple"&&"components"in u?Object.values(u.components).every((b,y)=>l==="object"&&i(Object.values(c)[y],b)):/^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)?$/.test(f)?l==="number"||l==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(f)?l==="string"||c instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(f)?Array.isArray(c)&&c.every(b=>i(b,{...u,type:f.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function a(c,u,l){for(const f in c){const b=c[f],y=u[f];if(b.type==="tuple"&&y.type==="tuple"&&"components"in b&&"components"in y)return a(b.components,y.components,l[f]);const h=[b.type,y.type];if(h.includes("address")&&h.includes("bytes20")?!0:h.includes("address")&&h.includes("string")?(0,n.isAddress)(l[f],{strict:!1}):h.includes("address")&&h.includes("bytes")?(0,n.isAddress)(l[f],{strict:!1}):!1)return h}}return tn}var E0;function Ur(){if(E0)return Ei;E0=1,Object.defineProperty(Ei,"__esModule",{value:!0}),Ei.encodeEventTopics=u;const e=Te(),t=Y1(),n=_e(),r=Ze(),o=_n(),s=pt(),i=Lt(),a=Gt(),c="/docs/contract/encodeEventTopics";function u(f){const{abi:b,eventName:y,args:h}=f;let m=b[0];if(y){const P=(0,a.getAbiItem)({abi:b,name:y});if(!P)throw new e.AbiEventNotFoundError(y,{docsPath:c});m=P}if(m.type!=="event")throw new e.AbiEventNotFoundError(void 0,{docsPath:c});const E=(0,i.formatAbiItem)(m),v=(0,o.toEventSelector)(E);let _=[];if(h&&"inputs"in m){const P=m.inputs?.filter(j=>"indexed"in j&&j.indexed),d=Array.isArray(h)?h:Object.values(h).length>0?P?.map(j=>h[j.name])??[]:[];d.length>0&&(_=P?.map((j,g)=>Array.isArray(d[g])?d[g].map((p,T)=>l({param:j,value:d[g][T]})):typeof d[g]<"u"&&d[g]!==null?l({param:j,value:d[g]}):null)??[])}return[v,..._]}function l({param:f,value:b}){if(f.type==="string"||f.type==="bytes")return(0,r.keccak256)((0,n.toBytes)(b));if(f.type==="tuple"||f.type.match(/^(.*)\[(\d+)?\]$/))throw new t.FilterTypeNotSupportedError(f.type);return(0,s.encodeAbiParameters)([f],[b])}return Ei}var Ri={},j0;function Ru(){if(j0)return Ri;j0=1,Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.createFilterRequestScope=e;function e(t,{method:n}){const r={};return t.transport.type==="fallback"&&t.transport.onResponse?.(({method:o,response:s,status:i,transport:a})=>{i==="success"&&n===o&&(r[s]=a.request)}),(o=>r[o]||t.request)}return Ri}var w0;function Xd(){if(w0)return vi;w0=1,Object.defineProperty(vi,"__esModule",{value:!0}),vi.createContractEventFilter=r;const e=Ur(),t=te(),n=Ru();async function r(o,s){const{address:i,abi:a,args:c,eventName:u,fromBlock:l,strict:f,toBlock:b}=s,y=(0,n.createFilterRequestScope)(o,{method:"eth_newFilter"}),h=u?(0,e.encodeEventTopics)({abi:a,args:c,eventName:u}):void 0,m=await o.request({method:"eth_newFilter",params:[{address:i,fromBlock:typeof l=="bigint"?(0,t.numberToHex)(l):l,toBlock:typeof b=="bigint"?(0,t.numberToHex)(b):b,topics:h}]});return{abi:a,args:c,eventName:u,id:m,request:y(m),strict:!!f,type:"event"}}return vi}var Bi={},Oi={},P0;function Ie(){if(P0)return Oi;P0=1,Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.parseAccount=e;function e(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}return Oi}var xi={},Ci={},A0;function Q1(){if(A0)return Ci;A0=1,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.prepareEncodeFunctionData=s;const e=Te(),t=zr(),n=Lt(),r=Gt(),o="/docs/contract/encodeFunctionData";function s(i){const{abi:a,args:c,functionName:u}=i;let l=a[0];if(u){const f=(0,r.getAbiItem)({abi:a,args:c,name:u});if(!f)throw new e.AbiFunctionNotFoundError(u,{docsPath:o});l=f}if(l.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:o});return{abi:[l],functionName:(0,t.toFunctionSelector)((0,n.formatAbiItem)(l))}}return Ci}var T0;function Je(){if(T0)return xi;T0=1,Object.defineProperty(xi,"__esModule",{value:!0}),xi.encodeFunctionData=r;const e=Ce(),t=pt(),n=Q1();function r(o){const{args:s}=o,{abi:i,functionName:a}=o.abi.length===1&&o.functionName?.startsWith("0x")?o:(0,n.prepareEncodeFunctionData)(o),c=i[0],u=a,l="inputs"in c&&c.inputs?(0,t.encodeAbiParameters)(c.inputs,s??[]):void 0;return(0,e.concatHex)([u,l??"0x"])}return xi}var qi={},Ne={},Mt={},I0;function Qd(){return I0||(I0=1,Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.solidityPanic=Mt.solidityError=Mt.panicReasons=void 0,Mt.panicReasons={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Mt.solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Mt.solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}),Mt}var Mi={},Hi={},ki={},Ht={},S0;function $1(){if(S0)return Ht;S0=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.RecursiveReadLimitExceededError=Ht.PositionOutOfBoundsError=Ht.NegativeOffsetError=void 0;const e=ue();class t extends e.BaseError{constructor({offset:s}){super(`Offset \`${s}\` cannot be negative.`,{name:"NegativeOffsetError"})}}Ht.NegativeOffsetError=t;class n extends e.BaseError{constructor({length:s,position:i}){super(`Position \`${i}\` is out of bounds (\`0 < position < ${s}\`).`,{name:"PositionOutOfBoundsError"})}}Ht.PositionOutOfBoundsError=n;class r extends e.BaseError{constructor({count:s,limit:i}){super(`Recursive read limit of \`${i}\` exceeded (recursive read count: \`${s}\`).`,{name:"RecursiveReadLimitExceededError"})}}return Ht.RecursiveReadLimitExceededError=r,Ht}var R0;function xo(){if(R0)return ki;R0=1,Object.defineProperty(ki,"__esModule",{value:!0}),ki.createCursor=n;const e=$1(),t={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new e.RecursiveReadLimitExceededError({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(r){if(r<0||r>this.bytes.length-1)throw new e.PositionOutOfBoundsError({length:this.bytes.length,position:r})},decrementPosition(r){if(r<0)throw new e.NegativeOffsetError({offset:r});const o=this.position-r;this.assertPosition(o),this.position=o},getReadCount(r){return this.positionReadCount.get(r||this.position)||0},incrementPosition(r){if(r<0)throw new e.NegativeOffsetError({offset:r});const o=this.position+r;this.assertPosition(o),this.position=o},inspectByte(r){const o=r??this.position;return this.assertPosition(o),this.bytes[o]},inspectBytes(r,o){const s=o??this.position;return this.assertPosition(s+r-1),this.bytes.subarray(s,s+r)},inspectUint8(r){const o=r??this.position;return this.assertPosition(o),this.bytes[o]},inspectUint16(r){const o=r??this.position;return this.assertPosition(o+1),this.dataView.getUint16(o)},inspectUint24(r){const o=r??this.position;return this.assertPosition(o+2),(this.dataView.getUint16(o)<<8)+this.dataView.getUint8(o+2)},inspectUint32(r){const o=r??this.position;return this.assertPosition(o+3),this.dataView.getUint32(o)},pushByte(r){this.assertPosition(this.position),this.bytes[this.position]=r,this.position++},pushBytes(r){this.assertPosition(this.position+r.length-1),this.bytes.set(r,this.position),this.position+=r.length},pushUint8(r){this.assertPosition(this.position),this.bytes[this.position]=r,this.position++},pushUint16(r){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,r),this.position+=2},pushUint24(r){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,r>>8),this.dataView.setUint8(this.position+2,r&255),this.position+=3},pushUint32(r){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,r),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const r=this.inspectByte();return this.position++,r},readBytes(r,o){this.assertReadLimit(),this._touch();const s=this.inspectBytes(r);return this.position+=o??r,s},readUint8(){this.assertReadLimit(),this._touch();const r=this.inspectUint8();return this.position+=1,r},readUint16(){this.assertReadLimit(),this._touch();const r=this.inspectUint16();return this.position+=2,r},readUint24(){this.assertReadLimit(),this._touch();const r=this.inspectUint24();return this.position+=3,r},readUint32(){this.assertReadLimit(),this._touch();const r=this.inspectUint32();return this.position+=4,r},get remaining(){return this.bytes.length-this.position},setPosition(r){const o=this.position;return this.assertPosition(r),this.position=r,()=>this.position=o},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const r=this.getReadCount();this.positionReadCount.set(this.position,r+1),r>0&&this.recursiveReadCount++}};function n(r,{recursiveReadLimit:o=8192}={}){const s=Object.create(t);return s.bytes=r,s.dataView=new DataView(r.buffer??r,r.byteOffset,r.byteLength),s.positionReadCount=new Map,s.recursiveReadLimit=o,s}return ki}var Xt={},B0;function $d(){if(B0)return Xt;B0=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.fromBytes=o,Xt.bytesToBigInt=s,Xt.bytesToBool=i,Xt.bytesToNumber=a,Xt.bytesToString=c;const e=gn(),t=Dt(),n=Re(),r=te();function o(u,l){const f=typeof l=="string"?{to:l}:l,b=f.to;return b==="number"?a(u,f):b==="bigint"?s(u,f):b==="boolean"?i(u,f):b==="string"?c(u,f):(0,r.bytesToHex)(u,f)}function s(u,l={}){typeof l.size<"u"&&(0,n.assertSize)(u,{size:l.size});const f=(0,r.bytesToHex)(u,l);return(0,n.hexToBigInt)(f,l)}function i(u,l={}){let f=u;if(typeof l.size<"u"&&((0,n.assertSize)(f,{size:l.size}),f=(0,t.trim)(f)),f.length>1||f[0]>1)throw new e.InvalidBytesBooleanError(f);return!!f[0]}function a(u,l={}){typeof l.size<"u"&&(0,n.assertSize)(u,{size:l.size});const f=(0,r.bytesToHex)(u,l);return(0,n.hexToNumber)(f,l)}function c(u,l={}){let f=u;return typeof l.size<"u"&&((0,n.assertSize)(f,{size:l.size}),f=(0,t.trim)(f,{dir:"right"})),new TextDecoder().decode(f)}return Xt}var O0;function ir(){if(O0)return Hi;O0=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.decodeAbiParameters=l;const e=Te(),t=nt(),n=xo(),r=Ke(),o=at(),s=Dt(),i=$d(),a=_e(),c=te(),u=pt();function l(g,p){const T=typeof p=="string"?(0,a.hexToBytes)(p):p,w=(0,n.createCursor)(T);if((0,r.size)(T)===0&&g.length>0)throw new e.AbiDecodingZeroDataError;if((0,r.size)(p)&&(0,r.size)(p)<32)throw new e.AbiDecodingDataSizeTooSmallError({data:typeof p=="string"?p:(0,c.bytesToHex)(p),params:g,size:(0,r.size)(p)});let A=0;const C=[];for(let R=0;R<g.length;++R){const S=g[R];w.setPosition(A);const[x,F]=f(w,S,{staticPosition:0});A+=F,C.push(x)}return C}function f(g,p,{staticPosition:T}){const w=(0,u.getArrayComponents)(p.type);if(w){const[A,C]=w;return m(g,{...p,type:C},{length:A,staticPosition:T})}if(p.type==="tuple")return P(g,p,{staticPosition:T});if(p.type==="address")return h(g);if(p.type==="bool")return E(g);if(p.type.startsWith("bytes"))return v(g,p,{staticPosition:T});if(p.type.startsWith("uint")||p.type.startsWith("int"))return _(g,p);if(p.type==="string")return d(g,{staticPosition:T});throw new e.InvalidAbiDecodingTypeError(p.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const b=32,y=32;function h(g){const p=g.readBytes(32);return[(0,t.checksumAddress)((0,c.bytesToHex)((0,o.sliceBytes)(p,-20))),32]}function m(g,p,{length:T,staticPosition:w}){if(!T){const R=(0,i.bytesToNumber)(g.readBytes(y)),S=w+R,x=S+b;g.setPosition(S);const F=(0,i.bytesToNumber)(g.readBytes(b)),M=j(p);let I=0;const k=[];for(let B=0;B<F;++B){g.setPosition(x+(M?B*32:I));const[q,O]=f(g,p,{staticPosition:x});I+=O,k.push(q)}return g.setPosition(w+32),[k,32]}if(j(p)){const R=(0,i.bytesToNumber)(g.readBytes(y)),S=w+R,x=[];for(let F=0;F<T;++F){g.setPosition(S+F*32);const[M]=f(g,p,{staticPosition:S});x.push(M)}return g.setPosition(w+32),[x,32]}let A=0;const C=[];for(let R=0;R<T;++R){const[S,x]=f(g,p,{staticPosition:w+A});A+=x,C.push(S)}return[C,A]}function E(g){return[(0,i.bytesToBool)(g.readBytes(32),{size:32}),32]}function v(g,p,{staticPosition:T}){const[w,A]=p.type.split("bytes");if(!A){const R=(0,i.bytesToNumber)(g.readBytes(32));g.setPosition(T+R);const S=(0,i.bytesToNumber)(g.readBytes(32));if(S===0)return g.setPosition(T+32),["0x",32];const x=g.readBytes(S);return g.setPosition(T+32),[(0,c.bytesToHex)(x),32]}return[(0,c.bytesToHex)(g.readBytes(Number.parseInt(A,10),32)),32]}function _(g,p){const T=p.type.startsWith("int"),w=Number.parseInt(p.type.split("int")[1]||"256",10),A=g.readBytes(32);return[w>48?(0,i.bytesToBigInt)(A,{signed:T}):(0,i.bytesToNumber)(A,{signed:T}),32]}function P(g,p,{staticPosition:T}){const w=p.components.length===0||p.components.some(({name:R})=>!R),A=w?[]:{};let C=0;if(j(p)){const R=(0,i.bytesToNumber)(g.readBytes(y)),S=T+R;for(let x=0;x<p.components.length;++x){const F=p.components[x];g.setPosition(S+C);const[M,I]=f(g,F,{staticPosition:S});C+=I,A[w?x:F?.name]=M}return g.setPosition(T+32),[A,32]}for(let R=0;R<p.components.length;++R){const S=p.components[R],[x,F]=f(g,S,{staticPosition:T});A[w?R:S?.name]=x,C+=F}return[A,C]}function d(g,{staticPosition:p}){const T=(0,i.bytesToNumber)(g.readBytes(32)),w=p+T;g.setPosition(w);const A=(0,i.bytesToNumber)(g.readBytes(32));if(A===0)return g.setPosition(p+32),["",32];const C=g.readBytes(A,32),R=(0,i.bytesToString)((0,s.trim)(C));return g.setPosition(p+32),[R,32]}function j(g){const{type:p}=g;if(p==="string"||p==="bytes"||p.endsWith("[]"))return!0;if(p==="tuple")return g.components?.some(j);const T=(0,u.getArrayComponents)(g.type);return!!(T&&j({...g,type:T[1]}))}return Hi}var x0;function Bu(){if(x0)return Mi;x0=1,Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.decodeErrorResult=i;const e=Qd(),t=Te(),n=at(),r=zr(),o=ir(),s=Lt();function i(a){const{abi:c,data:u}=a,l=(0,n.slice)(u,0,4);if(l==="0x")throw new t.AbiDecodingZeroDataError;const b=[...c||[],e.solidityError,e.solidityPanic].find(y=>y.type==="error"&&l===(0,r.toFunctionSelector)((0,s.formatAbiItem)(y)));if(!b)throw new t.AbiErrorSignatureNotFoundError(l,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:b,args:"inputs"in b&&b.inputs&&b.inputs.length>0?(0,o.decodeAbiParameters)(b.inputs,(0,n.slice)(u,4)):void 0,errorName:b.name}}return Mi}var Fi={},Qn={},C0;function He(){if(C0)return Qn;C0=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.stringify=void 0;const e=(t,n,r)=>JSON.stringify(t,(o,s)=>{const i=typeof s=="bigint"?s.toString():s;return typeof n=="function"?n(o,i):i},r);return Qn.stringify=e,Qn}var q0;function eg(){if(q0)return Fi;q0=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.formatAbiItemWithArgs=t;const e=He();function t({abiItem:n,args:r,includeFunctionName:o=!0,includeName:s=!1}){if("name"in n&&"inputs"in n&&n.inputs)return`${o?n.name:""}(${n.inputs.map((i,a)=>`${s&&i.name?`${i.name}: `:""}${typeof r[a]=="object"?(0,e.stringify)(r[a]):r[a]}`).join(", ")})`}return Fi}var Ni={},kt={},M0;function Co(){return M0||(M0=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.weiUnits=kt.gweiUnits=kt.etherUnits=void 0,kt.etherUnits={gwei:9,wei:18},kt.gweiUnits={ether:-9,wei:9},kt.weiUnits={ether:-18,gwei:-9}),kt}var zi={},H0;function Ou(){if(H0)return zi;H0=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.formatUnits=e;function e(t,n){let r=t.toString();const o=r.startsWith("-");o&&(r=r.slice(1)),r=r.padStart(n,"0");let[s,i]=[r.slice(0,r.length-n),r.slice(r.length-n)];return i=i.replace(/(0+)$/,""),`${o?"-":""}${s||"0"}${i?`.${i}`:""}`}return zi}var k0;function qo(){if(k0)return Ni;k0=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.formatEther=n;const e=Co(),t=Ou();function n(r,o="wei"){return(0,t.formatUnits)(r,e.etherUnits[o])}return Ni}var Ui={},F0;function Lr(){if(F0)return Ui;F0=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.formatGwei=n;const e=Co(),t=Ou();function n(r,o="wei"){return(0,t.formatUnits)(r,e.gweiUnits[o])}return Ui}var Ft={},N0;function ef(){if(N0)return Ft;N0=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.StateAssignmentConflictError=Ft.AccountStateConflictError=void 0,Ft.prettyStateMapping=r,Ft.prettyStateOverride=o;const e=ue();class t extends e.BaseError{constructor({address:i}){super(`State for account "${i}" is set multiple times.`,{name:"AccountStateConflictError"})}}Ft.AccountStateConflictError=t;class n extends e.BaseError{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}Ft.StateAssignmentConflictError=n;function r(s){return s.reduce((i,{slot:a,value:c})=>`${i} ${a}: ${c}
24
+ `,"")}function o(s){return s.reduce((i,{address:a,...c})=>{let u=`${i} ${a}:
25
+ `;return c.nonce&&(u+=` nonce: ${c.nonce}
26
+ `),c.balance&&(u+=` balance: ${c.balance}
27
+ `),c.code&&(u+=` code: ${c.code}
28
+ `),c.state&&(u+=` state:
29
+ `,u+=r(c.state)),c.stateDiff&&(u+=` stateDiff:
30
+ `,u+=r(c.stateDiff)),u},` State Override:
31
+ `).slice(0,-1)}return Ft}var Ee={},z0;function Xe(){if(z0)return Ee;z0=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.WaitForTransactionReceiptTimeoutError=Ee.TransactionReceiptRevertedError=Ee.TransactionReceiptNotFoundError=Ee.TransactionNotFoundError=Ee.TransactionExecutionError=Ee.InvalidStorageKeySizeError=Ee.InvalidSerializedTransactionError=Ee.InvalidSerializedTransactionTypeError=Ee.InvalidSerializableTransactionError=Ee.InvalidLegacyVError=Ee.FeeConflictError=void 0,Ee.prettyPrint=r;const e=qo(),t=Lr(),n=ue();function r(m){const E=Object.entries(m).map(([_,P])=>P===void 0||P===!1?null:[_,P]).filter(Boolean),v=E.reduce((_,[P])=>Math.max(_,P.length),0);return E.map(([_,P])=>` ${`${_}:`.padEnd(v+1)} ${P}`).join(`
32
+ `)}class o extends n.BaseError{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
33
+ `),{name:"FeeConflictError"})}}Ee.FeeConflictError=o;class s extends n.BaseError{constructor({v:E}){super(`Invalid \`v\` value "${E}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}Ee.InvalidLegacyVError=s;class i extends n.BaseError{constructor({transaction:E}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",r(E),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}Ee.InvalidSerializableTransactionError=i;class a extends n.BaseError{constructor({serializedType:E}){super(`Serialized transaction type "${E}" is invalid.`,{name:"InvalidSerializedTransactionType"}),Object.defineProperty(this,"serializedType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedType=E}}Ee.InvalidSerializedTransactionTypeError=a;class c extends n.BaseError{constructor({attributes:E,serializedTransaction:v,type:_}){const P=Object.entries(E).map(([d,j])=>typeof j>"u"?d:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${_}" was provided.`,{metaMessages:[`Serialized Transaction: "${v}"`,P.length>0?`Missing Attributes: ${P.join(", ")}`:""].filter(Boolean),name:"InvalidSerializedTransactionError"}),Object.defineProperty(this,"serializedTransaction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedTransaction=v,this.type=_}}Ee.InvalidSerializedTransactionError=c;class u extends n.BaseError{constructor({storageKey:E}){super(`Size for storage key "${E}" is invalid. Expected 32 bytes. Got ${Math.floor((E.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}Ee.InvalidStorageKeySizeError=u;class l extends n.BaseError{constructor(E,{account:v,docsPath:_,chain:P,data:d,gas:j,gasPrice:g,maxFeePerGas:p,maxPriorityFeePerGas:T,nonce:w,to:A,value:C}){const R=r({chain:P&&`${P?.name} (id: ${P?.id})`,from:v?.address,to:A,value:typeof C<"u"&&`${(0,e.formatEther)(C)} ${P?.nativeCurrency?.symbol||"ETH"}`,data:d,gas:j,gasPrice:typeof g<"u"&&`${(0,t.formatGwei)(g)} gwei`,maxFeePerGas:typeof p<"u"&&`${(0,t.formatGwei)(p)} gwei`,maxPriorityFeePerGas:typeof T<"u"&&`${(0,t.formatGwei)(T)} gwei`,nonce:w});super(E.shortMessage,{cause:E,docsPath:_,metaMessages:[...E.metaMessages?[...E.metaMessages," "]:[],"Request Arguments:",R].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=E}}Ee.TransactionExecutionError=l;class f extends n.BaseError{constructor({blockHash:E,blockNumber:v,blockTag:_,hash:P,index:d}){let j="Transaction";_&&d!==void 0&&(j=`Transaction at block time "${_}" at index "${d}"`),E&&d!==void 0&&(j=`Transaction at block hash "${E}" at index "${d}"`),v&&d!==void 0&&(j=`Transaction at block number "${v}" at index "${d}"`),P&&(j=`Transaction with hash "${P}"`),super(`${j} could not be found.`,{name:"TransactionNotFoundError"})}}Ee.TransactionNotFoundError=f;class b extends n.BaseError{constructor({hash:E}){super(`Transaction receipt with hash "${E}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}Ee.TransactionReceiptNotFoundError=b;class y extends n.BaseError{constructor({receipt:E}){super(`Transaction with hash "${E.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=E}}Ee.TransactionReceiptRevertedError=y;class h extends n.BaseError{constructor({hash:E}){super(`Timed out while waiting for transaction with hash "${E}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}return Ee.WaitForTransactionReceiptTimeoutError=h,Ee}var Pr={},U0;function tf(){if(U0)return Pr;U0=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.getUrl=Pr.getContractAddress=void 0;const e=n=>n;Pr.getContractAddress=e;const t=n=>n;return Pr.getUrl=t,Pr}var L0;function ar(){if(L0)return Ne;L0=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.RawContractError=Ne.CounterfactualDeploymentFailedError=Ne.ContractFunctionZeroDataError=Ne.ContractFunctionRevertedError=Ne.ContractFunctionExecutionError=Ne.CallExecutionError=void 0;const e=Ie(),t=Qd(),n=Bu(),r=Lt(),o=eg(),s=Gt(),i=qo(),a=Lr(),c=Te(),u=ue(),l=ef(),f=Xe(),b=tf();class y extends u.BaseError{constructor(d,{account:j,docsPath:g,chain:p,data:T,gas:w,gasPrice:A,maxFeePerGas:C,maxPriorityFeePerGas:R,nonce:S,to:x,value:F,stateOverride:M}){const I=j?(0,e.parseAccount)(j):void 0;let k=(0,f.prettyPrint)({from:I?.address,to:x,value:typeof F<"u"&&`${(0,i.formatEther)(F)} ${p?.nativeCurrency?.symbol||"ETH"}`,data:T,gas:w,gasPrice:typeof A<"u"&&`${(0,a.formatGwei)(A)} gwei`,maxFeePerGas:typeof C<"u"&&`${(0,a.formatGwei)(C)} gwei`,maxPriorityFeePerGas:typeof R<"u"&&`${(0,a.formatGwei)(R)} gwei`,nonce:S});M&&(k+=`
34
+ ${(0,l.prettyStateOverride)(M)}`),super(d.shortMessage,{cause:d,docsPath:g,metaMessages:[...d.metaMessages?[...d.metaMessages," "]:[],"Raw Call Arguments:",k].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=d}}Ne.CallExecutionError=y;class h extends u.BaseError{constructor(d,{abi:j,args:g,contractAddress:p,docsPath:T,functionName:w,sender:A}){const C=(0,s.getAbiItem)({abi:j,args:g,name:w}),R=C?(0,o.formatAbiItemWithArgs)({abiItem:C,args:g,includeFunctionName:!1,includeName:!1}):void 0,S=C?(0,r.formatAbiItem)(C,{includeName:!0}):void 0,x=(0,f.prettyPrint)({address:p&&(0,b.getContractAddress)(p),function:S,args:R&&R!=="()"&&`${[...Array(w?.length??0).keys()].map(()=>" ").join("")}${R}`,sender:A});super(d.shortMessage||`An unknown error occurred while executing the contract function "${w}".`,{cause:d,docsPath:T,metaMessages:[...d.metaMessages?[...d.metaMessages," "]:[],x&&"Contract Call:",x].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=j,this.args=g,this.cause=d,this.contractAddress=p,this.functionName=w,this.sender=A}}Ne.ContractFunctionExecutionError=h;class m extends u.BaseError{constructor({abi:d,data:j,functionName:g,message:p}){let T,w,A,C;if(j&&j!=="0x")try{w=(0,n.decodeErrorResult)({abi:d,data:j});const{abiItem:S,errorName:x,args:F}=w;if(x==="Error")C=F[0];else if(x==="Panic"){const[M]=F;C=t.panicReasons[M]}else{const M=S?(0,r.formatAbiItem)(S,{includeName:!0}):void 0,I=S&&F?(0,o.formatAbiItemWithArgs)({abiItem:S,args:F,includeFunctionName:!1,includeName:!1}):void 0;A=[M?`Error: ${M}`:"",I&&I!=="()"?` ${[...Array(x?.length??0).keys()].map(()=>" ").join("")}${I}`:""]}}catch(S){T=S}else p&&(C=p);let R;T instanceof c.AbiErrorSignatureNotFoundError&&(R=T.signature,A=[`Unable to decode signature "${R}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${R}.`]),super(C&&C!=="execution reverted"||R?[`The contract function "${g}" reverted with the following ${R?"signature":"reason"}:`,C||R].join(`
35
+ `):`The contract function "${g}" reverted.`,{cause:T,metaMessages:A,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=w,this.raw=j,this.reason=C,this.signature=R}}Ne.ContractFunctionRevertedError=m;class E extends u.BaseError{constructor({functionName:d}){super(`The contract function "${d}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${d}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}Ne.ContractFunctionZeroDataError=E;class v extends u.BaseError{constructor({factory:d}){super(`Deployment for counterfactual contract call failed${d?` for factory "${d}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}Ne.CounterfactualDeploymentFailedError=v;class _ extends u.BaseError{constructor({data:d,message:j}){super(j||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=d}}return Ne.RawContractError=_,Ne}var $e={},D0;function gt(){if(D0)return $e;D0=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.TimeoutError=$e.SocketClosedError=$e.RpcRequestError=$e.WebSocketRequestError=$e.HttpRequestError=void 0;const e=He(),t=ue(),n=tf();class r extends t.BaseError{constructor({body:u,cause:l,details:f,headers:b,status:y,url:h}){super("HTTP request failed.",{cause:l,details:f,metaMessages:[y&&`Status: ${y}`,`URL: ${(0,n.getUrl)(h)}`,u&&`Request body: ${(0,e.stringify)(u)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=u,this.headers=b,this.status=y,this.url=h}}$e.HttpRequestError=r;class o extends t.BaseError{constructor({body:u,cause:l,details:f,url:b}){super("WebSocket request failed.",{cause:l,details:f,metaMessages:[`URL: ${(0,n.getUrl)(b)}`,u&&`Request body: ${(0,e.stringify)(u)}`].filter(Boolean),name:"WebSocketRequestError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=b}}$e.WebSocketRequestError=o;class s extends t.BaseError{constructor({body:u,error:l,url:f}){super("RPC Request failed.",{cause:l,details:l.message,metaMessages:[`URL: ${(0,n.getUrl)(f)}`,`Request body: ${(0,e.stringify)(u)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=l.code,this.data=l.data,this.url=f}}$e.RpcRequestError=s;class i extends t.BaseError{constructor({url:u}={}){super("The socket has been closed.",{metaMessages:[u&&`URL: ${(0,n.getUrl)(u)}`].filter(Boolean),name:"SocketClosedError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=u}}$e.SocketClosedError=i;class a extends t.BaseError{constructor({body:u,url:l}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,n.getUrl)(l)}`,`Request body: ${(0,e.stringify)(u)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=l}}return $e.TimeoutError=a,$e}var re={},G0;function sr(){if(G0)return re;G0=1,Object.defineProperty(re,"__esModule",{value:!0}),re.UnknownRpcError=re.AtomicityNotSupportedError=re.AtomicReadyWalletRejectedUpgradeError=re.BundleTooLargeError=re.UnknownBundleIdError=re.DuplicateIdError=re.UnsupportedChainIdError=re.UnsupportedNonOptionalCapabilityError=re.SwitchChainError=re.ChainDisconnectedError=re.ProviderDisconnectedError=re.UnsupportedProviderMethodError=re.UnauthorizedProviderError=re.UserRejectedRequestError=re.JsonRpcVersionUnsupportedError=re.LimitExceededRpcError=re.MethodNotSupportedRpcError=re.TransactionRejectedRpcError=re.ResourceUnavailableRpcError=re.ResourceNotFoundRpcError=re.InvalidInputRpcError=re.InternalRpcError=re.InvalidParamsRpcError=re.MethodNotFoundRpcError=re.InvalidRequestRpcError=re.ParseRpcError=re.ProviderRpcError=re.RpcError=void 0;const e=ue(),t=gt(),n=-1;class r extends e.BaseError{constructor(M,{code:I,docsPath:k,metaMessages:B,name:q,shortMessage:O}){super(O,{cause:M,docsPath:k,metaMessages:B||M?.metaMessages,name:q||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=q||M.name,this.code=M instanceof t.RpcRequestError?M.code:I??n}}re.RpcError=r;class o extends r{constructor(M,I){super(M,I),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=I.data}}re.ProviderRpcError=o;class s extends r{constructor(M){super(M,{code:s.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}re.ParseRpcError=s,Object.defineProperty(s,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class i extends r{constructor(M){super(M,{code:i.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}re.InvalidRequestRpcError=i,Object.defineProperty(i,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class a extends r{constructor(M,{method:I}={}){super(M,{code:a.code,name:"MethodNotFoundRpcError",shortMessage:`The method${I?` "${I}"`:""} does not exist / is not available.`})}}re.MethodNotFoundRpcError=a,Object.defineProperty(a,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class c extends r{constructor(M){super(M,{code:c.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
36
+ `)})}}re.InvalidParamsRpcError=c,Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class u extends r{constructor(M){super(M,{code:u.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}re.InternalRpcError=u,Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class l extends r{constructor(M){super(M,{code:l.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
37
+ `)})}}re.InvalidInputRpcError=l,Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class f extends r{constructor(M){super(M,{code:f.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}re.ResourceNotFoundRpcError=f,Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class b extends r{constructor(M){super(M,{code:b.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}re.ResourceUnavailableRpcError=b,Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class y extends r{constructor(M){super(M,{code:y.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}re.TransactionRejectedRpcError=y,Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class h extends r{constructor(M,{method:I}={}){super(M,{code:h.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${I?` "${I}"`:""} is not supported.`})}}re.MethodNotSupportedRpcError=h,Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class m extends r{constructor(M){super(M,{code:m.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}re.LimitExceededRpcError=m,Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class E extends r{constructor(M){super(M,{code:E.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}re.JsonRpcVersionUnsupportedError=E,Object.defineProperty(E,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class v extends o{constructor(M){super(M,{code:v.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}re.UserRejectedRequestError=v,Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class _ extends o{constructor(M){super(M,{code:_.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}re.UnauthorizedProviderError=_,Object.defineProperty(_,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class P extends o{constructor(M,{method:I}={}){super(M,{code:P.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${I?` " ${I}"`:""}.`})}}re.UnsupportedProviderMethodError=P,Object.defineProperty(P,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class d extends o{constructor(M){super(M,{code:d.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}re.ProviderDisconnectedError=d,Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class j extends o{constructor(M){super(M,{code:j.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}re.ChainDisconnectedError=j,Object.defineProperty(j,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class g extends o{constructor(M){super(M,{code:g.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}re.SwitchChainError=g,Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class p extends o{constructor(M){super(M,{code:p.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}re.UnsupportedNonOptionalCapabilityError=p,Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class T extends o{constructor(M){super(M,{code:T.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}re.UnsupportedChainIdError=T,Object.defineProperty(T,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class w extends o{constructor(M){super(M,{code:w.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}re.DuplicateIdError=w,Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class A extends o{constructor(M){super(M,{code:A.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}re.UnknownBundleIdError=A,Object.defineProperty(A,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class C extends o{constructor(M){super(M,{code:C.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}re.BundleTooLargeError=C,Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class R extends o{constructor(M){super(M,{code:R.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}re.AtomicReadyWalletRejectedUpgradeError=R,Object.defineProperty(R,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class S extends o{constructor(M){super(M,{code:S.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}re.AtomicityNotSupportedError=S,Object.defineProperty(S,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class x extends r{constructor(M){super(M,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}return re.UnknownRpcError=x,re}var V0;function cr(){if(V0)return qi;V0=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.getContractError=i;const e=Te(),t=ue(),n=ar(),r=gt(),o=sr(),s=3;function i(a,{abi:c,address:u,args:l,docsPath:f,functionName:b,sender:y}){const h=a instanceof n.RawContractError?a:a instanceof t.BaseError?a.walk(j=>"data"in j)||a.walk():{},{code:m,data:E,details:v,message:_,shortMessage:P}=h,d=a instanceof e.AbiDecodingZeroDataError?new n.ContractFunctionZeroDataError({functionName:b}):[s,o.InternalRpcError.code].includes(m)&&(E||v||_||P)||m===o.InvalidInputRpcError.code&&v==="execution reverted"&&E?new n.ContractFunctionRevertedError({abi:c,data:typeof E=="object"?E.data:E,functionName:b,message:h instanceof r.RpcRequestError?v:P??_}):a;return new n.ContractFunctionExecutionError(d,{abi:c,args:l,contractAddress:u,docsPath:f,functionName:b,sender:y})}return qi}var Li={},Di={},Gi={},Vi={},W0;function tg(){if(W0)return Vi;W0=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.publicKeyToAddress=n;const e=nt(),t=Ze();function n(r){const o=(0,t.keccak256)(`0x${r.substring(4)}`).substring(26);return(0,e.checksumAddress)(`0x${o}`)}return Vi}var Wi={},Pd={},pe={},Fe={},K0;function rg(){if(K0)return Fe;K0=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.SHA512_IV=Fe.SHA384_IV=Fe.SHA224_IV=Fe.SHA256_IV=Fe.HashMD=void 0,Fe.setBigUint64=t,Fe.Chi=n,Fe.Maj=r;const e=or();function t(s,i,a,c){if(typeof s.setBigUint64=="function")return s.setBigUint64(i,a,c);const u=BigInt(32),l=BigInt(4294967295),f=Number(a>>u&l),b=Number(a&l),y=c?4:0,h=c?0:4;s.setUint32(i+y,f,c),s.setUint32(i+h,b,c)}function n(s,i,a){return s&i^~s&a}function r(s,i,a){return s&i^s&a^i&a}class o extends e.Hash{constructor(i,a,c,u){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=i,this.outputLen=a,this.padOffset=c,this.isLE=u,this.buffer=new Uint8Array(i),this.view=(0,e.createView)(this.buffer)}update(i){(0,e.aexists)(this),i=(0,e.toBytes)(i),(0,e.abytes)(i);const{view:a,buffer:c,blockLen:u}=this,l=i.length;for(let f=0;f<l;){const b=Math.min(u-this.pos,l-f);if(b===u){const y=(0,e.createView)(i);for(;u<=l-f;f+=u)this.process(y,f);continue}c.set(i.subarray(f,f+b),this.pos),this.pos+=b,f+=b,this.pos===u&&(this.process(a,0),this.pos=0)}return this.length+=i.length,this.roundClean(),this}digestInto(i){(0,e.aexists)(this),(0,e.aoutput)(i,this),this.finished=!0;const{buffer:a,view:c,blockLen:u,isLE:l}=this;let{pos:f}=this;a[f++]=128,(0,e.clean)(this.buffer.subarray(f)),this.padOffset>u-f&&(this.process(c,0),f=0);for(let E=f;E<u;E++)a[E]=0;t(c,u-8,BigInt(this.length*8),l),this.process(c,0);const b=(0,e.createView)(i),y=this.outputLen;if(y%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const h=y/4,m=this.get();if(h>m.length)throw new Error("_sha2: outputLen bigger than state");for(let E=0;E<h;E++)b.setUint32(4*E,m[E],l)}digest(){const{buffer:i,outputLen:a}=this;this.digestInto(i);const c=i.slice(0,a);return this.destroy(),c}_cloneInto(i){i||(i=new this.constructor),i.set(...this.get());const{blockLen:a,buffer:c,length:u,finished:l,destroyed:f,pos:b}=this;return i.destroyed=f,i.finished=l,i.length=u,i.pos=b,u%a&&i.buffer.set(c),i}clone(){return this._cloneInto()}}return Fe.HashMD=o,Fe.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Fe.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Fe.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Fe.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Fe}var Z0;function ng(){if(Z0)return pe;Z0=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.sha512_224=pe.sha512_256=pe.sha384=pe.sha512=pe.sha224=pe.sha256=pe.SHA512_256=pe.SHA512_224=pe.SHA384=pe.SHA512=pe.SHA224=pe.SHA256=void 0;const e=rg(),t=J1(),n=or(),r=Uint32Array.from([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]),o=new Uint32Array(64);class s extends e.HashMD{constructor(P=32){super(64,P,8,!1),this.A=e.SHA256_IV[0]|0,this.B=e.SHA256_IV[1]|0,this.C=e.SHA256_IV[2]|0,this.D=e.SHA256_IV[3]|0,this.E=e.SHA256_IV[4]|0,this.F=e.SHA256_IV[5]|0,this.G=e.SHA256_IV[6]|0,this.H=e.SHA256_IV[7]|0}get(){const{A:P,B:d,C:j,D:g,E:p,F:T,G:w,H:A}=this;return[P,d,j,g,p,T,w,A]}set(P,d,j,g,p,T,w,A){this.A=P|0,this.B=d|0,this.C=j|0,this.D=g|0,this.E=p|0,this.F=T|0,this.G=w|0,this.H=A|0}process(P,d){for(let S=0;S<16;S++,d+=4)o[S]=P.getUint32(d,!1);for(let S=16;S<64;S++){const x=o[S-15],F=o[S-2],M=(0,n.rotr)(x,7)^(0,n.rotr)(x,18)^x>>>3,I=(0,n.rotr)(F,17)^(0,n.rotr)(F,19)^F>>>10;o[S]=I+o[S-7]+M+o[S-16]|0}let{A:j,B:g,C:p,D:T,E:w,F:A,G:C,H:R}=this;for(let S=0;S<64;S++){const x=(0,n.rotr)(w,6)^(0,n.rotr)(w,11)^(0,n.rotr)(w,25),F=R+x+(0,e.Chi)(w,A,C)+r[S]+o[S]|0,I=((0,n.rotr)(j,2)^(0,n.rotr)(j,13)^(0,n.rotr)(j,22))+(0,e.Maj)(j,g,p)|0;R=C,C=A,A=w,w=T+F|0,T=p,p=g,g=j,j=F+I|0}j=j+this.A|0,g=g+this.B|0,p=p+this.C|0,T=T+this.D|0,w=w+this.E|0,A=A+this.F|0,C=C+this.G|0,R=R+this.H|0,this.set(j,g,p,T,w,A,C,R)}roundClean(){(0,n.clean)(o)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,n.clean)(this.buffer)}}pe.SHA256=s;class i extends s{constructor(){super(28),this.A=e.SHA224_IV[0]|0,this.B=e.SHA224_IV[1]|0,this.C=e.SHA224_IV[2]|0,this.D=e.SHA224_IV[3]|0,this.E=e.SHA224_IV[4]|0,this.F=e.SHA224_IV[5]|0,this.G=e.SHA224_IV[6]|0,this.H=e.SHA224_IV[7]|0}}pe.SHA224=i;const a=t.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(_=>BigInt(_))),c=a[0],u=a[1],l=new Uint32Array(80),f=new Uint32Array(80);class b extends e.HashMD{constructor(P=64){super(128,P,16,!1),this.Ah=e.SHA512_IV[0]|0,this.Al=e.SHA512_IV[1]|0,this.Bh=e.SHA512_IV[2]|0,this.Bl=e.SHA512_IV[3]|0,this.Ch=e.SHA512_IV[4]|0,this.Cl=e.SHA512_IV[5]|0,this.Dh=e.SHA512_IV[6]|0,this.Dl=e.SHA512_IV[7]|0,this.Eh=e.SHA512_IV[8]|0,this.El=e.SHA512_IV[9]|0,this.Fh=e.SHA512_IV[10]|0,this.Fl=e.SHA512_IV[11]|0,this.Gh=e.SHA512_IV[12]|0,this.Gl=e.SHA512_IV[13]|0,this.Hh=e.SHA512_IV[14]|0,this.Hl=e.SHA512_IV[15]|0}get(){const{Ah:P,Al:d,Bh:j,Bl:g,Ch:p,Cl:T,Dh:w,Dl:A,Eh:C,El:R,Fh:S,Fl:x,Gh:F,Gl:M,Hh:I,Hl:k}=this;return[P,d,j,g,p,T,w,A,C,R,S,x,F,M,I,k]}set(P,d,j,g,p,T,w,A,C,R,S,x,F,M,I,k){this.Ah=P|0,this.Al=d|0,this.Bh=j|0,this.Bl=g|0,this.Ch=p|0,this.Cl=T|0,this.Dh=w|0,this.Dl=A|0,this.Eh=C|0,this.El=R|0,this.Fh=S|0,this.Fl=x|0,this.Gh=F|0,this.Gl=M|0,this.Hh=I|0,this.Hl=k|0}process(P,d){for(let O=0;O<16;O++,d+=4)l[O]=P.getUint32(d),f[O]=P.getUint32(d+=4);for(let O=16;O<80;O++){const H=l[O-15]|0,N=f[O-15]|0,U=t.rotrSH(H,N,1)^t.rotrSH(H,N,8)^t.shrSH(H,N,7),z=t.rotrSL(H,N,1)^t.rotrSL(H,N,8)^t.shrSL(H,N,7),G=l[O-2]|0,V=f[O-2]|0,J=t.rotrSH(G,V,19)^t.rotrBH(G,V,61)^t.shrSH(G,V,6),Z=t.rotrSL(G,V,19)^t.rotrBL(G,V,61)^t.shrSL(G,V,6),K=t.add4L(z,Z,f[O-7],f[O-16]),Q=t.add4H(K,U,J,l[O-7],l[O-16]);l[O]=Q|0,f[O]=K|0}let{Ah:j,Al:g,Bh:p,Bl:T,Ch:w,Cl:A,Dh:C,Dl:R,Eh:S,El:x,Fh:F,Fl:M,Gh:I,Gl:k,Hh:B,Hl:q}=this;for(let O=0;O<80;O++){const H=t.rotrSH(S,x,14)^t.rotrSH(S,x,18)^t.rotrBH(S,x,41),N=t.rotrSL(S,x,14)^t.rotrSL(S,x,18)^t.rotrBL(S,x,41),U=S&F^~S&I,z=x&M^~x&k,G=t.add5L(q,N,z,u[O],f[O]),V=t.add5H(G,B,H,U,c[O],l[O]),J=G|0,Z=t.rotrSH(j,g,28)^t.rotrBH(j,g,34)^t.rotrBH(j,g,39),K=t.rotrSL(j,g,28)^t.rotrBL(j,g,34)^t.rotrBL(j,g,39),Q=j&p^j&w^p&w,ie=g&T^g&A^T&A;B=I|0,q=k|0,I=F|0,k=M|0,F=S|0,M=x|0,{h:S,l:x}=t.add(C|0,R|0,V|0,J|0),C=w|0,R=A|0,w=p|0,A=T|0,p=j|0,T=g|0;const Y=t.add3L(J,K,ie);j=t.add3H(Y,V,Z,Q),g=Y|0}({h:j,l:g}=t.add(this.Ah|0,this.Al|0,j|0,g|0)),{h:p,l:T}=t.add(this.Bh|0,this.Bl|0,p|0,T|0),{h:w,l:A}=t.add(this.Ch|0,this.Cl|0,w|0,A|0),{h:C,l:R}=t.add(this.Dh|0,this.Dl|0,C|0,R|0),{h:S,l:x}=t.add(this.Eh|0,this.El|0,S|0,x|0),{h:F,l:M}=t.add(this.Fh|0,this.Fl|0,F|0,M|0),{h:I,l:k}=t.add(this.Gh|0,this.Gl|0,I|0,k|0),{h:B,l:q}=t.add(this.Hh|0,this.Hl|0,B|0,q|0),this.set(j,g,p,T,w,A,C,R,S,x,F,M,I,k,B,q)}roundClean(){(0,n.clean)(l,f)}destroy(){(0,n.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}pe.SHA512=b;class y extends b{constructor(){super(48),this.Ah=e.SHA384_IV[0]|0,this.Al=e.SHA384_IV[1]|0,this.Bh=e.SHA384_IV[2]|0,this.Bl=e.SHA384_IV[3]|0,this.Ch=e.SHA384_IV[4]|0,this.Cl=e.SHA384_IV[5]|0,this.Dh=e.SHA384_IV[6]|0,this.Dl=e.SHA384_IV[7]|0,this.Eh=e.SHA384_IV[8]|0,this.El=e.SHA384_IV[9]|0,this.Fh=e.SHA384_IV[10]|0,this.Fl=e.SHA384_IV[11]|0,this.Gh=e.SHA384_IV[12]|0,this.Gl=e.SHA384_IV[13]|0,this.Hh=e.SHA384_IV[14]|0,this.Hl=e.SHA384_IV[15]|0}}pe.SHA384=y;const h=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),m=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class E extends b{constructor(){super(28),this.Ah=h[0]|0,this.Al=h[1]|0,this.Bh=h[2]|0,this.Bl=h[3]|0,this.Ch=h[4]|0,this.Cl=h[5]|0,this.Dh=h[6]|0,this.Dl=h[7]|0,this.Eh=h[8]|0,this.El=h[9]|0,this.Fh=h[10]|0,this.Fl=h[11]|0,this.Gh=h[12]|0,this.Gl=h[13]|0,this.Hh=h[14]|0,this.Hl=h[15]|0}}pe.SHA512_224=E;class v extends b{constructor(){super(32),this.Ah=m[0]|0,this.Al=m[1]|0,this.Bh=m[2]|0,this.Bl=m[3]|0,this.Ch=m[4]|0,this.Cl=m[5]|0,this.Dh=m[6]|0,this.Dl=m[7]|0,this.Eh=m[8]|0,this.El=m[9]|0,this.Fh=m[10]|0,this.Fl=m[11]|0,this.Gh=m[12]|0,this.Gl=m[13]|0,this.Hh=m[14]|0,this.Hl=m[15]|0}}return pe.SHA512_256=v,pe.sha256=(0,n.createHasher)(()=>new s),pe.sha224=(0,n.createHasher)(()=>new i),pe.sha512=(0,n.createHasher)(()=>new b),pe.sha384=(0,n.createHasher)(()=>new y),pe.sha512_256=(0,n.createHasher)(()=>new v),pe.sha512_224=(0,n.createHasher)(()=>new E),pe}var $n={},Ad={},Y0;function kv(){return Y0||(Y0=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=or();class n extends t.Hash{constructor(s,i){super(),this.finished=!1,this.destroyed=!1,(0,t.ahash)(s);const a=(0,t.toBytes)(i);if(this.iHash=s.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 c=this.blockLen,u=new Uint8Array(c);u.set(a.length>c?s.create().update(a).digest():a);for(let l=0;l<u.length;l++)u[l]^=54;this.iHash.update(u),this.oHash=s.create();for(let l=0;l<u.length;l++)u[l]^=106;this.oHash.update(u),(0,t.clean)(u)}update(s){return(0,t.aexists)(this),this.iHash.update(s),this}digestInto(s){(0,t.aexists)(this),(0,t.abytes)(s,this.outputLen),this.finished=!0,this.iHash.digestInto(s),this.oHash.update(s),this.oHash.digestInto(s),this.destroy()}digest(){const s=new Uint8Array(this.oHash.outputLen);return this.digestInto(s),s}_cloneInto(s){s||(s=Object.create(Object.getPrototypeOf(this),{}));const{oHash:i,iHash:a,finished:c,destroyed:u,blockLen:l,outputLen:f}=this;return s=s,s.finished=c,s.destroyed=u,s.blockLen=l,s.outputLen=f,s.oHash=i._cloneInto(s.oHash),s.iHash=a._cloneInto(s.iHash),s}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=n;const r=(o,s,i)=>new n(o,s).update(i).digest();e.hmac=r,e.hmac.create=(o,s)=>new n(o,s)})(Ad)),Ad}var Td={},Ar={},je={},he={},J0;function Dr(){if(J0)return he;J0=1;Object.defineProperty(he,"__esModule",{value:!0}),he.notImplemented=he.bitMask=void 0,he.isBytes=n,he.abytes=r,he.abool=o,he.numberToHexUnpadded=s,he.hexToNumber=i,he.bytesToHex=u,he.hexToBytes=b,he.bytesToNumberBE=y,he.bytesToNumberLE=h,he.numberToBytesBE=m,he.numberToBytesLE=E,he.numberToVarBytesBE=v,he.ensureBytes=_,he.concatBytes=P,he.equalBytes=d,he.utf8ToBytes=j,he.inRange=p,he.aInRange=T,he.bitLen=w,he.bitGet=A,he.bitSet=C,he.createHmacDrbg=F,he.validateObject=I,he.memoized=B;const e=BigInt(0),t=BigInt(1);function n(q){return q instanceof Uint8Array||ArrayBuffer.isView(q)&&q.constructor.name==="Uint8Array"}function r(q){if(!n(q))throw new Error("Uint8Array expected")}function o(q,O){if(typeof O!="boolean")throw new Error(q+" boolean expected, got "+O)}function s(q){const O=q.toString(16);return O.length&1?"0"+O:O}function i(q){if(typeof q!="string")throw new Error("hex string expected, got "+typeof q);return q===""?e:BigInt("0x"+q)}const a=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",c=Array.from({length:256},(q,O)=>O.toString(16).padStart(2,"0"));function u(q){if(r(q),a)return q.toHex();let O="";for(let H=0;H<q.length;H++)O+=c[q[H]];return O}const l={_0:48,_9:57,A:65,F:70,a:97,f:102};function f(q){if(q>=l._0&&q<=l._9)return q-l._0;if(q>=l.A&&q<=l.F)return q-(l.A-10);if(q>=l.a&&q<=l.f)return q-(l.a-10)}function b(q){if(typeof q!="string")throw new Error("hex string expected, got "+typeof q);if(a)return Uint8Array.fromHex(q);const O=q.length,H=O/2;if(O%2)throw new Error("hex string expected, got unpadded hex of length "+O);const N=new Uint8Array(H);for(let U=0,z=0;U<H;U++,z+=2){const G=f(q.charCodeAt(z)),V=f(q.charCodeAt(z+1));if(G===void 0||V===void 0){const J=q[z]+q[z+1];throw new Error('hex string expected, got non-hex character "'+J+'" at index '+z)}N[U]=G*16+V}return N}function y(q){return i(u(q))}function h(q){return r(q),i(u(Uint8Array.from(q).reverse()))}function m(q,O){return b(q.toString(16).padStart(O*2,"0"))}function E(q,O){return m(q,O).reverse()}function v(q){return b(s(q))}function _(q,O,H){let N;if(typeof O=="string")try{N=b(O)}catch(z){throw new Error(q+" must be hex string or Uint8Array, cause: "+z)}else if(n(O))N=Uint8Array.from(O);else throw new Error(q+" must be hex string or Uint8Array");const U=N.length;if(typeof H=="number"&&U!==H)throw new Error(q+" of length "+H+" expected, got "+U);return N}function P(...q){let O=0;for(let N=0;N<q.length;N++){const U=q[N];r(U),O+=U.length}const H=new Uint8Array(O);for(let N=0,U=0;N<q.length;N++){const z=q[N];H.set(z,U),U+=z.length}return H}function d(q,O){if(q.length!==O.length)return!1;let H=0;for(let N=0;N<q.length;N++)H|=q[N]^O[N];return H===0}function j(q){if(typeof q!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(q))}const g=q=>typeof q=="bigint"&&e<=q;function p(q,O,H){return g(q)&&g(O)&&g(H)&&O<=q&&q<H}function T(q,O,H,N){if(!p(O,H,N))throw new Error("expected valid "+q+": "+H+" <= n < "+N+", got "+O)}function w(q){let O;for(O=0;q>e;q>>=t,O+=1);return O}function A(q,O){return q>>BigInt(O)&t}function C(q,O,H){return q|(H?t:e)<<BigInt(O)}const R=q=>(t<<BigInt(q))-t;he.bitMask=R;const S=q=>new Uint8Array(q),x=q=>Uint8Array.from(q);function F(q,O,H){if(typeof q!="number"||q<2)throw new Error("hashLen must be a number");if(typeof O!="number"||O<2)throw new Error("qByteLen must be a number");if(typeof H!="function")throw new Error("hmacFn must be a function");let N=S(q),U=S(q),z=0;const G=()=>{N.fill(1),U.fill(0),z=0},V=(...Q)=>H(U,N,...Q),J=(Q=S(0))=>{U=V(x([0]),Q),N=V(),Q.length!==0&&(U=V(x([1]),Q),N=V())},Z=()=>{if(z++>=1e3)throw new Error("drbg: tried 1000 values");let Q=0;const ie=[];for(;Q<O;){N=V();const Y=N.slice();ie.push(Y),Q+=N.length}return P(...ie)};return(Q,ie)=>{G(),J(Q);let Y;for(;!(Y=ie(Z()));)J();return G(),Y}}const M={bigint:q=>typeof q=="bigint",function:q=>typeof q=="function",boolean:q=>typeof q=="boolean",string:q=>typeof q=="string",stringOrUint8Array:q=>typeof q=="string"||n(q),isSafeInteger:q=>Number.isSafeInteger(q),array:q=>Array.isArray(q),field:(q,O)=>O.Fp.isValid(q),hash:q=>typeof q=="function"&&Number.isSafeInteger(q.outputLen)};function I(q,O,H={}){const N=(U,z,G)=>{const V=M[z];if(typeof V!="function")throw new Error("invalid validator function");const J=q[U];if(!(G&&J===void 0)&&!V(J,q))throw new Error("param "+String(U)+" is invalid. Expected "+z+", got "+J)};for(const[U,z]of Object.entries(O))N(U,z,!1);for(const[U,z]of Object.entries(H))N(U,z,!0);return q}const k=()=>{throw new Error("not implemented")};he.notImplemented=k;function B(q){const O=new WeakMap;return(H,...N)=>{const U=O.get(H);if(U!==void 0)return U;const z=q(H,...N);return O.set(H,z),z}}return he}var X0;function xu(){if(X0)return je;X0=1,Object.defineProperty(je,"__esModule",{value:!0}),je.isNegativeLE=void 0,je.mod=u,je.pow=l,je.pow2=f,je.invert=b,je.tonelliShanks=m,je.FpSqrt=E,je.validateField=P,je.FpPow=d,je.FpInvertBatch=j,je.FpDiv=g,je.FpLegendre=p,je.FpIsSquare=T,je.nLength=w,je.Field=A,je.FpSqrtOdd=C,je.FpSqrtEven=R,je.hashToPrivateScalar=S,je.getFieldBytesLength=x,je.getMinHashLength=F,je.mapHashToField=M;const e=or(),t=Dr(),n=BigInt(0),r=BigInt(1),o=BigInt(2),s=BigInt(3),i=BigInt(4),a=BigInt(5),c=BigInt(8);function u(I,k){const B=I%k;return B>=n?B:k+B}function l(I,k,B){return d(A(B),I,k)}function f(I,k,B){let q=I;for(;k-- >n;)q*=q,q%=B;return q}function b(I,k){if(I===n)throw new Error("invert: expected non-zero number");if(k<=n)throw new Error("invert: expected positive modulus, got "+k);let B=u(I,k),q=k,O=n,H=r;for(;B!==n;){const U=q/B,z=q%B,G=O-H*U;q=B,B=z,O=H,H=G}if(q!==r)throw new Error("invert: does not exist");return u(O,k)}function y(I,k){const B=(I.ORDER+r)/i,q=I.pow(k,B);if(!I.eql(I.sqr(q),k))throw new Error("Cannot find square root");return q}function h(I,k){const B=(I.ORDER-a)/c,q=I.mul(k,o),O=I.pow(q,B),H=I.mul(k,O),N=I.mul(I.mul(H,o),O),U=I.mul(H,I.sub(N,I.ONE));if(!I.eql(I.sqr(U),k))throw new Error("Cannot find square root");return U}function m(I){if(I<BigInt(3))throw new Error("sqrt is not defined for small field");let k=I-r,B=0;for(;k%o===n;)k/=o,B++;let q=o;const O=A(I);for(;p(O,q)===1;)if(q++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(B===1)return y;let H=O.pow(q,k);const N=(k+r)/o;return function(z,G){if(z.is0(G))return G;if(p(z,G)!==1)throw new Error("Cannot find square root");let V=B,J=z.mul(z.ONE,H),Z=z.pow(G,k),K=z.pow(G,N);for(;!z.eql(Z,z.ONE);){if(z.is0(Z))return z.ZERO;let Q=1,ie=z.sqr(Z);for(;!z.eql(ie,z.ONE);)if(Q++,ie=z.sqr(ie),Q===V)throw new Error("Cannot find square root");const Y=r<<BigInt(V-Q-1),X=z.pow(J,Y);V=Q,J=z.sqr(X),Z=z.mul(Z,J),K=z.mul(K,X)}return K}}function E(I){return I%i===s?y:I%c===a?h:m(I)}const v=(I,k)=>(u(I,k)&r)===r;je.isNegativeLE=v;const _=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function P(I){const k={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},B=_.reduce((q,O)=>(q[O]="function",q),k);return(0,t.validateObject)(I,B)}function d(I,k,B){if(B<n)throw new Error("invalid exponent, negatives unsupported");if(B===n)return I.ONE;if(B===r)return k;let q=I.ONE,O=k;for(;B>n;)B&r&&(q=I.mul(q,O)),O=I.sqr(O),B>>=r;return q}function j(I,k,B=!1){const q=new Array(k.length).fill(B?I.ZERO:void 0),O=k.reduce((N,U,z)=>I.is0(U)?N:(q[z]=N,I.mul(N,U)),I.ONE),H=I.inv(O);return k.reduceRight((N,U,z)=>I.is0(U)?N:(q[z]=I.mul(N,q[z]),I.mul(N,U)),H),q}function g(I,k,B){return I.mul(k,typeof B=="bigint"?b(B,I.ORDER):I.inv(B))}function p(I,k){const B=(I.ORDER-r)/o,q=I.pow(k,B),O=I.eql(q,I.ONE),H=I.eql(q,I.ZERO),N=I.eql(q,I.neg(I.ONE));if(!O&&!H&&!N)throw new Error("invalid Legendre symbol result");return O?1:H?0:-1}function T(I,k){return p(I,k)===1}function w(I,k){k!==void 0&&(0,e.anumber)(k);const B=k!==void 0?k:I.toString(2).length,q=Math.ceil(B/8);return{nBitLength:B,nByteLength:q}}function A(I,k,B=!1,q={}){if(I<=n)throw new Error("invalid field: expected ORDER > 0, got "+I);const{nBitLength:O,nByteLength:H}=w(I,k);if(H>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let N;const U=Object.freeze({ORDER:I,isLE:B,BITS:O,BYTES:H,MASK:(0,t.bitMask)(O),ZERO:n,ONE:r,create:z=>u(z,I),isValid:z=>{if(typeof z!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof z);return n<=z&&z<I},is0:z=>z===n,isOdd:z=>(z&r)===r,neg:z=>u(-z,I),eql:(z,G)=>z===G,sqr:z=>u(z*z,I),add:(z,G)=>u(z+G,I),sub:(z,G)=>u(z-G,I),mul:(z,G)=>u(z*G,I),pow:(z,G)=>d(U,z,G),div:(z,G)=>u(z*b(G,I),I),sqrN:z=>z*z,addN:(z,G)=>z+G,subN:(z,G)=>z-G,mulN:(z,G)=>z*G,inv:z=>b(z,I),sqrt:q.sqrt||(z=>(N||(N=E(I)),N(U,z))),toBytes:z=>B?(0,t.numberToBytesLE)(z,H):(0,t.numberToBytesBE)(z,H),fromBytes:z=>{if(z.length!==H)throw new Error("Field.fromBytes: expected "+H+" bytes, got "+z.length);return B?(0,t.bytesToNumberLE)(z):(0,t.bytesToNumberBE)(z)},invertBatch:z=>j(U,z),cmov:(z,G,V)=>V?G:z});return Object.freeze(U)}function C(I,k){if(!I.isOdd)throw new Error("Field doesn't have isOdd");const B=I.sqrt(k);return I.isOdd(B)?B:I.neg(B)}function R(I,k){if(!I.isOdd)throw new Error("Field doesn't have isOdd");const B=I.sqrt(k);return I.isOdd(B)?I.neg(B):B}function S(I,k,B=!1){I=(0,t.ensureBytes)("privateHash",I);const q=I.length,O=w(k).nByteLength+8;if(O<24||q<O||q>1024)throw new Error("hashToPrivateScalar: expected "+O+"-1024 bytes of input, got "+q);const H=B?(0,t.bytesToNumberLE)(I):(0,t.bytesToNumberBE)(I);return u(H,k-r)+r}function x(I){if(typeof I!="bigint")throw new Error("field order must be bigint");const k=I.toString(2).length;return Math.ceil(k/8)}function F(I){const k=x(I);return k+Math.ceil(k/2)}function M(I,k,B=!1){const q=I.length,O=x(k),H=F(k);if(q<16||q<H||q>1024)throw new Error("expected "+H+"-1024 bytes of input, got "+q);const N=B?(0,t.bytesToNumberLE)(I):(0,t.bytesToNumberBE)(I),U=u(N,k-r)+r;return B?(0,t.numberToBytesLE)(U,O):(0,t.numberToBytesBE)(U,O)}return je}var Q0;function Fv(){if(Q0)return Ar;Q0=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.wNAF=y,Ar.pippenger=h,Ar.precomputeMSMUnsafe=m,Ar.validateBasic=E;const e=xu(),t=Dr(),n=BigInt(0),r=BigInt(1);function o(v,_){const P=_.negate();return v?P:_}function s(v,_){if(!Number.isSafeInteger(v)||v<=0||v>_)throw new Error("invalid window size, expected [1.."+_+"], got W="+v)}function i(v,_){s(v,_);const P=Math.ceil(_/v)+1,d=2**(v-1),j=2**v,g=(0,t.bitMask)(v),p=BigInt(v);return{windows:P,windowSize:d,mask:g,maxNumber:j,shiftBy:p}}function a(v,_,P){const{windowSize:d,mask:j,maxNumber:g,shiftBy:p}=P;let T=Number(v&j),w=v>>p;T>d&&(T-=g,w+=r);const A=_*d,C=A+Math.abs(T)-1,R=T===0,S=T<0,x=_%2!==0;return{nextN:w,offset:C,isZero:R,isNeg:S,isNegF:x,offsetF:A}}function c(v,_){if(!Array.isArray(v))throw new Error("array expected");v.forEach((P,d)=>{if(!(P instanceof _))throw new Error("invalid point at index "+d)})}function u(v,_){if(!Array.isArray(v))throw new Error("array of scalars expected");v.forEach((P,d)=>{if(!_.isValid(P))throw new Error("invalid scalar at index "+d)})}const l=new WeakMap,f=new WeakMap;function b(v){return f.get(v)||1}function y(v,_){return{constTimeNegate:o,hasPrecomputes(P){return b(P)!==1},unsafeLadder(P,d,j=v.ZERO){let g=P;for(;d>n;)d&r&&(j=j.add(g)),g=g.double(),d>>=r;return j},precomputeWindow(P,d){const{windows:j,windowSize:g}=i(d,_),p=[];let T=P,w=T;for(let A=0;A<j;A++){w=T,p.push(w);for(let C=1;C<g;C++)w=w.add(T),p.push(w);T=w.double()}return p},wNAF(P,d,j){let g=v.ZERO,p=v.BASE;const T=i(P,_);for(let w=0;w<T.windows;w++){const{nextN:A,offset:C,isZero:R,isNeg:S,isNegF:x,offsetF:F}=a(j,w,T);j=A,R?p=p.add(o(x,d[F])):g=g.add(o(S,d[C]))}return{p:g,f:p}},wNAFUnsafe(P,d,j,g=v.ZERO){const p=i(P,_);for(let T=0;T<p.windows&&j!==n;T++){const{nextN:w,offset:A,isZero:C,isNeg:R}=a(j,T,p);if(j=w,!C){const S=d[A];g=g.add(R?S.negate():S)}}return g},getPrecomputes(P,d,j){let g=l.get(d);return g||(g=this.precomputeWindow(d,P),P!==1&&l.set(d,j(g))),g},wNAFCached(P,d,j){const g=b(P);return this.wNAF(g,this.getPrecomputes(g,P,j),d)},wNAFCachedUnsafe(P,d,j,g){const p=b(P);return p===1?this.unsafeLadder(P,d,g):this.wNAFUnsafe(p,this.getPrecomputes(p,P,j),d,g)},setWindowSize(P,d){s(d,_),f.set(P,d),l.delete(P)}}}function h(v,_,P,d){c(P,v),u(d,_);const j=P.length,g=d.length;if(j!==g)throw new Error("arrays of points and scalars must have equal length");const p=v.ZERO,T=(0,t.bitLen)(BigInt(j));let w=1;T>12?w=T-3:T>4?w=T-2:T>0&&(w=2);const A=(0,t.bitMask)(w),C=new Array(Number(A)+1).fill(p),R=Math.floor((_.BITS-1)/w)*w;let S=p;for(let x=R;x>=0;x-=w){C.fill(p);for(let M=0;M<g;M++){const I=d[M],k=Number(I>>BigInt(x)&A);C[k]=C[k].add(P[M])}let F=p;for(let M=C.length-1,I=p;M>0;M--)I=I.add(C[M]),F=F.add(I);if(S=S.add(F),x!==0)for(let M=0;M<w;M++)S=S.double()}return S}function m(v,_,P,d){s(d,_.BITS),c(P,v);const j=v.ZERO,g=2**d-1,p=Math.ceil(_.BITS/d),T=(0,t.bitMask)(d),w=P.map(A=>{const C=[];for(let R=0,S=A;R<g;R++)C.push(S),S=S.add(A);return C});return A=>{if(u(A,_),A.length>P.length)throw new Error("array of scalars must be smaller than array of points");let C=j;for(let R=0;R<p;R++){if(C!==j)for(let x=0;x<d;x++)C=C.double();const S=BigInt(p*d-(R+1)*d);for(let x=0;x<A.length;x++){const F=A[x],M=Number(F>>S&T);M&&(C=C.add(w[x][M-1]))}}return C}}function E(v){return(0,e.validateField)(v.Fp),(0,t.validateObject)(v,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(v.n,v.nBitLength),...v,p:v.Fp.ORDER})}return Ar}var $0;function og(){return $0||($0=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=e.DERErr=void 0,e.weierstrassPoints=y,e.weierstrass=m,e.SWUFpSqrtRatio=E,e.mapToCurveSimpleSWU=v;const t=Fv(),n=xu(),r=Dr();function o(_){_.lowS!==void 0&&(0,r.abool)("lowS",_.lowS),_.prehash!==void 0&&(0,r.abool)("prehash",_.prehash)}function s(_){const P=(0,t.validateBasic)(_);(0,r.validateObject)(P,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:d,Fp:j,a:g}=P;if(d){if(!j.eql(g,j.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof d!="object"||typeof d.beta!="bigint"||typeof d.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...P})}class i extends Error{constructor(P=""){super(P)}}e.DERErr=i,e.DER={Err:i,_tlv:{encode:(_,P)=>{const{Err:d}=e.DER;if(_<0||_>256)throw new d("tlv.encode: wrong tag");if(P.length&1)throw new d("tlv.encode: unpadded data");const j=P.length/2,g=(0,r.numberToHexUnpadded)(j);if(g.length/2&128)throw new d("tlv.encode: long form length too big");const p=j>127?(0,r.numberToHexUnpadded)(g.length/2|128):"";return(0,r.numberToHexUnpadded)(_)+p+g+P},decode(_,P){const{Err:d}=e.DER;let j=0;if(_<0||_>256)throw new d("tlv.encode: wrong tag");if(P.length<2||P[j++]!==_)throw new d("tlv.decode: wrong tlv");const g=P[j++],p=!!(g&128);let T=0;if(!p)T=g;else{const A=g&127;if(!A)throw new d("tlv.decode(long): indefinite length not supported");if(A>4)throw new d("tlv.decode(long): byte length is too big");const C=P.subarray(j,j+A);if(C.length!==A)throw new d("tlv.decode: length bytes not complete");if(C[0]===0)throw new d("tlv.decode(long): zero leftmost byte");for(const R of C)T=T<<8|R;if(j+=A,T<128)throw new d("tlv.decode(long): not minimal encoding")}const w=P.subarray(j,j+T);if(w.length!==T)throw new d("tlv.decode: wrong value length");return{v:w,l:P.subarray(j+T)}}},_int:{encode(_){const{Err:P}=e.DER;if(_<c)throw new P("integer: negative integers are not allowed");let d=(0,r.numberToHexUnpadded)(_);if(Number.parseInt(d[0],16)&8&&(d="00"+d),d.length&1)throw new P("unexpected DER parsing assertion: unpadded hex");return d},decode(_){const{Err:P}=e.DER;if(_[0]&128)throw new P("invalid signature integer: negative");if(_[0]===0&&!(_[1]&128))throw new P("invalid signature integer: unnecessary leading zero");return(0,r.bytesToNumberBE)(_)}},toSig(_){const{Err:P,_int:d,_tlv:j}=e.DER,g=(0,r.ensureBytes)("signature",_),{v:p,l:T}=j.decode(48,g);if(T.length)throw new P("invalid signature: left bytes after parsing");const{v:w,l:A}=j.decode(2,p),{v:C,l:R}=j.decode(2,A);if(R.length)throw new P("invalid signature: left bytes after parsing");return{r:d.decode(w),s:d.decode(C)}},hexFromSig(_){const{_tlv:P,_int:d}=e.DER,j=P.encode(2,d.encode(_.r)),g=P.encode(2,d.encode(_.s)),p=j+g;return P.encode(48,p)}};function a(_,P){return(0,r.bytesToHex)((0,r.numberToBytesBE)(_,P))}const c=BigInt(0),u=BigInt(1),l=BigInt(2),f=BigInt(3),b=BigInt(4);function y(_){const P=s(_),{Fp:d}=P,j=(0,n.Field)(P.n,P.nBitLength),g=P.toBytes||((O,H,N)=>{const U=H.toAffine();return(0,r.concatBytes)(Uint8Array.from([4]),d.toBytes(U.x),d.toBytes(U.y))}),p=P.fromBytes||(O=>{const H=O.subarray(1),N=d.fromBytes(H.subarray(0,d.BYTES)),U=d.fromBytes(H.subarray(d.BYTES,2*d.BYTES));return{x:N,y:U}});function T(O){const{a:H,b:N}=P,U=d.sqr(O),z=d.mul(U,O);return d.add(d.add(z,d.mul(O,H)),N)}function w(O,H){const N=d.sqr(H),U=T(O);return d.eql(N,U)}if(!w(P.Gx,P.Gy))throw new Error("bad curve params: generator point");const A=d.mul(d.pow(P.a,f),b),C=d.mul(d.sqr(P.b),BigInt(27));if(d.is0(d.add(A,C)))throw new Error("bad curve params: a or b");function R(O){return(0,r.inRange)(O,u,P.n)}function S(O){const{allowedPrivateKeyLengths:H,nByteLength:N,wrapPrivateKey:U,n:z}=P;if(H&&typeof O!="bigint"){if((0,r.isBytes)(O)&&(O=(0,r.bytesToHex)(O)),typeof O!="string"||!H.includes(O.length))throw new Error("invalid private key");O=O.padStart(N*2,"0")}let G;try{G=typeof O=="bigint"?O:(0,r.bytesToNumberBE)((0,r.ensureBytes)("private key",O,N))}catch{throw new Error("invalid private key, expected hex or "+N+" bytes, got "+typeof O)}return U&&(G=(0,n.mod)(G,z)),(0,r.aInRange)("private key",G,u,z),G}function x(O){if(!(O instanceof I))throw new Error("ProjectivePoint expected")}const F=(0,r.memoized)((O,H)=>{const{px:N,py:U,pz:z}=O;if(d.eql(z,d.ONE))return{x:N,y:U};const G=O.is0();H==null&&(H=G?d.ONE:d.inv(z));const V=d.mul(N,H),J=d.mul(U,H),Z=d.mul(z,H);if(G)return{x:d.ZERO,y:d.ZERO};if(!d.eql(Z,d.ONE))throw new Error("invZ was invalid");return{x:V,y:J}}),M=(0,r.memoized)(O=>{if(O.is0()){if(P.allowInfinityPoint&&!d.is0(O.py))return;throw new Error("bad point: ZERO")}const{x:H,y:N}=O.toAffine();if(!d.isValid(H)||!d.isValid(N))throw new Error("bad point: x or y not FE");if(!w(H,N))throw new Error("bad point: equation left != right");if(!O.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class I{constructor(H,N,U){if(H==null||!d.isValid(H))throw new Error("x required");if(N==null||!d.isValid(N)||d.is0(N))throw new Error("y required");if(U==null||!d.isValid(U))throw new Error("z required");this.px=H,this.py=N,this.pz=U,Object.freeze(this)}static fromAffine(H){const{x:N,y:U}=H||{};if(!H||!d.isValid(N)||!d.isValid(U))throw new Error("invalid affine point");if(H instanceof I)throw new Error("projective point not allowed");const z=G=>d.eql(G,d.ZERO);return z(N)&&z(U)?I.ZERO:new I(N,U,d.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(H){const N=(0,n.FpInvertBatch)(d,H.map(U=>U.pz));return H.map((U,z)=>U.toAffine(N[z])).map(I.fromAffine)}static fromHex(H){const N=I.fromAffine(p((0,r.ensureBytes)("pointHex",H)));return N.assertValidity(),N}static fromPrivateKey(H){return I.BASE.multiply(S(H))}static msm(H,N){return(0,t.pippenger)(I,j,H,N)}_setWindowSize(H){q.setWindowSize(this,H)}assertValidity(){M(this)}hasEvenY(){const{y:H}=this.toAffine();if(d.isOdd)return!d.isOdd(H);throw new Error("Field doesn't support isOdd")}equals(H){x(H);const{px:N,py:U,pz:z}=this,{px:G,py:V,pz:J}=H,Z=d.eql(d.mul(N,J),d.mul(G,z)),K=d.eql(d.mul(U,J),d.mul(V,z));return Z&&K}negate(){return new I(this.px,d.neg(this.py),this.pz)}double(){const{a:H,b:N}=P,U=d.mul(N,f),{px:z,py:G,pz:V}=this;let J=d.ZERO,Z=d.ZERO,K=d.ZERO,Q=d.mul(z,z),ie=d.mul(G,G),Y=d.mul(V,V),X=d.mul(z,G);return X=d.add(X,X),K=d.mul(z,V),K=d.add(K,K),J=d.mul(H,K),Z=d.mul(U,Y),Z=d.add(J,Z),J=d.sub(ie,Z),Z=d.add(ie,Z),Z=d.mul(J,Z),J=d.mul(X,J),K=d.mul(U,K),Y=d.mul(H,Y),X=d.sub(Q,Y),X=d.mul(H,X),X=d.add(X,K),K=d.add(Q,Q),Q=d.add(K,Q),Q=d.add(Q,Y),Q=d.mul(Q,X),Z=d.add(Z,Q),Y=d.mul(G,V),Y=d.add(Y,Y),Q=d.mul(Y,X),J=d.sub(J,Q),K=d.mul(Y,ie),K=d.add(K,K),K=d.add(K,K),new I(J,Z,K)}add(H){x(H);const{px:N,py:U,pz:z}=this,{px:G,py:V,pz:J}=H;let Z=d.ZERO,K=d.ZERO,Q=d.ZERO;const ie=P.a,Y=d.mul(P.b,f);let X=d.mul(N,G),ee=d.mul(U,V),ae=d.mul(z,J),oe=d.add(N,U),se=d.add(G,V);oe=d.mul(oe,se),se=d.add(X,ee),oe=d.sub(oe,se),se=d.add(N,z);let fe=d.add(G,J);return se=d.mul(se,fe),fe=d.add(X,ae),se=d.sub(se,fe),fe=d.add(U,z),Z=d.add(V,J),fe=d.mul(fe,Z),Z=d.add(ee,ae),fe=d.sub(fe,Z),Q=d.mul(ie,se),Z=d.mul(Y,ae),Q=d.add(Z,Q),Z=d.sub(ee,Q),Q=d.add(ee,Q),K=d.mul(Z,Q),ee=d.add(X,X),ee=d.add(ee,X),ae=d.mul(ie,ae),se=d.mul(Y,se),ee=d.add(ee,ae),ae=d.sub(X,ae),ae=d.mul(ie,ae),se=d.add(se,ae),X=d.mul(ee,se),K=d.add(K,X),X=d.mul(fe,se),Z=d.mul(oe,Z),Z=d.sub(Z,X),X=d.mul(oe,ee),Q=d.mul(fe,Q),Q=d.add(Q,X),new I(Z,K,Q)}subtract(H){return this.add(H.negate())}is0(){return this.equals(I.ZERO)}wNAF(H){return q.wNAFCached(this,H,I.normalizeZ)}multiplyUnsafe(H){const{endo:N,n:U}=P;(0,r.aInRange)("scalar",H,c,U);const z=I.ZERO;if(H===c)return z;if(this.is0()||H===u)return this;if(!N||q.hasPrecomputes(this))return q.wNAFCachedUnsafe(this,H,I.normalizeZ);let{k1neg:G,k1:V,k2neg:J,k2:Z}=N.splitScalar(H),K=z,Q=z,ie=this;for(;V>c||Z>c;)V&u&&(K=K.add(ie)),Z&u&&(Q=Q.add(ie)),ie=ie.double(),V>>=u,Z>>=u;return G&&(K=K.negate()),J&&(Q=Q.negate()),Q=new I(d.mul(Q.px,N.beta),Q.py,Q.pz),K.add(Q)}multiply(H){const{endo:N,n:U}=P;(0,r.aInRange)("scalar",H,u,U);let z,G;if(N){const{k1neg:V,k1:J,k2neg:Z,k2:K}=N.splitScalar(H);let{p:Q,f:ie}=this.wNAF(J),{p:Y,f:X}=this.wNAF(K);Q=q.constTimeNegate(V,Q),Y=q.constTimeNegate(Z,Y),Y=new I(d.mul(Y.px,N.beta),Y.py,Y.pz),z=Q.add(Y),G=ie.add(X)}else{const{p:V,f:J}=this.wNAF(H);z=V,G=J}return I.normalizeZ([z,G])[0]}multiplyAndAddUnsafe(H,N,U){const z=I.BASE,G=(J,Z)=>Z===c||Z===u||!J.equals(z)?J.multiplyUnsafe(Z):J.multiply(Z),V=G(this,N).add(G(H,U));return V.is0()?void 0:V}toAffine(H){return F(this,H)}isTorsionFree(){const{h:H,isTorsionFree:N}=P;if(H===u)return!0;if(N)return N(I,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:H,clearCofactor:N}=P;return H===u?this:N?N(I,this):this.multiplyUnsafe(P.h)}toRawBytes(H=!0){return(0,r.abool)("isCompressed",H),this.assertValidity(),g(I,this,H)}toHex(H=!0){return(0,r.abool)("isCompressed",H),(0,r.bytesToHex)(this.toRawBytes(H))}}I.BASE=new I(P.Gx,P.Gy,d.ONE),I.ZERO=new I(d.ZERO,d.ONE,d.ZERO);const{endo:k,nBitLength:B}=P,q=(0,t.wNAF)(I,k?Math.ceil(B/2):B);return{CURVE:P,ProjectivePoint:I,normPrivateKeyToScalar:S,weierstrassEquation:T,isWithinCurveOrder:R}}function h(_){const P=(0,t.validateBasic)(_);return(0,r.validateObject)(P,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...P})}function m(_){const P=h(_),{Fp:d,n:j,nByteLength:g,nBitLength:p}=P,T=d.BYTES+1,w=2*d.BYTES+1;function A(Y){return(0,n.mod)(Y,j)}function C(Y){return(0,n.invert)(Y,j)}const{ProjectivePoint:R,normPrivateKeyToScalar:S,weierstrassEquation:x,isWithinCurveOrder:F}=y({...P,toBytes(Y,X,ee){const ae=X.toAffine(),oe=d.toBytes(ae.x),se=r.concatBytes;return(0,r.abool)("isCompressed",ee),ee?se(Uint8Array.from([X.hasEvenY()?2:3]),oe):se(Uint8Array.from([4]),oe,d.toBytes(ae.y))},fromBytes(Y){const X=Y.length,ee=Y[0],ae=Y.subarray(1);if(X===T&&(ee===2||ee===3)){const oe=(0,r.bytesToNumberBE)(ae);if(!(0,r.inRange)(oe,u,d.ORDER))throw new Error("Point is not on curve");const se=x(oe);let fe;try{fe=d.sqrt(se)}catch(we){const Be=we instanceof Error?": "+we.message:"";throw new Error("Point is not on curve"+Be)}const $=(fe&u)===u;return(ee&1)===1!==$&&(fe=d.neg(fe)),{x:oe,y:fe}}else if(X===w&&ee===4){const oe=d.fromBytes(ae.subarray(0,d.BYTES)),se=d.fromBytes(ae.subarray(d.BYTES,2*d.BYTES));return{x:oe,y:se}}else{const oe=T,se=w;throw new Error("invalid Point, expected length of "+oe+", or uncompressed "+se+", got "+X)}}});function M(Y){const X=j>>u;return Y>X}function I(Y){return M(Y)?A(-Y):Y}const k=(Y,X,ee)=>(0,r.bytesToNumberBE)(Y.slice(X,ee));class B{constructor(X,ee,ae){(0,r.aInRange)("r",X,u,j),(0,r.aInRange)("s",ee,u,j),this.r=X,this.s=ee,ae!=null&&(this.recovery=ae),Object.freeze(this)}static fromCompact(X){const ee=g;return X=(0,r.ensureBytes)("compactSignature",X,ee*2),new B(k(X,0,ee),k(X,ee,2*ee))}static fromDER(X){const{r:ee,s:ae}=e.DER.toSig((0,r.ensureBytes)("DER",X));return new B(ee,ae)}assertValidity(){}addRecoveryBit(X){return new B(this.r,this.s,X)}recoverPublicKey(X){const{r:ee,s:ae,recovery:oe}=this,se=z((0,r.ensureBytes)("msgHash",X));if(oe==null||![0,1,2,3].includes(oe))throw new Error("recovery id invalid");const fe=oe===2||oe===3?ee+P.n:ee;if(fe>=d.ORDER)throw new Error("recovery id 2 or 3 invalid");const $=(oe&1)===0?"02":"03",W=R.fromHex($+a(fe,d.BYTES)),we=C(fe),Be=A(-se*we),st=A(ae*we),qe=R.BASE.multiplyAndAddUnsafe(W,Be,st);if(!qe)throw new Error("point at infinify");return qe.assertValidity(),qe}hasHighS(){return M(this.s)}normalizeS(){return this.hasHighS()?new B(this.r,A(-this.s),this.recovery):this}toDERRawBytes(){return(0,r.hexToBytes)(this.toDERHex())}toDERHex(){return e.DER.hexFromSig(this)}toCompactRawBytes(){return(0,r.hexToBytes)(this.toCompactHex())}toCompactHex(){const X=g;return a(this.r,X)+a(this.s,X)}}const q={isValidPrivateKey(Y){try{return S(Y),!0}catch{return!1}},normPrivateKeyToScalar:S,randomPrivateKey:()=>{const Y=(0,n.getMinHashLength)(P.n);return(0,n.mapHashToField)(P.randomBytes(Y),P.n)},precompute(Y=8,X=R.BASE){return X._setWindowSize(Y),X.multiply(BigInt(3)),X}};function O(Y,X=!0){return R.fromPrivateKey(Y).toRawBytes(X)}function H(Y){if(typeof Y=="bigint")return!1;if(Y instanceof R)return!0;const ee=(0,r.ensureBytes)("key",Y).length,ae=d.BYTES,oe=ae+1,se=2*ae+1;if(!(P.allowedPrivateKeyLengths||g===oe))return ee===oe||ee===se}function N(Y,X,ee=!0){if(H(Y)===!0)throw new Error("first arg must be private key");if(H(X)===!1)throw new Error("second arg must be public key");return R.fromHex(X).multiply(S(Y)).toRawBytes(ee)}const U=P.bits2int||function(Y){if(Y.length>8192)throw new Error("input is too large");const X=(0,r.bytesToNumberBE)(Y),ee=Y.length*8-p;return ee>0?X>>BigInt(ee):X},z=P.bits2int_modN||function(Y){return A(U(Y))},G=(0,r.bitMask)(p);function V(Y){return(0,r.aInRange)("num < 2^"+p,Y,c,G),(0,r.numberToBytesBE)(Y,g)}function J(Y,X,ee=Z){if(["recovered","canonical"].some(Ge=>Ge in ee))throw new Error("sign() legacy options not supported");const{hash:ae,randomBytes:oe}=P;let{lowS:se,prehash:fe,extraEntropy:$}=ee;se==null&&(se=!0),Y=(0,r.ensureBytes)("msgHash",Y),o(ee),fe&&(Y=(0,r.ensureBytes)("prehashed msgHash",ae(Y)));const W=z(Y),we=S(X),Be=[V(we),V(W)];if($!=null&&$!==!1){const Ge=$===!0?oe(d.BYTES):$;Be.push((0,r.ensureBytes)("extraEntropy",Ge))}const st=(0,r.concatBytes)(...Be),qe=W;function ct(Ge){const xe=U(Ge);if(!F(xe))return;const Zt=C(xe),jt=R.BASE.multiply(xe).toAffine(),ut=A(jt.x);if(ut===c)return;const wt=A(Zt*A(qe+ut*we));if(wt===c)return;let dt=(jt.x===ut?0:2)|Number(jt.y&u),hr=wt;return se&&M(wt)&&(hr=I(wt),dt^=1),new B(ut,hr,dt)}return{seed:st,k2sig:ct}}const Z={lowS:P.lowS,prehash:!1},K={lowS:P.lowS,prehash:!1};function Q(Y,X,ee=Z){const{seed:ae,k2sig:oe}=J(Y,X,ee),se=P;return(0,r.createHmacDrbg)(se.hash.outputLen,se.nByteLength,se.hmac)(ae,oe)}R.BASE._setWindowSize(8);function ie(Y,X,ee,ae=K){const oe=Y;X=(0,r.ensureBytes)("msgHash",X),ee=(0,r.ensureBytes)("publicKey",ee);const{lowS:se,prehash:fe,format:$}=ae;if(o(ae),"strict"in ae)throw new Error("options.strict was renamed to lowS");if($!==void 0&&$!=="compact"&&$!=="der")throw new Error("format must be compact or der");const W=typeof oe=="string"||(0,r.isBytes)(oe),we=!W&&!$&&typeof oe=="object"&&oe!==null&&typeof oe.r=="bigint"&&typeof oe.s=="bigint";if(!W&&!we)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let Be,st;try{if(we&&(Be=new B(oe.r,oe.s)),W){try{$!=="compact"&&(Be=B.fromDER(oe))}catch(dt){if(!(dt instanceof e.DER.Err))throw dt}!Be&&$!=="der"&&(Be=B.fromCompact(oe))}st=R.fromHex(ee)}catch{return!1}if(!Be||se&&Be.hasHighS())return!1;fe&&(X=P.hash(X));const{r:qe,s:ct}=Be,Ge=z(X),xe=C(ct),Zt=A(Ge*xe),jt=A(qe*xe),ut=R.BASE.multiplyAndAddUnsafe(st,Zt,jt)?.toAffine();return ut?A(ut.x)===qe:!1}return{CURVE:P,getPublicKey:O,getSharedSecret:N,sign:Q,verify:ie,ProjectivePoint:R,Signature:B,utils:q}}function E(_,P){const d=_.ORDER;let j=c;for(let M=d-u;M%l===c;M/=l)j+=u;const g=j,p=l<<g-u-u,T=p*l,w=(d-u)/T,A=(w-u)/l,C=T-u,R=p,S=_.pow(P,w),x=_.pow(P,(w+u)/l);let F=(M,I)=>{let k=S,B=_.pow(I,C),q=_.sqr(B);q=_.mul(q,I);let O=_.mul(M,q);O=_.pow(O,A),O=_.mul(O,B),B=_.mul(O,I),q=_.mul(O,M);let H=_.mul(q,B);O=_.pow(H,R);let N=_.eql(O,_.ONE);B=_.mul(q,x),O=_.mul(H,k),q=_.cmov(B,q,N),H=_.cmov(O,H,N);for(let U=g;U>u;U--){let z=U-l;z=l<<z-u;let G=_.pow(H,z);const V=_.eql(G,_.ONE);B=_.mul(q,k),k=_.mul(k,k),G=_.mul(H,k),q=_.cmov(B,q,V),H=_.cmov(G,H,V)}return{isValid:N,value:q}};if(_.ORDER%b===f){const M=(_.ORDER-f)/b,I=_.sqrt(_.neg(P));F=(k,B)=>{let q=_.sqr(B);const O=_.mul(k,B);q=_.mul(q,O);let H=_.pow(q,M);H=_.mul(H,O);const N=_.mul(H,I),U=_.mul(_.sqr(H),B),z=_.eql(U,k);let G=_.cmov(N,H,z);return{isValid:z,value:G}}}return F}function v(_,P){if((0,n.validateField)(_),!_.isValid(P.A)||!_.isValid(P.B)||!_.isValid(P.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const d=E(_,P.Z);if(!_.isOdd)throw new Error("Fp.isOdd is not implemented!");return j=>{let g,p,T,w,A,C,R,S;g=_.sqr(j),g=_.mul(g,P.Z),p=_.sqr(g),p=_.add(p,g),T=_.add(p,_.ONE),T=_.mul(T,P.B),w=_.cmov(P.Z,_.neg(p),!_.eql(p,_.ZERO)),w=_.mul(w,P.A),p=_.sqr(T),C=_.sqr(w),A=_.mul(C,P.A),p=_.add(p,A),p=_.mul(p,T),C=_.mul(C,w),A=_.mul(C,P.B),p=_.add(p,A),R=_.mul(g,T);const{isValid:x,value:F}=d(p,C);S=_.mul(g,j),S=_.mul(S,F),R=_.cmov(R,T,x),S=_.cmov(S,F,x);const M=_.isOdd(j)===_.isOdd(S);S=_.cmov(_.neg(S),S,M);const I=(0,n.FpInvertBatch)(_,[w],!0)[0];return R=_.mul(R,I),{x:R,y:S}}}})(Td)),Td}var eb;function Nv(){if(eb)return $n;eb=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.getHash=r,$n.createCurve=o;const e=kv(),t=or(),n=og();function r(s){return{hash:s,hmac:(i,...a)=>(0,e.hmac)(s,i,(0,t.concatBytes)(...a)),randomBytes:t.randomBytes}}function o(s,i){const a=c=>(0,n.weierstrass)({...s,...r(c)});return{...a(i),create:a}}return $n}var Qt={},tb;function zv(){if(tb)return Qt;tb=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.expand_message_xmd=i,Qt.expand_message_xof=a,Qt.hash_to_field=c,Qt.isogenyMap=u,Qt.createHasher=l;const e=xu(),t=Dr(),n=t.bytesToNumberBE;function r(f,b){if(s(f),s(b),f<0||f>=1<<8*b)throw new Error("invalid I2OSP input: "+f);const y=Array.from({length:b}).fill(0);for(let h=b-1;h>=0;h--)y[h]=f&255,f>>>=8;return new Uint8Array(y)}function o(f,b){const y=new Uint8Array(f.length);for(let h=0;h<f.length;h++)y[h]=f[h]^b[h];return y}function s(f){if(!Number.isSafeInteger(f))throw new Error("number expected")}function i(f,b,y,h){(0,t.abytes)(f),(0,t.abytes)(b),s(y),b.length>255&&(b=h((0,t.concatBytes)((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-"),b)));const{outputLen:m,blockLen:E}=h,v=Math.ceil(y/m);if(y>65535||v>255)throw new Error("expand_message_xmd: invalid lenInBytes");const _=(0,t.concatBytes)(b,r(b.length,1)),P=r(0,E),d=r(y,2),j=new Array(v),g=h((0,t.concatBytes)(P,f,d,r(0,1),_));j[0]=h((0,t.concatBytes)(g,r(1,1),_));for(let T=1;T<=v;T++){const w=[o(g,j[T-1]),r(T+1,1),_];j[T]=h((0,t.concatBytes)(...w))}return(0,t.concatBytes)(...j).slice(0,y)}function a(f,b,y,h,m){if((0,t.abytes)(f),(0,t.abytes)(b),s(y),b.length>255){const E=Math.ceil(2*h/8);b=m.create({dkLen:E}).update((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(b).digest()}if(y>65535||b.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return m.create({dkLen:y}).update(f).update(r(y,2)).update(b).update(r(b.length,1)).digest()}function c(f,b,y){(0,t.validateObject)(y,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:h,k:m,m:E,hash:v,expand:_,DST:P}=y;(0,t.abytes)(f),s(b);const d=typeof P=="string"?(0,t.utf8ToBytes)(P):P,j=h.toString(2).length,g=Math.ceil((j+m)/8),p=b*E*g;let T;if(_==="xmd")T=i(f,d,p,v);else if(_==="xof")T=a(f,d,p,m,v);else if(_==="_internal_pass")T=f;else throw new Error('expand must be "xmd" or "xof"');const w=new Array(b);for(let A=0;A<b;A++){const C=new Array(E);for(let R=0;R<E;R++){const S=g*(R+A*E),x=T.subarray(S,S+g);C[R]=(0,e.mod)(n(x),h)}w[A]=C}return w}function u(f,b){const y=b.map(h=>Array.from(h).reverse());return(h,m)=>{const[E,v,_,P]=y.map(g=>g.reduce((p,T)=>f.add(f.mul(p,h),T))),[d,j]=(0,e.FpInvertBatch)(f,[v,P],!0);return h=f.mul(E,d),m=f.mul(m,f.mul(_,j)),{x:h,y:m}}}function l(f,b,y){if(typeof b!="function")throw new Error("mapToCurve() must be defined");function h(E){return f.fromAffine(b(E))}function m(E){const v=E.clearCofactor();return v.equals(f.ZERO)?f.ZERO:(v.assertValidity(),v)}return{defaults:y,hashToCurve(E,v){const _=c(E,2,{...y,DST:y.DST,...v}),P=h(_[0]),d=h(_[1]);return m(P.add(d))},encodeToCurve(E,v){const _=c(E,1,{...y,DST:y.encodeDST,...v});return m(h(_[0]))},mapToCurve(E){if(!Array.isArray(E))throw new Error("expected array of bigints");for(const v of E)if(typeof v!="bigint")throw new Error("expected array of bigints");return m(h(E))}}}return Qt}var rb;function Gr(){return rb||(rb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.secp256k1_hasher=e.schnorr=e.secp256k1=void 0;const t=ng(),n=or(),r=Nv(),o=zv(),s=xu(),i=Dr(),a=og(),c=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),u=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(0),f=BigInt(1),b=BigInt(2),y=(I,k)=>(I+k/b)/k;function h(I){const k=c,B=BigInt(3),q=BigInt(6),O=BigInt(11),H=BigInt(22),N=BigInt(23),U=BigInt(44),z=BigInt(88),G=I*I*I%k,V=G*G*I%k,J=(0,s.pow2)(V,B,k)*V%k,Z=(0,s.pow2)(J,B,k)*V%k,K=(0,s.pow2)(Z,b,k)*G%k,Q=(0,s.pow2)(K,O,k)*K%k,ie=(0,s.pow2)(Q,H,k)*Q%k,Y=(0,s.pow2)(ie,U,k)*ie%k,X=(0,s.pow2)(Y,z,k)*Y%k,ee=(0,s.pow2)(X,U,k)*ie%k,ae=(0,s.pow2)(ee,B,k)*V%k,oe=(0,s.pow2)(ae,N,k)*Q%k,se=(0,s.pow2)(oe,q,k)*G%k,fe=(0,s.pow2)(se,b,k);if(!m.eql(m.sqr(fe),I))throw new Error("Cannot find square root");return fe}const m=(0,s.Field)(c,void 0,void 0,{sqrt:h});e.secp256k1=(0,r.createCurve)({a:l,b:BigInt(7),Fp:m,n:u,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:I=>{const k=u,B=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),q=-f*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),O=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),H=B,N=BigInt("0x100000000000000000000000000000000"),U=y(H*I,k),z=y(-q*I,k);let G=(0,s.mod)(I-U*B-z*O,k),V=(0,s.mod)(-U*q-z*H,k);const J=G>N,Z=V>N;if(J&&(G=k-G),Z&&(V=k-V),G>N||V>N)throw new Error("splitScalar: Endomorphism failed, k="+I);return{k1neg:J,k1:G,k2neg:Z,k2:V}}}},t.sha256);const E={};function v(I,...k){let B=E[I];if(B===void 0){const q=(0,t.sha256)(Uint8Array.from(I,O=>O.charCodeAt(0)));B=(0,i.concatBytes)(q,q),E[I]=B}return(0,t.sha256)((0,i.concatBytes)(B,...k))}const _=I=>I.toRawBytes(!0).slice(1),P=I=>(0,i.numberToBytesBE)(I,32),d=I=>(0,s.mod)(I,c),j=I=>(0,s.mod)(I,u),g=e.secp256k1.ProjectivePoint,p=(I,k,B)=>g.BASE.multiplyAndAddUnsafe(I,k,B);function T(I){let k=e.secp256k1.utils.normPrivateKeyToScalar(I),B=g.fromPrivateKey(k);return{scalar:B.hasEvenY()?k:j(-k),bytes:_(B)}}function w(I){(0,i.aInRange)("x",I,f,c);const k=d(I*I),B=d(k*I+BigInt(7));let q=h(B);q%b!==l&&(q=d(-q));const O=new g(I,q,f);return O.assertValidity(),O}const A=i.bytesToNumberBE;function C(...I){return j(A(v("BIP0340/challenge",...I)))}function R(I){return T(I).bytes}function S(I,k,B=(0,n.randomBytes)(32)){const q=(0,i.ensureBytes)("message",I),{bytes:O,scalar:H}=T(k),N=(0,i.ensureBytes)("auxRand",B,32),U=P(H^A(v("BIP0340/aux",N))),z=v("BIP0340/nonce",U,O,q),G=j(A(z));if(G===l)throw new Error("sign failed: k is zero");const{bytes:V,scalar:J}=T(G),Z=C(V,O,q),K=new Uint8Array(64);if(K.set(V,0),K.set(P(j(J+Z*H)),32),!x(K,q,O))throw new Error("sign: Invalid signature produced");return K}function x(I,k,B){const q=(0,i.ensureBytes)("signature",I,64),O=(0,i.ensureBytes)("message",k),H=(0,i.ensureBytes)("publicKey",B,32);try{const N=w(A(H)),U=A(q.subarray(0,32));if(!(0,i.inRange)(U,f,c))return!1;const z=A(q.subarray(32,64));if(!(0,i.inRange)(z,f,u))return!1;const G=C(P(U),_(N),O),V=p(N,z,j(-G));return!(!V||!V.hasEvenY()||V.toAffine().x!==U)}catch{return!1}}e.schnorr={getPublicKey:R,sign:S,verify:x,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:w,pointToBytes:_,numberToBytesBE:i.numberToBytesBE,bytesToNumberBE:i.bytesToNumberBE,taggedHash:v,mod:s.mod}};const F=(0,o.isogenyMap)(m,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(I=>I.map(k=>BigInt(k)))),M=(0,a.mapToCurveSimpleSWU)(m,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:m.create(BigInt("-11"))});e.secp256k1_hasher=(0,o.createHasher)(e.secp256k1.ProjectivePoint,I=>{const{x:k,y:B}=M(m.create(I[0]));return F(k,B)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:m.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256}),e.hashToCurve=e.secp256k1_hasher.hashToCurve,e.encodeToCurve=e.secp256k1_hasher.encodeToCurve})(Pd)),Pd}var nb;function rf(){if(nb)return Wi;nb=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.recoverPublicKey=o;const e=De(),t=Ke(),n=Re(),r=te();async function o({hash:i,signature:a}){const c=(0,e.isHex)(i)?i:(0,r.toHex)(i),{secp256k1:u}=await Promise.resolve().then(()=>Gr());return`0x${(()=>{if(typeof a=="object"&&"r"in a&&"s"in a){const{r:m,s:E,v,yParity:_}=a,P=Number(_??v),d=s(P);return new u.Signature((0,n.hexToBigInt)(m),(0,n.hexToBigInt)(E)).addRecoveryBit(d)}const b=(0,e.isHex)(a)?a:(0,r.toHex)(a);if((0,t.size)(b)!==65)throw new Error("invalid signature length");const y=(0,n.hexToNumber)(`0x${b.slice(130)}`),h=s(y);return u.Signature.fromCompact(b.substring(2,130)).addRecoveryBit(h)})().recoverPublicKey(c.substring(2)).toHex(!1)}`}function s(i){if(i===0||i===1)return i;if(i===27)return 0;if(i===28)return 1;throw new Error("Invalid yParityOrV value")}return Wi}var ob;function ur(){if(ob)return Gi;ob=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.recoverAddress=n;const e=tg(),t=rf();async function n({hash:r,signature:o}){return(0,e.publicKeyToAddress)(await(0,t.recoverPublicKey)({hash:r,signature:o}))}return Gi}var Ki={},rn={},ib;function Mo(){if(ib)return rn;ib=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.toRlp=o,rn.bytesToRlp=s,rn.hexToRlp=i;const e=ue(),t=xo(),n=_e(),r=te();function o(f,b="hex"){const y=a(f),h=(0,t.createCursor)(new Uint8Array(y.length));return y.encode(h),b==="hex"?(0,r.bytesToHex)(h.bytes):h.bytes}function s(f,b="bytes"){return o(f,b)}function i(f,b="hex"){return o(f,b)}function a(f){return Array.isArray(f)?c(f.map(b=>a(b))):u(f)}function c(f){const b=f.reduce((m,E)=>m+E.length,0),y=l(b);return{length:b<=55?1+b:1+y+b,encode(m){b<=55?m.pushByte(192+b):(m.pushByte(247+y),y===1?m.pushUint8(b):y===2?m.pushUint16(b):y===3?m.pushUint24(b):m.pushUint32(b));for(const{encode:E}of f)E(m)}}}function u(f){const b=typeof f=="string"?(0,n.hexToBytes)(f):f,y=l(b.length);return{length:b.length===1&&b[0]<128?1:b.length<=55?1+b.length:1+y+b.length,encode(m){b.length===1&&b[0]<128?m.pushBytes(b):b.length<=55?(m.pushByte(128+b.length),m.pushBytes(b)):(m.pushByte(183+y),y===1?m.pushUint8(b.length):y===2?m.pushUint16(b.length):y===3?m.pushUint24(b.length):m.pushUint32(b.length),m.pushBytes(b))}}}function l(f){if(f<2**8)return 1;if(f<2**16)return 2;if(f<2**24)return 3;if(f<2**32)return 4;throw new e.BaseError("Length is too large.")}return rn}var ab;function ig(){if(ab)return Ki;ab=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.hashAuthorization=s;const e=Ce(),t=_e(),n=te(),r=Mo(),o=Ze();function s(i){const{chainId:a,nonce:c,to:u}=i,l=i.contractAddress??i.address,f=(0,o.keccak256)((0,e.concatHex)(["0x05",(0,r.toRlp)([a?(0,n.numberToHex)(a):"0x",l,c?(0,n.numberToHex)(c):"0x"])]));return u==="bytes"?(0,t.hexToBytes)(f):f}return Ki}var sb;function Ho(){if(sb)return Di;sb=1,Object.defineProperty(Di,"__esModule",{value:!0}),Di.recoverAuthorizationAddress=n;const e=ur(),t=ig();async function n(r){const{authorization:o,signature:s}=r;return(0,e.recoverAddress)({hash:(0,t.hashAuthorization)(o),signature:s??o})}return Di}var Zi={},eo={},cb;function ag(){if(cb)return eo;cb=1,Object.defineProperty(eo,"__esModule",{value:!0}),eo.EstimateGasExecutionError=void 0;const e=qo(),t=Lr(),n=ue(),r=Xe();class o extends n.BaseError{constructor(i,{account:a,docsPath:c,chain:u,data:l,gas:f,gasPrice:b,maxFeePerGas:y,maxPriorityFeePerGas:h,nonce:m,to:E,value:v}){const _=(0,r.prettyPrint)({from:a?.address,to:E,value:typeof v<"u"&&`${(0,e.formatEther)(v)} ${u?.nativeCurrency?.symbol||"ETH"}`,data:l,gas:f,gasPrice:typeof b<"u"&&`${(0,t.formatGwei)(b)} gwei`,maxFeePerGas:typeof y<"u"&&`${(0,t.formatGwei)(y)} gwei`,maxPriorityFeePerGas:typeof h<"u"&&`${(0,t.formatGwei)(h)} gwei`,nonce:m});super(i.shortMessage,{cause:i,docsPath:c,metaMessages:[...i.metaMessages?[...i.metaMessages," "]:[],"Estimate Gas Arguments:",_].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=i}}return eo.EstimateGasExecutionError=o,eo}var ge={},ub;function Vt(){if(ub)return ge;ub=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.UnknownNodeError=ge.TipAboveFeeCapError=ge.TransactionTypeNotSupportedError=ge.IntrinsicGasTooLowError=ge.IntrinsicGasTooHighError=ge.InsufficientFundsError=ge.NonceMaxValueError=ge.NonceTooLowError=ge.NonceTooHighError=ge.FeeCapTooLowError=ge.FeeCapTooHighError=ge.ExecutionRevertedError=void 0;const e=Lr(),t=ue();class n extends t.BaseError{constructor({cause:m,message:E}={}){const v=E?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${v?`with reason: ${v}`:"for an unknown reason"}.`,{cause:m,name:"ExecutionRevertedError"})}}ge.ExecutionRevertedError=n,Object.defineProperty(n,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(n,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class r extends t.BaseError{constructor({cause:m,maxFeePerGas:E}={}){super(`The fee cap (\`maxFeePerGas\`${E?` = ${(0,e.formatGwei)(E)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:m,name:"FeeCapTooHighError"})}}ge.FeeCapTooHighError=r,Object.defineProperty(r,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class o extends t.BaseError{constructor({cause:m,maxFeePerGas:E}={}){super(`The fee cap (\`maxFeePerGas\`${E?` = ${(0,e.formatGwei)(E)}`:""} gwei) cannot be lower than the block base fee.`,{cause:m,name:"FeeCapTooLowError"})}}ge.FeeCapTooLowError=o,Object.defineProperty(o,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class s extends t.BaseError{constructor({cause:m,nonce:E}={}){super(`Nonce provided for the transaction ${E?`(${E}) `:""}is higher than the next one expected.`,{cause:m,name:"NonceTooHighError"})}}ge.NonceTooHighError=s,Object.defineProperty(s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class i extends t.BaseError{constructor({cause:m,nonce:E}={}){super([`Nonce provided for the transaction ${E?`(${E}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
38
+ `),{cause:m,name:"NonceTooLowError"})}}ge.NonceTooLowError=i,Object.defineProperty(i,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class a extends t.BaseError{constructor({cause:m,nonce:E}={}){super(`Nonce provided for the transaction ${E?`(${E}) `:""}exceeds the maximum allowed nonce.`,{cause:m,name:"NonceMaxValueError"})}}ge.NonceMaxValueError=a,Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class c extends t.BaseError{constructor({cause:m}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
39
+ `),{cause:m,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}ge.InsufficientFundsError=c,Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class u extends t.BaseError{constructor({cause:m,gas:E}={}){super(`The amount of gas ${E?`(${E}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:m,name:"IntrinsicGasTooHighError"})}}ge.IntrinsicGasTooHighError=u,Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class l extends t.BaseError{constructor({cause:m,gas:E}={}){super(`The amount of gas ${E?`(${E}) `:""}provided for the transaction is too low.`,{cause:m,name:"IntrinsicGasTooLowError"})}}ge.IntrinsicGasTooLowError=l,Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class f extends t.BaseError{constructor({cause:m}){super("The transaction type is not supported for this chain.",{cause:m,name:"TransactionTypeNotSupportedError"})}}ge.TransactionTypeNotSupportedError=f,Object.defineProperty(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class b extends t.BaseError{constructor({cause:m,maxPriorityFeePerGas:E,maxFeePerGas:v}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${E?` = ${(0,e.formatGwei)(E)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${v?` = ${(0,e.formatGwei)(v)} gwei`:""}).`].join(`
40
+ `),{cause:m,name:"TipAboveFeeCapError"})}}ge.TipAboveFeeCapError=b,Object.defineProperty(b,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class y extends t.BaseError{constructor({cause:m}){super(`An error occurred while executing: ${m?.shortMessage}`,{cause:m,name:"UnknownNodeError"})}}return ge.UnknownNodeError=y,ge}var to={},db;function ko(){if(db)return to;db=1,Object.defineProperty(to,"__esModule",{value:!0}),to.containsNodeError=o,to.getNodeError=s;const e=ue(),t=Vt(),n=gt(),r=sr();function o(i){return i instanceof r.TransactionRejectedRpcError||i instanceof r.InvalidInputRpcError||i instanceof n.RpcRequestError&&i.code===t.ExecutionRevertedError.code}function s(i,a){const c=(i.details||"").toLowerCase(),u=i instanceof e.BaseError?i.walk(l=>l?.code===t.ExecutionRevertedError.code):i;return u instanceof e.BaseError?new t.ExecutionRevertedError({cause:i,message:u.details}):t.ExecutionRevertedError.nodeMessage.test(c)?new t.ExecutionRevertedError({cause:i,message:i.details}):t.FeeCapTooHighError.nodeMessage.test(c)?new t.FeeCapTooHighError({cause:i,maxFeePerGas:a?.maxFeePerGas}):t.FeeCapTooLowError.nodeMessage.test(c)?new t.FeeCapTooLowError({cause:i,maxFeePerGas:a?.maxFeePerGas}):t.NonceTooHighError.nodeMessage.test(c)?new t.NonceTooHighError({cause:i,nonce:a?.nonce}):t.NonceTooLowError.nodeMessage.test(c)?new t.NonceTooLowError({cause:i,nonce:a?.nonce}):t.NonceMaxValueError.nodeMessage.test(c)?new t.NonceMaxValueError({cause:i,nonce:a?.nonce}):t.InsufficientFundsError.nodeMessage.test(c)?new t.InsufficientFundsError({cause:i}):t.IntrinsicGasTooHighError.nodeMessage.test(c)?new t.IntrinsicGasTooHighError({cause:i,gas:a?.gas}):t.IntrinsicGasTooLowError.nodeMessage.test(c)?new t.IntrinsicGasTooLowError({cause:i,gas:a?.gas}):t.TransactionTypeNotSupportedError.nodeMessage.test(c)?new t.TransactionTypeNotSupportedError({cause:i}):t.TipAboveFeeCapError.nodeMessage.test(c)?new t.TipAboveFeeCapError({cause:i,maxFeePerGas:a?.maxFeePerGas,maxPriorityFeePerGas:a?.maxPriorityFeePerGas}):new t.UnknownNodeError({cause:i})}return to}var fb;function sg(){if(fb)return Zi;fb=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.getEstimateGasError=r;const e=ag(),t=Vt(),n=ko();function r(o,{docsPath:s,...i}){const a=(()=>{const c=(0,n.getNodeError)(o,i);return c instanceof t.UnknownNodeError?o:c})();return new e.EstimateGasExecutionError(a,{docsPath:s,...i})}return Zi}var Yi={},lb;function dr(){if(lb)return Yi;lb=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.extract=e;function e(t,{format:n}){if(!n)return{};const r={};function o(i){const a=Object.keys(i);for(const c of a)c in t&&(r[c]=t[c]),i[c]&&typeof i[c]=="object"&&!Array.isArray(i[c])&&o(i[c])}const s=n(t||{});return o(s),r}return Yi}var Id={},Ji={},bb;function Fo(){if(bb)return Ji;bb=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.defineFormatter=e;function e(t,n){return({exclude:r,format:o})=>({exclude:r,format:(s,i)=>{const a=n(s,i);if(r)for(const c of r)delete a[c];return{...a,...o(s,i)}},type:t})}return Ji}var mb;function _t(){return mb||(mb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defineTransactionRequest=e.rpcTransactionType=void 0,e.formatTransactionRequest=r;const t=te(),n=Fo();e.rpcTransactionType={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function r(s,i){const a={};return typeof s.authorizationList<"u"&&(a.authorizationList=o(s.authorizationList)),typeof s.accessList<"u"&&(a.accessList=s.accessList),typeof s.blobVersionedHashes<"u"&&(a.blobVersionedHashes=s.blobVersionedHashes),typeof s.blobs<"u"&&(typeof s.blobs[0]!="string"?a.blobs=s.blobs.map(c=>(0,t.bytesToHex)(c)):a.blobs=s.blobs),typeof s.data<"u"&&(a.data=s.data),s.account&&(a.from=s.account.address),typeof s.from<"u"&&(a.from=s.from),typeof s.gas<"u"&&(a.gas=(0,t.numberToHex)(s.gas)),typeof s.gasPrice<"u"&&(a.gasPrice=(0,t.numberToHex)(s.gasPrice)),typeof s.maxFeePerBlobGas<"u"&&(a.maxFeePerBlobGas=(0,t.numberToHex)(s.maxFeePerBlobGas)),typeof s.maxFeePerGas<"u"&&(a.maxFeePerGas=(0,t.numberToHex)(s.maxFeePerGas)),typeof s.maxPriorityFeePerGas<"u"&&(a.maxPriorityFeePerGas=(0,t.numberToHex)(s.maxPriorityFeePerGas)),typeof s.nonce<"u"&&(a.nonce=(0,t.numberToHex)(s.nonce)),typeof s.to<"u"&&(a.to=s.to),typeof s.type<"u"&&(a.type=e.rpcTransactionType[s.type]),typeof s.value<"u"&&(a.value=(0,t.numberToHex)(s.value)),a}e.defineTransactionRequest=(0,n.defineFormatter)("transactionRequest",r);function o(s){return s.map(i=>({address:i.address,r:i.r?(0,t.numberToHex)(BigInt(i.r)):i.r,s:i.s?(0,t.numberToHex)(BigInt(i.s)):i.s,chainId:(0,t.numberToHex)(i.chainId),nonce:(0,t.numberToHex)(i.nonce),...typeof i.yParity<"u"?{yParity:(0,t.numberToHex)(i.yParity)}:{},...typeof i.v<"u"&&typeof i.yParity>"u"?{v:(0,t.numberToHex)(i.v)}:{}}))}})(Id)),Id}var nn={},hb;function nf(){if(hb)return nn;hb=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.serializeStateMapping=s,nn.serializeAccountStateOverride=i,nn.serializeStateOverride=a;const e=yt(),t=Tu(),n=ef(),r=Ye(),o=te();function s(c){if(!(!c||c.length===0))return c.reduce((u,{slot:l,value:f})=>{if(l.length!==66)throw new t.InvalidBytesLengthError({size:l.length,targetSize:66,type:"hex"});if(f.length!==66)throw new t.InvalidBytesLengthError({size:f.length,targetSize:66,type:"hex"});return u[l]=f,u},{})}function i(c){const{balance:u,nonce:l,state:f,stateDiff:b,code:y}=c,h={};if(y!==void 0&&(h.code=y),u!==void 0&&(h.balance=(0,o.numberToHex)(u)),l!==void 0&&(h.nonce=(0,o.numberToHex)(l)),f!==void 0&&(h.state=s(f)),b!==void 0){if(h.state)throw new n.StateAssignmentConflictError;h.stateDiff=s(b)}return h}function a(c){if(!c)return;const u={};for(const{address:l,...f}of c){if(!(0,r.isAddress)(l,{strict:!1}))throw new e.InvalidAddressError({address:l});if(u[l])throw new n.AccountStateConflictError({address:l});u[l]=i(f)}return u}return nn}var Xi={},D={},yb;function of(){return yb||(yb=1,Object.defineProperty(D,"__esModule",{value:!0}),D.minInt144=D.minInt136=D.minInt128=D.minInt120=D.minInt112=D.minInt104=D.minInt96=D.minInt88=D.minInt80=D.minInt72=D.minInt64=D.minInt56=D.minInt48=D.minInt40=D.minInt32=D.minInt24=D.minInt16=D.minInt8=D.maxInt256=D.maxInt248=D.maxInt240=D.maxInt232=D.maxInt224=D.maxInt216=D.maxInt208=D.maxInt200=D.maxInt192=D.maxInt184=D.maxInt176=D.maxInt168=D.maxInt160=D.maxInt152=D.maxInt144=D.maxInt136=D.maxInt128=D.maxInt120=D.maxInt112=D.maxInt104=D.maxInt96=D.maxInt88=D.maxInt80=D.maxInt72=D.maxInt64=D.maxInt56=D.maxInt48=D.maxInt40=D.maxInt32=D.maxInt24=D.maxInt16=D.maxInt8=void 0,D.maxUint256=D.maxUint248=D.maxUint240=D.maxUint232=D.maxUint224=D.maxUint216=D.maxUint208=D.maxUint200=D.maxUint192=D.maxUint184=D.maxUint176=D.maxUint168=D.maxUint160=D.maxUint152=D.maxUint144=D.maxUint136=D.maxUint128=D.maxUint120=D.maxUint112=D.maxUint104=D.maxUint96=D.maxUint88=D.maxUint80=D.maxUint72=D.maxUint64=D.maxUint56=D.maxUint48=D.maxUint40=D.maxUint32=D.maxUint24=D.maxUint16=D.maxUint8=D.minInt256=D.minInt248=D.minInt240=D.minInt232=D.minInt224=D.minInt216=D.minInt208=D.minInt200=D.minInt192=D.minInt184=D.minInt176=D.minInt168=D.minInt160=D.minInt152=void 0,D.maxInt8=2n**(8n-1n)-1n,D.maxInt16=2n**(16n-1n)-1n,D.maxInt24=2n**(24n-1n)-1n,D.maxInt32=2n**(32n-1n)-1n,D.maxInt40=2n**(40n-1n)-1n,D.maxInt48=2n**(48n-1n)-1n,D.maxInt56=2n**(56n-1n)-1n,D.maxInt64=2n**(64n-1n)-1n,D.maxInt72=2n**(72n-1n)-1n,D.maxInt80=2n**(80n-1n)-1n,D.maxInt88=2n**(88n-1n)-1n,D.maxInt96=2n**(96n-1n)-1n,D.maxInt104=2n**(104n-1n)-1n,D.maxInt112=2n**(112n-1n)-1n,D.maxInt120=2n**(120n-1n)-1n,D.maxInt128=2n**(128n-1n)-1n,D.maxInt136=2n**(136n-1n)-1n,D.maxInt144=2n**(144n-1n)-1n,D.maxInt152=2n**(152n-1n)-1n,D.maxInt160=2n**(160n-1n)-1n,D.maxInt168=2n**(168n-1n)-1n,D.maxInt176=2n**(176n-1n)-1n,D.maxInt184=2n**(184n-1n)-1n,D.maxInt192=2n**(192n-1n)-1n,D.maxInt200=2n**(200n-1n)-1n,D.maxInt208=2n**(208n-1n)-1n,D.maxInt216=2n**(216n-1n)-1n,D.maxInt224=2n**(224n-1n)-1n,D.maxInt232=2n**(232n-1n)-1n,D.maxInt240=2n**(240n-1n)-1n,D.maxInt248=2n**(248n-1n)-1n,D.maxInt256=2n**(256n-1n)-1n,D.minInt8=-(2n**(8n-1n)),D.minInt16=-(2n**(16n-1n)),D.minInt24=-(2n**(24n-1n)),D.minInt32=-(2n**(32n-1n)),D.minInt40=-(2n**(40n-1n)),D.minInt48=-(2n**(48n-1n)),D.minInt56=-(2n**(56n-1n)),D.minInt64=-(2n**(64n-1n)),D.minInt72=-(2n**(72n-1n)),D.minInt80=-(2n**(80n-1n)),D.minInt88=-(2n**(88n-1n)),D.minInt96=-(2n**(96n-1n)),D.minInt104=-(2n**(104n-1n)),D.minInt112=-(2n**(112n-1n)),D.minInt120=-(2n**(120n-1n)),D.minInt128=-(2n**(128n-1n)),D.minInt136=-(2n**(136n-1n)),D.minInt144=-(2n**(144n-1n)),D.minInt152=-(2n**(152n-1n)),D.minInt160=-(2n**(160n-1n)),D.minInt168=-(2n**(168n-1n)),D.minInt176=-(2n**(176n-1n)),D.minInt184=-(2n**(184n-1n)),D.minInt192=-(2n**(192n-1n)),D.minInt200=-(2n**(200n-1n)),D.minInt208=-(2n**(208n-1n)),D.minInt216=-(2n**(216n-1n)),D.minInt224=-(2n**(224n-1n)),D.minInt232=-(2n**(232n-1n)),D.minInt240=-(2n**(240n-1n)),D.minInt248=-(2n**(248n-1n)),D.minInt256=-(2n**(256n-1n)),D.maxUint8=2n**8n-1n,D.maxUint16=2n**16n-1n,D.maxUint24=2n**24n-1n,D.maxUint32=2n**32n-1n,D.maxUint40=2n**40n-1n,D.maxUint48=2n**48n-1n,D.maxUint56=2n**56n-1n,D.maxUint64=2n**64n-1n,D.maxUint72=2n**72n-1n,D.maxUint80=2n**80n-1n,D.maxUint88=2n**88n-1n,D.maxUint96=2n**96n-1n,D.maxUint104=2n**104n-1n,D.maxUint112=2n**112n-1n,D.maxUint120=2n**120n-1n,D.maxUint128=2n**128n-1n,D.maxUint136=2n**136n-1n,D.maxUint144=2n**144n-1n,D.maxUint152=2n**152n-1n,D.maxUint160=2n**160n-1n,D.maxUint168=2n**168n-1n,D.maxUint176=2n**176n-1n,D.maxUint184=2n**184n-1n,D.maxUint192=2n**192n-1n,D.maxUint200=2n**200n-1n,D.maxUint208=2n**208n-1n,D.maxUint216=2n**216n-1n,D.maxUint224=2n**224n-1n,D.maxUint232=2n**232n-1n,D.maxUint240=2n**240n-1n,D.maxUint248=2n**248n-1n,D.maxUint256=2n**256n-1n),D}var pb;function vt(){if(pb)return Xi;pb=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.assertRequest=s;const e=Ie(),t=of(),n=yt(),r=Vt(),o=Ye();function s(i){const{account:a,maxFeePerGas:c,maxPriorityFeePerGas:u,to:l}=i,f=a?(0,e.parseAccount)(a):void 0;if(f&&!(0,o.isAddress)(f.address))throw new n.InvalidAddressError({address:f.address});if(l&&!(0,o.isAddress)(l))throw new n.InvalidAddressError({address:l});if(c&&c>t.maxUint256)throw new r.FeeCapTooHighError({maxFeePerGas:c});if(u&&c&&u>c)throw new r.TipAboveFeeCapError({maxFeePerGas:c,maxPriorityFeePerGas:u})}return Xi}var Sd={},ro={},Nt={},gb;function No(){if(gb)return Nt;gb=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.MaxFeePerGasTooLowError=Nt.Eip1559FeesNotSupportedError=Nt.BaseFeeScalarError=void 0;const e=Lr(),t=ue();class n extends t.BaseError{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}Nt.BaseFeeScalarError=n;class r extends t.BaseError{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}Nt.Eip1559FeesNotSupportedError=r;class o extends t.BaseError{constructor({maxPriorityFeePerGas:i}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${(0,e.formatGwei)(i)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}return Nt.MaxFeePerGasTooLowError=o,Nt}var no={},Qi={},oo={},_b;function af(){if(_b)return oo;_b=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.BlockNotFoundError=void 0;const e=ue();class t extends e.BaseError{constructor({blockHash:r,blockNumber:o}){let s="Block";r&&(s=`Block at hash "${r}"`),o&&(s=`Block at number "${o}"`),super(`${s} could not be found.`,{name:"BlockNotFoundError"})}}return oo.BlockNotFoundError=t,oo}var on={},Rd={},vb;function vn(){return vb||(vb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defineTransaction=e.transactionType=void 0,e.formatTransaction=r;const t=Re(),n=Fo();e.transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function r(s,i){const a={...s,blockHash:s.blockHash?s.blockHash:null,blockNumber:s.blockNumber?BigInt(s.blockNumber):null,chainId:s.chainId?(0,t.hexToNumber)(s.chainId):void 0,gas:s.gas?BigInt(s.gas):void 0,gasPrice:s.gasPrice?BigInt(s.gasPrice):void 0,maxFeePerBlobGas:s.maxFeePerBlobGas?BigInt(s.maxFeePerBlobGas):void 0,maxFeePerGas:s.maxFeePerGas?BigInt(s.maxFeePerGas):void 0,maxPriorityFeePerGas:s.maxPriorityFeePerGas?BigInt(s.maxPriorityFeePerGas):void 0,nonce:s.nonce?(0,t.hexToNumber)(s.nonce):void 0,to:s.to?s.to:null,transactionIndex:s.transactionIndex?Number(s.transactionIndex):null,type:s.type?e.transactionType[s.type]:void 0,typeHex:s.type?s.type:void 0,value:s.value?BigInt(s.value):void 0,v:s.v?BigInt(s.v):void 0};return s.authorizationList&&(a.authorizationList=o(s.authorizationList)),a.yParity=(()=>{if(s.yParity)return Number(s.yParity);if(typeof a.v=="bigint"){if(a.v===0n||a.v===27n)return 0;if(a.v===1n||a.v===28n)return 1;if(a.v>=35n)return a.v%2n===0n?1:0}})(),a.type==="legacy"&&(delete a.accessList,delete a.maxFeePerBlobGas,delete a.maxFeePerGas,delete a.maxPriorityFeePerGas,delete a.yParity),a.type==="eip2930"&&(delete a.maxFeePerBlobGas,delete a.maxFeePerGas,delete a.maxPriorityFeePerGas),a.type==="eip1559"&&delete a.maxFeePerBlobGas,a}e.defineTransaction=(0,n.defineFormatter)("transaction",r);function o(s){return s.map(i=>({address:i.address,chainId:Number(i.chainId),nonce:Number(i.nonce),r:i.r,s:i.s,yParity:Number(i.yParity)}))}})(Rd)),Rd}var Eb;function Cu(){if(Eb)return on;Eb=1,Object.defineProperty(on,"__esModule",{value:!0}),on.defineBlock=void 0,on.formatBlock=n;const e=Fo(),t=vn();function n(r,o){const s=(r.transactions??[]).map(i=>typeof i=="string"?i:(0,t.formatTransaction)(i));return{...r,baseFeePerGas:r.baseFeePerGas?BigInt(r.baseFeePerGas):null,blobGasUsed:r.blobGasUsed?BigInt(r.blobGasUsed):void 0,difficulty:r.difficulty?BigInt(r.difficulty):void 0,excessBlobGas:r.excessBlobGas?BigInt(r.excessBlobGas):void 0,gasLimit:r.gasLimit?BigInt(r.gasLimit):void 0,gasUsed:r.gasUsed?BigInt(r.gasUsed):void 0,hash:r.hash?r.hash:null,logsBloom:r.logsBloom?r.logsBloom:null,nonce:r.nonce?r.nonce:null,number:r.number?BigInt(r.number):null,size:r.size?BigInt(r.size):void 0,timestamp:r.timestamp?BigInt(r.timestamp):void 0,transactions:s,totalDifficulty:r.totalDifficulty?BigInt(r.totalDifficulty):null}}return on.defineBlock=(0,e.defineFormatter)("block",n),on}var jb;function Vr(){if(jb)return Qi;jb=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.getBlock=r;const e=af(),t=te(),n=Cu();async function r(o,{blockHash:s,blockNumber:i,blockTag:a=o.experimental_blockTag??"latest",includeTransactions:c}={}){const u=c??!1,l=i!==void 0?(0,t.numberToHex)(i):void 0;let f=null;if(s?f=await o.request({method:"eth_getBlockByHash",params:[s,u]},{dedupe:!0}):f=await o.request({method:"eth_getBlockByNumber",params:[l||a,u]},{dedupe:!!l}),!f)throw new e.BlockNotFoundError({blockHash:s,blockNumber:i});return(o.chain?.formatters?.block?.format||n.formatBlock)(f,"getBlock")}return Qi}var $i={},wb;function sf(){if(wb)return $i;wb=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.getGasPrice=e;async function e(t){const n=await t.request({method:"eth_gasPrice"});return BigInt(n)}return $i}var Pb;function cg(){if(Pb)return no;Pb=1,Object.defineProperty(no,"__esModule",{value:!0}),no.estimateMaxPriorityFeePerGas=s,no.internal_estimateMaxPriorityFeePerGas=i;const e=No(),t=Re(),n=me(),r=Vr(),o=sf();async function s(a,c){return i(a,c)}async function i(a,c){const{block:u,chain:l=a.chain,request:f}=c||{};try{const b=l?.fees?.maxPriorityFeePerGas??l?.fees?.defaultPriorityFee;if(typeof b=="function"){const h=u||await(0,n.getAction)(a,r.getBlock,"getBlock")({}),m=await b({block:h,client:a,request:f});if(m===null)throw new Error;return m}if(typeof b<"u")return b;const y=await a.request({method:"eth_maxPriorityFeePerGas"});return(0,t.hexToBigInt)(y)}catch{const[b,y]=await Promise.all([u?Promise.resolve(u):(0,n.getAction)(a,r.getBlock,"getBlock")({}),(0,n.getAction)(a,o.getGasPrice,"getGasPrice")({})]);if(typeof b.baseFeePerGas!="bigint")throw new e.Eip1559FeesNotSupportedError;const h=y-b.baseFeePerGas;return h<0n?0n:h}}return no}var Ab;function ug(){if(Ab)return ro;Ab=1,Object.defineProperty(ro,"__esModule",{value:!0}),ro.estimateFeesPerGas=s,ro.internal_estimateFeesPerGas=i;const e=No(),t=me(),n=cg(),r=Vr(),o=sf();async function s(a,c){return i(a,c)}async function i(a,c){const{block:u,chain:l=a.chain,request:f,type:b="eip1559"}=c||{},y=await(async()=>typeof l?.fees?.baseFeeMultiplier=="function"?l.fees.baseFeeMultiplier({block:u,client:a,request:f}):l?.fees?.baseFeeMultiplier??1.2)();if(y<1)throw new e.BaseFeeScalarError;const m=10**(y.toString().split(".")[1]?.length??0),E=P=>P*BigInt(Math.ceil(y*m))/BigInt(m),v=u||await(0,t.getAction)(a,r.getBlock,"getBlock")({});if(typeof l?.fees?.estimateFeesPerGas=="function"){const P=await l.fees.estimateFeesPerGas({block:u,client:a,multiply:E,request:f,type:b});if(P!==null)return P}if(b==="eip1559"){if(typeof v.baseFeePerGas!="bigint")throw new e.Eip1559FeesNotSupportedError;const P=typeof f?.maxPriorityFeePerGas=="bigint"?f.maxPriorityFeePerGas:await(0,n.internal_estimateMaxPriorityFeePerGas)(a,{block:v,chain:l,request:f}),d=E(v.baseFeePerGas);return{maxFeePerGas:f?.maxFeePerGas??d+P,maxPriorityFeePerGas:P}}return{gasPrice:f?.gasPrice??E(await(0,t.getAction)(a,o.getGasPrice,"getGasPrice")({}))}}return ro}var ea={},Tb;function qu(){if(Tb)return ea;Tb=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.getTransactionCount=n;const e=Re(),t=te();async function n(r,{address:o,blockTag:s="latest",blockNumber:i}){const a=await r.request({method:"eth_getTransactionCount",params:[o,typeof i=="bigint"?(0,t.numberToHex)(i):s]},{dedupe:!!i});return(0,e.hexToNumber)(a)}return ea}var ta={},Ib;function Mu(){if(Ib)return ta;Ib=1,Object.defineProperty(ta,"__esModule",{value:!0}),ta.blobsToCommitments=n;const e=_e(),t=te();function n(r){const{kzg:o}=r,s=r.to??(typeof r.blobs[0]=="string"?"hex":"bytes"),i=typeof r.blobs[0]=="string"?r.blobs.map(c=>(0,e.hexToBytes)(c)):r.blobs,a=[];for(const c of i)a.push(Uint8Array.from(o.blobToKzgCommitment(c)));return s==="bytes"?a:a.map(c=>(0,t.bytesToHex)(c))}return ta}var ra={},Sb;function Hu(){if(Sb)return ra;Sb=1,Object.defineProperty(ra,"__esModule",{value:!0}),ra.blobsToProofs=n;const e=_e(),t=te();function n(r){const{kzg:o}=r,s=r.to??(typeof r.blobs[0]=="string"?"hex":"bytes"),i=typeof r.blobs[0]=="string"?r.blobs.map(u=>(0,e.hexToBytes)(u)):r.blobs,a=typeof r.commitments[0]=="string"?r.commitments.map(u=>(0,e.hexToBytes)(u)):r.commitments,c=[];for(let u=0;u<i.length;u++){const l=i[u],f=a[u];c.push(Uint8Array.from(o.computeBlobKzgProof(l,f)))}return s==="bytes"?c:c.map(u=>(0,t.bytesToHex)(u))}return ra}var na={},oa={},ia={},ft={},Rb;function dg(){if(Rb)return ft;Rb=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.sha224=ft.SHA224=ft.sha256=ft.SHA256=void 0;const e=ng();return ft.SHA256=e.SHA256,ft.sha256=e.sha256,ft.SHA224=e.SHA224,ft.sha224=e.sha224,ft}var Bb;function cf(){if(Bb)return ia;Bb=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.sha256=o;const e=dg(),t=De(),n=_e(),r=te();function o(s,i){const a=i||"hex",c=(0,e.sha256)((0,t.isHex)(s,{strict:!1})?(0,n.toBytes)(s):s);return a==="bytes"?c:(0,r.toHex)(c)}return ia}var Ob;function uf(){if(Ob)return oa;Ob=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.commitmentToVersionedHash=n;const e=te(),t=cf();function n(r){const{commitment:o,version:s=1}=r,i=r.to??(typeof o=="string"?"hex":"bytes"),a=(0,t.sha256)(o,"bytes");return a.set([s],0),i==="bytes"?a:(0,e.bytesToHex)(a)}return oa}var xb;function df(){if(xb)return na;xb=1,Object.defineProperty(na,"__esModule",{value:!0}),na.commitmentsToVersionedHashes=t;const e=uf();function t(n){const{commitments:r,version:o}=n,s=n.to??(typeof r[0]=="string"?"hex":"bytes"),i=[];for(const a of r)i.push((0,e.commitmentToVersionedHash)({commitment:a,to:s,version:o}));return i}return na}var aa={},sa={},Bd={},Cb;function Uv(){return Cb||(Cb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.maxBytesPerTransaction=e.bytesPerBlob=e.fieldElementsPerBlob=e.bytesPerFieldElement=void 0;const t=6;e.bytesPerFieldElement=32,e.fieldElementsPerBlob=4096,e.bytesPerBlob=e.bytesPerFieldElement*e.fieldElementsPerBlob,e.maxBytesPerTransaction=e.bytesPerBlob*t-1-1*e.fieldElementsPerBlob*t})(Bd)),Bd}var lt={},io={},qb;function fg(){return qb||(qb=1,Object.defineProperty(io,"__esModule",{value:!0}),io.versionedHashVersionKzg=void 0,io.versionedHashVersionKzg=1),io}var Mb;function lg(){if(Mb)return lt;Mb=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.InvalidVersionedHashVersionError=lt.InvalidVersionedHashSizeError=lt.EmptyBlobError=lt.BlobSizeTooLargeError=void 0;const e=fg(),t=ue();class n extends t.BaseError{constructor({maxSize:a,size:c}){super("Blob size is too large.",{metaMessages:[`Max: ${a} bytes`,`Given: ${c} bytes`],name:"BlobSizeTooLargeError"})}}lt.BlobSizeTooLargeError=n;class r extends t.BaseError{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}lt.EmptyBlobError=r;class o extends t.BaseError{constructor({hash:a,size:c}){super(`Versioned hash "${a}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${c}`],name:"InvalidVersionedHashSizeError"})}}lt.InvalidVersionedHashSizeError=o;class s extends t.BaseError{constructor({hash:a,version:c}){super(`Versioned hash "${a}" version is invalid.`,{metaMessages:[`Expected: ${e.versionedHashVersionKzg}`,`Received: ${c}`],name:"InvalidVersionedHashVersionError"})}}return lt.InvalidVersionedHashVersionError=s,lt}var Hb;function bg(){if(Hb)return sa;Hb=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.toBlobs=i;const e=Uv(),t=lg(),n=xo(),r=Ke(),o=_e(),s=te();function i(a){const c=a.to??(typeof a.data=="string"?"hex":"bytes"),u=typeof a.data=="string"?(0,o.hexToBytes)(a.data):a.data,l=(0,r.size)(u);if(!l)throw new t.EmptyBlobError;if(l>e.maxBytesPerTransaction)throw new t.BlobSizeTooLargeError({maxSize:e.maxBytesPerTransaction,size:l});const f=[];let b=!0,y=0;for(;b;){const h=(0,n.createCursor)(new Uint8Array(e.bytesPerBlob));let m=0;for(;m<e.fieldElementsPerBlob;){const E=u.slice(y,y+(e.bytesPerFieldElement-1));if(h.pushByte(0),h.pushBytes(E),E.length<31){h.pushByte(128),b=!1;break}m++,y+=31}f.push(h)}return c==="bytes"?f.map(h=>h.bytes):f.map(h=>(0,s.bytesToHex)(h.bytes))}return sa}var kb;function ku(){if(kb)return aa;kb=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.toBlobSidecars=r;const e=Mu(),t=Hu(),n=bg();function r(o){const{data:s,kzg:i,to:a}=o,c=o.blobs??(0,n.toBlobs)({data:s,to:a}),u=o.commitments??(0,e.blobsToCommitments)({blobs:c,kzg:i,to:a}),l=o.proofs??(0,t.blobsToProofs)({blobs:c,commitments:u,kzg:i,to:a}),f=[];for(let b=0;b<c.length;b++)f.push({blob:c[b],commitment:u[b],proof:l[b]});return f}return aa}var ca={},Fb;function Fu(){if(Fb)return ca;Fb=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.getTransactionType=t;const e=Xe();function t(n){if(n.type)return n.type;if(typeof n.authorizationList<"u")return"eip7702";if(typeof n.blobs<"u"||typeof n.blobVersionedHashes<"u"||typeof n.maxFeePerBlobGas<"u"||typeof n.sidecars<"u")return"eip4844";if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")return"eip1559";if(typeof n.gasPrice<"u")return typeof n.accessList<"u"?"eip2930":"legacy";throw new e.InvalidSerializableTransactionError({transaction:n})}return ca}var ua={},da={},Nb;function zo(){if(Nb)return da;Nb=1,Object.defineProperty(da,"__esModule",{value:!0}),da.getTransactionError=r;const e=Vt(),t=Xe(),n=ko();function r(o,{docsPath:s,...i}){const a=(()=>{const c=(0,n.getNodeError)(o,i);return c instanceof e.UnknownNodeError?o:c})();return new t.TransactionExecutionError(a,{docsPath:s,...i})}return da}var fa={},zb;function fr(){if(zb)return fa;zb=1,Object.defineProperty(fa,"__esModule",{value:!0}),fa.getChainId=t;const e=Re();async function t(n){const r=await n.request({method:"eth_chainId"},{dedupe:!0});return(0,e.hexToNumber)(r)}return fa}var Ub;function ff(){if(Ub)return ua;Ub=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.fillTransaction=l;const e=Ie(),t=No(),n=zo(),r=dr(),o=vn(),s=_t(),i=me(),a=vt(),c=Vr(),u=fr();async function l(f,b){const{account:y=f.account,accessList:h,authorizationList:m,chain:E=f.chain,blobVersionedHashes:v,blobs:_,data:P,gas:d,gasPrice:j,maxFeePerBlobGas:g,maxFeePerGas:p,maxPriorityFeePerGas:T,nonce:w,nonceManager:A,to:C,type:R,value:S,...x}=b,F=await(async()=>{if(!y||!A||typeof w<"u")return w;const B=(0,e.parseAccount)(y),q=E?E.id:await(0,i.getAction)(f,u.getChainId,"getChainId")({});return await A.consume({address:B.address,chainId:q,client:f})})();(0,a.assertRequest)(b);const M=E?.formatters?.transactionRequest?.format,k=(M||s.formatTransactionRequest)({...(0,r.extract)(x,{format:M}),account:y?(0,e.parseAccount)(y):void 0,accessList:h,authorizationList:m,blobs:_,blobVersionedHashes:v,data:P,gas:d,gasPrice:j,maxFeePerBlobGas:g,maxFeePerGas:p,maxPriorityFeePerGas:T,nonce:F,to:C,type:R,value:S},"fillTransaction");try{const B=await f.request({method:"eth_fillTransaction",params:[k]}),O=(E?.formatters?.transaction?.format||o.formatTransaction)(B.tx);delete O.blockHash,delete O.blockNumber,delete O.r,delete O.s,delete O.transactionIndex,delete O.v,delete O.yParity,O.data=O.input,O.gas&&(O.gas=b.gas??O.gas),O.gasPrice&&(O.gasPrice=b.gasPrice??O.gasPrice),O.maxFeePerBlobGas&&(O.maxFeePerBlobGas=b.maxFeePerBlobGas??O.maxFeePerBlobGas),O.maxFeePerGas&&(O.maxFeePerGas=b.maxFeePerGas??O.maxFeePerGas),O.maxPriorityFeePerGas&&(O.maxPriorityFeePerGas=b.maxPriorityFeePerGas??O.maxPriorityFeePerGas),O.nonce&&(O.nonce=b.nonce??O.nonce);const H=await(async()=>{if(typeof E?.fees?.baseFeeMultiplier=="function"){const G=await(0,i.getAction)(f,c.getBlock,"getBlock")({});return E.fees.baseFeeMultiplier({block:G,client:f,request:b})}return E?.fees?.baseFeeMultiplier??1.2})();if(H<1)throw new t.BaseFeeScalarError;const U=10**(H.toString().split(".")[1]?.length??0),z=G=>G*BigInt(Math.ceil(H*U))/BigInt(U);return O.maxFeePerGas&&!b.maxFeePerGas&&(O.maxFeePerGas=z(O.maxFeePerGas)),O.gasPrice&&!b.gasPrice&&(O.gasPrice=z(O.gasPrice)),{raw:B.raw,transaction:{from:k.from,...O}}}catch(B){throw(0,n.getTransactionError)(B,{...b,chain:f.chain})}}return ua}var Lb;function Uo(){return Lb||(Lb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.supportsFillTransaction=e.eip1559NetworkCache=e.defaultParameters=void 0,e.prepareTransactionRequest=v;const t=Ie(),n=ug(),r=lf(),o=Vr(),s=qu(),i=No(),a=Mu(),c=Hu(),u=df(),l=ku(),f=me(),b=Nr(),y=vt(),h=Fu(),m=ff(),E=fr();e.defaultParameters=["blobVersionedHashes","chainId","fees","gas","nonce","type"],e.eip1559NetworkCache=new Map,e.supportsFillTransaction=new b.LruMap(128);async function v(_,P){let d=P;d.account??=_.account,d.parameters??=e.defaultParameters;const{account:j,chain:g=_.chain,nonceManager:p,parameters:T}=d,w=(()=>{if(typeof g?.prepareTransactionRequest=="function")return{fn:g.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(g?.prepareTransactionRequest))return{fn:g.prepareTransactionRequest[0],runAt:g.prepareTransactionRequest[1].runAt}})();let A;async function C(){return A||(typeof d.chainId<"u"?d.chainId:g?g.id:(A=await(0,f.getAction)(_,E.getChainId,"getChainId")({}),A))}const R=j&&(0,t.parseAccount)(j);let S=d.nonce;if(T.includes("nonce")&&typeof S>"u"&&R&&p){const H=await C();S=await p.consume({address:R.address,chainId:H,client:_})}w?.fn&&w.runAt?.includes("beforeFillTransaction")&&(d=await w.fn({...d,chain:g},{phase:"beforeFillTransaction"}),S??=d.nonce);const F=((T.includes("blobVersionedHashes")||T.includes("sidecars"))&&d.kzg&&d.blobs||e.supportsFillTransaction.get(_.uid)===!1||!["fees","gas"].some(N=>T.includes(N))?!1:!!(T.includes("chainId")&&typeof d.chainId!="number"||T.includes("nonce")&&typeof S!="number"||T.includes("fees")&&typeof d.gasPrice!="bigint"&&(typeof d.maxFeePerGas!="bigint"||typeof d.maxPriorityFeePerGas!="bigint")||T.includes("gas")&&typeof d.gas!="bigint"))?await(0,f.getAction)(_,m.fillTransaction,"fillTransaction")({...d,nonce:S}).then(H=>{const{chainId:N,from:U,gas:z,gasPrice:G,nonce:V,maxFeePerBlobGas:J,maxFeePerGas:Z,maxPriorityFeePerGas:K,type:Q,...ie}=H.transaction;return e.supportsFillTransaction.set(_.uid,!0),{...d,...U?{from:U}:{},...Q?{type:Q}:{},...typeof N<"u"?{chainId:N}:{},...typeof z<"u"?{gas:z}:{},...typeof G<"u"?{gasPrice:G}:{},...typeof V<"u"?{nonce:V}:{},...typeof J<"u"?{maxFeePerBlobGas:J}:{},...typeof Z<"u"?{maxFeePerGas:Z}:{},...typeof K<"u"?{maxPriorityFeePerGas:K}:{},..."nonceKey"in ie&&typeof ie.nonceKey<"u"?{nonceKey:ie.nonceKey}:{}}}).catch(H=>{const N=H;return N.name!=="TransactionExecutionError"||N.walk?.(z=>{const G=z;return G.name==="MethodNotFoundRpcError"||G.name==="MethodNotSupportedRpcError"})&&e.supportsFillTransaction.set(_.uid,!1),d}):d;S??=F.nonce,d={...F,...R?{from:R?.address}:{},...S?{nonce:S}:{}};const{blobs:M,gas:I,kzg:k,type:B}=d;w?.fn&&w.runAt?.includes("beforeFillParameters")&&(d=await w.fn({...d,chain:g},{phase:"beforeFillParameters"}));let q;async function O(){return q||(q=await(0,f.getAction)(_,o.getBlock,"getBlock")({blockTag:"latest"}),q)}if(T.includes("nonce")&&typeof S>"u"&&R&&!p&&(d.nonce=await(0,f.getAction)(_,s.getTransactionCount,"getTransactionCount")({address:R.address,blockTag:"pending"})),(T.includes("blobVersionedHashes")||T.includes("sidecars"))&&M&&k){const H=(0,a.blobsToCommitments)({blobs:M,kzg:k});if(T.includes("blobVersionedHashes")){const N=(0,u.commitmentsToVersionedHashes)({commitments:H,to:"hex"});d.blobVersionedHashes=N}if(T.includes("sidecars")){const N=(0,c.blobsToProofs)({blobs:M,commitments:H,kzg:k}),U=(0,l.toBlobSidecars)({blobs:M,commitments:H,proofs:N,to:"hex"});d.sidecars=U}}if(T.includes("chainId")&&(d.chainId=await C()),(T.includes("fees")||T.includes("type"))&&typeof B>"u")try{d.type=(0,h.getTransactionType)(d)}catch{let H=e.eip1559NetworkCache.get(_.uid);typeof H>"u"&&(H=typeof(await O())?.baseFeePerGas=="bigint",e.eip1559NetworkCache.set(_.uid,H)),d.type=H?"eip1559":"legacy"}if(T.includes("fees"))if(d.type!=="legacy"&&d.type!=="eip2930"){if(typeof d.maxFeePerGas>"u"||typeof d.maxPriorityFeePerGas>"u"){const H=await O(),{maxFeePerGas:N,maxPriorityFeePerGas:U}=await(0,n.internal_estimateFeesPerGas)(_,{block:H,chain:g,request:d});if(typeof d.maxPriorityFeePerGas>"u"&&d.maxFeePerGas&&d.maxFeePerGas<U)throw new i.MaxFeePerGasTooLowError({maxPriorityFeePerGas:U});d.maxPriorityFeePerGas=U,d.maxFeePerGas=N}}else{if(typeof d.maxFeePerGas<"u"||typeof d.maxPriorityFeePerGas<"u")throw new i.Eip1559FeesNotSupportedError;if(typeof d.gasPrice>"u"){const H=await O(),{gasPrice:N}=await(0,n.internal_estimateFeesPerGas)(_,{block:H,chain:g,request:d,type:"legacy"});d.gasPrice=N}}return T.includes("gas")&&typeof I>"u"&&(d.gas=await(0,f.getAction)(_,r.estimateGas,"estimateGas")({...d,account:R,prepare:R?.type==="local"?[]:["blobVersionedHashes"]})),w?.fn&&w.runAt?.includes("afterFillParameters")&&(d=await w.fn({...d,chain:g},{phase:"afterFillParameters"})),(0,y.assertRequest)(d),delete d.parameters,d}})(Sd)),Sd}var Db;function lf(){if(Db)return Li;Db=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.estimateGas=l;const e=Ie(),t=ue(),n=Ho(),r=te(),o=sg(),s=dr(),i=_t(),a=nf(),c=vt(),u=Uo();async function l(f,b){const{account:y=f.account,prepare:h=!0}=b,m=y?(0,e.parseAccount)(y):void 0,E=(()=>{if(Array.isArray(h))return h;if(m?.type!=="local")return["blobVersionedHashes"]})();try{const v=await(async()=>{if(b.to)return b.to;if(b.authorizationList&&b.authorizationList.length>0)return await(0,n.recoverAuthorizationAddress)({authorization:b.authorizationList[0]}).catch(()=>{throw new t.BaseError("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:_,authorizationList:P,blobs:d,blobVersionedHashes:j,blockNumber:g,blockTag:p,data:T,gas:w,gasPrice:A,maxFeePerBlobGas:C,maxFeePerGas:R,maxPriorityFeePerGas:S,nonce:x,value:F,stateOverride:M,...I}=h?await(0,u.prepareTransactionRequest)(f,{...b,parameters:E,to:v}):b;if(w&&b.gas!==w)return w;const B=(typeof g=="bigint"?(0,r.numberToHex)(g):void 0)||p,q=(0,a.serializeStateOverride)(M);(0,c.assertRequest)(b);const O=f.chain?.formatters?.transactionRequest?.format,N=(O||i.formatTransactionRequest)({...(0,s.extract)(I,{format:O}),account:m,accessList:_,authorizationList:P,blobs:d,blobVersionedHashes:j,data:T,gasPrice:A,maxFeePerBlobGas:C,maxFeePerGas:R,maxPriorityFeePerGas:S,nonce:x,to:v,value:F},"estimateGas");return BigInt(await f.request({method:"eth_estimateGas",params:q?[N,B??f.experimental_blockTag??"latest",q]:B?[N,B]:[N]}))}catch(v){throw(0,o.getEstimateGasError)(v,{...b,account:m,chain:f.chain})}}return Li}var Gb;function mg(){if(Gb)return Bi;Gb=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.estimateContractGas=s;const e=Ie(),t=Je(),n=cr(),r=me(),o=lf();async function s(i,a){const{abi:c,address:u,args:l,functionName:f,dataSuffix:b,...y}=a,h=(0,t.encodeFunctionData)({abi:c,args:l,functionName:f});try{return await(0,r.getAction)(i,o.estimateGas,"estimateGas")({data:`${h}${b?b.replace("0x",""):""}`,to:u,...y})}catch(m){const E=y.account?(0,e.parseAccount)(y.account):void 0;throw(0,n.getContractError)(m,{abi:c,address:u,args:l,docsPath:"/docs/contract/estimateContractGas",functionName:f,sender:E?.address})}}return Bi}var la={},ba={},ma={},ha={},Vb;function Et(){if(Vb)return ha;Vb=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.isAddressEqual=n;const e=yt(),t=Ye();function n(r,o){if(!(0,t.isAddress)(r,{strict:!1}))throw new e.InvalidAddressError({address:r});if(!(0,t.isAddress)(o,{strict:!1}))throw new e.InvalidAddressError({address:o});return r.toLowerCase()===o.toLowerCase()}return ha}var ya={},Wb;function Lo(){if(Wb)return ya;Wb=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.decodeEventLog=a;const e=Te(),t=$1(),n=Ke(),r=_n(),o=ir(),s=Lt(),i="/docs/contract/decodeEventLog";function a(u){const{abi:l,data:f,strict:b,topics:y}=u,h=b??!0,[m,...E]=y;if(!m)throw new e.AbiEventSignatureEmptyTopicsError({docsPath:i});const v=l.find(T=>T.type==="event"&&m===(0,r.toEventSelector)((0,s.formatAbiItem)(T)));if(!(v&&"name"in v)||v.type!=="event")throw new e.AbiEventSignatureNotFoundError(m,{docsPath:i});const{name:_,inputs:P}=v,d=P?.some(T=>!("name"in T&&T.name)),j=d?[]:{},g=P.map((T,w)=>[T,w]).filter(([T])=>"indexed"in T&&T.indexed);for(let T=0;T<g.length;T++){const[w,A]=g[T],C=E[T];if(!C)throw new e.DecodeLogTopicsMismatch({abiItem:v,param:w});j[d?A:w.name||A]=c({param:w,value:C})}const p=P.filter(T=>!("indexed"in T&&T.indexed));if(p.length>0){if(f&&f!=="0x")try{const T=(0,o.decodeAbiParameters)(p,f);if(T)if(d)for(let w=0;w<P.length;w++)j[w]=j[w]??T.shift();else for(let w=0;w<p.length;w++)j[p[w].name]=T[w]}catch(T){if(h)throw T instanceof e.AbiDecodingDataSizeTooSmallError||T instanceof t.PositionOutOfBoundsError?new e.DecodeLogDataMismatch({abiItem:v,data:f,params:p,size:(0,n.size)(f)}):T}else if(h)throw new e.DecodeLogDataMismatch({abiItem:v,data:"0x",params:p,size:0})}return{eventName:_,args:Object.values(j).length>0?j:void 0}}function c({param:u,value:l}){return u.type==="string"||u.type==="bytes"||u.type==="tuple"||u.type.match(/^(.*)\[(\d+)?\]$/)?l:((0,o.decodeAbiParameters)([u],l)||[])[0]}return ya}var Kb;function Do(){if(Kb)return ma;Kb=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.parseEventLogs=s;const e=Et(),t=_e(),n=Ze(),r=_n(),o=Lo();function s(a){const{abi:c,args:u,logs:l,strict:f=!0}=a,b=(()=>{if(a.eventName)return Array.isArray(a.eventName)?a.eventName:[a.eventName]})();return l.map(y=>{const h=c.filter(v=>v.type==="event"&&y.topics[0]===(0,r.toEventSelector)(v));if(h.length===0)return null;let m,E;for(const v of h)try{m=(0,o.decodeEventLog)({...y,abi:[v],strict:!0}),E=v;break}catch{}if(!m&&!f){E=h[0];try{m=(0,o.decodeEventLog)({...y,abi:[E],strict:!1})}catch{const v=E.inputs?.some(_=>!("name"in _&&_.name));return{...y,args:v?[]:{},eventName:E.name}}}return!m||!E||b&&!b.includes(m.eventName)||!i({args:m.args,inputs:E.inputs,matchArgs:u})?null:{...m,...y}}).filter(Boolean)}function i(a){const{args:c,inputs:u,matchArgs:l}=a;if(!l)return!0;if(!c)return!1;function f(b,y,h){try{return b.type==="address"?(0,e.isAddressEqual)(y,h):b.type==="string"||b.type==="bytes"?(0,n.keccak256)((0,t.toBytes)(y))===h:y===h}catch{return!1}}return Array.isArray(c)&&Array.isArray(l)?l.every((b,y)=>{if(b==null)return!0;const h=u[y];return h?(Array.isArray(b)?b:[b]).some(E=>f(h,E,c[y])):!1}):typeof c=="object"&&!Array.isArray(c)&&typeof l=="object"&&!Array.isArray(l)?Object.entries(l).every(([b,y])=>{if(y==null)return!0;const h=u.find(E=>E.name===b);return h?(Array.isArray(y)?y:[y]).some(E=>f(h,E,c[b])):!1}):!1}return ma}var pa={},Zb;function Wt(){if(Zb)return pa;Zb=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.formatLog=e;function e(t,{args:n,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,blockTimestamp:t.blockTimestamp?BigInt(t.blockTimestamp):t.blockTimestamp===null?null:void 0,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:n,eventName:r}:{}}}return pa}var Yb;function bf(){if(Yb)return ba;Yb=1,Object.defineProperty(ba,"__esModule",{value:!0}),ba.getLogs=o;const e=Ur(),t=Do(),n=te(),r=Wt();async function o(s,{address:i,blockHash:a,fromBlock:c,toBlock:u,event:l,events:f,args:b,strict:y}={}){const h=y??!1,m=f??(l?[l]:void 0);let E=[];m&&(E=[m.flatMap(d=>(0,e.encodeEventTopics)({abi:[d],eventName:d.name,args:f?void 0:b}))],l&&(E=E[0]));let v;a?v=await s.request({method:"eth_getLogs",params:[{address:i,topics:E,blockHash:a}]}):v=await s.request({method:"eth_getLogs",params:[{address:i,topics:E,fromBlock:typeof c=="bigint"?(0,n.numberToHex)(c):c,toBlock:typeof u=="bigint"?(0,n.numberToHex)(u):u}]});const _=v.map(P=>(0,r.formatLog)(P));return m?(0,t.parseEventLogs)({abi:m,args:b,logs:_,strict:h}):_}return ba}var Jb;function mf(){if(Jb)return la;Jb=1,Object.defineProperty(la,"__esModule",{value:!0}),la.getContractEvents=r;const e=Gt(),t=me(),n=bf();async function r(o,s){const{abi:i,address:a,args:c,blockHash:u,eventName:l,fromBlock:f,toBlock:b,strict:y}=s,h=l?(0,e.getAbiItem)({abi:i,name:l}):void 0,m=h?void 0:i.filter(E=>E.type==="event");return(0,t.getAction)(o,n.getLogs,"getLogs")({address:a,args:c,blockHash:u,event:h,events:m,fromBlock:f,toBlock:b,strict:y})}return la}var ga={},_a={},Xb;function Kt(){if(Xb)return _a;Xb=1,Object.defineProperty(_a,"__esModule",{value:!0}),_a.decodeFunctionResult=o;const e=Te(),t=ir(),n=Gt(),r="/docs/contract/decodeFunctionResult";function o(s){const{abi:i,args:a,functionName:c,data:u}=s;let l=i[0];if(c){const b=(0,n.getAbiItem)({abi:i,args:a,name:c});if(!b)throw new e.AbiFunctionNotFoundError(c,{docsPath:r});l=b}if(l.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:r});if(!l.outputs)throw new e.AbiFunctionOutputsNotFoundError(l.name,{docsPath:r});const f=(0,t.decodeAbiParameters)(l.outputs,u);if(f&&f.length>1)return f;if(f&&f.length===1)return f[0]}return _a}var ao={},so={},de={},le={},co={},an={},uo={},Qb;function Lv(){return Qb||(Qb=1,Object.defineProperty(uo,"__esModule",{value:!0}),uo.version=void 0,uo.version="0.1.1"),uo}var $b;function Dv(){if($b)return an;$b=1,Object.defineProperty(an,"__esModule",{value:!0}),an.getUrl=t,an.getVersion=n,an.prettyPrint=r;const e=Lv();function t(o){return o}function n(){return e.version}function r(o){if(!o)return"";const s=Object.entries(o).map(([a,c])=>c===void 0||c===!1?null:[a,c]).filter(Boolean),i=s.reduce((a,[c])=>Math.max(a,c.length),0);return s.map(([a,c])=>` ${`${a}:`.padEnd(i+1)} ${c}`).join(`
41
+ `)}return an}var em;function ot(){if(em)return co;em=1,Object.defineProperty(co,"__esModule",{value:!0}),co.BaseError=void 0;const e=Dv();class t extends Error{static setStaticOptions(o){t.prototype.docsOrigin=o.docsOrigin,t.prototype.showVersion=o.showVersion,t.prototype.version=o.version}constructor(o,s={}){const i=(()=>{if(s.cause instanceof t){if(s.cause.details)return s.cause.details;if(s.cause.shortMessage)return s.cause.shortMessage}return s.cause&&"details"in s.cause&&typeof s.cause.details=="string"?s.cause.details:s.cause?.message?s.cause.message:s.details})(),a=s.cause instanceof t&&s.cause.docsPath||s.docsPath,c=s.docsOrigin??t.prototype.docsOrigin,u=`${c}${a??""}`,l=!!(s.version??t.prototype.showVersion),f=s.version??t.prototype.version,b=[o||"An error occurred.",...s.metaMessages?["",...s.metaMessages]:[],...i||a||l?["",i?`Details: ${i}`:void 0,a?`See: ${u}`:void 0,l?`Version: ${f}`:void 0]:[]].filter(y=>typeof y=="string").join(`
42
+ `);super(b,s.cause?{cause:s.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=s.cause,this.details=i,this.docs=u,this.docsOrigin=c,this.docsPath=a,this.shortMessage=o,this.showVersion=l,this.version=f}walk(o){return n(this,o)}}co.BaseError=t,Object.defineProperty(t,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${(0,e.getVersion)()}`}}),t.setStaticOptions(t.defaultStaticOptions);function n(r,o){return o?.(r)?r:r&&typeof r=="object"&&"cause"in r&&r.cause?n(r.cause,o):o?null:r}return co}var Od={},tm;function hg(){return tm||(tm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.charCodeMap=void 0,e.assertSize=n,e.assertStartOffset=r,e.assertEndOffset=o,e.charCodeToBase16=s,e.pad=i,e.trim=a;const t=Tt();function n(c,u){if(t.size(c)>u)throw new t.SizeOverflowError({givenSize:t.size(c),maxSize:u})}function r(c,u){if(typeof u=="number"&&u>0&&u>t.size(c)-1)throw new t.SliceOffsetOutOfBoundsError({offset:u,position:"start",size:t.size(c)})}function o(c,u,l){if(typeof u=="number"&&typeof l=="number"&&t.size(c)!==l-u)throw new t.SliceOffsetOutOfBoundsError({offset:l,position:"end",size:t.size(c)})}e.charCodeMap={zero:48,nine:57,A:65,F:70,a:97,f:102};function s(c){if(c>=e.charCodeMap.zero&&c<=e.charCodeMap.nine)return c-e.charCodeMap.zero;if(c>=e.charCodeMap.A&&c<=e.charCodeMap.F)return c-(e.charCodeMap.A-10);if(c>=e.charCodeMap.a&&c<=e.charCodeMap.f)return c-(e.charCodeMap.a-10)}function i(c,u={}){const{dir:l,size:f=32}=u;if(f===0)return c;if(c.length>f)throw new t.SizeExceedsPaddingSizeError({size:c.length,targetSize:f,type:"Bytes"});const b=new Uint8Array(f);for(let y=0;y<f;y++){const h=l==="right";b[h?y:f-y-1]=c[h?y:c.length-y-1]}return b}function a(c,u={}){const{dir:l="left"}=u;let f=c,b=0;for(let y=0;y<f.length-1&&f[l==="left"?y:f.length-y-1].toString()==="0";y++)b++;return f=l==="left"?f.slice(b):f.slice(0,f.length-b),f}})(Od)),Od}var $t={},rm;function yg(){if(rm)return $t;rm=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.assertSize=t,$t.assertStartOffset=n,$t.assertEndOffset=r,$t.pad=o,$t.trim=s;const e=ke();function t(i,a){if(e.size(i)>a)throw new e.SizeOverflowError({givenSize:e.size(i),maxSize:a})}function n(i,a){if(typeof a=="number"&&a>0&&a>e.size(i)-1)throw new e.SliceOffsetOutOfBoundsError({offset:a,position:"start",size:e.size(i)})}function r(i,a,c){if(typeof a=="number"&&typeof c=="number"&&e.size(i)!==c-a)throw new e.SliceOffsetOutOfBoundsError({offset:c,position:"end",size:e.size(i)})}function o(i,a={}){const{dir:c,size:u=32}=a;if(u===0)return i;const l=i.replace("0x","");if(l.length>u*2)throw new e.SizeExceedsPaddingSizeError({size:Math.ceil(l.length/2),targetSize:u,type:"Hex"});return`0x${l[c==="right"?"padEnd":"padStart"](u*2,"0")}`}function s(i,a={}){const{dir:c="left"}=a;let u=i.replace("0x",""),l=0;for(let f=0;f<u.length-1&&u[c==="left"?f:u.length-f-1].toString()==="0";f++)l++;return u=c==="left"?u.slice(l):u.slice(0,u.length-l),u==="0"?"0x":c==="right"&&u.length%2===1?`0x${u}0`:`0x${u}`}return $t}var fo={},nm;function Nu(){if(nm)return fo;nm=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.parse=t,fo.stringify=n;const e="#__bigint";function t(r,o){return JSON.parse(r,(s,i)=>{const a=i;return typeof a=="string"&&a.endsWith(e)?BigInt(a.slice(0,-e.length)):typeof o=="function"?o(s,a):a})}function n(r,o,s){return JSON.stringify(r,(i,a)=>typeof o=="function"?o(i,a):typeof a=="bigint"?a.toString()+e:a,s)}return fo}var om;function Tt(){if(om)return le;om=1,Object.defineProperty(le,"__esModule",{value:!0}),le.SizeExceedsPaddingSizeError=le.SliceOffsetOutOfBoundsError=le.SizeOverflowError=le.InvalidBytesTypeError=le.InvalidBytesBooleanError=void 0,le.assert=c,le.concat=u,le.from=l,le.fromArray=f,le.fromBoolean=b,le.fromHex=y,le.fromNumber=h,le.fromString=m,le.isEqual=E,le.padLeft=v,le.padRight=_,le.random=P,le.size=d,le.slice=j,le.toBigInt=g,le.toBoolean=p,le.toHex=T,le.toNumber=w,le.toString=A,le.trimLeft=C,le.trimRight=R,le.validate=S;const e=Dr(),t=ot(),n=ke(),r=hg(),o=yg(),s=Nu(),i=new TextDecoder,a=new TextEncoder;function c(B){if(!(B instanceof Uint8Array)){if(!B)throw new F(B);if(typeof B!="object")throw new F(B);if(!("BYTES_PER_ELEMENT"in B))throw new F(B);if(B.BYTES_PER_ELEMENT!==1||B.constructor.name!=="Uint8Array")throw new F(B)}}function u(...B){let q=0;for(const H of B)q+=H.length;const O=new Uint8Array(q);for(let H=0,N=0;H<B.length;H++){const U=B[H];O.set(U,N),N+=U.length}return O}function l(B){return B instanceof Uint8Array?B:typeof B=="string"?y(B):f(B)}function f(B){return B instanceof Uint8Array?B:new Uint8Array(B)}function b(B,q={}){const{size:O}=q,H=new Uint8Array(1);return H[0]=Number(B),typeof O=="number"?(r.assertSize(H,O),v(H,O)):H}function y(B,q={}){const{size:O}=q;let H=B;O&&(o.assertSize(B,O),H=n.padRight(B,O));let N=H.slice(2);N.length%2&&(N=`0${N}`);const U=N.length/2,z=new Uint8Array(U);for(let G=0,V=0;G<U;G++){const J=r.charCodeToBase16(N.charCodeAt(V++)),Z=r.charCodeToBase16(N.charCodeAt(V++));if(J===void 0||Z===void 0)throw new t.BaseError(`Invalid byte sequence ("${N[V-2]}${N[V-1]}" in "${N}").`);z[G]=J<<4|Z}return z}function h(B,q){const O=n.fromNumber(B,q);return y(O)}function m(B,q={}){const{size:O}=q,H=a.encode(B);return typeof O=="number"?(r.assertSize(H,O),_(H,O)):H}function E(B,q){return(0,e.equalBytes)(B,q)}function v(B,q){return r.pad(B,{dir:"left",size:q})}function _(B,q){return r.pad(B,{dir:"right",size:q})}function P(B){return crypto.getRandomValues(new Uint8Array(B))}function d(B){return B.length}function j(B,q,O,H={}){const{strict:N}=H;r.assertStartOffset(B,q);const U=B.slice(q,O);return N&&r.assertEndOffset(U,q,O),U}function g(B,q={}){const{size:O}=q;typeof O<"u"&&r.assertSize(B,O);const H=n.fromBytes(B,q);return n.toBigInt(H,q)}function p(B,q={}){const{size:O}=q;let H=B;if(typeof O<"u"&&(r.assertSize(H,O),H=C(H)),H.length>1||H[0]>1)throw new x(H);return!!H[0]}function T(B,q={}){return n.fromBytes(B,q)}function w(B,q={}){const{size:O}=q;typeof O<"u"&&r.assertSize(B,O);const H=n.fromBytes(B,q);return n.toNumber(H,q)}function A(B,q={}){const{size:O}=q;let H=B;return typeof O<"u"&&(r.assertSize(H,O),H=R(H)),i.decode(H)}function C(B){return r.trim(B,{dir:"left"})}function R(B){return r.trim(B,{dir:"right"})}function S(B){try{return c(B),!0}catch{return!1}}class x extends t.BaseError{constructor(q){super(`Bytes value \`${q}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}le.InvalidBytesBooleanError=x;class F extends t.BaseError{constructor(q){super(`Value \`${typeof q=="object"?s.stringify(q):q}\` of type \`${typeof q}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}le.InvalidBytesTypeError=F;class M extends t.BaseError{constructor({givenSize:q,maxSize:O}){super(`Size cannot exceed \`${O}\` bytes. Given size: \`${q}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}le.SizeOverflowError=M;class I extends t.BaseError{constructor({offset:q,position:O,size:H}){super(`Slice ${O==="start"?"starting":"ending"} at offset \`${q}\` is out-of-bounds (size: \`${H}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}}le.SliceOffsetOutOfBoundsError=I;class k extends t.BaseError{constructor({size:q,targetSize:O,type:H}){super(`${H.charAt(0).toUpperCase()}${H.slice(1).toLowerCase()} size (\`${q}\`) exceeds padding size (\`${O}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}return le.SizeExceedsPaddingSizeError=k,le}var im;function ke(){if(im)return de;im=1,Object.defineProperty(de,"__esModule",{value:!0}),de.SizeExceedsPaddingSizeError=de.SliceOffsetOutOfBoundsError=de.SizeOverflowError=de.InvalidLengthError=de.InvalidHexValueError=de.InvalidHexTypeError=de.InvalidHexBooleanError=de.IntegerOutOfRangeError=void 0,de.assert=c,de.concat=u,de.from=l,de.fromBoolean=f,de.fromBytes=b,de.fromNumber=y,de.fromString=h,de.isEqual=m,de.padLeft=E,de.padRight=v,de.random=_,de.slice=P,de.size=d,de.trimLeft=j,de.trimRight=g,de.toBigInt=p,de.toBoolean=T,de.toBytes=w,de.toNumber=A,de.toString=C,de.validate=R;const e=Dr(),t=Tt(),n=ot(),r=hg(),o=yg(),s=Nu(),i=new TextEncoder,a=Array.from({length:256},(O,H)=>H.toString(16).padStart(2,"0"));function c(O,H={}){const{strict:N=!1}=H;if(!O)throw new F(O);if(typeof O!="string")throw new F(O);if(N&&!/^0x[0-9a-fA-F]*$/.test(O))throw new M(O);if(!O.startsWith("0x"))throw new M(O)}function u(...O){return`0x${O.reduce((H,N)=>H+N.replace("0x",""),"")}`}function l(O){return O instanceof Uint8Array?b(O):Array.isArray(O)?b(new Uint8Array(O)):O}function f(O,H={}){const N=`0x${Number(O)}`;return typeof H.size=="number"?(o.assertSize(N,H.size),E(N,H.size)):N}function b(O,H={}){let N="";for(let z=0;z<O.length;z++)N+=a[O[z]];const U=`0x${N}`;return typeof H.size=="number"?(o.assertSize(U,H.size),v(U,H.size)):U}function y(O,H={}){const{signed:N,size:U}=H,z=BigInt(O);let G;U?N?G=(1n<<BigInt(U)*8n-1n)-1n:G=2n**(BigInt(U)*8n)-1n:typeof O=="number"&&(G=BigInt(Number.MAX_SAFE_INTEGER));const V=typeof G=="bigint"&&N?-G-1n:0;if(G&&z>G||z<V){const K=typeof O=="bigint"?"n":"";throw new S({max:G?`${G}${K}`:void 0,min:`${V}${K}`,signed:N,size:U,value:`${O}${K}`})}const Z=`0x${(N&&z<0?BigInt.asUintN(U*8,BigInt(z)):z).toString(16)}`;return U?E(Z,U):Z}function h(O,H={}){return b(i.encode(O),H)}function m(O,H){return(0,e.equalBytes)(t.fromHex(O),t.fromHex(H))}function E(O,H){return o.pad(O,{dir:"left",size:H})}function v(O,H){return o.pad(O,{dir:"right",size:H})}function _(O){return b(t.random(O))}function P(O,H,N,U={}){const{strict:z}=U;o.assertStartOffset(O,H);const G=`0x${O.replace("0x","").slice((H??0)*2,(N??O.length)*2)}`;return z&&o.assertEndOffset(G,H,N),G}function d(O){return Math.ceil((O.length-2)/2)}function j(O){return o.trim(O,{dir:"left"})}function g(O){return o.trim(O,{dir:"right"})}function p(O,H={}){const{signed:N}=H;H.size&&o.assertSize(O,H.size);const U=BigInt(O);if(!N)return U;const z=(O.length-2)/2,G=(1n<<BigInt(z)*8n)-1n,V=G>>1n;return U<=V?U:U-G-1n}function T(O,H={}){H.size&&o.assertSize(O,H.size);const N=j(O);if(N==="0x")return!1;if(N==="0x1")return!0;throw new x(O)}function w(O,H={}){return t.fromHex(O,H)}function A(O,H={}){const{signed:N,size:U}=H;return Number(!N&&!U?O:p(O,H))}function C(O,H={}){const{size:N}=H;let U=t.fromHex(O);return N&&(r.assertSize(U,N),U=t.trimRight(U)),new TextDecoder().decode(U)}function R(O,H={}){const{strict:N=!1}=H;try{return c(O,{strict:N}),!0}catch{return!1}}class S extends n.BaseError{constructor({max:H,min:N,signed:U,size:z,value:G}){super(`Number \`${G}\` is not in safe${z?` ${z*8}-bit`:""}${U?" signed":" unsigned"} integer range ${H?`(\`${N}\` to \`${H}\`)`:`(above \`${N}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}de.IntegerOutOfRangeError=S;class x extends n.BaseError{constructor(H){super(`Hex value \`"${H}"\` is not a valid boolean.`,{metaMessages:['The hex value must be `"0x0"` (false) or `"0x1"` (true).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexBooleanError"})}}de.InvalidHexBooleanError=x;class F extends n.BaseError{constructor(H){super(`Value \`${typeof H=="object"?s.stringify(H):H}\` of type \`${typeof H}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}de.InvalidHexTypeError=F;class M extends n.BaseError{constructor(H){super(`Value \`${H}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}de.InvalidHexValueError=M;class I extends n.BaseError{constructor(H){super(`Hex value \`"${H}"\` is an odd length (${H.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}de.InvalidLengthError=I;class k extends n.BaseError{constructor({givenSize:H,maxSize:N}){super(`Size cannot exceed \`${N}\` bytes. Given size: \`${H}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}de.SizeOverflowError=k;class B extends n.BaseError{constructor({offset:H,position:N,size:U}){super(`Slice ${N==="start"?"starting":"ending"} at offset \`${H}\` is out-of-bounds (size: \`${U}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}de.SliceOffsetOutOfBoundsError=B;class q extends n.BaseError{constructor({size:H,targetSize:N,type:U}){super(`${U.charAt(0).toUpperCase()}${U.slice(1).toLowerCase()} size (\`${H}\`) exceeds padding size (\`${N}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}return de.SizeExceedsPaddingSizeError=q,de}var lo={},am;function Gv(){if(am)return lo;am=1,Object.defineProperty(lo,"__esModule",{value:!0}),lo.fromRpc=t,lo.toRpc=n;const e=ke();function t(r){return{...r,amount:BigInt(r.amount),index:Number(r.index),validatorIndex:Number(r.validatorIndex)}}function n(r){return{address:r.address,amount:e.fromNumber(r.amount),index:e.fromNumber(r.index),validatorIndex:e.fromNumber(r.validatorIndex)}}return lo}var sm;function pg(){if(sm)return so;sm=1,Object.defineProperty(so,"__esModule",{value:!0}),so.fromRpc=n,so.toRpc=r;const e=ke(),t=Gv();function n(o){return{...o.baseFeePerGas&&{baseFeePerGas:BigInt(o.baseFeePerGas)},...o.blobBaseFee&&{blobBaseFee:BigInt(o.blobBaseFee)},...o.feeRecipient&&{feeRecipient:o.feeRecipient},...o.gasLimit&&{gasLimit:BigInt(o.gasLimit)},...o.number&&{number:BigInt(o.number)},...o.prevRandao&&{prevRandao:BigInt(o.prevRandao)},...o.time&&{time:BigInt(o.time)},...o.withdrawals&&{withdrawals:o.withdrawals.map(t.fromRpc)}}}function r(o){return{...typeof o.baseFeePerGas=="bigint"&&{baseFeePerGas:e.fromNumber(o.baseFeePerGas)},...typeof o.blobBaseFee=="bigint"&&{blobBaseFee:e.fromNumber(o.blobBaseFee)},...typeof o.feeRecipient=="string"&&{feeRecipient:o.feeRecipient},...typeof o.gasLimit=="bigint"&&{gasLimit:e.fromNumber(o.gasLimit)},...typeof o.number=="bigint"&&{number:e.fromNumber(o.number)},...typeof o.prevRandao=="bigint"&&{prevRandao:e.fromNumber(o.prevRandao)},...typeof o.time=="bigint"&&{time:e.fromNumber(o.time)},...o.withdrawals&&{withdrawals:o.withdrawals.map(t.toRpc)}}}return so}var ye={},cm;function lr(){if(cm)return ye;cm=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.erc4626Abi=ye.erc721Abi=ye.erc1155Abi=ye.erc20Abi_bytes32=ye.erc20Abi=ye.erc6492SignatureValidatorAbi=ye.erc1271Abi=ye.addressResolverAbi=ye.textResolverAbi=ye.universalResolverReverseAbi=ye.universalResolverResolveAbi=ye.batchGatewayAbi=ye.multicall3Abi=void 0,ye.multicall3Abi=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],ye.batchGatewayAbi=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}];const e=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}];return ye.universalResolverResolveAbi=[...e,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],ye.universalResolverReverseAbi=[...e,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],ye.textResolverAbi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],ye.addressResolverAbi=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],ye.erc1271Abi=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],ye.erc6492SignatureValidatorAbi=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],ye.erc20Abi=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],ye.erc20Abi_bytes32=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],ye.erc1155Abi=[{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC1155InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC1155InvalidApprover",type:"error"},{inputs:[{internalType:"uint256",name:"idsLength",type:"uint256"},{internalType:"uint256",name:"valuesLength",type:"uint256"}],name:"ERC1155InvalidArrayLength",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"ERC1155InvalidOperator",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC1155InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC1155InvalidSender",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"owner",type:"address"}],name:"ERC1155MissingApprovalForAll",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",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:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],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:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],ye.erc721Abi=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"event",name:"ApprovalForAll",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"operator",type:"address"},{indexed:!1,name:"approved",type:"bool"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"payable",inputs:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"getApproved",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"address"}]},{type:"function",name:"isApprovedForAll",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"operator",type:"address"}],outputs:[{type:"bool"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"ownerOf",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"owner",type:"address"}]},{type:"function",name:"safeTransferFrom",stateMutability:"payable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"safeTransferFrom",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]},{type:"function",name:"setApprovalForAll",stateMutability:"nonpayable",inputs:[{name:"operator",type:"address"},{name:"approved",type:"bool"}],outputs:[]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"index",type:"uint256"}],outputs:[{type:"uint256"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"index",type:"uint256"}],outputs:[{name:"tokenId",type:"uint256"}]},{type:"function",name:"tokenURI",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transferFrom",stateMutability:"payable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]}],ye.erc4626Abi=[{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!0,name:"owner",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Withdraw",type:"event"},{inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],name:"allowance",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],name:"approve",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"asset",outputs:[{name:"assetTokenAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"balanceOf",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"convertToAssets",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"convertToShares",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"}],name:"deposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxDeposit",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxMint",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxRedeem",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxWithdraw",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"}],name:"mint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewDeposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewMint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewRedeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewWithdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"redeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"totalAssets",outputs:[{name:"totalManagedAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transfer",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"withdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"}],ye}var bo={},um;function Vv(){return um||(um=1,Object.defineProperty(bo,"__esModule",{value:!0}),bo.aggregate3Signature=void 0,bo.aggregate3Signature="0x82ad56cb"),bo}var bt={},dm;function Go(){return dm||(dm=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.multicall3Bytecode=bt.erc6492SignatureValidatorByteCode=bt.deploylessCallViaFactoryBytecode=bt.deploylessCallViaBytecodeBytecode=void 0,bt.deploylessCallViaBytecodeBytecode="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",bt.deploylessCallViaFactoryBytecode="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",bt.erc6492SignatureValidatorByteCode="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",bt.multicall3Bytecode="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033"),bt}var et={},fm;function Vo(){if(fm)return et;fm=1,Object.defineProperty(et,"__esModule",{value:!0}),et.InvalidChainIdError=et.ClientChainNotConfiguredError=et.ChainNotFoundError=et.ChainMismatchError=et.ChainDoesNotSupportContract=void 0;const e=ue();class t extends e.BaseError{constructor({blockNumber:a,chain:c,contract:u}){super(`Chain "${c.name}" does not support contract "${u.name}".`,{metaMessages:["This could be due to any of the following:",...a&&u.blockCreated&&u.blockCreated>a?[`- The contract "${u.name}" was not deployed until block ${u.blockCreated} (current block ${a}).`]:[`- The chain does not have the contract "${u.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}et.ChainDoesNotSupportContract=t;class n extends e.BaseError{constructor({chain:a,currentChainId:c}){super(`The current chain of the wallet (id: ${c}) does not match the target chain for the transaction (id: ${a.id} – ${a.name}).`,{metaMessages:[`Current Chain ID: ${c}`,`Expected Chain ID: ${a.id} – ${a.name}`],name:"ChainMismatchError"})}}et.ChainMismatchError=n;class r extends e.BaseError{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
43
+ `),{name:"ChainNotFoundError"})}}et.ChainNotFoundError=r;class o extends e.BaseError{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}et.ClientChainNotConfiguredError=o;class s extends e.BaseError{constructor({chainId:a}){super(typeof a=="number"?`Chain ID "${a}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}return et.InvalidChainIdError=s,et}var va={},lm;function Wo(){if(lm)return va;lm=1,Object.defineProperty(va,"__esModule",{value:!0}),va.encodeDeployData=o;const e=Te(),t=Ce(),n=pt(),r="/docs/contract/encodeDeployData";function o(s){const{abi:i,args:a,bytecode:c}=s;if(!a||a.length===0)return c;const u=i.find(f=>"type"in f&&f.type==="constructor");if(!u)throw new e.AbiConstructorNotFoundError({docsPath:r});if(!("inputs"in u))throw new e.AbiConstructorParamsNotFoundError({docsPath:r});if(!u.inputs||u.inputs.length===0)throw new e.AbiConstructorParamsNotFoundError({docsPath:r});const l=(0,n.encodeAbiParameters)(u.inputs,a);return(0,t.concatHex)([c,l])}return va}var Ea={},bm;function br(){if(bm)return Ea;bm=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.getChainContractAddress=t;const e=Vo();function t({blockNumber:n,chain:r,contract:o}){const s=r?.contracts?.[o];if(!s)throw new e.ChainDoesNotSupportContract({chain:r,contract:{name:o}});if(n&&s.blockCreated&&s.blockCreated>n)throw new e.ChainDoesNotSupportContract({blockNumber:n,chain:r,contract:{name:o,blockCreated:s.blockCreated}});return s.address}return Ea}var ja={},mm;function hf(){if(mm)return ja;mm=1,Object.defineProperty(ja,"__esModule",{value:!0}),ja.getCallError=r;const e=ar(),t=Vt(),n=ko();function r(o,{docsPath:s,...i}){const a=(()=>{const c=(0,n.getNodeError)(o,i);return c instanceof t.UnknownNodeError?o:c})();return new e.CallExecutionError(a,{docsPath:s,...i})}return ja}var wa={},Pa={},hm;function yf(){if(hm)return Pa;hm=1,Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.withResolvers=e;function e(){let t=()=>{},n=()=>{};return{promise:new Promise((o,s)=>{t=o,n=s}),resolve:t,reject:n}}return Pa}var ym;function pf(){if(ym)return wa;ym=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.createBatchScheduler=n;const e=yf(),t=new Map;function n({fn:r,id:o,shouldSplitBatch:s,wait:i=0,sort:a}){const c=async()=>{const y=f();u();const h=y.map(({args:m})=>m);h.length!==0&&r(h).then(m=>{a&&Array.isArray(m)&&m.sort(a);for(let E=0;E<y.length;E++){const{resolve:v}=y[E];v?.([m[E],m])}}).catch(m=>{for(let E=0;E<y.length;E++){const{reject:v}=y[E];v?.(m)}})},u=()=>t.delete(o),l=()=>f().map(({args:y})=>y),f=()=>t.get(o)||[],b=y=>t.set(o,[...f(),y]);return{flush:u,async schedule(y){const{promise:h,resolve:m,reject:E}=(0,e.withResolvers)();return s?.([...l(),y])&&c(),f().length>0?(b({args:y,resolve:m,reject:E}),h):(b({args:y,resolve:m,reject:E}),setTimeout(c,i),h)}}}return wa}var xd={},zt={},pm;function Wv(){if(pm)return zt;pm=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.OffchainLookupSenderMismatchError=zt.OffchainLookupResponseMalformedError=zt.OffchainLookupError=void 0;const e=He(),t=ue(),n=tf();class r extends t.BaseError{constructor({callbackSelector:a,cause:c,data:u,extraData:l,sender:f,urls:b}){super(c.shortMessage||"An error occurred while fetching for an offchain result.",{cause:c,metaMessages:[...c.metaMessages||[],c.metaMessages?.length?"":[],"Offchain Gateway Call:",b&&[" Gateway URL(s):",...b.map(y=>` ${(0,n.getUrl)(y)}`)],` Sender: ${f}`,` Data: ${u}`,` Callback selector: ${a}`,` Extra data: ${l}`].flat(),name:"OffchainLookupError"})}}zt.OffchainLookupError=r;class o extends t.BaseError{constructor({result:a,url:c}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${(0,n.getUrl)(c)}`,`Response: ${(0,e.stringify)(a)}`],name:"OffchainLookupResponseMalformedError"})}}zt.OffchainLookupResponseMalformedError=o;class s extends t.BaseError{constructor({sender:a,to:c}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${c}`,`OffchainLookup sender address: ${a}`],name:"OffchainLookupSenderMismatchError"})}}return zt.OffchainLookupSenderMismatchError=s,zt}var Cd={},Aa={},gm;function gf(){if(gm)return Aa;gm=1,Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.decodeFunctionData=s;const e=Te(),t=at(),n=zr(),r=ir(),o=Lt();function s(i){const{abi:a,data:c}=i,u=(0,t.slice)(c,0,4),l=a.find(f=>f.type==="function"&&u===(0,n.toFunctionSelector)((0,o.formatAbiItem)(f)));if(!l)throw new e.AbiFunctionSignatureNotFoundError(u,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:l.name,args:"inputs"in l&&l.inputs&&l.inputs.length>0?(0,r.decodeAbiParameters)(l.inputs,(0,t.slice)(c,4)):void 0}}return Aa}var Ta={},_m;function _f(){if(_m)return Ta;_m=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.encodeErrorResult=a;const e=Te(),t=Ce(),n=zr(),r=pt(),o=Lt(),s=Gt(),i="/docs/contract/encodeErrorResult";function a(c){const{abi:u,errorName:l,args:f}=c;let b=u[0];if(l){const E=(0,s.getAbiItem)({abi:u,args:f,name:l});if(!E)throw new e.AbiErrorNotFoundError(l,{docsPath:i});b=E}if(b.type!=="error")throw new e.AbiErrorNotFoundError(void 0,{docsPath:i});const y=(0,o.formatAbiItem)(b),h=(0,n.toFunctionSelector)(y);let m="0x";if(f&&f.length>0){if(!b.inputs)throw new e.AbiErrorInputsNotFoundError(b.name,{docsPath:i});m=(0,r.encodeAbiParameters)(b.inputs,f)}return(0,t.concatHex)([h,m])}return Ta}var Ia={},vm;function vf(){if(vm)return Ia;vm=1,Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.encodeFunctionResult=o;const e=Te(),t=pt(),n=Gt(),r="/docs/contract/encodeFunctionResult";function o(s){const{abi:i,functionName:a,result:c}=s;let u=i[0];if(a){const f=(0,n.getAbiItem)({abi:i,name:a});if(!f)throw new e.AbiFunctionNotFoundError(a,{docsPath:r});u=f}if(u.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:r});if(!u.outputs)throw new e.AbiFunctionOutputsNotFoundError(u.name,{docsPath:r});const l=(()=>{if(u.outputs.length===0)return[];if(u.outputs.length===1)return[c];if(Array.isArray(c))return c;throw new e.InvalidArrayError(c)})();return(0,t.encodeAbiParameters)(u.outputs,l)}return Ia}var Em;function zu(){return Em||(Em=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.localBatchGatewayUrl=void 0,e.localBatchGatewayRequest=i;const t=lr(),n=Qd(),r=gf(),o=_f(),s=vf();e.localBatchGatewayUrl="x-batch-gateway:true";async function i(c){const{data:u,ccipRequest:l}=c,{args:[f]}=(0,r.decodeFunctionData)({abi:t.batchGatewayAbi,data:u}),b=[],y=[];return await Promise.all(f.map(async(h,m)=>{try{y[m]=h.urls.includes(e.localBatchGatewayUrl)?await i({data:h.data,ccipRequest:l}):await l(h),b[m]=!1}catch(E){b[m]=!0,y[m]=a(E)}})),(0,s.encodeFunctionResult)({abi:t.batchGatewayAbi,functionName:"query",result:[b,y]})}function a(c){return c.name==="HttpRequestError"&&c.status?(0,o.encodeErrorResult)({abi:t.batchGatewayAbi,errorName:"HttpError",args:[c.status,c.shortMessage]}):(0,o.encodeErrorResult)({abi:[n.solidityError],errorName:"Error",args:["shortMessage"in c?c.shortMessage:c.message]})}})(Cd)),Cd}var jm;function Ef(){return jm||(jm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.offchainLookupAbiItem=e.offchainLookupSignature=void 0,e.offchainLookup=f,e.ccipRequest=b;const t=Ko(),n=Wv(),r=gt(),o=Bu(),s=pt(),i=Et(),a=Ce(),c=De(),u=zu(),l=He();e.offchainLookupSignature="0x556f1830",e.offchainLookupAbiItem={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function f(y,{blockNumber:h,blockTag:m,data:E,to:v}){const{args:_}=(0,o.decodeErrorResult)({data:E,abi:[e.offchainLookupAbiItem]}),[P,d,j,g,p]=_,{ccipRead:T}=y,w=T&&typeof T?.request=="function"?T.request:b;try{if(!(0,i.isAddressEqual)(v,P))throw new n.OffchainLookupSenderMismatchError({sender:P,to:v});const A=d.includes(u.localBatchGatewayUrl)?await(0,u.localBatchGatewayRequest)({data:j,ccipRequest:w}):await w({data:j,sender:P,urls:d}),{data:C}=await(0,t.call)(y,{blockNumber:h,blockTag:m,data:(0,a.concat)([g,(0,s.encodeAbiParameters)([{type:"bytes"},{type:"bytes"}],[A,p])]),to:v});return C}catch(A){throw new n.OffchainLookupError({callbackSelector:g,cause:A,data:E,extraData:p,sender:P,urls:d})}}async function b({data:y,sender:h,urls:m}){let E=new Error("An unknown error occurred.");for(let v=0;v<m.length;v++){const _=m[v],P=_.includes("{data}")?"GET":"POST",d=P==="POST"?{data:y,sender:h}:void 0,j=P==="POST"?{"Content-Type":"application/json"}:{};try{const g=await fetch(_.replace("{sender}",h.toLowerCase()).replace("{data}",y),{body:JSON.stringify(d),headers:j,method:P});let p;if(g.headers.get("Content-Type")?.startsWith("application/json")?p=(await g.json()).data:p=await g.text(),!g.ok){E=new r.HttpRequestError({body:d,details:p?.error?(0,l.stringify)(p.error):g.statusText,headers:g.headers,status:g.status,url:_});continue}if(!(0,c.isHex)(p)){E=new n.OffchainLookupResponseMalformedError({result:p,url:_});continue}return p}catch(g){E=new r.HttpRequestError({body:d,details:g.message,url:_})}}throw E}})(xd)),xd}var wm;function Ko(){if(wm)return ao;wm=1,Object.defineProperty(ao,"__esModule",{value:!0}),ao.call=d,ao.getRevertErrorData=w;const e=rr(),t=pg(),n=Ie(),r=lr(),o=Vv(),s=Go(),i=ue(),a=Vo(),c=ar(),u=Kt(),l=Wo(),f=Je(),b=br(),y=te(),h=hf(),m=dr(),E=_t(),v=pf(),_=nf(),P=vt();async function d(A,C){const{account:R=A.account,authorizationList:S,batch:x=!!A.batch?.multicall,blockNumber:F,blockTag:M=A.experimental_blockTag??"latest",accessList:I,blobs:k,blockOverrides:B,code:q,data:O,factory:H,factoryData:N,gas:U,gasPrice:z,maxFeePerBlobGas:G,maxFeePerGas:V,maxPriorityFeePerGas:J,nonce:Z,to:K,value:Q,stateOverride:ie,...Y}=C,X=R?(0,n.parseAccount)(R):void 0;if(q&&(H||N))throw new i.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(q&&K)throw new i.BaseError("Cannot provide both `code` & `to` as parameters.");const ee=q&&O,ae=H&&N&&K&&O,oe=ee||ae,se=ee?p({code:q,data:O}):ae?T({data:O,factory:H,factoryData:N,to:K}):O;try{(0,P.assertRequest)(C);const $=(typeof F=="bigint"?(0,y.numberToHex)(F):void 0)||M,W=B?t.toRpc(B):void 0,we=(0,_.serializeStateOverride)(ie),Be=A.chain?.formatters?.transactionRequest?.format,qe=(Be||E.formatTransactionRequest)({...(0,m.extract)(Y,{format:Be}),accessList:I,account:X,authorizationList:S,blobs:k,data:se,gas:U,gasPrice:z,maxFeePerBlobGas:G,maxFeePerGas:V,maxPriorityFeePerGas:J,nonce:Z,to:oe?void 0:K,value:Q},"call");if(x&&j({request:qe})&&!we&&!W)try{return await g(A,{...qe,blockNumber:F,blockTag:M})}catch(xe){if(!(xe instanceof a.ClientChainNotConfiguredError)&&!(xe instanceof a.ChainDoesNotSupportContract))throw xe}const ct=(()=>{const xe=[qe,$];return we&&W?[...xe,we,W]:we?[...xe,we]:W?[...xe,{},W]:xe})(),Ge=await A.request({method:"eth_call",params:ct});return Ge==="0x"?{data:void 0}:{data:Ge}}catch(fe){const $=w(fe),{offchainLookup:W,offchainLookupSignature:we}=await Promise.resolve().then(()=>Ef());if(A.ccipRead!==!1&&$?.slice(0,10)===we&&K)return{data:await W(A,{data:$,to:K})};throw oe&&$?.slice(0,10)==="0x101bb98d"?new c.CounterfactualDeploymentFailedError({factory:H}):(0,h.getCallError)(fe,{...C,account:X,chain:A.chain})}}function j({request:A}){const{data:C,to:R,...S}=A;return!(!C||C.startsWith(o.aggregate3Signature)||!R||Object.values(S).filter(x=>typeof x<"u").length>0)}async function g(A,C){const{batchSize:R=1024,deployless:S=!1,wait:x=0}=typeof A.batch?.multicall=="object"?A.batch.multicall:{},{blockNumber:F,blockTag:M=A.experimental_blockTag??"latest",data:I,to:k}=C,B=(()=>{if(S)return null;if(C.multicallAddress)return C.multicallAddress;if(A.chain)return(0,b.getChainContractAddress)({blockNumber:F,chain:A.chain,contract:"multicall3"});throw new a.ClientChainNotConfiguredError})(),O=(typeof F=="bigint"?(0,y.numberToHex)(F):void 0)||M,{schedule:H}=(0,v.createBatchScheduler)({id:`${A.uid}.${O}`,wait:x,shouldSplitBatch(z){return z.reduce((V,{data:J})=>V+(J.length-2),0)>R*2},fn:async z=>{const G=z.map(Z=>({allowFailure:!0,callData:Z.data,target:Z.to})),V=(0,f.encodeFunctionData)({abi:r.multicall3Abi,args:[G],functionName:"aggregate3"}),J=await A.request({method:"eth_call",params:[{...B===null?{data:p({code:s.multicall3Bytecode,data:V})}:{to:B,data:V}},O]});return(0,u.decodeFunctionResult)({abi:r.multicall3Abi,args:[G],functionName:"aggregate3",data:J||"0x"})}}),[{returnData:N,success:U}]=await H({data:I,to:k});if(!U)throw new c.RawContractError({data:N});return N==="0x"?{data:void 0}:{data:N}}function p(A){const{code:C,data:R}=A;return(0,l.encodeDeployData)({abi:(0,e.parseAbi)(["constructor(bytes, bytes)"]),bytecode:s.deploylessCallViaBytecodeBytecode,args:[C,R]})}function T(A){const{data:C,factory:R,factoryData:S,to:x}=A;return(0,l.encodeDeployData)({abi:(0,e.parseAbi)(["constructor(address, bytes, address, bytes)"]),bytecode:s.deploylessCallViaFactoryBytecode,args:[x,C,R,S]})}function w(A){if(!(A instanceof i.BaseError))return;const C=A.walk();return typeof C?.data=="object"?C.data?.data:C.data}return ao}var Pm;function It(){if(Pm)return ga;Pm=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.readContract=s;const e=Kt(),t=Je(),n=cr(),r=me(),o=Ko();async function s(i,a){const{abi:c,address:u,args:l,functionName:f,...b}=a,y=(0,t.encodeFunctionData)({abi:c,args:l,functionName:f});try{const{data:h}=await(0,r.getAction)(i,o.call,"call")({...b,data:y,to:u});return(0,e.decodeFunctionResult)({abi:c,args:l,functionName:f,data:h||"0x"})}catch(h){throw(0,n.getContractError)(h,{abi:c,address:u,args:l,docsPath:"/docs/contract/readContract",functionName:f})}}return ga}var Sa={},Am;function gg(){if(Am)return Sa;Am=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.simulateContract=i;const e=Ie(),t=Kt(),n=Je(),r=cr(),o=me(),s=Ko();async function i(a,c){const{abi:u,address:l,args:f,dataSuffix:b,functionName:y,...h}=c,m=h.account?(0,e.parseAccount)(h.account):a.account,E=(0,n.encodeFunctionData)({abi:u,args:f,functionName:y});try{const{data:v}=await(0,o.getAction)(a,s.call,"call")({batch:!1,data:`${E}${b?b.replace("0x",""):""}`,to:l,...h,account:m}),_=(0,t.decodeFunctionResult)({abi:u,args:f,functionName:y,data:v||"0x"}),P=u.filter(d=>"name"in d&&d.name===c.functionName);return{result:_,request:{abi:P,address:l,args:f,dataSuffix:b,functionName:y,...h,account:m}}}catch(v){throw(0,r.getContractError)(v,{abi:u,address:l,args:f,docsPath:"/docs/contract/simulateContract",functionName:y,sender:m?.address})}}return Sa}var Ra={},qd={},Tm;function Wr(){return Tm||(Tm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.cleanupCache=e.listenersCache=void 0,e.observe=n,e.listenersCache=new Map,e.cleanupCache=new Map;let t=0;function n(r,o,s){const i=++t,a=()=>e.listenersCache.get(r)||[],c=()=>{const y=a();e.listenersCache.set(r,y.filter(h=>h.id!==i))},u=()=>{const y=a();if(!y.some(m=>m.id===i))return;const h=e.cleanupCache.get(r);if(y.length===1&&h){const m=h();m instanceof Promise&&m.catch(()=>{})}c()},l=a();if(e.listenersCache.set(r,[...l,{id:i,fns:o}]),l&&l.length>0)return u;const f={};for(const y in o)f[y]=((...h)=>{const m=a();if(m.length!==0)for(const E of m)E.fns[y]?.(...h)});const b=s(f);return typeof b=="function"&&e.cleanupCache.set(r,b),u}})(qd)),qd}var Ba={},Oa={},Im;function jf(){if(Im)return Oa;Im=1,Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.wait=e;async function e(t){return new Promise(n=>setTimeout(n,t))}return Oa}var Sm;function En(){if(Sm)return Ba;Sm=1,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.poll=t;const e=jf();function t(n,{emitOnBegin:r,initialWaitTime:o,interval:s}){let i=!0;const a=()=>i=!1;return(async()=>{let u;r&&(u=await n({unpoll:a}));const l=await o?.(u)??s;await(0,e.wait)(l);const f=async()=>{i&&(await n({unpoll:a}),await(0,e.wait)(s),f())};f()})(),a}return Ba}var mo={},Md={},Rm;function _g(){return Rm||(Rm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.responseCache=e.promiseCache=void 0,e.getCache=t,e.withCache=n,e.promiseCache=new Map,e.responseCache=new Map;function t(r){const o=(a,c)=>({clear:()=>c.delete(a),get:()=>c.get(a),set:u=>c.set(a,u)}),s=o(r,e.promiseCache),i=o(r,e.responseCache);return{clear:()=>{s.clear(),i.clear()},promise:s,response:i}}async function n(r,{cacheKey:o,cacheTime:s=Number.POSITIVE_INFINITY}){const i=t(o),a=i.response.get();if(a&&s>0&&Date.now()-a.created.getTime()<s)return a.data;let c=i.promise.get();c||(c=r(),i.promise.set(c));try{const u=await c;return i.response.set({created:new Date,data:u}),u}finally{i.promise.clear()}}})(Md)),Md}var Bm;function Zo(){if(Bm)return mo;Bm=1,Object.defineProperty(mo,"__esModule",{value:!0}),mo.getBlockNumberCache=n,mo.getBlockNumber=r;const e=_g(),t=o=>`blockNumber.${o}`;function n(o){return(0,e.getCache)(t(o))}async function r(o,{cacheTime:s=o.cacheTime}={}){const i=await(0,e.withCache)(()=>o.request({method:"eth_blockNumber"}),{cacheKey:t(o.uid),cacheTime:s});return BigInt(i)}return mo}var xa={},Om;function Uu(){if(Om)return xa;Om=1,Object.defineProperty(xa,"__esModule",{value:!0}),xa.getFilterChanges=n;const e=Do(),t=Wt();async function n(r,{filter:o}){const s="strict"in o&&o.strict,i=await o.request({method:"eth_getFilterChanges",params:[o.id]});if(typeof i[0]=="string")return i;const a=i.map(c=>(0,t.formatLog)(c));return!("abi"in o)||!o.abi?a:(0,e.parseEventLogs)({abi:o.abi,logs:a,strict:s})}return xa}var Ca={},xm;function Lu(){if(xm)return Ca;xm=1,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.uninstallFilter=e;async function e(t,{filter:n}){return n.request({method:"eth_uninstallFilter",params:[n.id]})}return Ca}var Cm;function vg(){if(Cm)return Ra;Cm=1,Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.watchContractEvent=h;const e=Te(),t=sr(),n=Lo(),r=Ur(),o=Wt(),s=me(),i=Wr(),a=En(),c=He(),u=Xd(),l=Zo(),f=mf(),b=Uu(),y=Lu();function h(m,E){const{abi:v,address:_,args:P,batch:d=!0,eventName:j,fromBlock:g,onError:p,onLogs:T,poll:w,pollingInterval:A=m.pollingInterval,strict:C}=E;return(typeof w<"u"?w:typeof g=="bigint"?!0:!(m.transport.type==="webSocket"||m.transport.type==="ipc"||m.transport.type==="fallback"&&(m.transport.transports[0].config.type==="webSocket"||m.transport.transports[0].config.type==="ipc")))?(()=>{const F=C??!1,M=(0,c.stringify)(["watchContractEvent",_,P,d,m.uid,j,A,F,g]);return(0,i.observe)(M,{onLogs:T,onError:p},I=>{let k;g!==void 0&&(k=g-1n);let B,q=!1;const O=(0,a.poll)(async()=>{if(!q){try{B=await(0,s.getAction)(m,u.createContractEventFilter,"createContractEventFilter")({abi:v,address:_,args:P,eventName:j,strict:F,fromBlock:g})}catch{}q=!0;return}try{let H;if(B)H=await(0,s.getAction)(m,b.getFilterChanges,"getFilterChanges")({filter:B});else{const N=await(0,s.getAction)(m,l.getBlockNumber,"getBlockNumber")({});k&&k<N?H=await(0,s.getAction)(m,f.getContractEvents,"getContractEvents")({abi:v,address:_,args:P,eventName:j,fromBlock:k+1n,toBlock:N,strict:F}):H=[],k=N}if(H.length===0)return;if(d)I.onLogs(H);else for(const N of H)I.onLogs([N])}catch(H){B&&H instanceof t.InvalidInputRpcError&&(q=!1),I.onError?.(H)}},{emitOnBegin:!0,interval:A});return async()=>{B&&await(0,s.getAction)(m,y.uninstallFilter,"uninstallFilter")({filter:B}),O()}})})():(()=>{const F=C??!1,M=(0,c.stringify)(["watchContractEvent",_,P,d,m.uid,j,A,F]);let I=!0,k=()=>I=!1;return(0,i.observe)(M,{onLogs:T,onError:p},B=>((async()=>{try{const q=(()=>{if(m.transport.type==="fallback"){const N=m.transport.transports.find(U=>U.config.type==="webSocket"||U.config.type==="ipc");return N?N.value:m.transport}return m.transport})(),O=j?(0,r.encodeEventTopics)({abi:v,eventName:j,args:P}):[],{unsubscribe:H}=await q.subscribe({params:["logs",{address:_,topics:O}],onData(N){if(!I)return;const U=N.result;try{const{eventName:z,args:G}=(0,n.decodeEventLog)({abi:v,data:U.data,topics:U.topics,strict:C}),V=(0,o.formatLog)(U,{args:G,eventName:z});B.onLogs([V])}catch(z){let G,V;if(z instanceof e.DecodeLogDataMismatch||z instanceof e.DecodeLogTopicsMismatch){if(C)return;G=z.abiItem.name,V=z.abiItem.inputs?.some(Z=>!("name"in Z&&Z.name))}const J=(0,o.formatLog)(U,{args:V?[]:{},eventName:G});B.onLogs([J])}},onError(N){B.onError?.(N)}});k=H,I||k()}catch(q){p?.(q)}})(),()=>k()))})()}return Ra}var ho={},Tr={},qm;function mr(){if(qm)return Tr;qm=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.AccountTypeNotSupportedError=Tr.AccountNotFoundError=void 0;const e=ue();class t extends e.BaseError{constructor({docsPath:o}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
44
+ `),{docsPath:o,docsSlug:"account",name:"AccountNotFoundError"})}}Tr.AccountNotFoundError=t;class n extends e.BaseError{constructor({docsPath:o,metaMessages:s,type:i}){super(`Account type "${i}" is not supported.`,{docsPath:o,metaMessages:s,name:"AccountTypeNotSupportedError"})}}return Tr.AccountTypeNotSupportedError=n,Tr}var qa={},Ma={},Mm;function Yo(){if(Mm)return Ma;Mm=1,Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.assertCurrentChain=t;const e=Vo();function t({chain:n,currentChainId:r}){if(!n)throw new e.ChainNotFoundError;if(r!==n.id)throw new e.ChainMismatchError({chain:n,currentChainId:r})}return Ma}var Ha={},Hm;function wf(){if(Hm)return Ha;Hm=1,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.sendRawTransaction=e;async function e(t,{serializedTransaction:n}){return t.request({method:"eth_sendRawTransaction",params:[n]},{retryCount:0})}return Ha}var km;function Du(){if(km)return qa;km=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.sendTransaction=m;const e=Ie(),t=mr(),n=ue(),r=Ho(),o=Yo(),s=zo(),i=dr(),a=_t(),c=me(),u=Nr(),l=vt(),f=fr(),b=Uo(),y=wf(),h=new u.LruMap(128);async function m(E,v){const{account:_=E.account,chain:P=E.chain,accessList:d,authorizationList:j,blobs:g,data:p,gas:T,gasPrice:w,maxFeePerBlobGas:A,maxFeePerGas:C,maxPriorityFeePerGas:R,nonce:S,type:x,value:F,...M}=v;if(typeof _>"u")throw new t.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const I=_?(0,e.parseAccount)(_):null;try{(0,l.assertRequest)(v);const k=await(async()=>{if(v.to)return v.to;if(v.to!==null&&j&&j.length>0)return await(0,r.recoverAuthorizationAddress)({authorization:j[0]}).catch(()=>{throw new n.BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if(I?.type==="json-rpc"||I===null){let B;P!==null&&(B=await(0,c.getAction)(E,f.getChainId,"getChainId")({}),(0,o.assertCurrentChain)({currentChainId:B,chain:P}));const q=E.chain?.formatters?.transactionRequest?.format,H=(q||a.formatTransactionRequest)({...(0,i.extract)(M,{format:q}),accessList:d,account:I,authorizationList:j,blobs:g,chainId:B,data:p,gas:T,gasPrice:w,maxFeePerBlobGas:A,maxFeePerGas:C,maxPriorityFeePerGas:R,nonce:S,to:k,type:x,value:F},"sendTransaction"),N=h.get(E.uid),U=N?"wallet_sendTransaction":"eth_sendTransaction";try{return await E.request({method:U,params:[H]},{retryCount:0})}catch(z){if(N===!1)throw z;const G=z;if(G.name==="InvalidInputRpcError"||G.name==="InvalidParamsRpcError"||G.name==="MethodNotFoundRpcError"||G.name==="MethodNotSupportedRpcError")return await E.request({method:"wallet_sendTransaction",params:[H]},{retryCount:0}).then(V=>(h.set(E.uid,!0),V)).catch(V=>{const J=V;throw J.name==="MethodNotFoundRpcError"||J.name==="MethodNotSupportedRpcError"?(h.set(E.uid,!1),G):J});throw G}}if(I?.type==="local"){const B=await(0,c.getAction)(E,b.prepareTransactionRequest,"prepareTransactionRequest")({account:I,accessList:d,authorizationList:j,blobs:g,chain:P,data:p,gas:T,gasPrice:w,maxFeePerBlobGas:A,maxFeePerGas:C,maxPriorityFeePerGas:R,nonce:S,nonceManager:I.nonceManager,parameters:[...b.defaultParameters,"sidecars"],type:x,value:F,...M,to:k}),q=P?.serializers?.transaction,O=await I.signTransaction(B,{serializer:q});return await(0,c.getAction)(E,y.sendRawTransaction,"sendRawTransaction")({serializedTransaction:O})}throw I?.type==="smart"?new t.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new t.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:I?.type})}catch(k){throw k instanceof t.AccountTypeNotSupportedError?k:(0,s.getTransactionError)(k,{...v,account:I,chain:v.chain||void 0})}}return qa}var Fm;function Pf(){if(Fm)return ho;Fm=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.writeContract=i;const e=Ie(),t=mr(),n=Je(),r=cr(),o=me(),s=Du();async function i(a,c){return i.internal(a,s.sendTransaction,"sendTransaction",c)}return(function(a){async function c(u,l,f,b){const{abi:y,account:h=u.account,address:m,args:E,dataSuffix:v,functionName:_,...P}=b;if(typeof h>"u")throw new t.AccountNotFoundError({docsPath:"/docs/contract/writeContract"});const d=h?(0,e.parseAccount)(h):null,j=(0,n.encodeFunctionData)({abi:y,args:E,functionName:_});try{return await(0,o.getAction)(u,l,f)({data:`${j}${v?v.replace("0x",""):""}`,to:m,account:d,...P})}catch(g){throw(0,r.getContractError)(g,{abi:y,address:m,args:E,docsPath:"/docs/contract/writeContract",functionName:_,sender:d?.address})}}a.internal=c})(i||(ho.writeContract=i={})),ho}var Nm;function Kv(){if(Nm)return Jr;Nm=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.getContract=c,Jr.getFunctionParameters=u,Jr.getEventParameters=l;const e=me(),t=Xd(),n=mg(),r=mf(),o=It(),s=gg(),i=vg(),a=Pf();function c({abi:f,address:b,client:y}){const h=y,[m,E]=h?"public"in h&&"wallet"in h?[h.public,h.wallet]:"public"in h?[h.public,void 0]:"wallet"in h?[void 0,h.wallet]:[h,h]:[void 0,void 0],v=m!=null,_=E!=null,P={};let d=!1,j=!1,g=!1;for(const p of f)if(p.type==="function"?p.stateMutability==="view"||p.stateMutability==="pure"?d=!0:j=!0:p.type==="event"&&(g=!0),d&&j&&g)break;return v&&(d&&(P.read=new Proxy({},{get(p,T){return(...w)=>{const{args:A,options:C}=u(w);return(0,e.getAction)(m,o.readContract,"readContract")({abi:f,address:b,functionName:T,args:A,...C})}}})),j&&(P.simulate=new Proxy({},{get(p,T){return(...w)=>{const{args:A,options:C}=u(w);return(0,e.getAction)(m,s.simulateContract,"simulateContract")({abi:f,address:b,functionName:T,args:A,...C})}}})),g&&(P.createEventFilter=new Proxy({},{get(p,T){return(...w)=>{const A=f.find(S=>S.type==="event"&&S.name===T),{args:C,options:R}=l(w,A);return(0,e.getAction)(m,t.createContractEventFilter,"createContractEventFilter")({abi:f,address:b,eventName:T,args:C,...R})}}}),P.getEvents=new Proxy({},{get(p,T){return(...w)=>{const A=f.find(S=>S.type==="event"&&S.name===T),{args:C,options:R}=l(w,A);return(0,e.getAction)(m,r.getContractEvents,"getContractEvents")({abi:f,address:b,eventName:T,args:C,...R})}}}),P.watchEvent=new Proxy({},{get(p,T){return(...w)=>{const A=f.find(S=>S.type==="event"&&S.name===T),{args:C,options:R}=l(w,A);return(0,e.getAction)(m,i.watchContractEvent,"watchContractEvent")({abi:f,address:b,eventName:T,args:C,...R})}}}))),_&&j&&(P.write=new Proxy({},{get(p,T){return(...w)=>{const{args:A,options:C}=u(w);return(0,e.getAction)(E,a.writeContract,"writeContract")({abi:f,address:b,functionName:T,args:A,...C})}}})),(v||_)&&j&&(P.estimateGas=new Proxy({},{get(p,T){return(...w)=>{const{args:A,options:C}=u(w),R=m??E;return(0,e.getAction)(R,n.estimateContractGas,"estimateContractGas")({abi:f,address:b,functionName:T,args:A,...C,account:C.account??E.account})}}})),P.address=b,P.abi=f,P}function u(f){const b=f.length&&Array.isArray(f[0]),y=b?f[0]:[],h=(b?f[1]:f[0])??{};return{args:y,options:h}}function l(f,b){let y=!1;Array.isArray(f[0])?y=!0:f.length===1?y=b.inputs.some(E=>E.indexed):f.length===2&&(y=!0);const h=y?f[0]:void 0,m=(y?f[1]:f[0])??{};return{args:h,options:m}}return Jr}var sn={},yo={},zm;function Eg(){if(zm)return yo;zm=1,Object.defineProperty(yo,"__esModule",{value:!0}),yo.BundleFailedError=void 0;const e=ue();class t extends e.BaseError{constructor(r){super(`Call bundle failed with status: ${r.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=r}}return yo.BundleFailedError=t,yo}var ka={},Um;function Gu(){if(Um)return ka;Um=1,Object.defineProperty(ka,"__esModule",{value:!0}),ka.withRetry=t;const e=jf();function t(n,{delay:r=100,retryCount:o=2,shouldRetry:s=()=>!0}={}){return new Promise((i,a)=>{const c=async({count:u=0}={})=>{const l=async({error:f})=>{const b=typeof r=="function"?r({count:u,error:f}):r;b&&await(0,e.wait)(b),c({count:u+1})};try{const f=await n();i(f)}catch(f){if(u<o&&await s({count:u,error:f}))return l({error:f});a(f)}};c()})}return ka}var Fa={},Hd={},Lm;function Jo(){return Lm||(Lm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defineTransactionReceipt=e.receiptStatuses=void 0,e.formatTransactionReceipt=s;const t=Re(),n=Fo(),r=Wt(),o=vn();e.receiptStatuses={"0x0":"reverted","0x1":"success"};function s(i,a){const c={...i,blockNumber:i.blockNumber?BigInt(i.blockNumber):null,contractAddress:i.contractAddress?i.contractAddress:null,cumulativeGasUsed:i.cumulativeGasUsed?BigInt(i.cumulativeGasUsed):null,effectiveGasPrice:i.effectiveGasPrice?BigInt(i.effectiveGasPrice):null,gasUsed:i.gasUsed?BigInt(i.gasUsed):null,logs:i.logs?i.logs.map(u=>(0,r.formatLog)(u)):null,to:i.to?i.to:null,transactionIndex:i.transactionIndex?(0,t.hexToNumber)(i.transactionIndex):null,status:i.status?e.receiptStatuses[i.status]:null,type:i.type?o.transactionType[i.type]||i.type:null};return i.blobGasPrice&&(c.blobGasPrice=BigInt(i.blobGasPrice)),i.blobGasUsed&&(c.blobGasUsed=BigInt(i.blobGasUsed)),c}e.defineTransactionReceipt=(0,n.defineFormatter)("transactionReceipt",s)})(Hd)),Hd}var kd={},Dm;function Af(){return Dm||(Dm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fallbackTransactionErrorMagicIdentifier=e.fallbackMagicIdentifier=void 0,e.sendCalls=l;const t=Ie(),n=ue(),r=sr(),o=Je(),s=Ce(),i=Re(),a=te(),c=zo(),u=Du();e.fallbackMagicIdentifier="0x5792579257925792579257925792579257925792579257925792579257925792",e.fallbackTransactionErrorMagicIdentifier=(0,a.numberToHex)(0,{size:32});async function l(f,b){const{account:y=f.account,capabilities:h,chain:m=f.chain,experimental_fallback:E,experimental_fallbackDelay:v=32,forceAtomic:_=!1,id:P,version:d="2.0.0"}=b,j=y?(0,t.parseAccount)(y):null,g=b.calls.map(p=>{const T=p,w=T.abi?(0,o.encodeFunctionData)({abi:T.abi,functionName:T.functionName,args:T.args}):T.data;return{data:T.dataSuffix&&w?(0,s.concat)([w,T.dataSuffix]):w,to:T.to,value:T.value?(0,a.numberToHex)(T.value):void 0}});try{const p=await f.request({method:"wallet_sendCalls",params:[{atomicRequired:_,calls:g,capabilities:h,chainId:(0,a.numberToHex)(m.id),from:j?.address,id:P,version:d}]},{retryCount:0});return typeof p=="string"?{id:p}:p}catch(p){const T=p;if(E&&(T.name==="MethodNotFoundRpcError"||T.name==="MethodNotSupportedRpcError"||T.name==="UnknownRpcError"||T.details.toLowerCase().includes("does not exist / is not available")||T.details.toLowerCase().includes("missing or invalid. request()")||T.details.toLowerCase().includes("did not match any variant of untagged enum")||T.details.toLowerCase().includes("account upgraded to unsupported contract")||T.details.toLowerCase().includes("eip-7702 not supported")||T.details.toLowerCase().includes("unsupported wc_ method")||T.details.toLowerCase().includes("feature toggled misconfigured")||T.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(h&&Object.values(h).some(S=>!S.optional)){const S="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new r.UnsupportedNonOptionalCapabilityError(new n.BaseError(S,{details:S}))}if(_&&g.length>1){const R="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new r.AtomicityNotSupportedError(new n.BaseError(R,{details:R}))}const w=[];for(const R of g){const S=(0,u.sendTransaction)(f,{account:j,chain:m,data:R.data,to:R.to,value:R.value?(0,i.hexToBigInt)(R.value):void 0});w.push(S),v>0&&await new Promise(x=>setTimeout(x,v))}const A=await Promise.allSettled(w);if(A.every(R=>R.status==="rejected"))throw A[0].reason;const C=A.map(R=>R.status==="fulfilled"?R.value:e.fallbackTransactionErrorMagicIdentifier);return{id:(0,s.concat)([...C,(0,a.numberToHex)(m.id,{size:32}),e.fallbackMagicIdentifier])}}throw(0,c.getTransactionError)(p,{...b,account:j,chain:b.chain})}}})(kd)),kd}var Gm;function jg(){if(Gm)return Fa;Gm=1,Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.getCallsStatus=s;const e=at(),t=Dt(),n=Re(),r=Jo(),o=Af();async function s(i,a){async function c(E){if(E.endsWith(o.fallbackMagicIdentifier.slice(2))){const _=(0,t.trim)((0,e.sliceHex)(E,-64,-32)),P=(0,e.sliceHex)(E,0,-64).slice(2).match(/.{1,64}/g),d=await Promise.all(P.map(g=>o.fallbackTransactionErrorMagicIdentifier.slice(2)!==g?i.request({method:"eth_getTransactionReceipt",params:[`0x${g}`]},{dedupe:!0}):void 0)),j=d.some(g=>g===null)?100:d.every(g=>g?.status==="0x1")?200:d.every(g=>g?.status==="0x0")?500:600;return{atomic:!1,chainId:(0,n.hexToNumber)(_),receipts:d.filter(Boolean),status:j,version:"2.0.0"}}return i.request({method:"wallet_getCallsStatus",params:[E]})}const{atomic:u=!1,chainId:l,receipts:f,version:b="2.0.0",...y}=await c(a.id),[h,m]=(()=>{const E=y.status;return E>=100&&E<200?["pending",E]:E>=200&&E<300?["success",E]:E>=300&&E<700?["failure",E]:E==="CONFIRMED"?["success",200]:E==="PENDING"?["pending",100]:[void 0,E]})();return{...y,atomic:u,chainId:l?(0,n.hexToNumber)(l):void 0,receipts:f?.map(E=>({...E,blockNumber:(0,n.hexToBigInt)(E.blockNumber),gasUsed:(0,n.hexToBigInt)(E.gasUsed),status:r.receiptStatuses[E.status]}))??[],statusCode:m,status:h,version:b}}return Fa}var Vm;function Tf(){if(Vm)return sn;Vm=1,Object.defineProperty(sn,"__esModule",{value:!0}),sn.WaitForCallsStatusTimeoutError=void 0,sn.waitForCallsStatus=u;const e=ue(),t=Eg(),n=me(),r=Wr(),o=En(),s=yf(),i=Gu(),a=He(),c=jg();async function u(f,b){const{id:y,pollingInterval:h=f.pollingInterval,status:m=({statusCode:A})=>A===200||A>=300,retryCount:E=4,retryDelay:v=({count:A})=>~~(1<<A)*200,timeout:_=6e4,throwOnFailure:P=!1}=b,d=(0,a.stringify)(["waitForCallsStatus",f.uid,y]),{promise:j,resolve:g,reject:p}=(0,s.withResolvers)();let T;const w=(0,r.observe)(d,{resolve:g,reject:p},A=>{const C=(0,o.poll)(async()=>{const R=S=>{clearTimeout(T),C(),S(),w()};try{const S=await(0,i.withRetry)(async()=>{const x=await(0,n.getAction)(f,c.getCallsStatus,"getCallsStatus")({id:y});if(P&&x.status==="failure")throw new t.BundleFailedError(x);return x},{retryCount:E,delay:v});if(!m(S))return;R(()=>A.resolve(S))}catch(S){R(()=>A.reject(S))}},{interval:h,emitOnBegin:!0});return C});return T=_?setTimeout(()=>{w(),clearTimeout(T),p(new l({id:y}))},_):void 0,await j}class l extends e.BaseError{constructor({id:b}){super(`Timed out while waiting for call bundle with id "${b}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}return sn.WaitForCallsStatusTimeoutError=l,sn}var po={},Na={},Wm;function wg(){if(Wm)return Na;Wm=1,Object.defineProperty(Na,"__esModule",{value:!0}),Na.uid=r;const e=256;let t=e,n;function r(o=11){if(!n||t+o>e*2){n="",t=0;for(let s=0;s<e;s++)n+=(256+Math.random()*256|0).toString(16).substring(1)}return n.substring(t,t+++o)}return Na}var Km;function Vu(){if(Km)return po;Km=1,Object.defineProperty(po,"__esModule",{value:!0}),po.createClient=n,po.rpcSchema=r;const e=Ie(),t=wg();function n(o){const{batch:s,chain:i,ccipRead:a,key:c="base",name:u="Base Client",type:l="base"}=o,f=o.experimental_blockTag??(typeof i?.experimental_preconfirmationTime=="number"?"pending":void 0),b=i?.blockTime??12e3,y=Math.min(Math.max(Math.floor(b/2),500),4e3),h=o.pollingInterval??y,m=o.cacheTime??h,E=o.account?(0,e.parseAccount)(o.account):void 0,{config:v,request:_,value:P}=o.transport({account:E,chain:i,pollingInterval:h}),d={...v,...P},j={account:E,batch:s,cacheTime:m,ccipRead:a,chain:i,key:c,name:u,pollingInterval:h,request:_,transport:d,type:l,uid:(0,t.uid)(),...f?{experimental_blockTag:f}:{}};function g(p){return T=>{const w=T(p);for(const C in j)delete w[C];const A={...p,...w};return Object.assign(A,{extend:g(A)})}}return Object.assign(j,{extend:g(j)})}function r(){return null}return po}var za={},Ua={},La={},Da={},Zm;function If(){if(Zm)return Da;Zm=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.isNullUniversalResolverError=n;const e=ue(),t=ar();function n(r){if(!(r instanceof e.BaseError))return!1;const o=r.walk(s=>s instanceof t.ContractFunctionRevertedError);return o instanceof t.ContractFunctionRevertedError?o.data?.errorName==="HttpError"||o.data?.errorName==="ResolverError"||o.data?.errorName==="ResolverNotContract"||o.data?.errorName==="ResolverNotFound"||o.data?.errorName==="ReverseAddressMismatch"||o.data?.errorName==="UnsupportedResolverProfile":!1}return Da}var Ga={},Va={},Ym;function Pg(){if(Ym)return Va;Ym=1,Object.defineProperty(Va,"__esModule",{value:!0}),Va.encodedLabelToLabelhash=t;const e=De();function t(n){if(n.length!==66||n.indexOf("[")!==0||n.indexOf("]")!==65)return null;const r=`0x${n.slice(1,65)}`;return(0,e.isHex)(r)?r:null}return Va}var Jm;function Sf(){if(Jm)return Ga;Jm=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.namehash=s;const e=Ce(),t=_e(),n=te(),r=Ze(),o=Pg();function s(i){let a=new Uint8Array(32).fill(0);if(!i)return(0,n.bytesToHex)(a);const c=i.split(".");for(let u=c.length-1;u>=0;u-=1){const l=(0,o.encodedLabelToLabelhash)(c[u]),f=l?(0,t.toBytes)(l):(0,r.keccak256)((0,t.stringToBytes)(c[u]),"bytes");a=(0,r.keccak256)((0,e.concat)([a,f]),"bytes")}return(0,n.bytesToHex)(a)}return Ga}var Wa={},Ka={},Xm;function Zv(){if(Xm)return Ka;Xm=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.encodeLabelhash=e;function e(t){return`[${t.slice(2)}]`}return Ka}var Za={},Qm;function Ag(){if(Qm)return Za;Qm=1,Object.defineProperty(Za,"__esModule",{value:!0}),Za.labelhash=o;const e=_e(),t=te(),n=Ze(),r=Pg();function o(s){const i=new Uint8Array(32).fill(0);return s?(0,r.encodedLabelToLabelhash)(s)||(0,n.keccak256)((0,e.stringToBytes)(s)):(0,t.bytesToHex)(i)}return Za}var $m;function Rf(){if($m)return Wa;$m=1,Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.packetToBytes=r;const e=_e(),t=Zv(),n=Ag();function r(o){const s=o.replace(/^\.|\.$/gm,"");if(s.length===0)return new Uint8Array(1);const i=new Uint8Array((0,e.stringToBytes)(s).byteLength+2);let a=0;const c=s.split(".");for(let u=0;u<c.length;u++){let l=(0,e.stringToBytes)(c[u]);l.byteLength>255&&(l=(0,e.stringToBytes)((0,t.encodeLabelhash)((0,n.labelhash)(c[u])))),i[a]=l.length,i.set(l,a+1),a+=l.length+1}return i.byteLength!==a+1?i.slice(0,a+1):i}return Wa}var eh;function Yv(){if(eh)return La;eh=1,Object.defineProperty(La,"__esModule",{value:!0}),La.getEnsAddress=b;const e=lr(),t=Kt(),n=Je(),r=br(),o=Dt(),s=te(),i=If(),a=zu(),c=Sf(),u=Rf(),l=me(),f=It();async function b(y,h){const{blockNumber:m,blockTag:E,coinType:v,name:_,gatewayUrls:P,strict:d}=h,{chain:j}=y,g=(()=>{if(h.universalResolverAddress)return h.universalResolverAddress;if(!j)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,r.getChainContractAddress)({blockNumber:m,chain:j,contract:"ensUniversalResolver"})})(),p=j?.ensTlds;if(p&&!p.some(w=>_.endsWith(w)))return null;const T=v!=null?[(0,c.namehash)(_),BigInt(v)]:[(0,c.namehash)(_)];try{const w=(0,n.encodeFunctionData)({abi:e.addressResolverAbi,functionName:"addr",args:T}),A={address:g,abi:e.universalResolverResolveAbi,functionName:"resolveWithGateways",args:[(0,s.toHex)((0,u.packetToBytes)(_)),w,P??[a.localBatchGatewayUrl]],blockNumber:m,blockTag:E},R=await(0,l.getAction)(y,f.readContract,"readContract")(A);if(R[0]==="0x")return null;const S=(0,t.decodeFunctionResult)({abi:e.addressResolverAbi,args:T,functionName:"addr",data:R[0]});return S==="0x"||(0,o.trim)(S)==="0x00"?null:S}catch(w){if(d)throw w;if((0,i.isNullUniversalResolverError)(w))return null;throw w}}return La}var Ya={},Ja={},mt={},tt={},th;function Bf(){if(th)return tt;th=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.EnsInvalidChainIdError=tt.EnsAvatarUnsupportedNamespaceError=tt.EnsAvatarUriResolutionError=tt.EnsAvatarInvalidNftUriError=tt.EnsAvatarInvalidMetadataError=void 0;const e=ue();class t extends e.BaseError{constructor({data:a}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(a)}`],name:"EnsAvatarInvalidMetadataError"})}}tt.EnsAvatarInvalidMetadataError=t;class n extends e.BaseError{constructor({reason:a}){super(`ENS NFT avatar URI is invalid. ${a}`,{name:"EnsAvatarInvalidNftUriError"})}}tt.EnsAvatarInvalidNftUriError=n;class r extends e.BaseError{constructor({uri:a}){super(`Unable to resolve ENS avatar URI "${a}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}tt.EnsAvatarUriResolutionError=r;class o extends e.BaseError{constructor({namespace:a}){super(`ENS NFT avatar namespace "${a}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}tt.EnsAvatarUnsupportedNamespaceError=o;class s extends e.BaseError{constructor({chainId:a}){super(`Invalid ENSIP-11 chainId: ${a}. Must be between 0 and 0x7fffffff, or 1.`,{name:"EnsInvalidChainIdError"})}}return tt.EnsInvalidChainIdError=s,tt}var rh;function Jv(){if(rh)return mt;rh=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.isImageUri=i,mt.getGateway=a,mt.resolveAvatarUri=c,mt.getJsonImage=u,mt.getMetadataAvatarUri=l,mt.parseAvatarUri=f,mt.parseNftUri=b,mt.getNftTokenUri=y;const e=It(),t=Bf(),n=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,r=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,o=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,s=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function i(h){try{const m=await fetch(h,{method:"HEAD"});return m.status===200?m.headers.get("content-type")?.startsWith("image/"):!1}catch(m){return typeof m=="object"&&typeof m.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(E=>{const v=new Image;v.onload=()=>{E(!0)},v.onerror=()=>{E(!1)},v.src=h})}}function a(h,m){return h?h.endsWith("/")?h.slice(0,-1):h:m}function c({uri:h,gatewayUrls:m}){const E=o.test(h);if(E)return{uri:h,isOnChain:!0,isEncoded:E};const v=a(m?.ipfs,"https://ipfs.io"),_=a(m?.arweave,"https://arweave.net"),P=h.match(n),{protocol:d,subpath:j,target:g,subtarget:p=""}=P?.groups||{},T=d==="ipns:/"||j==="ipns/",w=d==="ipfs:/"||j==="ipfs/"||r.test(h);if(h.startsWith("http")&&!T&&!w){let C=h;return m?.arweave&&(C=h.replace(/https:\/\/arweave.net/g,m?.arweave)),{uri:C,isOnChain:!1,isEncoded:!1}}if((T||w)&&g)return{uri:`${v}/${T?"ipns":"ipfs"}/${g}${p}`,isOnChain:!1,isEncoded:!1};if(d==="ar:/"&&g)return{uri:`${_}/${g}${p||""}`,isOnChain:!1,isEncoded:!1};let A=h.replace(s,"");if(A.startsWith("<svg")&&(A=`data:image/svg+xml;base64,${btoa(A)}`),A.startsWith("data:")||A.startsWith("{"))return{uri:A,isOnChain:!0,isEncoded:!1};throw new t.EnsAvatarUriResolutionError({uri:h})}function u(h){if(typeof h!="object"||!("image"in h)&&!("image_url"in h)&&!("image_data"in h))throw new t.EnsAvatarInvalidMetadataError({data:h});return h.image||h.image_url||h.image_data}async function l({gatewayUrls:h,uri:m}){try{const E=await fetch(m).then(_=>_.json());return await f({gatewayUrls:h,uri:u(E)})}catch{throw new t.EnsAvatarUriResolutionError({uri:m})}}async function f({gatewayUrls:h,uri:m}){const{uri:E,isOnChain:v}=c({uri:m,gatewayUrls:h});if(v||await i(E))return E;throw new t.EnsAvatarUriResolutionError({uri:m})}function b(h){let m=h;m.startsWith("did:nft:")&&(m=m.replace("did:nft:","").replace(/_/g,"/"));const[E,v,_]=m.split("/"),[P,d]=E.split(":"),[j,g]=v.split(":");if(!P||P.toLowerCase()!=="eip155")throw new t.EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!d)throw new t.EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!g)throw new t.EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!_)throw new t.EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!j)throw new t.EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(d,10),namespace:j.toLowerCase(),contractAddress:g,tokenID:_}}async function y(h,{nft:m}){if(m.namespace==="erc721")return(0,e.readContract)(h,{address:m.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(m.tokenID)]});if(m.namespace==="erc1155")return(0,e.readContract)(h,{address:m.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(m.tokenID)]});throw new t.EnsAvatarUnsupportedNamespaceError({namespace:m.namespace})}return mt}var nh;function Xv(){if(nh)return Ja;nh=1,Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.parseAvatarRecord=t;const e=Jv();async function t(r,{gatewayUrls:o,record:s}){return/eip155:/i.test(s)?n(r,{gatewayUrls:o,record:s}):(0,e.parseAvatarUri)({uri:s,gatewayUrls:o})}async function n(r,{gatewayUrls:o,record:s}){const i=(0,e.parseNftUri)(s),a=await(0,e.getNftTokenUri)(r,{nft:i}),{uri:c,isOnChain:u,isEncoded:l}=(0,e.resolveAvatarUri)({uri:a,gatewayUrls:o});if(u&&(c.includes("data:application/json;base64,")||c.startsWith("{"))){const b=l?atob(c.replace("data:application/json;base64,","")):c,y=JSON.parse(b);return(0,e.parseAvatarUri)({uri:(0,e.getJsonImage)(y),gatewayUrls:o})}let f=i.tokenID;return i.namespace==="erc1155"&&(f=f.replace("0x","").padStart(64,"0")),(0,e.getMetadataAvatarUri)({gatewayUrls:o,uri:c.replace(/(?:0x)?{id}/,f)})}return Ja}var Xa={},oh;function Tg(){if(oh)return Xa;oh=1,Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.getEnsText=f;const e=lr(),t=Kt(),n=Je(),r=br(),o=te(),s=If(),i=zu(),a=Sf(),c=Rf(),u=me(),l=It();async function f(b,y){const{blockNumber:h,blockTag:m,key:E,name:v,gatewayUrls:_,strict:P}=y,{chain:d}=b,j=(()=>{if(y.universalResolverAddress)return y.universalResolverAddress;if(!d)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,r.getChainContractAddress)({blockNumber:h,chain:d,contract:"ensUniversalResolver"})})(),g=d?.ensTlds;if(g&&!g.some(p=>v.endsWith(p)))return null;try{const p={address:j,abi:e.universalResolverResolveAbi,args:[(0,o.toHex)((0,c.packetToBytes)(v)),(0,n.encodeFunctionData)({abi:e.textResolverAbi,functionName:"text",args:[(0,a.namehash)(v),E]}),_??[i.localBatchGatewayUrl]],functionName:"resolveWithGateways",blockNumber:h,blockTag:m},w=await(0,u.getAction)(b,l.readContract,"readContract")(p);if(w[0]==="0x")return null;const A=(0,t.decodeFunctionResult)({abi:e.textResolverAbi,functionName:"text",data:w[0]});return A===""?null:A}catch(p){if(P)throw p;if((0,s.isNullUniversalResolverError)(p))return null;throw p}}return Xa}var ih;function Qv(){if(ih)return Ya;ih=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.getEnsAvatar=r;const e=Xv(),t=me(),n=Tg();async function r(o,{blockNumber:s,blockTag:i,assetGatewayUrls:a,name:c,gatewayUrls:u,strict:l,universalResolverAddress:f}){const b=await(0,t.getAction)(o,n.getEnsText,"getEnsText")({blockNumber:s,blockTag:i,key:"avatar",name:c,universalResolverAddress:f,gatewayUrls:u,strict:l});if(!b)return null;try{return await(0,e.parseAvatarRecord)(o,{record:b,gatewayUrls:a})}catch{return null}}return Ya}var Qa={},ah;function $v(){if(ah)return Qa;ah=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.getEnsName=i;const e=lr(),t=br(),n=If(),r=zu(),o=me(),s=It();async function i(a,c){const{address:u,blockNumber:l,blockTag:f,coinType:b=60n,gatewayUrls:y,strict:h}=c,{chain:m}=a,E=(()=>{if(c.universalResolverAddress)return c.universalResolverAddress;if(!m)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,t.getChainContractAddress)({blockNumber:l,chain:m,contract:"ensUniversalResolver"})})();try{const v={address:E,abi:e.universalResolverReverseAbi,args:[u,b,y??[r.localBatchGatewayUrl]],functionName:"reverseWithGateways",blockNumber:l,blockTag:f},_=(0,o.getAction)(a,s.readContract,"readContract"),[P]=await _(v);return P||null}catch(v){if(h)throw v;if((0,n.isNullUniversalResolverError)(v))return null;throw v}}return Qa}var $a={},sh;function e6(){if(sh)return $a;sh=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.getEnsResolver=s;const e=br(),t=te(),n=Rf(),r=me(),o=It();async function s(i,a){const{blockNumber:c,blockTag:u,name:l}=a,{chain:f}=i,b=(()=>{if(a.universalResolverAddress)return a.universalResolverAddress;if(!f)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,e.getChainContractAddress)({blockNumber:c,chain:f,contract:"ensUniversalResolver"})})(),y=f?.ensTlds;if(y&&!y.some(m=>l.endsWith(m)))throw new Error(`${l} is not a valid ENS TLD (${y?.join(", ")}) for chain "${f.name}" (id: ${f.id}).`);const[h]=await(0,r.getAction)(i,o.readContract,"readContract")({address:b,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,t.toHex)((0,n.packetToBytes)(l))],blockNumber:c,blockTag:u});return h}return $a}var es={},ch;function Ig(){if(ch)return es;ch=1,Object.defineProperty(es,"__esModule",{value:!0}),es.createAccessList=i;const e=Ie(),t=te(),n=hf(),r=dr(),o=_t(),s=vt();async function i(a,c){const{account:u=a.account,blockNumber:l,blockTag:f="latest",blobs:b,data:y,gas:h,gasPrice:m,maxFeePerBlobGas:E,maxFeePerGas:v,maxPriorityFeePerGas:_,to:P,value:d,...j}=c,g=u?(0,e.parseAccount)(u):void 0;try{(0,s.assertRequest)(c);const T=(typeof l=="bigint"?(0,t.numberToHex)(l):void 0)||f,w=a.chain?.formatters?.transactionRequest?.format,C=(w||o.formatTransactionRequest)({...(0,r.extract)(j,{format:w}),account:g,blobs:b,data:y,gas:h,gasPrice:m,maxFeePerBlobGas:E,maxFeePerGas:v,maxPriorityFeePerGas:_,to:P,value:d},"createAccessList"),R=await a.request({method:"eth_createAccessList",params:[C,T]});return{accessList:R.accessList,gasUsed:BigInt(R.gasUsed)}}catch(p){throw(0,n.getCallError)(p,{...c,account:g,chain:a.chain})}}return es}var ts={},uh;function t6(){if(uh)return ts;uh=1,Object.defineProperty(ts,"__esModule",{value:!0}),ts.createBlockFilter=t;const e=Ru();async function t(n){const r=(0,e.createFilterRequestScope)(n,{method:"eth_newBlockFilter"}),o=await n.request({method:"eth_newBlockFilter"});return{id:o,request:r(o),type:"block"}}return ts}var rs={},dh;function Sg(){if(dh)return rs;dh=1,Object.defineProperty(rs,"__esModule",{value:!0}),rs.createEventFilter=r;const e=Ur(),t=te(),n=Ru();async function r(o,{address:s,args:i,event:a,events:c,fromBlock:u,strict:l,toBlock:f}={}){const b=c??(a?[a]:void 0),y=(0,n.createFilterRequestScope)(o,{method:"eth_newFilter"});let h=[];b&&(h=[b.flatMap(v=>(0,e.encodeEventTopics)({abi:[v],eventName:v.name,args:i}))],a&&(h=h[0]));const m=await o.request({method:"eth_newFilter",params:[{address:s,fromBlock:typeof u=="bigint"?(0,t.numberToHex)(u):u,toBlock:typeof f=="bigint"?(0,t.numberToHex)(f):f,...h.length?{topics:h}:{}}]});return{abi:b,args:i,eventName:a?a.name:void 0,fromBlock:u,id:m,request:y(m),strict:!!l,toBlock:f,type:"event"}}return rs}var ns={},fh;function Rg(){if(fh)return ns;fh=1,Object.defineProperty(ns,"__esModule",{value:!0}),ns.createPendingTransactionFilter=t;const e=Ru();async function t(n){const r=(0,e.createFilterRequestScope)(n,{method:"eth_newPendingTransactionFilter"}),o=await n.request({method:"eth_newPendingTransactionFilter"});return{id:o,request:r(o),type:"transaction"}}return ns}var os={},lh;function r6(){if(lh)return os;lh=1,Object.defineProperty(os,"__esModule",{value:!0}),os.getBalance=t;const e=te();async function t(n,{address:r,blockNumber:o,blockTag:s=n.experimental_blockTag??"latest"}){const i=typeof o=="bigint"?(0,e.numberToHex)(o):void 0,a=await n.request({method:"eth_getBalance",params:[r,i||s]});return BigInt(a)}return os}var is={},bh;function n6(){if(bh)return is;bh=1,Object.defineProperty(is,"__esModule",{value:!0}),is.getBlobBaseFee=e;async function e(t){const n=await t.request({method:"eth_blobBaseFee"});return BigInt(n)}return is}var as={},mh;function o6(){if(mh)return as;mh=1,Object.defineProperty(as,"__esModule",{value:!0}),as.getBlockTransactionCount=n;const e=Re(),t=te();async function n(r,{blockHash:o,blockNumber:s,blockTag:i="latest"}={}){const a=s!==void 0?(0,t.numberToHex)(s):void 0;let c;return o?c=await r.request({method:"eth_getBlockTransactionCountByHash",params:[o]},{dedupe:!0}):c=await r.request({method:"eth_getBlockTransactionCountByNumber",params:[a||i]},{dedupe:!!a}),(0,e.hexToNumber)(c)}return as}var ss={},hh;function Bg(){if(hh)return ss;hh=1,Object.defineProperty(ss,"__esModule",{value:!0}),ss.getCode=t;const e=te();async function t(n,{address:r,blockNumber:o,blockTag:s="latest"}){const i=o!==void 0?(0,e.numberToHex)(o):void 0,a=await n.request({method:"eth_getCode",params:[r,i||s]},{dedupe:!!i});if(a!=="0x")return a}return ss}var cs={},go={},yh;function i6(){if(yh)return go;yh=1,Object.defineProperty(go,"__esModule",{value:!0}),go.Eip712DomainNotFoundError=void 0;const e=ue();class t extends e.BaseError{constructor({address:r}){super(`No EIP-712 domain found on contract "${r}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${r}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}return go.Eip712DomainNotFoundError=t,go}var ph;function a6(){if(ph)return cs;ph=1,Object.defineProperty(cs,"__esModule",{value:!0}),cs.getEip712Domain=r;const e=i6(),t=me(),n=It();async function r(s,i){const{address:a,factory:c,factoryData:u}=i;try{const[l,f,b,y,h,m,E]=await(0,t.getAction)(s,n.readContract,"readContract")({abi:o,address:a,functionName:"eip712Domain",factory:c,factoryData:u});return{domain:{name:f,version:b,chainId:Number(y),verifyingContract:h,salt:m},extensions:E,fields:l}}catch(l){const f=l;throw f.name==="ContractFunctionExecutionError"&&f.cause.name==="ContractFunctionZeroDataError"?new e.Eip712DomainNotFoundError({address:a}):f}}const o=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];return cs}var us={},ds={},gh;function s6(){if(gh)return ds;gh=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.formatFeeHistory=e;function e(t){return{baseFeePerGas:t.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:t.reward?.map(n=>n.map(r=>BigInt(r)))}}return ds}var _h;function c6(){if(_h)return us;_h=1,Object.defineProperty(us,"__esModule",{value:!0}),us.getFeeHistory=n;const e=te(),t=s6();async function n(r,{blockCount:o,blockNumber:s,blockTag:i="latest",rewardPercentiles:a}){const c=typeof s=="bigint"?(0,e.numberToHex)(s):void 0,u=await r.request({method:"eth_feeHistory",params:[(0,e.numberToHex)(o),c||i,a]},{dedupe:!!c});return(0,t.formatFeeHistory)(u)}return us}var fs={},vh;function u6(){if(vh)return fs;vh=1,Object.defineProperty(fs,"__esModule",{value:!0}),fs.getFilterLogs=n;const e=Do(),t=Wt();async function n(r,{filter:o}){const s=o.strict??!1,a=(await o.request({method:"eth_getFilterLogs",params:[o.id]})).map(c=>(0,t.formatLog)(c));return o.abi?(0,e.parseEventLogs)({abi:o.abi,logs:a,strict:s}):a}return fs}var ls={},bs={},Fd={},ms={},Eh;function Og(){if(Eh)return ms;Eh=1,Object.defineProperty(ms,"__esModule",{value:!0}),ms.encodePacked=a;const e=Te(),t=yt(),n=Ye(),r=Ce(),o=nr(),s=te(),i=Su();function a(u,l){if(u.length!==l.length)throw new e.AbiEncodingLengthMismatchError({expectedLength:u.length,givenLength:l.length});const f=[];for(let b=0;b<u.length;b++){const y=u[b],h=l[b];f.push(c(y,h))}return(0,r.concatHex)(f)}function c(u,l,f=!1){if(u==="address"){const m=l;if(!(0,n.isAddress)(m))throw new t.InvalidAddressError({address:m});return(0,o.pad)(m.toLowerCase(),{size:f?32:null})}if(u==="string")return(0,s.stringToHex)(l);if(u==="bytes")return l;if(u==="bool")return(0,o.pad)((0,s.boolToHex)(l),{size:f?32:1});const b=u.match(i.integerRegex);if(b){const[m,E,v="256"]=b,_=Number.parseInt(v,10)/8;return(0,s.numberToHex)(l,{size:f?32:_,signed:E==="int"})}const y=u.match(i.bytesRegex);if(y){const[m,E]=y;if(Number.parseInt(E,10)!==(l.length-2)/2)throw new e.BytesSizeMismatchError({expectedSize:Number.parseInt(E,10),givenSize:(l.length-2)/2});return(0,o.pad)(l,{dir:"right",size:f?32:null})}const h=u.match(i.arrayRegex);if(h&&Array.isArray(l)){const[m,E]=h,v=[];for(let _=0;_<l.length;_++)v.push(c(E,l[_],!0));return v.length===0?"0x":(0,r.concatHex)(v)}throw new e.UnsupportedPackedAbiType(u)}return ms}var cn={},hs={},jh;function Of(){if(jh)return hs;jh=1,Object.defineProperty(hs,"__esModule",{value:!0}),hs.isBytes=e;function e(t){return!t||typeof t!="object"||!("BYTES_PER_ELEMENT"in t)?!1:t.BYTES_PER_ELEMENT===1&&t.constructor.name==="Uint8Array"}return hs}var wh;function xg(){if(wh)return cn;wh=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.getContractAddress=c,cn.getCreateAddress=u,cn.getCreate2Address=l;const e=Ce(),t=Of(),n=nr(),r=at(),o=_e(),s=Mo(),i=Ze(),a=nt();function c(f){return f.opcode==="CREATE2"?l(f):u(f)}function u(f){const b=(0,o.toBytes)((0,a.getAddress)(f.from));let y=(0,o.toBytes)(f.nonce);return y[0]===0&&(y=new Uint8Array([])),(0,a.getAddress)(`0x${(0,i.keccak256)((0,s.toRlp)([b,y],"bytes")).slice(26)}`)}function l(f){const b=(0,o.toBytes)((0,a.getAddress)(f.from)),y=(0,n.pad)((0,t.isBytes)(f.salt)?f.salt:(0,o.toBytes)(f.salt),{size:32}),h="bytecodeHash"in f?(0,t.isBytes)(f.bytecodeHash)?f.bytecodeHash:(0,o.toBytes)(f.bytecodeHash):(0,i.keccak256)(f.bytecode,"bytes");return(0,a.getAddress)((0,r.slice)((0,i.keccak256)((0,e.concat)([(0,o.toBytes)("0xff"),b,y,h])),12))}return cn}var ys={},_o={},er={},Ph;function Wu(){if(Ph)return er;Ph=1,Object.defineProperty(er,"__esModule",{value:!0}),er.assertTransactionEIP7702=f,er.assertTransactionEIP4844=b,er.assertTransactionEIP1559=y,er.assertTransactionEIP2930=h,er.assertTransactionLegacy=m;const e=fg(),t=of(),n=yt(),r=ue(),o=lg(),s=Vo(),i=Vt(),a=Ye(),c=Ke(),u=at(),l=Re();function f(E){const{authorizationList:v}=E;if(v)for(const _ of v){const{chainId:P}=_,d=_.address;if(!(0,a.isAddress)(d))throw new n.InvalidAddressError({address:d});if(P<0)throw new s.InvalidChainIdError({chainId:P})}y(E)}function b(E){const{blobVersionedHashes:v}=E;if(v){if(v.length===0)throw new o.EmptyBlobError;for(const _ of v){const P=(0,c.size)(_),d=(0,l.hexToNumber)((0,u.slice)(_,0,1));if(P!==32)throw new o.InvalidVersionedHashSizeError({hash:_,size:P});if(d!==e.versionedHashVersionKzg)throw new o.InvalidVersionedHashVersionError({hash:_,version:d})}}y(E)}function y(E){const{chainId:v,maxPriorityFeePerGas:_,maxFeePerGas:P,to:d}=E;if(v<=0)throw new s.InvalidChainIdError({chainId:v});if(d&&!(0,a.isAddress)(d))throw new n.InvalidAddressError({address:d});if(P&&P>t.maxUint256)throw new i.FeeCapTooHighError({maxFeePerGas:P});if(_&&P&&_>P)throw new i.TipAboveFeeCapError({maxFeePerGas:P,maxPriorityFeePerGas:_})}function h(E){const{chainId:v,maxPriorityFeePerGas:_,gasPrice:P,maxFeePerGas:d,to:j}=E;if(v<=0)throw new s.InvalidChainIdError({chainId:v});if(j&&!(0,a.isAddress)(j))throw new n.InvalidAddressError({address:j});if(_||d)throw new r.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(P&&P>t.maxUint256)throw new i.FeeCapTooHighError({maxFeePerGas:P})}function m(E){const{chainId:v,maxPriorityFeePerGas:_,gasPrice:P,maxFeePerGas:d,to:j}=E;if(j&&!(0,a.isAddress)(j))throw new n.InvalidAddressError({address:j});if(typeof v<"u"&&v<=0)throw new s.InvalidChainIdError({chainId:v});if(_||d)throw new r.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(P&&P>t.maxUint256)throw new i.FeeCapTooHighError({maxFeePerGas:P})}return er}var ps={},Ah;function xf(){if(Ah)return ps;Ah=1,Object.defineProperty(ps,"__esModule",{value:!0}),ps.serializeAccessList=r;const e=yt(),t=Xe(),n=Ye();function r(o){if(!o||o.length===0)return[];const s=[];for(let i=0;i<o.length;i++){const{address:a,storageKeys:c}=o[i];for(let u=0;u<c.length;u++)if(c[u].length-2!==64)throw new t.InvalidStorageKeySizeError({storageKey:c[u]});if(!(0,n.isAddress)(a,{strict:!1}))throw new e.InvalidAddressError({address:a});s.push([a,c])}return s}return ps}var Th;function Ku(){if(Th)return _o;Th=1,Object.defineProperty(_o,"__esModule",{value:!0}),_o.serializeTransaction=y,_o.toYParitySignatureArray=P;const e=Xe(),t=Cg(),n=Mu(),r=Hu(),o=df(),s=ku(),i=Ce(),a=Dt(),c=te(),u=Mo(),l=Wu(),f=Fu(),b=xf();function y(d,j){const g=(0,f.getTransactionType)(d);return g==="eip1559"?E(d,j):g==="eip2930"?v(d,j):g==="eip4844"?m(d,j):g==="eip7702"?h(d,j):_(d,j)}function h(d,j){const{authorizationList:g,chainId:p,gas:T,nonce:w,to:A,value:C,maxFeePerGas:R,maxPriorityFeePerGas:S,accessList:x,data:F}=d;(0,l.assertTransactionEIP7702)(d);const M=(0,b.serializeAccessList)(x),I=(0,t.serializeAuthorizationList)(g);return(0,i.concatHex)(["0x04",(0,u.toRlp)([(0,c.numberToHex)(p),w?(0,c.numberToHex)(w):"0x",S?(0,c.numberToHex)(S):"0x",R?(0,c.numberToHex)(R):"0x",T?(0,c.numberToHex)(T):"0x",A??"0x",C?(0,c.numberToHex)(C):"0x",F??"0x",M,I,...P(d,j)])])}function m(d,j){const{chainId:g,gas:p,nonce:T,to:w,value:A,maxFeePerBlobGas:C,maxFeePerGas:R,maxPriorityFeePerGas:S,accessList:x,data:F}=d;(0,l.assertTransactionEIP4844)(d);let M=d.blobVersionedHashes,I=d.sidecars;if(d.blobs&&(typeof M>"u"||typeof I>"u")){const N=typeof d.blobs[0]=="string"?d.blobs:d.blobs.map(G=>(0,c.bytesToHex)(G)),U=d.kzg,z=(0,n.blobsToCommitments)({blobs:N,kzg:U});if(typeof M>"u"&&(M=(0,o.commitmentsToVersionedHashes)({commitments:z})),typeof I>"u"){const G=(0,r.blobsToProofs)({blobs:N,commitments:z,kzg:U});I=(0,s.toBlobSidecars)({blobs:N,commitments:z,proofs:G})}}const k=(0,b.serializeAccessList)(x),B=[(0,c.numberToHex)(g),T?(0,c.numberToHex)(T):"0x",S?(0,c.numberToHex)(S):"0x",R?(0,c.numberToHex)(R):"0x",p?(0,c.numberToHex)(p):"0x",w??"0x",A?(0,c.numberToHex)(A):"0x",F??"0x",k,C?(0,c.numberToHex)(C):"0x",M??[],...P(d,j)],q=[],O=[],H=[];if(I)for(let N=0;N<I.length;N++){const{blob:U,commitment:z,proof:G}=I[N];q.push(U),O.push(z),H.push(G)}return(0,i.concatHex)(["0x03",I?(0,u.toRlp)([B,q,O,H]):(0,u.toRlp)(B)])}function E(d,j){const{chainId:g,gas:p,nonce:T,to:w,value:A,maxFeePerGas:C,maxPriorityFeePerGas:R,accessList:S,data:x}=d;(0,l.assertTransactionEIP1559)(d);const F=(0,b.serializeAccessList)(S),M=[(0,c.numberToHex)(g),T?(0,c.numberToHex)(T):"0x",R?(0,c.numberToHex)(R):"0x",C?(0,c.numberToHex)(C):"0x",p?(0,c.numberToHex)(p):"0x",w??"0x",A?(0,c.numberToHex)(A):"0x",x??"0x",F,...P(d,j)];return(0,i.concatHex)(["0x02",(0,u.toRlp)(M)])}function v(d,j){const{chainId:g,gas:p,data:T,nonce:w,to:A,value:C,accessList:R,gasPrice:S}=d;(0,l.assertTransactionEIP2930)(d);const x=(0,b.serializeAccessList)(R),F=[(0,c.numberToHex)(g),w?(0,c.numberToHex)(w):"0x",S?(0,c.numberToHex)(S):"0x",p?(0,c.numberToHex)(p):"0x",A??"0x",C?(0,c.numberToHex)(C):"0x",T??"0x",x,...P(d,j)];return(0,i.concatHex)(["0x01",(0,u.toRlp)(F)])}function _(d,j){const{chainId:g=0,gas:p,data:T,nonce:w,to:A,value:C,gasPrice:R}=d;(0,l.assertTransactionLegacy)(d);let S=[w?(0,c.numberToHex)(w):"0x",R?(0,c.numberToHex)(R):"0x",p?(0,c.numberToHex)(p):"0x",A??"0x",C?(0,c.numberToHex)(C):"0x",T??"0x"];if(j){const x=(()=>{if(j.v>=35n)return(j.v-35n)/2n>0?j.v:27n+(j.v===35n?0n:1n);if(g>0)return BigInt(g*2)+BigInt(35n+j.v-27n);const I=27n+(j.v===27n?0n:1n);if(j.v!==I)throw new e.InvalidLegacyVError({v:j.v});return I})(),F=(0,a.trim)(j.r),M=(0,a.trim)(j.s);S=[...S,(0,c.numberToHex)(x),F==="0x00"?"0x":F,M==="0x00"?"0x":M]}else g>0&&(S=[...S,(0,c.numberToHex)(g),"0x","0x"]);return(0,u.toRlp)(S)}function P(d,j){const g=j??d,{v:p,yParity:T}=g;if(typeof g.r>"u")return[];if(typeof g.s>"u")return[];if(typeof p>"u"&&typeof T>"u")return[];const w=(0,a.trim)(g.r),A=(0,a.trim)(g.s);return[typeof T=="number"?T?(0,c.numberToHex)(1):"0x":p===0n?"0x":p===1n?(0,c.numberToHex)(1):p===27n?"0x":(0,c.numberToHex)(1),w==="0x00"?"0x":w,A==="0x00"?"0x":A]}return _o}var Ih;function Cg(){if(Ih)return ys;Ih=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.serializeAuthorizationList=n;const e=te(),t=Ku();function n(r){if(!r||r.length===0)return[];const o=[];for(const s of r){const{chainId:i,nonce:a,...c}=s,u=s.address;o.push([i?(0,e.toHex)(i):"0x",u,a?(0,e.toHex)(a):"0x",...(0,t.toYParitySignatureArray)({},c)])}return o}return ys}var gs={},Sh;function qg(){if(Sh)return gs;Sh=1,Object.defineProperty(gs,"__esModule",{value:!0}),gs.verifyAuthorization=r;const e=nt(),t=Et(),n=Ho();async function r({address:o,authorization:s,signature:i}){return(0,t.isAddressEqual)((0,e.getAddress)(o),await(0,n.recoverAuthorizationAddress)({authorization:s,signature:i}))}return gs}var vo={},Nd={},Rh;function d6(){return Rh||(Rh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.promiseCache=void 0,e.withDedupe=n;const t=Nr();e.promiseCache=new t.LruMap(8192);function n(r,{enabled:o=!0,id:s}){if(!o||!s)return r();if(e.promiseCache.get(s))return e.promiseCache.get(s);const i=r().finally(()=>e.promiseCache.delete(s));return e.promiseCache.set(s,i),i}})(Nd)),Nd}var Bh;function Mg(){if(Bh)return vo;Bh=1,Object.defineProperty(vo,"__esModule",{value:!0}),vo.buildRequest=a,vo.shouldRetry=c;const e=ue(),t=gt(),n=sr(),r=te(),o=d6(),s=Gu(),i=He();function a(u,l={}){return async(f,b={})=>{const{dedupe:y=!1,methods:h,retryDelay:m=150,retryCount:E=3,uid:v}={...l,...b},{method:_}=f;if(h?.exclude?.includes(_))throw new n.MethodNotSupportedRpcError(new Error("method not supported"),{method:_});if(h?.include&&!h.include.includes(_))throw new n.MethodNotSupportedRpcError(new Error("method not supported"),{method:_});const P=y?(0,r.stringToHex)(`${v}.${(0,i.stringify)(f)}`):void 0;return(0,o.withDedupe)(()=>(0,s.withRetry)(async()=>{try{return await u(f)}catch(d){const j=d;switch(j.code){case n.ParseRpcError.code:throw new n.ParseRpcError(j);case n.InvalidRequestRpcError.code:throw new n.InvalidRequestRpcError(j);case n.MethodNotFoundRpcError.code:throw new n.MethodNotFoundRpcError(j,{method:f.method});case n.InvalidParamsRpcError.code:throw new n.InvalidParamsRpcError(j);case n.InternalRpcError.code:throw new n.InternalRpcError(j);case n.InvalidInputRpcError.code:throw new n.InvalidInputRpcError(j);case n.ResourceNotFoundRpcError.code:throw new n.ResourceNotFoundRpcError(j);case n.ResourceUnavailableRpcError.code:throw new n.ResourceUnavailableRpcError(j);case n.TransactionRejectedRpcError.code:throw new n.TransactionRejectedRpcError(j);case n.MethodNotSupportedRpcError.code:throw new n.MethodNotSupportedRpcError(j,{method:f.method});case n.LimitExceededRpcError.code:throw new n.LimitExceededRpcError(j);case n.JsonRpcVersionUnsupportedError.code:throw new n.JsonRpcVersionUnsupportedError(j);case n.UserRejectedRequestError.code:throw new n.UserRejectedRequestError(j);case n.UnauthorizedProviderError.code:throw new n.UnauthorizedProviderError(j);case n.UnsupportedProviderMethodError.code:throw new n.UnsupportedProviderMethodError(j);case n.ProviderDisconnectedError.code:throw new n.ProviderDisconnectedError(j);case n.ChainDisconnectedError.code:throw new n.ChainDisconnectedError(j);case n.SwitchChainError.code:throw new n.SwitchChainError(j);case n.UnsupportedNonOptionalCapabilityError.code:throw new n.UnsupportedNonOptionalCapabilityError(j);case n.UnsupportedChainIdError.code:throw new n.UnsupportedChainIdError(j);case n.DuplicateIdError.code:throw new n.DuplicateIdError(j);case n.UnknownBundleIdError.code:throw new n.UnknownBundleIdError(j);case n.BundleTooLargeError.code:throw new n.BundleTooLargeError(j);case n.AtomicReadyWalletRejectedUpgradeError.code:throw new n.AtomicReadyWalletRejectedUpgradeError(j);case n.AtomicityNotSupportedError.code:throw new n.AtomicityNotSupportedError(j);case 5e3:throw new n.UserRejectedRequestError(j);default:throw d instanceof e.BaseError?d:new n.UnknownRpcError(j)}}},{delay:({count:d,error:j})=>{if(j&&j instanceof t.HttpRequestError){const g=j?.headers?.get("Retry-After");if(g?.match(/\d/))return Number.parseInt(g,10)*1e3}return~~(1<<d)*m},retryCount:E,shouldRetry:({error:d})=>c(d)}),{enabled:y,id:P})}}function c(u){return"code"in u&&typeof u.code=="number"?u.code===-1||u.code===n.LimitExceededRpcError.code||u.code===n.InternalRpcError.code:u instanceof t.HttpRequestError&&u.status?u.status===403||u.status===408||u.status===413||u.status===429||u.status===500||u.status===502||u.status===503||u.status===504:!0}return vo}var Eo={},Oh;function Hg(){if(Oh)return Eo;Oh=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.defineChain=e,Eo.extendSchema=t;function e(n){const r={formatters:void 0,fees:void 0,serializers:void 0,...n};function o(s){return i=>{const a=typeof i=="function"?i(s):i,c={...s,...a};return Object.assign(c,{extend:o(c)})}}return Object.assign(r,{extend:o(r)})}function t(){return{}}return Eo}var _s={},xh;function kg(){if(xh)return _s;xh=1,Object.defineProperty(_s,"__esModule",{value:!0}),_s.extractChain=e;function e({chains:t,id:n}){return t.find(r=>r.id===n)}return _s}var vs={},Ch;function Cf(){if(Ch)return vs;Ch=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.fromRlp=s;const e=ue(),t=gn(),n=xo(),r=_e(),o=te();function s(u,l="hex"){const f=(()=>{if(typeof u=="string"){if(u.length>3&&u.length%2!==0)throw new t.InvalidHexValueError(u);return(0,r.hexToBytes)(u)}return u})(),b=(0,n.createCursor)(f,{recursiveReadLimit:Number.POSITIVE_INFINITY});return i(b,l)}function i(u,l="hex"){if(u.bytes.length===0)return l==="hex"?(0,o.bytesToHex)(u.bytes):u.bytes;const f=u.readByte();if(f<128&&u.decrementPosition(1),f<192){const y=a(u,f,128),h=u.readBytes(y);return l==="hex"?(0,o.bytesToHex)(h):h}const b=a(u,f,192);return c(u,b,l)}function a(u,l,f){if(f===128&&l<128)return 1;if(l<=f+55)return l-f;if(l===f+55+1)return u.readUint8();if(l===f+55+2)return u.readUint16();if(l===f+55+3)return u.readUint24();if(l===f+55+4)return u.readUint32();throw new e.BaseError("Invalid RLP prefix")}function c(u,l,f){const b=u.position,y=[];for(;u.position-b<l;)y.push(i(u,f));return y}return vs}var Es={},qh;function qf(){if(qh)return Es;qh=1,Object.defineProperty(Es,"__esModule",{value:!0}),Es.isHash=n;const e=De(),t=Ke();function n(r){return(0,e.isHex)(r)&&(0,t.size)(r)===32}return Es}var js={},Ir={},ze={},Mh;function f6(){if(Mh)return ze;Mh=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.ripemd160=ze.RIPEMD160=ze.md5=ze.MD5=ze.sha1=ze.SHA1=void 0;const e=rg(),t=or(),n=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),r=new Uint32Array(80);class o extends e.HashMD{constructor(){super(64,20,8,!1),this.A=n[0]|0,this.B=n[1]|0,this.C=n[2]|0,this.D=n[3]|0,this.E=n[4]|0}get(){const{A:w,B:A,C,D:R,E:S}=this;return[w,A,C,R,S]}set(w,A,C,R,S){this.A=w|0,this.B=A|0,this.C=C|0,this.D=R|0,this.E=S|0}process(w,A){for(let M=0;M<16;M++,A+=4)r[M]=w.getUint32(A,!1);for(let M=16;M<80;M++)r[M]=(0,t.rotl)(r[M-3]^r[M-8]^r[M-14]^r[M-16],1);let{A:C,B:R,C:S,D:x,E:F}=this;for(let M=0;M<80;M++){let I,k;M<20?(I=(0,e.Chi)(R,S,x),k=1518500249):M<40?(I=R^S^x,k=1859775393):M<60?(I=(0,e.Maj)(R,S,x),k=2400959708):(I=R^S^x,k=3395469782);const B=(0,t.rotl)(C,5)+I+F+k+r[M]|0;F=x,x=S,S=(0,t.rotl)(R,30),R=C,C=B}C=C+this.A|0,R=R+this.B|0,S=S+this.C|0,x=x+this.D|0,F=F+this.E|0,this.set(C,R,S,x,F)}roundClean(){(0,t.clean)(r)}destroy(){this.set(0,0,0,0,0),(0,t.clean)(this.buffer)}}ze.SHA1=o,ze.sha1=(0,t.createHasher)(()=>new o);const s=Math.pow(2,32),i=Array.from({length:64},(T,w)=>Math.floor(s*Math.abs(Math.sin(w+1)))),a=n.slice(0,4),c=new Uint32Array(16);class u extends e.HashMD{constructor(){super(64,16,8,!0),this.A=a[0]|0,this.B=a[1]|0,this.C=a[2]|0,this.D=a[3]|0}get(){const{A:w,B:A,C,D:R}=this;return[w,A,C,R]}set(w,A,C,R){this.A=w|0,this.B=A|0,this.C=C|0,this.D=R|0}process(w,A){for(let F=0;F<16;F++,A+=4)c[F]=w.getUint32(A,!0);let{A:C,B:R,C:S,D:x}=this;for(let F=0;F<64;F++){let M,I,k;F<16?(M=(0,e.Chi)(R,S,x),I=F,k=[7,12,17,22]):F<32?(M=(0,e.Chi)(x,R,S),I=(5*F+1)%16,k=[5,9,14,20]):F<48?(M=R^S^x,I=(3*F+5)%16,k=[4,11,16,23]):(M=S^(R|~x),I=7*F%16,k=[6,10,15,21]),M=M+C+i[F]+c[I],C=x,x=S,S=R,R=R+(0,t.rotl)(M,k[F%4])}C=C+this.A|0,R=R+this.B|0,S=S+this.C|0,x=x+this.D|0,this.set(C,R,S,x)}roundClean(){(0,t.clean)(c)}destroy(){this.set(0,0,0,0),(0,t.clean)(this.buffer)}}ze.MD5=u,ze.md5=(0,t.createHasher)(()=>new u);const l=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),f=Uint8Array.from(new Array(16).fill(0).map((T,w)=>w)),b=f.map(T=>(9*T+5)%16),y=(()=>{const A=[[f],[b]];for(let C=0;C<4;C++)for(let R of A)R.push(R[C].map(S=>l[S]));return A})(),h=y[0],m=y[1],E=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(T=>Uint8Array.from(T)),v=h.map((T,w)=>T.map(A=>E[w][A])),_=m.map((T,w)=>T.map(A=>E[w][A])),P=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),d=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function j(T,w,A,C){return T===0?w^A^C:T===1?w&A|~w&C:T===2?(w|~A)^C:T===3?w&C|A&~C:w^(A|~C)}const g=new Uint32Array(16);class p extends e.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:w,h1:A,h2:C,h3:R,h4:S}=this;return[w,A,C,R,S]}set(w,A,C,R,S){this.h0=w|0,this.h1=A|0,this.h2=C|0,this.h3=R|0,this.h4=S|0}process(w,A){for(let O=0;O<16;O++,A+=4)g[O]=w.getUint32(A,!0);let C=this.h0|0,R=C,S=this.h1|0,x=S,F=this.h2|0,M=F,I=this.h3|0,k=I,B=this.h4|0,q=B;for(let O=0;O<5;O++){const H=4-O,N=P[O],U=d[O],z=h[O],G=m[O],V=v[O],J=_[O];for(let Z=0;Z<16;Z++){const K=(0,t.rotl)(C+j(O,S,F,I)+g[z[Z]]+N,V[Z])+B|0;C=B,B=I,I=(0,t.rotl)(F,10)|0,F=S,S=K}for(let Z=0;Z<16;Z++){const K=(0,t.rotl)(R+j(H,x,M,k)+g[G[Z]]+U,J[Z])+q|0;R=q,q=k,k=(0,t.rotl)(M,10)|0,M=x,x=K}}this.set(this.h1+F+k|0,this.h2+I+q|0,this.h3+B+R|0,this.h4+C+x|0,this.h0+S+M|0)}roundClean(){(0,t.clean)(g)}destroy(){this.destroyed=!0,(0,t.clean)(this.buffer),this.set(0,0,0,0,0)}}return ze.RIPEMD160=p,ze.ripemd160=(0,t.createHasher)(()=>new p),ze}var Hh;function Fg(){if(Hh)return Ir;Hh=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.ripemd160=Ir.RIPEMD160=void 0;const e=f6();return Ir.RIPEMD160=e.RIPEMD160,Ir.ripemd160=e.ripemd160,Ir}var kh;function Ng(){if(kh)return js;kh=1,Object.defineProperty(js,"__esModule",{value:!0}),js.ripemd160=o;const e=Fg(),t=De(),n=_e(),r=te();function o(s,i){const a=i||"hex",c=(0,e.ripemd160)((0,t.isHex)(s,{strict:!1})?(0,n.toBytes)(s):s);return a==="bytes"?c:(0,r.toHex)(c)}return js}var zd={},Fh;function zg(){return Fh||(Fh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toEventHash=void 0;var t=Iu();Object.defineProperty(e,"toEventHash",{enumerable:!0,get:function(){return t.toSignatureHash}})})(zd)),zd}var Ud={},Nh;function Ug(){return Nh||(Nh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toEventSignature=void 0;var t=Jd();Object.defineProperty(e,"toEventSignature",{enumerable:!0,get:function(){return t.toSignature}})})(Ud)),Ud}var Ld={},zh;function Lg(){return zh||(zh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toFunctionHash=void 0;var t=Iu();Object.defineProperty(e,"toFunctionHash",{enumerable:!0,get:function(){return t.toSignatureHash}})})(Ld)),Ld}var Dd={},Uh;function Dg(){return Uh||(Uh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toFunctionSignature=void 0;var t=Jd();Object.defineProperty(e,"toFunctionSignature",{enumerable:!0,get:function(){return t.toSignature}})})(Dd)),Dd}var Sr={},Lh;function Gg(){if(Lh)return Sr;Lh=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.nonceManager=void 0,Sr.createNonceManager=n,Sr.jsonRpc=r;const e=qu(),t=Nr();function n(o){const{source:s}=o,i=new Map,a=new t.LruMap(8192),c=new Map,u=({address:l,chainId:f})=>`${l}.${f}`;return{async consume({address:l,chainId:f,client:b}){const y=u({address:l,chainId:f}),h=this.get({address:l,chainId:f,client:b});this.increment({address:l,chainId:f});const m=await h;return await s.set({address:l,chainId:f},m),a.set(y,m),m},async increment({address:l,chainId:f}){const b=u({address:l,chainId:f}),y=i.get(b)??0;i.set(b,y+1)},async get({address:l,chainId:f,client:b}){const y=u({address:l,chainId:f});let h=c.get(y);return h||(h=(async()=>{try{const E=await s.get({address:l,chainId:f,client:b}),v=a.get(y)??0;return v>0&&E<=v?v+1:(a.delete(y),E)}finally{this.reset({address:l,chainId:f})}})(),c.set(y,h)),(i.get(y)??0)+await h},reset({address:l,chainId:f}){const b=u({address:l,chainId:f});i.delete(b),c.delete(b)}}}function r(){return{async get(o){const{address:s,client:i}=o;return(0,e.getTransactionCount)(i,{address:s,blockTag:"pending"})},set(){}}}return Sr.nonceManager=n({source:r()}),Sr}var un={},ws={},Ps={},Dh;function Mf(){if(Dh)return Ps;Dh=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.withTimeout=e;function e(t,{errorInstance:n=new Error("timed out"),timeout:r,signal:o}){return new Promise((s,i)=>{(async()=>{let a;try{const c=new AbortController;r>0&&(a=setTimeout(()=>{o?c.abort():i(n)},r)),s(await t({signal:c?.signal||null}))}catch(c){c?.name==="AbortError"&&i(n),i(c)}finally{clearTimeout(a)}})()})}return Ps}var jo={},Gh;function Vg(){if(Gh)return jo;Gh=1,Object.defineProperty(jo,"__esModule",{value:!0}),jo.idCache=void 0;function e(){return{current:0,take(){return this.current++},reset(){this.current=0}}}return jo.idCache=e(),jo}var Vh;function Hf(){if(Vh)return ws;Vh=1,Object.defineProperty(ws,"__esModule",{value:!0}),ws.getHttpRpcClient=o;const e=gt(),t=Mf(),n=He(),r=Vg();function o(s,i={}){return{async request(a){const{body:c,fetchFn:u=i.fetchFn??fetch,onRequest:l=i.onRequest,onResponse:f=i.onResponse,timeout:b=i.timeout??1e4}=a,y={...i.fetchOptions??{},...a.fetchOptions??{}},{headers:h,method:m,signal:E}=y;try{const v=await(0,t.withTimeout)(async({signal:P})=>{const d={...y,body:Array.isArray(c)?(0,n.stringify)(c.map(T=>({jsonrpc:"2.0",id:T.id??r.idCache.take(),...T}))):(0,n.stringify)({jsonrpc:"2.0",id:c.id??r.idCache.take(),...c}),headers:{"Content-Type":"application/json",...h},method:m||"POST",signal:E||(b>0?P:null)},j=new Request(s,d),g=await l?.(j,d)??{...d,url:s};return await u(g.url??s,g)},{errorInstance:new e.TimeoutError({body:c,url:s}),timeout:b,signal:!0});f&&await f(v);let _;if(v.headers.get("Content-Type")?.startsWith("application/json"))_=await v.json();else{_=await v.text();try{_=JSON.parse(_||"{}")}catch(P){if(v.ok)throw P;_={error:_}}}if(!v.ok)throw new e.HttpRequestError({body:c,details:(0,n.stringify)(_.error)||v.statusText,headers:v.headers,status:v.status,url:s});return _}catch(v){throw v instanceof e.HttpRequestError||v instanceof e.TimeoutError?v:new e.HttpRequestError({body:c,cause:v,url:s})}}}}return ws}var As={},Gd={},Wh;function Wg(){return Wh||(Wh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.socketClientCache=void 0,e.getSocketRpcClient=s;const t=gt(),n=pf(),r=Mf(),o=Vg();e.socketClientCache=new Map;async function s(i){const{getSocket:a,keepAlive:c=!0,key:u="socket",reconnect:l=!0,url:f}=i,{interval:b=3e4}=typeof c=="object"?c:{},{attempts:y=5,delay:h=2e3}=typeof l=="object"?l:{},m=JSON.stringify({keepAlive:c,key:u,url:f,reconnect:l});let E=e.socketClientCache.get(m);if(E)return E;let v=0;const{schedule:_}=(0,n.createBatchScheduler)({id:m,fn:async()=>{const j=new Map,g=new Map;let p,T,w,A=!1;function C(){if(l&&v<y){if(A)return;A=!0,v++,T?.close(),setTimeout(async()=>{await R().catch(console.error),A=!1},h)}else j.clear(),g.clear()}async function R(){const S=await a({onClose(){for(const x of j.values())x.onError?.(new t.SocketClosedError({url:f}));for(const x of g.values())x.onError?.(new t.SocketClosedError({url:f}));C()},onError(x){p=x;for(const F of j.values())F.onError?.(p);for(const F of g.values())F.onError?.(p);C()},onOpen(){p=void 0,v=0},onResponse(x){const F=x.method==="eth_subscription",M=F?x.params.subscription:x.id,I=F?g:j,k=I.get(M);k&&k.onResponse(x),F||I.delete(M)}});if(T=S,c&&(w&&clearInterval(w),w=setInterval(()=>T.ping?.(),b)),l&&g.size>0){const x=g.entries();for(const[F,{onResponse:M,body:I,onError:k}]of x)I&&(g.delete(F),E?.request({body:I,onResponse:M,onError:k}))}return S}return await R(),p=void 0,E={close(){w&&clearInterval(w),T.close(),e.socketClientCache.delete(m)},get socket(){return T},request({body:S,onError:x,onResponse:F}){p&&x&&x(p);const M=S.id??o.idCache.take(),I=k=>{typeof k.id=="number"&&M!==k.id||(S.method==="eth_subscribe"&&typeof k.result=="string"&&g.set(k.result,{onResponse:I,onError:x,body:S}),F(k))};S.method==="eth_unsubscribe"&&g.delete(S.params?.[0]),j.set(M,{onResponse:I,onError:x});try{T.request({body:{jsonrpc:"2.0",id:M,...S}})}catch(k){x?.(k)}},requestAsync({body:S,timeout:x=1e4}){return(0,r.withTimeout)(()=>new Promise((F,M)=>this.request({body:S,onError:M,onResponse:F})),{errorInstance:new t.TimeoutError({body:S,url:f}),timeout:x})},requests:j,subscriptions:g,url:f},e.socketClientCache.set(m,E),[E]}}),[P,[d]]=await _();return d}})(Gd)),Gd}const l6=uv(yv);var Kh;function kf(){if(Kh)return As;Kh=1,Object.defineProperty(As,"__esModule",{value:!0}),As.getWebSocketRpcClient=n;const e=gt(),t=Wg();async function n(r,o={}){const{keepAlive:s,reconnect:i}=o;return(0,t.getSocketRpcClient)({async getSocket({onClose:a,onError:c,onOpen:u,onResponse:l}){const f=await Promise.resolve().then(()=>l6).then(E=>E.WebSocket),b=new f(r);function y(){b.removeEventListener("close",y),b.removeEventListener("message",h),b.removeEventListener("error",c),b.removeEventListener("open",u),a()}function h({data:E}){if(!(typeof E=="string"&&E.trim().length===0))try{const v=JSON.parse(E);l(v)}catch(v){c(v)}}b.addEventListener("close",y),b.addEventListener("message",h),b.addEventListener("error",c),b.addEventListener("open",u),b.readyState===f.CONNECTING&&await new Promise((E,v)=>{b&&(b.onopen=E,b.onerror=v)});const{close:m}=b;return Object.assign(b,{close(){m.bind(b)(),y()},ping(){try{if(b.readyState===b.CLOSED||b.readyState===b.CLOSING)throw new e.WebSocketRequestError({url:b.url,cause:new e.SocketClosedError({url:b.url})});const E={jsonrpc:"2.0",id:null,method:"net_version",params:[]};b.send(JSON.stringify(E))}catch(E){c(E)}},request({body:E}){if(b.readyState===b.CLOSED||b.readyState===b.CLOSING)throw new e.WebSocketRequestError({body:E,url:b.url,cause:new e.SocketClosedError({url:b.url})});return b.send(JSON.stringify(E))}})},keepAlive:s,reconnect:i,url:r})}return As}var Zh;function Kg(){if(Zh)return un;Zh=1,Object.defineProperty(un,"__esModule",{value:!0}),un.rpc=void 0,un.getSocket=o;const e=Hf(),t=kf();function n(s,{body:i,onError:a,onResponse:c}){return s.request({body:i,onError:a,onResponse:c}),s}async function r(s,{body:i,timeout:a=1e4}){return s.requestAsync({body:i,timeout:a})}async function o(s){const i=await(0,t.getWebSocketRpcClient)(s);return Object.assign(i.socket,{requests:i.requests,subscriptions:i.subscriptions})}return un.rpc={http(s,i){return(0,e.getHttpRpcClient)(s).request(i)},webSocket:n,webSocketAsync:r},un}var Ts={},Is={},wo={},Yh;function Zg(){return Yh||(Yh=1,Object.defineProperty(wo,"__esModule",{value:!0}),wo.presignMessagePrefix=void 0,wo.presignMessagePrefix=`Ethereum Signed Message:
45
+ `),wo}var Jh;function Yg(){if(Jh)return Is;Jh=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.toPrefixedMessage=o;const e=Zg(),t=Ce(),n=Ke(),r=te();function o(s){const i=typeof s=="string"?(0,r.stringToHex)(s):typeof s.raw=="string"?s.raw:(0,r.bytesToHex)(s.raw),a=(0,r.stringToHex)(`${e.presignMessagePrefix}${(0,n.size)(i)}`);return(0,t.concat)([a,i])}return Is}var Xh;function Xo(){if(Xh)return Ts;Xh=1,Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.hashMessage=n;const e=Ze(),t=Yg();function n(r,o){return(0,e.keccak256)((0,t.toPrefixedMessage)(r),o)}return Ts}var Rr={},Br={},Ut={},Qh;function Jg(){if(Qh)return Ut;Qh=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.InvalidStructTypeError=Ut.InvalidPrimaryTypeError=Ut.InvalidDomainError=void 0;const e=He(),t=ue();class n extends t.BaseError{constructor({domain:i}){super(`Invalid domain "${(0,e.stringify)(i)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}Ut.InvalidDomainError=n;class r extends t.BaseError{constructor({primaryType:i,types:a}){super(`Invalid primary type \`${i}\` must be one of \`${JSON.stringify(Object.keys(a))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}Ut.InvalidPrimaryTypeError=r;class o extends t.BaseError{constructor({type:i}){super(`Struct type "${i}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}return Ut.InvalidStructTypeError=o,Ut}var $h;function Zu(){if($h)return Br;$h=1,Object.defineProperty(Br,"__esModule",{value:!0}),Br.serializeTypedData=u,Br.validateTypedData=l,Br.getTypesForEIP712Domain=f,Br.domainSeparator=b;const e=Te(),t=yt(),n=Jg(),r=Ye(),o=Ke(),s=te(),i=Su(),a=Qo(),c=He();function u(h){const{domain:m,message:E,primaryType:v,types:_}=h,P=(g,p)=>{const T={...p};for(const w of g){const{name:A,type:C}=w;C==="address"&&(T[A]=T[A].toLowerCase())}return T},d=_.EIP712Domain?m?P(_.EIP712Domain,m):{}:{},j=(()=>{if(v!=="EIP712Domain")return P(_[v],E)})();return(0,c.stringify)({domain:d,message:j,primaryType:v,types:_})}function l(h){const{domain:m,message:E,primaryType:v,types:_}=h,P=(d,j)=>{for(const g of d){const{name:p,type:T}=g,w=j[p],A=T.match(i.integerRegex);if(A&&(typeof w=="number"||typeof w=="bigint")){const[S,x,F]=A;(0,s.numberToHex)(w,{signed:x==="int",size:Number.parseInt(F,10)/8})}if(T==="address"&&typeof w=="string"&&!(0,r.isAddress)(w))throw new t.InvalidAddressError({address:w});const C=T.match(i.bytesRegex);if(C){const[S,x]=C;if(x&&(0,o.size)(w)!==Number.parseInt(x,10))throw new e.BytesSizeMismatchError({expectedSize:Number.parseInt(x,10),givenSize:(0,o.size)(w)})}const R=_[T];R&&(y(T),P(R,w))}};if(_.EIP712Domain&&m){if(typeof m!="object")throw new n.InvalidDomainError({domain:m});P(_.EIP712Domain,m)}if(v!=="EIP712Domain")if(_[v])P(_[v],E);else throw new n.InvalidPrimaryTypeError({primaryType:v,types:_})}function f({domain:h}){return[typeof h?.name=="string"&&{name:"name",type:"string"},h?.version&&{name:"version",type:"string"},(typeof h?.chainId=="number"||typeof h?.chainId=="bigint")&&{name:"chainId",type:"uint256"},h?.verifyingContract&&{name:"verifyingContract",type:"address"},h?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function b({domain:h}){return(0,a.hashDomain)({domain:h,types:{EIP712Domain:f({domain:h})}})}function y(h){if(h==="address"||h==="bool"||h==="string"||h.startsWith("bytes")||h.startsWith("uint")||h.startsWith("int"))throw new n.InvalidStructTypeError({type:h})}return Br}var ey;function Qo(){if(ey)return Rr;ey=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.hashTypedData=s,Rr.hashDomain=i,Rr.hashStruct=a,Rr.encodeType=l;const e=pt(),t=Ce(),n=te(),r=Ze(),o=Zu();function s(y){const{domain:h={},message:m,primaryType:E}=y,v={EIP712Domain:(0,o.getTypesForEIP712Domain)({domain:h}),...y.types};(0,o.validateTypedData)({domain:h,message:m,primaryType:E,types:v});const _=["0x1901"];return h&&_.push(i({domain:h,types:v})),E!=="EIP712Domain"&&_.push(a({data:m,primaryType:E,types:v})),(0,r.keccak256)((0,t.concat)(_))}function i({domain:y,types:h}){return a({data:y,primaryType:"EIP712Domain",types:h})}function a({data:y,primaryType:h,types:m}){const E=c({data:y,primaryType:h,types:m});return(0,r.keccak256)(E)}function c({data:y,primaryType:h,types:m}){const E=[{type:"bytes32"}],v=[u({primaryType:h,types:m})];for(const _ of m[h]){const[P,d]=b({types:m,name:_.name,type:_.type,value:y[_.name]});E.push(P),v.push(d)}return(0,e.encodeAbiParameters)(E,v)}function u({primaryType:y,types:h}){const m=(0,n.toHex)(l({primaryType:y,types:h}));return(0,r.keccak256)(m)}function l({primaryType:y,types:h}){let m="";const E=f({primaryType:y,types:h});E.delete(y);const v=[y,...Array.from(E).sort()];for(const _ of v)m+=`${_}(${h[_].map(({name:P,type:d})=>`${d} ${P}`).join(",")})`;return m}function f({primaryType:y,types:h},m=new Set){const v=y.match(/^\w*/u)?.[0];if(m.has(v)||h[v]===void 0)return m;m.add(v);for(const _ of h[v])f({primaryType:_.type,types:h},m);return m}function b({types:y,name:h,type:m,value:E}){if(y[m]!==void 0)return[{type:"bytes32"},(0,r.keccak256)(c({data:E,primaryType:m,types:y}))];if(m==="bytes")return[{type:"bytes32"},(0,r.keccak256)(E)];if(m==="string")return[{type:"bytes32"},(0,r.keccak256)((0,n.toHex)(E))];if(m.lastIndexOf("]")===m.length-1){const v=m.slice(0,m.lastIndexOf("[")),_=E.map(P=>b({name:h,type:v,types:y,value:P}));return[{type:"bytes32"},(0,r.keccak256)((0,e.encodeAbiParameters)(_.map(([P])=>P),_.map(([,P])=>P)))]}return[{type:m},E]}return Rr}var Ss={},Or={},ty;function Ff(){return ty||(ty=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.zeroHash=Or.erc6492MagicBytes=void 0,Or.erc6492MagicBytes="0x6492649264926492649264926492649264926492649264926492649264926492",Or.zeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"),Or}var ry;function Nf(){if(ry)return Ss;ry=1,Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.isErc6492Signature=n;const e=Ff(),t=at();function n(r){return(0,t.sliceHex)(r,-32)===e.erc6492MagicBytes}return Ss}var Rs={},Po={},Vd={},Pe={},Ue={},dn={},Ao={},ny;function b6(){if(ny)return Ao;ny=1,Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.LruMap=void 0;class e extends Map{constructor(n){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=n}get(n){const r=super.get(n);return super.has(n)&&r!==void 0&&(this.delete(n),super.set(n,r)),r}set(n,r){if(super.set(n,r),this.maxSize&&this.size>this.maxSize){const o=this.keys().next().value;o&&this.delete(o)}return this}}return Ao.LruMap=e,Ao}var oy;function m6(){if(oy)return dn;oy=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.checksum=void 0,dn.clear=n;const e=b6(),t={checksum:new e.LruMap(8192)};dn.checksum=t.checksum;function n(){for(const r of Object.values(t))r.clear()}return dn}var xr={},iy;function zf(){if(iy)return xr;iy=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.keccak256=s,xr.ripemd160=i,xr.sha256=a,xr.validate=c;const e=Fg(),t=X1(),n=dg(),r=Tt(),o=ke();function s(u,l={}){const{as:f=typeof u=="string"?"Hex":"Bytes"}=l,b=(0,t.keccak_256)(r.from(u));return f==="Bytes"?b:o.fromBytes(b)}function i(u,l={}){const{as:f=typeof u=="string"?"Hex":"Bytes"}=l,b=(0,e.ripemd160)(r.from(u));return f==="Bytes"?b:o.fromBytes(b)}function a(u,l={}){const{as:f=typeof u=="string"?"Hex":"Bytes"}=l,b=(0,n.sha256)(r.from(u));return f==="Bytes"?b:o.fromBytes(b)}function c(u){return o.validate(u)&&o.size(u)===32}return xr}var Oe={},ay;function Xg(){if(ay)return Oe;ay=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.InvalidSerializedSizeError=Oe.InvalidUncompressedPrefixError=Oe.InvalidCompressedPrefixError=Oe.InvalidPrefixError=Oe.InvalidError=void 0,Oe.assert=o,Oe.compress=s,Oe.from=i,Oe.fromBytes=a,Oe.fromHex=c,Oe.toBytes=u,Oe.toHex=l,Oe.validate=f;const e=Tt(),t=ot(),n=ke(),r=Nu();function o(v,_={}){const{compressed:P}=_,{prefix:d,x:j,y:g}=v;if(P===!1||typeof j=="bigint"&&typeof g=="bigint"){if(d!==4)throw new y({prefix:d,cause:new m});return}if(P===!0||typeof j=="bigint"&&typeof g>"u"){if(d!==3&&d!==2)throw new y({prefix:d,cause:new h});return}throw new b({publicKey:v})}function s(v){const{x:_,y:P}=v;return{prefix:P%2n===0n?2:3,x:_}}function i(v){const _=(()=>{if(n.validate(v))return c(v);if(e.validate(v))return a(v);const{prefix:P,x:d,y:j}=v;return typeof d=="bigint"&&typeof j=="bigint"?{prefix:P??4,x:d,y:j}:{prefix:P,x:d}})();return o(_),_}function a(v){return c(n.fromBytes(v))}function c(v){if(v.length!==132&&v.length!==130&&v.length!==68)throw new E({publicKey:v});if(v.length===130){const d=BigInt(n.slice(v,0,32)),j=BigInt(n.slice(v,32,64));return{prefix:4,x:d,y:j}}if(v.length===132){const d=Number(n.slice(v,0,1)),j=BigInt(n.slice(v,1,33)),g=BigInt(n.slice(v,33,65));return{prefix:d,x:j,y:g}}const _=Number(n.slice(v,0,1)),P=BigInt(n.slice(v,1,33));return{prefix:_,x:P}}function u(v,_={}){return e.fromHex(l(v,_))}function l(v,_={}){o(v);const{prefix:P,x:d,y:j}=v,{includePrefix:g=!0}=_;return n.concat(g?n.fromNumber(P,{size:1}):"0x",n.fromNumber(d,{size:32}),typeof j=="bigint"?n.fromNumber(j,{size:32}):"0x")}function f(v,_={}){try{return o(v,_),!0}catch{return!1}}class b extends t.BaseError{constructor({publicKey:_}){super(`Value \`${r.stringify(_)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}Oe.InvalidError=b;class y extends t.BaseError{constructor({prefix:_,cause:P}){super(`Prefix "${_}" is invalid.`,{cause:P}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}Oe.InvalidPrefixError=y;class h extends t.BaseError{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}Oe.InvalidCompressedPrefixError=h;class m extends t.BaseError{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}Oe.InvalidUncompressedPrefixError=m;class E extends t.BaseError{constructor({publicKey:_}){super(`Value \`${_}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${n.size(n.from(_))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}return Oe.InvalidSerializedSizeError=E,Oe}var sy;function Yu(){if(sy)return Ue;sy=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.InvalidChecksumError=Ue.InvalidInputError=Ue.InvalidAddressError=void 0,Ue.assert=i,Ue.checksum=a,Ue.from=c,Ue.fromPublicKey=u,Ue.isEqual=l,Ue.validate=f;const e=Tt(),t=m6(),n=ot(),r=zf(),o=Xg(),s=/^0x[a-fA-F0-9]{40}$/;function i(m,E={}){const{strict:v=!0}=E;if(!s.test(m))throw new b({address:m,cause:new y});if(v){if(m.toLowerCase()===m)return;if(a(m)!==m)throw new b({address:m,cause:new h})}}function a(m){if(t.checksum.has(m))return t.checksum.get(m);i(m,{strict:!1});const E=m.substring(2).toLowerCase(),v=r.keccak256(e.fromString(E),{as:"Bytes"}),_=E.split("");for(let d=0;d<40;d+=2)v[d>>1]>>4>=8&&_[d]&&(_[d]=_[d].toUpperCase()),(v[d>>1]&15)>=8&&_[d+1]&&(_[d+1]=_[d+1].toUpperCase());const P=`0x${_.join("")}`;return t.checksum.set(m,P),P}function c(m,E={}){const{checksum:v=!1}=E;return i(m),v?a(m):m}function u(m,E={}){const v=r.keccak256(`0x${o.toHex(m).slice(4)}`).substring(26);return c(`0x${v}`,E)}function l(m,E){return i(m,{strict:!1}),i(E,{strict:!1}),m.toLowerCase()===E.toLowerCase()}function f(m,E={}){const{strict:v=!0}=E??{};try{return i(m,{strict:v}),!0}catch{return!1}}class b extends n.BaseError{constructor({address:E,cause:v}){super(`Address "${E}" is invalid.`,{cause:v}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}Ue.InvalidAddressError=b;class y extends n.BaseError{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}Ue.InvalidInputError=y;class h extends n.BaseError{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}return Ue.InvalidChecksumError=h,Ue}var Ae={},L={},cy;function Uf(){return cy||(cy=1,Object.defineProperty(L,"__esModule",{value:!0}),L.minInt120=L.minInt112=L.minInt104=L.minInt96=L.minInt88=L.minInt80=L.minInt72=L.minInt64=L.minInt56=L.minInt48=L.minInt40=L.minInt32=L.minInt24=L.minInt16=L.minInt8=L.maxInt256=L.maxInt248=L.maxInt240=L.maxInt232=L.maxInt224=L.maxInt216=L.maxInt208=L.maxInt200=L.maxInt192=L.maxInt184=L.maxInt176=L.maxInt168=L.maxInt160=L.maxInt152=L.maxInt144=L.maxInt136=L.maxInt128=L.maxInt120=L.maxInt112=L.maxInt104=L.maxInt96=L.maxInt88=L.maxInt80=L.maxInt72=L.maxInt64=L.maxInt56=L.maxInt48=L.maxInt40=L.maxInt32=L.maxInt24=L.maxInt16=L.maxInt8=L.integerRegex=L.bytesRegex=L.arrayRegex=void 0,L.maxUint256=L.maxUint248=L.maxUint240=L.maxUint232=L.maxUint224=L.maxUint216=L.maxUint208=L.maxUint200=L.maxUint192=L.maxUint184=L.maxUint176=L.maxUint168=L.maxUint160=L.maxUint152=L.maxUint144=L.maxUint136=L.maxUint128=L.maxUint120=L.maxUint112=L.maxUint104=L.maxUint96=L.maxUint88=L.maxUint80=L.maxUint72=L.maxUint64=L.maxUint56=L.maxUint48=L.maxUint40=L.maxUint32=L.maxUint24=L.maxUint16=L.maxUint8=L.minInt256=L.minInt248=L.minInt240=L.minInt232=L.minInt224=L.minInt216=L.minInt208=L.minInt200=L.minInt192=L.minInt184=L.minInt176=L.minInt168=L.minInt160=L.minInt152=L.minInt144=L.minInt136=L.minInt128=void 0,L.arrayRegex=/^(.*)\[([0-9]*)\]$/,L.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,L.integerRegex=/^(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)?$/,L.maxInt8=2n**(8n-1n)-1n,L.maxInt16=2n**(16n-1n)-1n,L.maxInt24=2n**(24n-1n)-1n,L.maxInt32=2n**(32n-1n)-1n,L.maxInt40=2n**(40n-1n)-1n,L.maxInt48=2n**(48n-1n)-1n,L.maxInt56=2n**(56n-1n)-1n,L.maxInt64=2n**(64n-1n)-1n,L.maxInt72=2n**(72n-1n)-1n,L.maxInt80=2n**(80n-1n)-1n,L.maxInt88=2n**(88n-1n)-1n,L.maxInt96=2n**(96n-1n)-1n,L.maxInt104=2n**(104n-1n)-1n,L.maxInt112=2n**(112n-1n)-1n,L.maxInt120=2n**(120n-1n)-1n,L.maxInt128=2n**(128n-1n)-1n,L.maxInt136=2n**(136n-1n)-1n,L.maxInt144=2n**(144n-1n)-1n,L.maxInt152=2n**(152n-1n)-1n,L.maxInt160=2n**(160n-1n)-1n,L.maxInt168=2n**(168n-1n)-1n,L.maxInt176=2n**(176n-1n)-1n,L.maxInt184=2n**(184n-1n)-1n,L.maxInt192=2n**(192n-1n)-1n,L.maxInt200=2n**(200n-1n)-1n,L.maxInt208=2n**(208n-1n)-1n,L.maxInt216=2n**(216n-1n)-1n,L.maxInt224=2n**(224n-1n)-1n,L.maxInt232=2n**(232n-1n)-1n,L.maxInt240=2n**(240n-1n)-1n,L.maxInt248=2n**(248n-1n)-1n,L.maxInt256=2n**(256n-1n)-1n,L.minInt8=-(2n**(8n-1n)),L.minInt16=-(2n**(16n-1n)),L.minInt24=-(2n**(24n-1n)),L.minInt32=-(2n**(32n-1n)),L.minInt40=-(2n**(40n-1n)),L.minInt48=-(2n**(48n-1n)),L.minInt56=-(2n**(56n-1n)),L.minInt64=-(2n**(64n-1n)),L.minInt72=-(2n**(72n-1n)),L.minInt80=-(2n**(80n-1n)),L.minInt88=-(2n**(88n-1n)),L.minInt96=-(2n**(96n-1n)),L.minInt104=-(2n**(104n-1n)),L.minInt112=-(2n**(112n-1n)),L.minInt120=-(2n**(120n-1n)),L.minInt128=-(2n**(128n-1n)),L.minInt136=-(2n**(136n-1n)),L.minInt144=-(2n**(144n-1n)),L.minInt152=-(2n**(152n-1n)),L.minInt160=-(2n**(160n-1n)),L.minInt168=-(2n**(168n-1n)),L.minInt176=-(2n**(176n-1n)),L.minInt184=-(2n**(184n-1n)),L.minInt192=-(2n**(192n-1n)),L.minInt200=-(2n**(200n-1n)),L.minInt208=-(2n**(208n-1n)),L.minInt216=-(2n**(216n-1n)),L.minInt224=-(2n**(224n-1n)),L.minInt232=-(2n**(232n-1n)),L.minInt240=-(2n**(240n-1n)),L.minInt248=-(2n**(248n-1n)),L.minInt256=-(2n**(256n-1n)),L.maxUint8=2n**8n-1n,L.maxUint16=2n**16n-1n,L.maxUint24=2n**24n-1n,L.maxUint32=2n**32n-1n,L.maxUint40=2n**40n-1n,L.maxUint48=2n**48n-1n,L.maxUint56=2n**56n-1n,L.maxUint64=2n**64n-1n,L.maxUint72=2n**72n-1n,L.maxUint80=2n**80n-1n,L.maxUint88=2n**88n-1n,L.maxUint96=2n**96n-1n,L.maxUint104=2n**104n-1n,L.maxUint112=2n**112n-1n,L.maxUint120=2n**120n-1n,L.maxUint128=2n**128n-1n,L.maxUint136=2n**136n-1n,L.maxUint144=2n**144n-1n,L.maxUint152=2n**152n-1n,L.maxUint160=2n**160n-1n,L.maxUint168=2n**168n-1n,L.maxUint176=2n**176n-1n,L.maxUint184=2n**184n-1n,L.maxUint192=2n**192n-1n,L.maxUint200=2n**200n-1n,L.maxUint208=2n**208n-1n,L.maxUint216=2n**216n-1n,L.maxUint224=2n**224n-1n,L.maxUint232=2n**232n-1n,L.maxUint240=2n**240n-1n,L.maxUint248=2n**248n-1n,L.maxUint256=2n**256n-1n),L}var uy;function h6(){if(uy)return Ae;uy=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.decodeParameter=i,Ae.decodeAddress=u,Ae.decodeArray=l,Ae.decodeBool=f,Ae.decodeBytes=b,Ae.decodeNumber=y,Ae.decodeTuple=h,Ae.decodeString=m,Ae.prepareParameters=E,Ae.prepareParameter=v,Ae.encode=_,Ae.encodeAddress=P,Ae.encodeArray=d,Ae.encodeBytes=j,Ae.encodeBoolean=g,Ae.encodeNumber=p,Ae.encodeString=T,Ae.encodeTuple=w,Ae.getArrayComponents=A,Ae.hasDynamicChild=C;const e=$o(),t=Yu(),n=Tt(),r=ot(),o=ke(),s=Uf();function i(R,S,x){const{checksumAddress:F,staticPosition:M}=x,I=A(S.type);if(I){const[k,B]=I;return l(R,{...S,type:B},{checksumAddress:F,length:k,staticPosition:M})}if(S.type==="tuple")return h(R,S,{checksumAddress:F,staticPosition:M});if(S.type==="address")return u(R,{checksum:F});if(S.type==="bool")return f(R);if(S.type.startsWith("bytes"))return b(R,S,{staticPosition:M});if(S.type.startsWith("uint")||S.type.startsWith("int"))return y(R,S);if(S.type==="string")return m(R,{staticPosition:M});throw new e.InvalidTypeError(S.type)}const a=32,c=32;function u(R,S={}){const{checksum:x=!1}=S,F=R.readBytes(32);return[(I=>x?t.checksum(I):I)(o.fromBytes(n.slice(F,-20))),32]}function l(R,S,x){const{checksumAddress:F,length:M,staticPosition:I}=x;if(!M){const q=n.toNumber(R.readBytes(c)),O=I+q,H=O+a;R.setPosition(O);const N=n.toNumber(R.readBytes(a)),U=C(S);let z=0;const G=[];for(let V=0;V<N;++V){R.setPosition(H+(U?V*32:z));const[J,Z]=i(R,S,{checksumAddress:F,staticPosition:H});z+=Z,G.push(J)}return R.setPosition(I+32),[G,32]}if(C(S)){const q=n.toNumber(R.readBytes(c)),O=I+q,H=[];for(let N=0;N<M;++N){R.setPosition(O+N*32);const[U]=i(R,S,{checksumAddress:F,staticPosition:O});H.push(U)}return R.setPosition(I+32),[H,32]}let k=0;const B=[];for(let q=0;q<M;++q){const[O,H]=i(R,S,{checksumAddress:F,staticPosition:I+k});k+=H,B.push(O)}return[B,k]}function f(R){return[n.toBoolean(R.readBytes(32),{size:32}),32]}function b(R,S,{staticPosition:x}){const[F,M]=S.type.split("bytes");if(!M){const k=n.toNumber(R.readBytes(32));R.setPosition(x+k);const B=n.toNumber(R.readBytes(32));if(B===0)return R.setPosition(x+32),["0x",32];const q=R.readBytes(B);return R.setPosition(x+32),[o.fromBytes(q),32]}return[o.fromBytes(R.readBytes(Number.parseInt(M,10),32)),32]}function y(R,S){const x=S.type.startsWith("int"),F=Number.parseInt(S.type.split("int")[1]||"256",10),M=R.readBytes(32);return[F>48?n.toBigInt(M,{signed:x}):n.toNumber(M,{signed:x}),32]}function h(R,S,x){const{checksumAddress:F,staticPosition:M}=x,I=S.components.length===0||S.components.some(({name:q})=>!q),k=I?[]:{};let B=0;if(C(S)){const q=n.toNumber(R.readBytes(c)),O=M+q;for(let H=0;H<S.components.length;++H){const N=S.components[H];R.setPosition(O+B);const[U,z]=i(R,N,{checksumAddress:F,staticPosition:O});B+=z,k[I?H:N?.name]=U}return R.setPosition(M+32),[k,32]}for(let q=0;q<S.components.length;++q){const O=S.components[q],[H,N]=i(R,O,{checksumAddress:F,staticPosition:M});k[I?q:O?.name]=H,B+=N}return[k,B]}function m(R,{staticPosition:S}){const x=n.toNumber(R.readBytes(32)),F=S+x;R.setPosition(F);const M=n.toNumber(R.readBytes(32));if(M===0)return R.setPosition(S+32),["",32];const I=R.readBytes(M,32),k=n.toString(n.trimLeft(I));return R.setPosition(S+32),[k,32]}function E({checksumAddress:R,parameters:S,values:x}){const F=[];for(let M=0;M<S.length;M++)F.push(v({checksumAddress:R,parameter:S[M],value:x[M]}));return F}function v({checksumAddress:R=!1,parameter:S,value:x}){const F=S,M=A(F.type);if(M){const[I,k]=M;return d(x,{checksumAddress:R,length:I,parameter:{...F,type:k}})}if(F.type==="tuple")return w(x,{checksumAddress:R,parameter:F});if(F.type==="address")return P(x,{checksum:R});if(F.type==="bool")return g(x);if(F.type.startsWith("uint")||F.type.startsWith("int")){const I=F.type.startsWith("int"),[,,k="256"]=s.integerRegex.exec(F.type)??[];return p(x,{signed:I,size:Number(k)})}if(F.type.startsWith("bytes"))return j(x,{type:F.type});if(F.type==="string")return T(x);throw new e.InvalidTypeError(F.type)}function _(R){let S=0;for(let I=0;I<R.length;I++){const{dynamic:k,encoded:B}=R[I];k?S+=32:S+=o.size(B)}const x=[],F=[];let M=0;for(let I=0;I<R.length;I++){const{dynamic:k,encoded:B}=R[I];k?(x.push(o.fromNumber(S+M,{size:32})),F.push(B),M+=o.size(B)):x.push(B)}return o.concat(...x,...F)}function P(R,S){const{checksum:x=!1}=S;return t.assert(R,{strict:x}),{dynamic:!1,encoded:o.padLeft(R.toLowerCase())}}function d(R,S){const{checksumAddress:x,length:F,parameter:M}=S,I=F===null;if(!Array.isArray(R))throw new e.InvalidArrayError(R);if(!I&&R.length!==F)throw new e.ArrayLengthMismatchError({expectedLength:F,givenLength:R.length,type:`${M.type}[${F}]`});let k=!1;const B=[];for(let q=0;q<R.length;q++){const O=v({checksumAddress:x,parameter:M,value:R[q]});O.dynamic&&(k=!0),B.push(O)}if(I||k){const q=_(B);if(I){const O=o.fromNumber(B.length,{size:32});return{dynamic:!0,encoded:B.length>0?o.concat(O,q):O}}if(k)return{dynamic:!0,encoded:q}}return{dynamic:!1,encoded:o.concat(...B.map(({encoded:q})=>q))}}function j(R,{type:S}){const[,x]=S.split("bytes"),F=o.size(R);if(!x){let M=R;return F%32!==0&&(M=o.padRight(M,Math.ceil((R.length-2)/2/32)*32)),{dynamic:!0,encoded:o.concat(o.padLeft(o.fromNumber(F,{size:32})),M)}}if(F!==Number.parseInt(x,10))throw new e.BytesSizeMismatchError({expectedSize:Number.parseInt(x,10),value:R});return{dynamic:!1,encoded:o.padRight(R)}}function g(R){if(typeof R!="boolean")throw new r.BaseError(`Invalid boolean value: "${R}" (type: ${typeof R}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:o.padLeft(o.fromBoolean(R))}}function p(R,{signed:S,size:x}){if(typeof x=="number"){const F=2n**(BigInt(x)-(S?1n:0n))-1n,M=S?-F-1n:0n;if(R>F||R<M)throw new o.IntegerOutOfRangeError({max:F.toString(),min:M.toString(),signed:S,size:x/8,value:R.toString()})}return{dynamic:!1,encoded:o.fromNumber(R,{size:32,signed:S})}}function T(R){const S=o.fromString(R),x=Math.ceil(o.size(S)/32),F=[];for(let M=0;M<x;M++)F.push(o.padRight(o.slice(S,M*32,(M+1)*32)));return{dynamic:!0,encoded:o.concat(o.padRight(o.fromNumber(o.size(S),{size:32})),...F)}}function w(R,S){const{checksumAddress:x,parameter:F}=S;let M=!1;const I=[];for(let k=0;k<F.components.length;k++){const B=F.components[k],q=Array.isArray(R)?k:B.name,O=v({checksumAddress:x,parameter:B,value:R[q]});I.push(O),O.dynamic&&(M=!0)}return{dynamic:M,encoded:M?_(I):o.concat(...I.map(({encoded:k})=>k))}}function A(R){const S=R.match(/^(.*)\[(\d+)?\]$/);return S?[S[2]?Number(S[2]):null,S[1]]:void 0}function C(R){const{type:S}=R;if(S==="string"||S==="bytes"||S.endsWith("[]"))return!0;if(S==="tuple")return R.components?.some(C);const x=A(R.type);return!!(x&&C({...R,type:x[1]}))}return Ae}var At={},dy;function Qg(){if(dy)return At;dy=1,Object.defineProperty(At,"__esModule",{value:!0}),At.RecursiveReadLimitExceededError=At.PositionOutOfBoundsError=At.NegativeOffsetError=void 0,At.create=n;const e=ot(),t={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new s({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(i){if(i<0||i>this.bytes.length-1)throw new o({length:this.bytes.length,position:i})},decrementPosition(i){if(i<0)throw new r({offset:i});const a=this.position-i;this.assertPosition(a),this.position=a},getReadCount(i){return this.positionReadCount.get(i||this.position)||0},incrementPosition(i){if(i<0)throw new r({offset:i});const a=this.position+i;this.assertPosition(a),this.position=a},inspectByte(i){const a=i??this.position;return this.assertPosition(a),this.bytes[a]},inspectBytes(i,a){const c=a??this.position;return this.assertPosition(c+i-1),this.bytes.subarray(c,c+i)},inspectUint8(i){const a=i??this.position;return this.assertPosition(a),this.bytes[a]},inspectUint16(i){const a=i??this.position;return this.assertPosition(a+1),this.dataView.getUint16(a)},inspectUint24(i){const a=i??this.position;return this.assertPosition(a+2),(this.dataView.getUint16(a)<<8)+this.dataView.getUint8(a+2)},inspectUint32(i){const a=i??this.position;return this.assertPosition(a+3),this.dataView.getUint32(a)},pushByte(i){this.assertPosition(this.position),this.bytes[this.position]=i,this.position++},pushBytes(i){this.assertPosition(this.position+i.length-1),this.bytes.set(i,this.position),this.position+=i.length},pushUint8(i){this.assertPosition(this.position),this.bytes[this.position]=i,this.position++},pushUint16(i){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,i),this.position+=2},pushUint24(i){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,i>>8),this.dataView.setUint8(this.position+2,i&255),this.position+=3},pushUint32(i){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,i),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const i=this.inspectByte();return this.position++,i},readBytes(i,a){this.assertReadLimit(),this._touch();const c=this.inspectBytes(i);return this.position+=a??i,c},readUint8(){this.assertReadLimit(),this._touch();const i=this.inspectUint8();return this.position+=1,i},readUint16(){this.assertReadLimit(),this._touch();const i=this.inspectUint16();return this.position+=2,i},readUint24(){this.assertReadLimit(),this._touch();const i=this.inspectUint24();return this.position+=3,i},readUint32(){this.assertReadLimit(),this._touch();const i=this.inspectUint32();return this.position+=4,i},get remaining(){return this.bytes.length-this.position},setPosition(i){const a=this.position;return this.assertPosition(i),this.position=i,()=>this.position=a},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const i=this.getReadCount();this.positionReadCount.set(this.position,i+1),i>0&&this.recursiveReadCount++}};function n(i,{recursiveReadLimit:a=8192}={}){const c=Object.create(t);return c.bytes=i,c.dataView=new DataView(i.buffer,i.byteOffset,i.byteLength),c.positionReadCount=new Map,c.recursiveReadLimit=a,c}class r extends e.BaseError{constructor({offset:a}){super(`Offset \`${a}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}At.NegativeOffsetError=r;class o extends e.BaseError{constructor({length:a,position:c}){super(`Position \`${c}\` is out of bounds (\`0 < position < ${a}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}At.PositionOutOfBoundsError=o;class s extends e.BaseError{constructor({count:a,limit:c}){super(`Recursive read limit of \`${c}\` exceeded (recursive read count: \`${a}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}return At.RecursiveReadLimitExceededError=s,At}var fy;function $o(){if(fy)return Pe;fy=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.InvalidTypeError=Pe.InvalidArrayError=Pe.LengthMismatchError=Pe.BytesSizeMismatchError=Pe.ArrayLengthMismatchError=Pe.ZeroDataError=Pe.DataSizeTooSmallError=void 0,Pe.decode=c,Pe.encode=u,Pe.encodePacked=l,Pe.format=f,Pe.from=b;const e=rr(),t=Yu(),n=Tt(),r=ot(),o=ke(),s=h6(),i=Qg(),a=Uf();function c(d,j,g={}){const{as:p="Array",checksumAddress:T=!1}=g,w=typeof j=="string"?n.fromHex(j):j,A=i.create(w);if(n.size(w)===0&&d.length>0)throw new h;if(n.size(w)&&n.size(w)<32)throw new y({data:typeof j=="string"?j:o.fromBytes(j),parameters:d,size:n.size(w)});let C=0;const R=p==="Array"?[]:{};for(let S=0;S<d.length;++S){const x=d[S];A.setPosition(C);const[F,M]=s.decodeParameter(A,x,{checksumAddress:T,staticPosition:0});C+=M,p==="Array"?R.push(F):R[x.name??S]=F}return R}function u(d,j,g){const{checksumAddress:p=!1}=g??{};if(d.length!==j.length)throw new v({expectedLength:d.length,givenLength:j.length});const T=s.prepareParameters({checksumAddress:p,parameters:d,values:j}),w=s.encode(T);return w.length===0?"0x":w}function l(d,j){if(d.length!==j.length)throw new v({expectedLength:d.length,givenLength:j.length});const g=[];for(let p=0;p<d.length;p++){const T=d[p],w=j[p];g.push(l.encode(T,w))}return o.concat(...g)}(function(d){function j(g,p,T=!1){if(g==="address"){const R=p;return t.assert(R),o.padLeft(R.toLowerCase(),T?32:0)}if(g==="string")return o.fromString(p);if(g==="bytes")return p;if(g==="bool")return o.padLeft(o.fromBoolean(p),T?32:1);const w=g.match(a.integerRegex);if(w){const[R,S,x="256"]=w,F=Number.parseInt(x,10)/8;return o.fromNumber(p,{size:T?32:F,signed:S==="int"})}const A=g.match(a.bytesRegex);if(A){const[R,S]=A;if(Number.parseInt(S,10)!==(p.length-2)/2)throw new E({expectedSize:Number.parseInt(S,10),value:p});return o.padRight(p,T?32:0)}const C=g.match(a.arrayRegex);if(C&&Array.isArray(p)){const[R,S]=C,x=[];for(let F=0;F<p.length;F++)x.push(j(S,p[F],!0));return x.length===0?"0x":o.concat(...x)}throw new P(g)}d.encode=j})(l||(Pe.encodePacked=l={}));function f(d){return e.formatAbiParameters(d)}function b(d){return Array.isArray(d)&&typeof d[0]=="string"||typeof d=="string"?e.parseAbiParameters(d):d}class y extends r.BaseError{constructor({data:j,parameters:g,size:p}){super(`Data size of ${p} bytes is too small for given parameters.`,{metaMessages:[`Params: (${e.formatAbiParameters(g)})`,`Data: ${j} (${p} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}Pe.DataSizeTooSmallError=y;class h extends r.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}Pe.ZeroDataError=h;class m extends r.BaseError{constructor({expectedLength:j,givenLength:g,type:p}){super(`Array length mismatch for type \`${p}\`. Expected: \`${j}\`. Given: \`${g}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}Pe.ArrayLengthMismatchError=m;class E extends r.BaseError{constructor({expectedSize:j,value:g}){super(`Size of bytes "${g}" (bytes${o.size(g)}) does not match expected size (bytes${j}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}Pe.BytesSizeMismatchError=E;class v extends r.BaseError{constructor({expectedLength:j,givenLength:g}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${j}`,`Given length (values): ${g}`].join(`
46
+ `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}Pe.LengthMismatchError=v;class _ extends r.BaseError{constructor(j){super(`Value \`${j}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}Pe.InvalidArrayError=_;class P extends r.BaseError{constructor(j){super(`Type \`${j}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}return Pe.InvalidTypeError=P,Pe}var We={},it={},ly;function y6(){if(ly)return it;ly=1,Object.defineProperty(it,"__esModule",{value:!0}),it.toBytes=o,it.toHex=s,it.to=i,it.decodeRlpCursor=a,it.readLength=c,it.readList=u,it.from=l,it.fromBytes=f,it.fromHex=b;const e=Tt(),t=ot(),n=ke(),r=Qg();function o(v){return i(v,"Bytes")}function s(v){return i(v,"Hex")}function i(v,_){const P=_??(typeof v=="string"?"Hex":"Bytes"),d=(()=>{if(typeof v=="string"){if(v.length>3&&v.length%2!==0)throw new n.InvalidLengthError(v);return e.fromHex(v)}return v})(),j=r.create(d,{recursiveReadLimit:Number.POSITIVE_INFINITY});return a(j,P)}function a(v,_="Hex"){if(v.bytes.length===0)return _==="Hex"?n.fromBytes(v.bytes):v.bytes;const P=v.readByte();if(P<128&&v.decrementPosition(1),P<192){const j=c(v,P,128),g=v.readBytes(j);return _==="Hex"?n.fromBytes(g):g}const d=c(v,P,192);return u(v,d,_)}function c(v,_,P){if(P===128&&_<128)return 1;if(_<=P+55)return _-P;if(_===P+55+1)return v.readUint8();if(_===P+55+2)return v.readUint16();if(_===P+55+3)return v.readUint24();if(_===P+55+4)return v.readUint32();throw new t.BaseError("Invalid RLP prefix")}function u(v,_,P){const d=v.position,j=[];for(;v.position-d<_;)j.push(a(v,P));return j}function l(v,_){const{as:P}=_,d=y(v),j=r.create(new Uint8Array(d.length));return d.encode(j),P==="Hex"?n.fromBytes(j.bytes):j.bytes}function f(v,_={}){const{as:P="Bytes"}=_;return l(v,{as:P})}function b(v,_={}){const{as:P="Hex"}=_;return l(v,{as:P})}function y(v){return Array.isArray(v)?h(v.map(_=>y(_))):m(v)}function h(v){const _=v.reduce((j,g)=>j+g.length,0),P=E(_);return{length:_<=55?1+_:1+P+_,encode(j){_<=55?j.pushByte(192+_):(j.pushByte(247+P),P===1?j.pushUint8(_):P===2?j.pushUint16(_):P===3?j.pushUint24(_):j.pushUint32(_));for(const{encode:g}of v)g(j)}}}function m(v){const _=typeof v=="string"?e.fromHex(v):v,P=E(_.length);return{length:_.length===1&&_[0]<128?1:_.length<=55?1+_.length:1+P+_.length,encode(j){_.length===1&&_[0]<128?j.pushBytes(_):_.length<=55?(j.pushByte(128+_.length),j.pushBytes(_)):(j.pushByte(183+P),P===1?j.pushUint8(_.length):P===2?j.pushUint16(_.length):P===3?j.pushUint24(_.length):j.pushUint32(_.length),j.pushBytes(_))}}}function E(v){if(v<=255)return 1;if(v<=65535)return 2;if(v<=16777215)return 3;if(v<=4294967295)return 4;throw new t.BaseError("Length is too large.")}return it}var be={},by;function $g(){if(by)return be;by=1,Object.defineProperty(be,"__esModule",{value:!0}),be.InvalidVError=be.InvalidYParityError=be.InvalidSError=be.InvalidRError=be.MissingPropertiesError=be.InvalidSerializedSizeError=void 0,be.assert=i,be.fromBytes=a,be.fromHex=c,be.extract=u,be.from=l,be.fromDerBytes=f,be.fromDerHex=b,be.fromLegacy=y,be.fromRpc=h,be.fromTuple=m,be.toBytes=E,be.toHex=v,be.toDerBytes=_,be.toDerHex=P,be.toLegacy=d,be.toRpc=j,be.toTuple=g,be.validate=p,be.vToYParity=T,be.yParityToV=w;const e=Gr(),t=Tt(),n=ot(),r=ke(),o=Nu(),s=Uf();function i(M,I={}){const{recovered:k}=I;if(typeof M.r>"u")throw new C({signature:M});if(typeof M.s>"u")throw new C({signature:M});if(k&&typeof M.yParity>"u")throw new C({signature:M});if(M.r<0n||M.r>s.maxUint256)throw new R({value:M.r});if(M.s<0n||M.s>s.maxUint256)throw new S({value:M.s});if(typeof M.yParity=="number"&&M.yParity!==0&&M.yParity!==1)throw new x({value:M.yParity})}function a(M){return c(r.fromBytes(M))}function c(M){if(M.length!==130&&M.length!==132)throw new A({signature:M});const I=BigInt(r.slice(M,0,32)),k=BigInt(r.slice(M,32,64)),B=(()=>{const q=+`0x${M.slice(130)}`;if(!Number.isNaN(q))try{return T(q)}catch{throw new x({value:q})}})();return typeof B>"u"?{r:I,s:k}:{r:I,s:k,yParity:B}}function u(M){if(!(typeof M.r>"u")&&!(typeof M.s>"u"))return l(M)}function l(M){const I=typeof M=="string"?c(M):M instanceof Uint8Array?a(M):typeof M.r=="string"?h(M):M.v?y(M):{r:M.r,s:M.s,...typeof M.yParity<"u"?{yParity:M.yParity}:{}};return i(I),I}function f(M){return b(r.fromBytes(M))}function b(M){const{r:I,s:k}=e.secp256k1.Signature.fromDER(r.from(M).slice(2));return{r:I,s:k}}function y(M){return{r:M.r,s:M.s,yParity:T(M.v)}}function h(M){const I=(()=>{const k=M.v?Number(M.v):void 0;let B=M.yParity?Number(M.yParity):void 0;if(typeof k=="number"&&typeof B!="number"&&(B=T(k)),typeof B!="number")throw new x({value:M.yParity});return B})();return{r:BigInt(M.r),s:BigInt(M.s),yParity:I}}function m(M){const[I,k,B]=M;return l({r:k==="0x"?0n:BigInt(k),s:B==="0x"?0n:BigInt(B),yParity:I==="0x"?0:Number(I)})}function E(M){return t.fromHex(v(M))}function v(M){i(M);const I=M.r,k=M.s;return r.concat(r.fromNumber(I,{size:32}),r.fromNumber(k,{size:32}),typeof M.yParity=="number"?r.fromNumber(w(M.yParity),{size:1}):"0x")}function _(M){return new e.secp256k1.Signature(M.r,M.s).toDERRawBytes()}function P(M){return`0x${new e.secp256k1.Signature(M.r,M.s).toDERHex()}`}function d(M){return{r:M.r,s:M.s,v:w(M.yParity)}}function j(M){const{r:I,s:k,yParity:B}=M;return{r:r.fromNumber(I,{size:32}),s:r.fromNumber(k,{size:32}),yParity:B===0?"0x0":"0x1"}}function g(M){const{r:I,s:k,yParity:B}=M;return[B?"0x01":"0x",I===0n?"0x":r.trimLeft(r.fromNumber(I)),k===0n?"0x":r.trimLeft(r.fromNumber(k))]}function p(M,I={}){try{return i(M,I),!0}catch{return!1}}function T(M){if(M===0||M===27)return 0;if(M===1||M===28)return 1;if(M>=35)return M%2===0?1:0;throw new F({value:M})}function w(M){if(M===0)return 27;if(M===1)return 28;throw new x({value:M})}class A extends n.BaseError{constructor({signature:I}){super(`Value \`${I}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${r.size(r.from(I))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}be.InvalidSerializedSizeError=A;class C extends n.BaseError{constructor({signature:I}){super(`Signature \`${o.stringify(I)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}be.MissingPropertiesError=C;class R extends n.BaseError{constructor({value:I}){super(`Value \`${I}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}be.InvalidRError=R;class S extends n.BaseError{constructor({value:I}){super(`Value \`${I}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}be.InvalidSError=S;class x extends n.BaseError{constructor({value:I}){super(`Value \`${I}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}be.InvalidYParityError=x;class F extends n.BaseError{constructor({value:I}){super(`Value \`${I}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}return be.InvalidVError=F,be}var my;function p6(){if(my)return We;my=1,Object.defineProperty(We,"__esModule",{value:!0}),We.from=o,We.fromRpc=s,We.fromRpcList=i,We.fromTuple=a,We.fromTupleList=c,We.getSignPayload=u,We.hash=l,We.toRpc=f,We.toRpcList=b,We.toTuple=y,We.toTupleList=h;const e=zf(),t=ke(),n=y6(),r=$g();function o(m,E={}){return typeof m.chainId=="string"?s(m):{...m,...E.signature}}function s(m){const{address:E,chainId:v,nonce:_}=m,P=r.extract(m);return{address:E,chainId:Number(v),nonce:BigInt(_),...P}}function i(m){return m.map(s)}function a(m){const[E,v,_,P,d,j]=m;let g={address:v,chainId:E==="0x"?0:Number(E),nonce:_==="0x"?0n:BigInt(_)};return P&&d&&j&&(g={...g,...r.fromTuple([P,d,j])}),o(g)}function c(m){const E=[];for(const v of m)E.push(a(v));return E}function u(m){return l(m,{presign:!0})}function l(m,E={}){const{presign:v}=E;return e.keccak256(t.concat("0x05",n.fromHex(y(v?{address:m.address,chainId:m.chainId,nonce:m.nonce}:m))))}function f(m){const{address:E,chainId:v,nonce:_,...P}=m;return{address:E,chainId:t.fromNumber(v),nonce:t.fromNumber(_),...r.toRpc(P)}}function b(m){return m.map(f)}function y(m){const{address:E,chainId:v,nonce:_}=m,P=r.extract(m);return[v?t.fromNumber(v):"0x",E,_?t.fromNumber(_):"0x",...P?r.toTuple(P):[]]}function h(m){if(!m||m.length===0)return[];const E=[];for(const v of m)E.push(y(v));return E}return We}var rt={},Cr={},hy;function g6(){if(hy)return Cr;hy=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.extraEntropy=void 0,Cr.setExtraEntropy=e,Cr.extraEntropy=!1;function e(t){Cr.extraEntropy=t}return Cr}var yy;function _6(){if(yy)return rt;yy=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.noble=void 0,rt.createKeyPair=i,rt.getPublicKey=a,rt.getSharedSecret=c,rt.randomPrivateKey=u,rt.recoverAddress=l,rt.recoverPublicKey=f,rt.sign=b,rt.verify=y;const e=Gr(),t=Yu(),n=Tt(),r=ke(),o=g6(),s=Xg();rt.noble=e.secp256k1;function i(h={}){const{as:m="Hex"}=h,E=u({as:m}),v=a({privateKey:E});return{privateKey:E,publicKey:v}}function a(h){const{privateKey:m}=h,E=e.secp256k1.ProjectivePoint.fromPrivateKey(r.from(m).slice(2));return s.from(E)}function c(h){const{as:m="Hex",privateKey:E,publicKey:v}=h,d=e.secp256k1.ProjectivePoint.fromHex(s.toHex(v).slice(2)).multiply(e.secp256k1.utils.normPrivateKeyToScalar(r.from(E).slice(2))).toRawBytes(!0);return m==="Hex"?r.fromBytes(d):d}function u(h={}){const{as:m="Hex"}=h,E=e.secp256k1.utils.randomPrivateKey();return m==="Hex"?r.fromBytes(E):E}function l(h){return t.fromPublicKey(f(h))}function f(h){const{payload:m,signature:E}=h,{r:v,s:_,yParity:P}=E,j=new e.secp256k1.Signature(BigInt(v),BigInt(_)).addRecoveryBit(P).recoverPublicKey(r.from(m).substring(2));return s.from(j)}function b(h){const{extraEntropy:m=o.extraEntropy,hash:E,payload:v,privateKey:_}=h,{r:P,s:d,recovery:j}=e.secp256k1.sign(n.from(v),n.from(_),{extraEntropy:typeof m=="boolean"?m:r.from(m).slice(2),lowS:!0,...E?{prehash:!0}:{}});return{r:P,s:d,yParity:j}}function y(h){const{address:m,hash:E,payload:v,publicKey:_,signature:P}=h;return m?t.isEqual(m,l({payload:v,signature:P})):e.secp256k1.verify(P,n.from(v),s.toBytes(_),...E?[{prehash:!0,lowS:!0}]:[])}return rt}var py;function v6(){return py||(py=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidWrappedSignatureError=e.suffixParameters=e.magicBytes=void 0,e.assert=a,e.from=c,e.unwrap=u,e.wrap=l,e.validate=f;const t=$o(),n=p6(),r=ot(),o=ke(),s=_6(),i=$g();e.magicBytes="0x8010801080108010801080108010801080108010801080108010801080108010",e.suffixParameters=t.from("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function a(y){if(typeof y=="string"){if(o.slice(y,-32)!==e.magicBytes)throw new b(y)}else i.assert(y.authorization)}function c(y){return typeof y=="string"?u(y):y}function u(y){a(y);const h=o.toNumber(o.slice(y,-64,-32)),m=o.slice(y,-h-64,-64),E=o.slice(y,0,-h-64),[v,_,P]=t.decode(e.suffixParameters,m);return{authorization:n.from({address:v.delegation,chainId:Number(v.chainId),nonce:v.nonce,yParity:v.yParity,r:v.r,s:v.s}),signature:E,...P&&P!=="0x"?{data:P,to:_}:{}}}function l(y){const{data:h,signature:m}=y;a(y);const E=s.recoverAddress({payload:n.getSignPayload(y.authorization),signature:i.from(y.authorization)}),v=t.encode(e.suffixParameters,[{...y.authorization,delegation:y.authorization.address,chainId:BigInt(y.authorization.chainId)},y.to??E,h??"0x"]),_=o.fromNumber(o.size(v),{size:32});return o.concat(m,v,_,e.magicBytes)}function f(y){try{return a(y),!0}catch{return!1}}class b extends r.BaseError{constructor(h){super(`Value \`${h}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}e.InvalidWrappedSignatureError=b})(Vd)),Vd}var gy;function Ju(){return gy||(gy=1,Object.defineProperty(Po,"__esModule",{value:!0}),Po.SignatureErc8010=void 0,Po.SignatureErc8010=v6()),Po}var _y;function Lf(){if(_y)return Rs;_y=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.isErc8010Signature=t;const e=Ju();function t(n){return e.SignatureErc8010.validate(n)}return Rs}var Bs={},vy;function e_(){if(vy)return Bs;vy=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.parseErc6492Signature=n;const e=ir(),t=Nf();function n(r){if(!(0,t.isErc6492Signature)(r))return{signature:r};const[o,s,i]=(0,e.decodeAbiParameters)([{type:"address"},{type:"bytes"},{type:"bytes"}],r);return{address:o,data:s,signature:i}}return Bs}var Os={},Ey;function t_(){if(Ey)return Os;Ey=1,Object.defineProperty(Os,"__esModule",{value:!0}),Os.parseErc8010Signature=r;const e=Ju(),t=te(),n=Lf();function r(o){if(!(0,n.isErc8010Signature)(o))return{signature:o};const{authorization:s,to:i,...a}=e.SignatureErc8010.unwrap(o);return{authorization:{address:s.address,chainId:s.chainId,nonce:Number(s.nonce),r:(0,t.numberToHex)(s.r,{size:32}),s:(0,t.numberToHex)(s.s,{size:32}),yParity:s.yParity},...i?{address:i}:{},...a}}return Os}var xs={},jy;function Df(){if(jy)return xs;jy=1,Object.defineProperty(xs,"__esModule",{value:!0}),xs.recoverMessageAddress=n;const e=Xo(),t=ur();async function n({message:r,signature:o}){return(0,t.recoverAddress)({hash:(0,e.hashMessage)(r),signature:o})}return xs}var Cs={},wy;function Gf(){if(wy)return Cs;wy=1,Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.recoverTypedDataAddress=n;const e=Qo(),t=ur();async function n(r){const{domain:o,message:s,primaryType:i,signature:a,types:c}=r;return(0,t.recoverAddress)({hash:(0,e.hashTypedData)({domain:o,message:s,primaryType:i,types:c}),signature:a})}return Cs}var qs={},Py;function r_(){if(Py)return qs;Py=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.serializeErc6492Signature=o;const e=Ff(),t=pt(),n=Ce(),r=_e();function o(s){const{address:i,data:a,signature:c,to:u="hex"}=s,l=(0,n.concatHex)([(0,t.encodeAbiParameters)([{type:"address"},{type:"bytes"},{type:"bytes"}],[i,a,c]),e.erc6492MagicBytes]);return u==="hex"?l:(0,r.hexToBytes)(l)}return qs}var Ms={},Ay;function n_(){if(Ay)return Ms;Ay=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.serializeErc8010Signature=n;const e=Ju(),t=_e();function n(r){const{address:o,data:s,signature:i,to:a="hex"}=r,c=e.SignatureErc8010.wrap({authorization:{address:r.authorization.address,chainId:r.authorization.chainId,nonce:BigInt(r.authorization.nonce),r:BigInt(r.authorization.r),s:BigInt(r.authorization.s),yParity:r.authorization.yParity},data:s,signature:i,to:o});return a==="hex"?c:(0,t.hexToBytes)(c)}return Ms}var Hs={},Ty;function o_(){if(Ty)return Hs;Ty=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.verifyHash=r;const e=nt(),t=Et(),n=ur();async function r({address:o,hash:s,signature:i}){return(0,t.isAddressEqual)((0,e.getAddress)(o),await(0,n.recoverAddress)({hash:s,signature:i}))}return Hs}var ks={},Iy;function i_(){if(Iy)return ks;Iy=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.verifyMessage=r;const e=nt(),t=Et(),n=Df();async function r({address:o,message:s,signature:i}){return(0,t.isAddressEqual)((0,e.getAddress)(o),await(0,n.recoverMessageAddress)({message:s,signature:i}))}return ks}var Fs={},Sy;function a_(){if(Sy)return Fs;Sy=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.verifyTypedData=r;const e=nt(),t=Et(),n=Gf();async function r(o){const{address:s,domain:i,message:a,primaryType:c,signature:u,types:l}=o;return(0,t.isAddressEqual)((0,e.getAddress)(s),await(0,n.recoverTypedDataAddress)({domain:i,message:a,primaryType:c,signature:u,types:l}))}return Fs}var Ns={},Ry;function Vf(){if(Ry)return Ns;Ry=1,Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.getSerializedTransactionType=r;const e=Xe(),t=at(),n=Re();function r(o){const s=(0,t.sliceHex)(o,0,1);if(s==="0x04")return"eip7702";if(s==="0x03")return"eip4844";if(s==="0x02")return"eip1559";if(s==="0x01")return"eip2930";if(s!=="0x"&&(0,n.hexToNumber)(s)>=192)return"legacy";throw new e.InvalidSerializedTransactionTypeError({serializedType:s})}return Ns}var fn={},By;function Wf(){if(By)return fn;By=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.parseTransaction=b,fn.toTransactionArray=_,fn.parseAccessList=P;const e=yt(),t=Xe(),n=Ye(),r=ku(),o=De(),s=nr(),i=Dt(),a=Re(),c=Cf(),u=qf(),l=Wu(),f=Vf();function b(g){const p=(0,f.getSerializedTransactionType)(g);return p==="eip1559"?m(g):p==="eip2930"?E(g):p==="eip4844"?h(g):p==="eip7702"?y(g):v(g)}function y(g){const p=_(g),[T,w,A,C,R,S,x,F,M,I,k,B,q]=p;if(p.length!==10&&p.length!==13)throw new t.InvalidSerializedTransactionError({attributes:{chainId:T,nonce:w,maxPriorityFeePerGas:A,maxFeePerGas:C,gas:R,to:S,value:x,data:F,accessList:M,authorizationList:I,...p.length>9?{v:k,r:B,s:q}:{}},serializedTransaction:g,type:"eip7702"});const O={chainId:(0,a.hexToNumber)(T),type:"eip7702"};return(0,o.isHex)(S)&&S!=="0x"&&(O.to=S),(0,o.isHex)(R)&&R!=="0x"&&(O.gas=(0,a.hexToBigInt)(R)),(0,o.isHex)(F)&&F!=="0x"&&(O.data=F),(0,o.isHex)(w)&&(O.nonce=w==="0x"?0:(0,a.hexToNumber)(w)),(0,o.isHex)(x)&&x!=="0x"&&(O.value=(0,a.hexToBigInt)(x)),(0,o.isHex)(C)&&C!=="0x"&&(O.maxFeePerGas=(0,a.hexToBigInt)(C)),(0,o.isHex)(A)&&A!=="0x"&&(O.maxPriorityFeePerGas=(0,a.hexToBigInt)(A)),M.length!==0&&M!=="0x"&&(O.accessList=P(M)),I.length!==0&&I!=="0x"&&(O.authorizationList=d(I)),(0,l.assertTransactionEIP7702)(O),{...p.length===13?j(p):void 0,...O}}function h(g){const p=_(g),T=p.length===4,w=T?p[0]:p,A=T?p.slice(1):[],[C,R,S,x,F,M,I,k,B,q,O,H,N,U]=w,[z,G,V]=A;if(!(w.length===11||w.length===14))throw new t.InvalidSerializedTransactionError({attributes:{chainId:C,nonce:R,maxPriorityFeePerGas:S,maxFeePerGas:x,gas:F,to:M,value:I,data:k,accessList:B,...w.length>9?{v:H,r:N,s:U}:{}},serializedTransaction:g,type:"eip4844"});const J={blobVersionedHashes:O,chainId:(0,a.hexToNumber)(C),to:M,type:"eip4844"};return(0,o.isHex)(F)&&F!=="0x"&&(J.gas=(0,a.hexToBigInt)(F)),(0,o.isHex)(k)&&k!=="0x"&&(J.data=k),(0,o.isHex)(R)&&(J.nonce=R==="0x"?0:(0,a.hexToNumber)(R)),(0,o.isHex)(I)&&I!=="0x"&&(J.value=(0,a.hexToBigInt)(I)),(0,o.isHex)(q)&&q!=="0x"&&(J.maxFeePerBlobGas=(0,a.hexToBigInt)(q)),(0,o.isHex)(x)&&x!=="0x"&&(J.maxFeePerGas=(0,a.hexToBigInt)(x)),(0,o.isHex)(S)&&S!=="0x"&&(J.maxPriorityFeePerGas=(0,a.hexToBigInt)(S)),B.length!==0&&B!=="0x"&&(J.accessList=P(B)),z&&G&&V&&(J.sidecars=(0,r.toBlobSidecars)({blobs:z,commitments:G,proofs:V})),(0,l.assertTransactionEIP4844)(J),{...w.length===14?j(w):void 0,...J}}function m(g){const p=_(g),[T,w,A,C,R,S,x,F,M,I,k,B]=p;if(!(p.length===9||p.length===12))throw new t.InvalidSerializedTransactionError({attributes:{chainId:T,nonce:w,maxPriorityFeePerGas:A,maxFeePerGas:C,gas:R,to:S,value:x,data:F,accessList:M,...p.length>9?{v:I,r:k,s:B}:{}},serializedTransaction:g,type:"eip1559"});const q={chainId:(0,a.hexToNumber)(T),type:"eip1559"};return(0,o.isHex)(S)&&S!=="0x"&&(q.to=S),(0,o.isHex)(R)&&R!=="0x"&&(q.gas=(0,a.hexToBigInt)(R)),(0,o.isHex)(F)&&F!=="0x"&&(q.data=F),(0,o.isHex)(w)&&(q.nonce=w==="0x"?0:(0,a.hexToNumber)(w)),(0,o.isHex)(x)&&x!=="0x"&&(q.value=(0,a.hexToBigInt)(x)),(0,o.isHex)(C)&&C!=="0x"&&(q.maxFeePerGas=(0,a.hexToBigInt)(C)),(0,o.isHex)(A)&&A!=="0x"&&(q.maxPriorityFeePerGas=(0,a.hexToBigInt)(A)),M.length!==0&&M!=="0x"&&(q.accessList=P(M)),(0,l.assertTransactionEIP1559)(q),{...p.length===12?j(p):void 0,...q}}function E(g){const p=_(g),[T,w,A,C,R,S,x,F,M,I,k]=p;if(!(p.length===8||p.length===11))throw new t.InvalidSerializedTransactionError({attributes:{chainId:T,nonce:w,gasPrice:A,gas:C,to:R,value:S,data:x,accessList:F,...p.length>8?{v:M,r:I,s:k}:{}},serializedTransaction:g,type:"eip2930"});const B={chainId:(0,a.hexToNumber)(T),type:"eip2930"};return(0,o.isHex)(R)&&R!=="0x"&&(B.to=R),(0,o.isHex)(C)&&C!=="0x"&&(B.gas=(0,a.hexToBigInt)(C)),(0,o.isHex)(x)&&x!=="0x"&&(B.data=x),(0,o.isHex)(w)&&(B.nonce=w==="0x"?0:(0,a.hexToNumber)(w)),(0,o.isHex)(S)&&S!=="0x"&&(B.value=(0,a.hexToBigInt)(S)),(0,o.isHex)(A)&&A!=="0x"&&(B.gasPrice=(0,a.hexToBigInt)(A)),F.length!==0&&F!=="0x"&&(B.accessList=P(F)),(0,l.assertTransactionEIP2930)(B),{...p.length===11?j(p):void 0,...B}}function v(g){const p=(0,c.fromRlp)(g,"hex"),[T,w,A,C,R,S,x,F,M]=p;if(!(p.length===6||p.length===9))throw new t.InvalidSerializedTransactionError({attributes:{nonce:T,gasPrice:w,gas:A,to:C,value:R,data:S,...p.length>6?{v:x,r:F,s:M}:{}},serializedTransaction:g,type:"legacy"});const I={type:"legacy"};if((0,o.isHex)(C)&&C!=="0x"&&(I.to=C),(0,o.isHex)(A)&&A!=="0x"&&(I.gas=(0,a.hexToBigInt)(A)),(0,o.isHex)(S)&&S!=="0x"&&(I.data=S),(0,o.isHex)(T)&&(I.nonce=T==="0x"?0:(0,a.hexToNumber)(T)),(0,o.isHex)(R)&&R!=="0x"&&(I.value=(0,a.hexToBigInt)(R)),(0,o.isHex)(w)&&w!=="0x"&&(I.gasPrice=(0,a.hexToBigInt)(w)),(0,l.assertTransactionLegacy)(I),p.length===6)return I;const k=(0,o.isHex)(x)&&x!=="0x"?(0,a.hexToBigInt)(x):0n;if(M==="0x"&&F==="0x")return k>0&&(I.chainId=Number(k)),I;const B=k,q=Number((B-35n)/2n);if(q>0)I.chainId=q;else if(B!==27n&&B!==28n)throw new t.InvalidLegacyVError({v:B});return I.v=B,I.s=M,I.r=F,I.yParity=B%2n===0n?1:0,I}function _(g){return(0,c.fromRlp)(`0x${g.slice(4)}`,"hex")}function P(g){const p=[];for(let T=0;T<g.length;T++){const[w,A]=g[T];if(!(0,n.isAddress)(w,{strict:!1}))throw new e.InvalidAddressError({address:w});p.push({address:w,storageKeys:A.map(C=>(0,u.isHash)(C)?C:(0,i.trim)(C))})}return p}function d(g){const p=[];for(let T=0;T<g.length;T++){const[w,A,C,R,S,x]=g[T];p.push({address:A,chainId:w==="0x"?0:(0,a.hexToNumber)(w),nonce:C==="0x"?0:(0,a.hexToNumber)(C),...j([R,S,x])})}return p}function j(g){const p=g.slice(-3),T=p[0]==="0x"||(0,a.hexToBigInt)(p[0])===0n?27n:28n;return{r:(0,s.padHex)(p[1],{size:32}),s:(0,s.padHex)(p[2],{size:32}),v:T,yParity:T===27n?0:1}}return fn}var zs={},Us={},To={},Oy;function s_(){if(Oy)return To;Oy=1,Object.defineProperty(To,"__esModule",{value:!0}),To.InvalidDecimalNumberError=void 0;const e=ue();class t extends e.BaseError{constructor({value:r}){super(`Number \`${r}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}return To.InvalidDecimalNumberError=t,To}var xy;function Xu(){if(xy)return Us;xy=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.parseUnits=t;const e=s_();function t(n,r){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(n))throw new e.InvalidDecimalNumberError({value:n});let[o,s="0"]=n.split(".");const i=o.startsWith("-");if(i&&(o=o.slice(1)),s=s.replace(/(0+)$/,""),r===0)Math.round(+`.${s}`)===1&&(o=`${BigInt(o)+1n}`),s="";else if(s.length>r){const[a,c,u]=[s.slice(0,r-1),s.slice(r-1,r),s.slice(r)],l=Math.round(+`${c}.${u}`);l>9?s=`${BigInt(a)+BigInt(1)}0`.padStart(a.length+1,"0"):s=`${a}${l}`,s.length>r&&(s=s.slice(1),o=`${BigInt(o)+1n}`),s=s.slice(0,r)}else s=s.padEnd(r,"0");return BigInt(`${i?"-":""}${o}${s}`)}return Us}var Cy;function c_(){if(Cy)return zs;Cy=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.parseEther=n;const e=Co(),t=Xu();function n(r,o="wei"){return(0,t.parseUnits)(r,e.etherUnits[o])}return zs}var Ls={},qy;function u_(){if(qy)return Ls;qy=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.parseGwei=n;const e=Co(),t=Xu();function n(r,o="wei"){return(0,t.parseUnits)(r,e.gweiUnits[o])}return Ls}var My;function Kf(){return My||(My=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.padBytes=e.pad=e.isHex=e.isBytes=e.concatHex=e.concatBytes=e.concat=e.getChainContractAddress=e.extractChain=e.defineChain=e.assertCurrentChain=e.offchainLookupSignature=e.offchainLookupAbiItem=e.offchainLookup=e.ccipFetch=e.ccipRequest=e.buildRequest=e.verifyAuthorization=e.serializeAuthorizationList=e.recoverAuthorizationAddress=e.hashAuthorization=e.isAddressEqual=e.isAddress=e.getCreateAddress=e.getCreate2Address=e.getContractAddress=e.getAddress=e.parseEventLogs=e.getAbiItem=e.formatAbiItemWithArgs=e.formatAbiParams=e.formatAbiItem=e.encodePacked=e.encodeFunctionResult=e.encodeFunctionData=e.encodeEventTopics=e.encodeErrorResult=e.encodeDeployData=e.encodeAbiParameters=e.decodeFunctionResult=e.decodeFunctionData=e.decodeEventLog=e.decodeErrorResult=e.decodeAbiParameters=e.publicKeyToAddress=e.parseAccount=e.parseAbiParameters=e.parseAbiParameter=e.parseAbiItem=e.parseAbi=void 0,e.ripemd160=e.keccak256=e.isHash=e.getAction=e.formatTransactionRequest=e.defineTransactionRequest=e.defineTransactionReceipt=e.transactionType=e.formatTransaction=e.defineTransaction=e.formatLog=e.defineFormatter=e.extract=e.formatBlock=e.defineBlock=e.getTransactionError=e.getNodeError=e.containsNodeError=e.getEstimateGasError=e.getContractError=e.getCallError=e.toRlp=e.toHex=e.stringToHex=e.numberToHex=e.bytesToHex=e.boolToHex=e.toBytes=e.stringToBytes=e.numberToBytes=e.hexToBytes=e.boolToBytes=e.fromRlp=e.hexToString=e.hexToNumber=e.hexToBool=e.hexToBigInt=e.fromHex=e.fromBytes=e.bytesToString=e.bytesToNumber=e.bytesToBool=e.bytesToBigint=e.bytesToBigInt=e.trim=e.sliceHex=e.sliceBytes=e.slice=e.size=e.padHex=void 0,e.validateTypedData=e.serializeTypedData=e.serializeTransaction=e.serializeAccessList=e.parseTransaction=e.getTransactionType=e.getSerializedTransactionType=e.assertTransactionLegacy=e.assertTransactionEIP2930=e.assertTransactionEIP1559=e.assertRequest=e.stringify=e.verifyTypedData=e.verifyMessage=e.verifyHash=e.serializeErc8010Signature=e.serializeErc6492Signature=e.recoverTypedDataAddress=e.recoverPublicKey=e.recoverMessageAddress=e.recoverAddress=e.parseErc8010Signature=e.parseErc6492Signature=e.isErc8010Signature=e.isErc6492Signature=e.hashTypedData=e.hashStruct=e.hashMessage=e.getWebSocketRpcClient=e.socketClientCache=e.getSocketRpcClient=e.getHttpRpcClient=e.rpc=e.getSocket=e.integerRegex=e.bytesRegex=e.arrayRegex=e.nonceManager=e.createNonceManager=e.getFunctionSignature=e.toFunctionSignature=e.getFunctionSelector=e.toFunctionSelector=e.toFunctionHash=e.getEventSignature=e.toEventSignature=e.getEventSelector=e.toEventSelector=e.toEventHash=e.sha256=void 0,e.parseUnits=e.parseGwei=e.parseEther=e.formatUnits=e.formatGwei=e.formatEther=void 0;var t=rr();Object.defineProperty(e,"parseAbi",{enumerable:!0,get:function(){return t.parseAbi}}),Object.defineProperty(e,"parseAbiItem",{enumerable:!0,get:function(){return t.parseAbiItem}}),Object.defineProperty(e,"parseAbiParameter",{enumerable:!0,get:function(){return t.parseAbiParameter}}),Object.defineProperty(e,"parseAbiParameters",{enumerable:!0,get:function(){return t.parseAbiParameters}});var n=Ie();Object.defineProperty(e,"parseAccount",{enumerable:!0,get:function(){return n.parseAccount}});var r=tg();Object.defineProperty(e,"publicKeyToAddress",{enumerable:!0,get:function(){return r.publicKeyToAddress}});var o=ir();Object.defineProperty(e,"decodeAbiParameters",{enumerable:!0,get:function(){return o.decodeAbiParameters}});var s=Bu();Object.defineProperty(e,"decodeErrorResult",{enumerable:!0,get:function(){return s.decodeErrorResult}});var i=Lo();Object.defineProperty(e,"decodeEventLog",{enumerable:!0,get:function(){return i.decodeEventLog}});var a=gf();Object.defineProperty(e,"decodeFunctionData",{enumerable:!0,get:function(){return a.decodeFunctionData}});var c=Kt();Object.defineProperty(e,"decodeFunctionResult",{enumerable:!0,get:function(){return c.decodeFunctionResult}});var u=pt();Object.defineProperty(e,"encodeAbiParameters",{enumerable:!0,get:function(){return u.encodeAbiParameters}});var l=Wo();Object.defineProperty(e,"encodeDeployData",{enumerable:!0,get:function(){return l.encodeDeployData}});var f=_f();Object.defineProperty(e,"encodeErrorResult",{enumerable:!0,get:function(){return f.encodeErrorResult}});var b=Ur();Object.defineProperty(e,"encodeEventTopics",{enumerable:!0,get:function(){return b.encodeEventTopics}});var y=Je();Object.defineProperty(e,"encodeFunctionData",{enumerable:!0,get:function(){return y.encodeFunctionData}});var h=vf();Object.defineProperty(e,"encodeFunctionResult",{enumerable:!0,get:function(){return h.encodeFunctionResult}});var m=Og();Object.defineProperty(e,"encodePacked",{enumerable:!0,get:function(){return m.encodePacked}});var E=Lt();Object.defineProperty(e,"formatAbiItem",{enumerable:!0,get:function(){return E.formatAbiItem}}),Object.defineProperty(e,"formatAbiParams",{enumerable:!0,get:function(){return E.formatAbiParams}});var v=eg();Object.defineProperty(e,"formatAbiItemWithArgs",{enumerable:!0,get:function(){return v.formatAbiItemWithArgs}});var _=Gt();Object.defineProperty(e,"getAbiItem",{enumerable:!0,get:function(){return _.getAbiItem}});var P=Do();Object.defineProperty(e,"parseEventLogs",{enumerable:!0,get:function(){return P.parseEventLogs}});var d=nt();Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return d.getAddress}});var j=xg();Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return j.getContractAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return j.getCreate2Address}}),Object.defineProperty(e,"getCreateAddress",{enumerable:!0,get:function(){return j.getCreateAddress}});var g=Ye();Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return g.isAddress}});var p=Et();Object.defineProperty(e,"isAddressEqual",{enumerable:!0,get:function(){return p.isAddressEqual}});var T=ig();Object.defineProperty(e,"hashAuthorization",{enumerable:!0,get:function(){return T.hashAuthorization}});var w=Ho();Object.defineProperty(e,"recoverAuthorizationAddress",{enumerable:!0,get:function(){return w.recoverAuthorizationAddress}});var A=Cg();Object.defineProperty(e,"serializeAuthorizationList",{enumerable:!0,get:function(){return A.serializeAuthorizationList}});var C=qg();Object.defineProperty(e,"verifyAuthorization",{enumerable:!0,get:function(){return C.verifyAuthorization}});var R=Mg();Object.defineProperty(e,"buildRequest",{enumerable:!0,get:function(){return R.buildRequest}});var S=Ef();Object.defineProperty(e,"ccipRequest",{enumerable:!0,get:function(){return S.ccipRequest}}),Object.defineProperty(e,"ccipFetch",{enumerable:!0,get:function(){return S.ccipRequest}}),Object.defineProperty(e,"offchainLookup",{enumerable:!0,get:function(){return S.offchainLookup}}),Object.defineProperty(e,"offchainLookupAbiItem",{enumerable:!0,get:function(){return S.offchainLookupAbiItem}}),Object.defineProperty(e,"offchainLookupSignature",{enumerable:!0,get:function(){return S.offchainLookupSignature}});var x=Yo();Object.defineProperty(e,"assertCurrentChain",{enumerable:!0,get:function(){return x.assertCurrentChain}});var F=Hg();Object.defineProperty(e,"defineChain",{enumerable:!0,get:function(){return F.defineChain}});var M=kg();Object.defineProperty(e,"extractChain",{enumerable:!0,get:function(){return M.extractChain}});var I=br();Object.defineProperty(e,"getChainContractAddress",{enumerable:!0,get:function(){return I.getChainContractAddress}});var k=Ce();Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return k.concat}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return k.concatBytes}}),Object.defineProperty(e,"concatHex",{enumerable:!0,get:function(){return k.concatHex}});var B=Of();Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return B.isBytes}});var q=De();Object.defineProperty(e,"isHex",{enumerable:!0,get:function(){return q.isHex}});var O=nr();Object.defineProperty(e,"pad",{enumerable:!0,get:function(){return O.pad}}),Object.defineProperty(e,"padBytes",{enumerable:!0,get:function(){return O.padBytes}}),Object.defineProperty(e,"padHex",{enumerable:!0,get:function(){return O.padHex}});var H=Ke();Object.defineProperty(e,"size",{enumerable:!0,get:function(){return H.size}});var N=at();Object.defineProperty(e,"slice",{enumerable:!0,get:function(){return N.slice}}),Object.defineProperty(e,"sliceBytes",{enumerable:!0,get:function(){return N.sliceBytes}}),Object.defineProperty(e,"sliceHex",{enumerable:!0,get:function(){return N.sliceHex}});var U=Dt();Object.defineProperty(e,"trim",{enumerable:!0,get:function(){return U.trim}});var z=$d();Object.defineProperty(e,"bytesToBigInt",{enumerable:!0,get:function(){return z.bytesToBigInt}}),Object.defineProperty(e,"bytesToBigint",{enumerable:!0,get:function(){return z.bytesToBigInt}}),Object.defineProperty(e,"bytesToBool",{enumerable:!0,get:function(){return z.bytesToBool}}),Object.defineProperty(e,"bytesToNumber",{enumerable:!0,get:function(){return z.bytesToNumber}}),Object.defineProperty(e,"bytesToString",{enumerable:!0,get:function(){return z.bytesToString}}),Object.defineProperty(e,"fromBytes",{enumerable:!0,get:function(){return z.fromBytes}});var G=Re();Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return G.fromHex}}),Object.defineProperty(e,"hexToBigInt",{enumerable:!0,get:function(){return G.hexToBigInt}}),Object.defineProperty(e,"hexToBool",{enumerable:!0,get:function(){return G.hexToBool}}),Object.defineProperty(e,"hexToNumber",{enumerable:!0,get:function(){return G.hexToNumber}}),Object.defineProperty(e,"hexToString",{enumerable:!0,get:function(){return G.hexToString}});var V=Cf();Object.defineProperty(e,"fromRlp",{enumerable:!0,get:function(){return V.fromRlp}});var J=_e();Object.defineProperty(e,"boolToBytes",{enumerable:!0,get:function(){return J.boolToBytes}}),Object.defineProperty(e,"hexToBytes",{enumerable:!0,get:function(){return J.hexToBytes}}),Object.defineProperty(e,"numberToBytes",{enumerable:!0,get:function(){return J.numberToBytes}}),Object.defineProperty(e,"stringToBytes",{enumerable:!0,get:function(){return J.stringToBytes}}),Object.defineProperty(e,"toBytes",{enumerable:!0,get:function(){return J.toBytes}});var Z=te();Object.defineProperty(e,"boolToHex",{enumerable:!0,get:function(){return Z.boolToHex}}),Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return Z.bytesToHex}}),Object.defineProperty(e,"numberToHex",{enumerable:!0,get:function(){return Z.numberToHex}}),Object.defineProperty(e,"stringToHex",{enumerable:!0,get:function(){return Z.stringToHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return Z.toHex}});var K=Mo();Object.defineProperty(e,"toRlp",{enumerable:!0,get:function(){return K.toRlp}});var Q=hf();Object.defineProperty(e,"getCallError",{enumerable:!0,get:function(){return Q.getCallError}});var ie=cr();Object.defineProperty(e,"getContractError",{enumerable:!0,get:function(){return ie.getContractError}});var Y=sg();Object.defineProperty(e,"getEstimateGasError",{enumerable:!0,get:function(){return Y.getEstimateGasError}});var X=ko();Object.defineProperty(e,"containsNodeError",{enumerable:!0,get:function(){return X.containsNodeError}}),Object.defineProperty(e,"getNodeError",{enumerable:!0,get:function(){return X.getNodeError}});var ee=zo();Object.defineProperty(e,"getTransactionError",{enumerable:!0,get:function(){return ee.getTransactionError}});var ae=Cu();Object.defineProperty(e,"defineBlock",{enumerable:!0,get:function(){return ae.defineBlock}}),Object.defineProperty(e,"formatBlock",{enumerable:!0,get:function(){return ae.formatBlock}});var oe=dr();Object.defineProperty(e,"extract",{enumerable:!0,get:function(){return oe.extract}});var se=Fo();Object.defineProperty(e,"defineFormatter",{enumerable:!0,get:function(){return se.defineFormatter}});var fe=Wt();Object.defineProperty(e,"formatLog",{enumerable:!0,get:function(){return fe.formatLog}});var $=vn();Object.defineProperty(e,"defineTransaction",{enumerable:!0,get:function(){return $.defineTransaction}}),Object.defineProperty(e,"formatTransaction",{enumerable:!0,get:function(){return $.formatTransaction}}),Object.defineProperty(e,"transactionType",{enumerable:!0,get:function(){return $.transactionType}});var W=Jo();Object.defineProperty(e,"defineTransactionReceipt",{enumerable:!0,get:function(){return W.defineTransactionReceipt}});var we=_t();Object.defineProperty(e,"defineTransactionRequest",{enumerable:!0,get:function(){return we.defineTransactionRequest}}),Object.defineProperty(e,"formatTransactionRequest",{enumerable:!0,get:function(){return we.formatTransactionRequest}});var Be=me();Object.defineProperty(e,"getAction",{enumerable:!0,get:function(){return Be.getAction}});var st=qf();Object.defineProperty(e,"isHash",{enumerable:!0,get:function(){return st.isHash}});var qe=Ze();Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return qe.keccak256}});var ct=Ng();Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return ct.ripemd160}});var Ge=cf();Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return Ge.sha256}});var xe=zg();Object.defineProperty(e,"toEventHash",{enumerable:!0,get:function(){return xe.toEventHash}});var Zt=_n();Object.defineProperty(e,"toEventSelector",{enumerable:!0,get:function(){return Zt.toEventSelector}}),Object.defineProperty(e,"getEventSelector",{enumerable:!0,get:function(){return Zt.toEventSelector}});var jt=Ug();Object.defineProperty(e,"toEventSignature",{enumerable:!0,get:function(){return jt.toEventSignature}}),Object.defineProperty(e,"getEventSignature",{enumerable:!0,get:function(){return jt.toEventSignature}});var ut=Lg();Object.defineProperty(e,"toFunctionHash",{enumerable:!0,get:function(){return ut.toFunctionHash}});var wt=zr();Object.defineProperty(e,"toFunctionSelector",{enumerable:!0,get:function(){return wt.toFunctionSelector}}),Object.defineProperty(e,"getFunctionSelector",{enumerable:!0,get:function(){return wt.toFunctionSelector}});var dt=Dg();Object.defineProperty(e,"toFunctionSignature",{enumerable:!0,get:function(){return dt.toFunctionSignature}}),Object.defineProperty(e,"getFunctionSignature",{enumerable:!0,get:function(){return dt.toFunctionSignature}});var hr=Gg();Object.defineProperty(e,"createNonceManager",{enumerable:!0,get:function(){return hr.createNonceManager}}),Object.defineProperty(e,"nonceManager",{enumerable:!0,get:function(){return hr.nonceManager}});var jn=Su();Object.defineProperty(e,"arrayRegex",{enumerable:!0,get:function(){return jn.arrayRegex}}),Object.defineProperty(e,"bytesRegex",{enumerable:!0,get:function(){return jn.bytesRegex}}),Object.defineProperty(e,"integerRegex",{enumerable:!0,get:function(){return jn.integerRegex}});var ti=Kg();Object.defineProperty(e,"getSocket",{enumerable:!0,get:function(){return ti.getSocket}}),Object.defineProperty(e,"rpc",{enumerable:!0,get:function(){return ti.rpc}});var yr=Hf();Object.defineProperty(e,"getHttpRpcClient",{enumerable:!0,get:function(){return yr.getHttpRpcClient}});var ri=Wg();Object.defineProperty(e,"getSocketRpcClient",{enumerable:!0,get:function(){return ri.getSocketRpcClient}}),Object.defineProperty(e,"socketClientCache",{enumerable:!0,get:function(){return ri.socketClientCache}});var ni=kf();Object.defineProperty(e,"getWebSocketRpcClient",{enumerable:!0,get:function(){return ni.getWebSocketRpcClient}});var $u=Xo();Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return $u.hashMessage}});var oi=Qo();Object.defineProperty(e,"hashStruct",{enumerable:!0,get:function(){return oi.hashStruct}}),Object.defineProperty(e,"hashTypedData",{enumerable:!0,get:function(){return oi.hashTypedData}});var wn=Nf();Object.defineProperty(e,"isErc6492Signature",{enumerable:!0,get:function(){return wn.isErc6492Signature}});var ed=Lf();Object.defineProperty(e,"isErc8010Signature",{enumerable:!0,get:function(){return ed.isErc8010Signature}});var td=e_();Object.defineProperty(e,"parseErc6492Signature",{enumerable:!0,get:function(){return td.parseErc6492Signature}});var Pn=t_();Object.defineProperty(e,"parseErc8010Signature",{enumerable:!0,get:function(){return Pn.parseErc8010Signature}});var rd=ur();Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return rd.recoverAddress}});var An=Df();Object.defineProperty(e,"recoverMessageAddress",{enumerable:!0,get:function(){return An.recoverMessageAddress}});var nd=rf();Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return nd.recoverPublicKey}});var pr=Gf();Object.defineProperty(e,"recoverTypedDataAddress",{enumerable:!0,get:function(){return pr.recoverTypedDataAddress}});var gr=r_();Object.defineProperty(e,"serializeErc6492Signature",{enumerable:!0,get:function(){return gr.serializeErc6492Signature}});var od=n_();Object.defineProperty(e,"serializeErc8010Signature",{enumerable:!0,get:function(){return od.serializeErc8010Signature}});var _r=o_();Object.defineProperty(e,"verifyHash",{enumerable:!0,get:function(){return _r.verifyHash}});var vr=i_();Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return vr.verifyMessage}});var Tn=a_();Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return Tn.verifyTypedData}});var id=He();Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return id.stringify}});var ad=vt();Object.defineProperty(e,"assertRequest",{enumerable:!0,get:function(){return ad.assertRequest}});var In=Wu();Object.defineProperty(e,"assertTransactionEIP1559",{enumerable:!0,get:function(){return In.assertTransactionEIP1559}}),Object.defineProperty(e,"assertTransactionEIP2930",{enumerable:!0,get:function(){return In.assertTransactionEIP2930}}),Object.defineProperty(e,"assertTransactionLegacy",{enumerable:!0,get:function(){return In.assertTransactionLegacy}});var sd=Vf();Object.defineProperty(e,"getSerializedTransactionType",{enumerable:!0,get:function(){return sd.getSerializedTransactionType}});var ii=Fu();Object.defineProperty(e,"getTransactionType",{enumerable:!0,get:function(){return ii.getTransactionType}});var cd=Wf();Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return cd.parseTransaction}});var Sn=xf();Object.defineProperty(e,"serializeAccessList",{enumerable:!0,get:function(){return Sn.serializeAccessList}});var ai=Ku();Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return ai.serializeTransaction}});var Kr=Zu();Object.defineProperty(e,"serializeTypedData",{enumerable:!0,get:function(){return Kr.serializeTypedData}}),Object.defineProperty(e,"validateTypedData",{enumerable:!0,get:function(){return Kr.validateTypedData}});var ud=qo();Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return ud.formatEther}});var dd=Lr();Object.defineProperty(e,"formatGwei",{enumerable:!0,get:function(){return dd.formatGwei}});var fd=Ou();Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return fd.formatUnits}});var ld=c_();Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return ld.parseEther}});var bd=u_();Object.defineProperty(e,"parseGwei",{enumerable:!0,get:function(){return bd.parseGwei}});var si=Xu();Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return si.parseUnits}})})(Fd)),Fd}var Hy;function E6(){if(Hy)return bs;Hy=1,Object.defineProperty(bs,"__esModule",{value:!0}),bs.formatProof=n;const e=Kf();function t(r){return r.map(o=>({...o,value:BigInt(o.value)}))}function n(r){return{...r,balance:r.balance?BigInt(r.balance):void 0,nonce:r.nonce?(0,e.hexToNumber)(r.nonce):void 0,storageProof:r.storageProof?t(r.storageProof):void 0}}return bs}var ky;function j6(){if(ky)return ls;ky=1,Object.defineProperty(ls,"__esModule",{value:!0}),ls.getProof=n;const e=te(),t=E6();async function n(r,{address:o,blockNumber:s,blockTag:i,storageKeys:a}){const c=i??"latest",u=s!==void 0?(0,e.numberToHex)(s):void 0,l=await r.request({method:"eth_getProof",params:[o,a,u||c]});return(0,t.formatProof)(l)}return ls}var Ds={},Fy;function w6(){if(Fy)return Ds;Fy=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.getStorageAt=t;const e=te();async function t(n,{address:r,blockNumber:o,blockTag:s="latest",slot:i}){const a=o!==void 0?(0,e.numberToHex)(o):void 0;return await n.request({method:"eth_getStorageAt",params:[r,i,a||s]})}return Ds}var Gs={},Ny;function Zf(){if(Ny)return Gs;Ny=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.getTransaction=r;const e=Xe(),t=te(),n=vn();async function r(o,{blockHash:s,blockNumber:i,blockTag:a,hash:c,index:u,sender:l,nonce:f}){const b=a||"latest",y=i!==void 0?(0,t.numberToHex)(i):void 0;let h=null;if(c?h=await o.request({method:"eth_getTransactionByHash",params:[c]},{dedupe:!0}):s?h=await o.request({method:"eth_getTransactionByBlockHashAndIndex",params:[s,(0,t.numberToHex)(u)]},{dedupe:!0}):typeof u=="number"?h=await o.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[y||b,(0,t.numberToHex)(u)]},{dedupe:!!y}):l&&typeof f=="number"&&(h=await o.request({method:"eth_getTransactionBySenderAndNonce",params:[l,(0,t.numberToHex)(f)]},{dedupe:!0})),!h)throw new e.TransactionNotFoundError({blockHash:s,blockNumber:i,blockTag:b,hash:c,index:u});return(o.chain?.formatters?.transaction?.format||n.formatTransaction)(h,"getTransaction")}return Gs}var Vs={},zy;function P6(){if(zy)return Vs;zy=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.getTransactionConfirmations=r;const e=me(),t=Zo(),n=Zf();async function r(o,{hash:s,transactionReceipt:i}){const[a,c]=await Promise.all([(0,e.getAction)(o,t.getBlockNumber,"getBlockNumber")({}),s?(0,e.getAction)(o,n.getTransaction,"getTransaction")({hash:s}):void 0]),u=i?.blockNumber||c?.blockNumber;return u?a-u+1n:0n}return Vs}var Ws={},Uy;function d_(){if(Uy)return Ws;Uy=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.getTransactionReceipt=n;const e=Xe(),t=Jo();async function n(r,{hash:o}){const s=await r.request({method:"eth_getTransactionReceipt",params:[o]},{dedupe:!0});if(!s)throw new e.TransactionReceiptNotFoundError({hash:o});return(r.chain?.formatters?.transactionReceipt?.format||t.formatTransactionReceipt)(s,"getTransactionReceipt")}return Ws}var Ks={},Ly;function A6(){if(Ly)return Ks;Ly=1,Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.multicall=f;const e=lr(),t=Go(),n=Te(),r=ue(),o=ar(),s=Kt(),i=Je(),a=br(),c=cr(),u=me(),l=It();async function f(b,y){const{account:h,authorizationList:m,allowFailure:E=!0,blockNumber:v,blockOverrides:_,blockTag:P,stateOverride:d}=y,j=y.contracts,{batchSize:g=y.batchSize??1024,deployless:p=y.deployless??!1}=typeof b.batch?.multicall=="object"?b.batch.multicall:{},T=(()=>{if(y.multicallAddress)return y.multicallAddress;if(p)return null;if(b.chain)return(0,a.getChainContractAddress)({blockNumber:v,chain:b.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),w=[[]];let A=0,C=0;for(let x=0;x<j.length;x++){const{abi:F,address:M,args:I,functionName:k}=j[x];try{const B=(0,i.encodeFunctionData)({abi:F,args:I,functionName:k});C+=(B.length-2)/2,g>0&&C>g&&w[A].length>0&&(A++,C=(B.length-2)/2,w[A]=[]),w[A]=[...w[A],{allowFailure:!0,callData:B,target:M}]}catch(B){const q=(0,c.getContractError)(B,{abi:F,address:M,args:I,docsPath:"/docs/contract/multicall",functionName:k,sender:h});if(!E)throw q;w[A]=[...w[A],{allowFailure:!0,callData:"0x",target:M}]}}const R=await Promise.allSettled(w.map(x=>(0,u.getAction)(b,l.readContract,"readContract")({...T===null?{code:t.multicall3Bytecode}:{address:T},abi:e.multicall3Abi,account:h,args:[x],authorizationList:m,blockNumber:v,blockOverrides:_,blockTag:P,functionName:"aggregate3",stateOverride:d}))),S=[];for(let x=0;x<R.length;x++){const F=R[x];if(F.status==="rejected"){if(!E)throw F.reason;for(let I=0;I<w[x].length;I++)S.push({status:"failure",error:F.reason,result:void 0});continue}const M=F.value;for(let I=0;I<M.length;I++){const{returnData:k,success:B}=M[I],{callData:q}=w[x][I],{abi:O,address:H,functionName:N,args:U}=j[S.length];try{if(q==="0x")throw new n.AbiDecodingZeroDataError;if(!B)throw new o.RawContractError({data:k});const z=(0,s.decodeFunctionResult)({abi:O,args:U,data:k,functionName:N});S.push(E?{result:z,status:"success"}:z)}catch(z){const G=(0,c.getContractError)(z,{abi:O,address:H,args:U,docsPath:"/docs/contract/multicall",functionName:N});if(!E)throw G;S.push({error:G,result:void 0,status:"failure"})}}}if(S.length!==j.length)throw new r.BaseError("multicall results mismatch");return S}return Ks}var Zs={},Dy;function f_(){if(Dy)return Zs;Dy=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.simulateBlocks=E;const e=pg(),t=Ie(),n=Te(),r=ar(),o=Vt(),s=Kt(),i=Je(),a=Ce(),c=te(),u=cr(),l=ko(),f=Cu(),b=Wt(),y=_t(),h=nf(),m=vt();async function E(v,_){const{blockNumber:P,blockTag:d=v.experimental_blockTag??"latest",blocks:j,returnFullTransactions:g,traceTransfers:p,validation:T}=_;try{const w=[];for(const S of j){const x=S.blockOverrides?e.toRpc(S.blockOverrides):void 0,F=S.calls.map(I=>{const k=I,B=k.account?(0,t.parseAccount)(k.account):void 0,q=k.abi?(0,i.encodeFunctionData)(k):k.data,O={...k,account:B,data:k.dataSuffix?(0,a.concat)([q||"0x",k.dataSuffix]):q,from:k.from??B?.address};return(0,m.assertRequest)(O),(0,y.formatTransactionRequest)(O)}),M=S.stateOverrides?(0,h.serializeStateOverride)(S.stateOverrides):void 0;w.push({blockOverrides:x,calls:F,stateOverrides:M})}const C=(typeof P=="bigint"?(0,c.numberToHex)(P):void 0)||d;return(await v.request({method:"eth_simulateV1",params:[{blockStateCalls:w,returnFullTransactions:g,traceTransfers:p,validation:T},C]})).map((S,x)=>({...(0,f.formatBlock)(S),calls:S.calls.map((F,M)=>{const{abi:I,args:k,functionName:B,to:q}=j[x].calls[M],O=F.error?.data??F.returnData,H=BigInt(F.gasUsed),N=F.logs?.map(V=>(0,b.formatLog)(V)),U=F.status==="0x1"?"success":"failure",z=I&&U==="success"&&O!=="0x"?(0,s.decodeFunctionResult)({abi:I,data:O,functionName:B}):null,G=(()=>{if(U==="success")return;let V;if(F.error?.data==="0x"?V=new n.AbiDecodingZeroDataError:F.error&&(V=new r.RawContractError(F.error)),!!V)return(0,u.getContractError)(V,{abi:I??[],address:q??"0x",args:k,functionName:B??"<unknown>"})})();return{data:O,gasUsed:H,logs:N,status:U,...U==="success"?{result:z}:{error:G}}})}))}catch(w){const A=w,C=(0,l.getNodeError)(A,{});throw C instanceof o.UnknownNodeError?A:C}}return Zs}var Ys={},tr={},Le={},ln={},Gy;function T6(){if(Gy)return ln;Gy=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.normalizeSignature=n,ln.isArgOfType=r,ln.getAmbiguousTypes=o;const e=Yu(),t=ot();function n(s){let i=!0,a="",c=0,u="",l=!1;for(let f=0;f<s.length;f++){const b=s[f];if(["(",")",","].includes(b)&&(i=!0),b==="("&&c++,b===")"&&c--,!!i){if(c===0){if(b===" "&&["event","function","error",""].includes(u))u="";else if(u+=b,b===")"){l=!0;break}continue}if(b===" "){s[f-1]!==","&&a!==","&&a!==",("&&(a="",i=!1);continue}u+=b,a+=b}}if(!l)throw new t.BaseError("Unable to normalize signature.");return u}function r(s,i){const a=typeof s,c=i.type;switch(c){case"address":return e.validate(s,{strict:!1});case"bool":return a==="boolean";case"function":return a==="string";case"string":return a==="string";default:return c==="tuple"&&"components"in i?Object.values(i.components).every((u,l)=>r(Object.values(s)[l],u)):/^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)?$/.test(c)?a==="number"||a==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(c)?a==="string"||s instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(c)?Array.isArray(s)&&s.every(u=>r(u,{...i,type:c.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function o(s,i,a){for(const c in s){const u=s[c],l=i[c];if(u.type==="tuple"&&l.type==="tuple"&&"components"in u&&"components"in l)return o(u.components,l.components,a[c]);const f=[u.type,l.type];if(f.includes("address")&&f.includes("bytes20")?!0:f.includes("address")&&f.includes("string")?e.validate(a[c],{strict:!1}):f.includes("address")&&f.includes("bytes")?e.validate(a[c],{strict:!1}):!1)return f}}return ln}var Vy;function l_(){if(Vy)return Le;Vy=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.InvalidSelectorSizeError=Le.NotFoundError=Le.AmbiguityError=void 0,Le.format=s,Le.from=i,Le.fromAbi=a,Le.getSelector=c,Le.getSignature=u,Le.getSignatureHash=l;const e=rr(),t=ot(),n=zf(),r=ke(),o=T6();function s(h){return e.formatAbiItem(h)}function i(h,m={}){const{prepare:E=!0}=m,v=Array.isArray(h)||typeof h=="string"?e.parseAbiItem(h):h;return{...v,...E?{hash:l(v)}:{}}}function a(h,m,E){const{args:v=[],prepare:_=!0}=E??{},P=r.validate(m,{strict:!1}),d=h.filter(p=>P?p.type==="function"||p.type==="error"?c(p)===r.slice(m,0,4):p.type==="event"?l(p)===m:!1:"name"in p&&p.name===m);if(d.length===0)throw new b({name:m});if(d.length===1)return{...d[0],..._?{hash:l(d[0])}:{}};let j;for(const p of d){if(!("inputs"in p))continue;if(!v||v.length===0){if(!p.inputs||p.inputs.length===0)return{...p,..._?{hash:l(p)}:{}};continue}if(!p.inputs||p.inputs.length===0||p.inputs.length!==v.length)continue;if(v.every((w,A)=>{const C="inputs"in p&&p.inputs[A];return C?o.isArgOfType(w,C):!1})){if(j&&"inputs"in j&&j.inputs){const w=o.getAmbiguousTypes(p.inputs,j.inputs,v);if(w)throw new f({abiItem:p,type:w[0]},{abiItem:j,type:w[1]})}j=p}}const g=(()=>{if(j)return j;const[p,...T]=d;return{...p,overloads:T}})();if(!g)throw new b({name:m});return{...g,..._?{hash:l(g)}:{}}}function c(...h){const m=(()=>{if(Array.isArray(h[0])){const[E,v]=h;return a(E,v)}return h[0]})();return r.slice(l(m),0,4)}function u(...h){const m=(()=>{if(Array.isArray(h[0])){const[v,_]=h;return a(v,_)}return h[0]})(),E=typeof m=="string"?m:e.formatAbiItem(m);return o.normalizeSignature(E)}function l(...h){const m=(()=>{if(Array.isArray(h[0])){const[E,v]=h;return a(E,v)}return h[0]})();return typeof m!="string"&&"hash"in m&&m.hash?m.hash:n.keccak256(r.fromString(u(m)))}class f extends t.BaseError{constructor(m,E){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${m.type}\` in \`${o.normalizeSignature(e.formatAbiItem(m.abiItem))}\`, and`,`\`${E.type}\` in \`${o.normalizeSignature(e.formatAbiItem(E.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}Le.AmbiguityError=f;class b extends t.BaseError{constructor({name:m,data:E,type:v="item"}){const _=m?` with name "${m}"`:E?` with data "${E}"`:"";super(`ABI ${v}${_} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}Le.NotFoundError=b;class y extends t.BaseError{constructor({data:m}){super(`Selector size is invalid. Expected 4 bytes. Received ${r.size(m)} bytes ("${m}").`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.InvalidSelectorSizeError"})}}return Le.InvalidSelectorSizeError=y,Le}var Wy;function I6(){if(Wy)return tr;Wy=1,Object.defineProperty(tr,"__esModule",{value:!0}),tr.decode=o,tr.encode=s,tr.format=i,tr.from=a,tr.fromAbi=c;const e=rr(),t=l_(),n=$o(),r=ke();function o(...u){const[l,f]=(()=>{if(Array.isArray(u[0])){const[h,m]=u;return[c(h),m]}return u})(),{bytecode:b}=f;if(l.inputs?.length===0)return;const y=f.data.replace(b,"0x");return n.decode(l.inputs,y)}function s(...u){const[l,f]=(()=>{if(Array.isArray(u[0])){const[h,m]=u;return[c(h),m]}return u})(),{bytecode:b,args:y}=f;return r.concat(b,l.inputs?.length&&y?.length?n.encode(l.inputs,y):"0x")}function i(u){return e.formatAbiItem(u)}function a(u){return t.from(u)}function c(u){const l=u.find(f=>f.type==="constructor");if(!l)throw new t.NotFoundError({name:"constructor"});return l}return tr}var ht={},Ky;function S6(){if(Ky)return ht;Ky=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.decodeData=o,ht.decodeResult=s,ht.encodeData=i,ht.encodeResult=a,ht.format=c,ht.from=u,ht.fromAbi=l,ht.getSelector=f;const e=rr(),t=l_(),n=$o(),r=ke();function o(...b){const[y,h]=(()=>{if(Array.isArray(b[0])){const[v,_,P]=b;return[l(v,_),P]}return b})(),{overloads:m}=y;if(r.size(h)<4)throw new t.InvalidSelectorSizeError({data:h});if(y.inputs?.length===0)return;const E=m?l([y,...m],h):y;if(!(r.size(h)<=4))return n.decode(E.inputs,r.slice(h,4))}function s(...b){const[y,h,m={}]=(()=>{if(Array.isArray(b[0])){const[v,_,P,d]=b;return[l(v,_),P,d]}return b})(),E=n.decode(y.outputs,h,m);if(!(E&&Object.keys(E).length===0))return E&&Object.keys(E).length===1?Array.isArray(E)?E[0]:Object.values(E)[0]:E}function i(...b){const[y,h=[]]=(()=>{if(Array.isArray(b[0])){const[j,g,p]=b;return[l(j,g,{args:p}),p]}const[P,d]=b;return[P,d]})(),{overloads:m}=y,E=m?l([y,...m],y.name,{args:h}):y,v=f(E),_=h.length>0?n.encode(E.inputs,h):void 0;return _?r.concat(v,_):v}function a(...b){const[y,h,m={}]=(()=>{if(Array.isArray(b[0])){const[_,P,d,j]=b;return[l(_,P),d,j]}return b})(),{as:E="Array"}=m,v=y.outputs.length===1?[h]:Array.isArray(h)?h:E==="Object"?Object.values(h):[h];return n.encode(y.outputs,v)}function c(b){return e.formatAbiItem(b)}function u(b,y={}){return t.from(b,y)}function l(b,y,h){const m=t.fromAbi(b,y,h);if(m.type!=="function")throw new t.NotFoundError({name:y,type:"function"});return m}function f(b){return t.getSelector(b)}return ht}var qr={},Zy;function b_(){return Zy||(Zy=1,Object.defineProperty(qr,"__esModule",{value:!0}),qr.zeroAddress=qr.ethAddress=void 0,qr.ethAddress="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",qr.zeroAddress="0x0000000000000000000000000000000000000000"),qr}var Yy;function R6(){if(Yy)return Ys;Yy=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.simulateCalls=f;const e=I6(),t=S6(),n=Ie(),r=b_(),o=Go(),s=ue(),i=Je(),a=Kf(),c=Ig(),u=f_(),l="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function f(b,y){const{blockNumber:h,blockTag:m,calls:E,stateOverrides:v,traceAssetChanges:_,traceTransfers:P,validation:d}=y,j=y.account?(0,n.parseAccount)(y.account):void 0;if(_&&!j)throw new s.BaseError("`account` is required when `traceAssetChanges` is true");const g=j?e.encode(e.from("constructor(bytes, bytes)"),{bytecode:o.deploylessCallViaBytecodeBytecode,args:[l,t.encodeData(t.from("function getBalance(address)"),[j.address])]}):void 0,p=_?await Promise.all(y.calls.map(async K=>{if(!K.data&&!K.abi)return;const{accessList:Q}=await(0,c.createAccessList)(b,{account:j.address,...K,data:K.abi?(0,i.encodeFunctionData)(K):K.data});return Q.map(({address:ie,storageKeys:Y})=>Y.length>0?ie:null)})).then(K=>K.flat().filter(Boolean)):[],T=await(0,u.simulateBlocks)(b,{blockNumber:h,blockTag:m,blocks:[..._?[{calls:[{data:g}],stateOverrides:v},{calls:p.map((K,Q)=>({abi:[t.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[j.address],to:K,from:r.zeroAddress,nonce:Q})),stateOverrides:[{address:r.zeroAddress,nonce:0}]}]:[],{calls:[...E,{}].map(K=>({...K,from:j?.address})),stateOverrides:v},..._?[{calls:[{data:g}]},{calls:p.map((K,Q)=>({abi:[t.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[j.address],to:K,from:r.zeroAddress,nonce:Q})),stateOverrides:[{address:r.zeroAddress,nonce:0}]},{calls:p.map((K,Q)=>({to:K,abi:[t.from("function decimals() returns (uint256)")],functionName:"decimals",from:r.zeroAddress,nonce:Q})),stateOverrides:[{address:r.zeroAddress,nonce:0}]},{calls:p.map((K,Q)=>({to:K,abi:[t.from("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:r.zeroAddress,nonce:Q})),stateOverrides:[{address:r.zeroAddress,nonce:0}]},{calls:p.map((K,Q)=>({to:K,abi:[t.from("function symbol() returns (string)")],functionName:"symbol",from:r.zeroAddress,nonce:Q})),stateOverrides:[{address:r.zeroAddress,nonce:0}]}]:[]],traceTransfers:P,validation:d}),w=_?T[2]:T[0],[A,C,,R,S,x,F,M]=_?T:[],{calls:I,...k}=w,B=I.slice(0,-1)??[],q=A?.calls??[],O=C?.calls??[],H=[...q,...O].map(K=>K.status==="success"?(0,a.hexToBigInt)(K.data):null),N=R?.calls??[],U=S?.calls??[],z=[...N,...U].map(K=>K.status==="success"?(0,a.hexToBigInt)(K.data):null),G=(x?.calls??[]).map(K=>K.status==="success"?K.result:null),V=(M?.calls??[]).map(K=>K.status==="success"?K.result:null),J=(F?.calls??[]).map(K=>K.status==="success"?K.result:null),Z=[];for(const[K,Q]of z.entries()){const ie=H[K];if(typeof Q!="bigint"||typeof ie!="bigint")continue;const Y=G[K-1],X=V[K-1],ee=J[K-1],ae=K===0?{address:r.ethAddress,decimals:18,symbol:"ETH"}:{address:p[K-1],decimals:ee||Y?Number(Y??1):void 0,symbol:X??void 0};Z.some(oe=>oe.token.address===ae.address)||Z.push({token:ae,value:{pre:ie,post:Q,diff:Q-ie}})}return{assetChanges:Z,block:k,results:B}}return Ys}var bn={},Io={},Wd={},Jy;function B6(){return Jy||(Jy=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidWrappedSignatureError=e.universalSignatureValidatorAbi=e.universalSignatureValidatorBytecode=e.magicBytes=void 0,e.assert=o,e.from=s,e.unwrap=i,e.wrap=a,e.validate=c;const t=$o(),n=ot(),r=ke();e.magicBytes="0x6492649264926492649264926492649264926492649264926492649264926492",e.universalSignatureValidatorBytecode="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",e.universalSignatureValidatorAbi=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function o(l){if(r.slice(l,-32)!==e.magicBytes)throw new u(l)}function s(l){return typeof l=="string"?i(l):l}function i(l){o(l);const[f,b,y]=t.decode(t.from("address, bytes, bytes"),l);return{data:b,signature:y,to:f}}function a(l){const{data:f,signature:b,to:y}=l;return r.concat(t.encode(t.from("address, bytes, bytes"),[y,f,b]),e.magicBytes)}function c(l){try{return o(l),!0}catch{return!1}}class u extends n.BaseError{constructor(f){super(`Value \`${f}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}e.InvalidWrappedSignatureError=u})(Wd)),Wd}var Xy;function O6(){return Xy||(Xy=1,Object.defineProperty(Io,"__esModule",{value:!0}),Io.SignatureErc6492=void 0,Io.SignatureErc6492=B6()),Io}var Js={},Qy;function m_(){if(Qy)return Js;Qy=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.serializeSignature=r;const e=Gr(),t=Re(),n=_e();function r({r:o,s,to:i="hex",v:a,yParity:c}){const u=(()=>{if(c===0||c===1)return c;if(a&&(a===27n||a===28n||a>=35n))return a%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),l=`0x${new e.secp256k1.Signature((0,t.hexToBigInt)(o),(0,t.hexToBigInt)(s)).toCompactHex()}${u===0?"1b":"1c"}`;return i==="hex"?l:(0,n.hexToBytes)(l)}return Js}var $y;function Qu(){if($y)return bn;$y=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.verifyHash=d,bn.verifyErc8010=j,bn.verifyErc1271=p;const e=O6(),t=Ju(),n=lr(),r=Go(),o=ar(),s=Wo(),i=Je(),a=nt(),c=Et(),u=qg(),l=Ce(),f=De(),b=Re(),y=te(),h=me(),m=ur(),E=m_(),v=Ko(),_=Bg(),P=It();async function d(w,A){const{address:C,chain:R=w.chain,hash:S,erc6492VerifierAddress:x=A.universalSignatureVerifierAddress??R?.contracts?.erc6492Verifier?.address,multicallAddress:F=A.multicallAddress??R?.contracts?.multicall3?.address}=A;if(R?.verifyHash)return await R.verifyHash(w,A);const M=(()=>{const I=A.signature;return(0,f.isHex)(I)?I:typeof I=="object"&&"r"in I&&"s"in I?(0,E.serializeSignature)(I):(0,y.bytesToHex)(I)})();try{return t.SignatureErc8010.validate(M)?await j(w,{...A,multicallAddress:F,signature:M}):await g(w,{...A,verifierAddress:x,signature:M})}catch(I){try{if((0,c.isAddressEqual)((0,a.getAddress)(C),await(0,m.recoverAddress)({hash:S,signature:M})))return!0}catch{}if(I instanceof T)return!1;throw I}}async function j(w,A){const{address:C,blockNumber:R,blockTag:S,hash:x,multicallAddress:F}=A,{authorization:M,data:I,signature:k,to:B}=t.SignatureErc8010.unwrap(A.signature);if(await(0,_.getCode)(w,{address:C,blockNumber:R,blockTag:S})===(0,l.concatHex)(["0xef0100",M.address]))return await p(w,{address:C,blockNumber:R,blockTag:S,hash:x,signature:k});const O={address:M.address,chainId:Number(M.chainId),nonce:Number(M.nonce),r:(0,y.numberToHex)(M.r,{size:32}),s:(0,y.numberToHex)(M.s,{size:32}),yParity:M.yParity};if(!await(0,u.verifyAuthorization)({address:C,authorization:O}))throw new T;const N=await(0,h.getAction)(w,P.readContract,"readContract")({...F?{address:F}:{code:r.multicall3Bytecode},authorizationList:[O],abi:n.multicall3Abi,blockNumber:R,blockTag:"pending",functionName:"aggregate3",args:[[...I?[{allowFailure:!0,target:B??C,callData:I}]:[],{allowFailure:!0,target:C,callData:(0,i.encodeFunctionData)({abi:n.erc1271Abi,functionName:"isValidSignature",args:[x,k]})}]]});if(N[N.length-1]?.returnData?.startsWith("0x1626ba7e"))return!0;throw new T}async function g(w,A){const{address:C,factory:R,factoryData:S,hash:x,signature:F,verifierAddress:M,...I}=A,k=await(async()=>!R&&!S||e.SignatureErc6492.validate(F)?F:e.SignatureErc6492.wrap({data:S,signature:F,to:R}))(),B=M?{to:M,data:(0,i.encodeFunctionData)({abi:n.erc6492SignatureValidatorAbi,functionName:"isValidSig",args:[C,x,k]}),...I}:{data:(0,s.encodeDeployData)({abi:n.erc6492SignatureValidatorAbi,args:[C,x,k],bytecode:r.erc6492SignatureValidatorByteCode}),...I},{data:q}=await(0,h.getAction)(w,v.call,"call")(B).catch(O=>{throw O instanceof o.CallExecutionError?new T:O});if((0,b.hexToBool)(q??"0x0"))return!0;throw new T}async function p(w,A){const{address:C,blockNumber:R,blockTag:S,hash:x,signature:F}=A;if((await(0,h.getAction)(w,P.readContract,"readContract")({address:C,abi:n.erc1271Abi,args:[x,F],blockNumber:R,blockTag:S,functionName:"isValidSignature"}).catch(I=>{throw I instanceof o.ContractFunctionExecutionError?new T:I})).startsWith("0x1626ba7e"))return!0;throw new T}class T extends Error{}return bn}var Xs={},ep;function x6(){if(ep)return Xs;ep=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.verifyMessage=r;const e=me(),t=Xo(),n=Qu();async function r(o,{address:s,message:i,factory:a,factoryData:c,signature:u,...l}){const f=(0,t.hashMessage)(i);return(0,e.getAction)(o,n.verifyHash,"verifyHash")({address:s,factory:a,factoryData:c,hash:f,signature:u,...l})}return Xs}var Qs={},tp;function C6(){if(tp)return Qs;tp=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.verifyTypedData=r;const e=me(),t=Qo(),n=Qu();async function r(o,s){const{address:i,factory:a,factoryData:c,signature:u,message:l,primaryType:f,types:b,domain:y,...h}=s,m=(0,t.hashTypedData)({message:l,primaryType:f,types:b,domain:y});return(0,e.getAction)(o,n.verifyHash,"verifyHash")({address:i,factory:a,factoryData:c,hash:m,signature:u,...h})}return Qs}var $s={},ec={},rp;function h_(){if(rp)return ec;rp=1,Object.defineProperty(ec,"__esModule",{value:!0}),ec.watchBlockNumber=i;const e=Re(),t=me(),n=Wr(),r=En(),o=He(),s=Zo();function i(a,{emitOnBegin:c=!1,emitMissed:u=!1,onBlockNumber:l,onError:f,poll:b,pollingInterval:y=a.pollingInterval}){const h=typeof b<"u"?b:!(a.transport.type==="webSocket"||a.transport.type==="ipc"||a.transport.type==="fallback"&&(a.transport.transports[0].config.type==="webSocket"||a.transport.transports[0].config.type==="ipc"));let m;return h?(()=>{const _=(0,o.stringify)(["watchBlockNumber",a.uid,c,u,y]);return(0,n.observe)(_,{onBlockNumber:l,onError:f},P=>(0,r.poll)(async()=>{try{const d=await(0,t.getAction)(a,s.getBlockNumber,"getBlockNumber")({cacheTime:0});if(m!==void 0){if(d===m)return;if(d-m>1&&u)for(let j=m+1n;j<d;j++)P.onBlockNumber(j,m),m=j}(m===void 0||d>m)&&(P.onBlockNumber(d,m),m=d)}catch(d){P.onError?.(d)}},{emitOnBegin:c,interval:y}))})():(()=>{const _=(0,o.stringify)(["watchBlockNumber",a.uid,c,u]);return(0,n.observe)(_,{onBlockNumber:l,onError:f},P=>{let d=!0,j=()=>d=!1;return(async()=>{try{const g=(()=>{if(a.transport.type==="fallback"){const T=a.transport.transports.find(w=>w.config.type==="webSocket"||w.config.type==="ipc");return T?T.value:a.transport}return a.transport})(),{unsubscribe:p}=await g.subscribe({params:["newHeads"],onData(T){if(!d)return;const w=(0,e.hexToBigInt)(T.result?.number);P.onBlockNumber(w,m),m=w},onError(T){P.onError?.(T)}});j=p,d||j()}catch(g){f?.(g)}})(),()=>j()})})()}return ec}var np;function y_(){if(np)return $s;np=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.waitForTransactionReceipt=f;const e=af(),t=Xe(),n=me(),r=Wr(),o=yf(),s=Gu(),i=He(),a=Vr(),c=Zf(),u=d_(),l=h_();async function f(b,y){const{checkReplacement:h=!0,confirmations:m=1,hash:E,onReplaced:v,retryCount:_=6,retryDelay:P=({count:I})=>~~(1<<I)*200,timeout:d=18e4}=y,j=(0,i.stringify)(["waitForTransactionReceipt",b.uid,E]),g=y.pollingInterval?y.pollingInterval:b.chain?.experimental_preconfirmationTime?b.chain.experimental_preconfirmationTime:b.pollingInterval;let p,T,w,A=!1,C,R;const{promise:S,resolve:x,reject:F}=(0,o.withResolvers)(),M=d?setTimeout(()=>{R?.(),C?.(),F(new t.WaitForTransactionReceiptTimeoutError({hash:E}))},d):void 0;return C=(0,r.observe)(j,{onReplaced:v,resolve:x,reject:F},async I=>{if(w=await(0,n.getAction)(b,u.getTransactionReceipt,"getTransactionReceipt")({hash:E}).catch(()=>{}),w&&m<=1){clearTimeout(M),I.resolve(w),C?.();return}R=(0,n.getAction)(b,l.watchBlockNumber,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:g,async onBlockNumber(k){const B=O=>{clearTimeout(M),R?.(),O(),C?.()};let q=k;if(!A)try{if(w){if(m>1&&(!w.blockNumber||q-w.blockNumber+1n<m))return;B(()=>I.resolve(w));return}if(h&&!p&&(A=!0,await(0,s.withRetry)(async()=>{p=await(0,n.getAction)(b,c.getTransaction,"getTransaction")({hash:E}),p.blockNumber&&(q=p.blockNumber)},{delay:P,retryCount:_}),A=!1),w=await(0,n.getAction)(b,u.getTransactionReceipt,"getTransactionReceipt")({hash:E}),m>1&&(!w.blockNumber||q-w.blockNumber+1n<m))return;B(()=>I.resolve(w))}catch(O){if(O instanceof t.TransactionNotFoundError||O instanceof t.TransactionReceiptNotFoundError){if(!p){A=!1;return}try{T=p,A=!0;const H=await(0,s.withRetry)(()=>(0,n.getAction)(b,a.getBlock,"getBlock")({blockNumber:q,includeTransactions:!0}),{delay:P,retryCount:_,shouldRetry:({error:z})=>z instanceof e.BlockNotFoundError});A=!1;const N=H.transactions.find(({from:z,nonce:G})=>z===T.from&&G===T.nonce);if(!N||(w=await(0,n.getAction)(b,u.getTransactionReceipt,"getTransactionReceipt")({hash:N.hash}),m>1&&(!w.blockNumber||q-w.blockNumber+1n<m)))return;let U="replaced";N.to===T.to&&N.value===T.value&&N.input===T.input?U="repriced":N.from===N.to&&N.value===0n&&(U="cancelled"),B(()=>{I.onReplaced?.({reason:U,replacedTransaction:T,transaction:N,transactionReceipt:w}),I.resolve(w)})}catch(H){B(()=>I.reject(H))}}else B(()=>I.reject(O))}}})}),S}return $s}var tc={},op;function q6(){if(op)return tc;op=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.watchBlocks=s;const e=me(),t=Wr(),n=En(),r=He(),o=Vr();function s(i,{blockTag:a=i.experimental_blockTag??"latest",emitMissed:c=!1,emitOnBegin:u=!1,onBlock:l,onError:f,includeTransactions:b,poll:y,pollingInterval:h=i.pollingInterval}){const m=typeof y<"u"?y:!(i.transport.type==="webSocket"||i.transport.type==="ipc"||i.transport.type==="fallback"&&(i.transport.transports[0].config.type==="webSocket"||i.transport.transports[0].config.type==="ipc")),E=b??!1;let v;return m?(()=>{const d=(0,r.stringify)(["watchBlocks",i.uid,a,c,u,E,h]);return(0,t.observe)(d,{onBlock:l,onError:f},j=>(0,n.poll)(async()=>{try{const g=await(0,e.getAction)(i,o.getBlock,"getBlock")({blockTag:a,includeTransactions:E});if(g.number!==null&&v?.number!=null){if(g.number===v.number)return;if(g.number-v.number>1&&c)for(let p=v?.number+1n;p<g.number;p++){const T=await(0,e.getAction)(i,o.getBlock,"getBlock")({blockNumber:p,includeTransactions:E});j.onBlock(T,v),v=T}}(v?.number==null||a==="pending"&&g?.number==null||g.number!==null&&g.number>v.number)&&(j.onBlock(g,v),v=g)}catch(g){j.onError?.(g)}},{emitOnBegin:u,interval:h}))})():(()=>{let d=!0,j=!0,g=()=>d=!1;return(async()=>{try{u&&(0,e.getAction)(i,o.getBlock,"getBlock")({blockTag:a,includeTransactions:E}).then(w=>{d&&j&&(l(w,void 0),j=!1)}).catch(f);const p=(()=>{if(i.transport.type==="fallback"){const w=i.transport.transports.find(A=>A.config.type==="webSocket"||A.config.type==="ipc");return w?w.value:i.transport}return i.transport})(),{unsubscribe:T}=await p.subscribe({params:["newHeads"],async onData(w){if(!d)return;const A=await(0,e.getAction)(i,o.getBlock,"getBlock")({blockNumber:w.result?.number,includeTransactions:E}).catch(()=>{});d&&(l(A,v),j=!1,v=A)},onError(w){f?.(w)}});g=T,d||g()}catch(p){f?.(p)}})(),()=>g()})()}return tc}var rc={},ip;function M6(){if(ip)return rc;ip=1,Object.defineProperty(rc,"__esModule",{value:!0}),rc.watchEvent=h;const e=Te(),t=sr(),n=Lo(),r=Ur(),o=Wt(),s=me(),i=Wr(),a=En(),c=He(),u=Sg(),l=Zo(),f=Uu(),b=bf(),y=Lu();function h(m,{address:E,args:v,batch:_=!0,event:P,events:d,fromBlock:j,onError:g,onLogs:p,poll:T,pollingInterval:w=m.pollingInterval,strict:A}){const C=typeof T<"u"?T:typeof j=="bigint"?!0:!(m.transport.type==="webSocket"||m.transport.type==="ipc"||m.transport.type==="fallback"&&(m.transport.transports[0].config.type==="webSocket"||m.transport.transports[0].config.type==="ipc")),R=A??!1;return C?(()=>{const F=(0,c.stringify)(["watchEvent",E,v,_,m.uid,P,w,j]);return(0,i.observe)(F,{onLogs:p,onError:g},M=>{let I;j!==void 0&&(I=j-1n);let k,B=!1;const q=(0,a.poll)(async()=>{if(!B){try{k=await(0,s.getAction)(m,u.createEventFilter,"createEventFilter")({address:E,args:v,event:P,events:d,strict:R,fromBlock:j})}catch{}B=!0;return}try{let O;if(k)O=await(0,s.getAction)(m,f.getFilterChanges,"getFilterChanges")({filter:k});else{const H=await(0,s.getAction)(m,l.getBlockNumber,"getBlockNumber")({});I&&I!==H?O=await(0,s.getAction)(m,b.getLogs,"getLogs")({address:E,args:v,event:P,events:d,fromBlock:I+1n,toBlock:H}):O=[],I=H}if(O.length===0)return;if(_)M.onLogs(O);else for(const H of O)M.onLogs([H])}catch(O){k&&O instanceof t.InvalidInputRpcError&&(B=!1),M.onError?.(O)}},{emitOnBegin:!0,interval:w});return async()=>{k&&await(0,s.getAction)(m,y.uninstallFilter,"uninstallFilter")({filter:k}),q()}})})():(()=>{let F=!0,M=()=>F=!1;return(async()=>{try{const I=(()=>{if(m.transport.type==="fallback"){const O=m.transport.transports.find(H=>H.config.type==="webSocket"||H.config.type==="ipc");return O?O.value:m.transport}return m.transport})(),k=d??(P?[P]:void 0);let B=[];k&&(B=[k.flatMap(H=>(0,r.encodeEventTopics)({abi:[H],eventName:H.name,args:v}))],P&&(B=B[0]));const{unsubscribe:q}=await I.subscribe({params:["logs",{address:E,topics:B}],onData(O){if(!F)return;const H=O.result;try{const{eventName:N,args:U}=(0,n.decodeEventLog)({abi:k??[],data:H.data,topics:H.topics,strict:R}),z=(0,o.formatLog)(H,{args:U,eventName:N});p([z])}catch(N){let U,z;if(N instanceof e.DecodeLogDataMismatch||N instanceof e.DecodeLogTopicsMismatch){if(A)return;U=N.abiItem.name,z=N.abiItem.inputs?.some(V=>!("name"in V&&V.name))}const G=(0,o.formatLog)(H,{args:z?[]:{},eventName:U});p([G])}},onError(O){g?.(O)}});M=q,F||M()}catch(I){g?.(I)}})(),()=>M()})()}return rc}var nc={},ap;function H6(){if(ap)return nc;ap=1,Object.defineProperty(nc,"__esModule",{value:!0}),nc.watchPendingTransactions=a;const e=me(),t=Wr(),n=En(),r=He(),o=Rg(),s=Uu(),i=Lu();function a(c,{batch:u=!0,onError:l,onTransactions:f,poll:b,pollingInterval:y=c.pollingInterval}){return(typeof b<"u"?b:c.transport.type!=="webSocket"&&c.transport.type!=="ipc")?(()=>{const v=(0,r.stringify)(["watchPendingTransactions",c.uid,u,y]);return(0,t.observe)(v,{onTransactions:f,onError:l},_=>{let P;const d=(0,n.poll)(async()=>{try{if(!P)try{P=await(0,e.getAction)(c,o.createPendingTransactionFilter,"createPendingTransactionFilter")({});return}catch(g){throw d(),g}const j=await(0,e.getAction)(c,s.getFilterChanges,"getFilterChanges")({filter:P});if(j.length===0)return;if(u)_.onTransactions(j);else for(const g of j)_.onTransactions([g])}catch(j){_.onError?.(j)}},{emitOnBegin:!0,interval:y});return async()=>{P&&await(0,e.getAction)(c,i.uninstallFilter,"uninstallFilter")({filter:P}),d()}})})():(()=>{let v=!0,_=()=>v=!1;return(async()=>{try{const{unsubscribe:P}=await c.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!v)return;const j=d.result;f([j])},onError(d){l?.(d)}});_=P,v||_()}catch(P){l?.(P)}})(),()=>_()})()}return nc}var oc={},ic={},sp;function k6(){if(sp)return ic;sp=1,Object.defineProperty(ic,"__esModule",{value:!0}),ic.parseSiweMessage=e;function e(r){const{scheme:o,statement:s,...i}=r.match(t)?.groups??{},{chainId:a,expirationTime:c,issuedAt:u,notBefore:l,requestId:f,...b}=r.match(n)?.groups??{},y=r.split("Resources:")[1]?.split(`
47
+ - `).slice(1);return{...i,...b,...a?{chainId:Number(a)}:{},...c?{expirationTime:new Date(c)}:{},...u?{issuedAt:new Date(u)}:{},...l?{notBefore:new Date(l)}:{},...f?{requestId:f}:{},...y?{resources:y}:{},...o?{scheme:o}:{},...s?{statement:s}:{}}}const t=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,n=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;return ic}var ac={},cp;function F6(){if(cp)return ac;cp=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.validateSiweMessage=n;const e=Ye(),t=Et();function n(r){const{address:o,domain:s,message:i,nonce:a,scheme:c,time:u=new Date}=r;if(s&&i.domain!==s||a&&i.nonce!==a||c&&i.scheme!==c||i.expirationTime&&u>=i.expirationTime||i.notBefore&&u<i.notBefore)return!1;try{if(!i.address||!(0,e.isAddress)(i.address,{strict:!1})||o&&!(0,t.isAddressEqual)(i.address,o))return!1}catch{return!1}return!0}return ac}var up;function N6(){if(up)return oc;up=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.verifySiweMessage=o;const e=Xo(),t=k6(),n=F6(),r=Qu();async function o(s,i){const{address:a,domain:c,message:u,nonce:l,scheme:f,signature:b,time:y=new Date,...h}=i,m=(0,t.parseSiweMessage)(u);if(!m.address||!(0,n.validateSiweMessage)({address:a,domain:c,message:m,nonce:l,scheme:f,time:y}))return!1;const v=(0,e.hashMessage)(u);return(0,r.verifyHash)(s,{address:m.address,hash:v,signature:b,...h})}return oc}var sc={},dp;function Yf(){if(dp)return sc;dp=1,Object.defineProperty(sc,"__esModule",{value:!0}),sc.sendRawTransactionSync=r;const e=Xe(),t=Jo(),n=Kf();async function r(o,{serializedTransaction:s,throwOnReceiptRevert:i,timeout:a}){const c=await o.request({method:"eth_sendRawTransactionSync",params:a?[s,(0,n.numberToHex)(a)]:[s]},{retryCount:0}),l=(o.chain?.formatters?.transactionReceipt?.format||t.formatTransactionReceipt)(c);if(l.status==="reverted"&&i)throw new e.TransactionReceiptRevertedError({receipt:l});return l}return sc}var fp;function p_(){if(fp)return Ua;fp=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.publicActions=fe;const e=Yv(),t=Qv(),n=$v(),r=e6(),o=Tg(),s=Ko(),i=Ig(),a=t6(),c=Xd(),u=Sg(),l=Rg(),f=mg(),b=ug(),y=lf(),h=cg(),m=ff(),E=r6(),v=n6(),_=Vr(),P=Zo(),d=o6(),j=fr(),g=Bg(),p=mf(),T=a6(),w=c6(),A=Uu(),C=u6(),R=sf(),S=bf(),x=j6(),F=w6(),M=Zf(),I=P6(),k=qu(),B=d_(),q=A6(),O=It(),H=f_(),N=R6(),U=gg(),z=Lu(),G=Qu(),V=x6(),J=C6(),Z=y_(),K=h_(),Q=q6(),ie=vg(),Y=M6(),X=H6(),ee=N6(),ae=Uo(),oe=wf(),se=Yf();function fe($){return{call:W=>(0,s.call)($,W),createAccessList:W=>(0,i.createAccessList)($,W),createBlockFilter:()=>(0,a.createBlockFilter)($),createContractEventFilter:W=>(0,c.createContractEventFilter)($,W),createEventFilter:W=>(0,u.createEventFilter)($,W),createPendingTransactionFilter:()=>(0,l.createPendingTransactionFilter)($),estimateContractGas:W=>(0,f.estimateContractGas)($,W),estimateGas:W=>(0,y.estimateGas)($,W),getBalance:W=>(0,E.getBalance)($,W),getBlobBaseFee:()=>(0,v.getBlobBaseFee)($),getBlock:W=>(0,_.getBlock)($,W),getBlockNumber:W=>(0,P.getBlockNumber)($,W),getBlockTransactionCount:W=>(0,d.getBlockTransactionCount)($,W),getBytecode:W=>(0,g.getCode)($,W),getChainId:()=>(0,j.getChainId)($),getCode:W=>(0,g.getCode)($,W),getContractEvents:W=>(0,p.getContractEvents)($,W),getEip712Domain:W=>(0,T.getEip712Domain)($,W),getEnsAddress:W=>(0,e.getEnsAddress)($,W),getEnsAvatar:W=>(0,t.getEnsAvatar)($,W),getEnsName:W=>(0,n.getEnsName)($,W),getEnsResolver:W=>(0,r.getEnsResolver)($,W),getEnsText:W=>(0,o.getEnsText)($,W),getFeeHistory:W=>(0,w.getFeeHistory)($,W),estimateFeesPerGas:W=>(0,b.estimateFeesPerGas)($,W),getFilterChanges:W=>(0,A.getFilterChanges)($,W),getFilterLogs:W=>(0,C.getFilterLogs)($,W),getGasPrice:()=>(0,R.getGasPrice)($),getLogs:W=>(0,S.getLogs)($,W),getProof:W=>(0,x.getProof)($,W),estimateMaxPriorityFeePerGas:W=>(0,h.estimateMaxPriorityFeePerGas)($,W),fillTransaction:W=>(0,m.fillTransaction)($,W),getStorageAt:W=>(0,F.getStorageAt)($,W),getTransaction:W=>(0,M.getTransaction)($,W),getTransactionConfirmations:W=>(0,I.getTransactionConfirmations)($,W),getTransactionCount:W=>(0,k.getTransactionCount)($,W),getTransactionReceipt:W=>(0,B.getTransactionReceipt)($,W),multicall:W=>(0,q.multicall)($,W),prepareTransactionRequest:W=>(0,ae.prepareTransactionRequest)($,W),readContract:W=>(0,O.readContract)($,W),sendRawTransaction:W=>(0,oe.sendRawTransaction)($,W),sendRawTransactionSync:W=>(0,se.sendRawTransactionSync)($,W),simulate:W=>(0,H.simulateBlocks)($,W),simulateBlocks:W=>(0,H.simulateBlocks)($,W),simulateCalls:W=>(0,N.simulateCalls)($,W),simulateContract:W=>(0,U.simulateContract)($,W),verifyHash:W=>(0,G.verifyHash)($,W),verifyMessage:W=>(0,V.verifyMessage)($,W),verifySiweMessage:W=>(0,ee.verifySiweMessage)($,W),verifyTypedData:W=>(0,J.verifyTypedData)($,W),uninstallFilter:W=>(0,z.uninstallFilter)($,W),waitForTransactionReceipt:W=>(0,Z.waitForTransactionReceipt)($,W),watchBlocks:W=>(0,Q.watchBlocks)($,W),watchBlockNumber:W=>(0,K.watchBlockNumber)($,W),watchContractEvent:W=>(0,ie.watchContractEvent)($,W),watchEvent:W=>(0,Y.watchEvent)($,W),watchPendingTransactions:W=>(0,X.watchPendingTransactions)($,W)}}return Ua}var lp;function z6(){if(lp)return za;lp=1,Object.defineProperty(za,"__esModule",{value:!0}),za.createPublicClient=n;const e=Vu(),t=p_();function n(r){const{key:o="public",name:s="Public Client"}=r;return(0,e.createClient)({...r,key:o,name:s,type:"publicClient"}).extend(t.publicActions)}return za}var cc={},uc={},dc={},bp;function U6(){if(bp)return dc;bp=1,Object.defineProperty(dc,"__esModule",{value:!0}),dc.dropTransaction=e;async function e(t,{hash:n}){await t.request({method:`${t.mode}_dropTransaction`,params:[n]})}return dc}var fc={},mp;function L6(){if(mp)return fc;mp=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.dumpState=e;async function e(t){return t.request({method:`${t.mode}_dumpState`})}return fc}var lc={},hp;function D6(){if(hp)return lc;hp=1,Object.defineProperty(lc,"__esModule",{value:!0}),lc.getAutomine=e;async function e(t){return t.mode==="ganache"?await t.request({method:"eth_mining"}):await t.request({method:`${t.mode}_getAutomine`})}return lc}var bc={},yp;function G6(){if(yp)return bc;yp=1,Object.defineProperty(bc,"__esModule",{value:!0}),bc.getTxpoolContent=e;async function e(t){return await t.request({method:"txpool_content"})}return bc}var mc={},pp;function V6(){if(pp)return mc;pp=1,Object.defineProperty(mc,"__esModule",{value:!0}),mc.getTxpoolStatus=t;const e=Re();async function t(n){const{pending:r,queued:o}=await n.request({method:"txpool_status"});return{pending:(0,e.hexToNumber)(r),queued:(0,e.hexToNumber)(o)}}return mc}var hc={},gp;function W6(){if(gp)return hc;gp=1,Object.defineProperty(hc,"__esModule",{value:!0}),hc.impersonateAccount=e;async function e(t,{address:n}){await t.request({method:`${t.mode}_impersonateAccount`,params:[n]})}return hc}var yc={},_p;function K6(){if(_p)return yc;_p=1,Object.defineProperty(yc,"__esModule",{value:!0}),yc.increaseTime=t;const e=te();async function t(n,{seconds:r}){return await n.request({method:"evm_increaseTime",params:[(0,e.numberToHex)(r)]})}return yc}var pc={},vp;function Z6(){if(vp)return pc;vp=1,Object.defineProperty(pc,"__esModule",{value:!0}),pc.inspectTxpool=e;async function e(t){return await t.request({method:"txpool_inspect"})}return pc}var gc={},Ep;function Y6(){if(Ep)return gc;Ep=1,Object.defineProperty(gc,"__esModule",{value:!0}),gc.loadState=e;async function e(t,{state:n}){await t.request({method:`${t.mode}_loadState`,params:[n]})}return gc}var _c={},jp;function J6(){if(jp)return _c;jp=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.mine=t;const e=te();async function t(n,{blocks:r,interval:o}){n.mode==="ganache"?await n.request({method:"evm_mine",params:[{blocks:(0,e.numberToHex)(r)}]}):await n.request({method:`${n.mode}_mine`,params:[(0,e.numberToHex)(r),(0,e.numberToHex)(o||0)]})}return _c}var vc={},wp;function X6(){if(wp)return vc;wp=1,Object.defineProperty(vc,"__esModule",{value:!0}),vc.removeBlockTimestampInterval=e;async function e(t){await t.request({method:`${t.mode}_removeBlockTimestampInterval`})}return vc}var Ec={},Pp;function Q6(){if(Pp)return Ec;Pp=1,Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.reset=e;async function e(t,{blockNumber:n,jsonRpcUrl:r}={}){await t.request({method:`${t.mode}_reset`,params:[{forking:{blockNumber:Number(n),jsonRpcUrl:r}}]})}return Ec}var jc={},Ap;function $6(){if(Ap)return jc;Ap=1,Object.defineProperty(jc,"__esModule",{value:!0}),jc.revert=e;async function e(t,{id:n}){await t.request({method:"evm_revert",params:[n]})}return jc}var wc={},Tp;function e2(){if(Tp)return wc;Tp=1,Object.defineProperty(wc,"__esModule",{value:!0}),wc.sendUnsignedTransaction=n;const e=dr(),t=_t();async function n(r,o){const{accessList:s,data:i,from:a,gas:c,gasPrice:u,maxFeePerGas:l,maxPriorityFeePerGas:f,nonce:b,to:y,value:h,...m}=o,E=r.chain?.formatters?.transactionRequest?.format,_=(E||t.formatTransactionRequest)({...(0,e.extract)(m,{format:E}),accessList:s,data:i,from:a,gas:c,gasPrice:u,maxFeePerGas:l,maxPriorityFeePerGas:f,nonce:b,to:y,value:h},"sendUnsignedTransaction");return await r.request({method:"eth_sendUnsignedTransaction",params:[_]})}return wc}var Pc={},Ip;function t2(){if(Ip)return Pc;Ip=1,Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.setAutomine=e;async function e(t,n){t.mode==="ganache"?n?await t.request({method:"miner_start"}):await t.request({method:"miner_stop"}):await t.request({method:"evm_setAutomine",params:[n]})}return Pc}var Ac={},Sp;function r2(){if(Sp)return Ac;Sp=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.setBalance=t;const e=te();async function t(n,{address:r,value:o}){n.mode==="ganache"?await n.request({method:"evm_setAccountBalance",params:[r,(0,e.numberToHex)(o)]}):await n.request({method:`${n.mode}_setBalance`,params:[r,(0,e.numberToHex)(o)]})}return Ac}var Tc={},Rp;function n2(){if(Rp)return Tc;Rp=1,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.setBlockGasLimit=t;const e=te();async function t(n,{gasLimit:r}){await n.request({method:"evm_setBlockGasLimit",params:[(0,e.numberToHex)(r)]})}return Tc}var Ic={},Bp;function o2(){if(Bp)return Ic;Bp=1,Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.setBlockTimestampInterval=e;async function e(t,{interval:n}){const r=t.mode==="hardhat"?n*1e3:n;await t.request({method:`${t.mode}_setBlockTimestampInterval`,params:[r]})}return Ic}var Sc={},Op;function i2(){if(Op)return Sc;Op=1,Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.setCode=e;async function e(t,{address:n,bytecode:r}){t.mode==="ganache"?await t.request({method:"evm_setAccountCode",params:[n,r]}):await t.request({method:`${t.mode}_setCode`,params:[n,r]})}return Sc}var Rc={},xp;function a2(){if(xp)return Rc;xp=1,Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.setCoinbase=e;async function e(t,{address:n}){await t.request({method:`${t.mode}_setCoinbase`,params:[n]})}return Rc}var Bc={},Cp;function s2(){if(Cp)return Bc;Cp=1,Object.defineProperty(Bc,"__esModule",{value:!0}),Bc.setIntervalMining=e;async function e(t,{interval:n}){const r=t.mode==="hardhat"?n*1e3:n;await t.request({method:"evm_setIntervalMining",params:[r]})}return Bc}var Oc={},qp;function c2(){if(qp)return Oc;qp=1,Object.defineProperty(Oc,"__esModule",{value:!0}),Oc.setLoggingEnabled=e;async function e(t,n){await t.request({method:`${t.mode}_setLoggingEnabled`,params:[n]})}return Oc}var xc={},Mp;function u2(){if(Mp)return xc;Mp=1,Object.defineProperty(xc,"__esModule",{value:!0}),xc.setMinGasPrice=t;const e=te();async function t(n,{gasPrice:r}){await n.request({method:`${n.mode}_setMinGasPrice`,params:[(0,e.numberToHex)(r)]})}return xc}var Cc={},Hp;function d2(){if(Hp)return Cc;Hp=1,Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.setNextBlockBaseFeePerGas=t;const e=te();async function t(n,{baseFeePerGas:r}){await n.request({method:`${n.mode}_setNextBlockBaseFeePerGas`,params:[(0,e.numberToHex)(r)]})}return Cc}var qc={},kp;function f2(){if(kp)return qc;kp=1,Object.defineProperty(qc,"__esModule",{value:!0}),qc.setNextBlockTimestamp=t;const e=te();async function t(n,{timestamp:r}){await n.request({method:"evm_setNextBlockTimestamp",params:[(0,e.numberToHex)(r)]})}return qc}var Mc={},Fp;function l2(){if(Fp)return Mc;Fp=1,Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.setNonce=t;const e=te();async function t(n,{address:r,nonce:o}){await n.request({method:`${n.mode}_setNonce`,params:[r,(0,e.numberToHex)(o)]})}return Mc}var Hc={},Np;function b2(){if(Np)return Hc;Np=1,Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.setRpcUrl=e;async function e(t,n){await t.request({method:`${t.mode}_setRpcUrl`,params:[n]})}return Hc}var kc={},zp;function m2(){if(zp)return kc;zp=1,Object.defineProperty(kc,"__esModule",{value:!0}),kc.setStorageAt=t;const e=te();async function t(n,{address:r,index:o,value:s}){await n.request({method:`${n.mode}_setStorageAt`,params:[r,typeof o=="number"?(0,e.numberToHex)(o):o,s]})}return kc}var Fc={},Up;function h2(){if(Up)return Fc;Up=1,Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.snapshot=e;async function e(t){return await t.request({method:"evm_snapshot"})}return Fc}var Nc={},Lp;function y2(){if(Lp)return Nc;Lp=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.stopImpersonatingAccount=e;async function e(t,{address:n}){await t.request({method:`${t.mode}_stopImpersonatingAccount`,params:[n]})}return Nc}var Dp;function g_(){if(Dp)return uc;Dp=1,Object.defineProperty(uc,"__esModule",{value:!0}),uc.testActions=x;const e=U6(),t=L6(),n=D6(),r=G6(),o=V6(),s=W6(),i=K6(),a=Z6(),c=Y6(),u=J6(),l=X6(),f=Q6(),b=$6(),y=e2(),h=t2(),m=r2(),E=n2(),v=o2(),_=i2(),P=a2(),d=s2(),j=c2(),g=u2(),p=d2(),T=f2(),w=l2(),A=b2(),C=m2(),R=h2(),S=y2();function x({mode:F}){return M=>{const I=M.extend(()=>({mode:F}));return{dropTransaction:k=>(0,e.dropTransaction)(I,k),dumpState:()=>(0,t.dumpState)(I),getAutomine:()=>(0,n.getAutomine)(I),getTxpoolContent:()=>(0,r.getTxpoolContent)(I),getTxpoolStatus:()=>(0,o.getTxpoolStatus)(I),impersonateAccount:k=>(0,s.impersonateAccount)(I,k),increaseTime:k=>(0,i.increaseTime)(I,k),inspectTxpool:()=>(0,a.inspectTxpool)(I),loadState:k=>(0,c.loadState)(I,k),mine:k=>(0,u.mine)(I,k),removeBlockTimestampInterval:()=>(0,l.removeBlockTimestampInterval)(I),reset:k=>(0,f.reset)(I,k),revert:k=>(0,b.revert)(I,k),sendUnsignedTransaction:k=>(0,y.sendUnsignedTransaction)(I,k),setAutomine:k=>(0,h.setAutomine)(I,k),setBalance:k=>(0,m.setBalance)(I,k),setBlockGasLimit:k=>(0,E.setBlockGasLimit)(I,k),setBlockTimestampInterval:k=>(0,v.setBlockTimestampInterval)(I,k),setCode:k=>(0,_.setCode)(I,k),setCoinbase:k=>(0,P.setCoinbase)(I,k),setIntervalMining:k=>(0,d.setIntervalMining)(I,k),setLoggingEnabled:k=>(0,j.setLoggingEnabled)(I,k),setMinGasPrice:k=>(0,g.setMinGasPrice)(I,k),setNextBlockBaseFeePerGas:k=>(0,p.setNextBlockBaseFeePerGas)(I,k),setNextBlockTimestamp:k=>(0,T.setNextBlockTimestamp)(I,k),setNonce:k=>(0,w.setNonce)(I,k),setRpcUrl:k=>(0,A.setRpcUrl)(I,k),setStorageAt:k=>(0,C.setStorageAt)(I,k),snapshot:()=>(0,R.snapshot)(I),stopImpersonatingAccount:k=>(0,S.stopImpersonatingAccount)(I,k)}}}return uc}var Gp;function p2(){if(Gp)return cc;Gp=1,Object.defineProperty(cc,"__esModule",{value:!0}),cc.createTestClient=n;const e=Vu(),t=g_();function n(r){const{key:o="test",name:s="Test Client",mode:i}=r;return(0,e.createClient)({...r,key:o,name:s,type:"testClient"}).extend(c=>({mode:i,...(0,t.testActions)({mode:i})(c)}))}return cc}var zc={},Uc={},Lc={},Vp;function g2(){if(Vp)return Lc;Vp=1,Object.defineProperty(Lc,"__esModule",{value:!0}),Lc.addChain=t;const e=te();async function t(n,{chain:r}){const{id:o,name:s,nativeCurrency:i,rpcUrls:a,blockExplorers:c}=r;await n.request({method:"wallet_addEthereumChain",params:[{chainId:(0,e.numberToHex)(o),chainName:s,nativeCurrency:i,rpcUrls:a.default.http,blockExplorerUrls:c?Object.values(c).map(({url:u})=>u):void 0}]},{dedupe:!0,retryCount:0})}return Lc}var Dc={},Wp;function _2(){if(Wp)return Dc;Wp=1,Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.deployContract=n;const e=Wo(),t=Du();function n(r,o){const{abi:s,args:i,bytecode:a,...c}=o,u=(0,e.encodeDeployData)({abi:s,args:i,bytecode:a});return(0,t.sendTransaction)(r,{...c,...c.authorizationList?{to:null}:{},data:u})}return Dc}var Gc={},Kp;function v2(){if(Kp)return Gc;Kp=1,Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.getAddresses=t;const e=nt();async function t(n){return n.account?.type==="local"?[n.account.address]:(await n.request({method:"eth_accounts"},{dedupe:!0})).map(o=>(0,e.checksumAddress)(o))}return Gc}var Vc={},Zp;function E2(){if(Zp)return Vc;Zp=1,Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.getCapabilities=n;const e=Ie(),t=te();async function n(r,o={}){const{account:s=r.account,chainId:i}=o,a=s?(0,e.parseAccount)(s):void 0,c=i?[a?.address,[(0,t.numberToHex)(i)]]:[a?.address],u=await r.request({method:"wallet_getCapabilities",params:c}),l={};for(const[f,b]of Object.entries(u)){l[Number(f)]={};for(let[y,h]of Object.entries(b))y==="addSubAccount"&&(y="unstable_addSubAccount"),l[Number(f)][y]=h}return typeof i=="number"?l[i]:l}return Vc}var Wc={},Yp;function j2(){if(Yp)return Wc;Yp=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.getPermissions=e;async function e(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}return Wc}var Kc={},Jp;function __(){if(Jp)return Kc;Jp=1,Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.prepareAuthorization=i;const e=Ie(),t=mr(),n=Et(),r=me(),o=fr(),s=qu();async function i(a,c){const{account:u=a.account,chainId:l,nonce:f}=c;if(!u)throw new t.AccountNotFoundError({docsPath:"/docs/eip7702/prepareAuthorization"});const b=(0,e.parseAccount)(u),y=(()=>{if(c.executor)return c.executor==="self"?c.executor:(0,e.parseAccount)(c.executor)})(),h={address:c.contractAddress??c.address,chainId:l,nonce:f};return typeof h.chainId>"u"&&(h.chainId=a.chain?.id??await(0,r.getAction)(a,o.getChainId,"getChainId")({})),typeof h.nonce>"u"&&(h.nonce=await(0,r.getAction)(a,s.getTransactionCount,"getTransactionCount")({address:b.address,blockTag:"pending"}),(y==="self"||y?.address&&(0,n.isAddressEqual)(y.address,b.address))&&(h.nonce+=1)),h}return Kc}var Zc={},Xp;function w2(){if(Xp)return Zc;Xp=1,Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.requestAddresses=t;const e=nt();async function t(n){return(await n.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(o=>(0,e.getAddress)(o))}return Zc}var Yc={},Qp;function P2(){if(Qp)return Yc;Qp=1,Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.requestPermissions=e;async function e(t,n){return t.request({method:"wallet_requestPermissions",params:[n]},{retryCount:0})}return Yc}var Jc={},$p;function A2(){if($p)return Jc;$p=1,Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.sendCallsSync=n;const e=Af(),t=Tf();async function n(r,o){const{chain:s=r.chain}=o,i=o.timeout??Math.max((s?.blockTime??0)*3,5e3),a=await(0,e.sendCalls)(r,o);return await(0,t.waitForCallsStatus)(r,{...o,id:a.id,timeout:i})}return Jc}var Xc={},e1;function v_(){if(e1)return Xc;e1=1,Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.sendTransactionSync=v;const e=Ie(),t=mr(),n=ue(),r=Xe(),o=Ho(),s=Yo(),i=zo(),a=dr(),c=_t(),u=me(),l=Nr(),f=vt(),b=fr(),y=y_(),h=Uo(),m=Yf(),E=new l.LruMap(128);async function v(_,P){const{account:d=_.account,chain:j=_.chain,accessList:g,authorizationList:p,blobs:T,data:w,gas:A,gasPrice:C,maxFeePerBlobGas:R,maxFeePerGas:S,maxPriorityFeePerGas:x,nonce:F,pollingInterval:M,throwOnReceiptRevert:I,type:k,value:B,...q}=P,O=P.timeout??Math.max((j?.blockTime??0)*3,5e3);if(typeof d>"u")throw new t.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransactionSync"});const H=d?(0,e.parseAccount)(d):null;try{(0,f.assertRequest)(P);const N=await(async()=>{if(P.to)return P.to;if(P.to!==null&&p&&p.length>0)return await(0,o.recoverAuthorizationAddress)({authorization:p[0]}).catch(()=>{throw new n.BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if(H?.type==="json-rpc"||H===null){let U;j!==null&&(U=await(0,u.getAction)(_,b.getChainId,"getChainId")({}),(0,s.assertCurrentChain)({currentChainId:U,chain:j}));const z=_.chain?.formatters?.transactionRequest?.format,V=(z||c.formatTransactionRequest)({...(0,a.extract)(q,{format:z}),accessList:g,account:H,authorizationList:p,blobs:T,chainId:U,data:w,gas:A,gasPrice:C,maxFeePerBlobGas:R,maxFeePerGas:S,maxPriorityFeePerGas:x,nonce:F,to:N,type:k,value:B},"sendTransaction"),J=E.get(_.uid),Z=J?"wallet_sendTransaction":"eth_sendTransaction",K=await(async()=>{try{return await _.request({method:Z,params:[V]},{retryCount:0})}catch(ie){if(J===!1)throw ie;const Y=ie;if(Y.name==="InvalidInputRpcError"||Y.name==="InvalidParamsRpcError"||Y.name==="MethodNotFoundRpcError"||Y.name==="MethodNotSupportedRpcError")return await _.request({method:"wallet_sendTransaction",params:[V]},{retryCount:0}).then(X=>(E.set(_.uid,!0),X)).catch(X=>{const ee=X;throw ee.name==="MethodNotFoundRpcError"||ee.name==="MethodNotSupportedRpcError"?(E.set(_.uid,!1),Y):ee});throw Y}})(),Q=await(0,u.getAction)(_,y.waitForTransactionReceipt,"waitForTransactionReceipt")({checkReplacement:!1,hash:K,pollingInterval:M,timeout:O});if(I&&Q.status==="reverted")throw new r.TransactionReceiptRevertedError({receipt:Q});return Q}if(H?.type==="local"){const U=await(0,u.getAction)(_,h.prepareTransactionRequest,"prepareTransactionRequest")({account:H,accessList:g,authorizationList:p,blobs:T,chain:j,data:w,gas:A,gasPrice:C,maxFeePerBlobGas:R,maxFeePerGas:S,maxPriorityFeePerGas:x,nonce:F,nonceManager:H.nonceManager,parameters:[...h.defaultParameters,"sidecars"],type:k,value:B,...q,to:N}),z=j?.serializers?.transaction,G=await H.signTransaction(U,{serializer:z});return await(0,u.getAction)(_,m.sendRawTransactionSync,"sendRawTransactionSync")({serializedTransaction:G,throwOnReceiptRevert:I,timeout:P.timeout})}throw H?.type==="smart"?new t.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new t.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransactionSync",type:H?.type})}catch(N){throw N instanceof t.AccountTypeNotSupportedError?N:(0,i.getTransactionError)(N,{...P,account:H,chain:P.chain||void 0})}}return Xc}var Qc={},t1;function T2(){if(t1)return Qc;t1=1,Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.showCallsStatus=e;async function e(t,n){const{id:r}=n;await t.request({method:"wallet_showCallsStatus",params:[r]})}return Qc}var $c={},r1;function I2(){if(r1)return $c;r1=1,Object.defineProperty($c,"__esModule",{value:!0}),$c.signAuthorization=r;const e=Ie(),t=mr(),n=__();async function r(o,s){const{account:i=o.account}=s;if(!i)throw new t.AccountNotFoundError({docsPath:"/docs/eip7702/signAuthorization"});const a=(0,e.parseAccount)(i);if(!a.signAuthorization)throw new t.AccountTypeNotSupportedError({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:a.type});const c=await(0,n.prepareAuthorization)(o,s);return a.signAuthorization(c)}return $c}var eu={},n1;function S2(){if(n1)return eu;n1=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.signMessage=r;const e=Ie(),t=mr(),n=te();async function r(o,{account:s=o.account,message:i}){if(!s)throw new t.AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const a=(0,e.parseAccount)(s);if(a.signMessage)return a.signMessage({message:i});const c=typeof i=="string"?(0,n.stringToHex)(i):i.raw instanceof Uint8Array?(0,n.toHex)(i.raw):i.raw;return o.request({method:"personal_sign",params:[c,a.address]},{retryCount:0})}return eu}var tu={},o1;function R2(){if(o1)return tu;o1=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.signTransaction=c;const e=Ie(),t=mr(),n=Yo(),r=te(),o=_t(),s=me(),i=vt(),a=fr();async function c(u,l){const{account:f=u.account,chain:b=u.chain,...y}=l;if(!f)throw new t.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTransaction"});const h=(0,e.parseAccount)(f);(0,i.assertRequest)({account:h,...l});const m=await(0,s.getAction)(u,a.getChainId,"getChainId")({});b!==null&&(0,n.assertCurrentChain)({currentChainId:m,chain:b});const v=(b?.formatters||u.chain?.formatters)?.transactionRequest?.format||o.formatTransactionRequest;return h.signTransaction?h.signTransaction({...y,chainId:m},{serializer:u.chain?.serializers?.transaction}):await u.request({method:"eth_signTransaction",params:[{...v({...y,account:h},"signTransaction"),chainId:(0,r.numberToHex)(m),from:h.address}]},{retryCount:0})}return tu}var ru={},i1;function B2(){if(i1)return ru;i1=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.signTypedData=r;const e=Ie(),t=mr(),n=Zu();async function r(o,s){const{account:i=o.account,domain:a,message:c,primaryType:u}=s;if(!i)throw new t.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTypedData"});const l=(0,e.parseAccount)(i),f={EIP712Domain:(0,n.getTypesForEIP712Domain)({domain:a}),...s.types};if((0,n.validateTypedData)({domain:a,message:c,primaryType:u,types:f}),l.signTypedData)return l.signTypedData({domain:a,message:c,primaryType:u,types:f});const b=(0,n.serializeTypedData)({domain:a,message:c,primaryType:u,types:f});return o.request({method:"eth_signTypedData_v4",params:[l.address,b]},{retryCount:0})}return ru}var nu={},a1;function O2(){if(a1)return nu;a1=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.switchChain=t;const e=te();async function t(n,{id:r}){await n.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,e.numberToHex)(r)}]},{retryCount:0})}return nu}var ou={},s1;function x2(){if(s1)return ou;s1=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.watchAsset=e;async function e(t,n){return await t.request({method:"wallet_watchAsset",params:n},{retryCount:0})}return ou}var iu={},c1;function C2(){if(c1)return iu;c1=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.writeContractSync=n;const e=v_(),t=Pf();async function n(r,o){return t.writeContract.internal(r,e.sendTransactionSync,"sendTransactionSync",o)}return iu}var u1;function E_(){if(u1)return Uc;u1=1,Object.defineProperty(Uc,"__esModule",{value:!0}),Uc.walletActions=R;const e=ff(),t=fr(),n=g2(),r=_2(),o=v2(),s=jg(),i=E2(),a=j2(),c=__(),u=Uo(),l=w2(),f=P2(),b=Af(),y=A2(),h=wf(),m=Yf(),E=Du(),v=v_(),_=T2(),P=I2(),d=S2(),j=R2(),g=B2(),p=O2(),T=Tf(),w=x2(),A=Pf(),C=C2();function R(S){return{addChain:x=>(0,n.addChain)(S,x),deployContract:x=>(0,r.deployContract)(S,x),fillTransaction:x=>(0,e.fillTransaction)(S,x),getAddresses:()=>(0,o.getAddresses)(S),getCallsStatus:x=>(0,s.getCallsStatus)(S,x),getCapabilities:x=>(0,i.getCapabilities)(S,x),getChainId:()=>(0,t.getChainId)(S),getPermissions:()=>(0,a.getPermissions)(S),prepareAuthorization:x=>(0,c.prepareAuthorization)(S,x),prepareTransactionRequest:x=>(0,u.prepareTransactionRequest)(S,x),requestAddresses:()=>(0,l.requestAddresses)(S),requestPermissions:x=>(0,f.requestPermissions)(S,x),sendCalls:x=>(0,b.sendCalls)(S,x),sendCallsSync:x=>(0,y.sendCallsSync)(S,x),sendRawTransaction:x=>(0,h.sendRawTransaction)(S,x),sendRawTransactionSync:x=>(0,m.sendRawTransactionSync)(S,x),sendTransaction:x=>(0,E.sendTransaction)(S,x),sendTransactionSync:x=>(0,v.sendTransactionSync)(S,x),showCallsStatus:x=>(0,_.showCallsStatus)(S,x),signAuthorization:x=>(0,P.signAuthorization)(S,x),signMessage:x=>(0,d.signMessage)(S,x),signTransaction:x=>(0,j.signTransaction)(S,x),signTypedData:x=>(0,g.signTypedData)(S,x),switchChain:x=>(0,p.switchChain)(S,x),waitForCallsStatus:x=>(0,T.waitForCallsStatus)(S,x),watchAsset:x=>(0,w.watchAsset)(S,x),writeContract:x=>(0,A.writeContract)(S,x),writeContractSync:x=>(0,C.writeContractSync)(S,x)}}return Uc}var d1;function q2(){if(d1)return zc;d1=1,Object.defineProperty(zc,"__esModule",{value:!0}),zc.createWalletClient=n;const e=Vu(),t=E_();function n(r){const{key:o="wallet",name:s="Wallet Client",transport:i}=r;return(0,e.createClient)({...r,key:o,name:s,transport:i,type:"walletClient"}).extend(t.walletActions)}return zc}var au={},f1;function ei(){if(f1)return au;f1=1,Object.defineProperty(au,"__esModule",{value:!0}),au.createTransport=n;const e=Mg(),t=wg();function n({key:r,methods:o,name:s,request:i,retryCount:a=3,retryDelay:c=150,timeout:u,type:l},f){const b=(0,t.uid)();return{config:{key:r,methods:o,name:s,request:i,retryCount:a,retryDelay:c,timeout:u,type:l},request:(0,e.buildRequest)(i,{methods:o,retryCount:a,retryDelay:c,uid:b}),value:f}}return au}var su={},l1;function M2(){if(l1)return su;l1=1,Object.defineProperty(su,"__esModule",{value:!0}),su.custom=t;const e=ei();function t(n,r={}){const{key:o="custom",methods:s,name:i="Custom Provider",retryDelay:a}=r;return({retryCount:c})=>(0,e.createTransport)({key:o,methods:s,name:i,request:n.request.bind(n),retryCount:r.retryCount??c,retryDelay:a,type:"custom"})}return su}var mn={},b1;function H2(){if(b1)return mn;b1=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.fallback=o,mn.shouldThrow=s,mn.rankTransports=i;const e=Vt(),t=sr(),n=jf(),r=ei();function o(a,c={}){const{key:u="fallback",name:l="Fallback",rank:f=!1,shouldThrow:b=s,retryCount:y,retryDelay:h}=c;return(({chain:m,pollingInterval:E=4e3,timeout:v,..._})=>{let P=a,d=()=>{};const j=(0,r.createTransport)({key:u,name:l,async request({method:g,params:p}){let T;const w=async(A=0)=>{const C=P[A]({..._,chain:m,retryCount:0,timeout:v});try{const R=await C.request({method:g,params:p});return d({method:g,params:p,response:R,transport:C,status:"success"}),R}catch(R){if(d({error:R,method:g,params:p,transport:C,status:"error"}),b(R)||A===P.length-1||(T??=P.slice(A+1).some(S=>{const{include:x,exclude:F}=S({chain:m}).config.methods||{};return x?x.includes(g):F?!F.includes(g):!0}),!T))throw R;return w(A+1)}};return w()},retryCount:y,retryDelay:h,type:"fallback"},{onResponse:g=>d=g,transports:P.map(g=>g({chain:m,retryCount:0}))});if(f){const g=typeof f=="object"?f:{};i({chain:m,interval:g.interval??E,onTransports:p=>P=p,ping:g.ping,sampleCount:g.sampleCount,timeout:g.timeout,transports:P,weights:g.weights})}return j})}function s(a){return!!("code"in a&&typeof a.code=="number"&&(a.code===t.TransactionRejectedRpcError.code||a.code===t.UserRejectedRequestError.code||e.ExecutionRevertedError.nodeMessage.test(a.message)||a.code===5e3))}function i({chain:a,interval:c=4e3,onTransports:u,ping:l,sampleCount:f=10,timeout:b=1e3,transports:y,weights:h={}}){const{stability:m=.7,latency:E=.3}=h,v=[],_=async()=>{const P=await Promise.all(y.map(async g=>{const p=g({chain:a,retryCount:0,timeout:b}),T=Date.now();let w,A;try{await(l?l({transport:p}):p.request({method:"net_listening"})),A=1}catch{A=0}finally{w=Date.now()}return{latency:w-T,success:A}}));v.push(P),v.length>f&&v.shift();const d=Math.max(...v.map(g=>Math.max(...g.map(({latency:p})=>p)))),j=y.map((g,p)=>{const T=v.map(S=>S[p].latency),A=1-T.reduce((S,x)=>S+x,0)/T.length/d,C=v.map(S=>S[p].success),R=C.reduce((S,x)=>S+x,0)/C.length;return R===0?[0,p]:[E*A+m*R,p]}).sort((g,p)=>p[0]-g[0]);u(j.map(([,g])=>y[g])),await(0,n.wait)(c),_()};_()}return mn}var cu={},So={},m1;function Jf(){if(m1)return So;m1=1,Object.defineProperty(So,"__esModule",{value:!0}),So.UrlRequiredError=void 0;const e=ue();class t extends e.BaseError{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}return So.UrlRequiredError=t,So}var h1;function k2(){if(h1)return cu;h1=1,Object.defineProperty(cu,"__esModule",{value:!0}),cu.http=s;const e=gt(),t=Jf(),n=pf(),r=Hf(),o=ei();function s(i,a={}){const{batch:c,fetchFn:u,fetchOptions:l,key:f="http",methods:b,name:y="HTTP JSON-RPC",onFetchRequest:h,onFetchResponse:m,retryDelay:E,raw:v}=a;return({chain:_,retryCount:P,timeout:d})=>{const{batchSize:j=1e3,wait:g=0}=typeof c=="object"?c:{},p=a.retryCount??P,T=d??a.timeout??1e4,w=i||_?.rpcUrls.default.http[0];if(!w)throw new t.UrlRequiredError;const A=(0,r.getHttpRpcClient)(w,{fetchFn:u,fetchOptions:l,onRequest:h,onResponse:m,timeout:T});return(0,o.createTransport)({key:f,methods:b,name:y,async request({method:C,params:R}){const S={method:C,params:R},{schedule:x}=(0,n.createBatchScheduler)({id:w,wait:g,shouldSplitBatch(k){return k.length>j},fn:k=>A.request({body:k}),sort:(k,B)=>k.id-B.id}),F=async k=>c?x(k):[await A.request({body:k})],[{error:M,result:I}]=await F(S);if(v)return{error:M,result:I};if(M)throw new e.RpcRequestError({body:S,error:M,url:w});return I},retryCount:p,retryDelay:E,timeout:T,type:"http"},{fetchOptions:l,url:w})}}return cu}var uu={},y1;function F2(){if(y1)return uu;y1=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.webSocket=s;const e=gt(),t=Jf(),n=Kg(),r=kf(),o=ei();function s(i,a={}){const{keepAlive:c,key:u="webSocket",methods:l,name:f="WebSocket JSON-RPC",reconnect:b,retryDelay:y}=a;return({chain:h,retryCount:m,timeout:E})=>{const v=a.retryCount??m,_=E??a.timeout??1e4,P=i||h?.rpcUrls.default.webSocket?.[0],d={keepAlive:c,reconnect:b};if(!P)throw new t.UrlRequiredError;return(0,o.createTransport)({key:u,methods:l,name:f,async request({method:j,params:g}){const p={method:j,params:g},T=await(0,r.getWebSocketRpcClient)(P,d),{error:w,result:A}=await T.requestAsync({body:p,timeout:_});if(w)throw new e.RpcRequestError({body:p,error:w,url:P});return A},retryCount:v,retryDelay:y,timeout:_,type:"webSocket"},{getSocket(){return(0,n.getSocket)(P)},getRpcClient(){return(0,r.getWebSocketRpcClient)(P,d)},async subscribe({params:j,onData:g,onError:p}){const T=await(0,r.getWebSocketRpcClient)(P,d),{result:w}=await new Promise((A,C)=>T.request({body:{method:"eth_subscribe",params:j},onError(R){C(R),p?.(R)},onResponse(R){if(R.error){C(R.error),p?.(R.error);return}if(typeof R.id=="number"){A(R);return}R.method==="eth_subscription"&&g(R.params)}}));return{subscriptionId:w,async unsubscribe(){return new Promise(A=>T.request({body:{method:"eth_unsubscribe",params:[w]},onResponse:A}))}}}})}}return uu}var Ro={},p1;function N2(){if(p1)return Ro;p1=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.ProviderRpcError=void 0;class e extends Error{constructor(n,r){super(r),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n,this.details=r}}return Ro.ProviderRpcError=e,Ro}var du={},g1;function z2(){if(g1)return du;g1=1,Object.defineProperty(du,"__esModule",{value:!0}),du.decodeDeployData=r;const e=Te(),t=ir(),n="/docs/contract/decodeDeployData";function r(o){const{abi:s,bytecode:i,data:a}=o;if(a===i)return{bytecode:i};const c=s.find(l=>"type"in l&&l.type==="constructor");if(!c)throw new e.AbiConstructorNotFoundError({docsPath:n});if(!("inputs"in c))throw new e.AbiConstructorParamsNotFoundError({docsPath:n});if(!c.inputs||c.inputs.length===0)throw new e.AbiConstructorParamsNotFoundError({docsPath:n});return{args:(0,t.decodeAbiParameters)(c.inputs,`0x${a.replace(i,"")}`),bytecode:i}}return du}var fu={},_1;function U2(){if(_1)return fu;_1=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.fromBlobs=r;const e=xo(),t=_e(),n=te();function r(o){const s=o.to??(typeof o.blobs[0]=="string"?"hex":"bytes"),i=typeof o.blobs[0]=="string"?o.blobs.map(f=>(0,t.hexToBytes)(f)):o.blobs,a=i.reduce((f,b)=>f+b.length,0),c=(0,e.createCursor)(new Uint8Array(a));let u=!0;for(const f of i){const b=(0,e.createCursor)(f);for(;u&&b.position<f.length;){b.incrementPosition(1);let y=31;f.length-b.position<31&&(y=f.length-b.position);for(const h in Array.from({length:y})){const m=b.readByte();if(m===128&&!b.inspectBytes(b.remaining).includes(128)){u=!1;break}c.pushByte(m)}}}const l=c.bytes.slice(0,c.position);return s==="hex"?(0,n.bytesToHex)(l):l}return fu}var lu={},v1;function L2(){if(v1)return lu;v1=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.sidecarsToVersionedHashes=t;const e=uf();function t(n){const{sidecars:r,version:o}=n,s=n.to??(typeof r[0].blob=="string"?"hex":"bytes"),i=[];for(const{commitment:a}of r)i.push((0,e.commitmentToVersionedHash)({commitment:a,to:s,version:o}));return i}return lu}var bu={},E1;function D2(){if(E1)return bu;E1=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.toCoinType=n;const e=Bf(),t=2147483648;function n(r){if(r===1)return 60n;if(r>=t||r<0)throw new e.EnsInvalidChainIdError({chainId:r});return BigInt((2147483648|r)>>>0)}return bu}var mu={},j1;function j_(){if(j1)return mu;j1=1,Object.defineProperty(mu,"__esModule",{value:!0}),mu.defineKzg=e;function e({blobToKzgCommitment:t,computeBlobKzgProof:n}){return{blobToKzgCommitment:t,computeBlobKzgProof:n}}return mu}var hu={},w1;function G2(){if(w1)return hu;w1=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.setupKzg=t;const e=j_();function t(n,r){try{n.loadTrustedSetup(r)}catch(o){const s=o;if(!s.message.includes("trusted setup is already loaded"))throw s}return(0,e.defineKzg)(n)}return hu}var yu={},P1;function V2(){if(P1)return yu;P1=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.compactSignatureToSignature=n;const e=_e(),t=te();function n({r,yParityAndS:o}){const s=(0,e.hexToBytes)(o),i=s[0]&128?1:0,a=s;return i===1&&(a[0]&=127),{r,s:(0,t.bytesToHex)(a),yParity:i}}return yu}var pu={},A1;function W2(){if(A1)return pu;A1=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.parseCompactSignature=n;const e=Gr(),t=te();function n(r){const{r:o,s}=e.secp256k1.Signature.fromCompact(r.slice(2,130));return{r:(0,t.numberToHex)(o,{size:32}),yParityAndS:(0,t.numberToHex)(s,{size:32})}}return pu}var gu={},T1;function K2(){if(T1)return gu;T1=1,Object.defineProperty(gu,"__esModule",{value:!0}),gu.parseSignature=n;const e=Gr(),t=te();function n(r){const{r:o,s}=e.secp256k1.Signature.fromCompact(r.slice(2,130)),i=+`0x${r.slice(130)}`,[a,c]=(()=>{if(i===0||i===1)return[void 0,i];if(i===27)return[BigInt(i),0];if(i===28)return[BigInt(i),1];throw new Error("Invalid yParityOrV value")})();return typeof a<"u"?{r:(0,t.numberToHex)(o,{size:32}),s:(0,t.numberToHex)(s,{size:32}),v:a,yParity:c}:{r:(0,t.numberToHex)(o,{size:32}),s:(0,t.numberToHex)(s,{size:32}),yParity:c}}return gu}var _u={},I1;function Z2(){if(I1)return _u;I1=1,Object.defineProperty(_u,"__esModule",{value:!0}),_u.recoverTransactionAddress=o;const e=Ze(),t=Wf(),n=Ku(),r=ur();async function o(s){const{serializedTransaction:i,signature:a}=s,c=(0,t.parseTransaction)(i),u=a??{r:c.r,s:c.s,v:c.v,yParity:c.yParity},l=(0,n.serializeTransaction)({...c,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await(0,r.recoverAddress)({hash:(0,e.keccak256)(l),signature:u})}return _u}var vu={},S1;function Y2(){if(S1)return vu;S1=1,Object.defineProperty(vu,"__esModule",{value:!0}),vu.serializeCompactSignature=n;const e=Gr(),t=Re();function n({r,yParityAndS:o}){return`0x${new e.secp256k1.Signature((0,t.hexToBigInt)(r),(0,t.hexToBigInt)(o)).toCompactHex()}`}return vu}var Eu={},R1;function J2(){if(R1)return Eu;R1=1,Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.signatureToCompactSignature=n;const e=_e(),t=te();function n(r){const{r:o,s,v:i,yParity:a}=r,c=Number(a??i-27n);let u=s;if(c===1){const l=(0,e.hexToBytes)(s);l[0]|=128,u=(0,t.bytesToHex)(l)}return{r:o,yParityAndS:u}}return Eu}var B1;function X2(){return B1||(B1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.maxInt8=e.universalSignatureValidatorByteCode=e.erc6492SignatureValidatorByteCode=e.deploylessCallViaFactoryBytecode=e.deploylessCallViaBytecodeBytecode=e.zeroHash=e.zeroAddress=e.ethAddress=e.multicall3Abi=e.universalSignatureValidatorAbi=e.erc6492SignatureValidatorAbi=e.erc4626Abi=e.erc1155Abi=e.erc721Abi=e.erc20Abi_bytes32=e.erc20Abi=e.webSocket=e.http=e.shouldThrow=e.fallback=e.custom=e.createTransport=e.walletActions=e.testActions=e.publicActions=e.createWalletClient=e.createTestClient=e.createPublicClient=e.rpcSchema=e.createClient=e.WaitForCallsStatusTimeoutError=e.getContract=e.UnknownTypeError=e.UnknownSignatureError=e.SolidityProtectedKeywordError=e.parseAbiParameters=e.parseAbiParameter=e.parseAbiItem=e.parseAbi=e.InvalidStructSignatureError=e.InvalidSignatureError=e.InvalidParenthesisError=e.InvalidParameterError=e.InvalidModifierError=e.InvalidFunctionModifierError=e.InvalidAbiTypeParameterError=e.InvalidAbiParametersError=e.InvalidAbiParameterError=e.InvalidAbiItemError=e.CircularReferenceError=void 0,e.maxUint152=e.maxUint144=e.maxUint136=e.maxUint128=e.maxUint120=e.maxUint112=e.maxUint104=e.maxUint96=e.maxUint88=e.maxUint80=e.maxUint72=e.maxUint64=e.maxUint56=e.maxUint48=e.maxUint40=e.maxUint32=e.maxUint24=e.maxUint16=e.maxUint8=e.maxInt256=e.maxInt248=e.maxInt240=e.maxInt232=e.maxInt224=e.maxInt216=e.maxInt208=e.maxInt200=e.maxInt192=e.maxInt184=e.maxInt176=e.maxInt168=e.maxInt160=e.maxInt152=e.maxInt144=e.maxInt136=e.maxInt128=e.maxInt120=e.maxInt112=e.maxInt104=e.maxInt96=e.maxInt88=e.maxInt80=e.maxInt72=e.maxInt64=e.maxInt56=e.maxInt48=e.maxInt40=e.maxInt32=e.maxInt24=e.maxInt16=void 0,e.AbiConstructorNotFoundError=e.weiUnits=e.gweiUnits=e.etherUnits=e.presignMessagePrefix=e.minInt256=e.minInt248=e.minInt240=e.minInt232=e.minInt224=e.minInt216=e.minInt208=e.minInt200=e.minInt192=e.minInt184=e.minInt176=e.minInt168=e.minInt160=e.minInt152=e.minInt144=e.minInt136=e.minInt128=e.minInt120=e.minInt112=e.minInt104=e.minInt96=e.minInt88=e.minInt80=e.minInt72=e.minInt64=e.minInt56=e.minInt48=e.minInt40=e.minInt32=e.minInt24=e.minInt16=e.minInt8=e.maxUint256=e.maxUint248=e.maxUint240=e.maxUint232=e.maxUint224=e.maxUint216=e.maxUint208=e.maxUint200=e.maxUint192=e.maxUint184=e.maxUint176=e.maxUint168=e.maxUint160=void 0,e.EnsAvatarUriResolutionError=e.EnsAvatarUnsupportedNamespaceError=e.EnsAvatarInvalidNftUriError=e.SizeOverflowError=e.InvalidHexValueError=e.InvalidHexBooleanError=e.InvalidBytesBooleanError=e.IntegerOutOfRangeError=e.SliceOffsetOutOfBoundsError=e.SizeExceedsPaddingSizeError=e.RawContractError=e.CounterfactualDeploymentFailedError=e.ContractFunctionZeroDataError=e.ContractFunctionRevertedError=e.ContractFunctionExecutionError=e.CallExecutionError=e.InvalidChainIdError=e.ClientChainNotConfiguredError=e.ChainNotFoundError=e.ChainMismatchError=e.ChainDoesNotSupportContract=e.BundleFailedError=e.BlockNotFoundError=e.setErrorConfig=e.BaseError=e.InvalidAddressError=e.UnsupportedPackedAbiType=e.InvalidDefinitionTypeError=e.InvalidArrayError=e.InvalidAbiEncodingTypeError=e.InvalidAbiDecodingTypeError=e.DecodeLogTopicsMismatch=e.DecodeLogDataMismatch=e.BytesSizeMismatchError=e.AbiFunctionSignatureNotFoundError=e.AbiFunctionOutputsNotFoundError=e.AbiFunctionNotFoundError=e.AbiEventSignatureNotFoundError=e.AbiEventSignatureEmptyTopicsError=e.AbiEventNotFoundError=e.AbiErrorSignatureNotFoundError=e.AbiErrorNotFoundError=e.AbiErrorInputsNotFoundError=e.AbiEncodingLengthMismatchError=e.AbiEncodingBytesSizeMismatchError=e.AbiEncodingArrayLengthMismatchError=e.AbiDecodingZeroDataError=e.AbiDecodingDataSizeTooSmallError=e.AbiDecodingDataSizeInvalidError=e.AbiConstructorParamsNotFoundError=void 0,e.UnsupportedProviderMethodError=e.UnsupportedNonOptionalCapabilityError=e.UnsupportedChainIdError=e.UnknownRpcError=e.UnknownBundleIdError=e.UnauthorizedProviderError=e.TransactionRejectedRpcError=e.SwitchChainError=e.RpcError=e.ResourceUnavailableRpcError=e.ResourceNotFoundRpcError=e.ProviderRpcError=e.ProviderDisconnectedError=e.ParseRpcError=e.MethodNotSupportedRpcError=e.MethodNotFoundRpcError=e.LimitExceededRpcError=e.JsonRpcVersionUnsupportedError=e.InvalidRequestRpcError=e.InvalidParamsRpcError=e.InvalidInputRpcError=e.InternalRpcError=e.DuplicateIdError=e.ChainDisconnectedError=e.BundleTooLargeError=e.AtomicReadyWalletRejectedUpgradeError=e.AtomicityNotSupportedError=e.WebSocketRequestError=e.TimeoutError=e.SocketClosedError=e.RpcRequestError=e.HttpRequestError=e.UnknownNodeError=e.TransactionTypeNotSupportedError=e.TipAboveFeeCapError=e.NonceTooLowError=e.NonceTooHighError=e.NonceMaxValueError=e.IntrinsicGasTooLowError=e.IntrinsicGasTooHighError=e.InsufficientFundsError=e.FeeCapTooLowError=e.FeeCapTooHighError=e.ExecutionRevertedError=e.FilterTypeNotSupportedError=e.MaxFeePerGasTooLowError=e.Eip1559FeesNotSupportedError=e.BaseFeeScalarError=e.EstimateGasExecutionError=e.EnsInvalidChainIdError=void 0,e.toBlobs=e.toBlobSidecars=e.sidecarsToVersionedHashes=e.fromBlobs=e.commitmentToVersionedHash=e.commitmentsToVersionedHashes=e.blobsToProofs=e.blobsToCommitments=e.isAddressEqual=e.isAddress=e.getCreateAddress=e.getCreate2Address=e.getContractAddress=e.getAddress=e.checksumAddress=e.prepareEncodeFunctionData=e.parseEventLogs=e.getAbiItem=e.encodePacked=e.encodeFunctionResult=e.encodeFunctionData=e.encodeEventTopics=e.encodeErrorResult=e.encodeDeployData=e.encodeAbiParameters=e.decodeFunctionResult=e.decodeFunctionData=e.decodeEventLog=e.decodeErrorResult=e.decodeDeployData=e.decodeAbiParameters=e.EIP1193ProviderRpcError=e.InvalidDecimalNumberError=e.InvalidStructTypeError=e.InvalidPrimaryTypeError=e.InvalidDomainError=e.UrlRequiredError=e.WaitForTransactionReceiptTimeoutError=e.TransactionReceiptNotFoundError=e.TransactionNotFoundError=e.TransactionExecutionError=e.InvalidStorageKeySizeError=e.InvalidSerializedTransactionTypeError=e.InvalidSerializedTransactionError=e.InvalidSerializableTransactionError=e.InvalidLegacyVError=e.FeeConflictError=e.StateAssignmentConflictError=e.AccountStateConflictError=e.UserRejectedRequestError=void 0,e.toCoinType=e.namehash=e.labelhash=e.toRlp=e.hexToRlp=e.bytesToRlp=e.toHex=e.stringToHex=e.numberToHex=e.bytesToHex=e.boolToHex=e.toBytes=e.stringToBytes=e.numberToBytes=e.hexToBytes=e.boolToBytes=e.fromRlp=e.hexToString=e.hexToNumber=e.hexToBool=e.hexToBigInt=e.fromHex=e.fromBytes=e.bytesToString=e.bytesToNumber=e.bytesToBool=e.bytesToBigInt=e.trim=e.sliceHex=e.sliceBytes=e.slice=e.size=e.padHex=e.padBytes=e.pad=e.isHex=e.isBytes=e.concatHex=e.concatBytes=e.concat=e.getChainContractAddress=e.extractChain=e.extendSchema=e.defineChain=e.assertCurrentChain=e.offchainLookupSignature=e.offchainLookupAbiItem=e.offchainLookup=e.ccipFetch=e.ccipRequest=void 0,e.recoverTransactionAddress=e.recoverPublicKey=e.recoverMessageAddress=e.recoverAddress=e.parseSignature=e.hexToSignature=e.parseErc8010Signature=e.parseErc6492Signature=e.parseCompactSignature=e.hexToCompactSignature=e.isErc8010Signature=e.isErc6492Signature=e.hashTypedData=e.hashStruct=e.hashDomain=e.hashMessage=e.compactSignatureToSignature=e.withTimeout=e.withRetry=e.withCache=e.nonceManager=e.createNonceManager=e.setupKzg=e.defineKzg=e.getFunctionSignature=e.toFunctionSignature=e.getFunctionSelector=e.toFunctionSelector=e.toFunctionHash=e.getEventSignature=e.toEventSignature=e.getEventSelector=e.toEventSelector=e.toEventHash=e.sha256=e.ripemd160=e.keccak256=e.isHash=e.rpcTransactionType=e.formatTransactionRequest=e.defineTransactionRequest=e.formatTransactionReceipt=e.defineTransactionReceipt=e.transactionType=e.formatTransaction=e.defineTransaction=e.formatLog=e.formatBlock=e.defineBlock=e.getContractError=void 0,e.parseUnits=e.parseGwei=e.parseEther=e.formatUnits=e.formatGwei=e.formatEther=e.validateTypedData=e.serializeTypedData=e.getTypesForEIP712Domain=e.domainSeparator=e.serializeTransaction=e.serializeAccessList=e.parseTransaction=e.getTransactionType=e.getSerializedTransactionType=e.assertTransactionLegacy=e.assertTransactionEIP2930=e.assertTransactionEIP1559=e.assertRequest=e.stringify=e.verifyTypedData=e.verifyMessage=e.verifyHash=e.toPrefixedMessage=e.signatureToCompactSignature=e.serializeSignature=e.signatureToHex=e.serializeErc8010Signature=e.serializeErc6492Signature=e.serializeCompactSignature=e.compactSignatureToHex=e.recoverTypedDataAddress=void 0;var t=rr();Object.defineProperty(e,"CircularReferenceError",{enumerable:!0,get:function(){return t.CircularReferenceError}}),Object.defineProperty(e,"InvalidAbiItemError",{enumerable:!0,get:function(){return t.InvalidAbiItemError}}),Object.defineProperty(e,"InvalidAbiParameterError",{enumerable:!0,get:function(){return t.InvalidAbiParameterError}}),Object.defineProperty(e,"InvalidAbiParametersError",{enumerable:!0,get:function(){return t.InvalidAbiParametersError}}),Object.defineProperty(e,"InvalidAbiTypeParameterError",{enumerable:!0,get:function(){return t.InvalidAbiTypeParameterError}}),Object.defineProperty(e,"InvalidFunctionModifierError",{enumerable:!0,get:function(){return t.InvalidFunctionModifierError}}),Object.defineProperty(e,"InvalidModifierError",{enumerable:!0,get:function(){return t.InvalidModifierError}}),Object.defineProperty(e,"InvalidParameterError",{enumerable:!0,get:function(){return t.InvalidParameterError}}),Object.defineProperty(e,"InvalidParenthesisError",{enumerable:!0,get:function(){return t.InvalidParenthesisError}}),Object.defineProperty(e,"InvalidSignatureError",{enumerable:!0,get:function(){return t.InvalidSignatureError}}),Object.defineProperty(e,"InvalidStructSignatureError",{enumerable:!0,get:function(){return t.InvalidStructSignatureError}}),Object.defineProperty(e,"parseAbi",{enumerable:!0,get:function(){return t.parseAbi}}),Object.defineProperty(e,"parseAbiItem",{enumerable:!0,get:function(){return t.parseAbiItem}}),Object.defineProperty(e,"parseAbiParameter",{enumerable:!0,get:function(){return t.parseAbiParameter}}),Object.defineProperty(e,"parseAbiParameters",{enumerable:!0,get:function(){return t.parseAbiParameters}}),Object.defineProperty(e,"SolidityProtectedKeywordError",{enumerable:!0,get:function(){return t.SolidityProtectedKeywordError}}),Object.defineProperty(e,"UnknownSignatureError",{enumerable:!0,get:function(){return t.UnknownSignatureError}}),Object.defineProperty(e,"UnknownTypeError",{enumerable:!0,get:function(){return t.UnknownTypeError}});var n=Kv();Object.defineProperty(e,"getContract",{enumerable:!0,get:function(){return n.getContract}});var r=Tf();Object.defineProperty(e,"WaitForCallsStatusTimeoutError",{enumerable:!0,get:function(){return r.WaitForCallsStatusTimeoutError}});var o=Vu();Object.defineProperty(e,"createClient",{enumerable:!0,get:function(){return o.createClient}}),Object.defineProperty(e,"rpcSchema",{enumerable:!0,get:function(){return o.rpcSchema}});var s=z6();Object.defineProperty(e,"createPublicClient",{enumerable:!0,get:function(){return s.createPublicClient}});var i=p2();Object.defineProperty(e,"createTestClient",{enumerable:!0,get:function(){return i.createTestClient}});var a=q2();Object.defineProperty(e,"createWalletClient",{enumerable:!0,get:function(){return a.createWalletClient}});var c=p_();Object.defineProperty(e,"publicActions",{enumerable:!0,get:function(){return c.publicActions}});var u=g_();Object.defineProperty(e,"testActions",{enumerable:!0,get:function(){return u.testActions}});var l=E_();Object.defineProperty(e,"walletActions",{enumerable:!0,get:function(){return l.walletActions}});var f=ei();Object.defineProperty(e,"createTransport",{enumerable:!0,get:function(){return f.createTransport}});var b=M2();Object.defineProperty(e,"custom",{enumerable:!0,get:function(){return b.custom}});var y=H2();Object.defineProperty(e,"fallback",{enumerable:!0,get:function(){return y.fallback}}),Object.defineProperty(e,"shouldThrow",{enumerable:!0,get:function(){return y.shouldThrow}});var h=k2();Object.defineProperty(e,"http",{enumerable:!0,get:function(){return h.http}});var m=F2();Object.defineProperty(e,"webSocket",{enumerable:!0,get:function(){return m.webSocket}});var E=lr();Object.defineProperty(e,"erc20Abi",{enumerable:!0,get:function(){return E.erc20Abi}}),Object.defineProperty(e,"erc20Abi_bytes32",{enumerable:!0,get:function(){return E.erc20Abi_bytes32}}),Object.defineProperty(e,"erc721Abi",{enumerable:!0,get:function(){return E.erc721Abi}}),Object.defineProperty(e,"erc1155Abi",{enumerable:!0,get:function(){return E.erc1155Abi}}),Object.defineProperty(e,"erc4626Abi",{enumerable:!0,get:function(){return E.erc4626Abi}}),Object.defineProperty(e,"erc6492SignatureValidatorAbi",{enumerable:!0,get:function(){return E.erc6492SignatureValidatorAbi}}),Object.defineProperty(e,"universalSignatureValidatorAbi",{enumerable:!0,get:function(){return E.erc6492SignatureValidatorAbi}}),Object.defineProperty(e,"multicall3Abi",{enumerable:!0,get:function(){return E.multicall3Abi}});var v=b_();Object.defineProperty(e,"ethAddress",{enumerable:!0,get:function(){return v.ethAddress}}),Object.defineProperty(e,"zeroAddress",{enumerable:!0,get:function(){return v.zeroAddress}});var _=Ff();Object.defineProperty(e,"zeroHash",{enumerable:!0,get:function(){return _.zeroHash}});var P=Go();Object.defineProperty(e,"deploylessCallViaBytecodeBytecode",{enumerable:!0,get:function(){return P.deploylessCallViaBytecodeBytecode}}),Object.defineProperty(e,"deploylessCallViaFactoryBytecode",{enumerable:!0,get:function(){return P.deploylessCallViaFactoryBytecode}}),Object.defineProperty(e,"erc6492SignatureValidatorByteCode",{enumerable:!0,get:function(){return P.erc6492SignatureValidatorByteCode}}),Object.defineProperty(e,"universalSignatureValidatorByteCode",{enumerable:!0,get:function(){return P.erc6492SignatureValidatorByteCode}});var d=of();Object.defineProperty(e,"maxInt8",{enumerable:!0,get:function(){return d.maxInt8}}),Object.defineProperty(e,"maxInt16",{enumerable:!0,get:function(){return d.maxInt16}}),Object.defineProperty(e,"maxInt24",{enumerable:!0,get:function(){return d.maxInt24}}),Object.defineProperty(e,"maxInt32",{enumerable:!0,get:function(){return d.maxInt32}}),Object.defineProperty(e,"maxInt40",{enumerable:!0,get:function(){return d.maxInt40}}),Object.defineProperty(e,"maxInt48",{enumerable:!0,get:function(){return d.maxInt48}}),Object.defineProperty(e,"maxInt56",{enumerable:!0,get:function(){return d.maxInt56}}),Object.defineProperty(e,"maxInt64",{enumerable:!0,get:function(){return d.maxInt64}}),Object.defineProperty(e,"maxInt72",{enumerable:!0,get:function(){return d.maxInt72}}),Object.defineProperty(e,"maxInt80",{enumerable:!0,get:function(){return d.maxInt80}}),Object.defineProperty(e,"maxInt88",{enumerable:!0,get:function(){return d.maxInt88}}),Object.defineProperty(e,"maxInt96",{enumerable:!0,get:function(){return d.maxInt96}}),Object.defineProperty(e,"maxInt104",{enumerable:!0,get:function(){return d.maxInt104}}),Object.defineProperty(e,"maxInt112",{enumerable:!0,get:function(){return d.maxInt112}}),Object.defineProperty(e,"maxInt120",{enumerable:!0,get:function(){return d.maxInt120}}),Object.defineProperty(e,"maxInt128",{enumerable:!0,get:function(){return d.maxInt128}}),Object.defineProperty(e,"maxInt136",{enumerable:!0,get:function(){return d.maxInt136}}),Object.defineProperty(e,"maxInt144",{enumerable:!0,get:function(){return d.maxInt144}}),Object.defineProperty(e,"maxInt152",{enumerable:!0,get:function(){return d.maxInt152}}),Object.defineProperty(e,"maxInt160",{enumerable:!0,get:function(){return d.maxInt160}}),Object.defineProperty(e,"maxInt168",{enumerable:!0,get:function(){return d.maxInt168}}),Object.defineProperty(e,"maxInt176",{enumerable:!0,get:function(){return d.maxInt176}}),Object.defineProperty(e,"maxInt184",{enumerable:!0,get:function(){return d.maxInt184}}),Object.defineProperty(e,"maxInt192",{enumerable:!0,get:function(){return d.maxInt192}}),Object.defineProperty(e,"maxInt200",{enumerable:!0,get:function(){return d.maxInt200}}),Object.defineProperty(e,"maxInt208",{enumerable:!0,get:function(){return d.maxInt208}}),Object.defineProperty(e,"maxInt216",{enumerable:!0,get:function(){return d.maxInt216}}),Object.defineProperty(e,"maxInt224",{enumerable:!0,get:function(){return d.maxInt224}}),Object.defineProperty(e,"maxInt232",{enumerable:!0,get:function(){return d.maxInt232}}),Object.defineProperty(e,"maxInt240",{enumerable:!0,get:function(){return d.maxInt240}}),Object.defineProperty(e,"maxInt248",{enumerable:!0,get:function(){return d.maxInt248}}),Object.defineProperty(e,"maxInt256",{enumerable:!0,get:function(){return d.maxInt256}}),Object.defineProperty(e,"maxUint8",{enumerable:!0,get:function(){return d.maxUint8}}),Object.defineProperty(e,"maxUint16",{enumerable:!0,get:function(){return d.maxUint16}}),Object.defineProperty(e,"maxUint24",{enumerable:!0,get:function(){return d.maxUint24}}),Object.defineProperty(e,"maxUint32",{enumerable:!0,get:function(){return d.maxUint32}}),Object.defineProperty(e,"maxUint40",{enumerable:!0,get:function(){return d.maxUint40}}),Object.defineProperty(e,"maxUint48",{enumerable:!0,get:function(){return d.maxUint48}}),Object.defineProperty(e,"maxUint56",{enumerable:!0,get:function(){return d.maxUint56}}),Object.defineProperty(e,"maxUint64",{enumerable:!0,get:function(){return d.maxUint64}}),Object.defineProperty(e,"maxUint72",{enumerable:!0,get:function(){return d.maxUint72}}),Object.defineProperty(e,"maxUint80",{enumerable:!0,get:function(){return d.maxUint80}}),Object.defineProperty(e,"maxUint88",{enumerable:!0,get:function(){return d.maxUint88}}),Object.defineProperty(e,"maxUint96",{enumerable:!0,get:function(){return d.maxUint96}}),Object.defineProperty(e,"maxUint104",{enumerable:!0,get:function(){return d.maxUint104}}),Object.defineProperty(e,"maxUint112",{enumerable:!0,get:function(){return d.maxUint112}}),Object.defineProperty(e,"maxUint120",{enumerable:!0,get:function(){return d.maxUint120}}),Object.defineProperty(e,"maxUint128",{enumerable:!0,get:function(){return d.maxUint128}}),Object.defineProperty(e,"maxUint136",{enumerable:!0,get:function(){return d.maxUint136}}),Object.defineProperty(e,"maxUint144",{enumerable:!0,get:function(){return d.maxUint144}}),Object.defineProperty(e,"maxUint152",{enumerable:!0,get:function(){return d.maxUint152}}),Object.defineProperty(e,"maxUint160",{enumerable:!0,get:function(){return d.maxUint160}}),Object.defineProperty(e,"maxUint168",{enumerable:!0,get:function(){return d.maxUint168}}),Object.defineProperty(e,"maxUint176",{enumerable:!0,get:function(){return d.maxUint176}}),Object.defineProperty(e,"maxUint184",{enumerable:!0,get:function(){return d.maxUint184}}),Object.defineProperty(e,"maxUint192",{enumerable:!0,get:function(){return d.maxUint192}}),Object.defineProperty(e,"maxUint200",{enumerable:!0,get:function(){return d.maxUint200}}),Object.defineProperty(e,"maxUint208",{enumerable:!0,get:function(){return d.maxUint208}}),Object.defineProperty(e,"maxUint216",{enumerable:!0,get:function(){return d.maxUint216}}),Object.defineProperty(e,"maxUint224",{enumerable:!0,get:function(){return d.maxUint224}}),Object.defineProperty(e,"maxUint232",{enumerable:!0,get:function(){return d.maxUint232}}),Object.defineProperty(e,"maxUint240",{enumerable:!0,get:function(){return d.maxUint240}}),Object.defineProperty(e,"maxUint248",{enumerable:!0,get:function(){return d.maxUint248}}),Object.defineProperty(e,"maxUint256",{enumerable:!0,get:function(){return d.maxUint256}}),Object.defineProperty(e,"minInt8",{enumerable:!0,get:function(){return d.minInt8}}),Object.defineProperty(e,"minInt16",{enumerable:!0,get:function(){return d.minInt16}}),Object.defineProperty(e,"minInt24",{enumerable:!0,get:function(){return d.minInt24}}),Object.defineProperty(e,"minInt32",{enumerable:!0,get:function(){return d.minInt32}}),Object.defineProperty(e,"minInt40",{enumerable:!0,get:function(){return d.minInt40}}),Object.defineProperty(e,"minInt48",{enumerable:!0,get:function(){return d.minInt48}}),Object.defineProperty(e,"minInt56",{enumerable:!0,get:function(){return d.minInt56}}),Object.defineProperty(e,"minInt64",{enumerable:!0,get:function(){return d.minInt64}}),Object.defineProperty(e,"minInt72",{enumerable:!0,get:function(){return d.minInt72}}),Object.defineProperty(e,"minInt80",{enumerable:!0,get:function(){return d.minInt80}}),Object.defineProperty(e,"minInt88",{enumerable:!0,get:function(){return d.minInt88}}),Object.defineProperty(e,"minInt96",{enumerable:!0,get:function(){return d.minInt96}}),Object.defineProperty(e,"minInt104",{enumerable:!0,get:function(){return d.minInt104}}),Object.defineProperty(e,"minInt112",{enumerable:!0,get:function(){return d.minInt112}}),Object.defineProperty(e,"minInt120",{enumerable:!0,get:function(){return d.minInt120}}),Object.defineProperty(e,"minInt128",{enumerable:!0,get:function(){return d.minInt128}}),Object.defineProperty(e,"minInt136",{enumerable:!0,get:function(){return d.minInt136}}),Object.defineProperty(e,"minInt144",{enumerable:!0,get:function(){return d.minInt144}}),Object.defineProperty(e,"minInt152",{enumerable:!0,get:function(){return d.minInt152}}),Object.defineProperty(e,"minInt160",{enumerable:!0,get:function(){return d.minInt160}}),Object.defineProperty(e,"minInt168",{enumerable:!0,get:function(){return d.minInt168}}),Object.defineProperty(e,"minInt176",{enumerable:!0,get:function(){return d.minInt176}}),Object.defineProperty(e,"minInt184",{enumerable:!0,get:function(){return d.minInt184}}),Object.defineProperty(e,"minInt192",{enumerable:!0,get:function(){return d.minInt192}}),Object.defineProperty(e,"minInt200",{enumerable:!0,get:function(){return d.minInt200}}),Object.defineProperty(e,"minInt208",{enumerable:!0,get:function(){return d.minInt208}}),Object.defineProperty(e,"minInt216",{enumerable:!0,get:function(){return d.minInt216}}),Object.defineProperty(e,"minInt224",{enumerable:!0,get:function(){return d.minInt224}}),Object.defineProperty(e,"minInt232",{enumerable:!0,get:function(){return d.minInt232}}),Object.defineProperty(e,"minInt240",{enumerable:!0,get:function(){return d.minInt240}}),Object.defineProperty(e,"minInt248",{enumerable:!0,get:function(){return d.minInt248}}),Object.defineProperty(e,"minInt256",{enumerable:!0,get:function(){return d.minInt256}});var j=Zg();Object.defineProperty(e,"presignMessagePrefix",{enumerable:!0,get:function(){return j.presignMessagePrefix}});var g=Co();Object.defineProperty(e,"etherUnits",{enumerable:!0,get:function(){return g.etherUnits}}),Object.defineProperty(e,"gweiUnits",{enumerable:!0,get:function(){return g.gweiUnits}}),Object.defineProperty(e,"weiUnits",{enumerable:!0,get:function(){return g.weiUnits}});var p=Te();Object.defineProperty(e,"AbiConstructorNotFoundError",{enumerable:!0,get:function(){return p.AbiConstructorNotFoundError}}),Object.defineProperty(e,"AbiConstructorParamsNotFoundError",{enumerable:!0,get:function(){return p.AbiConstructorParamsNotFoundError}}),Object.defineProperty(e,"AbiDecodingDataSizeInvalidError",{enumerable:!0,get:function(){return p.AbiDecodingDataSizeInvalidError}}),Object.defineProperty(e,"AbiDecodingDataSizeTooSmallError",{enumerable:!0,get:function(){return p.AbiDecodingDataSizeTooSmallError}}),Object.defineProperty(e,"AbiDecodingZeroDataError",{enumerable:!0,get:function(){return p.AbiDecodingZeroDataError}}),Object.defineProperty(e,"AbiEncodingArrayLengthMismatchError",{enumerable:!0,get:function(){return p.AbiEncodingArrayLengthMismatchError}}),Object.defineProperty(e,"AbiEncodingBytesSizeMismatchError",{enumerable:!0,get:function(){return p.AbiEncodingBytesSizeMismatchError}}),Object.defineProperty(e,"AbiEncodingLengthMismatchError",{enumerable:!0,get:function(){return p.AbiEncodingLengthMismatchError}}),Object.defineProperty(e,"AbiErrorInputsNotFoundError",{enumerable:!0,get:function(){return p.AbiErrorInputsNotFoundError}}),Object.defineProperty(e,"AbiErrorNotFoundError",{enumerable:!0,get:function(){return p.AbiErrorNotFoundError}}),Object.defineProperty(e,"AbiErrorSignatureNotFoundError",{enumerable:!0,get:function(){return p.AbiErrorSignatureNotFoundError}}),Object.defineProperty(e,"AbiEventNotFoundError",{enumerable:!0,get:function(){return p.AbiEventNotFoundError}}),Object.defineProperty(e,"AbiEventSignatureEmptyTopicsError",{enumerable:!0,get:function(){return p.AbiEventSignatureEmptyTopicsError}}),Object.defineProperty(e,"AbiEventSignatureNotFoundError",{enumerable:!0,get:function(){return p.AbiEventSignatureNotFoundError}}),Object.defineProperty(e,"AbiFunctionNotFoundError",{enumerable:!0,get:function(){return p.AbiFunctionNotFoundError}}),Object.defineProperty(e,"AbiFunctionOutputsNotFoundError",{enumerable:!0,get:function(){return p.AbiFunctionOutputsNotFoundError}}),Object.defineProperty(e,"AbiFunctionSignatureNotFoundError",{enumerable:!0,get:function(){return p.AbiFunctionSignatureNotFoundError}}),Object.defineProperty(e,"BytesSizeMismatchError",{enumerable:!0,get:function(){return p.BytesSizeMismatchError}}),Object.defineProperty(e,"DecodeLogDataMismatch",{enumerable:!0,get:function(){return p.DecodeLogDataMismatch}}),Object.defineProperty(e,"DecodeLogTopicsMismatch",{enumerable:!0,get:function(){return p.DecodeLogTopicsMismatch}}),Object.defineProperty(e,"InvalidAbiDecodingTypeError",{enumerable:!0,get:function(){return p.InvalidAbiDecodingTypeError}}),Object.defineProperty(e,"InvalidAbiEncodingTypeError",{enumerable:!0,get:function(){return p.InvalidAbiEncodingTypeError}}),Object.defineProperty(e,"InvalidArrayError",{enumerable:!0,get:function(){return p.InvalidArrayError}}),Object.defineProperty(e,"InvalidDefinitionTypeError",{enumerable:!0,get:function(){return p.InvalidDefinitionTypeError}}),Object.defineProperty(e,"UnsupportedPackedAbiType",{enumerable:!0,get:function(){return p.UnsupportedPackedAbiType}});var T=yt();Object.defineProperty(e,"InvalidAddressError",{enumerable:!0,get:function(){return T.InvalidAddressError}});var w=ue();Object.defineProperty(e,"BaseError",{enumerable:!0,get:function(){return w.BaseError}}),Object.defineProperty(e,"setErrorConfig",{enumerable:!0,get:function(){return w.setErrorConfig}});var A=af();Object.defineProperty(e,"BlockNotFoundError",{enumerable:!0,get:function(){return A.BlockNotFoundError}});var C=Eg();Object.defineProperty(e,"BundleFailedError",{enumerable:!0,get:function(){return C.BundleFailedError}});var R=Vo();Object.defineProperty(e,"ChainDoesNotSupportContract",{enumerable:!0,get:function(){return R.ChainDoesNotSupportContract}}),Object.defineProperty(e,"ChainMismatchError",{enumerable:!0,get:function(){return R.ChainMismatchError}}),Object.defineProperty(e,"ChainNotFoundError",{enumerable:!0,get:function(){return R.ChainNotFoundError}}),Object.defineProperty(e,"ClientChainNotConfiguredError",{enumerable:!0,get:function(){return R.ClientChainNotConfiguredError}}),Object.defineProperty(e,"InvalidChainIdError",{enumerable:!0,get:function(){return R.InvalidChainIdError}});var S=ar();Object.defineProperty(e,"CallExecutionError",{enumerable:!0,get:function(){return S.CallExecutionError}}),Object.defineProperty(e,"ContractFunctionExecutionError",{enumerable:!0,get:function(){return S.ContractFunctionExecutionError}}),Object.defineProperty(e,"ContractFunctionRevertedError",{enumerable:!0,get:function(){return S.ContractFunctionRevertedError}}),Object.defineProperty(e,"ContractFunctionZeroDataError",{enumerable:!0,get:function(){return S.ContractFunctionZeroDataError}}),Object.defineProperty(e,"CounterfactualDeploymentFailedError",{enumerable:!0,get:function(){return S.CounterfactualDeploymentFailedError}}),Object.defineProperty(e,"RawContractError",{enumerable:!0,get:function(){return S.RawContractError}});var x=Tu();Object.defineProperty(e,"SizeExceedsPaddingSizeError",{enumerable:!0,get:function(){return x.SizeExceedsPaddingSizeError}}),Object.defineProperty(e,"SliceOffsetOutOfBoundsError",{enumerable:!0,get:function(){return x.SliceOffsetOutOfBoundsError}});var F=gn();Object.defineProperty(e,"IntegerOutOfRangeError",{enumerable:!0,get:function(){return F.IntegerOutOfRangeError}}),Object.defineProperty(e,"InvalidBytesBooleanError",{enumerable:!0,get:function(){return F.InvalidBytesBooleanError}}),Object.defineProperty(e,"InvalidHexBooleanError",{enumerable:!0,get:function(){return F.InvalidHexBooleanError}}),Object.defineProperty(e,"InvalidHexValueError",{enumerable:!0,get:function(){return F.InvalidHexValueError}}),Object.defineProperty(e,"SizeOverflowError",{enumerable:!0,get:function(){return F.SizeOverflowError}});var M=Bf();Object.defineProperty(e,"EnsAvatarInvalidNftUriError",{enumerable:!0,get:function(){return M.EnsAvatarInvalidNftUriError}}),Object.defineProperty(e,"EnsAvatarUnsupportedNamespaceError",{enumerable:!0,get:function(){return M.EnsAvatarUnsupportedNamespaceError}}),Object.defineProperty(e,"EnsAvatarUriResolutionError",{enumerable:!0,get:function(){return M.EnsAvatarUriResolutionError}}),Object.defineProperty(e,"EnsInvalidChainIdError",{enumerable:!0,get:function(){return M.EnsInvalidChainIdError}});var I=ag();Object.defineProperty(e,"EstimateGasExecutionError",{enumerable:!0,get:function(){return I.EstimateGasExecutionError}});var k=No();Object.defineProperty(e,"BaseFeeScalarError",{enumerable:!0,get:function(){return k.BaseFeeScalarError}}),Object.defineProperty(e,"Eip1559FeesNotSupportedError",{enumerable:!0,get:function(){return k.Eip1559FeesNotSupportedError}}),Object.defineProperty(e,"MaxFeePerGasTooLowError",{enumerable:!0,get:function(){return k.MaxFeePerGasTooLowError}});var B=Y1();Object.defineProperty(e,"FilterTypeNotSupportedError",{enumerable:!0,get:function(){return B.FilterTypeNotSupportedError}});var q=Vt();Object.defineProperty(e,"ExecutionRevertedError",{enumerable:!0,get:function(){return q.ExecutionRevertedError}}),Object.defineProperty(e,"FeeCapTooHighError",{enumerable:!0,get:function(){return q.FeeCapTooHighError}}),Object.defineProperty(e,"FeeCapTooLowError",{enumerable:!0,get:function(){return q.FeeCapTooLowError}}),Object.defineProperty(e,"InsufficientFundsError",{enumerable:!0,get:function(){return q.InsufficientFundsError}}),Object.defineProperty(e,"IntrinsicGasTooHighError",{enumerable:!0,get:function(){return q.IntrinsicGasTooHighError}}),Object.defineProperty(e,"IntrinsicGasTooLowError",{enumerable:!0,get:function(){return q.IntrinsicGasTooLowError}}),Object.defineProperty(e,"NonceMaxValueError",{enumerable:!0,get:function(){return q.NonceMaxValueError}}),Object.defineProperty(e,"NonceTooHighError",{enumerable:!0,get:function(){return q.NonceTooHighError}}),Object.defineProperty(e,"NonceTooLowError",{enumerable:!0,get:function(){return q.NonceTooLowError}}),Object.defineProperty(e,"TipAboveFeeCapError",{enumerable:!0,get:function(){return q.TipAboveFeeCapError}}),Object.defineProperty(e,"TransactionTypeNotSupportedError",{enumerable:!0,get:function(){return q.TransactionTypeNotSupportedError}}),Object.defineProperty(e,"UnknownNodeError",{enumerable:!0,get:function(){return q.UnknownNodeError}});var O=gt();Object.defineProperty(e,"HttpRequestError",{enumerable:!0,get:function(){return O.HttpRequestError}}),Object.defineProperty(e,"RpcRequestError",{enumerable:!0,get:function(){return O.RpcRequestError}}),Object.defineProperty(e,"SocketClosedError",{enumerable:!0,get:function(){return O.SocketClosedError}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return O.TimeoutError}}),Object.defineProperty(e,"WebSocketRequestError",{enumerable:!0,get:function(){return O.WebSocketRequestError}});var H=sr();Object.defineProperty(e,"AtomicityNotSupportedError",{enumerable:!0,get:function(){return H.AtomicityNotSupportedError}}),Object.defineProperty(e,"AtomicReadyWalletRejectedUpgradeError",{enumerable:!0,get:function(){return H.AtomicReadyWalletRejectedUpgradeError}}),Object.defineProperty(e,"BundleTooLargeError",{enumerable:!0,get:function(){return H.BundleTooLargeError}}),Object.defineProperty(e,"ChainDisconnectedError",{enumerable:!0,get:function(){return H.ChainDisconnectedError}}),Object.defineProperty(e,"DuplicateIdError",{enumerable:!0,get:function(){return H.DuplicateIdError}}),Object.defineProperty(e,"InternalRpcError",{enumerable:!0,get:function(){return H.InternalRpcError}}),Object.defineProperty(e,"InvalidInputRpcError",{enumerable:!0,get:function(){return H.InvalidInputRpcError}}),Object.defineProperty(e,"InvalidParamsRpcError",{enumerable:!0,get:function(){return H.InvalidParamsRpcError}}),Object.defineProperty(e,"InvalidRequestRpcError",{enumerable:!0,get:function(){return H.InvalidRequestRpcError}}),Object.defineProperty(e,"JsonRpcVersionUnsupportedError",{enumerable:!0,get:function(){return H.JsonRpcVersionUnsupportedError}}),Object.defineProperty(e,"LimitExceededRpcError",{enumerable:!0,get:function(){return H.LimitExceededRpcError}}),Object.defineProperty(e,"MethodNotFoundRpcError",{enumerable:!0,get:function(){return H.MethodNotFoundRpcError}}),Object.defineProperty(e,"MethodNotSupportedRpcError",{enumerable:!0,get:function(){return H.MethodNotSupportedRpcError}}),Object.defineProperty(e,"ParseRpcError",{enumerable:!0,get:function(){return H.ParseRpcError}}),Object.defineProperty(e,"ProviderDisconnectedError",{enumerable:!0,get:function(){return H.ProviderDisconnectedError}}),Object.defineProperty(e,"ProviderRpcError",{enumerable:!0,get:function(){return H.ProviderRpcError}}),Object.defineProperty(e,"ResourceNotFoundRpcError",{enumerable:!0,get:function(){return H.ResourceNotFoundRpcError}}),Object.defineProperty(e,"ResourceUnavailableRpcError",{enumerable:!0,get:function(){return H.ResourceUnavailableRpcError}}),Object.defineProperty(e,"RpcError",{enumerable:!0,get:function(){return H.RpcError}}),Object.defineProperty(e,"SwitchChainError",{enumerable:!0,get:function(){return H.SwitchChainError}}),Object.defineProperty(e,"TransactionRejectedRpcError",{enumerable:!0,get:function(){return H.TransactionRejectedRpcError}}),Object.defineProperty(e,"UnauthorizedProviderError",{enumerable:!0,get:function(){return H.UnauthorizedProviderError}}),Object.defineProperty(e,"UnknownBundleIdError",{enumerable:!0,get:function(){return H.UnknownBundleIdError}}),Object.defineProperty(e,"UnknownRpcError",{enumerable:!0,get:function(){return H.UnknownRpcError}}),Object.defineProperty(e,"UnsupportedChainIdError",{enumerable:!0,get:function(){return H.UnsupportedChainIdError}}),Object.defineProperty(e,"UnsupportedNonOptionalCapabilityError",{enumerable:!0,get:function(){return H.UnsupportedNonOptionalCapabilityError}}),Object.defineProperty(e,"UnsupportedProviderMethodError",{enumerable:!0,get:function(){return H.UnsupportedProviderMethodError}}),Object.defineProperty(e,"UserRejectedRequestError",{enumerable:!0,get:function(){return H.UserRejectedRequestError}});var N=ef();Object.defineProperty(e,"AccountStateConflictError",{enumerable:!0,get:function(){return N.AccountStateConflictError}}),Object.defineProperty(e,"StateAssignmentConflictError",{enumerable:!0,get:function(){return N.StateAssignmentConflictError}});var U=Xe();Object.defineProperty(e,"FeeConflictError",{enumerable:!0,get:function(){return U.FeeConflictError}}),Object.defineProperty(e,"InvalidLegacyVError",{enumerable:!0,get:function(){return U.InvalidLegacyVError}}),Object.defineProperty(e,"InvalidSerializableTransactionError",{enumerable:!0,get:function(){return U.InvalidSerializableTransactionError}}),Object.defineProperty(e,"InvalidSerializedTransactionError",{enumerable:!0,get:function(){return U.InvalidSerializedTransactionError}}),Object.defineProperty(e,"InvalidSerializedTransactionTypeError",{enumerable:!0,get:function(){return U.InvalidSerializedTransactionTypeError}}),Object.defineProperty(e,"InvalidStorageKeySizeError",{enumerable:!0,get:function(){return U.InvalidStorageKeySizeError}}),Object.defineProperty(e,"TransactionExecutionError",{enumerable:!0,get:function(){return U.TransactionExecutionError}}),Object.defineProperty(e,"TransactionNotFoundError",{enumerable:!0,get:function(){return U.TransactionNotFoundError}}),Object.defineProperty(e,"TransactionReceiptNotFoundError",{enumerable:!0,get:function(){return U.TransactionReceiptNotFoundError}}),Object.defineProperty(e,"WaitForTransactionReceiptTimeoutError",{enumerable:!0,get:function(){return U.WaitForTransactionReceiptTimeoutError}});var z=Jf();Object.defineProperty(e,"UrlRequiredError",{enumerable:!0,get:function(){return z.UrlRequiredError}});var G=Jg();Object.defineProperty(e,"InvalidDomainError",{enumerable:!0,get:function(){return G.InvalidDomainError}}),Object.defineProperty(e,"InvalidPrimaryTypeError",{enumerable:!0,get:function(){return G.InvalidPrimaryTypeError}}),Object.defineProperty(e,"InvalidStructTypeError",{enumerable:!0,get:function(){return G.InvalidStructTypeError}});var V=s_();Object.defineProperty(e,"InvalidDecimalNumberError",{enumerable:!0,get:function(){return V.InvalidDecimalNumberError}});var J=N2();Object.defineProperty(e,"EIP1193ProviderRpcError",{enumerable:!0,get:function(){return J.ProviderRpcError}});var Z=ir();Object.defineProperty(e,"decodeAbiParameters",{enumerable:!0,get:function(){return Z.decodeAbiParameters}});var K=z2();Object.defineProperty(e,"decodeDeployData",{enumerable:!0,get:function(){return K.decodeDeployData}});var Q=Bu();Object.defineProperty(e,"decodeErrorResult",{enumerable:!0,get:function(){return Q.decodeErrorResult}});var ie=Lo();Object.defineProperty(e,"decodeEventLog",{enumerable:!0,get:function(){return ie.decodeEventLog}});var Y=gf();Object.defineProperty(e,"decodeFunctionData",{enumerable:!0,get:function(){return Y.decodeFunctionData}});var X=Kt();Object.defineProperty(e,"decodeFunctionResult",{enumerable:!0,get:function(){return X.decodeFunctionResult}});var ee=pt();Object.defineProperty(e,"encodeAbiParameters",{enumerable:!0,get:function(){return ee.encodeAbiParameters}});var ae=Wo();Object.defineProperty(e,"encodeDeployData",{enumerable:!0,get:function(){return ae.encodeDeployData}});var oe=_f();Object.defineProperty(e,"encodeErrorResult",{enumerable:!0,get:function(){return oe.encodeErrorResult}});var se=Ur();Object.defineProperty(e,"encodeEventTopics",{enumerable:!0,get:function(){return se.encodeEventTopics}});var fe=Je();Object.defineProperty(e,"encodeFunctionData",{enumerable:!0,get:function(){return fe.encodeFunctionData}});var $=vf();Object.defineProperty(e,"encodeFunctionResult",{enumerable:!0,get:function(){return $.encodeFunctionResult}});var W=Og();Object.defineProperty(e,"encodePacked",{enumerable:!0,get:function(){return W.encodePacked}});var we=Gt();Object.defineProperty(e,"getAbiItem",{enumerable:!0,get:function(){return we.getAbiItem}});var Be=Do();Object.defineProperty(e,"parseEventLogs",{enumerable:!0,get:function(){return Be.parseEventLogs}});var st=Q1();Object.defineProperty(e,"prepareEncodeFunctionData",{enumerable:!0,get:function(){return st.prepareEncodeFunctionData}});var qe=nt();Object.defineProperty(e,"checksumAddress",{enumerable:!0,get:function(){return qe.checksumAddress}}),Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return qe.getAddress}});var ct=xg();Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return ct.getContractAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return ct.getCreate2Address}}),Object.defineProperty(e,"getCreateAddress",{enumerable:!0,get:function(){return ct.getCreateAddress}});var Ge=Ye();Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return Ge.isAddress}});var xe=Et();Object.defineProperty(e,"isAddressEqual",{enumerable:!0,get:function(){return xe.isAddressEqual}});var Zt=Mu();Object.defineProperty(e,"blobsToCommitments",{enumerable:!0,get:function(){return Zt.blobsToCommitments}});var jt=Hu();Object.defineProperty(e,"blobsToProofs",{enumerable:!0,get:function(){return jt.blobsToProofs}});var ut=df();Object.defineProperty(e,"commitmentsToVersionedHashes",{enumerable:!0,get:function(){return ut.commitmentsToVersionedHashes}});var wt=uf();Object.defineProperty(e,"commitmentToVersionedHash",{enumerable:!0,get:function(){return wt.commitmentToVersionedHash}});var dt=U2();Object.defineProperty(e,"fromBlobs",{enumerable:!0,get:function(){return dt.fromBlobs}});var hr=L2();Object.defineProperty(e,"sidecarsToVersionedHashes",{enumerable:!0,get:function(){return hr.sidecarsToVersionedHashes}});var jn=ku();Object.defineProperty(e,"toBlobSidecars",{enumerable:!0,get:function(){return jn.toBlobSidecars}});var ti=bg();Object.defineProperty(e,"toBlobs",{enumerable:!0,get:function(){return ti.toBlobs}});var yr=Ef();Object.defineProperty(e,"ccipRequest",{enumerable:!0,get:function(){return yr.ccipRequest}}),Object.defineProperty(e,"ccipFetch",{enumerable:!0,get:function(){return yr.ccipRequest}}),Object.defineProperty(e,"offchainLookup",{enumerable:!0,get:function(){return yr.offchainLookup}}),Object.defineProperty(e,"offchainLookupAbiItem",{enumerable:!0,get:function(){return yr.offchainLookupAbiItem}}),Object.defineProperty(e,"offchainLookupSignature",{enumerable:!0,get:function(){return yr.offchainLookupSignature}});var ri=Yo();Object.defineProperty(e,"assertCurrentChain",{enumerable:!0,get:function(){return ri.assertCurrentChain}});var ni=Hg();Object.defineProperty(e,"defineChain",{enumerable:!0,get:function(){return ni.defineChain}}),Object.defineProperty(e,"extendSchema",{enumerable:!0,get:function(){return ni.extendSchema}});var $u=kg();Object.defineProperty(e,"extractChain",{enumerable:!0,get:function(){return $u.extractChain}});var oi=br();Object.defineProperty(e,"getChainContractAddress",{enumerable:!0,get:function(){return oi.getChainContractAddress}});var wn=Ce();Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return wn.concat}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return wn.concatBytes}}),Object.defineProperty(e,"concatHex",{enumerable:!0,get:function(){return wn.concatHex}});var ed=Of();Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return ed.isBytes}});var td=De();Object.defineProperty(e,"isHex",{enumerable:!0,get:function(){return td.isHex}});var Pn=nr();Object.defineProperty(e,"pad",{enumerable:!0,get:function(){return Pn.pad}}),Object.defineProperty(e,"padBytes",{enumerable:!0,get:function(){return Pn.padBytes}}),Object.defineProperty(e,"padHex",{enumerable:!0,get:function(){return Pn.padHex}});var rd=Ke();Object.defineProperty(e,"size",{enumerable:!0,get:function(){return rd.size}});var An=at();Object.defineProperty(e,"slice",{enumerable:!0,get:function(){return An.slice}}),Object.defineProperty(e,"sliceBytes",{enumerable:!0,get:function(){return An.sliceBytes}}),Object.defineProperty(e,"sliceHex",{enumerable:!0,get:function(){return An.sliceHex}});var nd=Dt();Object.defineProperty(e,"trim",{enumerable:!0,get:function(){return nd.trim}});var pr=$d();Object.defineProperty(e,"bytesToBigInt",{enumerable:!0,get:function(){return pr.bytesToBigInt}}),Object.defineProperty(e,"bytesToBool",{enumerable:!0,get:function(){return pr.bytesToBool}}),Object.defineProperty(e,"bytesToNumber",{enumerable:!0,get:function(){return pr.bytesToNumber}}),Object.defineProperty(e,"bytesToString",{enumerable:!0,get:function(){return pr.bytesToString}}),Object.defineProperty(e,"fromBytes",{enumerable:!0,get:function(){return pr.fromBytes}});var gr=Re();Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return gr.fromHex}}),Object.defineProperty(e,"hexToBigInt",{enumerable:!0,get:function(){return gr.hexToBigInt}}),Object.defineProperty(e,"hexToBool",{enumerable:!0,get:function(){return gr.hexToBool}}),Object.defineProperty(e,"hexToNumber",{enumerable:!0,get:function(){return gr.hexToNumber}}),Object.defineProperty(e,"hexToString",{enumerable:!0,get:function(){return gr.hexToString}});var od=Cf();Object.defineProperty(e,"fromRlp",{enumerable:!0,get:function(){return od.fromRlp}});var _r=_e();Object.defineProperty(e,"boolToBytes",{enumerable:!0,get:function(){return _r.boolToBytes}}),Object.defineProperty(e,"hexToBytes",{enumerable:!0,get:function(){return _r.hexToBytes}}),Object.defineProperty(e,"numberToBytes",{enumerable:!0,get:function(){return _r.numberToBytes}}),Object.defineProperty(e,"stringToBytes",{enumerable:!0,get:function(){return _r.stringToBytes}}),Object.defineProperty(e,"toBytes",{enumerable:!0,get:function(){return _r.toBytes}});var vr=te();Object.defineProperty(e,"boolToHex",{enumerable:!0,get:function(){return vr.boolToHex}}),Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return vr.bytesToHex}}),Object.defineProperty(e,"numberToHex",{enumerable:!0,get:function(){return vr.numberToHex}}),Object.defineProperty(e,"stringToHex",{enumerable:!0,get:function(){return vr.stringToHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return vr.toHex}});var Tn=Mo();Object.defineProperty(e,"bytesToRlp",{enumerable:!0,get:function(){return Tn.bytesToRlp}}),Object.defineProperty(e,"hexToRlp",{enumerable:!0,get:function(){return Tn.hexToRlp}}),Object.defineProperty(e,"toRlp",{enumerable:!0,get:function(){return Tn.toRlp}});var id=Ag();Object.defineProperty(e,"labelhash",{enumerable:!0,get:function(){return id.labelhash}});var ad=Sf();Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return ad.namehash}});var In=D2();Object.defineProperty(e,"toCoinType",{enumerable:!0,get:function(){return In.toCoinType}});var sd=cr();Object.defineProperty(e,"getContractError",{enumerable:!0,get:function(){return sd.getContractError}});var ii=Cu();Object.defineProperty(e,"defineBlock",{enumerable:!0,get:function(){return ii.defineBlock}}),Object.defineProperty(e,"formatBlock",{enumerable:!0,get:function(){return ii.formatBlock}});var cd=Wt();Object.defineProperty(e,"formatLog",{enumerable:!0,get:function(){return cd.formatLog}});var Sn=vn();Object.defineProperty(e,"defineTransaction",{enumerable:!0,get:function(){return Sn.defineTransaction}}),Object.defineProperty(e,"formatTransaction",{enumerable:!0,get:function(){return Sn.formatTransaction}}),Object.defineProperty(e,"transactionType",{enumerable:!0,get:function(){return Sn.transactionType}});var ai=Jo();Object.defineProperty(e,"defineTransactionReceipt",{enumerable:!0,get:function(){return ai.defineTransactionReceipt}}),Object.defineProperty(e,"formatTransactionReceipt",{enumerable:!0,get:function(){return ai.formatTransactionReceipt}});var Kr=_t();Object.defineProperty(e,"defineTransactionRequest",{enumerable:!0,get:function(){return Kr.defineTransactionRequest}}),Object.defineProperty(e,"formatTransactionRequest",{enumerable:!0,get:function(){return Kr.formatTransactionRequest}}),Object.defineProperty(e,"rpcTransactionType",{enumerable:!0,get:function(){return Kr.rpcTransactionType}});var ud=qf();Object.defineProperty(e,"isHash",{enumerable:!0,get:function(){return ud.isHash}});var dd=Ze();Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return dd.keccak256}});var fd=Ng();Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return fd.ripemd160}});var ld=cf();Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return ld.sha256}});var bd=zg();Object.defineProperty(e,"toEventHash",{enumerable:!0,get:function(){return bd.toEventHash}});var si=_n();Object.defineProperty(e,"toEventSelector",{enumerable:!0,get:function(){return si.toEventSelector}}),Object.defineProperty(e,"getEventSelector",{enumerable:!0,get:function(){return si.toEventSelector}});var Xf=Ug();Object.defineProperty(e,"toEventSignature",{enumerable:!0,get:function(){return Xf.toEventSignature}}),Object.defineProperty(e,"getEventSignature",{enumerable:!0,get:function(){return Xf.toEventSignature}});var T_=Lg();Object.defineProperty(e,"toFunctionHash",{enumerable:!0,get:function(){return T_.toFunctionHash}});var Qf=zr();Object.defineProperty(e,"toFunctionSelector",{enumerable:!0,get:function(){return Qf.toFunctionSelector}}),Object.defineProperty(e,"getFunctionSelector",{enumerable:!0,get:function(){return Qf.toFunctionSelector}});var $f=Dg();Object.defineProperty(e,"toFunctionSignature",{enumerable:!0,get:function(){return $f.toFunctionSignature}}),Object.defineProperty(e,"getFunctionSignature",{enumerable:!0,get:function(){return $f.toFunctionSignature}});var I_=j_();Object.defineProperty(e,"defineKzg",{enumerable:!0,get:function(){return I_.defineKzg}});var S_=G2();Object.defineProperty(e,"setupKzg",{enumerable:!0,get:function(){return S_.setupKzg}});var el=Gg();Object.defineProperty(e,"createNonceManager",{enumerable:!0,get:function(){return el.createNonceManager}}),Object.defineProperty(e,"nonceManager",{enumerable:!0,get:function(){return el.nonceManager}});var R_=_g();Object.defineProperty(e,"withCache",{enumerable:!0,get:function(){return R_.withCache}});var B_=Gu();Object.defineProperty(e,"withRetry",{enumerable:!0,get:function(){return B_.withRetry}});var O_=Mf();Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return O_.withTimeout}});var x_=V2();Object.defineProperty(e,"compactSignatureToSignature",{enumerable:!0,get:function(){return x_.compactSignatureToSignature}});var C_=Xo();Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return C_.hashMessage}});var md=Qo();Object.defineProperty(e,"hashDomain",{enumerable:!0,get:function(){return md.hashDomain}}),Object.defineProperty(e,"hashStruct",{enumerable:!0,get:function(){return md.hashStruct}}),Object.defineProperty(e,"hashTypedData",{enumerable:!0,get:function(){return md.hashTypedData}});var q_=Nf();Object.defineProperty(e,"isErc6492Signature",{enumerable:!0,get:function(){return q_.isErc6492Signature}});var M_=Lf();Object.defineProperty(e,"isErc8010Signature",{enumerable:!0,get:function(){return M_.isErc8010Signature}});var tl=W2();Object.defineProperty(e,"hexToCompactSignature",{enumerable:!0,get:function(){return tl.parseCompactSignature}}),Object.defineProperty(e,"parseCompactSignature",{enumerable:!0,get:function(){return tl.parseCompactSignature}});var H_=e_();Object.defineProperty(e,"parseErc6492Signature",{enumerable:!0,get:function(){return H_.parseErc6492Signature}});var k_=t_();Object.defineProperty(e,"parseErc8010Signature",{enumerable:!0,get:function(){return k_.parseErc8010Signature}});var rl=K2();Object.defineProperty(e,"hexToSignature",{enumerable:!0,get:function(){return rl.parseSignature}}),Object.defineProperty(e,"parseSignature",{enumerable:!0,get:function(){return rl.parseSignature}});var F_=ur();Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return F_.recoverAddress}});var N_=Df();Object.defineProperty(e,"recoverMessageAddress",{enumerable:!0,get:function(){return N_.recoverMessageAddress}});var z_=rf();Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return z_.recoverPublicKey}});var U_=Z2();Object.defineProperty(e,"recoverTransactionAddress",{enumerable:!0,get:function(){return U_.recoverTransactionAddress}});var L_=Gf();Object.defineProperty(e,"recoverTypedDataAddress",{enumerable:!0,get:function(){return L_.recoverTypedDataAddress}});var nl=Y2();Object.defineProperty(e,"compactSignatureToHex",{enumerable:!0,get:function(){return nl.serializeCompactSignature}}),Object.defineProperty(e,"serializeCompactSignature",{enumerable:!0,get:function(){return nl.serializeCompactSignature}});var D_=r_();Object.defineProperty(e,"serializeErc6492Signature",{enumerable:!0,get:function(){return D_.serializeErc6492Signature}});var G_=n_();Object.defineProperty(e,"serializeErc8010Signature",{enumerable:!0,get:function(){return G_.serializeErc8010Signature}});var ol=m_();Object.defineProperty(e,"signatureToHex",{enumerable:!0,get:function(){return ol.serializeSignature}}),Object.defineProperty(e,"serializeSignature",{enumerable:!0,get:function(){return ol.serializeSignature}});var V_=J2();Object.defineProperty(e,"signatureToCompactSignature",{enumerable:!0,get:function(){return V_.signatureToCompactSignature}});var W_=Yg();Object.defineProperty(e,"toPrefixedMessage",{enumerable:!0,get:function(){return W_.toPrefixedMessage}});var K_=o_();Object.defineProperty(e,"verifyHash",{enumerable:!0,get:function(){return K_.verifyHash}});var Z_=i_();Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return Z_.verifyMessage}});var Y_=a_();Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return Y_.verifyTypedData}});var J_=He();Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return J_.stringify}});var X_=vt();Object.defineProperty(e,"assertRequest",{enumerable:!0,get:function(){return X_.assertRequest}});var hd=Wu();Object.defineProperty(e,"assertTransactionEIP1559",{enumerable:!0,get:function(){return hd.assertTransactionEIP1559}}),Object.defineProperty(e,"assertTransactionEIP2930",{enumerable:!0,get:function(){return hd.assertTransactionEIP2930}}),Object.defineProperty(e,"assertTransactionLegacy",{enumerable:!0,get:function(){return hd.assertTransactionLegacy}});var Q_=Vf();Object.defineProperty(e,"getSerializedTransactionType",{enumerable:!0,get:function(){return Q_.getSerializedTransactionType}});var $_=Fu();Object.defineProperty(e,"getTransactionType",{enumerable:!0,get:function(){return $_.getTransactionType}});var ev=Wf();Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return ev.parseTransaction}});var tv=xf();Object.defineProperty(e,"serializeAccessList",{enumerable:!0,get:function(){return tv.serializeAccessList}});var rv=Ku();Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return rv.serializeTransaction}});var ci=Zu();Object.defineProperty(e,"domainSeparator",{enumerable:!0,get:function(){return ci.domainSeparator}}),Object.defineProperty(e,"getTypesForEIP712Domain",{enumerable:!0,get:function(){return ci.getTypesForEIP712Domain}}),Object.defineProperty(e,"serializeTypedData",{enumerable:!0,get:function(){return ci.serializeTypedData}}),Object.defineProperty(e,"validateTypedData",{enumerable:!0,get:function(){return ci.validateTypedData}});var nv=qo();Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return nv.formatEther}});var ov=Lr();Object.defineProperty(e,"formatGwei",{enumerable:!0,get:function(){return ov.formatGwei}});var iv=Ou();Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return iv.formatUnits}});var av=c_();Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return av.parseEther}});var sv=u_();Object.defineProperty(e,"parseGwei",{enumerable:!0,get:function(){return sv.parseGwei}});var cv=Xu();Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return cv.parseUnits}})})(vd)),vd}var Mr={},O1;function Q2(){if(O1)return Mr;O1=1,Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.MAGIC_VALUE_BYTES=Mr.MAGIC_VALUE=void 0;const e="0x1626ba7e";Mr.MAGIC_VALUE=e;const t="0x20c13b0b";return Mr.MAGIC_VALUE_BYTES=t,Mr}var ju={},Bo={},Hr={},x1;function w_(){if(x1)return Hr;x1=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.PermissionsError=Hr.PERMISSIONS_REQUEST_REJECTED=void 0,Hr.PERMISSIONS_REQUEST_REJECTED=4001;class e extends Error{constructor(n,r,o){super(n),this.code=r,this.data=o,Object.setPrototypeOf(this,e.prototype)}}return Hr.PermissionsError=e,Hr}var C1;function P_(){if(C1)return Bo;C1=1,Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.Wallet=void 0;const e=Fr(),t=w_();class n{constructor(o){this.communicator=o}async getPermissions(){return(await this.communicator.send(e.Methods.wallet_getPermissions,void 0)).data}async requestPermissions(o){if(!this.isPermissionRequestValid(o))throw new t.PermissionsError("Permissions request is invalid",t.PERMISSIONS_REQUEST_REJECTED);try{return(await this.communicator.send(e.Methods.wallet_requestPermissions,o)).data}catch{throw new t.PermissionsError("Permissions rejected",t.PERMISSIONS_REQUEST_REJECTED)}}isPermissionRequestValid(o){return o.every(s=>typeof s=="object"?Object.keys(s).every(i=>!!Object.values(e.RestrictedMethods).includes(i)):!1)}}return Bo.Wallet=n,Bo}var q1;function $2(){if(q1)return ju;q1=1,Object.defineProperty(ju,"__esModule",{value:!0});const e=P_(),t=w_(),n=(o,s)=>s.some(i=>i.parentCapability===o),r=()=>(o,s,i)=>{const a=i.value;return i.value=async function(){const c=new e.Wallet(this.communicator);let u=await c.getPermissions();if(n(s,u)||(u=await c.requestPermissions([{[s]:{}}])),!n(s,u))throw new t.PermissionsError("Permissions rejected",t.PERMISSIONS_REQUEST_REJECTED);return a.apply(this)},i};return ju.default=r,ju}var M1;function e5(){if(M1)return Rt;M1=1;var e=Rt&&Rt.__decorate||function(u,l,f,b){var y=arguments.length,h=y<3?l:b===null?b=Object.getOwnPropertyDescriptor(l,f):b,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(u,l,f,b);else for(var E=u.length-1;E>=0;E--)(m=u[E])&&(h=(y<3?m(h):y>3?m(l,f,h):m(l,f))||h);return y>3&&h&&Object.defineProperty(l,f,h),h},t=Rt&&Rt.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.Safe=void 0;const n=X2(),r=Q2(),o=Fr(),s=Zd(),i=Kd(),a=t($2());class c{constructor(l){this.communicator=l}async getChainInfo(){return(await this.communicator.send(o.Methods.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(o.Methods.getSafeInfo,void 0)).data}async experimental_getBalances({currency:l="usd"}={}){return(await this.communicator.send(o.Methods.getSafeBalances,{currency:l})).data}async check1271Signature(l,f="0x"){const b=await this.getInfo(),y=(0,n.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[l,f]}),h={call:s.RPC_CALLS.eth_call,params:[{to:b.safeAddress,data:y},"latest"]};try{return(await this.communicator.send(o.Methods.rpcCall,h)).data.slice(0,10).toLowerCase()===r.MAGIC_VALUE}catch{return!1}}async check1271SignatureBytes(l,f="0x"){const b=await this.getInfo(),y=(0,n.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[l,f]}),h={call:s.RPC_CALLS.eth_call,params:[{to:b.safeAddress,data:y},"latest"]};try{return(await this.communicator.send(o.Methods.rpcCall,h)).data.slice(0,10).toLowerCase()===r.MAGIC_VALUE_BYTES}catch{return!1}}calculateMessageHash(l){return(0,n.hashMessage)(l)}calculateTypedMessageHash(l){const f=typeof l.domain.chainId=="object"?l.domain.chainId.toNumber():Number(l.domain.chainId);let b=l.primaryType;if(!b){const y=Object.values(l.types),h=Object.keys(l.types).filter(m=>y.every(E=>E.every(({type:v})=>v.replace("[","").replace("]","")!==m)));if(h.length===0||h.length>1)throw new Error("Please specify primaryType");b=h[0]}return(0,n.hashTypedData)({message:l.message,domain:{...l.domain,chainId:f,verifyingContract:l.domain.verifyingContract,salt:l.domain.salt},types:l.types,primaryType:b})}async getOffChainSignature(l){return(await this.communicator.send(o.Methods.getOffChainSignature,l)).data}async isMessageSigned(l,f="0x"){let b;if(typeof l=="string"&&(b=async()=>{const y=this.calculateMessageHash(l);return await this.isMessageHashSigned(y,f)}),(0,i.isObjectEIP712TypedData)(l)&&(b=async()=>{const y=this.calculateTypedMessageHash(l);return await this.isMessageHashSigned(y,f)}),b)return await b();throw new Error("Invalid message type")}async isMessageHashSigned(l,f="0x"){const b=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const y of b)if(await y(l,f))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(o.Methods.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(o.Methods.requestAddressBook,void 0)).data}}return Rt.Safe=c,e([(0,a.default)()],c.prototype,"requestAddressBook",null),Rt}var H1;function k1(){if(H1)return Zr;H1=1;var e=Zr&&Zr.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Zr,"__esModule",{value:!0});const t=e(gv()),n=wv(),r=Pv(),o=e5(),s=P_();class i{constructor(c={}){const{allowedDomains:u=null,debug:l=!1}=c;this.communicator=new t.default(u,l),this.eth=new r.Eth(this.communicator),this.txs=new n.TXs(this.communicator),this.safe=new o.Safe(this.communicator),this.wallet=new s.Wallet(this.communicator)}}return Zr.default=i,Zr}var F1;function t5(){return F1||(F1=1,(function(e){var t=St&&St.__createBinding||(Object.create?(function(i,a,c,u){u===void 0&&(u=c);var l=Object.getOwnPropertyDescriptor(a,c);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(i,u,l)}):(function(i,a,c,u){u===void 0&&(u=c),i[u]=a[c]})),n=St&&St.__exportStar||function(i,a){for(var c in i)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&t(a,i,c)},r=St&&St.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.getSDKVersion=void 0;const o=r(k1());e.default=o.default,n(k1(),e),n(Kd(),e),n(Fr(),e),n(D1(),e);var s=L1();Object.defineProperty(e,"getSDKVersion",{enumerable:!0,get:function(){return s.getSDKVersion}}),n(Zd(),e)})(St)),St}var kr={},N1;function r5(){if(N1)return kr;N1=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.numberToHex=kr.getLowerCase=void 0;function e(n){return n&&n.toLowerCase()}kr.getLowerCase=e;function t(n){return`0x${n.toString(16)}`}return kr.numberToHex=t,kr}var z1;function n5(){if(z1)return Rn;z1=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.SafeAppProvider=void 0;const e=t5(),t=lv(),n=r5();class r extends t.EventEmitter{constructor(s,i){super(),this.submittedTxs=new Map,this.safe=s,this.sdk=i}async connect(){this.emit("connect",{chainId:this.chainId})}async disconnect(){}get chainId(){return this.safe.chainId}async request(s){const{method:i,params:a=[]}=s;switch(i){case"eth_accounts":return[this.safe.safeAddress];case"net_version":case"eth_chainId":return(0,n.numberToHex)(this.chainId);case"personal_sign":{const[b,y]=a;if(this.safe.safeAddress.toLowerCase()!==y.toLowerCase())throw new Error("The address or message hash is invalid");const h=await this.sdk.txs.signMessage(b);return("signature"in h?h.signature:void 0)||"0x"}case"eth_sign":{const[b,y]=a;if(this.safe.safeAddress.toLowerCase()!==b.toLowerCase()||!y.startsWith("0x"))throw new Error("The address or message hash is invalid");const h=await this.sdk.txs.signMessage(y);return("signature"in h?h.signature:void 0)||"0x"}case"eth_signTypedData":case"eth_signTypedData_v4":{const[b,y]=a,h=typeof y=="string"?JSON.parse(y):y;if(this.safe.safeAddress.toLowerCase()!==b.toLowerCase())throw new Error("The address is invalid");const m=await this.sdk.txs.signTypedMessage(h);return("signature"in m?m.signature:void 0)||"0x"}case"eth_sendTransaction":const c={...a[0],value:a[0].value||"0",data:a[0].data||"0x"};typeof c.gas=="string"&&c.gas.startsWith("0x")&&(c.gas=parseInt(c.gas,16));const u=await this.sdk.txs.send({txs:[c],params:{safeTxGas:c.gas}});return this.submittedTxs.set(u.safeTxHash,{from:this.safe.safeAddress,hash:u.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:c.data,value:c.value,to:c.to,blockHash:null,blockNumber:null,transactionIndex:null}),u.safeTxHash;case"eth_blockNumber":return(await this.sdk.eth.getBlockByNumber(["latest"])).number;case"eth_getBalance":return this.sdk.eth.getBalance([(0,n.getLowerCase)(a[0]),a[1]]);case"eth_getCode":return this.sdk.eth.getCode([(0,n.getLowerCase)(a[0]),a[1]]);case"eth_getTransactionCount":return this.sdk.eth.getTransactionCount([(0,n.getLowerCase)(a[0]),a[1]]);case"eth_getStorageAt":return this.sdk.eth.getStorageAt([(0,n.getLowerCase)(a[0]),a[1],a[2]]);case"eth_getBlockByNumber":return this.sdk.eth.getBlockByNumber([a[0],a[1]]);case"eth_getBlockByHash":return this.sdk.eth.getBlockByHash([a[0],a[1]]);case"eth_getTransactionByHash":let f=a[0];try{f=(await this.sdk.txs.getBySafeTxHash(f)).txHash||f}catch{}return this.submittedTxs.has(f)?this.submittedTxs.get(f):this.sdk.eth.getTransactionByHash([f]).then(b=>(b&&(b.hash=a[0]),b));case"eth_getTransactionReceipt":{let b=a[0];try{b=(await this.sdk.txs.getBySafeTxHash(b)).txHash||b}catch{}return this.sdk.eth.getTransactionReceipt([b]).then(y=>(y&&(y.transactionHash=a[0]),y))}case"eth_estimateGas":return this.sdk.eth.getEstimateGas(a[0]);case"eth_call":return this.sdk.eth.call([a[0],a[1]]);case"eth_getLogs":return this.sdk.eth.getPastLogs([a[0]]);case"eth_gasPrice":return this.sdk.eth.getGasPrice();case"wallet_getPermissions":return this.sdk.wallet.getPermissions();case"wallet_requestPermissions":return this.sdk.wallet.requestPermissions(a[0]);case"safe_setSettings":return this.sdk.eth.setSafeSettings([a[0]]);case"wallet_sendCalls":{const{from:b,calls:y,chainId:h}=a[0];if(h!==(0,n.numberToHex)(this.chainId))throw new Error(`Safe is not on chain ${h}`);if(b!==this.safe.safeAddress)throw Error("Invalid from address");const m=y.map((_,P)=>{if(!_.to)throw new Error(`Invalid call #${P}: missing "to" field`);return{to:_.to,data:_.data??"0x",value:_.value??(0,n.numberToHex)(0)}}),{safeTxHash:E}=await this.sdk.txs.send({txs:m});return{id:E}}case"wallet_getCallsStatus":{const b=a[0],y={[e.TransactionStatus.AWAITING_CONFIRMATIONS]:100,[e.TransactionStatus.AWAITING_EXECUTION]:100,[e.TransactionStatus.SUCCESS]:200,[e.TransactionStatus.CANCELLED]:400,[e.TransactionStatus.FAILED]:500},h=await this.sdk.txs.getBySafeTxHash(b),m={version:"1.0",id:b,chainId:(0,n.numberToHex)(this.chainId),status:y[h.txStatus]};if(!h.txHash)return m;const E=await this.sdk.eth.getTransactionReceipt([h.txHash]);if(!E)return m;const v=h.txData?.dataDecoded?.method!=="multiSend"?1:h.txData.dataDecoded.parameters?.[0].valueDecoded?.length??1,_=Number(E.blockNumber),P=Number(E.gasUsed);return m.receipts=Array(v).fill({logs:E.logs,status:(0,n.numberToHex)(h.txStatus===e.TransactionStatus.SUCCESS?1:0),blockHash:E.blockHash,blockNumber:(0,n.numberToHex)(_),gasUsed:(0,n.numberToHex)(P),transactionHash:h.txHash}),m}case"wallet_showCallsStatus":throw new Error(`"${s.method}" not supported`);case"wallet_getCapabilities":return{[(0,n.numberToHex)(this.chainId)]:{atomicBatch:{supported:!0}}};default:throw Error(`"${s.method}" not implemented`)}}send(s,i){s||i("Undefined request"),this.request(s).then(a=>i(null,{jsonrpc:"2.0",id:s.id,result:a})).catch(a=>i(a,null))}}return Rn.SafeAppProvider=r,Rn}var U1;function o5(){return U1||(U1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SafeAppProvider=void 0;var t=n5();Object.defineProperty(e,"SafeAppProvider",{enumerable:!0,get:function(){return t.SafeAppProvider}})})(yd)),yd}var A_=o5();const i5=dv(A_),u5=bv({__proto__:null,default:i5},[A_]);export{u5 as i};