@dcl/blog-site 0.2.2-23649734878.commit-de1a383 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/assets/{add-zf09jsz8.js → add-Dnkf3E3Q.js} +1 -1
  2. package/assets/{all-wallets-tVLLlnWi.js → all-wallets-C5N9p7Oh.js} +1 -1
  3. package/assets/{app-store-C64E-ygN.js → app-store-C9FH4_zP.js} +1 -1
  4. package/assets/{apple-B11br0RG.js → apple-Dm5w1W69.js} +1 -1
  5. package/assets/{arrow-bottom-DifqQKT2.js → arrow-bottom-CXaxVEeb.js} +1 -1
  6. package/assets/{arrow-bottom-circle-BYISwBN-.js → arrow-bottom-circle-Bgw9yiHN.js} +1 -1
  7. package/assets/{arrow-left-DTR_KHWL.js → arrow-left-pgI3hg3C.js} +1 -1
  8. package/assets/{arrow-right-DU6_D0VV.js → arrow-right-CyKp2yFa.js} +1 -1
  9. package/assets/{arrow-top-B_CgJVlG.js → arrow-top-B2waxVPx.js} +1 -1
  10. package/assets/{auto-track-BxXPoe4g.js → auto-track-BvFI9h3i.js} +1 -1
  11. package/assets/{bank-q4oLVSZ1.js → bank-qNUWniDB.js} +1 -1
  12. package/assets/{basic-CGdBHVeA.js → basic-DJvhbg9L.js} +1 -1
  13. package/assets/{biconomy-6NHz5Iqa.js → biconomy-DZsFbmF0.js} +1 -1
  14. package/assets/{browser-BH_NdFte.js → browser-Du0KKb8R.js} +1 -1
  15. package/assets/{card-CU8Sx8aZ.js → card-BpDAuOwe.js} +1 -1
  16. package/assets/{ccip-BfmMG-TS.js → ccip-CpLmER95.js} +1 -1
  17. package/assets/{checkmark-bold-yZPChLqH.js → checkmark-bold-BYtPga6u.js} +1 -1
  18. package/assets/{checkmark-CJQv14xB.js → checkmark-srdyV91l.js} +1 -1
  19. package/assets/{chevron-bottom-DTs-26Eq.js → chevron-bottom-C2aa3E9i.js} +1 -1
  20. package/assets/{chevron-left-CWQcI0TP.js → chevron-left-jGoftk_A.js} +1 -1
  21. package/assets/{chevron-right-zjZwGM3P.js → chevron-right-Dt6SfcNy.js} +1 -1
  22. package/assets/{chevron-top-DiPqYm2O.js → chevron-top-CBCgyIVe.js} +1 -1
  23. package/assets/{chrome-store-uudWD7dl.js → chrome-store-D-UYtj15.js} +1 -1
  24. package/assets/{clock-BtHKgq8x.js → clock-BGyfn2Ix.js} +1 -1
  25. package/assets/{close-C0UXp_W-.js → close-BQpWkcd5.js} +1 -1
  26. package/assets/{coinPlaceholder-4wrqCYAs.js → coinPlaceholder-o1yCmFLN.js} +1 -1
  27. package/assets/{compass-DfOzkjuQ.js → compass-BrX88OdU.js} +1 -1
  28. package/assets/{controller-zOLBxAda.js → controller-BW9fJMCh.js} +2 -2
  29. package/assets/{copy-BDn55LjS.js → copy-CGKLgPMf.js} +1 -1
  30. package/assets/{core-FalccOZQ.js → core-f4taWsy5.js} +4 -4
  31. package/assets/{createBundlerClient-ceEjCqsz.js → createBundlerClient-r1Kofl9Y.js} +1 -1
  32. package/assets/cursor-l_ly71I2.js +3 -0
  33. package/assets/{cursor-transparent-B0-Mw3Y1.js → cursor-transparent--gaS-5ET.js} +1 -1
  34. package/assets/{decimals-BBBuCBiH.js → decimals-BB5yEnWu.js} +1 -1
  35. package/assets/{decimals-DrdfxUxV.js → decimals-D7yTLBH-.js} +1 -1
  36. package/assets/{desktop-Cm0fPOoG.js → desktop-D3dzP-FX.js} +1 -1
  37. package/assets/{detectExtension-CTJS_83C.js → detectExtension-BOyq5ueD.js} +1 -1
  38. package/assets/{disconnect-BuA91iia.js → disconnect-CsHX0nla.js} +1 -1
  39. package/assets/{discord-CEAkeZ_H.js → discord-TnXCJHRv.js} +1 -1
  40. package/assets/{engine-1bZj5J3h.js → engine-COatTZhI.js} +1 -1
  41. package/assets/{estimate-l1-fee-C9trXYSy.js → estimate-l1-fee-gm3XrWSf.js} +1 -1
  42. package/assets/eth_estimateGas-A6ba-Fl3.js +1 -0
  43. package/assets/{eth_getStorageAt-D6adTFW0.js → eth_getStorageAt-DiqyV3Wq.js} +1 -1
  44. package/assets/{eth_getTransactionCount-BIhOSWd4.js → eth_getTransactionCount-CF50onAO.js} +1 -1
  45. package/assets/{etherscan-WCjozDmo.js → etherscan-BNOTAlpJ.js} +1 -1
  46. package/assets/{events-BSf9wyey.js → events-CjOrSHaz.js} +1 -1
  47. package/assets/{exclamation-triangle-CXoNKPez.js → exclamation-triangle-3cTnBFEz.js} +1 -1
  48. package/assets/{extension-BszEBTVU.js → extension-C7i3kBcJ.js} +1 -1
  49. package/assets/{external-link-Dd_ZWmsS.js → external-link-C6RRSRES.js} +1 -1
  50. package/assets/{extractIPFS-GqdL13gj.js → extractIPFS-BchHnCEN.js} +1 -1
  51. package/assets/{facebook-4SsNdpO8.js → facebook-BtRXxuTh.js} +1 -1
  52. package/assets/{farcaster-ayvvFuu8.js → farcaster-DuvCkOsj.js} +1 -1
  53. package/assets/{fetchTokenMetadata-BVwYMovl.js → fetchTokenMetadata-ClRC5ORW.js} +2 -2
  54. package/assets/{filters-CaJPoSbo.js → filters-q4uY0GXA.js} +1 -1
  55. package/assets/{get-ecosystem-wallet-info-Q0K86GGt.js → get-ecosystem-wallet-info-C2CJ_2OU.js} +1 -1
  56. package/assets/{getBalance-B57AUVbe.js → getBalance-DGuxWuYL.js} +1 -1
  57. package/assets/{getInstalledModules-CAje9rp8.js → getInstalledModules-A3tAP18V.js} +1 -1
  58. package/assets/{getNFT-CpvjLK0Y.js → getNFT-C7cllYFm.js} +1 -1
  59. package/assets/{getNFT-Bb-t59ds.js → getNFT-CQKD7QHk.js} +2 -2
  60. package/assets/{github-Agge6OPm.js → github-DdvkoPeB.js} +1 -1
  61. package/assets/{google-BCp2rRpD.js → google-d4Ql9qix.js} +1 -1
  62. package/assets/{hashTypedData-621x-e3F.js → hashTypedData-7WNMs5EV.js} +1 -1
  63. package/assets/{help-circle-BglhVJJg.js → help-circle-BY_Weu8t.js} +1 -1
  64. package/assets/{id-DJWOh1yx.js → id-BJNb6vOI.js} +1 -1
  65. package/assets/{image-XVP-TFUR.js → image-DIsXNsXJ.js} +1 -1
  66. package/assets/{in-app-wallet-calls-C4soc9zT.js → in-app-wallet-calls-CIRR0eJZ.js} +1 -1
  67. package/assets/{index-DoKNVID8.js → index-BNdVKnva.js} +2 -2
  68. package/assets/{index-Dw1-bBaI.js → index-BtvcwkC4.js} +1 -1
  69. package/assets/{index-D4HP5DQC.js → index-C3CMrfih.js} +1 -1
  70. package/assets/{index-CecZD-vJ.js → index-C8ynIJrk.js} +3 -3
  71. package/assets/{index-DSxj-vNU.js → index-Ca6sys5l.js} +1 -1
  72. package/assets/index-CvqvWWYJ.js +2 -0
  73. package/assets/{index-CmTH1mn1.js → index-CxA55UWl.js} +1 -1
  74. package/assets/{index-VloZUDIL.js → index-D-W42D03.js} +8 -8
  75. package/assets/{index-Mb-EqEoD.js → index-DC9TKWAz.js} +1 -1
  76. package/assets/{index-LCDpDH8Q.js → index-DFfsl0Io.js} +1 -1
  77. package/assets/{index-DlDkzdhK.js → index-DN2JqH-l.js} +6 -6
  78. package/assets/{index-CUn0wuu2.js → index-DfqIHbWG.js} +2 -2
  79. package/assets/{index-X1qL-0B0.js → index-pQ6ZXw4u.js} +1 -1
  80. package/assets/{index-BAkdueH0.js → index-qMD90g0X.js} +1 -1
  81. package/assets/{index.es-DqGsvA8g.js → index.es-B2O4h03u.js} +4 -4
  82. package/assets/{index.es-vOkXvnBD.js → index.es-BEAksKXY.js} +1 -1
  83. package/assets/{index.es-ClZCnaxS.js → index.es-Dxxm_SKC.js} +1 -1
  84. package/assets/{index.es-B3ObrDkW.js → index.es-MXG0VeeZ.js} +1 -1
  85. package/assets/{index.umd-CrjosV4X.js → index.umd-DvfMpbcY.js} +1 -1
  86. package/assets/{info-Ce-k8YeY.js → info-BvPgRaaJ.js} +1 -1
  87. package/assets/{info-circle-DWKsUP7S.js → info-circle-sWcom9RD.js} +1 -1
  88. package/assets/{lightbulb-WJ_BxNVb.js → lightbulb-HJchniSu.js} +1 -1
  89. package/assets/{localBatchGatewayRequest-DbABcKyV.js → localBatchGatewayRequest-CHeIulW5.js} +1 -1
  90. package/assets/{mail-KoHfgvFC.js → mail-DlRijJmV.js} +1 -1
  91. package/assets/{mobile-DgiOcfZl.js → mobile-CoiDw6cg.js} +1 -1
  92. package/assets/{more-DQ2sX7uC.js → more-LUiRL6x4.js} +1 -1
  93. package/assets/{network-placeholder-J46GlKpA.js → network-placeholder-Cj3jgVfo.js} +1 -1
  94. package/assets/{nftPlaceholder-DJzkRgNi.js → nftPlaceholder-LkhQmGFs.js} +1 -1
  95. package/assets/{off-Bx4KjNoN.js → off-BCDn43Xl.js} +1 -1
  96. package/assets/{openzeppelin-CDBEZ0A6.js → openzeppelin-_xpy9vRo.js} +1 -1
  97. package/assets/{ownerOf-H_15UHmZ.js → ownerOf-ClSM4brX.js} +1 -1
  98. package/assets/{parseNft-C-gFG5mL.js → parseNft-BmEusGKu.js} +2 -2
  99. package/assets/{play-store-DnrAN_Zk.js → play-store-DBit2AoS.js} +1 -1
  100. package/assets/{plus-CG21jVu3.js → plus-CZe-WgSN.js} +1 -1
  101. package/assets/{qr-code-DCN5HoIC.js → qr-code-BhW7ZXY-.js} +1 -1
  102. package/assets/{qr-overlay-DZM2US31.js → qr-overlay-DsRPQv6v.js} +1 -1
  103. package/assets/{recycle-horizontal-pV5cKVIC.js → recycle-horizontal-DBnWoDRV.js} +1 -1
  104. package/assets/{refresh-DDAlbnMR.js → refresh-qvocxvcf.js} +1 -1
  105. package/assets/{reown-logo-BgBTRPqh.js → reown-logo-C-45v-AJ.js} +1 -1
  106. package/assets/{resolveImplementation--0Bj03XB.js → resolveImplementation-BssH7H5b.js} +1 -1
  107. package/assets/{rpc-BMTq3WxT.js → rpc-DMtarHL0.js} +1 -1
  108. package/assets/{search-F5Kt2PDD.js → search-CAzZVrZw.js} +1 -1
  109. package/assets/{secp256k1-HF3nQqZj.js → secp256k1-C_4ya0Qz.js} +1 -1
  110. package/assets/{secp256k1-DTovG4r4.js → secp256k1-CnKxz2gu.js} +1 -1
  111. package/assets/{secp256k1-D0j47cev.js → secp256k1-oGq0B4P7.js} +1 -1
  112. package/assets/{send-1sOEDYYV.js → send-DI2x4DfJ.js} +1 -1
  113. package/assets/{send-batch-transaction-DexqN5g2.js → send-batch-transaction-DfUNUZ4Z.js} +1 -1
  114. package/assets/{send-eip712-transaction-CzOG_yjy.js → send-eip712-transaction-Ro5QmOlW.js} +2 -2
  115. package/assets/{send-gasless-transaction-BerY-rcr.js → send-gasless-transaction-B-Uu5KdW.js} +2 -2
  116. package/assets/{session-proposal-BxP6Eg-Q.js → session-proposal-CRjqbz7W.js} +1 -1
  117. package/assets/{session-request-BmUVvzLs.js → session-request-BI3BlMfs.js} +2 -2
  118. package/assets/{sha256-CBZo01eO.js → sha256-ChRob2fv.js} +1 -1
  119. package/assets/{signing-CQ15XHyj.js → signing-B1K_Jdsm.js} +4 -4
  120. package/assets/{swapHorizontal-DwtkaBY9.js → swapHorizontal-eTjjU7d8.js} +1 -1
  121. package/assets/{swapHorizontalBold-DjH3VBED.js → swapHorizontalBold-B86nJTAP.js} +1 -1
  122. package/assets/{swapHorizontalMedium-B8m-zSxH.js → swapHorizontalMedium-CNT7ELrN.js} +1 -1
  123. package/assets/{swapHorizontalRoundedBold-CcKr4oU5.js → swapHorizontalRoundedBold-R_inXmIh.js} +1 -1
  124. package/assets/{swapVertical-Vhgw_9G1.js → swapVertical-DBChOUj8.js} +1 -1
  125. package/assets/{telegram-CItwttXQ.js → telegram-DjYbgHgS.js} +1 -1
  126. package/assets/{thirdweb-BEvIP-fy.js → thirdweb-0Fl_ECmE.js} +3 -3
  127. package/assets/{three-dots-DcElkEG2.js → three-dots-VoULPGrI.js} +1 -1
  128. package/assets/{totalSupply-DYVdetcS.js → totalSupply-ClM38QOc.js} +1 -1
  129. package/assets/{twitch-DIYf-ntg.js → twitch-ETBgqGHE.js} +1 -1
  130. package/assets/{twitterIcon-xMs4TJuA.js → twitterIcon-N584dzfh.js} +1 -1
  131. package/assets/{verify-CJQEOvVE.js → verify-Dp4bztGk.js} +1 -1
  132. package/assets/{verify-filled-Dm46z2W0.js → verify-filled-B7WhO3Kn.js} +1 -1
  133. package/assets/{w3m-modal-ime9_H71.js → w3m-modal-BmEHfmEu.js} +1 -1
  134. package/assets/{wait-for-tx-receipt-BWZbdlKf.js → wait-for-tx-receipt-pc2BJc62.js} +1 -1
  135. package/assets/{wallet-placeholder-lVvJajkJ.js → wallet-placeholder-B2e9Wl_u.js} +1 -1
  136. package/assets/{wallet-DsKK0DZZ.js → wallet-tXSvlbUa.js} +1 -1
  137. package/assets/{walletconnect-BzBoiyAH.js → walletconnect-D70wSjLs.js} +1 -1
  138. package/assets/{wallets-CCAGQYIy.js → wallets-Dj6CY1yi.js} +6 -6
  139. package/assets/{warning-circle-DPKmaE0h.js → warning-circle-CsTkZ4Rl.js} +1 -1
  140. package/assets/{web-connector-BiJHWbvm.js → web-connector-CiZO9RvI.js} +3 -3
  141. package/assets/{x-DEpEErGT.js → x-DwOCQuex.js} +1 -1
  142. package/index.html +3 -3
  143. package/package.json +2 -2
  144. package/assets/cursor-BQJeaiqW.js +0 -3
  145. package/assets/eth_estimateGas-DylIsdQK.js +0 -1
  146. package/assets/index-DX_PNZlK.js +0 -2
  147. package/dcl-blog-site-0.2.2-23649734878.commit-de1a383.tgz +0 -0
@@ -1,4 +1,4 @@
1
- import{F as fe,W as Ps,X as de,q as Ee,B as F,Y as Es,Z as Yt,$ as mt,a0 as Bs,a1 as As,a2 as yi,a3 as ht,a4 as mi,a5 as ie,l as et,a6 as Ft,x as ke,a7 as hi,a8 as Rr,a9 as Is,aa as Ss,ab as gi,ac as $r,ad as Dr,ae as zr,af as bi,ag as wi,ah as je,ai as _,aj as Be,ak as Os,al as vi,am as xi,an as Pi,ao as Ei,ap as Bi,aq as Ai,ar as Ii,as as ce,at as Fe,au as Si,av as Ze,aw as re,ax as tt,ay as Gs,az as Oi,aA as Qn,aB as Gi,n as R,m as M,aC as Ni,t as Te,g as ki,o as Y,aD as at,z as Ns,aE as T,A as se,aF as Fi,aG as Ti,u as we,aH as ks,aI as _r,aJ as Ci,N as er,aK as Li,aL as Ui,aM as Fs,aN as Ri,aO as dn,p as Qe,O as ue,aP as Tt,aQ as Mr,aR as Ts,aS as Ct,r as Cs,aT as Hr,aU as $i,aV as it,aW as Lt,aX as tr,aY as Di,aZ as J,a_ as Ls,a$ as Vr,b0 as Us,b1 as nr,v as Ge,b2 as Rs,b3 as Me,b4 as zi,b5 as rr,b6 as sr,b7 as _i,b8 as $s,b9 as ar,ba as ir,bb as Mi,bc as Hi,bd as or,D as Ds,be as Vi,bf as ji,bg as gt,bh as qi,k as cr,bi as zs,C as X,w as ln,bj as Zi,bk as _s,bl as Ms,bm as Hs,bn as Wi,bo as Ki,L as ae,bp as Vs,bq as js,br as Yi,bs as Ji,bt as Xi,bu as Qi,bv as pn,bw as eo,S as jr,bx as qs,by as to,bz as yn,bA as Zs,bB as qr,bC as no,bD as ro,bE as so,bF as Ws,bG as ao,M as io,bH as oo}from"./index-DlDkzdhK.js";import{i as ot,l as ur}from"./localBatchGatewayRequest-DbABcKyV.js";function fr(e,t){return({exclude:n,format:r})=>({exclude:n,format:(s,a)=>{const i=t(s,a);if(n)for(const c of n)delete i[c];return{...i,...r(s,a)}},type:e})}const Ks={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Ut(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?fe(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?fe(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Ks[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=co(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}const Ld=fr("transaction",Ut);function co(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function dr(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:Ut(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Ud=fr("block",dr);function le(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const Ys={"0x0":"reverted","0x1":"success"};function Rt(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(r=>le(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?fe(e.transactionIndex):null,status:e.status?Ys[e.status]:null,type:e.type?Ks[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Rd=fr("transactionReceipt",Rt);function uo(e,t="hex"){const n=Js(e),r=Ps(new Uint8Array(n.length));return n.encode(r),t==="hex"?de(r.bytes):r.bytes}function Js(e){return Array.isArray(e)?fo(e.map(t=>Js(t))):lo(e)}function fo(e){const t=e.reduce((s,a)=>s+a.length,0),n=Xs(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:a}of e)a(s)}}}function lo(e){const t=typeof e=="string"?Ee(e):e,n=Xs(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function Xs(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new F("Length is too large.")}function Qs(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(a=>Ee(a)):e.blobs,s=[];for(const a of r)s.push(Uint8Array.from(t.blobToKzgCommitment(a)));return n==="bytes"?s:s.map(a=>de(a))}function ea(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>Ee(i)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(i=>Ee(i)):e.commitments,a=[];for(let i=0;i<r.length;i++){const c=r[i],o=s[i];a.push(Uint8Array.from(t.computeBlobKzgProof(c,o)))}return n==="bytes"?a:a.map(i=>de(i))}function po(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),a=BigInt(4294967295),i=Number(n>>s&a),c=Number(n&a),o=r?4:0,u=r?0:4;e.setUint32(t+o,i,r),e.setUint32(t+u,c,r)}function yo(e,t,n){return e&t^~e&n}function mo(e,t,n){return e&t^e&n^t&n}class ho extends Es{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=Yt(this.buffer)}update(t){mt(this),t=Bs(t),As(t);const{view:n,buffer:r,blockLen:s}=this,a=t.length;for(let i=0;i<a;){const c=Math.min(s-this.pos,a-i);if(c===s){const o=Yt(t);for(;s<=a-i;i+=s)this.process(o,i);continue}r.set(t.subarray(i,i+c),this.pos),this.pos+=c,i+=c,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){mt(this),yi(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:a}=this;let{pos:i}=this;n[i++]=128,ht(this.buffer.subarray(i)),this.padOffset>s-i&&(this.process(r,0),i=0);for(let d=i;d<s;d++)n[d]=0;po(r,s-8,BigInt(this.length*8),a),this.process(r,0);const c=Yt(t),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=o/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)c.setUint32(4*d,f[d],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:a,destroyed:i,pos:c}=this;return t.destroyed=i,t.finished=a,t.length=s,t.pos=c,s%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const xe=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),go=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]),Pe=new Uint32Array(64);class bo extends ho{constructor(t=32){super(64,t,8,!1),this.A=xe[0]|0,this.B=xe[1]|0,this.C=xe[2]|0,this.D=xe[3]|0,this.E=xe[4]|0,this.F=xe[5]|0,this.G=xe[6]|0,this.H=xe[7]|0}get(){const{A:t,B:n,C:r,D:s,E:a,F:i,G:c,H:o}=this;return[t,n,r,s,a,i,c,o]}set(t,n,r,s,a,i,c,o){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=a|0,this.F=i|0,this.G=c|0,this.H=o|0}process(t,n){for(let d=0;d<16;d++,n+=4)Pe[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){const l=Pe[d-15],y=Pe[d-2],m=ie(l,7)^ie(l,18)^l>>>3,p=ie(y,17)^ie(y,19)^y>>>10;Pe[d]=p+Pe[d-7]+m+Pe[d-16]|0}let{A:r,B:s,C:a,D:i,E:c,F:o,G:u,H:f}=this;for(let d=0;d<64;d++){const l=ie(c,6)^ie(c,11)^ie(c,25),y=f+l+yo(c,o,u)+go[d]+Pe[d]|0,p=(ie(r,2)^ie(r,13)^ie(r,22))+mo(r,s,a)|0;f=u,u=o,o=c,c=i+y|0,i=a,a=s,s=r,r=y+p|0}r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,i=i+this.D|0,c=c+this.E|0,o=o+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,s,a,i,c,o,u,f)}roundClean(){ht(Pe)}destroy(){this.set(0,0,0,0,0,0,0,0),ht(this.buffer)}}const ta=mi(()=>new bo),wo=ta;function vo(e,t){return wo(et(e,{strict:!1})?Ft(e):e)}function xo(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=vo(t);return s.set([n],0),r==="bytes"?s:de(s)}function Po(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const a of t)s.push(xo({commitment:a,to:r,version:n}));return s}const Zr=6,na=32,lr=4096,ra=na*lr,Wr=ra*Zr-1-1*lr*Zr,Eo=1;class Bo extends F{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Ao extends F{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class $d extends F{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class Dd extends F{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${Eo}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function Io(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?Ee(e.data):e.data,r=ke(n);if(!r)throw new Ao;if(r>Wr)throw new Bo({maxSize:Wr,size:r});const s=[];let a=!0,i=0;for(;a;){const c=Ps(new Uint8Array(ra));let o=0;for(;o<lr;){const u=n.slice(i,i+(na-1));if(c.pushByte(0),c.pushBytes(u),u.length<31){c.pushByte(128),a=!1;break}o++,i+=31}s.push(c)}return t==="bytes"?s.map(c=>c.bytes):s.map(c=>de(c.bytes))}function So(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??Io({data:t,to:r}),a=e.commitments??Qs({blobs:s,kzg:n,to:r}),i=e.proofs??ea({blobs:s,commitments:a,kzg:n,to:r}),c=[];for(let o=0;o<s.length;o++)c.push({blob:s[o],commitment:a[o],proof:i[o]});return c}function Oo(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new hi({transaction:e})}class $t extends F{constructor({docsPath:t}={}){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(`
1
+ import{F as fe,W as Ps,X as de,q as Ee,B as F,Y as Es,Z as Yt,$ as mt,a0 as Bs,a1 as As,a2 as yi,a3 as ht,a4 as mi,a5 as ie,l as et,a6 as Ft,x as ke,a7 as hi,a8 as Rr,a9 as Is,aa as Ss,ab as gi,ac as $r,ad as Dr,ae as zr,af as bi,ag as wi,ah as je,ai as _,aj as Be,ak as Os,al as vi,am as xi,an as Pi,ao as Ei,ap as Bi,aq as Ai,ar as Ii,as as ce,at as Fe,au as Si,av as Ze,aw as re,ax as tt,ay as Gs,az as Oi,aA as Qn,aB as Gi,n as R,m as M,aC as Ni,t as Te,g as ki,o as Y,aD as at,z as Ns,aE as T,A as se,aF as Fi,aG as Ti,u as we,aH as ks,aI as _r,aJ as Ci,N as er,aK as Li,aL as Ui,aM as Fs,aN as Ri,aO as dn,p as Qe,O as ue,aP as Tt,aQ as Mr,aR as Ts,aS as Ct,r as Cs,aT as Hr,aU as $i,aV as it,aW as Lt,aX as tr,aY as Di,aZ as J,a_ as Ls,a$ as Vr,b0 as Us,b1 as nr,v as Ge,b2 as Rs,b3 as Me,b4 as zi,b5 as rr,b6 as sr,b7 as _i,b8 as $s,b9 as ar,ba as ir,bb as Mi,bc as Hi,bd as or,D as Ds,be as Vi,bf as ji,bg as gt,bh as qi,k as cr,bi as zs,C as X,w as ln,bj as Zi,bk as _s,bl as Ms,bm as Hs,bn as Wi,bo as Ki,L as ae,bp as Vs,bq as js,br as Yi,bs as Ji,bt as Xi,bu as Qi,bv as pn,bw as eo,S as jr,bx as qs,by as to,bz as yn,bA as Zs,bB as qr,bC as no,bD as ro,bE as so,bF as Ws,bG as ao,M as io,bH as oo}from"./index-DN2JqH-l.js";import{i as ot,l as ur}from"./localBatchGatewayRequest-CHeIulW5.js";function fr(e,t){return({exclude:n,format:r})=>({exclude:n,format:(s,a)=>{const i=t(s,a);if(n)for(const c of n)delete i[c];return{...i,...r(s,a)}},type:e})}const Ks={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Ut(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?fe(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?fe(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Ks[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=co(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}const Ld=fr("transaction",Ut);function co(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function dr(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:Ut(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Ud=fr("block",dr);function le(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const Ys={"0x0":"reverted","0x1":"success"};function Rt(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(r=>le(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?fe(e.transactionIndex):null,status:e.status?Ys[e.status]:null,type:e.type?Ks[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Rd=fr("transactionReceipt",Rt);function uo(e,t="hex"){const n=Js(e),r=Ps(new Uint8Array(n.length));return n.encode(r),t==="hex"?de(r.bytes):r.bytes}function Js(e){return Array.isArray(e)?fo(e.map(t=>Js(t))):lo(e)}function fo(e){const t=e.reduce((s,a)=>s+a.length,0),n=Xs(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:a}of e)a(s)}}}function lo(e){const t=typeof e=="string"?Ee(e):e,n=Xs(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function Xs(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new F("Length is too large.")}function Qs(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(a=>Ee(a)):e.blobs,s=[];for(const a of r)s.push(Uint8Array.from(t.blobToKzgCommitment(a)));return n==="bytes"?s:s.map(a=>de(a))}function ea(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>Ee(i)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(i=>Ee(i)):e.commitments,a=[];for(let i=0;i<r.length;i++){const c=r[i],o=s[i];a.push(Uint8Array.from(t.computeBlobKzgProof(c,o)))}return n==="bytes"?a:a.map(i=>de(i))}function po(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),a=BigInt(4294967295),i=Number(n>>s&a),c=Number(n&a),o=r?4:0,u=r?0:4;e.setUint32(t+o,i,r),e.setUint32(t+u,c,r)}function yo(e,t,n){return e&t^~e&n}function mo(e,t,n){return e&t^e&n^t&n}class ho extends Es{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=Yt(this.buffer)}update(t){mt(this),t=Bs(t),As(t);const{view:n,buffer:r,blockLen:s}=this,a=t.length;for(let i=0;i<a;){const c=Math.min(s-this.pos,a-i);if(c===s){const o=Yt(t);for(;s<=a-i;i+=s)this.process(o,i);continue}r.set(t.subarray(i,i+c),this.pos),this.pos+=c,i+=c,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){mt(this),yi(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:a}=this;let{pos:i}=this;n[i++]=128,ht(this.buffer.subarray(i)),this.padOffset>s-i&&(this.process(r,0),i=0);for(let d=i;d<s;d++)n[d]=0;po(r,s-8,BigInt(this.length*8),a),this.process(r,0);const c=Yt(t),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=o/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)c.setUint32(4*d,f[d],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:a,destroyed:i,pos:c}=this;return t.destroyed=i,t.finished=a,t.length=s,t.pos=c,s%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const xe=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),go=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]),Pe=new Uint32Array(64);class bo extends ho{constructor(t=32){super(64,t,8,!1),this.A=xe[0]|0,this.B=xe[1]|0,this.C=xe[2]|0,this.D=xe[3]|0,this.E=xe[4]|0,this.F=xe[5]|0,this.G=xe[6]|0,this.H=xe[7]|0}get(){const{A:t,B:n,C:r,D:s,E:a,F:i,G:c,H:o}=this;return[t,n,r,s,a,i,c,o]}set(t,n,r,s,a,i,c,o){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=a|0,this.F=i|0,this.G=c|0,this.H=o|0}process(t,n){for(let d=0;d<16;d++,n+=4)Pe[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){const l=Pe[d-15],y=Pe[d-2],m=ie(l,7)^ie(l,18)^l>>>3,p=ie(y,17)^ie(y,19)^y>>>10;Pe[d]=p+Pe[d-7]+m+Pe[d-16]|0}let{A:r,B:s,C:a,D:i,E:c,F:o,G:u,H:f}=this;for(let d=0;d<64;d++){const l=ie(c,6)^ie(c,11)^ie(c,25),y=f+l+yo(c,o,u)+go[d]+Pe[d]|0,p=(ie(r,2)^ie(r,13)^ie(r,22))+mo(r,s,a)|0;f=u,u=o,o=c,c=i+y|0,i=a,a=s,s=r,r=y+p|0}r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,i=i+this.D|0,c=c+this.E|0,o=o+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,s,a,i,c,o,u,f)}roundClean(){ht(Pe)}destroy(){this.set(0,0,0,0,0,0,0,0),ht(this.buffer)}}const ta=mi(()=>new bo),wo=ta;function vo(e,t){return wo(et(e,{strict:!1})?Ft(e):e)}function xo(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=vo(t);return s.set([n],0),r==="bytes"?s:de(s)}function Po(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const a of t)s.push(xo({commitment:a,to:r,version:n}));return s}const Zr=6,na=32,lr=4096,ra=na*lr,Wr=ra*Zr-1-1*lr*Zr,Eo=1;class Bo extends F{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Ao extends F{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class $d extends F{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class Dd extends F{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${Eo}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function Io(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?Ee(e.data):e.data,r=ke(n);if(!r)throw new Ao;if(r>Wr)throw new Bo({maxSize:Wr,size:r});const s=[];let a=!0,i=0;for(;a;){const c=Ps(new Uint8Array(ra));let o=0;for(;o<lr;){const u=n.slice(i,i+(na-1));if(c.pushByte(0),c.pushBytes(u),u.length<31){c.pushByte(128),a=!1;break}o++,i+=31}s.push(c)}return t==="bytes"?s.map(c=>c.bytes):s.map(c=>de(c.bytes))}function So(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??Io({data:t,to:r}),a=e.commitments??Qs({blobs:s,kzg:n,to:r}),i=e.proofs??ea({blobs:s,commitments:a,kzg:n,to:r}),c=[];for(let o=0;o<s.length;o++)c.push({blob:s[o],commitment:a[o],proof:i[o]});return c}function Oo(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new hi({transaction:e})}class $t extends F{constructor({docsPath:t}={}){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(`
2
2
  `),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}function Kr(e){let t;if(typeof e=="string")t=Rr(e);else{const n=Is(e),r=e.length;for(let s=0;s<r;s++){const a=e[s];if(!Ss(a)){t=Rr(a,n);break}}}if(!t)throw new gi({signature:e});return t}function Yr(e){const t=[];if(typeof e=="string"){const n=$r(e),r=n.length;for(let s=0;s<r;s++)t.push(Dr(n[s],{modifiers:zr}))}else{const n=Is(e),r=e.length;for(let s=0;s<r;s++){const a=e[s];if(Ss(a))continue;const i=$r(a),c=i.length;for(let o=0;o<c;o++)t.push(Dr(i[o],{modifiers:zr,structs:n}))}}if(t.length===0)throw new bi({params:e});return t}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const pr=BigInt(0),mn=BigInt(1);function ct(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function yr(e){if(!ct(e))throw new Error("Uint8Array expected")}function nt(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function pt(e){const t=e.toString(16);return t.length&1?"0"+t:t}function sa(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?pr:BigInt("0x"+e)}const aa=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Go=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function rt(e){if(yr(e),aa)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Go[e[n]];return t}const ye={_0:48,_9:57,A:65,F:70,a:97,f:102};function Jr(e){if(e>=ye._0&&e<=ye._9)return e-ye._0;if(e>=ye.A&&e<=ye.F)return e-(ye.A-10);if(e>=ye.a&&e<=ye.f)return e-(ye.a-10)}function bt(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(aa)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let s=0,a=0;s<n;s++,a+=2){const i=Jr(e.charCodeAt(a)),c=Jr(e.charCodeAt(a+1));if(i===void 0||c===void 0){const o=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+o+'" at index '+a)}r[s]=i*16+c}return r}function Ne(e){return sa(rt(e))}function ia(e){return yr(e),sa(rt(Uint8Array.from(e).reverse()))}function ut(e,t){return bt(e.toString(16).padStart(t*2,"0"))}function oa(e,t){return ut(e,t).reverse()}function ee(e,t,n){let r;if(typeof t=="string")try{r=bt(t)}catch(a){throw new Error(e+" must be hex string or Uint8Array, cause: "+a)}else if(ct(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(e+" of length "+n+" expected, got "+s);return r}function wt(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];yr(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}const Jt=e=>typeof e=="bigint"&&pr<=e;function mr(e,t,n){return Jt(e)&&Jt(t)&&Jt(n)&&t<=e&&e<n}function He(e,t,n,r){if(!mr(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function No(e){let t;for(t=0;e>pr;e>>=mn,t+=1);return t}const Dt=e=>(mn<<BigInt(e))-mn,Xt=e=>new Uint8Array(e),Xr=e=>Uint8Array.from(e);function ko(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Xt(e),s=Xt(e),a=0;const i=()=>{r.fill(1),s.fill(0),a=0},c=(...d)=>n(s,r,...d),o=(d=Xt(0))=>{s=c(Xr([0]),d),r=c(),d.length!==0&&(s=c(Xr([1]),d),r=c())},u=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const l=[];for(;d<t;){r=c();const y=r.slice();l.push(y),d+=r.length}return wt(...l)};return(d,l)=>{i(),o(d);let y;for(;!(y=l(u()));)o();return i(),y}}const Fo={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||ct(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function zt(e,t,n={}){const r=(s,a,i)=>{const c=Fo[a];if(typeof c!="function")throw new Error("invalid validator function");const o=e[s];if(!(i&&o===void 0)&&!c(o,e))throw new Error("param "+String(s)+" is invalid. Expected "+a+", got "+o)};for(const[s,a]of Object.entries(t))r(s,a,!1);for(const[s,a]of Object.entries(n))r(s,a,!0);return e}function Qr(e){const t=new WeakMap;return(n,...r)=>{const s=t.get(n);if(s!==void 0)return s;const a=e(n,...r);return t.set(n,a),a}}function ft(e,t){if(ze(e)>t)throw new qo({givenSize:ze(e),maxSize:t})}const me={zero:48,nine:57,A:65,F:70,a:97,f:102};function es(e){if(e>=me.zero&&e<=me.nine)return e-me.zero;if(e>=me.A&&e<=me.F)return e-(me.A-10);if(e>=me.a&&e<=me.f)return e-(me.a-10)}function To(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new Zo({size:e.length,targetSize:r,type:"Bytes"});const s=new Uint8Array(r);for(let a=0;a<r;a++){const i=n==="right";s[i?a:r-a-1]=e[i?a:e.length-a-1]}return s}function ca(e,t={}){const{dir:n="left"}=t;let r=e,s=0;for(let a=0;a<r.length-1&&r[n==="left"?a:r.length-a-1].toString()==="0";a++)s++;return r=n==="left"?r.slice(s):r.slice(0,r.length-s),r}const Co=new TextDecoder,Lo=new TextEncoder;function Uo(e){return e instanceof Uint8Array?e:typeof e=="string"?ua(e):Ro(e)}function Ro(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function ua(e,t={}){const{size:n}=t;let r=e;n&&(wi(e,n),r=je(e,n));let s=r.slice(2);s.length%2&&(s=`0${s}`);const a=s.length/2,i=new Uint8Array(a);for(let c=0,o=0;c<a;c++){const u=es(s.charCodeAt(o++)),f=es(s.charCodeAt(o++));if(u===void 0||f===void 0)throw new _(`Invalid byte sequence ("${s[o-2]}${s[o-1]}" in "${s}").`);i[c]=u<<4|f}return i}function $o(e,t={}){const{size:n}=t,r=Lo.encode(e);return typeof n=="number"?(ft(r,n),Do(r,n)):r}function Do(e,t){return To(e,{dir:"right",size:t})}function ze(e){return e.length}function zo(e,t,n,r={}){const{strict:s}=r;return e.slice(t,n)}function _o(e,t={}){const{size:n}=t;typeof n<"u"&&ft(e,n);const r=Be(e,t);return vi(r,t)}function Mo(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(ft(r,n),r=fa(r)),r.length>1||r[0]>1)throw new jo(r);return!!r[0]}function be(e,t={}){const{size:n}=t;typeof n<"u"&&ft(e,n);const r=Be(e,t);return Os(r,t)}function Ho(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(ft(r,n),r=Vo(r)),Co.decode(r)}function fa(e){return ca(e,{dir:"left"})}function Vo(e){return ca(e,{dir:"right"})}class jo extends _{constructor(t){super(`Bytes value \`${t}\` 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"})}}class qo extends _{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class Zo extends _{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}function da(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=xi(Uo(e));return n==="Bytes"?r:Be(r)}const Wo={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 Jo({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Yo({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new ts({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new ts({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Ko(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Wo);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class ts extends _{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class Yo extends _{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class Jo extends _{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}class Xo extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const Qo={checksum:new Xo(8192)},Qt=Qo.checksum,ec=/^0x[a-fA-F0-9]{40}$/;function _t(e,t={}){const{strict:n=!0}=t;if(!ec.test(e))throw new ns({address:e,cause:new tc});if(n){if(e.toLowerCase()===e)return;if(la(e)!==e)throw new ns({address:e,cause:new nc})}}function la(e){if(Qt.has(e))return Qt.get(e);_t(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=da($o(t),{as:"Bytes"}),r=t.split("");for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&r[a]&&(r[a]=r[a].toUpperCase()),(n[a>>1]&15)>=8&&r[a+1]&&(r[a+1]=r[a+1].toUpperCase());const s=`0x${r.join("")}`;return Qt.set(e,s),s}function hn(e,t={}){const{strict:n=!0}=t??{};try{return _t(e,{strict:n}),!0}catch{return!1}}class ns extends _{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class tc extends _{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"})}}class nc extends _{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const K=BigInt(0),q=BigInt(1),Se=BigInt(2),rc=BigInt(3),pa=BigInt(4),ya=BigInt(5),ma=BigInt(8);function W(e,t){const n=e%t;return n>=K?n:t+n}function Q(e,t,n){let r=e;for(;t-- >K;)r*=r,r%=n;return r}function gn(e,t){if(e===K)throw new Error("invert: expected non-zero number");if(t<=K)throw new Error("invert: expected positive modulus, got "+t);let n=W(e,t),r=t,s=K,a=q;for(;n!==K;){const c=r/n,o=r%n,u=s-a*c;r=n,n=o,s=a,a=u}if(r!==q)throw new Error("invert: does not exist");return W(s,t)}function ha(e,t){const n=(e.ORDER+q)/pa,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function sc(e,t){const n=(e.ORDER-ya)/ma,r=e.mul(t,Se),s=e.pow(r,n),a=e.mul(t,s),i=e.mul(e.mul(a,Se),s),c=e.mul(a,e.sub(i,e.ONE));if(!e.eql(e.sqr(c),t))throw new Error("Cannot find square root");return c}function ac(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-q,n=0;for(;t%Se===K;)t/=Se,n++;let r=Se;const s=hr(e);for(;rs(s,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return ha;let a=s.pow(r,t);const i=(t+q)/Se;return function(o,u){if(o.is0(u))return u;if(rs(o,u)!==1)throw new Error("Cannot find square root");let f=n,d=o.mul(o.ONE,a),l=o.pow(u,t),y=o.pow(u,i);for(;!o.eql(l,o.ONE);){if(o.is0(l))return o.ZERO;let m=1,p=o.sqr(l);for(;!o.eql(p,o.ONE);)if(m++,p=o.sqr(p),m===f)throw new Error("Cannot find square root");const b=q<<BigInt(f-m-1),P=o.pow(d,b);f=m,d=o.sqr(P),l=o.mul(l,d),y=o.mul(y,P)}return y}}function ic(e){return e%pa===rc?ha:e%ma===ya?sc:ac(e)}const oc=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function cc(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=oc.reduce((r,s)=>(r[s]="function",r),t);return zt(e,n)}function uc(e,t,n){if(n<K)throw new Error("invalid exponent, negatives unsupported");if(n===K)return e.ONE;if(n===q)return t;let r=e.ONE,s=t;for(;n>K;)n&q&&(r=e.mul(r,s)),s=e.sqr(s),n>>=q;return r}function ga(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),s=t.reduce((i,c,o)=>e.is0(c)?i:(r[o]=i,e.mul(i,c)),e.ONE),a=e.inv(s);return t.reduceRight((i,c,o)=>e.is0(c)?i:(r[o]=e.mul(i,r[o]),e.mul(i,c)),a),r}function rs(e,t){const n=(e.ORDER-q)/Se,r=e.pow(t,n),s=e.eql(r,e.ONE),a=e.eql(r,e.ZERO),i=e.eql(r,e.neg(e.ONE));if(!s&&!a&&!i)throw new Error("invalid Legendre symbol result");return s?1:a?0:-1}function ba(e,t){t!==void 0&&Pi(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function hr(e,t,n=!1,r={}){if(e<=K)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:s,nByteLength:a}=ba(e,t);if(a>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i;const c=Object.freeze({ORDER:e,isLE:n,BITS:s,BYTES:a,MASK:Dt(s),ZERO:K,ONE:q,create:o=>W(o,e),isValid:o=>{if(typeof o!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof o);return K<=o&&o<e},is0:o=>o===K,isOdd:o=>(o&q)===q,neg:o=>W(-o,e),eql:(o,u)=>o===u,sqr:o=>W(o*o,e),add:(o,u)=>W(o+u,e),sub:(o,u)=>W(o-u,e),mul:(o,u)=>W(o*u,e),pow:(o,u)=>uc(c,o,u),div:(o,u)=>W(o*gn(u,e),e),sqrN:o=>o*o,addN:(o,u)=>o+u,subN:(o,u)=>o-u,mulN:(o,u)=>o*u,inv:o=>gn(o,e),sqrt:r.sqrt||(o=>(i||(i=ic(e)),i(c,o))),toBytes:o=>n?oa(o,a):ut(o,a),fromBytes:o=>{if(o.length!==a)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+o.length);return n?ia(o):Ne(o)},invertBatch:o=>ga(c,o),cmov:(o,u,f)=>f?u:o});return Object.freeze(c)}function wa(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function va(e){const t=wa(e);return t+Math.ceil(t/2)}function fc(e,t,n=!1){const r=e.length,s=wa(t),a=va(t);if(r<16||r<a||r>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+r);const i=n?ia(e):Ne(e),c=W(i,t-q)+q;return n?oa(c,s):ut(c,s)}class xa extends Es{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Ei(t);const r=Bs(n);if(this.iHash=t.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 s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?t.create().update(r).digest():r);for(let i=0;i<a.length;i++)a[i]^=54;this.iHash.update(a),this.oHash=t.create();for(let i=0;i<a.length;i++)a[i]^=106;this.oHash.update(a),ht(a)}update(t){return mt(this),this.iHash.update(t),this}digestInto(t){mt(this),As(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:a,blockLen:i,outputLen:c}=this;return t=t,t.finished=s,t.destroyed=a,t.blockLen=i,t.outputLen=c,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Pa=(e,t,n)=>new xa(e,t).update(n).digest();Pa.create=(e,t)=>new xa(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ss=BigInt(0),bn=BigInt(1);function en(e,t){const n=t.negate();return e?n:t}function Ea(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function tn(e,t){Ea(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),s=2**e,a=Dt(e),i=BigInt(e);return{windows:n,windowSize:r,mask:a,maxNumber:s,shiftBy:i}}function as(e,t,n){const{windowSize:r,mask:s,maxNumber:a,shiftBy:i}=n;let c=Number(e&s),o=e>>i;c>r&&(c-=a,o+=bn);const u=t*r,f=u+Math.abs(c)-1,d=c===0,l=c<0,y=t%2!==0;return{nextN:o,offset:f,isZero:d,isNeg:l,isNegF:y,offsetF:u}}function dc(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function lc(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const nn=new WeakMap,Ba=new WeakMap;function rn(e){return Ba.get(e)||1}function pc(e,t){return{constTimeNegate:en,hasPrecomputes(n){return rn(n)!==1},unsafeLadder(n,r,s=e.ZERO){let a=n;for(;r>ss;)r&bn&&(s=s.add(a)),a=a.double(),r>>=bn;return s},precomputeWindow(n,r){const{windows:s,windowSize:a}=tn(r,t),i=[];let c=n,o=c;for(let u=0;u<s;u++){o=c,i.push(o);for(let f=1;f<a;f++)o=o.add(c),i.push(o);c=o.double()}return i},wNAF(n,r,s){let a=e.ZERO,i=e.BASE;const c=tn(n,t);for(let o=0;o<c.windows;o++){const{nextN:u,offset:f,isZero:d,isNeg:l,isNegF:y,offsetF:m}=as(s,o,c);s=u,d?i=i.add(en(y,r[m])):a=a.add(en(l,r[f]))}return{p:a,f:i}},wNAFUnsafe(n,r,s,a=e.ZERO){const i=tn(n,t);for(let c=0;c<i.windows&&s!==ss;c++){const{nextN:o,offset:u,isZero:f,isNeg:d}=as(s,c,i);if(s=o,!f){const l=r[u];a=a.add(d?l.negate():l)}}return a},getPrecomputes(n,r,s){let a=nn.get(r);return a||(a=this.precomputeWindow(r,n),n!==1&&nn.set(r,s(a))),a},wNAFCached(n,r,s){const a=rn(n);return this.wNAF(a,this.getPrecomputes(a,n,s),r)},wNAFCachedUnsafe(n,r,s,a){const i=rn(n);return i===1?this.unsafeLadder(n,r,a):this.wNAFUnsafe(i,this.getPrecomputes(i,n,s),r,a)},setWindowSize(n,r){Ea(r,t),Ba.set(n,r),nn.delete(n)}}}function yc(e,t,n,r){dc(n,e),lc(r,t);const s=n.length,a=r.length;if(s!==a)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,c=No(BigInt(s));let o=1;c>12?o=c-3:c>4?o=c-2:c>0&&(o=2);const u=Dt(o),f=new Array(Number(u)+1).fill(i),d=Math.floor((t.BITS-1)/o)*o;let l=i;for(let y=d;y>=0;y-=o){f.fill(i);for(let p=0;p<a;p++){const b=r[p],P=Number(b>>BigInt(y)&u);f[P]=f[P].add(n[p])}let m=i;for(let p=f.length-1,b=i;p>0;p--)b=b.add(f[p]),m=m.add(b);if(l=l.add(m),y!==0)for(let p=0;p<o;p++)l=l.double()}return l}function Aa(e){return cc(e.Fp),zt(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ba(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function is(e){e.lowS!==void 0&&nt("lowS",e.lowS),e.prehash!==void 0&&nt("prehash",e.prehash)}function mc(e){const t=Aa(e);zt(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class hc extends Error{constructor(t=""){super(t)}}const he={Err:hc,_tlv:{encode:(e,t)=>{const{Err:n}=he;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,s=pt(r);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const a=r>127?pt(s.length/2|128):"";return pt(e)+a+s+t},decode(e,t){const{Err:n}=he;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const s=t[r++],a=!!(s&128);let i=0;if(!a)i=s;else{const o=s&127;if(!o)throw new n("tlv.decode(long): indefinite length not supported");if(o>4)throw new n("tlv.decode(long): byte length is too big");const u=t.subarray(r,r+o);if(u.length!==o)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const f of u)i=i<<8|f;if(r+=o,i<128)throw new n("tlv.decode(long): not minimal encoding")}const c=t.subarray(r,r+i);if(c.length!==i)throw new n("tlv.decode: wrong value length");return{v:c,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=he;if(e<ge)throw new t("integer: negative integers are not allowed");let n=pt(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=he;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return Ne(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=he,s=ee("signature",e),{v:a,l:i}=r.decode(48,s);if(i.length)throw new t("invalid signature: left bytes after parsing");const{v:c,l:o}=r.decode(2,a),{v:u,l:f}=r.decode(2,o);if(f.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(c),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=he,r=t.encode(2,n.encode(e.r)),s=t.encode(2,n.encode(e.s)),a=r+s;return t.encode(48,a)}};function sn(e,t){return rt(ut(e,t))}const ge=BigInt(0),V=BigInt(1);BigInt(2);const an=BigInt(3),gc=BigInt(4);function bc(e){const t=mc(e),{Fp:n}=t,r=hr(t.n,t.nBitLength),s=t.toBytes||((w,h,B)=>{const G=h.toAffine();return wt(Uint8Array.from([4]),n.toBytes(G.x),n.toBytes(G.y))}),a=t.fromBytes||(w=>{const h=w.subarray(1),B=n.fromBytes(h.subarray(0,n.BYTES)),G=n.fromBytes(h.subarray(n.BYTES,2*n.BYTES));return{x:B,y:G}});function i(w){const{a:h,b:B}=t,G=n.sqr(w),g=n.mul(G,w);return n.add(n.add(g,n.mul(w,h)),B)}function c(w,h){const B=n.sqr(h),G=i(w);return n.eql(B,G)}if(!c(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const o=n.mul(n.pow(t.a,an),gc),u=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(o,u)))throw new Error("bad curve params: a or b");function f(w){return mr(w,V,t.n)}function d(w){const{allowedPrivateKeyLengths:h,nByteLength:B,wrapPrivateKey:G,n:g}=t;if(h&&typeof w!="bigint"){if(ct(w)&&(w=rt(w)),typeof w!="string"||!h.includes(w.length))throw new Error("invalid private key");w=w.padStart(B*2,"0")}let x;try{x=typeof w=="bigint"?w:Ne(ee("private key",w,B))}catch{throw new Error("invalid private key, expected hex or "+B+" bytes, got "+typeof w)}return G&&(x=W(x,g)),He("private key",x,V,g),x}function l(w){if(!(w instanceof p))throw new Error("ProjectivePoint expected")}const y=Qr((w,h)=>{const{px:B,py:G,pz:g}=w;if(n.eql(g,n.ONE))return{x:B,y:G};const x=w.is0();h==null&&(h=x?n.ONE:n.inv(g));const O=n.mul(B,h),U=n.mul(G,h),S=n.mul(g,h);if(x)return{x:n.ZERO,y:n.ZERO};if(!n.eql(S,n.ONE))throw new Error("invZ was invalid");return{x:O,y:U}}),m=Qr(w=>{if(w.is0()){if(t.allowInfinityPoint&&!n.is0(w.py))return;throw new Error("bad point: ZERO")}const{x:h,y:B}=w.toAffine();if(!n.isValid(h)||!n.isValid(B))throw new Error("bad point: x or y not FE");if(!c(h,B))throw new Error("bad point: equation left != right");if(!w.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class p{constructor(h,B,G){if(h==null||!n.isValid(h))throw new Error("x required");if(B==null||!n.isValid(B)||n.is0(B))throw new Error("y required");if(G==null||!n.isValid(G))throw new Error("z required");this.px=h,this.py=B,this.pz=G,Object.freeze(this)}static fromAffine(h){const{x:B,y:G}=h||{};if(!h||!n.isValid(B)||!n.isValid(G))throw new Error("invalid affine point");if(h instanceof p)throw new Error("projective point not allowed");const g=x=>n.eql(x,n.ZERO);return g(B)&&g(G)?p.ZERO:new p(B,G,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(h){const B=ga(n,h.map(G=>G.pz));return h.map((G,g)=>G.toAffine(B[g])).map(p.fromAffine)}static fromHex(h){const B=p.fromAffine(a(ee("pointHex",h)));return B.assertValidity(),B}static fromPrivateKey(h){return p.BASE.multiply(d(h))}static msm(h,B){return yc(p,r,h,B)}_setWindowSize(h){E.setWindowSize(this,h)}assertValidity(){m(this)}hasEvenY(){const{y:h}=this.toAffine();if(n.isOdd)return!n.isOdd(h);throw new Error("Field doesn't support isOdd")}equals(h){l(h);const{px:B,py:G,pz:g}=this,{px:x,py:O,pz:U}=h,S=n.eql(n.mul(B,U),n.mul(x,g)),k=n.eql(n.mul(G,U),n.mul(O,g));return S&&k}negate(){return new p(this.px,n.neg(this.py),this.pz)}double(){const{a:h,b:B}=t,G=n.mul(B,an),{px:g,py:x,pz:O}=this;let U=n.ZERO,S=n.ZERO,k=n.ZERO,N=n.mul(g,g),z=n.mul(x,x),v=n.mul(O,O),A=n.mul(g,x);return A=n.add(A,A),k=n.mul(g,O),k=n.add(k,k),U=n.mul(h,k),S=n.mul(G,v),S=n.add(U,S),U=n.sub(z,S),S=n.add(z,S),S=n.mul(U,S),U=n.mul(A,U),k=n.mul(G,k),v=n.mul(h,v),A=n.sub(N,v),A=n.mul(h,A),A=n.add(A,k),k=n.add(N,N),N=n.add(k,N),N=n.add(N,v),N=n.mul(N,A),S=n.add(S,N),v=n.mul(x,O),v=n.add(v,v),N=n.mul(v,A),U=n.sub(U,N),k=n.mul(v,z),k=n.add(k,k),k=n.add(k,k),new p(U,S,k)}add(h){l(h);const{px:B,py:G,pz:g}=this,{px:x,py:O,pz:U}=h;let S=n.ZERO,k=n.ZERO,N=n.ZERO;const z=t.a,v=n.mul(t.b,an);let A=n.mul(B,x),C=n.mul(G,O),I=n.mul(g,U),L=n.add(B,G),$=n.add(x,O);L=n.mul(L,$),$=n.add(A,C),L=n.sub(L,$),$=n.add(B,g);let D=n.add(x,U);return $=n.mul($,D),D=n.add(A,I),$=n.sub($,D),D=n.add(G,g),S=n.add(O,U),D=n.mul(D,S),S=n.add(C,I),D=n.sub(D,S),N=n.mul(z,$),S=n.mul(v,I),N=n.add(S,N),S=n.sub(C,N),N=n.add(C,N),k=n.mul(S,N),C=n.add(A,A),C=n.add(C,A),I=n.mul(z,I),$=n.mul(v,$),C=n.add(C,I),I=n.sub(A,I),I=n.mul(z,I),$=n.add($,I),A=n.mul(C,$),k=n.add(k,A),A=n.mul(D,$),S=n.mul(L,S),S=n.sub(S,A),A=n.mul(L,C),N=n.mul(D,N),N=n.add(N,A),new p(S,k,N)}subtract(h){return this.add(h.negate())}is0(){return this.equals(p.ZERO)}wNAF(h){return E.wNAFCached(this,h,p.normalizeZ)}multiplyUnsafe(h){const{endo:B,n:G}=t;He("scalar",h,ge,G);const g=p.ZERO;if(h===ge)return g;if(this.is0()||h===V)return this;if(!B||E.hasPrecomputes(this))return E.wNAFCachedUnsafe(this,h,p.normalizeZ);let{k1neg:x,k1:O,k2neg:U,k2:S}=B.splitScalar(h),k=g,N=g,z=this;for(;O>ge||S>ge;)O&V&&(k=k.add(z)),S&V&&(N=N.add(z)),z=z.double(),O>>=V,S>>=V;return x&&(k=k.negate()),U&&(N=N.negate()),N=new p(n.mul(N.px,B.beta),N.py,N.pz),k.add(N)}multiply(h){const{endo:B,n:G}=t;He("scalar",h,V,G);let g,x;if(B){const{k1neg:O,k1:U,k2neg:S,k2:k}=B.splitScalar(h);let{p:N,f:z}=this.wNAF(U),{p:v,f:A}=this.wNAF(k);N=E.constTimeNegate(O,N),v=E.constTimeNegate(S,v),v=new p(n.mul(v.px,B.beta),v.py,v.pz),g=N.add(v),x=z.add(A)}else{const{p:O,f:U}=this.wNAF(h);g=O,x=U}return p.normalizeZ([g,x])[0]}multiplyAndAddUnsafe(h,B,G){const g=p.BASE,x=(U,S)=>S===ge||S===V||!U.equals(g)?U.multiplyUnsafe(S):U.multiply(S),O=x(this,B).add(x(h,G));return O.is0()?void 0:O}toAffine(h){return y(this,h)}isTorsionFree(){const{h,isTorsionFree:B}=t;if(h===V)return!0;if(B)return B(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h,clearCofactor:B}=t;return h===V?this:B?B(p,this):this.multiplyUnsafe(t.h)}toRawBytes(h=!0){return nt("isCompressed",h),this.assertValidity(),s(p,this,h)}toHex(h=!0){return nt("isCompressed",h),rt(this.toRawBytes(h))}}p.BASE=new p(t.Gx,t.Gy,n.ONE),p.ZERO=new p(n.ZERO,n.ONE,n.ZERO);const{endo:b,nBitLength:P}=t,E=pc(p,b?Math.ceil(P/2):P);return{CURVE:t,ProjectivePoint:p,normPrivateKeyToScalar:d,weierstrassEquation:i,isWithinCurveOrder:f}}function wc(e){const t=Aa(e);return zt(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function vc(e){const t=wc(e),{Fp:n,n:r,nByteLength:s,nBitLength:a}=t,i=n.BYTES+1,c=2*n.BYTES+1;function o(v){return W(v,r)}function u(v){return gn(v,r)}const{ProjectivePoint:f,normPrivateKeyToScalar:d,weierstrassEquation:l,isWithinCurveOrder:y}=bc({...t,toBytes(v,A,C){const I=A.toAffine(),L=n.toBytes(I.x),$=wt;return nt("isCompressed",C),C?$(Uint8Array.from([A.hasEvenY()?2:3]),L):$(Uint8Array.from([4]),L,n.toBytes(I.y))},fromBytes(v){const A=v.length,C=v[0],I=v.subarray(1);if(A===i&&(C===2||C===3)){const L=Ne(I);if(!mr(L,V,n.ORDER))throw new Error("Point is not on curve");const $=l(L);let D;try{D=n.sqrt($)}catch(Z){const j=Z instanceof Error?": "+Z.message:"";throw new Error("Point is not on curve"+j)}const H=(D&V)===V;return(C&1)===1!==H&&(D=n.neg(D)),{x:L,y:D}}else if(A===c&&C===4){const L=n.fromBytes(I.subarray(0,n.BYTES)),$=n.fromBytes(I.subarray(n.BYTES,2*n.BYTES));return{x:L,y:$}}else{const L=i,$=c;throw new Error("invalid Point, expected length of "+L+", or uncompressed "+$+", got "+A)}}});function m(v){const A=r>>V;return v>A}function p(v){return m(v)?o(-v):v}const b=(v,A,C)=>Ne(v.slice(A,C));class P{constructor(A,C,I){He("r",A,V,r),He("s",C,V,r),this.r=A,this.s=C,I!=null&&(this.recovery=I),Object.freeze(this)}static fromCompact(A){const C=s;return A=ee("compactSignature",A,C*2),new P(b(A,0,C),b(A,C,2*C))}static fromDER(A){const{r:C,s:I}=he.toSig(ee("DER",A));return new P(C,I)}assertValidity(){}addRecoveryBit(A){return new P(this.r,this.s,A)}recoverPublicKey(A){const{r:C,s:I,recovery:L}=this,$=g(ee("msgHash",A));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const D=L===2||L===3?C+t.n:C;if(D>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const H=L&1?"03":"02",te=f.fromHex(H+sn(D,n.BYTES)),Z=u(D),j=o(-$*Z),Ue=o(I*Z),ve=f.BASE.multiplyAndAddUnsafe(te,j,Ue);if(!ve)throw new Error("point at infinify");return ve.assertValidity(),ve}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new P(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return bt(this.toDERHex())}toDERHex(){return he.hexFromSig(this)}toCompactRawBytes(){return bt(this.toCompactHex())}toCompactHex(){const A=s;return sn(this.r,A)+sn(this.s,A)}}const E={isValidPrivateKey(v){try{return d(v),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const v=va(t.n);return fc(t.randomBytes(v),t.n)},precompute(v=8,A=f.BASE){return A._setWindowSize(v),A.multiply(BigInt(3)),A}};function w(v,A=!0){return f.fromPrivateKey(v).toRawBytes(A)}function h(v){if(typeof v=="bigint")return!1;if(v instanceof f)return!0;const C=ee("key",v).length,I=n.BYTES,L=I+1,$=2*I+1;if(!(t.allowedPrivateKeyLengths||s===L))return C===L||C===$}function B(v,A,C=!0){if(h(v)===!0)throw new Error("first arg must be private key");if(h(A)===!1)throw new Error("second arg must be public key");return f.fromHex(A).multiply(d(v)).toRawBytes(C)}const G=t.bits2int||function(v){if(v.length>8192)throw new Error("input is too large");const A=Ne(v),C=v.length*8-a;return C>0?A>>BigInt(C):A},g=t.bits2int_modN||function(v){return o(G(v))},x=Dt(a);function O(v){return He("num < 2^"+a,v,ge,x),ut(v,s)}function U(v,A,C=S){if(["recovered","canonical"].some(Ae=>Ae in C))throw new Error("sign() legacy options not supported");const{hash:I,randomBytes:L}=t;let{lowS:$,prehash:D,extraEntropy:H}=C;$==null&&($=!0),v=ee("msgHash",v),is(C),D&&(v=ee("prehashed msgHash",I(v)));const te=g(v),Z=d(A),j=[O(Z),O(te)];if(H!=null&&H!==!1){const Ae=H===!0?L(n.BYTES):H;j.push(ee("extraEntropy",Ae))}const Ue=wt(...j),ve=te;function Wt(Ae){const Re=G(Ae);if(!y(Re))return;const Kt=u(Re),Ke=f.BASE.multiply(Re).toAffine(),Ie=o(Ke.x);if(Ie===ge)return;const Ye=o(Kt*o(ve+Ie*Z));if(Ye===ge)return;let Je=(Ke.x===Ie?0:2)|Number(Ke.y&V),$e=Ye;return $&&m(Ye)&&($e=p(Ye),Je^=1),new P(Ie,$e,Je)}return{seed:Ue,k2sig:Wt}}const S={lowS:t.lowS,prehash:!1},k={lowS:t.lowS,prehash:!1};function N(v,A,C=S){const{seed:I,k2sig:L}=U(v,A,C),$=t;return ko($.hash.outputLen,$.nByteLength,$.hmac)(I,L)}f.BASE._setWindowSize(8);function z(v,A,C,I=k){var Je;const L=v;A=ee("msgHash",A),C=ee("publicKey",C);const{lowS:$,prehash:D,format:H}=I;if(is(I),"strict"in I)throw new Error("options.strict was renamed to lowS");if(H!==void 0&&H!=="compact"&&H!=="der")throw new Error("format must be compact or der");const te=typeof L=="string"||ct(L),Z=!te&&!H&&typeof L=="object"&&L!==null&&typeof L.r=="bigint"&&typeof L.s=="bigint";if(!te&&!Z)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let j,Ue;try{if(Z&&(j=new P(L.r,L.s)),te){try{H!=="compact"&&(j=P.fromDER(L))}catch($e){if(!($e instanceof he.Err))throw $e}!j&&H!=="der"&&(j=P.fromCompact(L))}Ue=f.fromHex(C)}catch{return!1}if(!j||$&&j.hasHighS())return!1;D&&(A=t.hash(A));const{r:ve,s:Wt}=j,Ae=g(A),Re=u(Wt),Kt=o(Ae*Re),Ke=o(ve*Re),Ie=(Je=f.BASE.multiplyAndAddUnsafe(Ue,Kt,Ke))==null?void 0:Je.toAffine();return Ie?o(Ie.x)===ve:!1}return{CURVE:t,getPublicKey:w,getSharedSecret:B,sign:N,verify:z,ProjectivePoint:f,Signature:P,utils:E}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function xc(e){return{hash:e,hmac:(t,...n)=>Pa(e,t,Ai(...n)),randomBytes:Bi}}function Pc(e,t){const n=r=>vc({...e,...xc(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ia=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),os=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Ec=BigInt(0),Bc=BigInt(1),wn=BigInt(2),cs=(e,t)=>(e+t/wn)/t;function Ac(e){const t=Ia,n=BigInt(3),r=BigInt(6),s=BigInt(11),a=BigInt(22),i=BigInt(23),c=BigInt(44),o=BigInt(88),u=e*e*e%t,f=u*u*e%t,d=Q(f,n,t)*f%t,l=Q(d,n,t)*f%t,y=Q(l,wn,t)*u%t,m=Q(y,s,t)*y%t,p=Q(m,a,t)*m%t,b=Q(p,c,t)*p%t,P=Q(b,o,t)*b%t,E=Q(P,c,t)*p%t,w=Q(E,n,t)*f%t,h=Q(w,i,t)*m%t,B=Q(h,r,t)*u%t,G=Q(B,wn,t);if(!vn.eql(vn.sqr(G),e))throw new Error("Cannot find square root");return G}const vn=hr(Ia,void 0,void 0,{sqrt:Ac}),gr=Pc({a:Ec,b:BigInt(7),Fp:vn,n:os,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=os,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Bc*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,i=BigInt("0x100000000000000000000000000000000"),c=cs(a*e,t),o=cs(-r*e,t);let u=W(e-c*n-o*s,t),f=W(-c*r-o*a,t);const d=u>i,l=f>i;if(d&&(u=t-u),l&&(f=t-f),u>i||f>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:u,k2neg:l,k2:f}}}},ta),Ic=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:gr},Symbol.toStringTag,{value:"Module"})),Sc=/^(.*)\[([0-9]*)\]$/,Oc=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Sa=/^(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)?$/,us=2n**256n-1n;function Oa(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new on({signature:e});if(typeof e.s>"u")throw new on({signature:e});if(n&&typeof e.yParity>"u")throw new on({signature:e});if(e.r<0n||e.r>us)throw new Lc({value:e.r});if(e.s<0n||e.s>us)throw new Uc({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new wr({value:e.yParity})}function Gc(e){return Ga(Be(e))}function Ga(e){if(e.length!==130&&e.length!==132)throw new Cc({signature:e});const t=BigInt(ce(e,0,32)),n=BigInt(ce(e,32,64)),r=(()=>{const s=+`0x${e.slice(130)}`;if(!Number.isNaN(s))try{return br(s)}catch{throw new wr({value:s})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function Nc(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return kc(e)}function kc(e){const t=typeof e=="string"?Ga(e):e instanceof Uint8Array?Gc(e):typeof e.r=="string"?Tc(e):e.v?Fc(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return Oa(t),t}function Fc(e){return{r:e.r,s:e.s,yParity:br(e.v)}}function Tc(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=br(n)),typeof r!="number")throw new wr({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function br(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new Rc({value:e})}class Cc extends _{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${Fe(Si(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class on extends _{constructor({signature:t}){super(`Signature \`${Ii(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class Lc extends _{constructor({value:t}){super(`Value \`${t}\` 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"})}}class Uc extends _{constructor({value:t}){super(`Value \`${t}\` 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"})}}class wr extends _{constructor({value:t}){super(`Value \`${t}\` 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"})}}class Rc extends _{constructor({value:t}){super(`Value \`${t}\` 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"})}}function Ve(e,t,n){const{checksumAddress:r,staticPosition:s}=n,a=Pr(t.type);if(a){const[i,c]=a;return Dc(e,{...t,type:c},{checksumAddress:r,length:i,staticPosition:s})}if(t.type==="tuple")return Hc(e,t,{checksumAddress:r,staticPosition:s});if(t.type==="address")return $c(e,{checksum:r});if(t.type==="bool")return zc(e);if(t.type.startsWith("bytes"))return _c(e,t,{staticPosition:s});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Mc(e,t);if(t.type==="string")return Vc(e,{staticPosition:s});throw new Br(t.type)}const fs=32,xn=32;function $c(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(a=>n?la(a):a)(Be(zo(r,-20))),32]}function Dc(e,t,n){const{checksumAddress:r,length:s,staticPosition:a}=n;if(!s){const o=be(e.readBytes(xn)),u=a+o,f=u+fs;e.setPosition(u);const d=be(e.readBytes(fs)),l=st(t);let y=0;const m=[];for(let p=0;p<d;++p){e.setPosition(f+(l?p*32:y));const[b,P]=Ve(e,t,{checksumAddress:r,staticPosition:f});y+=P,m.push(b)}return e.setPosition(a+32),[m,32]}if(st(t)){const o=be(e.readBytes(xn)),u=a+o,f=[];for(let d=0;d<s;++d){e.setPosition(u+d*32);const[l]=Ve(e,t,{checksumAddress:r,staticPosition:u});f.push(l)}return e.setPosition(a+32),[f,32]}let i=0;const c=[];for(let o=0;o<s;++o){const[u,f]=Ve(e,t,{checksumAddress:r,staticPosition:a+i});i+=f,c.push(u)}return[c,i]}function zc(e){return[Mo(e.readBytes(32),{size:32}),32]}function _c(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const i=be(e.readBytes(32));e.setPosition(n+i);const c=be(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const o=e.readBytes(c);return e.setPosition(n+32),[Be(o),32]}return[Be(e.readBytes(Number.parseInt(s,10),32)),32]}function Mc(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),s=e.readBytes(32);return[r>48?_o(s,{signed:n}):be(s,{signed:n}),32]}function Hc(e,t,n){const{checksumAddress:r,staticPosition:s}=n,a=t.components.length===0||t.components.some(({name:o})=>!o),i=a?[]:{};let c=0;if(st(t)){const o=be(e.readBytes(xn)),u=s+o;for(let f=0;f<t.components.length;++f){const d=t.components[f];e.setPosition(u+c);const[l,y]=Ve(e,d,{checksumAddress:r,staticPosition:u});c+=y,i[a?f:d==null?void 0:d.name]=l}return e.setPosition(s+32),[i,32]}for(let o=0;o<t.components.length;++o){const u=t.components[o],[f,d]=Ve(e,u,{checksumAddress:r,staticPosition:s});i[a?o:u==null?void 0:u.name]=f,c+=d}return[i,c]}function Vc(e,{staticPosition:t}){const n=be(e.readBytes(32)),r=t+n;e.setPosition(r);const s=be(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const a=e.readBytes(s,32),i=Ho(fa(a));return e.setPosition(t+32),[i,32]}function jc({checksumAddress:e,parameters:t,values:n}){const r=[];for(let s=0;s<t.length;s++)r.push(vr({checksumAddress:e,parameter:t[s],value:n[s]}));return r}function vr({checksumAddress:e=!1,parameter:t,value:n}){const r=t,s=Pr(r.type);if(s){const[a,i]=s;return Zc(n,{checksumAddress:e,length:a,parameter:{...r,type:i}})}if(r.type==="tuple")return Xc(n,{checksumAddress:e,parameter:r});if(r.type==="address")return qc(n,{checksum:e});if(r.type==="bool")return Kc(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const a=r.type.startsWith("int"),[,,i="256"]=Sa.exec(r.type)??[];return Yc(n,{signed:a,size:Number(i)})}if(r.type.startsWith("bytes"))return Wc(n,{type:r.type});if(r.type==="string")return Jc(n);throw new Br(r.type)}function xr(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:i,encoded:c}=e[a];i?t+=32:t+=Fe(c)}const n=[],r=[];let s=0;for(let a=0;a<e.length;a++){const{dynamic:i,encoded:c}=e[a];i?(n.push(Ze(t+s,{size:32})),r.push(c),s+=Fe(c)):n.push(c)}return re(...n,...r)}function qc(e,t){const{checksum:n=!1}=t;return _t(e,{strict:n}),{dynamic:!1,encoded:tt(e.toLowerCase())}}function Zc(e,t){const{checksumAddress:n,length:r,parameter:s}=t,a=r===null;if(!Array.isArray(e))throw new ru(e);if(!a&&e.length!==r)throw new nu({expectedLength:r,givenLength:e.length,type:`${s.type}[${r}]`});let i=!1;const c=[];for(let o=0;o<e.length;o++){const u=vr({checksumAddress:n,parameter:s,value:e[o]});u.dynamic&&(i=!0),c.push(u)}if(a||i){const o=xr(c);if(a){const u=Ze(c.length,{size:32});return{dynamic:!0,encoded:c.length>0?re(u,o):u}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:re(...c.map(({encoded:o})=>o))}}function Wc(e,{type:t}){const[,n]=t.split("bytes"),r=Fe(e);if(!n){let s=e;return r%32!==0&&(s=je(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:re(tt(Ze(r,{size:32})),s)}}if(r!==Number.parseInt(n,10))throw new ka({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:je(e)}}function Kc(e){if(typeof e!="boolean")throw new _(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:tt(Gs(e))}}function Yc(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new Oi({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Ze(e,{size:32,signed:t})}}function Jc(e){const t=Qn(e),n=Math.ceil(Fe(t)/32),r=[];for(let s=0;s<n;s++)r.push(je(ce(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:re(je(Ze(Fe(t),{size:32})),...r)}}function Xc(e,t){const{checksumAddress:n,parameter:r}=t;let s=!1;const a=[];for(let i=0;i<r.components.length;i++){const c=r.components[i],o=Array.isArray(e)?i:c.name,u=vr({checksumAddress:n,parameter:c,value:e[o]});a.push(u),u.dynamic&&(s=!0)}return{dynamic:s,encoded:s?xr(a):re(...a.map(({encoded:i})=>i))}}function Pr(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function st(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(st);const n=Pr(e.type);return!!(n&&st({...e,type:n[1]}))}function Qc(e,t,n={}){const{as:r="Array",checksumAddress:s=!1}=n,a=typeof t=="string"?ua(t):t,i=Ko(a);if(ze(a)===0&&e.length>0)throw new tu;if(ze(a)&&ze(a)<32)throw new eu({data:typeof t=="string"?t:Be(t),parameters:e,size:ze(a)});let c=0;const o=r==="Array"?[]:{};for(let u=0;u<e.length;++u){const f=e[u];i.setPosition(c);const[d,l]=Ve(i,f,{checksumAddress:s,staticPosition:0});c+=l,r==="Array"?o.push(d):o[f.name??u]=d}return o}function Er(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new Fa({expectedLength:e.length,givenLength:t.length});const s=jc({checksumAddress:r,parameters:e,values:t}),a=xr(s);return a.length===0?"0x":a}function Pn(e,t){if(e.length!==t.length)throw new Fa({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],a=t[r];n.push(Pn.encode(s,a))}return re(...n)}(function(e){function t(n,r,s=!1){if(n==="address"){const o=r;return _t(o),tt(o.toLowerCase(),s?32:0)}if(n==="string")return Qn(r);if(n==="bytes")return r;if(n==="bool")return tt(Gs(r),s?32:1);const a=n.match(Sa);if(a){const[o,u,f="256"]=a,d=Number.parseInt(f,10)/8;return Ze(r,{size:s?32:d,signed:u==="int"})}const i=n.match(Oc);if(i){const[o,u]=i;if(Number.parseInt(u,10)!==(r.length-2)/2)throw new ka({expectedSize:Number.parseInt(u,10),value:r});return je(r,s?32:0)}const c=n.match(Sc);if(c&&Array.isArray(r)){const[o,u]=c,f=[];for(let d=0;d<r.length;d++)f.push(t(u,r[d],!0));return f.length===0?"0x":re(...f)}throw new Br(n)}e.encode=t})(Pn||(Pn={}));function Na(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Yr(e):e}class eu extends _{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Gi(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class tu extends _{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class nu extends _{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class ka extends _{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${Fe(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class Fa extends _{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
3
3
  `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class ru extends _{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class Br extends _{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function su(e,t={}){return typeof e.chainId=="string"?au(e):{...e,...t.signature}}function au(e){const{address:t,chainId:n,nonce:r}=e,s=Nc(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...s}}async function vt(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n!==void 0?R(n):void 0,a=await e.request({method:"eth_getCode",params:[t,s||r]},{dedupe:!!s});if(a!=="0x")return a}const Ta="0x6492649264926492649264926492649264926492649264926492649264926492";function iu(e){if(ce(e,-32)!==Ta)throw new uu(e)}function ou(e){const{data:t,signature:n,to:r}=e;return re(Er(Na("address, bytes, bytes"),[r,t,n]),Ta)}function cu(e){try{return iu(e),!0}catch{return!1}}let uu=class extends _{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}};const fu="0x8010801080108010801080108010801080108010801080108010801080108010",du=Na("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function Ca(e){if(typeof e=="string"){if(ce(e,-32)!==fu)throw new yu(e)}else Oa(e.authorization)}function lu(e){Ca(e);const t=Os(ce(e,-64,-32)),n=ce(e,-t-64,-64),r=ce(e,0,-t-64),[s,a,i]=Qc(du,n);return{authorization:su({address:s.delegation,chainId:Number(s.chainId),nonce:s.nonce,yParity:s.yParity,r:s.r,s:s.s}),signature:r,...i&&i!=="0x"?{data:i,to:a}:{}}}function pu(e){try{return Ca(e),!0}catch{return!1}}class yu extends _{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}function mu(e){const t=M(`0x${e.substring(4)}`).substring(26);return Ni(`0x${t}`)}async function hu({hash:e,signature:t}){const n=et(e)?e:Te(e),{secp256k1:r}=await ki(async()=>{const{secp256k1:i}=await Promise.resolve().then(()=>Ic);return{secp256k1:i}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:u,s:f,v:d,yParity:l}=t,y=Number(l??d),m=ds(y);return new r.Signature(Y(u),Y(f)).addRecoveryBit(m)}const i=et(t)?t:Te(t);if(ke(i)!==65)throw new Error("invalid signature length");const c=fe(`0x${i.slice(130)}`),o=ds(c);return r.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(o)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function ds(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function La({hash:e,signature:t}){return mu(await hu({hash:e,signature:t}))}function gu(e){const{chainId:t,nonce:n,to:r}=e,s=e.contractAddress??e.address,a=M(at(["0x05",uo([t?R(t):"0x",s,n?R(n):"0x"])]));return r==="bytes"?Ee(a):a}async function Ua(e){const{authorization:t,signature:n}=e;return La({hash:gu(t),signature:n??t})}async function bu({address:e,authorization:t,signature:n}){return ot(Ns(e),await Ua({authorization:t,signature:n}))}function wu({r:e,s:t,to:n="hex",v:r,yParity:s}){const a=(()=>{if(s===0||s===1)return s;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),i=`0x${new gr.Signature(Y(e),Y(t)).toCompactHex()}${a===0?"1b":"1c"}`;return n==="hex"?i:Ee(i)}async function Mt(e,t){var o,u,f,d;const{address:n,chain:r=e.chain,hash:s,erc6492VerifierAddress:a=t.universalSignatureVerifierAddress??((u=(o=r==null?void 0:r.contracts)==null?void 0:o.erc6492Verifier)==null?void 0:u.address),multicallAddress:i=t.multicallAddress??((d=(f=r==null?void 0:r.contracts)==null?void 0:f.multicall3)==null?void 0:d.address)}=t;if(r!=null&&r.verifyHash)return await r.verifyHash(e,t);const c=(()=>{const l=t.signature;return et(l)?l:typeof l=="object"&&"r"in l&&"s"in l?wu(l):de(l)})();try{return pu(c)?await vu(e,{...t,multicallAddress:i,signature:c}):await xu(e,{...t,verifierAddress:a,signature:c})}catch(l){try{if(ot(Ns(n),await La({hash:s,signature:c})))return!0}catch{}if(l instanceof Ce)return!1;throw l}}async function vu(e,t){var b;const{address:n,blockNumber:r,blockTag:s,hash:a,multicallAddress:i}=t,{authorization:c,data:o,signature:u,to:f}=lu(t.signature);if(await vt(e,{address:n,blockNumber:r,blockTag:s})===at(["0xef0100",c.address]))return await Pu(e,{address:n,blockNumber:r,blockTag:s,hash:a,signature:u});const l={address:c.address,chainId:Number(c.chainId),nonce:Number(c.nonce),r:R(c.r,{size:32}),s:R(c.s,{size:32}),yParity:c.yParity};if(!await bu({address:n,authorization:l}))throw new Ce;const m=await T(e,se,"readContract")({...i?{address:i}:{code:Ti},authorizationList:[l],abi:Fi,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...o?[{allowFailure:!0,target:f??n,callData:o}]:[],{allowFailure:!0,target:n,callData:we({abi:ks,functionName:"isValidSignature",args:[a,u]})}]]}),p=(b=m[m.length-1])==null?void 0:b.returnData;if(p!=null&&p.startsWith("0x1626ba7e"))return!0;throw new Ce}async function xu(e,t){const{address:n,factory:r,factoryData:s,hash:a,signature:i,verifierAddress:c,...o}=t,u=await(async()=>!r&&!s||cu(i)?i:ou({data:s,signature:i,to:r}))(),f=c?{to:c,data:we({abi:_r,functionName:"isValidSig",args:[n,a,u]}),...o}:{data:Ci({abi:_r,args:[n,a,u],bytecode:Ri}),...o},{data:d}=await T(e,er,"call")(f).catch(l=>{throw l instanceof Li?new Ce:l});if(Ui(d??"0x0"))return!0;throw new Ce}async function Pu(e,t){const{address:n,blockNumber:r,blockTag:s,hash:a,signature:i}=t;if((await T(e,se,"readContract")({address:n,abi:ks,args:[a,i],blockNumber:r,blockTag:s,functionName:"isValidSignature"}).catch(o=>{throw o instanceof Fs?new Ce:o})).startsWith("0x1626ba7e"))return!0;throw new Ce}class Ce extends Error{}function Ar(e){var n,r,s,a,i,c;if(!(e instanceof F))return!1;const t=e.walk(o=>o instanceof dn);return t instanceof dn?((n=t.data)==null?void 0:n.errorName)==="HttpError"||((r=t.data)==null?void 0:r.errorName)==="ResolverError"||((s=t.data)==null?void 0:s.errorName)==="ResolverNotContract"||((a=t.data)==null?void 0:a.errorName)==="ResolverNotFound"||((i=t.data)==null?void 0:i.errorName)==="ReverseAddressMismatch"||((c=t.data)==null?void 0:c.errorName)==="UnsupportedResolverProfile":!1}function Ra(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return et(t)?t:null}function En(e){let t=new Uint8Array(32).fill(0);if(!e)return de(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const s=Ra(n[r]),a=s?Ft(s):M(Qe(n[r]),"bytes");t=M(ue([t,a]),"bytes")}return de(t)}function Eu(e){return`[${e.slice(2)}]`}function Bu(e){const t=new Uint8Array(32).fill(0);return e?Ra(e)||M(Qe(e)):de(t)}function Ir(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(Qe(t).byteLength+2);let r=0;const s=t.split(".");for(let a=0;a<s.length;a++){let i=Qe(s[a]);i.byteLength>255&&(i=Qe(Eu(Bu(s[a])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function Au(e,t){const{blockNumber:n,blockTag:r,coinType:s,name:a,gatewayUrls:i,strict:c}=t,{chain:o}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!o)throw new Error("client chain not configured. universalResolverAddress is required.");return Tt({blockNumber:n,chain:o,contract:"ensUniversalResolver"})})(),f=o==null?void 0:o.ensTlds;if(f&&!f.some(l=>a.endsWith(l)))return null;const d=s!=null?[En(a),BigInt(s)]:[En(a)];try{const l=we({abi:Mr,functionName:"addr",args:d}),y={address:u,abi:Ts,functionName:"resolveWithGateways",args:[Te(Ir(a)),l,i??[ur]],blockNumber:n,blockTag:r},p=await T(e,se,"readContract")(y);if(p[0]==="0x")return null;const b=Ct({abi:Mr,args:d,functionName:"addr",data:p[0]});return b==="0x"||Cs(b)==="0x00"?null:b}catch(l){if(c)throw l;if(Ar(l))return null;throw l}}class Iu extends F{constructor({data:t}){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(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class Xe extends F{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class Sr extends F{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class Su extends F{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const Ou=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Gu=/^(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>\/.*)?$/,Nu=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,ku=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Fu(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function ls(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function $a({uri:e,gatewayUrls:t}){const n=Nu.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=ls(t==null?void 0:t.ipfs,"https://ipfs.io"),s=ls(t==null?void 0:t.arweave,"https://arweave.net"),a=e.match(Ou),{protocol:i,subpath:c,target:o,subtarget:u=""}=(a==null?void 0:a.groups)||{},f=i==="ipns:/"||c==="ipns/",d=i==="ipfs:/"||c==="ipfs/"||Gu.test(e);if(e.startsWith("http")&&!f&&!d){let y=e;return t!=null&&t.arweave&&(y=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:y,isOnChain:!1,isEncoded:!1}}if((f||d)&&o)return{uri:`${r}/${f?"ipns":"ipfs"}/${o}${u}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&o)return{uri:`${s}/${o}${u||""}`,isOnChain:!1,isEncoded:!1};let l=e.replace(ku,"");if(l.startsWith("<svg")&&(l=`data:image/svg+xml;base64,${btoa(l)}`),l.startsWith("data:")||l.startsWith("{"))return{uri:l,isOnChain:!0,isEncoded:!1};throw new Sr({uri:e})}function Da(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Iu({data:e});return e.image||e.image_url||e.image_data}async function Tu({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(s=>s.json());return await Or({gatewayUrls:e,uri:Da(n)})}catch{throw new Sr({uri:t})}}async function Or({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=$a({uri:t,gatewayUrls:e});if(r||await Fu(n))return n;throw new Sr({uri:t})}function Cu(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[a,i]=n.split(":"),[c,o]=r.split(":");if(!a||a.toLowerCase()!=="eip155")throw new Xe({reason:"Only EIP-155 supported"});if(!i)throw new Xe({reason:"Chain ID not found"});if(!o)throw new Xe({reason:"Contract address not found"});if(!s)throw new Xe({reason:"Token ID not found"});if(!c)throw new Xe({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:c.toLowerCase(),contractAddress:o,tokenID:s}}async function Lu(e,{nft:t}){if(t.namespace==="erc721")return se(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return se(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new Su({namespace:t.namespace})}async function Uu(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Ru(e,{gatewayUrls:t,record:n}):Or({uri:n,gatewayUrls:t})}async function Ru(e,{gatewayUrls:t,record:n}){const r=Cu(n),s=await Lu(e,{nft:r}),{uri:a,isOnChain:i,isEncoded:c}=$a({uri:s,gatewayUrls:t});if(i&&(a.includes("data:application/json;base64,")||a.startsWith("{"))){const u=c?atob(a.replace("data:application/json;base64,","")):a,f=JSON.parse(u);return Or({uri:Da(f),gatewayUrls:t})}let o=r.tokenID;return r.namespace==="erc1155"&&(o=o.replace("0x","").padStart(64,"0")),Tu({gatewayUrls:t,uri:a.replace(/(?:0x)?{id}/,o)})}async function za(e,t){const{blockNumber:n,blockTag:r,key:s,name:a,gatewayUrls:i,strict:c}=t,{chain:o}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!o)throw new Error("client chain not configured. universalResolverAddress is required.");return Tt({blockNumber:n,chain:o,contract:"ensUniversalResolver"})})(),f=o==null?void 0:o.ensTlds;if(f&&!f.some(d=>a.endsWith(d)))return null;try{const d={address:u,abi:Ts,args:[Te(Ir(a)),we({abi:Hr,functionName:"text",args:[En(a),s]}),i??[ur]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},y=await T(e,se,"readContract")(d);if(y[0]==="0x")return null;const m=Ct({abi:Hr,functionName:"text",data:y[0]});return m===""?null:m}catch(d){if(c)throw d;if(Ar(d))return null;throw d}}async function $u(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:a,strict:i,universalResolverAddress:c}){const o=await T(e,za,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:c,gatewayUrls:a,strict:i});if(!o)return null;try{return await Uu(e,{record:o,gatewayUrls:r})}catch{return null}}async function Du(e,t){const{address:n,blockNumber:r,blockTag:s,coinType:a=60n,gatewayUrls:i,strict:c}=t,{chain:o}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!o)throw new Error("client chain not configured. universalResolverAddress is required.");return Tt({blockNumber:r,chain:o,contract:"ensUniversalResolver"})})();try{const f={address:u,abi:$i,args:[n,a,i??[ur]],functionName:"reverseWithGateways",blockNumber:r,blockTag:s},d=T(e,se,"readContract"),[l]=await d(f);return l||null}catch(f){if(c)throw f;if(Ar(f))return null;throw f}}async function zu(e,t){const{blockNumber:n,blockTag:r,name:s}=t,{chain:a}=e,i=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return Tt({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),c=a==null?void 0:a.ensTlds;if(c&&!c.some(u=>s.endsWith(u)))throw new Error(`${s} is not a valid ENS TLD (${c==null?void 0:c.join(", ")}) for chain "${a.name}" (id: ${a.id}).`);const[o]=await T(e,se,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Te(Ir(s))],blockNumber:n,blockTag:r});return o}async function _a(e,t){var b,P,E;const{account:n=e.account,blockNumber:r,blockTag:s="latest",blobs:a,data:i,gas:c,gasPrice:o,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:d,to:l,value:y,...m}=t,p=n?J(n):void 0;try{it(t);const h=(typeof r=="bigint"?R(r):void 0)||s,B=(E=(P=(b=e.chain)==null?void 0:b.formatters)==null?void 0:P.transactionRequest)==null?void 0:E.format,g=(B||Lt)({...tr(m,{format:B}),account:p,blobs:a,data:i,gas:c,gasPrice:o,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:d,to:l,value:y},"createAccessList"),x=await e.request({method:"eth_createAccessList",params:[g,h]});return{accessList:x.accessList,gasUsed:BigInt(x.gasUsed)}}catch(w){throw Di(w,{...t,account:p,chain:e.chain})}}function Ht(e,{method:t}){var r,s;const n={};return e.transport.type==="fallback"&&((s=(r=e.transport).onResponse)==null||s.call(r,({method:a,response:i,status:c,transport:o})=>{c==="success"&&t===a&&(n[i]=o.request)})),a=>n[a]||e.request}async function _u(e){const t=Ht(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}class Mu extends F{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const ps="/docs/contract/encodeEventTopics";function dt(e){var o;const{abi:t,eventName:n,args:r}=e;let s=t[0];if(n){const u=Ls({abi:t,name:n});if(!u)throw new Vr(n,{docsPath:ps});s=u}if(s.type!=="event")throw new Vr(void 0,{docsPath:ps});const a=Us(s),i=nr(a);let c=[];if(r&&"inputs"in s){const u=(o=s.inputs)==null?void 0:o.filter(d=>"indexed"in d&&d.indexed),f=Array.isArray(r)?r:Object.values(r).length>0?(u==null?void 0:u.map(d=>r[d.name]))??[]:[];f.length>0&&(c=(u==null?void 0:u.map((d,l)=>Array.isArray(f[l])?f[l].map((y,m)=>ys({param:d,value:f[l][m]})):typeof f[l]<"u"&&f[l]!==null?ys({param:d,value:f[l]}):null))??[])}return[i,...c]}function ys({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return M(Ft(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Mu(e.type);return Ge([e],[t])}async function Ma(e,t){const{address:n,abi:r,args:s,eventName:a,fromBlock:i,strict:c,toBlock:o}=t,u=Ht(e,{method:"eth_newFilter"}),f=a?dt({abi:r,args:s,eventName:a}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?R(i):i,toBlock:typeof o=="bigint"?R(o):o,topics:f}]});return{abi:r,args:s,eventName:a,id:d,request:u(d),strict:!!c,type:"event"}}async function Ha(e,{address:t,args:n,event:r,events:s,fromBlock:a,strict:i,toBlock:c}={}){const o=s??(r?[r]:void 0),u=Ht(e,{method:"eth_newFilter"});let f=[];o&&(f=[o.flatMap(y=>dt({abi:[y],eventName:y.name,args:n}))],r&&(f=f[0]));const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof a=="bigint"?R(a):a,toBlock:typeof c=="bigint"?R(c):c,...f.length?{topics:f}:{}}]});return{abi:o,args:n,eventName:r?r.name:void 0,fromBlock:a,id:d,request:u(d),strict:!!i,toBlock:c,type:"event"}}async function Va(e){const t=Ht(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}class Hu extends F{constructor(t,{account:n,docsPath:r,chain:s,data:a,gas:i,gasPrice:c,maxFeePerGas:o,maxPriorityFeePerGas:u,nonce:f,to:d,value:l}){var m;const y=Rs({from:n==null?void 0:n.address,to:d,value:typeof l<"u"&&`${zi(l)} ${((m=s==null?void 0:s.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:a,gas:i,gasPrice:typeof c<"u"&&`${Me(c)} gwei`,maxFeePerGas:typeof o<"u"&&`${Me(o)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Me(u)} gwei`,nonce:f});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",y].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function Vu(e,{docsPath:t,...n}){const r=(()=>{const s=rr(e,n);return s instanceof sr?e:s})();return new Hu(r,{docsPath:t,...n})}class ja extends F{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Gr extends F{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class ju extends F{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Me(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class qa extends F{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}async function ne(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:s}={}){var u,f,d;const a=s??!1,i=n!==void 0?R(n):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,a]},{dedupe:!0}):c=await e.request({method:"eth_getBlockByNumber",params:[i||r,a]},{dedupe:!!i}),!c)throw new qa({blockHash:t,blockNumber:n});return(((d=(f=(u=e.chain)==null?void 0:u.formatters)==null?void 0:f.block)==null?void 0:d.format)||dr)(c,"getBlock")}async function Nr(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function qu(e,t){return Za(e,t)}async function Za(e,t){var a,i;const{block:n,chain:r=e.chain,request:s}=t||{};try{const c=((a=r==null?void 0:r.fees)==null?void 0:a.maxPriorityFeePerGas)??((i=r==null?void 0:r.fees)==null?void 0:i.defaultPriorityFee);if(typeof c=="function"){const u=n||await T(e,ne,"getBlock")({}),f=await c({block:u,client:e,request:s});if(f===null)throw new Error;return f}if(typeof c<"u")return c;const o=await e.request({method:"eth_maxPriorityFeePerGas"});return Y(o)}catch{const[c,o]=await Promise.all([n?Promise.resolve(n):T(e,ne,"getBlock")({}),T(e,Nr,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new Gr;const u=o-c.baseFeePerGas;return u<0n?0n:u}}async function Wa(e,t){return Bn(e,t)}async function Bn(e,t){var l,y;const{block:n,chain:r=e.chain,request:s,type:a="eip1559"}=t||{},i=await(async()=>{var m,p;return typeof((m=r==null?void 0:r.fees)==null?void 0:m.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):((p=r==null?void 0:r.fees)==null?void 0:p.baseFeeMultiplier)??1.2})();if(i<1)throw new ja;const o=10**(((l=i.toString().split(".")[1])==null?void 0:l.length)??0),u=m=>m*BigInt(Math.ceil(i*o))/BigInt(o),f=n||await T(e,ne,"getBlock")({});if(typeof((y=r==null?void 0:r.fees)==null?void 0:y.estimateFeesPerGas)=="function"){const m=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:u,request:s,type:a});if(m!==null)return m}if(a==="eip1559"){if(typeof f.baseFeePerGas!="bigint")throw new Gr;const m=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await Za(e,{block:f,chain:r,request:s}),p=u(f.baseFeePerGas);return{maxFeePerGas:(s==null?void 0:s.maxFeePerGas)??p+m,maxPriorityFeePerGas:m}}return{gasPrice:(s==null?void 0:s.gasPrice)??u(await T(e,Nr,"getGasPrice")({}))}}async function kr(e,{address:t,blockTag:n="latest",blockNumber:r}){const s=await e.request({method:"eth_getTransactionCount",params:[t,typeof r=="bigint"?R(r):n]},{dedupe:!!r});return fe(s)}function Zu(e,{docsPath:t,...n}){const r=(()=>{const s=rr(e,n);return s instanceof sr?e:s})();return new _i(r,{docsPath:t,...n})}async function We(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return fe(t)}async function Ka(e,t){var x,O,U,S,k;const{account:n=e.account,accessList:r,authorizationList:s,chain:a=e.chain,blobVersionedHashes:i,blobs:c,data:o,gas:u,gasPrice:f,maxFeePerBlobGas:d,maxFeePerGas:l,maxPriorityFeePerGas:y,nonce:m,nonceManager:p,to:b,type:P,value:E,...w}=t,h=await(async()=>{if(!n||!p||typeof m<"u")return m;const N=J(n),z=a?a.id:await T(e,We,"getChainId")({});return await p.consume({address:N.address,chainId:z,client:e})})();it(t);const B=(O=(x=a==null?void 0:a.formatters)==null?void 0:x.transactionRequest)==null?void 0:O.format,g=(B||Lt)({...tr(w,{format:B}),account:n?J(n):void 0,accessList:r,authorizationList:s,blobs:c,blobVersionedHashes:i,data:o,gas:u,gasPrice:f,maxFeePerBlobGas:d,maxFeePerGas:l,maxPriorityFeePerGas:y,nonce:h,to:b,type:P,value:E},"fillTransaction");try{const N=await e.request({method:"eth_fillTransaction",params:[g]}),v=(((S=(U=a==null?void 0:a.formatters)==null?void 0:U.transaction)==null?void 0:S.format)||Ut)(N.tx);delete v.blockHash,delete v.blockNumber,delete v.r,delete v.s,delete v.transactionIndex,delete v.v,delete v.yParity,v.data=v.input,v.gas&&(v.gas=t.gas??v.gas),v.gasPrice&&(v.gasPrice=t.gasPrice??v.gasPrice),v.maxFeePerBlobGas&&(v.maxFeePerBlobGas=t.maxFeePerBlobGas??v.maxFeePerBlobGas),v.maxFeePerGas&&(v.maxFeePerGas=t.maxFeePerGas??v.maxFeePerGas),v.maxPriorityFeePerGas&&(v.maxPriorityFeePerGas=t.maxPriorityFeePerGas??v.maxPriorityFeePerGas),v.nonce&&(v.nonce=t.nonce??v.nonce);const A=await(async()=>{var $,D;if(typeof(($=a==null?void 0:a.fees)==null?void 0:$.baseFeeMultiplier)=="function"){const H=await T(e,ne,"getBlock")({});return a.fees.baseFeeMultiplier({block:H,client:e,request:t})}return((D=a==null?void 0:a.fees)==null?void 0:D.baseFeeMultiplier)??1.2})();if(A<1)throw new ja;const I=10**(((k=A.toString().split(".")[1])==null?void 0:k.length)??0),L=$=>$*BigInt(Math.ceil(A*I))/BigInt(I);return v.maxFeePerGas&&!t.maxFeePerGas&&(v.maxFeePerGas=L(v.maxFeePerGas)),v.gasPrice&&!t.gasPrice&&(v.gasPrice=L(v.gasPrice)),{raw:N.raw,transaction:{from:g.from,...v}}}catch(N){throw Zu(N,{...t,chain:e.chain})}}const Wu=["blobVersionedHashes","chainId","fees","gas","nonce","type"],ms=new Map,cn=new $s(128);async function Ya(e,t){var h,B,G;let n=t;n.account??(n.account=e.account),n.parameters??(n.parameters=Wu);const{account:r,chain:s=e.chain,nonceManager:a,parameters:i}=n,c=(()=>{if(typeof(s==null?void 0:s.prepareTransactionRequest)=="function")return{fn:s.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(s==null?void 0:s.prepareTransactionRequest))return{fn:s.prepareTransactionRequest[0],runAt:s.prepareTransactionRequest[1].runAt}})();let o;async function u(){return o||(typeof n.chainId<"u"?n.chainId:s?s.id:(o=await T(e,We,"getChainId")({}),o))}const f=r&&J(r);let d=n.nonce;if(i.includes("nonce")&&typeof d>"u"&&f&&a){const g=await u();d=await a.consume({address:f.address,chainId:g,client:e})}c!=null&&c.fn&&((h=c.runAt)!=null&&h.includes("beforeFillTransaction"))&&(n=await c.fn({...n,chain:s},{phase:"beforeFillTransaction"}),d??(d=n.nonce));const y=((i.includes("blobVersionedHashes")||i.includes("sidecars"))&&n.kzg&&n.blobs||cn.get(e.uid)===!1||!["fees","gas"].some(x=>i.includes(x))?!1:!!(i.includes("chainId")&&typeof n.chainId!="number"||i.includes("nonce")&&typeof d!="number"||i.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||i.includes("gas")&&typeof n.gas!="bigint"))?await T(e,Ka,"fillTransaction")({...n,nonce:d}).then(g=>{const{chainId:x,from:O,gas:U,gasPrice:S,nonce:k,maxFeePerBlobGas:N,maxFeePerGas:z,maxPriorityFeePerGas:v,type:A,...C}=g.transaction;return cn.set(e.uid,!0),{...n,...O?{from:O}:{},...A?{type:A}:{},...typeof x<"u"?{chainId:x}:{},...typeof U<"u"?{gas:U}:{},...typeof S<"u"?{gasPrice:S}:{},...typeof k<"u"?{nonce:k}:{},...typeof N<"u"?{maxFeePerBlobGas:N}:{},...typeof z<"u"?{maxFeePerGas:z}:{},...typeof v<"u"?{maxPriorityFeePerGas:v}:{},..."nonceKey"in C&&typeof C.nonceKey<"u"?{nonceKey:C.nonceKey}:{}}}).catch(g=>{var U;const x=g;return x.name!=="TransactionExecutionError"||((U=x.walk)==null?void 0:U.call(x,S=>{const k=S;return k.name==="MethodNotFoundRpcError"||k.name==="MethodNotSupportedRpcError"}))&&cn.set(e.uid,!1),n}):n;d??(d=y.nonce),n={...y,...f?{from:f==null?void 0:f.address}:{},...d?{nonce:d}:{}};const{blobs:m,gas:p,kzg:b,type:P}=n;c!=null&&c.fn&&((B=c.runAt)!=null&&B.includes("beforeFillParameters"))&&(n=await c.fn({...n,chain:s},{phase:"beforeFillParameters"}));let E;async function w(){return E||(E=await T(e,ne,"getBlock")({blockTag:"latest"}),E)}if(i.includes("nonce")&&typeof d>"u"&&f&&!a&&(n.nonce=await T(e,kr,"getTransactionCount")({address:f.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&m&&b){const g=Qs({blobs:m,kzg:b});if(i.includes("blobVersionedHashes")){const x=Po({commitments:g,to:"hex"});n.blobVersionedHashes=x}if(i.includes("sidecars")){const x=ea({blobs:m,commitments:g,kzg:b}),O=So({blobs:m,commitments:g,proofs:x,to:"hex"});n.sidecars=O}}if(i.includes("chainId")&&(n.chainId=await u()),(i.includes("fees")||i.includes("type"))&&typeof P>"u")try{n.type=Oo(n)}catch{let g=ms.get(e.uid);if(typeof g>"u"){const x=await w();g=typeof(x==null?void 0:x.baseFeePerGas)=="bigint",ms.set(e.uid,g)}n.type=g?"eip1559":"legacy"}if(i.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const g=await w(),{maxFeePerGas:x,maxPriorityFeePerGas:O}=await Bn(e,{block:g,chain:s,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<O)throw new ju({maxPriorityFeePerGas:O});n.maxPriorityFeePerGas=O,n.maxFeePerGas=x}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new Gr;if(typeof n.gasPrice>"u"){const g=await w(),{gasPrice:x}=await Bn(e,{block:g,chain:s,request:n,type:"legacy"});n.gasPrice=x}}return i.includes("gas")&&typeof p>"u"&&(n.gas=await T(e,Fr,"estimateGas")({...n,account:f,prepare:(f==null?void 0:f.type)==="local"?[]:["blobVersionedHashes"]})),c!=null&&c.fn&&((G=c.runAt)!=null&&G.includes("afterFillParameters"))&&(n=await c.fn({...n,chain:s},{phase:"afterFillParameters"})),it(n),delete n.parameters,n}async function Fr(e,t){var i,c,o;const{account:n=e.account,prepare:r=!0}=t,s=n?J(n):void 0,a=(()=>{if(Array.isArray(r))return r;if((s==null?void 0:s.type)!=="local")return["blobVersionedHashes"]})();try{const u=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await Ua({authorization:t.authorizationList[0]}).catch(()=>{throw new F("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:f,authorizationList:d,blobs:l,blobVersionedHashes:y,blockNumber:m,blockTag:p,data:b,gas:P,gasPrice:E,maxFeePerBlobGas:w,maxFeePerGas:h,maxPriorityFeePerGas:B,nonce:G,value:g,stateOverride:x,...O}=r?await Ya(e,{...t,parameters:a,to:u}):t;if(P&&t.gas!==P)return P;const S=(typeof m=="bigint"?R(m):void 0)||p,k=ar(x);it(t);const N=(o=(c=(i=e.chain)==null?void 0:i.formatters)==null?void 0:c.transactionRequest)==null?void 0:o.format,v=(N||Lt)({...tr(O,{format:N}),account:s,accessList:f,authorizationList:d,blobs:l,blobVersionedHashes:y,data:b,gasPrice:E,maxFeePerBlobGas:w,maxFeePerGas:h,maxPriorityFeePerGas:B,nonce:G,to:u,value:g},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:k?[v,S??e.experimental_blockTag??"latest",k]:S?[v,S]:[v]}))}catch(u){throw Vu(u,{...t,account:s,chain:e.chain})}}async function Ku(e,t){const{abi:n,address:r,args:s,functionName:a,dataSuffix:i,...c}=t,o=we({abi:n,args:s,functionName:a});try{return await T(e,Fr,"estimateGas")({data:`${o}${i?i.replace("0x",""):""}`,to:r,...c})}catch(u){const f=c.account?J(c.account):void 0;throw ir(u,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:a,sender:f==null?void 0:f.address})}}async function Yu(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}const Ju=new Map,Xu=new Map;function Qu(e){const t=(s,a)=>({clear:()=>a.delete(s),get:()=>a.get(s),set:i=>a.set(s,i)}),n=t(e,Ju),r=t(e,Xu);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function ef(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=Qu(t),s=r.response.get();if(s&&n>0&&Date.now()-s.created.getTime()<n)return s.data;let a=r.promise.get();a||(a=e(),r.promise.set(a));try{const i=await a;return r.response.set({created:new Date,data:i}),i}finally{r.promise.clear()}}const tf=e=>`blockNumber.${e}`;async function lt(e,{cacheTime:t=e.cacheTime}={}){const n=await ef(()=>e.request({method:"eth_blockNumber"}),{cacheKey:tf(e.uid),cacheTime:t});return BigInt(n)}async function nf(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=n!==void 0?R(n):void 0;let a;return t?a=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):a=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]},{dedupe:!!s}),fe(a)}const hs="/docs/contract/decodeEventLog";function xt(e){const{abi:t,data:n,strict:r,topics:s}=e,a=r??!0,[i,...c]=s;if(!i)throw new Mi({docsPath:hs});const o=t.find(p=>p.type==="event"&&i===nr(Us(p)));if(!(o&&"name"in o)||o.type!=="event")throw new Hi(i,{docsPath:hs});const{name:u,inputs:f}=o,d=f==null?void 0:f.some(p=>!("name"in p&&p.name)),l=d?[]:{},y=f.map((p,b)=>[p,b]).filter(([p])=>"indexed"in p&&p.indexed);for(let p=0;p<y.length;p++){const[b,P]=y[p],E=c[p];if(!E)throw new or({abiItem:o,param:b});l[d?P:b.name||P]=rf({param:b,value:E})}const m=f.filter(p=>!("indexed"in p&&p.indexed));if(m.length>0){if(n&&n!=="0x")try{const p=Ds(m,n);if(p)if(d)for(let b=0;b<f.length;b++)l[b]=l[b]??p.shift();else for(let b=0;b<m.length;b++)l[m[b].name]=p[b]}catch(p){if(a)throw p instanceof Vi||p instanceof ji?new gt({abiItem:o,data:n,params:m,size:ke(n)}):p}else if(a)throw new gt({abiItem:o,data:"0x",params:m,size:0})}return{eventName:u,args:Object.values(l).length>0?l:void 0}}function rf({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Ds([e],t)||[])[0]}function Tr(e){const{abi:t,args:n,logs:r,strict:s=!0}=e,a=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return r.map(i=>{var f;const c=t.filter(d=>d.type==="event"&&i.topics[0]===nr(d));if(c.length===0)return null;let o,u;for(const d of c)try{o=xt({...i,abi:[d],strict:!0}),u=d;break}catch{}if(!o&&!s){u=c[0];try{o=xt({...i,abi:[u],strict:!1})}catch{const d=(f=u.inputs)==null?void 0:f.some(l=>!("name"in l&&l.name));return{...i,args:d?[]:{},eventName:u.name}}}return!o||!u||a&&!a.includes(o.eventName)||!sf({args:o.args,inputs:u.inputs,matchArgs:n})?null:{...o,...i}}).filter(Boolean)}function sf(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function s(a,i,c){try{return a.type==="address"?ot(i,c):a.type==="string"||a.type==="bytes"?M(Ft(i))===c:i===c}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((a,i)=>{if(a==null)return!0;const c=n[i];return c?(Array.isArray(a)?a:[a]).some(u=>s(c,u,t[i])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([a,i])=>{if(i==null)return!0;const c=n.find(u=>u.name===a);return c?(Array.isArray(i)?i:[i]).some(u=>s(c,u,t[a])):!1}):!1}async function Cr(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:a,events:i,args:c,strict:o}={}){const u=o??!1,f=i??(a?[a]:void 0);let d=[];f&&(d=[f.flatMap(p=>dt({abi:[p],eventName:p.name,args:i?void 0:c}))],a&&(d=d[0]));let l;n?l=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:n}]}):l=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:typeof r=="bigint"?R(r):r,toBlock:typeof s=="bigint"?R(s):s}]});const y=l.map(m=>le(m));return f?Tr({abi:f,args:c,logs:y,strict:u}):y}async function Ja(e,t){const{abi:n,address:r,args:s,blockHash:a,eventName:i,fromBlock:c,toBlock:o,strict:u}=t,f=i?Ls({abi:n,name:i}):void 0,d=f?void 0:n.filter(l=>l.type==="event");return T(e,Cr,"getLogs")({address:r,args:s,blockHash:a,event:f,events:d,fromBlock:c,toBlock:o,strict:u})}class af extends F{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function of(e,t){const{address:n,factory:r,factoryData:s}=t;try{const[a,i,c,o,u,f,d]=await T(e,se,"readContract")({abi:cf,address:n,functionName:"eip712Domain",factory:r,factoryData:s});return{domain:{name:i,version:c,chainId:Number(o),verifyingContract:u,salt:f},extensions:d,fields:a}}catch(a){const i=a;throw i.name==="ContractFunctionExecutionError"&&i.cause.name==="ContractFunctionZeroDataError"?new af({address:n}):i}}const cf=[{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"}];function uf(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function ff(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const a=typeof n=="bigint"?R(n):void 0,i=await e.request({method:"eth_feeHistory",params:[R(t),a||r,s]},{dedupe:!!a});return uf(i)}async function Vt(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const s=r.map(a=>le(a));return!("abi"in t)||!t.abi?s:Tr({abi:t.abi,logs:s,strict:n})}async function df(e,{filter:t}){const n=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(a=>le(a));return t.abi?Tr({abi:t.abi,logs:s,strict:n}):s}function _d(e,t){if(e.length!==t.length)throw new qi({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],a=t[r];n.push(Xa(s,a))}return at(n)}function Xa(e,t,n=!1){if(e==="address"){const i=t;if(!cr(i))throw new zs({address:i});return X(i.toLowerCase(),{size:n?32:null})}if(e==="string")return ln(t);if(e==="bytes")return t;if(e==="bool")return X(Zi(t),{size:n?32:1});const r=e.match(_s);if(r){const[i,c,o="256"]=r,u=Number.parseInt(o,10)/8;return R(t,{size:n?32:u,signed:c==="int"})}const s=e.match(Ms);if(s){const[i,c]=s;if(Number.parseInt(c,10)!==(t.length-2)/2)throw new Hs({expectedSize:Number.parseInt(c,10),givenSize:(t.length-2)/2});return X(t,{dir:"right",size:n?32:null})}const a=e.match(Wi);if(a&&Array.isArray(t)){const[i,c]=a,o=[];for(let u=0;u<t.length;u++)o.push(Xa(c,t[u],!0));return o.length===0?"0x":at(o)}throw new Ki(e)}function lf(e){const{source:t}=e,n=new Map,r=new $s(8192),s=new Map,a=({address:i,chainId:c})=>`${i}.${c}`;return{async consume({address:i,chainId:c,client:o}){const u=a({address:i,chainId:c}),f=this.get({address:i,chainId:c,client:o});this.increment({address:i,chainId:c});const d=await f;return await t.set({address:i,chainId:c},d),r.set(u,d),d},async increment({address:i,chainId:c}){const o=a({address:i,chainId:c}),u=n.get(o)??0;n.set(o,u+1)},async get({address:i,chainId:c,client:o}){const u=a({address:i,chainId:c});let f=s.get(u);return f||(f=(async()=>{try{const l=await t.get({address:i,chainId:c,client:o}),y=r.get(u)??0;return y>0&&l<=y?y+1:(r.delete(u),l)}finally{this.reset({address:i,chainId:c})}})(),s.set(u,f)),(n.get(u)??0)+await f},reset({address:i,chainId:c}){const o=a({address:i,chainId:c});n.delete(o),s.delete(o)}}}const pf=`Ethereum Signed Message:
4
4
  `;function yf(e){const t=typeof e=="string"?ln(e):typeof e.raw=="string"?e.raw:de(e.raw),n=ln(`${pf}${ke(t)}`);return ue([n,t])}function Qa(e,t){return M(yf(e),t)}class mf extends F{constructor({domain:t}){super(`Invalid domain "${ae(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class hf extends F{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class gf extends F{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function bf(e){const{domain:t,message:n,primaryType:r,types:s}=e,a=(i,c)=>{for(const o of i){const{name:u,type:f}=o,d=c[u],l=f.match(_s);if(l&&(typeof d=="number"||typeof d=="bigint")){const[p,b,P]=l;R(d,{signed:b==="int",size:Number.parseInt(P,10)/8})}if(f==="address"&&typeof d=="string"&&!cr(d))throw new zs({address:d});const y=f.match(Ms);if(y){const[p,b]=y;if(b&&ke(d)!==Number.parseInt(b,10))throw new Hs({expectedSize:Number.parseInt(b,10),givenSize:ke(d)})}const m=s[f];m&&(vf(f),a(m,d))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new mf({domain:t});a(s.EIP712Domain,t)}if(r!=="EIP712Domain")if(s[r])a(s[r],n);else throw new hf({primaryType:r,types:s})}function wf({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function vf(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new gf({type:e})}function ei(e){const{domain:t={},message:n,primaryType:r}=e,s={EIP712Domain:wf({domain:t}),...e.types};bf({domain:t,message:n,primaryType:r,types:s});const a=["0x1901"];return t&&a.push(xf({domain:t,types:s})),r!=="EIP712Domain"&&a.push(ti({data:n,primaryType:r,types:s})),M(ue(a))}function xf({domain:e,types:t}){return ti({data:e,primaryType:"EIP712Domain",types:t})}function ti({data:e,primaryType:t,types:n}){const r=ni({data:e,primaryType:t,types:n});return M(r)}function ni({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],s=[Pf({primaryType:t,types:n})];for(const a of n[t]){const[i,c]=si({types:n,name:a.name,type:a.type,value:e[a.name]});r.push(i),s.push(c)}return Ge(r,s)}function Pf({primaryType:e,types:t}){const n=Te(Ef({primaryType:e,types:t}));return M(n)}function Ef({primaryType:e,types:t}){let n="";const r=ri({primaryType:e,types:t});r.delete(e);const s=[e,...Array.from(r).sort()];for(const a of s)n+=`${a}(${t[a].map(({name:i,type:c})=>`${c} ${i}`).join(",")})`;return n}function ri({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),s=r==null?void 0:r[0];if(n.has(s)||t[s]===void 0)return n;n.add(s);for(const a of t[s])ri({primaryType:a.type,types:t},n);return n}function si({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},M(ni({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},M(r)];if(n==="string")return[{type:"bytes32"},M(Te(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),a=r.map(i=>si({name:t,type:s,types:e,value:i}));return[{type:"bytes32"},M(Ge(a.map(([i])=>i),a.map(([,i])=>i)))]}return[{type:n},r]}const Bf="0x6492649264926492649264926492649264926492649264926492649264926492";function un(e){const{address:t,data:n,signature:r,to:s="hex"}=e,a=at([Ge([{type:"address"},{type:"bytes"},{type:"bytes"}],[t,n,r]),Bf]);return s==="hex"?a:Ee(a)}function Af(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function If(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?fe(e.nonce):void 0,storageProof:e.storageProof?Af(e.storageProof):void 0}}async function Sf(e,{address:t,blockNumber:n,blockTag:r,storageKeys:s}){const a=r??"latest",i=n!==void 0?R(n):void 0,c=await e.request({method:"eth_getProof",params:[t,s,i||a]});return If(c)}async function Of(e,{address:t,blockNumber:n,blockTag:r="latest",slot:s}){const a=n!==void 0?R(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,a||r]})}async function Lr(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:a,sender:i,nonce:c}){var l,y,m;const o=r||"latest",u=n!==void 0?R(n):void 0;let f=null;if(s?f=await e.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):t?f=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,R(a)]},{dedupe:!0}):typeof a=="number"?f=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[u||o,R(a)]},{dedupe:!!u}):i&&typeof c=="number"&&(f=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[i,R(c)]},{dedupe:!0})),!f)throw new Vs({blockHash:t,blockNumber:n,blockTag:o,hash:s,index:a});return(((m=(y=(l=e.chain)==null?void 0:l.formatters)==null?void 0:y.transaction)==null?void 0:m.format)||Ut)(f,"getTransaction")}async function Gf(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([T(e,lt,"getBlockNumber")({}),t?T(e,Lr,"getTransaction")({hash:t}):void 0]),a=(n==null?void 0:n.blockNumber)||(s==null?void 0:s.blockNumber);return a?r-a+1n:0n}async function yt(e,{hash:t}){var s,a,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new js({hash:t});return(((i=(a=(s=e.chain)==null?void 0:s.formatters)==null?void 0:a.transactionReceipt)==null?void 0:i.format)||Rt)(n,"getTransactionReceipt")}async function An(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:s,returnFullTransactions:a,traceTransfers:i,validation:c}=t;try{const o=[];for(const l of s){const y=l.blockOverrides?Yi(l.blockOverrides):void 0,m=l.calls.map(b=>{const P=b,E=P.account?J(P.account):void 0,w=P.abi?we(P):P.data,h={...P,account:E,data:P.dataSuffix?ue([w||"0x",P.dataSuffix]):w,from:P.from??(E==null?void 0:E.address)};return it(h),Lt(h)}),p=l.stateOverrides?ar(l.stateOverrides):void 0;o.push({blockOverrides:y,calls:m,stateOverrides:p})}const f=(typeof n=="bigint"?R(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:o,returnFullTransactions:a,traceTransfers:i,validation:c},f]})).map((l,y)=>({...dr(l),calls:l.calls.map((m,p)=>{var U,S;const{abi:b,args:P,functionName:E,to:w}=s[y].calls[p],h=((U=m.error)==null?void 0:U.data)??m.returnData,B=BigInt(m.gasUsed),G=(S=m.logs)==null?void 0:S.map(k=>le(k)),g=m.status==="0x1"?"success":"failure",x=b&&g==="success"&&h!=="0x"?Ct({abi:b,data:h,functionName:E}):null,O=(()=>{var N;if(g==="success")return;let k;if(((N=m.error)==null?void 0:N.data)==="0x"?k=new Ji:m.error&&(k=new Xi(m.error)),!!k)return ir(k,{abi:b??[],address:w??"0x",args:P,functionName:E??"<unknown>"})})();return{data:h,gasUsed:B,logs:G,status:g,...g==="success"?{result:x}:{error:O}}})}))}catch(o){const u=o,f=rr(u,{});throw f instanceof sr?u:f}}function In(e){let t=!0,n="",r=0,s="",a=!1;for(let i=0;i<e.length;i++){const c=e[i];if(["(",")",","].includes(c)&&(t=!0),c==="("&&r++,c===")"&&r--,!!t){if(r===0){if(c===" "&&["event","function","error",""].includes(s))s="";else if(s+=c,c===")"){a=!0;break}continue}if(c===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=c,n+=c}}if(!a)throw new _("Unable to normalize signature.");return s}function Sn(e,t){const n=typeof e,r=t.type;switch(r){case"address":return hn(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,a)=>Sn(Object.values(e)[a],s)):/^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(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>Sn(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function ai(e,t,n){for(const r in e){const s=e[r],a=t[r];if(s.type==="tuple"&&a.type==="tuple"&&"components"in s&&"components"in a)return ai(s.components,a.components,n[r]);const i=[s.type,a.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?hn(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?hn(n[r],{strict:!1}):!1)return i}}function ii(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?Kr(e):e;return{...r,...n?{hash:_e(r)}:{}}}function jt(e,t,n){const{args:r=[],prepare:s=!0}=n??{},a=Qi(t,{strict:!1}),i=e.filter(u=>a?u.type==="function"||u.type==="error"?oi(u)===ce(t,0,4):u.type==="event"?_e(u)===t:!1:"name"in u&&u.name===t);if(i.length===0)throw new Pt({name:t});if(i.length===1)return{...i[0],...s?{hash:_e(i[0])}:{}};let c;for(const u of i){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...s?{hash:_e(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((d,l)=>{const y="inputs"in u&&u.inputs[l];return y?Sn(d,y):!1})){if(c&&"inputs"in c&&c.inputs){const d=ai(u.inputs,c.inputs,r);if(d)throw new kf({abiItem:u,type:d[0]},{abiItem:c,type:d[1]})}c=u}}const o=(()=>{if(c)return c;const[u,...f]=i;return{...u,overloads:f}})();if(!o)throw new Pt({name:t});return{...o,...s?{hash:_e(o)}:{}}}function oi(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return jt(n,r)}return e[0]})();return ce(_e(t),0,4)}function Nf(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,s]=e;return jt(r,s)}return e[0]})(),n=typeof t=="string"?t:pn(t);return In(n)}function _e(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return jt(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:da(Qn(Nf(t)))}class kf extends _{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${In(pn(t.abiItem))}\`, and`,`\`${n.type}\` in \`${In(pn(n.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"})}}class Pt extends _{constructor({name:t,data:n,type:r="item"}){const s=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function Ff(...e){var a;const[t,n]=(()=>{if(Array.isArray(e[0])){const[i,c]=e;return[Cf(i),c]}return e})(),{bytecode:r,args:s}=n;return re(r,(a=t.inputs)!=null&&a.length&&(s!=null&&s.length)?Er(t.inputs,s):"0x")}function Tf(e){return ii(e)}function Cf(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new Pt({name:"constructor"});return t}function Lf(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[u,f,d]=e;return[gs(u,f,{args:d}),d]}const[c,o]=e;return[c,o]})(),{overloads:r}=t,s=r?gs([t,...r],t.name,{args:n}):t,a=Uf(s),i=n.length>0?Er(s.inputs,n):void 0;return i?re(a,i):a}function De(e,t={}){return ii(e,t)}function gs(e,t,n){const r=jt(e,t,n);if(r.type!=="function")throw new Pt({name:t,type:"function"});return r}function Uf(e){return oi(e)}const Rf="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",oe="0x0000000000000000000000000000000000000000",$f="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function Df(e,t){const{blockNumber:n,blockTag:r,calls:s,stateOverrides:a,traceAssetChanges:i,traceTransfers:c,validation:o}=t,u=t.account?J(t.account):void 0;if(i&&!u)throw new F("`account` is required when `traceAssetChanges` is true");const f=u?Ff(Tf("constructor(bytes, bytes)"),{bytecode:eo,args:[$f,Lf(De("function getBalance(address)"),[u.address])]}):void 0,d=i?await Promise.all(t.calls.map(async I=>{if(!I.data&&!I.abi)return;const{accessList:L}=await _a(e,{account:u.address,...I,data:I.abi?we(I):I.data});return L.map(({address:$,storageKeys:D})=>D.length>0?$:null)})).then(I=>I.flat().filter(Boolean)):[],l=await An(e,{blockNumber:n,blockTag:r,blocks:[...i?[{calls:[{data:f}],stateOverrides:a},{calls:d.map((I,L)=>({abi:[De("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:I,from:oe,nonce:L})),stateOverrides:[{address:oe,nonce:0}]}]:[],{calls:[...s,{}].map(I=>({...I,from:u==null?void 0:u.address})),stateOverrides:a},...i?[{calls:[{data:f}]},{calls:d.map((I,L)=>({abi:[De("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:I,from:oe,nonce:L})),stateOverrides:[{address:oe,nonce:0}]},{calls:d.map((I,L)=>({to:I,abi:[De("function decimals() returns (uint256)")],functionName:"decimals",from:oe,nonce:L})),stateOverrides:[{address:oe,nonce:0}]},{calls:d.map((I,L)=>({to:I,abi:[De("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:oe,nonce:L})),stateOverrides:[{address:oe,nonce:0}]},{calls:d.map((I,L)=>({to:I,abi:[De("function symbol() returns (string)")],functionName:"symbol",from:oe,nonce:L})),stateOverrides:[{address:oe,nonce:0}]}]:[]],traceTransfers:c,validation:o}),y=i?l[2]:l[0],[m,p,,b,P,E,w,h]=i?l:[],{calls:B,...G}=y,g=B.slice(0,-1)??[],x=(m==null?void 0:m.calls)??[],O=(p==null?void 0:p.calls)??[],U=[...x,...O].map(I=>I.status==="success"?Y(I.data):null),S=(b==null?void 0:b.calls)??[],k=(P==null?void 0:P.calls)??[],N=[...S,...k].map(I=>I.status==="success"?Y(I.data):null),z=((E==null?void 0:E.calls)??[]).map(I=>I.status==="success"?I.result:null),v=((h==null?void 0:h.calls)??[]).map(I=>I.status==="success"?I.result:null),A=((w==null?void 0:w.calls)??[]).map(I=>I.status==="success"?I.result:null),C=[];for(const[I,L]of N.entries()){const $=U[I];if(typeof L!="bigint"||typeof $!="bigint")continue;const D=z[I-1],H=v[I-1],te=A[I-1],Z=I===0?{address:Rf,decimals:18,symbol:"ETH"}:{address:d[I-1],decimals:te||D?Number(D??1):void 0,symbol:H??void 0};C.some(j=>j.token.address===Z.address)||C.push({token:Z,value:{pre:$,post:L,diff:L-$}})}return{assetChanges:C,block:G,results:g}}async function zf(e,t){const{abi:n,address:r,args:s,dataSuffix:a,functionName:i,...c}=t,o=c.account?J(c.account):e.account,u=we({abi:n,args:s,functionName:i});try{const{data:f}=await T(e,er,"call")({batch:!1,data:`${u}${a?a.replace("0x",""):""}`,to:r,...c,account:o}),d=Ct({abi:n,args:s,functionName:i,data:f||"0x"}),l=n.filter(y=>"name"in y&&y.name===t.functionName);return{result:d,request:{abi:l,address:r,args:s,dataSuffix:a,functionName:i,...c,account:o}}}catch(f){throw ir(f,{abi:n,address:r,args:s,docsPath:"/docs/contract/simulateContract",functionName:i,sender:o==null?void 0:o.address})}}async function qt(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}async function _f(e,{address:t,message:n,factory:r,factoryData:s,signature:a,...i}){const c=Qa(n);return T(e,Mt,"verifyHash")({address:t,factory:r,factoryData:s,hash:c,signature:a,...i})}async function Mf(e,t){const{address:n,factory:r,factoryData:s,signature:a,message:i,primaryType:c,types:o,domain:u,...f}=t,d=ei({message:i,primaryType:c,types:o,domain:u});return T(e,Mt,"verifyHash")({address:n,factory:r,factoryData:s,hash:d,signature:a,...f})}const fn=new Map,bs=new Map;let Hf=0;function pe(e,t,n){const r=++Hf,s=()=>fn.get(e)||[],a=()=>{const f=s();fn.set(e,f.filter(d=>d.id!==r))},i=()=>{const f=s();if(!f.some(l=>l.id===r))return;const d=bs.get(e);if(f.length===1&&d){const l=d();l instanceof Promise&&l.catch(()=>{})}a()},c=s();if(fn.set(e,[...c,{id:r,fns:t}]),c&&c.length>0)return i;const o={};for(const f in t)o[f]=(...d)=>{var y,m;const l=s();if(l.length!==0)for(const p of l)(m=(y=p.fns)[f])==null||m.call(y,...d)};const u=n(o);return typeof u=="function"&&bs.set(e,u),i}function Le(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let s=!0;const a=()=>s=!1;return(async()=>{let c;t&&(c=await e({unpoll:a}));const o=await(n==null?void 0:n(c))??r;await jr(o);const u=async()=>{s&&(await e({unpoll:a}),await jr(r),u())};u()})(),a}function ci(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:s,poll:a,pollingInterval:i=e.pollingInterval}){const c=typeof a<"u"?a:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let o;return c?(()=>{const d=ae(["watchBlockNumber",e.uid,t,n,i]);return pe(d,{onBlockNumber:r,onError:s},l=>Le(async()=>{var y;try{const m=await T(e,lt,"getBlockNumber")({cacheTime:0});if(o!==void 0){if(m===o)return;if(m-o>1&&n)for(let p=o+1n;p<m;p++)l.onBlockNumber(p,o),o=p}(o===void 0||m>o)&&(l.onBlockNumber(m,o),o=m)}catch(m){(y=l.onError)==null||y.call(l,m)}},{emitOnBegin:t,interval:i}))})():(()=>{const d=ae(["watchBlockNumber",e.uid,t,n]);return pe(d,{onBlockNumber:r,onError:s},l=>{let y=!0,m=()=>y=!1;return(async()=>{try{const p=(()=>{if(e.transport.type==="fallback"){const P=e.transport.transports.find(E=>E.config.type==="webSocket"||E.config.type==="ipc");return P?P.value:e.transport}return e.transport})(),{unsubscribe:b}=await p.subscribe({params:["newHeads"],onData(P){var w;if(!y)return;const E=Y((w=P.result)==null?void 0:w.number);l.onBlockNumber(E,o),o=E},onError(P){var E;(E=l.onError)==null||E.call(l,P)}});m=b,y||m()}catch(p){s==null||s(p)}})(),()=>m()})})()}async function Vf(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:s,onReplaced:a,retryCount:i=6,retryDelay:c=({count:B})=>~~(1<<B)*200,timeout:o=18e4}=t,u=ae(["waitForTransactionReceipt",e.uid,s]),f=(()=>{var B;return t.pollingInterval?t.pollingInterval:(B=e.chain)!=null&&B.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let d,l,y,m=!1,p,b;const{promise:P,resolve:E,reject:w}=qs(),h=o?setTimeout(()=>{b==null||b(),p==null||p(),w(new to({hash:s}))},o):void 0;return p=pe(u,{onReplaced:a,resolve:E,reject:w},async B=>{if(y=await T(e,yt,"getTransactionReceipt")({hash:s}).catch(()=>{}),y&&r<=1){clearTimeout(h),B.resolve(y),p==null||p();return}b=T(e,ci,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:f,async onBlockNumber(G){const g=O=>{clearTimeout(h),b==null||b(),O(),p==null||p()};let x=G;if(!m)try{if(y){if(r>1&&(!y.blockNumber||x-y.blockNumber+1n<r))return;g(()=>B.resolve(y));return}if(n&&!d&&(m=!0,await yn(async()=>{d=await T(e,Lr,"getTransaction")({hash:s}),d.blockNumber&&(x=d.blockNumber)},{delay:c,retryCount:i}),m=!1),y=await T(e,yt,"getTransactionReceipt")({hash:s}),r>1&&(!y.blockNumber||x-y.blockNumber+1n<r))return;g(()=>B.resolve(y))}catch(O){if(O instanceof Vs||O instanceof js){if(!d){m=!1;return}try{l=d,m=!0;const U=await yn(()=>T(e,ne,"getBlock")({blockNumber:x,includeTransactions:!0}),{delay:c,retryCount:i,shouldRetry:({error:N})=>N instanceof qa});m=!1;const S=U.transactions.find(({from:N,nonce:z})=>N===l.from&&z===l.nonce);if(!S||(y=await T(e,yt,"getTransactionReceipt")({hash:S.hash}),r>1&&(!y.blockNumber||x-y.blockNumber+1n<r)))return;let k="replaced";S.to===l.to&&S.value===l.value&&S.input===l.input?k="repriced":S.from===S.to&&S.value===0n&&(k="cancelled"),g(()=>{var N;(N=B.onReplaced)==null||N.call(B,{reason:k,replacedTransaction:l,transaction:S,transactionReceipt:y}),B.resolve(y)})}catch(U){g(()=>B.reject(U))}}else g(()=>B.reject(O))}}})}),P}function jf(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:a,includeTransactions:i,poll:c,pollingInterval:o=e.pollingInterval}){const u=typeof c<"u"?c:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),f=i??!1;let d;return u?(()=>{const m=ae(["watchBlocks",e.uid,t,n,r,f,o]);return pe(m,{onBlock:s,onError:a},p=>Le(async()=>{var b;try{const P=await T(e,ne,"getBlock")({blockTag:t,includeTransactions:f});if(P.number!==null&&(d==null?void 0:d.number)!=null){if(P.number===d.number)return;if(P.number-d.number>1&&n)for(let E=(d==null?void 0:d.number)+1n;E<P.number;E++){const w=await T(e,ne,"getBlock")({blockNumber:E,includeTransactions:f});p.onBlock(w,d),d=w}}((d==null?void 0:d.number)==null||t==="pending"&&(P==null?void 0:P.number)==null||P.number!==null&&P.number>d.number)&&(p.onBlock(P,d),d=P)}catch(P){(b=p.onError)==null||b.call(p,P)}},{emitOnBegin:r,interval:o}))})():(()=>{let m=!0,p=!0,b=()=>m=!1;return(async()=>{try{r&&T(e,ne,"getBlock")({blockTag:t,includeTransactions:f}).then(w=>{m&&p&&(s(w,void 0),p=!1)}).catch(a);const P=(()=>{if(e.transport.type==="fallback"){const w=e.transport.transports.find(h=>h.config.type==="webSocket"||h.config.type==="ipc");return w?w.value:e.transport}return e.transport})(),{unsubscribe:E}=await P.subscribe({params:["newHeads"],async onData(w){var B;if(!m)return;const h=await T(e,ne,"getBlock")({blockNumber:(B=w.result)==null?void 0:B.number,includeTransactions:f}).catch(()=>{});m&&(s(h,d),p=!1,d=h)},onError(w){a==null||a(w)}});b=E,m||b()}catch(P){a==null||a(P)}})(),()=>b()})()}function qf(e,t){const{abi:n,address:r,args:s,batch:a=!0,eventName:i,fromBlock:c,onError:o,onLogs:u,poll:f,pollingInterval:d=e.pollingInterval,strict:l}=t;return(typeof f<"u"?f:typeof c=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const b=l??!1,P=ae(["watchContractEvent",r,s,a,e.uid,i,d,b,c]);return pe(P,{onLogs:u,onError:o},E=>{let w;c!==void 0&&(w=c-1n);let h,B=!1;const G=Le(async()=>{var g;if(!B){try{h=await T(e,Ma,"createContractEventFilter")({abi:n,address:r,args:s,eventName:i,strict:b,fromBlock:c})}catch{}B=!0;return}try{let x;if(h)x=await T(e,Vt,"getFilterChanges")({filter:h});else{const O=await T(e,lt,"getBlockNumber")({});w&&w<O?x=await T(e,Ja,"getContractEvents")({abi:n,address:r,args:s,eventName:i,fromBlock:w+1n,toBlock:O,strict:b}):x=[],w=O}if(x.length===0)return;if(a)E.onLogs(x);else for(const O of x)E.onLogs([O])}catch(x){h&&x instanceof Zs&&(B=!1),(g=E.onError)==null||g.call(E,x)}},{emitOnBegin:!0,interval:d});return async()=>{h&&await T(e,qt,"uninstallFilter")({filter:h}),G()}})})():(()=>{const b=l??!1,P=ae(["watchContractEvent",r,s,a,e.uid,i,d,b]);let E=!0,w=()=>E=!1;return pe(P,{onLogs:u,onError:o},h=>((async()=>{try{const B=(()=>{if(e.transport.type==="fallback"){const x=e.transport.transports.find(O=>O.config.type==="webSocket"||O.config.type==="ipc");return x?x.value:e.transport}return e.transport})(),G=i?dt({abi:n,eventName:i,args:s}):[],{unsubscribe:g}=await B.subscribe({params:["logs",{address:r,topics:G}],onData(x){var U;if(!E)return;const O=x.result;try{const{eventName:S,args:k}=xt({abi:n,data:O.data,topics:O.topics,strict:l}),N=le(O,{args:k,eventName:S});h.onLogs([N])}catch(S){let k,N;if(S instanceof gt||S instanceof or){if(l)return;k=S.abiItem.name,N=(U=S.abiItem.inputs)==null?void 0:U.some(v=>!("name"in v&&v.name))}const z=le(O,{args:N?[]:{},eventName:k});h.onLogs([z])}},onError(x){var O;(O=h.onError)==null||O.call(h,x)}});w=g,E||w()}catch(B){o==null||o(B)}})(),()=>w()))})()}function Zf(e,{address:t,args:n,batch:r=!0,event:s,events:a,fromBlock:i,onError:c,onLogs:o,poll:u,pollingInterval:f=e.pollingInterval,strict:d}){const l=typeof u<"u"?u:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),y=d??!1;return l?(()=>{const b=ae(["watchEvent",t,n,r,e.uid,s,f,i]);return pe(b,{onLogs:o,onError:c},P=>{let E;i!==void 0&&(E=i-1n);let w,h=!1;const B=Le(async()=>{var G;if(!h){try{w=await T(e,Ha,"createEventFilter")({address:t,args:n,event:s,events:a,strict:y,fromBlock:i})}catch{}h=!0;return}try{let g;if(w)g=await T(e,Vt,"getFilterChanges")({filter:w});else{const x=await T(e,lt,"getBlockNumber")({});E&&E!==x?g=await T(e,Cr,"getLogs")({address:t,args:n,event:s,events:a,fromBlock:E+1n,toBlock:x}):g=[],E=x}if(g.length===0)return;if(r)P.onLogs(g);else for(const x of g)P.onLogs([x])}catch(g){w&&g instanceof Zs&&(h=!1),(G=P.onError)==null||G.call(P,g)}},{emitOnBegin:!0,interval:f});return async()=>{w&&await T(e,qt,"uninstallFilter")({filter:w}),B()}})})():(()=>{let b=!0,P=()=>b=!1;return(async()=>{try{const E=(()=>{if(e.transport.type==="fallback"){const G=e.transport.transports.find(g=>g.config.type==="webSocket"||g.config.type==="ipc");return G?G.value:e.transport}return e.transport})(),w=a??(s?[s]:void 0);let h=[];w&&(h=[w.flatMap(g=>dt({abi:[g],eventName:g.name,args:n}))],s&&(h=h[0]));const{unsubscribe:B}=await E.subscribe({params:["logs",{address:t,topics:h}],onData(G){var x;if(!b)return;const g=G.result;try{const{eventName:O,args:U}=xt({abi:w??[],data:g.data,topics:g.topics,strict:y}),S=le(g,{args:U,eventName:O});o([S])}catch(O){let U,S;if(O instanceof gt||O instanceof or){if(d)return;U=O.abiItem.name,S=(x=O.abiItem.inputs)==null?void 0:x.some(N=>!("name"in N&&N.name))}const k=le(g,{args:S?[]:{},eventName:U});o([k])}},onError(G){c==null||c(G)}});P=B,b||P()}catch(E){c==null||c(E)}})(),()=>P()})()}function Wf(e,{batch:t=!0,onError:n,onTransactions:r,poll:s,pollingInterval:a=e.pollingInterval}){return(typeof s<"u"?s:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const u=ae(["watchPendingTransactions",e.uid,t,a]);return pe(u,{onTransactions:r,onError:n},f=>{let d;const l=Le(async()=>{var y;try{if(!d)try{d=await T(e,Va,"createPendingTransactionFilter")({});return}catch(p){throw l(),p}const m=await T(e,Vt,"getFilterChanges")({filter:d});if(m.length===0)return;if(t)f.onTransactions(m);else for(const p of m)f.onTransactions([p])}catch(m){(y=f.onError)==null||y.call(f,m)}},{emitOnBegin:!0,interval:a});return async()=>{d&&await T(e,qt,"uninstallFilter")({filter:d}),l()}})})():(()=>{let u=!0,f=()=>u=!1;return(async()=>{try{const{unsubscribe:d}=await e.transport.subscribe({params:["newPendingTransactions"],onData(l){if(!u)return;const y=l.result;r([y])},onError(l){n==null||n(l)}});f=d,u||f()}catch(d){n==null||n(d)}})(),()=>f()})()}async function Kf(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const Yf="0x5792579257925792579257925792579257925792579257925792579257925792",Jf=R(0,{size:32});async function Xf(e,t){async function n(f){if(f.endsWith(Yf.slice(2))){const l=Cs(qr(f,-64,-32)),y=qr(f,0,-64).slice(2).match(/.{1,64}/g),m=await Promise.all(y.map(b=>Jf.slice(2)!==b?e.request({method:"eth_getTransactionReceipt",params:[`0x${b}`]},{dedupe:!0}):void 0)),p=m.some(b=>b===null)?100:m.every(b=>(b==null?void 0:b.status)==="0x1")?200:m.every(b=>(b==null?void 0:b.status)==="0x0")?500:600;return{atomic:!1,chainId:fe(l),receipts:m.filter(Boolean),status:p,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[f]})}const{atomic:r=!1,chainId:s,receipts:a,version:i="2.0.0",...c}=await n(t.id),[o,u]=(()=>{const f=c.status;return f>=100&&f<200?["pending",f]:f>=200&&f<300?["success",f]:f>=300&&f<700?["failure",f]:f==="CONFIRMED"?["success",200]:f==="PENDING"?["pending",100]:[void 0,f]})();return{...c,atomic:r,chainId:s?fe(s):void 0,receipts:(a==null?void 0:a.map(f=>({...f,blockNumber:Y(f.blockNumber),gasUsed:Y(f.gasUsed),status:Ys[f.status]})))??[],statusCode:u,status:o,version:i}}async function Qf(e,t){var o;const{account:n=e.account,chainId:r,nonce:s}=t;if(!n)throw new $t({docsPath:"/docs/eip7702/prepareAuthorization"});const a=J(n),i=(()=>{if(t.executor)return t.executor==="self"?t.executor:J(t.executor)})(),c={address:t.contractAddress??t.address,chainId:r,nonce:s};return typeof c.chainId>"u"&&(c.chainId=((o=e.chain)==null?void 0:o.id)??await T(e,We,"getChainId")({})),typeof c.nonce>"u"&&(c.nonce=await T(e,kr,"getTransactionCount")({address:a.address,blockTag:"pending"}),(i==="self"||i!=null&&i.address&&ot(i.address,a.address))&&(c.nonce+=1)),c}class ed extends F{constructor(t){super(`Call bundle failed with status: ${t.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=t}}async function Md(e,t){const{id:n,pollingInterval:r=e.pollingInterval,status:s=({statusCode:p})=>p===200||p>=300,retryCount:a=4,retryDelay:i=({count:p})=>~~(1<<p)*200,timeout:c=6e4,throwOnFailure:o=!1}=t,u=ae(["waitForCallsStatus",e.uid,n]),{promise:f,resolve:d,reject:l}=qs();let y;const m=pe(u,{resolve:d,reject:l},p=>{const b=Le(async()=>{const P=E=>{clearTimeout(y),b(),E(),m()};try{const E=await yn(async()=>{const w=await T(e,Xf,"getCallsStatus")({id:n});if(o&&w.status==="failure")throw new ed(w);return w},{retryCount:a,delay:i});if(!s(E))return;P(()=>p.resolve(E))}catch(E){P(()=>p.reject(E))}},{interval:r,emitOnBegin:!0});return b});return y=c?setTimeout(()=>{m(),clearTimeout(y),l(new td({id:n}))},c):void 0,await f}class td extends F{constructor({id:t}){super(`Timed out while waiting for call bundle with id "${t}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}async function nd(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){var c,o,u;const s=await e.request({method:"eth_sendRawTransactionSync",params:r?[t,R(r)]:[t]},{retryCount:0}),i=(((u=(o=(c=e.chain)==null?void 0:c.formatters)==null?void 0:o.transactionReceipt)==null?void 0:u.format)||Rt)(s);if(i.status==="reverted"&&n)throw new no({receipt:i});return i}function rd(e){var d,l,y;const{scheme:t,statement:n,...r}=((d=e.match(sd))==null?void 0:d.groups)??{},{chainId:s,expirationTime:a,issuedAt:i,notBefore:c,requestId:o,...u}=((l=e.match(ad))==null?void 0:l.groups)??{},f=(y=e.split("Resources:")[1])==null?void 0:y.split(`
@@ -0,0 +1,3 @@
1
+ import{w as o}from"./core-f4taWsy5.js";import"./index-DN2JqH-l.js";import"./events-CjOrSHaz.js";import"./index.es-MXG0VeeZ.js";import"./index-nibyPLVP.js";import"./index.es-BEAksKXY.js";const e=o` <svg fill="none" viewBox="0 0 13 4">
2
+ <path fill="currentColor" d="M.5 0h12L8.9 3.13a3.76 3.76 0 0 1-4.8 0L.5 0Z" />
3
+ </svg>`;export{e as cursorSvg};
@@ -1,4 +1,4 @@
1
- import{w as o}from"./core-FalccOZQ.js";import"./index-DlDkzdhK.js";import"./events-BSf9wyey.js";import"./index.es-B3ObrDkW.js";import"./index-nibyPLVP.js";import"./index.es-vOkXvnBD.js";const e=o`<svg fill="none" viewBox="0 0 14 6">
1
+ import{w as o}from"./core-f4taWsy5.js";import"./index-DN2JqH-l.js";import"./events-CjOrSHaz.js";import"./index.es-MXG0VeeZ.js";import"./index-nibyPLVP.js";import"./index.es-BEAksKXY.js";const e=o`<svg fill="none" viewBox="0 0 14 6">
2
2
  <path style="fill: var(--wui-color-bg-150);" d="M0 1h14L9.21 5.12a3.31 3.31 0 0 1-4.49 0L0 1Z" />
3
3
  <path
4
4
  style="stroke: var(--wui-color-inverse-100);"
@@ -1 +1 @@
1
- import{am as c}from"./signing-CQ15XHyj.js";const a="0x313ce567",n=[],o=[{type:"uint8"}];async function s(t){return c({contract:t.contract,method:[a,n,o],params:[]})}export{s as d};
1
+ import{am as c}from"./signing-B1K_Jdsm.js";const a="0x313ce567",n=[],o=[{type:"uint8"}];async function s(t){return c({contract:t.contract,method:[a,n,o],params:[]})}export{s as d};
@@ -1 +1 @@
1
- import{w as a}from"./utils-B3vUvlNq.js";import{d as r}from"./decimals-BBBuCBiH.js";import"./signing-CQ15XHyj.js";import"./index-DlDkzdhK.js";async function d(c){return a(()=>r(c),{cacheKey:`${c.contract.chain.id}:${c.contract.address}:decimals`,cacheTime:Number.POSITIVE_INFINITY})}export{d as decimals};
1
+ import{w as a}from"./utils-B3vUvlNq.js";import{d as r}from"./decimals-BB5yEnWu.js";import"./signing-B1K_Jdsm.js";import"./index-DN2JqH-l.js";async function d(c){return a(()=>r(c),{cacheKey:`${c.contract.chain.id}:${c.contract.address}:decimals`,cacheTime:Number.POSITIVE_INFINITY})}export{d as decimals};
@@ -1,4 +1,4 @@
1
- import{w as c}from"./core-FalccOZQ.js";import"./index-DlDkzdhK.js";import"./events-BSf9wyey.js";import"./index.es-B3ObrDkW.js";import"./index-nibyPLVP.js";import"./index.es-vOkXvnBD.js";const i=c`<svg fill="none" viewBox="0 0 20 20">
1
+ import{w as c}from"./core-f4taWsy5.js";import"./index-DN2JqH-l.js";import"./events-CjOrSHaz.js";import"./index.es-MXG0VeeZ.js";import"./index-nibyPLVP.js";import"./index.es-BEAksKXY.js";const i=c`<svg fill="none" viewBox="0 0 20 20">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1 +1 @@
1
- import{bw as r}from"./signing-CQ15XHyj.js";function o(e){const t=Array.isArray(e.method)?e.method[0]:r(e.method);return e.availableSelectors.includes(t)}export{o as d};
1
+ import{bw as r}from"./signing-B1K_Jdsm.js";function o(e){const t=Array.isArray(e.method)?e.method[0]:r(e.method);return e.availableSelectors.includes(t)}export{o as d};
@@ -1,4 +1,4 @@
1
- import{w as o}from"./core-FalccOZQ.js";import"./index-DlDkzdhK.js";import"./events-BSf9wyey.js";import"./index.es-B3ObrDkW.js";import"./index-nibyPLVP.js";import"./index.es-vOkXvnBD.js";const t=o`<svg fill="none" viewBox="0 0 16 16">
1
+ import{w as o}from"./core-f4taWsy5.js";import"./index-DN2JqH-l.js";import"./events-CjOrSHaz.js";import"./index.es-MXG0VeeZ.js";import"./index-nibyPLVP.js";import"./index.es-BEAksKXY.js";const t=o`<svg fill="none" viewBox="0 0 16 16">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{w as l}from"./core-FalccOZQ.js";import"./index-DlDkzdhK.js";import"./events-BSf9wyey.js";import"./index.es-B3ObrDkW.js";import"./index-nibyPLVP.js";import"./index.es-vOkXvnBD.js";const e=l`<svg fill="none" viewBox="0 0 40 40">
1
+ import{w as l}from"./core-f4taWsy5.js";import"./index-DN2JqH-l.js";import"./events-CjOrSHaz.js";import"./index.es-MXG0VeeZ.js";import"./index-nibyPLVP.js";import"./index.es-BEAksKXY.js";const e=l`<svg fill="none" viewBox="0 0 40 40">
2
2
  <g clip-path="url(#a)">
3
3
  <g clip-path="url(#b)">
4
4
  <circle cx="20" cy="19.89" r="20" fill="#5865F2" />
@@ -1 +1 @@
1
- import{s as w,n as y,am as p}from"./signing-CQ15XHyj.js";import{b as h}from"./wait-for-tx-receipt-BWZbdlKf.js";import"./utils-B3vUvlNq.js";import"./index-DlDkzdhK.js";import"./sleep-mAKpSMLY.js";async function f({account:t,serializableTransaction:e,transaction:r,gasless:n}){const a=y({address:n.relayerForwarderAddress,chain:r.chain,client:r.client}),s=await p({contract:a,method:"function getNonce(address) view returns (uint256)",params:[t.address]}),[o,i]=await(async()=>{if(!e.to)throw new Error("engine transactions must have a 'to' address");if(!e.gas)throw new Error("engine transactions must have a 'gas' value");if(!e.data)throw new Error("engine transactions must have a 'data' value");if(n.experimentalChainlessSupport){const d={chainid:BigInt(r.chain.id),data:e.data,from:t.address,gas:e.gas,nonce:s,to:e.to,value:0n};return[await t.signTypedData({domain:{name:"GSNv2 Forwarder",verifyingContract:a.address,version:"0.0.1"},message:d,primaryType:"ForwardRequest",types:{ForwardRequest:l}}),d]}const c={data:e.data,from:t.address,gas:e.gas,nonce:s,to:e.to,value:0n};return[await t.signTypedData({domain:{chainId:r.chain.id,name:n.domainName??"GSNv2 Forwarder",verifyingContract:a.address,version:n.domainVersion??"0.0.1"},message:c,primaryType:"ForwardRequest",types:{ForwardRequest:g}}),c]})();return{message:i,messageType:"forward",signature:o}}const g=[{name:"from",type:"address"},{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"gas",type:"uint256"},{name:"nonce",type:"uint256"},{name:"data",type:"bytes"}],l=[{name:"from",type:"address"},{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"gas",type:"uint256"},{name:"nonce",type:"uint256"},{name:"data",type:"bytes"},{name:"chainid",type:"uint256"}];async function T(t){const{message:e,messageType:r,signature:n}=await f(t),a=await fetch(t.gasless.relayerUrl,{body:w({forwarderAddress:t.gasless.relayerForwarderAddress,request:e,signature:n,type:r}),headers:{"Content-Type":"application/json"},method:"POST"});if(!a.ok)throw new Error(`Failed to send transaction: ${await a.text()}`);const s=await a.json();if(!s.result)throw new Error(`Relay transaction failed: ${s.message}`);const o=s.result.queueId,i=6e4,m=1e3,c=Date.now()+i;for(;Date.now()<c;){const d=await v({options:t,queueId:o});if(d)return{chain:t.transaction.chain,client:t.transaction.client,transactionHash:d.transactionHash};await new Promise(u=>setTimeout(u,m))}throw new Error(`Failed to find relayed transaction after ${i}ms`)}async function v(t){const{options:e,queueId:r}=t,n=e.gasless.relayerUrl.split("/relayer/")[0],a=await fetch(`${n}/transaction/status/${r}`,{method:"GET"}),s=await a.json();if(!a.ok)return null;const o=s.result;if(!o)return null;switch(o.status){case"errored":throw new Error(`Transaction errored with reason: ${o.errorMessage}`);case"cancelled":throw new Error("Transaction execution cancelled.");case"mined":return await h({chain:e.transaction.chain,client:e.transaction.client,transactionHash:o.transactionHash});default:return null}}export{f as prepareEngineTransaction,T as relayEngineTransaction};
1
+ import{s as w,n as y,am as p}from"./signing-B1K_Jdsm.js";import{b as h}from"./wait-for-tx-receipt-pc2BJc62.js";import"./utils-B3vUvlNq.js";import"./index-DN2JqH-l.js";import"./sleep-mAKpSMLY.js";async function f({account:t,serializableTransaction:e,transaction:r,gasless:n}){const a=y({address:n.relayerForwarderAddress,chain:r.chain,client:r.client}),s=await p({contract:a,method:"function getNonce(address) view returns (uint256)",params:[t.address]}),[o,i]=await(async()=>{if(!e.to)throw new Error("engine transactions must have a 'to' address");if(!e.gas)throw new Error("engine transactions must have a 'gas' value");if(!e.data)throw new Error("engine transactions must have a 'data' value");if(n.experimentalChainlessSupport){const d={chainid:BigInt(r.chain.id),data:e.data,from:t.address,gas:e.gas,nonce:s,to:e.to,value:0n};return[await t.signTypedData({domain:{name:"GSNv2 Forwarder",verifyingContract:a.address,version:"0.0.1"},message:d,primaryType:"ForwardRequest",types:{ForwardRequest:l}}),d]}const c={data:e.data,from:t.address,gas:e.gas,nonce:s,to:e.to,value:0n};return[await t.signTypedData({domain:{chainId:r.chain.id,name:n.domainName??"GSNv2 Forwarder",verifyingContract:a.address,version:n.domainVersion??"0.0.1"},message:c,primaryType:"ForwardRequest",types:{ForwardRequest:g}}),c]})();return{message:i,messageType:"forward",signature:o}}const g=[{name:"from",type:"address"},{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"gas",type:"uint256"},{name:"nonce",type:"uint256"},{name:"data",type:"bytes"}],l=[{name:"from",type:"address"},{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"gas",type:"uint256"},{name:"nonce",type:"uint256"},{name:"data",type:"bytes"},{name:"chainid",type:"uint256"}];async function T(t){const{message:e,messageType:r,signature:n}=await f(t),a=await fetch(t.gasless.relayerUrl,{body:w({forwarderAddress:t.gasless.relayerForwarderAddress,request:e,signature:n,type:r}),headers:{"Content-Type":"application/json"},method:"POST"});if(!a.ok)throw new Error(`Failed to send transaction: ${await a.text()}`);const s=await a.json();if(!s.result)throw new Error(`Relay transaction failed: ${s.message}`);const o=s.result.queueId,i=6e4,m=1e3,c=Date.now()+i;for(;Date.now()<c;){const d=await v({options:t,queueId:o});if(d)return{chain:t.transaction.chain,client:t.transaction.client,transactionHash:d.transactionHash};await new Promise(u=>setTimeout(u,m))}throw new Error(`Failed to find relayed transaction after ${i}ms`)}async function v(t){const{options:e,queueId:r}=t,n=e.gasless.relayerUrl.split("/relayer/")[0],a=await fetch(`${n}/transaction/status/${r}`,{method:"GET"}),s=await a.json();if(!a.ok)return null;const o=s.result;if(!o)return null;switch(o.status){case"errored":throw new Error(`Transaction errored with reason: ${o.errorMessage}`);case"cancelled":throw new Error("Transaction execution cancelled.");case"mined":return await h({chain:e.transaction.chain,client:e.transaction.client,transactionHash:o.transactionHash});default:return null}}export{f as prepareEngineTransaction,T as relayEngineTransaction};
@@ -1 +1 @@
1
- import{n as c,j as i,ao as o,am as l}from"./signing-CQ15XHyj.js";import"./utils-B3vUvlNq.js";import"./index-DlDkzdhK.js";const d="0x420000000000000000000000000000000000000F";async function z(t){const{transaction:a,gasPriceOracleAddress:e}=t,r=c({address:e||d,chain:a.chain,client:a.client}),{gasPrice:m,...n}=await i({transaction:a}),s=o({transaction:n});return l({contract:r,method:"function getL1Fee(bytes memory _data) view returns (uint256)",params:[s]})}export{z as estimateL1Fee};
1
+ import{n as c,j as i,ao as o,am as l}from"./signing-B1K_Jdsm.js";import"./utils-B3vUvlNq.js";import"./index-DN2JqH-l.js";const d="0x420000000000000000000000000000000000000F";async function z(t){const{transaction:a,gasPriceOracleAddress:e}=t,r=c({address:e||d,chain:a.chain,client:a.client}),{gasPrice:m,...n}=await i({transaction:a}),s=o({transaction:n});return l({contract:r,method:"function getL1Fee(bytes memory _data) view returns (uint256)",params:[s]})}export{z as estimateL1Fee};
@@ -0,0 +1 @@
1
+ import{ac as s}from"./signing-B1K_Jdsm.js";import"./utils-B3vUvlNq.js";import"./index-DN2JqH-l.js";async function r(t,e){const a=await t({method:"eth_estimateGas",params:[e]});return s(a)}export{r as eth_estimateGas};
@@ -1 +1 @@
1
- import{m as o}from"./signing-CQ15XHyj.js";async function r(e,t){return await e({method:"eth_getStorageAt",params:[o(t.address),t.position,t.blockTag??"latest"]})}export{r as e};
1
+ import{m as o}from"./signing-B1K_Jdsm.js";async function r(e,t){return await e({method:"eth_getStorageAt",params:[o(t.address),t.position,t.blockTag??"latest"]})}export{r as e};
@@ -1 +1 @@
1
- import{p as n,af as r}from"./signing-CQ15XHyj.js";import"./utils-B3vUvlNq.js";import"./index-DlDkzdhK.js";async function i(t,o){const e=await t({method:"eth_getTransactionCount",params:[o.address,o.blockNumber?n(o.blockNumber):o.blockTag||"pending"]});return r(e)}export{i as eth_getTransactionCount};
1
+ import{p as n,af as r}from"./signing-B1K_Jdsm.js";import"./utils-B3vUvlNq.js";import"./index-DN2JqH-l.js";async function i(t,o){const e=await t({method:"eth_getTransactionCount",params:[o.address,o.blockNumber?n(o.blockNumber):o.blockTag||"pending"]});return r(e)}export{i as eth_getTransactionCount};
@@ -1,4 +1,4 @@
1
- import{w as o}from"./core-FalccOZQ.js";import"./index-DlDkzdhK.js";import"./events-BSf9wyey.js";import"./index.es-B3ObrDkW.js";import"./index-nibyPLVP.js";import"./index.es-vOkXvnBD.js";const p=o`<svg fill="none" viewBox="0 0 16 16">
1
+ import{w as o}from"./core-f4taWsy5.js";import"./index-DN2JqH-l.js";import"./events-CjOrSHaz.js";import"./index.es-MXG0VeeZ.js";import"./index-nibyPLVP.js";import"./index.es-BEAksKXY.js";const p=o`<svg fill="none" viewBox="0 0 16 16">
2
2
  <path
3
3
  fill="currentColor"
4
4
  d="M4.25 7a.63.63 0 0 0-.63.63v3.97c0 .28-.2.51-.47.54l-.75.07a.93.93 0 0 1-.9-.47A7.51 7.51 0 0 1 5.54.92a7.5 7.5 0 0 1 9.54 4.62c.12.35.06.72-.16 1-.74.97-1.68 1.78-2.6 2.44V4.44a.64.64 0 0 0-.63-.64h-1.06c-.35 0-.63.3-.63.64v5.5c0 .23-.12.42-.32.5l-.52.23V6.05c0-.36-.3-.64-.64-.64H7.45c-.35 0-.64.3-.64.64v4.97c0 .25-.17.46-.4.52a5.8 5.8 0 0 0-.45.11v-4c0-.36-.3-.65-.64-.65H4.25ZM14.07 12.4A7.49 7.49 0 0 1 3.6 14.08c4.09-.58 9.14-2.5 11.87-6.6v.03a7.56 7.56 0 0 1-1.41 4.91Z"
@@ -1 +1 @@
1
- import{h as C}from"./index-DlDkzdhK.js";var p={exports:{}},a=typeof Reflect=="object"?Reflect:null,d=a&&typeof a.apply=="function"?a.apply:function(e,n,r){return Function.prototype.apply.call(e,n,r)},l;a&&typeof a.ownKeys=="function"?l=a.ownKeys:Object.getOwnPropertySymbols?l=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:l=function(e){return Object.getOwnPropertyNames(e)};function j(t){console&&console.warn&&console.warn(t)}var L=Number.isNaN||function(e){return e!==e};function o(){o.init.call(this)}p.exports=o;p.exports.once=A;o.EventEmitter=o;o.prototype._events=void 0;o.prototype._eventsCount=0;o.prototype._maxListeners=void 0;var m=10;function v(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return m},set:function(t){if(typeof t!="number"||t<0||L(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");m=t}});o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};o.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||L(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function y(t){return t._maxListeners===void 0?o.defaultMaxListeners:t._maxListeners}o.prototype.getMaxListeners=function(){return y(this)};o.prototype.emit=function(e){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i=e==="error",f=this._events;if(f!==void 0)i=i&&f.error===void 0;else if(!i)return!1;if(i){var s;if(n.length>0&&(s=n[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=f[e];if(c===void 0)return!1;if(typeof c=="function")d(c,this,n);else for(var h=c.length,O=E(c,h),r=0;r<h;++r)d(O[r],this,n);return!0};function g(t,e,n,r){var i,f,s;if(v(n),f=t._events,f===void 0?(f=t._events=Object.create(null),t._eventsCount=0):(f.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),f=t._events),s=f[e]),s===void 0)s=f[e]=n,++t._eventsCount;else if(typeof s=="function"?s=f[e]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=y(t),i>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,j(u)}return t}o.prototype.addListener=function(e,n){return g(this,e,n,!1)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function(e,n){return g(this,e,n,!0)};function R(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=R.bind(r);return i.listener=n,r.wrapFn=i,i}o.prototype.once=function(e,n){return v(n),this.on(e,_(this,e,n)),this};o.prototype.prependOnceListener=function(e,n){return v(n),this.prependListener(e,_(this,e,n)),this};o.prototype.removeListener=function(e,n){var r,i,f,s,u;if(v(n),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||n));else if(typeof r!="function"){for(f=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){u=r[s].listener,f=s;break}if(f<0)return this;f===0?r.shift():N(r,f),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||n)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function(e){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var f=Object.keys(r),s;for(i=0;i<f.length;++i)s=f[i],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[e],typeof n=="function")this.removeListener(e,n);else if(n!==void 0)for(i=n.length-1;i>=0;i--)this.removeListener(e,n[i]);return this};function w(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?M(i):E(i,i.length)}o.prototype.listeners=function(e){return w(this,e,!0)};o.prototype.rawListeners=function(e){return w(this,e,!1)};o.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):b.call(t,e)};o.prototype.listenerCount=b;function b(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function E(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function N(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function M(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}function A(t,e){return new Promise(function(n,r){function i(s){t.removeListener(e,f),r(s)}function f(){typeof t.removeListener=="function"&&t.removeListener("error",i),n([].slice.call(arguments))}x(t,e,f,{once:!0}),e!=="error"&&P(t,i,{once:!0})})}function P(t,e,n){typeof t.on=="function"&&x(t,"error",e,n)}function x(t,e,n,r){if(typeof t.on=="function")r.once?t.once(e,n):t.on(e,n);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(f){r.once&&t.removeEventListener(e,i),n(f)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var T=p.exports;const I=C(T);export{T as e,I as k};
1
+ import{h as C}from"./index-DN2JqH-l.js";var p={exports:{}},a=typeof Reflect=="object"?Reflect:null,d=a&&typeof a.apply=="function"?a.apply:function(e,n,r){return Function.prototype.apply.call(e,n,r)},l;a&&typeof a.ownKeys=="function"?l=a.ownKeys:Object.getOwnPropertySymbols?l=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:l=function(e){return Object.getOwnPropertyNames(e)};function j(t){console&&console.warn&&console.warn(t)}var L=Number.isNaN||function(e){return e!==e};function o(){o.init.call(this)}p.exports=o;p.exports.once=A;o.EventEmitter=o;o.prototype._events=void 0;o.prototype._eventsCount=0;o.prototype._maxListeners=void 0;var m=10;function v(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return m},set:function(t){if(typeof t!="number"||t<0||L(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");m=t}});o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};o.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||L(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function y(t){return t._maxListeners===void 0?o.defaultMaxListeners:t._maxListeners}o.prototype.getMaxListeners=function(){return y(this)};o.prototype.emit=function(e){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i=e==="error",f=this._events;if(f!==void 0)i=i&&f.error===void 0;else if(!i)return!1;if(i){var s;if(n.length>0&&(s=n[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=f[e];if(c===void 0)return!1;if(typeof c=="function")d(c,this,n);else for(var h=c.length,O=E(c,h),r=0;r<h;++r)d(O[r],this,n);return!0};function g(t,e,n,r){var i,f,s;if(v(n),f=t._events,f===void 0?(f=t._events=Object.create(null),t._eventsCount=0):(f.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),f=t._events),s=f[e]),s===void 0)s=f[e]=n,++t._eventsCount;else if(typeof s=="function"?s=f[e]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=y(t),i>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,j(u)}return t}o.prototype.addListener=function(e,n){return g(this,e,n,!1)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function(e,n){return g(this,e,n,!0)};function R(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=R.bind(r);return i.listener=n,r.wrapFn=i,i}o.prototype.once=function(e,n){return v(n),this.on(e,_(this,e,n)),this};o.prototype.prependOnceListener=function(e,n){return v(n),this.prependListener(e,_(this,e,n)),this};o.prototype.removeListener=function(e,n){var r,i,f,s,u;if(v(n),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||n));else if(typeof r!="function"){for(f=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){u=r[s].listener,f=s;break}if(f<0)return this;f===0?r.shift():N(r,f),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||n)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function(e){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var f=Object.keys(r),s;for(i=0;i<f.length;++i)s=f[i],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[e],typeof n=="function")this.removeListener(e,n);else if(n!==void 0)for(i=n.length-1;i>=0;i--)this.removeListener(e,n[i]);return this};function w(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?M(i):E(i,i.length)}o.prototype.listeners=function(e){return w(this,e,!0)};o.prototype.rawListeners=function(e){return w(this,e,!1)};o.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):b.call(t,e)};o.prototype.listenerCount=b;function b(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function E(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function N(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function M(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}function A(t,e){return new Promise(function(n,r){function i(s){t.removeListener(e,f),r(s)}function f(){typeof t.removeListener=="function"&&t.removeListener("error",i),n([].slice.call(arguments))}x(t,e,f,{once:!0}),e!=="error"&&P(t,i,{once:!0})})}function P(t,e,n){typeof t.on=="function"&&x(t,"error",e,n)}function x(t,e,n,r){if(typeof t.on=="function")r.once?t.once(e,n):t.on(e,n);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(f){r.once&&t.removeEventListener(e,i),n(f)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var T=p.exports;const I=C(T);export{T as e,I as k};
@@ -1,4 +1,4 @@
1
- import{w as C}from"./core-FalccOZQ.js";import"./index-DlDkzdhK.js";import"./events-BSf9wyey.js";import"./index.es-B3ObrDkW.js";import"./index-nibyPLVP.js";import"./index.es-vOkXvnBD.js";const l=C`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ import{w as C}from"./core-f4taWsy5.js";import"./index-DN2JqH-l.js";import"./events-CjOrSHaz.js";import"./index.es-MXG0VeeZ.js";import"./index-nibyPLVP.js";import"./index.es-BEAksKXY.js";const l=C`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M15.0162 11.6312L9.55059 2.13937C9.39228 1.86862 9.16584 1.64405 8.8938 1.48798C8.62176 1.33192 8.3136 1.2498 7.99997 1.2498C7.68634 1.2498 7.37817 1.33192 7.10613 1.48798C6.83409 1.64405 6.60765 1.86862 6.44934 2.13937L0.983716 11.6312C0.830104 11.894 0.749146 12.1928 0.749146 12.4972C0.749146 12.8015 0.830104 13.1004 0.983716 13.3631C1.14027 13.6352 1.3664 13.8608 1.63889 14.0166C1.91139 14.1725 2.22044 14.253 2.53434 14.25H13.4656C13.7793 14.2528 14.0881 14.1721 14.3603 14.0163C14.6326 13.8604 14.8585 13.635 15.015 13.3631C15.1688 13.1005 15.2499 12.8017 15.2502 12.4973C15.2504 12.193 15.1696 11.8941 15.0162 11.6312ZM13.7162 12.6125C13.6908 12.6558 13.6541 12.6914 13.6101 12.7157C13.5661 12.7399 13.5164 12.7517 13.4662 12.75H2.53434C2.48415 12.7517 2.43442 12.7399 2.39042 12.7157C2.34641 12.6914 2.30976 12.6558 2.28434 12.6125C2.26278 12.5774 2.25137 12.5371 2.25137 12.4959C2.25137 12.4548 2.26278 12.4144 2.28434 12.3794L7.74997 2.88749C7.77703 2.84583 7.81408 2.8116 7.85774 2.7879C7.9014 2.7642 7.95029 2.75178 7.99997 2.75178C8.04964 2.75178 8.09854 2.7642 8.1422 2.7879C8.18586 2.8116 8.2229 2.84583 8.24997 2.88749L13.715 12.3794C13.7367 12.4143 13.7483 12.4546 13.7486 12.4958C13.7488 12.5369 13.7376 12.5773 13.7162 12.6125ZM7.24997 8.49999V6.49999C7.24997 6.30108 7.32898 6.11031 7.46964 5.96966C7.61029 5.82901 7.80105 5.74999 7.99997 5.74999C8.19888 5.74999 8.38964 5.82901 8.5303 5.96966C8.67095 6.11031 8.74997 6.30108 8.74997 6.49999V8.49999C8.74997 8.6989 8.67095 8.88967 8.5303 9.03032C8.38964 9.17097 8.19888 9.24999 7.99997 9.24999C7.80105 9.24999 7.61029 9.17097 7.46964 9.03032C7.32898 8.88967 7.24997 8.6989 7.24997 8.49999ZM8.99997 11C8.99997 11.1978 8.94132 11.3911 8.83144 11.5556C8.72155 11.72 8.56538 11.8482 8.38265 11.9239C8.19992 11.9996 7.99886 12.0194 7.80488 11.9808C7.6109 11.9422 7.43271 11.847 7.29286 11.7071C7.15301 11.5672 7.05777 11.3891 7.01918 11.1951C6.9806 11.0011 7.0004 10.8 7.07609 10.6173C7.15177 10.4346 7.27995 10.2784 7.4444 10.1685C7.60885 10.0586 7.80219 9.99999 7.99997 9.99999C8.26518 9.99999 8.51954 10.1053 8.70707 10.2929C8.89461 10.4804 8.99997 10.7348 8.99997 11Z" fill="currentColor"/>
3
3
  </svg>
4
4
  `;export{l as exclamationTriangleSvg};
@@ -1,4 +1,4 @@
1
- import{w as a}from"./core-FalccOZQ.js";import"./index-DlDkzdhK.js";import"./events-BSf9wyey.js";import"./index.es-B3ObrDkW.js";import"./index-nibyPLVP.js";import"./index.es-vOkXvnBD.js";const l=a`<svg fill="none" viewBox="0 0 14 15">
1
+ import{w as a}from"./core-f4taWsy5.js";import"./index-DN2JqH-l.js";import"./events-CjOrSHaz.js";import"./index.es-MXG0VeeZ.js";import"./index-nibyPLVP.js";import"./index.es-BEAksKXY.js";const l=a`<svg fill="none" viewBox="0 0 14 15">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{w as o}from"./core-FalccOZQ.js";import"./index-DlDkzdhK.js";import"./events-BSf9wyey.js";import"./index.es-B3ObrDkW.js";import"./index-nibyPLVP.js";import"./index.es-vOkXvnBD.js";const n=o`<svg fill="none" viewBox="0 0 14 15">
1
+ import{w as o}from"./core-f4taWsy5.js";import"./index-DN2JqH-l.js";import"./events-CjOrSHaz.js";import"./index.es-MXG0VeeZ.js";import"./index-nibyPLVP.js";import"./index.es-BEAksKXY.js";const n=o`<svg fill="none" viewBox="0 0 14 15">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1 +1 @@
1
- import{a as _,ae as L}from"./signing-CQ15XHyj.js";import"./utils-B3vUvlNq.js";import"./index-DlDkzdhK.js";const V="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",U=V.length,M=V.charAt(0),z=Math.log(256)/Math.log(U);function F(t){if(!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length===0)return"";let e=0,i=0,n=0;const s=t.length;for(;n!==s&&t[n]===0;)n++,e++;const c=(s-n)*z+1>>>0,a=new Uint8Array(c);for(;n!==s;){let d=t[n]||0,w=0;for(let h=c-1;(d!==0||w<i)&&h!==-1;h--,w++)d+=256*(a[h]||0)>>>0,a[h]=d%U>>>0,d=d/U>>>0;if(d!==0)throw new Error("Non-zero carry");i=w,n++}let l=c-i;for(;l!==c&&a[l]===0;)l++;let u=M.repeat(e);for(;l<c;++l)u+=V.charAt(a[l]||0);return u}let o,E,r=0,j={},b,N;const D=0;let C=0,S,R,I;const $={mapsAsObjects:!0,useRecords:!1};function v(t){let e;if(t<16&&(e=T(t)))return e;if(t>64&&decoder)return decoder.decode(o.subarray(r,r+=t));const i=r+t,n=[];for(e="";r<i;){const s=o[r++];if(!(s&128))n.push(s);else if((s&224)===192){const c=o[r++]&63;n.push((s&31)<<6|c)}else if((s&240)===224){const c=o[r++]&63,a=o[r++]&63;n.push((s&31)<<12|c<<6|a)}else if((s&248)===240){const c=o[r++]&63,a=o[r++]&63,l=o[r++]&63;let u=(s&7)<<18|c<<12|a<<6|l;u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u)}else n.push(s);n.length>=4096&&(e+=x.apply(String,n),n.length=0)}return n.length>0&&(e+=x.apply(String,n)),e}class O{constructor(){Object.assign(this,$)}decodeKey(e){return e}decode(e,i=-1){E=i>-1?i:e.length,r=0,C=0,N=null,S=null,o=e;try{I=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){throw o=null,e instanceof Uint8Array?n:new Error(`Source must be a Uint8Array or Buffer but was a ${e&&typeof e=="object"?e.constructor.name:typeof e}`)}return this instanceof O?(j=this,this.sharedValues&&(this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),(!b||b.length>0)&&(b=[])):(j=$,(!b||b.length>0)&&(b=[])),H()}}function H(){try{const t=g();if(S){if(r>=S.postBundlePosition){const e=new Error("Unexpected bundle position");throw e.incomplete=!0,e}r=S.postBundlePosition,S=null}if(r===E)b=null,o=null,R&&(R=null);else if(r>E){const e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else throw new Error("Data read, but end of buffer not reached");return t}catch(t){throw q(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer"))&&(t.incomplete=!0),t}}function g(){let t=o[r++];const e=t>>5;if(t=t&31,t>23)switch(t){case 24:t=o[r++];break;default:throw new Error(`Unknown token ${t}`)}switch(e){case 0:return t;case 1:return~t;case 2:return W(t);case 3:if(C>=r)return N.slice(r-D,(r+=t)-D);if(C===0&&E<140&&t<32){const i=t<16?T(t):K(t);if(i!==null)return i}return v(t);case 4:{const i=new Array(t);for(let n=0;n<t;n++)i[n]=g();return i}case 5:{const i={};for(let n=0;n<t;n++)i[J(g())]=g();return i}default:if(Number.isNaN(t)){const i=new Error("Unexpected end of CBOR data");throw i.incomplete=!0,i}throw new Error(`Unknown CBOR token ${t}`)}}function J(t){if(typeof t=="string")return t==="__proto__"?"__proto_":t;if(typeof t!="object")return t.toString();throw new Error(`Invalid property name type ${typeof t}`)}const x=String.fromCharCode;function K(t){const e=r,i=new Array(t);for(let n=0;n<t;n++){const s=o[r++];if((s&128)>0){r=e;return}i[n]=s}return x.apply(String,i)}function T(t){if(t<4){if(t<2){if(t===0)return"";const k=o[r++];if((k&128)>1){r-=1;return}return x(k)}const f=o[r++],p=o[r++];if((f&128)>0||(p&128)>0){r-=2;return}if(t<3)return x(f,p);const y=o[r++];if((y&128)>0){r-=3;return}return x(f,p,y)}const e=o[r++],i=o[r++],n=o[r++],s=o[r++];if((e&128)>0||(i&128)>0||(n&128)>0||(s&128)>0){r-=4;return}if(t<6){if(t===4)return x(e,i,n,s);const f=o[r++];if((f&128)>0){r-=5;return}return x(e,i,n,s,f)}if(t<8){const f=o[r++],p=o[r++];if((f&128)>0||(p&128)>0){r-=6;return}if(t<7)return x(e,i,n,s,f,p);const y=o[r++];if((y&128)>0){r-=7;return}return x(e,i,n,s,f,p,y)}const c=o[r++],a=o[r++],l=o[r++],u=o[r++];if((c&128)>0||(a&128)>0||(l&128)>0||(u&128)>0){r-=8;return}if(t<10){if(t===8)return x(e,i,n,s,c,a,l,u);const f=o[r++];if((f&128)>0){r-=9;return}return x(e,i,n,s,c,a,l,u,f)}if(t<12){const f=o[r++],p=o[r++];if((f&128)>0||(p&128)>0){r-=10;return}if(t<11)return x(e,i,n,s,c,a,l,u,f,p);const y=o[r++];if((y&128)>0){r-=11;return}return x(e,i,n,s,c,a,l,u,f,p,y)}const d=o[r++],w=o[r++],h=o[r++],m=o[r++];if((d&128)>0||(w&128)>0||(h&128)>0||(m&128)>0){r-=12;return}if(t<14){if(t===12)return x(e,i,n,s,c,a,l,u,d,w,h,m);const f=o[r++];if((f&128)>0){r-=13;return}return x(e,i,n,s,c,a,l,u,d,w,h,m,f)}const A=o[r++],B=o[r++];if((A&128)>0||(B&128)>0){r-=14;return}if(t<15)return x(e,i,n,s,c,a,l,u,d,w,h,m,A,B);const P=o[r++];if((P&128)>0){r-=15;return}return x(e,i,n,s,c,a,l,u,d,w,h,m,A,B,P)}function W(t){return j.copyBuffers?Uint8Array.prototype.slice.call(o,r,r+=t):o.subarray(r,r+=t)}function q(){o=null,R=null,b=null}const G=new Array(147);for(let t=0;t<256;t++)G[t]=+`1e${Math.floor(45.15-t*.30103)}`;const Q=new O,X=Q.decode;function Y(t){return _(t,{strict:!1})?t:`0x${t}`}function et(t){const e=L(Y(t)),i=e[e.length-2]*256+e[e.length-1],n=e.length-2-i;if(n<0||n>e.length)return;const s=e.slice(n,-2),c=X(s);if("ipfs"in c)return`ipfs://${F(c.ipfs)}`}export{et as extractIPFSUri};
1
+ import{a as _,ae as L}from"./signing-B1K_Jdsm.js";import"./utils-B3vUvlNq.js";import"./index-DN2JqH-l.js";const V="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",U=V.length,M=V.charAt(0),z=Math.log(256)/Math.log(U);function F(t){if(!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length===0)return"";let e=0,i=0,n=0;const s=t.length;for(;n!==s&&t[n]===0;)n++,e++;const c=(s-n)*z+1>>>0,a=new Uint8Array(c);for(;n!==s;){let d=t[n]||0,w=0;for(let h=c-1;(d!==0||w<i)&&h!==-1;h--,w++)d+=256*(a[h]||0)>>>0,a[h]=d%U>>>0,d=d/U>>>0;if(d!==0)throw new Error("Non-zero carry");i=w,n++}let l=c-i;for(;l!==c&&a[l]===0;)l++;let u=M.repeat(e);for(;l<c;++l)u+=V.charAt(a[l]||0);return u}let o,E,r=0,j={},b,N;const D=0;let C=0,S,R,I;const $={mapsAsObjects:!0,useRecords:!1};function v(t){let e;if(t<16&&(e=T(t)))return e;if(t>64&&decoder)return decoder.decode(o.subarray(r,r+=t));const i=r+t,n=[];for(e="";r<i;){const s=o[r++];if(!(s&128))n.push(s);else if((s&224)===192){const c=o[r++]&63;n.push((s&31)<<6|c)}else if((s&240)===224){const c=o[r++]&63,a=o[r++]&63;n.push((s&31)<<12|c<<6|a)}else if((s&248)===240){const c=o[r++]&63,a=o[r++]&63,l=o[r++]&63;let u=(s&7)<<18|c<<12|a<<6|l;u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u)}else n.push(s);n.length>=4096&&(e+=x.apply(String,n),n.length=0)}return n.length>0&&(e+=x.apply(String,n)),e}class O{constructor(){Object.assign(this,$)}decodeKey(e){return e}decode(e,i=-1){E=i>-1?i:e.length,r=0,C=0,N=null,S=null,o=e;try{I=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){throw o=null,e instanceof Uint8Array?n:new Error(`Source must be a Uint8Array or Buffer but was a ${e&&typeof e=="object"?e.constructor.name:typeof e}`)}return this instanceof O?(j=this,this.sharedValues&&(this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),(!b||b.length>0)&&(b=[])):(j=$,(!b||b.length>0)&&(b=[])),H()}}function H(){try{const t=g();if(S){if(r>=S.postBundlePosition){const e=new Error("Unexpected bundle position");throw e.incomplete=!0,e}r=S.postBundlePosition,S=null}if(r===E)b=null,o=null,R&&(R=null);else if(r>E){const e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else throw new Error("Data read, but end of buffer not reached");return t}catch(t){throw q(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer"))&&(t.incomplete=!0),t}}function g(){let t=o[r++];const e=t>>5;if(t=t&31,t>23)switch(t){case 24:t=o[r++];break;default:throw new Error(`Unknown token ${t}`)}switch(e){case 0:return t;case 1:return~t;case 2:return W(t);case 3:if(C>=r)return N.slice(r-D,(r+=t)-D);if(C===0&&E<140&&t<32){const i=t<16?T(t):K(t);if(i!==null)return i}return v(t);case 4:{const i=new Array(t);for(let n=0;n<t;n++)i[n]=g();return i}case 5:{const i={};for(let n=0;n<t;n++)i[J(g())]=g();return i}default:if(Number.isNaN(t)){const i=new Error("Unexpected end of CBOR data");throw i.incomplete=!0,i}throw new Error(`Unknown CBOR token ${t}`)}}function J(t){if(typeof t=="string")return t==="__proto__"?"__proto_":t;if(typeof t!="object")return t.toString();throw new Error(`Invalid property name type ${typeof t}`)}const x=String.fromCharCode;function K(t){const e=r,i=new Array(t);for(let n=0;n<t;n++){const s=o[r++];if((s&128)>0){r=e;return}i[n]=s}return x.apply(String,i)}function T(t){if(t<4){if(t<2){if(t===0)return"";const k=o[r++];if((k&128)>1){r-=1;return}return x(k)}const f=o[r++],p=o[r++];if((f&128)>0||(p&128)>0){r-=2;return}if(t<3)return x(f,p);const y=o[r++];if((y&128)>0){r-=3;return}return x(f,p,y)}const e=o[r++],i=o[r++],n=o[r++],s=o[r++];if((e&128)>0||(i&128)>0||(n&128)>0||(s&128)>0){r-=4;return}if(t<6){if(t===4)return x(e,i,n,s);const f=o[r++];if((f&128)>0){r-=5;return}return x(e,i,n,s,f)}if(t<8){const f=o[r++],p=o[r++];if((f&128)>0||(p&128)>0){r-=6;return}if(t<7)return x(e,i,n,s,f,p);const y=o[r++];if((y&128)>0){r-=7;return}return x(e,i,n,s,f,p,y)}const c=o[r++],a=o[r++],l=o[r++],u=o[r++];if((c&128)>0||(a&128)>0||(l&128)>0||(u&128)>0){r-=8;return}if(t<10){if(t===8)return x(e,i,n,s,c,a,l,u);const f=o[r++];if((f&128)>0){r-=9;return}return x(e,i,n,s,c,a,l,u,f)}if(t<12){const f=o[r++],p=o[r++];if((f&128)>0||(p&128)>0){r-=10;return}if(t<11)return x(e,i,n,s,c,a,l,u,f,p);const y=o[r++];if((y&128)>0){r-=11;return}return x(e,i,n,s,c,a,l,u,f,p,y)}const d=o[r++],w=o[r++],h=o[r++],m=o[r++];if((d&128)>0||(w&128)>0||(h&128)>0||(m&128)>0){r-=12;return}if(t<14){if(t===12)return x(e,i,n,s,c,a,l,u,d,w,h,m);const f=o[r++];if((f&128)>0){r-=13;return}return x(e,i,n,s,c,a,l,u,d,w,h,m,f)}const A=o[r++],B=o[r++];if((A&128)>0||(B&128)>0){r-=14;return}if(t<15)return x(e,i,n,s,c,a,l,u,d,w,h,m,A,B);const P=o[r++];if((P&128)>0){r-=15;return}return x(e,i,n,s,c,a,l,u,d,w,h,m,A,B,P)}function W(t){return j.copyBuffers?Uint8Array.prototype.slice.call(o,r,r+=t):o.subarray(r,r+=t)}function q(){o=null,R=null,b=null}const G=new Array(147);for(let t=0;t<256;t++)G[t]=+`1e${Math.floor(45.15-t*.30103)}`;const Q=new O,X=Q.decode;function Y(t){return _(t,{strict:!1})?t:`0x${t}`}function et(t){const e=L(Y(t)),i=e[e.length-2]*256+e[e.length-1],n=e.length-2-i;if(n<0||n>e.length)return;const s=e.slice(n,-2),c=X(s);if("ipfs"in c)return`ipfs://${F(c.ipfs)}`}export{et as extractIPFSUri};
@@ -1,4 +1,4 @@
1
- import{w as l}from"./core-FalccOZQ.js";import"./index-DlDkzdhK.js";import"./events-BSf9wyey.js";import"./index.es-B3ObrDkW.js";import"./index-nibyPLVP.js";import"./index.es-vOkXvnBD.js";const a=l`<svg fill="none" viewBox="0 0 40 40">
1
+ import{w as l}from"./core-f4taWsy5.js";import"./index-DN2JqH-l.js";import"./events-CjOrSHaz.js";import"./index.es-MXG0VeeZ.js";import"./index-nibyPLVP.js";import"./index.es-BEAksKXY.js";const a=l`<svg fill="none" viewBox="0 0 40 40">
2
2
  <g clip-path="url(#a)">
3
3
  <g clip-path="url(#b)">
4
4
  <circle cx="20" cy="19.89" r="20" fill="#1877F2" />