@dcl/shop 1.4.1-31270463822.commit-d816951 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/_assets/{Activity-DRduybVV.js → Activity-Bp8Sw4qK.js} +24 -24
  2. package/_assets/{AnimatedBackground-ypLCVsPZ.js → AnimatedBackground-lL_07dfc.js} +1 -1
  3. package/_assets/{Assets-Cwv_G3fi.js → Assets-IJnjhA4j.js} +7 -7
  4. package/_assets/{Assets.styles-DPnoon7Z.js → Assets.styles-DvKHdPv2.js} +1 -1
  5. package/_assets/{Authorizations-D6ULsW9E.js → Authorizations-Dik9aSxH.js} +1 -1
  6. package/_assets/{Cart-CQO5e78H.js → Cart-pNR-1Udw.js} +1 -1
  7. package/_assets/{CircularProgress-DLhxWHZE.js → CircularProgress-Be3b2-j-.js} +1 -1
  8. package/_assets/{Collection-Dujbxbtk.js → Collection-CC0NQbio.js} +1 -1
  9. package/_assets/{CollectionCarousel-BuxdLEjb.js → CollectionCarousel-CbSaEpnt.js} +2 -2
  10. package/_assets/{Confetti-DgKI9CE0.js → Confetti-CsLfYVYK.js} +1 -1
  11. package/_assets/{Creator-UxVsIlzx.js → Creator-BHrSc3yG.js} +1 -1
  12. package/_assets/{ErrorNotice-Ce7lGsYT.js → ErrorNotice-85K9YN9v.js} +1 -1
  13. package/_assets/{ExchangeController-DuD0bbgT.js → ExchangeController-pCPaWVPt.js} +1 -1
  14. package/_assets/{Faq-BOc22i5I.js → Faq-TM-W-SNb.js} +1 -1
  15. package/_assets/{GetCredits-BsP8gUID.js → GetCredits-DdXr31aY.js} +1 -1
  16. package/_assets/{Grow-t2UFwA6e.js → Grow-ChVTGdeq.js} +1 -1
  17. package/_assets/{HelpersUtil-BZkorgZo.js → HelpersUtil-Ic5GpN9l.js} +1 -1
  18. package/_assets/{ItemDetail-B04NYAZe.js → ItemDetail-CyOs-AQj.js} +1 -1
  19. package/_assets/LazyEmoteControls-CkOxDI6U.js +2 -0
  20. package/_assets/{LoadMore-BiqDnpiK.js → LoadMore-CZrX5Gv7.js} +1 -1
  21. package/_assets/{ManaPricingBanner.styles-CwLEZBYt.js → ManaPricingBanner.styles-BKaFLBUK.js} +1 -1
  22. package/_assets/{MyAssets-B-BQ0Gvo.js → MyAssets-BQCzzNvz.js} +2 -2
  23. package/_assets/{MyFavorites-HoGz-hoR.js → MyFavorites-BqzCIYTK.js} +1 -1
  24. package/_assets/{NotFound-BGcJ8gYV.js → NotFound-BHSNy_W9.js} +1 -1
  25. package/_assets/{NotificationsBell-DhVP1k-e.js → NotificationsBell-Cayv1bNv.js} +1 -1
  26. package/_assets/{OutfitDetail-BVdTdbU8.js → OutfitDetail-BTWKm6JG.js} +1 -1
  27. package/_assets/{OutfitPreview-Dc8OljjJ.js → OutfitPreview-D11FWLSw.js} +1 -1
  28. package/_assets/{OutfitStudio-CdFWnwOk.js → OutfitStudio-dGwku2rf.js} +1 -1
  29. package/_assets/{StoreSettings-C5zvB9ig.js → StoreSettings-CitNcyvk.js} +1 -1
  30. package/_assets/{Success-wVR2FEwa.js → Success-D4YuNuG8.js} +1 -1
  31. package/_assets/{SwapController-BmDxMQDQ.js → SwapController-C5PTgP9M.js} +1 -1
  32. package/_assets/{Tooltip-DmJBOJG4.js → Tooltip-B8fVdcBn.js} +1 -1
  33. package/_assets/{TradeService-BOVZw_cj.js → TradeService-gwq3auT8.js} +1 -1
  34. package/_assets/{W3MFrameProviderSingleton-CW1PUUTw.js → W3MFrameProviderSingleton-CpAC0lb5.js} +3 -3
  35. package/_assets/{WebCryptoP256-BJtPdt0B.js → WebCryptoP256-BdZ7qw2f.js} +1 -1
  36. package/_assets/{authorizations-C1arBETV.js → authorizations-DF77DF8l.js} +1 -1
  37. package/_assets/{basic-DsaYVSJa.js → basic-BzrBYDLn.js} +1 -1
  38. package/_assets/{biconomy-CdlDa34k.js → biconomy-D0NqkYS4.js} +1 -1
  39. package/_assets/{builder-KOO6PWgS.js → builder-NgL-D1DH.js} +1 -1
  40. package/_assets/{buy-M73sUQEC.js → buy-BO3reV5y.js} +1 -1
  41. package/_assets/{buy-gasless-B04We20s.js → buy-gasless-D-P_OEFk.js} +1 -1
  42. package/_assets/{categories-D6lgqZ-J.js → categories-DEDiLarq.js} +1 -1
  43. package/_assets/{ccip-u425zS87.js → ccip-CKxxDuCA.js} +1 -1
  44. package/_assets/{ccip-DyPtCXe7.js → ccip-CrlybRWE.js} +1 -1
  45. package/_assets/{collectionPage.styles-DArUMgMV.js → collectionPage.styles-B7luoUwY.js} +4 -4
  46. package/_assets/{controller-0MuFE3Gz.js → controller-D-WxJPwg.js} +2 -2
  47. package/_assets/{core-94MvqV9r.js → core-B2vVQmfh.js} +4 -4
  48. package/_assets/{createSvgIcon-WVKovDz9.js → createSvgIcon-BpHWx1Ka.js} +1 -1
  49. package/_assets/{custom-Ce3DNkNI.js → custom-CxNQPA4R.js} +1 -1
  50. package/_assets/{data-capture-BAWa7qDw.js → data-capture-COq-EdMa.js} +1 -1
  51. package/_assets/{email-Cr0XOmY6.js → email-T9V3sqd1.js} +1 -1
  52. package/_assets/{embedded-wallet-DwCd7IHR.js → embedded-wallet-Dg7uu1gY.js} +1 -1
  53. package/_assets/{emotion-styled.browser.esm-BEfi2ynx.js → emotion-styled.browser.esm-DGNmaOEg.js} +1 -1
  54. package/_assets/{engine-CeV65-ng.js → engine-B6OKL1kN.js} +1 -1
  55. package/_assets/{errors-D2Oxm3fm.js → errors-ByuDglQO.js} +1 -1
  56. package/_assets/{estimate-l1-fee-BaiEAtA8.js → estimate-l1-fee-U77A6DZp.js} +1 -1
  57. package/_assets/{execute-D1vpEx_6.js → execute-BKGpV3HT.js} +2 -2
  58. package/_assets/{features-xL7U_YA_.js → features-B_0m5qAO.js} +1 -1
  59. package/_assets/{fetchTokenMetadata-CbzSe8vV.js → fetchTokenMetadata-BLkwh0vx.js} +2 -2
  60. package/_assets/{field.styles-M7cznL3G.js → field.styles-Di2XxH4G.js} +1 -1
  61. package/_assets/{get-ecosystem-wallet-info-GCURfOgC.js → get-ecosystem-wallet-info-DcdrlNuu.js} +1 -1
  62. package/_assets/{getBalance-B8Ul3w-q.js → getBalance-XiFtLwlO.js} +1 -1
  63. package/_assets/{getNFT-ChCvt1Pa.js → getNFT-Bmd84BZn.js} +1 -1
  64. package/_assets/{getNFT-Bo7oToRD.js → getNFT-BywN0Kux.js} +1 -1
  65. package/_assets/{grid.styles-SyT_GsJ_.js → grid.styles-CHyL7A8J.js} +1 -1
  66. package/_assets/{hashTypedData-DYmarbOl.js → hashTypedData-CPoOrHdV.js} +1 -1
  67. package/_assets/{hashTypedData-Drw1v4Gy.js → hashTypedData-D6j6Ztal.js} +1 -1
  68. package/_assets/{in-app-a_vaCizu.js → in-app-bZq5TT4x.js} +1 -1
  69. package/_assets/{in-app-wallet-calls-BPQLmHd_.js → in-app-wallet-calls-zHwhzKhq.js} +1 -1
  70. package/_assets/{index-BnPkJ78u.js → index-2FoefM9Q.js} +1 -1
  71. package/_assets/{index-2yXtFC3w.js → index-5bRECx6a.js} +1 -1
  72. package/_assets/{index-hZagCJ_-.js → index-6jfgxkro.js} +1 -1
  73. package/_assets/{index-CoZetxg0.js → index-B1FHWlJe.js} +1 -1
  74. package/_assets/{index-B22HUskl.js → index-BFMoyHW0.js} +1 -1
  75. package/_assets/{index-CDT-f5kR.js → index-BHzsqUc8.js} +1 -1
  76. package/_assets/{index-C4KlFepO.js → index-BPlrOFTC.js} +1 -1
  77. package/_assets/{index-BLgEoAMc.js → index-BQ9JyrRe.js} +1 -1
  78. package/_assets/{index-7h3SJCpU.js → index-BSn1_2Zj.js} +1 -1
  79. package/_assets/{index-Bo8PlEzQ.js → index-BZ1hhBx4.js} +1 -1
  80. package/_assets/{index-WAgD6WPQ.js → index-BZGM9FWk.js} +1 -1
  81. package/_assets/{index-C35WtbE5.js → index-BbJAHpzm.js} +1 -1
  82. package/_assets/{index-C8RkDmvI.js → index-BcgGNlqh.js} +2 -2
  83. package/_assets/{index-Bm5-3PXX.js → index-BsW8Eyey.js} +1 -1
  84. package/_assets/{index-BtMueIRm.js → index-ByuFbmZ8.js} +1 -1
  85. package/_assets/{index-NZglH3wv.js → index-C4jkL4id.js} +1 -1
  86. package/_assets/{index-B6D4YICs.js → index-C617s7dD.js} +1 -1
  87. package/_assets/{index-DEECJUIl.js → index-CNswf2xV.js} +1 -1
  88. package/_assets/{index-BXnelBcK.js → index-C__aQGZ3.js} +1 -1
  89. package/_assets/{index-xyDGbsu7.js → index-CfoYiHeb.js} +2 -2
  90. package/_assets/{index-BYMZCtEX.js → index-Cm_4zTDf.js} +3 -3
  91. package/_assets/{index-B8l9BXVE.js → index-Cn8WVps3.js} +1 -1
  92. package/_assets/{index-BLTpEQOz.js → index-CntdB4i7.js} +1 -1
  93. package/_assets/{index-CTlOaM0r.js → index-Coy9djZY.js} +1 -1
  94. package/_assets/{index-BJ7QDORu.js → index-CtQ9l7ML.js} +1 -1
  95. package/_assets/{index-u6d-Hhga.js → index-CteyodZT.js} +3 -3
  96. package/_assets/{index-BOQ3wHjU.js → index-CuVgNl3Y.js} +1 -1
  97. package/_assets/{index-BvG65AZz.js → index-CvqOZGzt.js} +1 -1
  98. package/_assets/{index-C489Mrmb.js → index-CxWIzN3m.js} +1 -1
  99. package/_assets/{index-DNsu9EnW.js → index-D00IKQW6.js} +1 -1
  100. package/_assets/{index-siSK96BI.js → index-D24PzU1R.js} +3 -3
  101. package/_assets/{index-Bf38MyW2.js → index-D3IKI6V4.js} +1 -1
  102. package/_assets/{index-DZ2zOH0O.js → index-D4yUYJLc.js} +1 -1
  103. package/_assets/{index-BXK7U_aX.js → index-D7XGzB3c.js} +1 -1
  104. package/_assets/{index--ud9yc1V.js → index-DF4Ha-75.js} +1 -1
  105. package/_assets/{index-BWubgfNg.js → index-DIketzHJ.js} +1 -1
  106. package/_assets/{index-DRK-ZYhT.js → index-DPM_2inZ.js} +1 -1
  107. package/_assets/{index-DChQ_aNN.js → index-DPtintqP.js} +1 -1
  108. package/_assets/{index-oTvtIcJO.js → index-Di-TSk-N.js} +1 -1
  109. package/_assets/{index-DJ8_ExxR.js → index-Dp3NEgRA.js} +2 -2
  110. package/_assets/{index--6xa_84e.js → index-DrWafdvv.js} +1 -1
  111. package/_assets/{index-YLh9o5JS.js → index-DtzuonLF.js} +1 -1
  112. package/_assets/{index-B51NwmXP.js → index-DwSMiBZJ.js} +1 -1
  113. package/_assets/{index-BMDEszE5.js → index-Dwdhqx6d.js} +1 -1
  114. package/_assets/{index-_IfC7BYG.js → index-ExVTqMiG.js} +1 -1
  115. package/_assets/{index-CMxdP6bK.js → index-V2TPPzBO.js} +1 -1
  116. package/_assets/{index-MGR8iOdq.js → index-Xxhqhd7B.js} +1 -1
  117. package/_assets/{index-D9fdrY1Y.js → index-dfp4J94C.js} +1 -1
  118. package/_assets/{index-wv69CvU6.js → index-drIus9if.js} +1 -1
  119. package/_assets/{index-CSb_9996.js → index-hUIzKCfu.js} +1 -1
  120. package/_assets/{index-BzGWS8ln.js → index-uGopMLx_.js} +67 -67
  121. package/_assets/{index-DQSjD6iE.js → index-yx-xGak5.js} +1 -1
  122. package/_assets/{index.es-DdiRHtEp.js → index.es-7a-YRioH.js} +1 -1
  123. package/_assets/{index.es-C0xQ9UwN.js → index.es-BFjxQxKe.js} +1 -1
  124. package/_assets/{index.es-CDVFQNzM.js → index.es-DWauw0u3.js} +4 -4
  125. package/_assets/{localBatchGatewayRequest-peECUp5W.js → localBatchGatewayRequest-0VkJzsEN.js} +1 -1
  126. package/_assets/{networks-BaamH2vu.js → networks-DyQsWWgA.js} +1 -1
  127. package/_assets/{onramp-CMdgEVET.js → onramp-DzK_7EqG.js} +1 -1
  128. package/_assets/{openzeppelin-DIm1JWyK.js → openzeppelin-BtnpZFcF.js} +1 -1
  129. package/_assets/{parseNft-tHUKXiwx.js → parseNft-DVNQcQTW.js} +2 -2
  130. package/_assets/{parseSignature-BlcmAmYI.js → parseSignature-d_qU1nsa.js} +3 -3
  131. package/_assets/{parseSignature-DyEannI8.js → parseSignature-uahxpo6h.js} +1 -1
  132. package/_assets/{passkeys-BGingCMs.js → passkeys-DCXgcJ3i.js} +1 -1
  133. package/_assets/{pay-with-exchange-DVNVJXkL.js → pay-with-exchange-BAKpQWUa.js} +1 -1
  134. package/_assets/{qr-overlay-CfVKqNDZ.js → qr-overlay-cF8AYPXz.js} +1 -1
  135. package/_assets/{receive-s4vwQksb.js → receive-DKeQiKpb.js} +1 -1
  136. package/_assets/{resolveImplementation-CtJMMHNn.js → resolveImplementation-BbMBWFik.js} +1 -1
  137. package/_assets/{rpc-L1fXd1Sd.js → rpc-B_5Ot3q6.js} +1 -1
  138. package/_assets/{secp256k1-CTZes-uV.js → secp256k1-BJ5_5ze6.js} +1 -1
  139. package/_assets/{secp256k1-z67sN914.js → secp256k1-C2MsrfGW.js} +1 -1
  140. package/_assets/{secp256k1-DHUNQ5bk.js → secp256k1-vgDnLeQE.js} +1 -1
  141. package/_assets/{send-CbigwlGz.js → send-DRkbPGAy.js} +1 -1
  142. package/_assets/{send-batch-transaction-koPW-Xx-.js → send-batch-transaction-C98vx0Si.js} +1 -1
  143. package/_assets/{send-eip712-transaction-D_0yg9Nh.js → send-eip712-transaction-B9uhwtxq.js} +2 -2
  144. package/_assets/{send-gasless-transaction-DHTCbZYH.js → send-gasless-transaction-DlAx-hhk.js} +2 -2
  145. package/_assets/{send-transaction-vVmLV10q.js → send-transaction-D7omgpzp.js} +2 -2
  146. package/_assets/{sendMetaTransaction-Cha0OHLb.js → sendMetaTransaction-o2u8XwNS.js} +1 -1
  147. package/_assets/{sendRawTransaction-CVp_7MRP.js → sendRawTransaction-DevIof93.js} +3 -3
  148. package/_assets/{serializeTransaction-Cqo7tlLM.js → serializeTransaction-DLeETOYT.js} +1 -1
  149. package/_assets/{session-proposal-C2uAA2u5.js → session-proposal-KU3_N1na.js} +1 -1
  150. package/_assets/{session-request-BlpO5ZV_.js → session-request-uPrgrHzK.js} +2 -2
  151. package/_assets/{signing-D6VaYziU.js → signing-QBKrHvr9.js} +3 -3
  152. package/_assets/{skeleton.styles-PDRIkUUL.js → skeleton.styles-BC9MqXiU.js} +1 -1
  153. package/_assets/{socials-CYBI3Ubm.js → socials-CoKeQXiF.js} +1 -1
  154. package/_assets/{styled-D4QGMvI6.js → styled-DOIj5nPF.js} +1 -1
  155. package/_assets/{swaps-FcdbmTiI.js → swaps-CRzxJol6.js} +1 -1
  156. package/_assets/{thirdweb-CTcb9atG.js → thirdweb-C12p7UHc.js} +3 -3
  157. package/_assets/{to-serializable-transaction-DmYzeFAP.js → to-serializable-transaction-VMfkzTnh.js} +2 -2
  158. package/_assets/{transactionReceipt-CYlPad05.js → transactionReceipt-BD6aaYgU.js} +1 -1
  159. package/_assets/{transactions-BnGm7i4k.js → transactions-eYCJ_4w6.js} +1 -1
  160. package/_assets/{useCreditPacks-DtBkBG2H.js → useCreditPacks-A5RBl1MB.js} +1 -1
  161. package/_assets/{useImportable-21fWQPLj.js → useImportable-DsSOJu2h.js} +1 -1
  162. package/_assets/{useInfiniteGrid-Dx4PYR2K.js → useInfiniteGrid-BSzq15pV.js} +1 -1
  163. package/_assets/{useStore-C53ctj6V.js → useStore-Cus0x1de.js} +1 -1
  164. package/_assets/{useTheme-crJpDWt-.js → useTheme-BRanpp9G.js} +1 -1
  165. package/_assets/{verifyHash-7YoL5c_b.js → verifyHash-B4ZiNM58.js} +1 -1
  166. package/_assets/{w3m-modal-BI79L6Y4.js → w3m-modal-CC3uZxtJ.js} +1 -1
  167. package/_assets/{w3m-modal-DKGkgUce.js → w3m-modal-DjOtYjTK.js} +1 -1
  168. package/_assets/{wait-for-tx-receipt-D_Gb9jAL.js → wait-for-tx-receipt-BnCyfeD5.js} +1 -1
  169. package/_assets/{wallets-DSYNibaO.js → wallets-HnCmZe2C.js} +5 -5
  170. package/_assets/{web-connector-Dp__jGfa.js → web-connector-Bx6u3JDC.js} +3 -3
  171. package/_assets/{writeContract-cBq5zJm-.js → writeContract-BD-47Gns.js} +1 -1
  172. package/_assets/{zoraTestnet-93TlIFkU.js → zoraTestnet-Uh6KMdOq.js} +1 -1
  173. package/index.html +11 -11
  174. package/package.json +1 -1
  175. package/_assets/LazyEmoteControls-Bk_SueO8.js +0 -2
@@ -1,3 +1,3 @@
1
- import{d as G}from"./index-BJ7QDORu.js";/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function P(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function V(e,r){return Array.isArray(r)?r.length===0?!0:e?r.every(n=>typeof n=="string"):r.every(n=>Number.isSafeInteger(n)):!1}function I(e,r){if(typeof r!="string")throw new Error(`${e}: string expected`);return!0}function B(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function v(e){if(!Array.isArray(e))throw new Error("array expected")}function S(e,r){if(!V(!0,r))throw new Error(`${e}: array of strings expected`)}function K(e,r){if(!V(!1,r))throw new Error(`${e}: array of numbers expected`)}function J(...e){const r=s=>s,n=(s,u)=>i=>s(u(i)),b=e.map(s=>s.encode).reduceRight(n,r),d=e.map(s=>s.decode).reduce(n,r);return{encode:b,decode:d}}function Q(e){const r=typeof e=="string"?e.split(""):e,n=r.length;S("alphabet",r);const b=new Map(r.map((d,s)=>[d,s]));return{encode:d=>(v(d),d.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${e}`);return r[s]})),decode:d=>(v(d),d.map(s=>{I("alphabet.decode",s);const u=b.get(s);if(u===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${e}`);return u}))}}function W(e=""){return I("join",e),{encode:r=>(S("join.decode",r),r.join(e)),decode:r=>(I("join.decode",r),r.split(e))}}function fe(e,r="="){return B(e),I("padding",r),{encode(n){for(S("padding.encode",n);n.length*e%8;)n.push(r);return n},decode(n){S("padding.decode",n);let b=n.length;if(b*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;b>0&&n[b-1]===r;b--)if((b-1)*e%8===0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,b)}}}function _(e,r,n){if(r<2)throw new Error(`convertRadix: invalid from=${r}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(v(e),!e.length)return[];let b=0;const d=[],s=Array.from(e,i=>{if(B(i),i<0||i>=r)throw new Error(`invalid integer: ${i}`);return i}),u=s.length;for(;;){let i=0,a=!0;for(let w=b;w<u;w++){const p=s[w],x=r*i,A=x+p;if(!Number.isSafeInteger(A)||x/r!==i||A-p!==x)throw new Error("convertRadix: carry overflow");const m=A/n;i=A%n;const l=Math.floor(m);if(s[w]=l,!Number.isSafeInteger(l)||l*n+i!==A)throw new Error("convertRadix: carry overflow");if(a)l?a=!1:b=w;else continue}if(d.push(i),a)break}for(let i=0;i<e.length-1&&e[i]===0;i++)d.push(0);return d.reverse()}const X=(e,r)=>r===0?e:X(r,e%r),$=(e,r)=>e+(r-X(e,r)),R=(()=>{let e=[];for(let r=0;r<40;r++)e.push(2**r);return e})();function F(e,r,n,b){if(v(e),r<=0||r>32)throw new Error(`convertRadix2: wrong from=${r}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if($(r,n)>32)throw new Error(`convertRadix2: carry overflow from=${r} to=${n} carryBits=${$(r,n)}`);let d=0,s=0;const u=R[r],i=R[n]-1,a=[];for(const w of e){if(B(w),w>=u)throw new Error(`convertRadix2: invalid data word=${w} from=${r}`);if(d=d<<r|w,s+r>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${r}`);for(s+=r;s>=n;s-=n)a.push((d>>s-n&i)>>>0);const p=R[s];if(p===void 0)throw new Error("invalid carry");d&=p-1}if(d=d<<n-s&i,!b&&s>=r)throw new Error("Excess padding");if(!b&&d>0)throw new Error(`Non-zero padding: ${d}`);return b&&s>0&&a.push(d>>>0),a}function ae(e){B(e);const r=2**8;return{encode:n=>{if(!P(n))throw new Error("radix.encode input should be Uint8Array");return _(Array.from(n),r,e)},decode:n=>(K("radix.decode",n),Uint8Array.from(_(n,e,r)))}}function le(e,r=!1){if(B(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if($(8,e)>32||$(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!P(n))throw new Error("radix2.encode input should be Uint8Array");return F(Array.from(n),8,e,!r)},decode:n=>(K("radix2.decode",n),Uint8Array.from(F(n,e,8,r)))}}const be=J(le(5),Q("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),fe(5),W("")),se=e=>J(ae(58),Q(e),W("")),we=se("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function D(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Y(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?D(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function ge(e,r){r||(r=e.reduce((d,s)=>d+s.length,0));const n=Y(r);let b=0;for(const d of e)n.set(d,b),b+=d.length;return D(n)}function Z(e,r,n,b){return{name:e,prefix:r,encoder:{name:e,prefix:r,encode:n},decoder:{decode:b}}}const q=Z("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),T=Z("ascii","a",e=>{let r="a";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return r},e=>{e=e.substring(1);const r=Y(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}),ee={utf8:q,"utf-8":q,hex:G.base16,latin1:T,ascii:T,binary:T,...G};function pe(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?D(globalThis.Buffer.from(e,"utf-8")):n.decoder.decode(`${n.prefix}${e}`)}function ye(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}var H,N;function re(){if(N)return H;N=1;const e="Input must be an string, Buffer or Uint8Array";function r(u){let i;if(u instanceof Uint8Array)i=u;else if(typeof u=="string")i=new TextEncoder().encode(u);else throw new Error(e);return i}function n(u){return Array.prototype.map.call(u,function(i){return(i<16?"0":"")+i.toString(16)}).join("")}function b(u){return(4294967296+u).toString(16).substring(1)}function d(u,i,a){let w=`
1
+ import{d as G}from"./index-CtQ9l7ML.js";/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function P(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function V(e,r){return Array.isArray(r)?r.length===0?!0:e?r.every(n=>typeof n=="string"):r.every(n=>Number.isSafeInteger(n)):!1}function I(e,r){if(typeof r!="string")throw new Error(`${e}: string expected`);return!0}function B(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function v(e){if(!Array.isArray(e))throw new Error("array expected")}function S(e,r){if(!V(!0,r))throw new Error(`${e}: array of strings expected`)}function K(e,r){if(!V(!1,r))throw new Error(`${e}: array of numbers expected`)}function J(...e){const r=s=>s,n=(s,u)=>i=>s(u(i)),b=e.map(s=>s.encode).reduceRight(n,r),d=e.map(s=>s.decode).reduce(n,r);return{encode:b,decode:d}}function Q(e){const r=typeof e=="string"?e.split(""):e,n=r.length;S("alphabet",r);const b=new Map(r.map((d,s)=>[d,s]));return{encode:d=>(v(d),d.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${e}`);return r[s]})),decode:d=>(v(d),d.map(s=>{I("alphabet.decode",s);const u=b.get(s);if(u===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${e}`);return u}))}}function W(e=""){return I("join",e),{encode:r=>(S("join.decode",r),r.join(e)),decode:r=>(I("join.decode",r),r.split(e))}}function fe(e,r="="){return B(e),I("padding",r),{encode(n){for(S("padding.encode",n);n.length*e%8;)n.push(r);return n},decode(n){S("padding.decode",n);let b=n.length;if(b*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;b>0&&n[b-1]===r;b--)if((b-1)*e%8===0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,b)}}}function _(e,r,n){if(r<2)throw new Error(`convertRadix: invalid from=${r}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(v(e),!e.length)return[];let b=0;const d=[],s=Array.from(e,i=>{if(B(i),i<0||i>=r)throw new Error(`invalid integer: ${i}`);return i}),u=s.length;for(;;){let i=0,a=!0;for(let w=b;w<u;w++){const p=s[w],x=r*i,A=x+p;if(!Number.isSafeInteger(A)||x/r!==i||A-p!==x)throw new Error("convertRadix: carry overflow");const m=A/n;i=A%n;const l=Math.floor(m);if(s[w]=l,!Number.isSafeInteger(l)||l*n+i!==A)throw new Error("convertRadix: carry overflow");if(a)l?a=!1:b=w;else continue}if(d.push(i),a)break}for(let i=0;i<e.length-1&&e[i]===0;i++)d.push(0);return d.reverse()}const X=(e,r)=>r===0?e:X(r,e%r),$=(e,r)=>e+(r-X(e,r)),R=(()=>{let e=[];for(let r=0;r<40;r++)e.push(2**r);return e})();function F(e,r,n,b){if(v(e),r<=0||r>32)throw new Error(`convertRadix2: wrong from=${r}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if($(r,n)>32)throw new Error(`convertRadix2: carry overflow from=${r} to=${n} carryBits=${$(r,n)}`);let d=0,s=0;const u=R[r],i=R[n]-1,a=[];for(const w of e){if(B(w),w>=u)throw new Error(`convertRadix2: invalid data word=${w} from=${r}`);if(d=d<<r|w,s+r>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${r}`);for(s+=r;s>=n;s-=n)a.push((d>>s-n&i)>>>0);const p=R[s];if(p===void 0)throw new Error("invalid carry");d&=p-1}if(d=d<<n-s&i,!b&&s>=r)throw new Error("Excess padding");if(!b&&d>0)throw new Error(`Non-zero padding: ${d}`);return b&&s>0&&a.push(d>>>0),a}function ae(e){B(e);const r=2**8;return{encode:n=>{if(!P(n))throw new Error("radix.encode input should be Uint8Array");return _(Array.from(n),r,e)},decode:n=>(K("radix.decode",n),Uint8Array.from(_(n,e,r)))}}function le(e,r=!1){if(B(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if($(8,e)>32||$(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!P(n))throw new Error("radix2.encode input should be Uint8Array");return F(Array.from(n),8,e,!r)},decode:n=>(K("radix2.decode",n),Uint8Array.from(F(n,e,8,r)))}}const be=J(le(5),Q("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),fe(5),W("")),se=e=>J(ae(58),Q(e),W("")),we=se("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function D(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Y(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?D(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function ge(e,r){r||(r=e.reduce((d,s)=>d+s.length,0));const n=Y(r);let b=0;for(const d of e)n.set(d,b),b+=d.length;return D(n)}function Z(e,r,n,b){return{name:e,prefix:r,encoder:{name:e,prefix:r,encode:n},decoder:{decode:b}}}const q=Z("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),T=Z("ascii","a",e=>{let r="a";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return r},e=>{e=e.substring(1);const r=Y(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}),ee={utf8:q,"utf-8":q,hex:G.base16,latin1:T,ascii:T,binary:T,...G};function pe(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?D(globalThis.Buffer.from(e,"utf-8")):n.decoder.decode(`${n.prefix}${e}`)}function ye(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}var H,N;function re(){if(N)return H;N=1;const e="Input must be an string, Buffer or Uint8Array";function r(u){let i;if(u instanceof Uint8Array)i=u;else if(typeof u=="string")i=new TextEncoder().encode(u);else throw new Error(e);return i}function n(u){return Array.prototype.map.call(u,function(i){return(i<16?"0":"")+i.toString(16)}).join("")}function b(u){return(4294967296+u).toString(16).substring(1)}function d(u,i,a){let w=`
2
2
  `+u+" = ";for(let p=0;p<i.length;p+=2){if(a===32)w+=b(i[p]).toUpperCase(),w+=" ",w+=b(i[p+1]).toUpperCase();else if(a===64)w+=b(i[p+1]).toUpperCase(),w+=b(i[p]).toUpperCase();else throw new Error("Invalid size "+a);p%6===4?w+=`
3
3
  `+new Array(u.length+4).join(" "):p<i.length-2&&(w+=" ")}console.log(w)}function s(u,i,a){let w=new Date().getTime();const p=new Uint8Array(i);for(let A=0;A<i;A++)p[A]=A%256;const x=new Date().getTime();console.log("Generated random input in "+(x-w)+"ms"),w=x;for(let A=0;A<a;A++){const m=u(p),l=new Date().getTime(),h=l-w;w=l,console.log("Hashed in "+h+"ms: "+m.substring(0,20)+"..."),console.log(Math.round(i/(1<<20)/(h/1e3)*100)/100+" MB PER SECOND")}}return H={normalizeInput:r,toHex:n,debugPrint:d,testSpeed:s},H}var C,O;function ue(){if(O)return C;O=1;const e=re();function r(t,c,o){const g=t[c]+t[o];let y=t[c+1]+t[o+1];g>=4294967296&&y++,t[c]=g,t[c+1]=y}function n(t,c,o,g){let y=t[c]+o;o<0&&(y+=4294967296);let U=t[c+1]+g;y>=4294967296&&U++,t[c]=y,t[c+1]=U}function b(t,c){return t[c]^t[c+1]<<8^t[c+2]<<16^t[c+3]<<24}function d(t,c,o,g,y,U){const ne=w[y],te=w[y+1],oe=w[U],ie=w[U+1];r(a,t,c),n(a,t,ne,te);let k=a[g]^a[t],E=a[g+1]^a[t+1];a[g]=E,a[g+1]=k,r(a,o,g),k=a[c]^a[o],E=a[c+1]^a[o+1],a[c]=k>>>24^E<<8,a[c+1]=E>>>24^k<<8,r(a,t,c),n(a,t,oe,ie),k=a[g]^a[t],E=a[g+1]^a[t+1],a[g]=k>>>16^E<<16,a[g+1]=E>>>16^k<<16,r(a,o,g),k=a[c]^a[o],E=a[c+1]^a[o+1],a[c]=E>>>31^k<<1,a[c+1]=k>>>31^E<<1}const s=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],i=new Uint8Array(u.map(function(t){return t*2})),a=new Uint32Array(32),w=new Uint32Array(32);function p(t,c){let o=0;for(o=0;o<16;o++)a[o]=t.h[o],a[o+16]=s[o];for(a[24]=a[24]^t.t,a[25]=a[25]^t.t/4294967296,c&&(a[28]=~a[28],a[29]=~a[29]),o=0;o<32;o++)w[o]=b(t.b,4*o);for(o=0;o<12;o++)d(0,8,16,24,i[o*16+0],i[o*16+1]),d(2,10,18,26,i[o*16+2],i[o*16+3]),d(4,12,20,28,i[o*16+4],i[o*16+5]),d(6,14,22,30,i[o*16+6],i[o*16+7]),d(0,10,20,30,i[o*16+8],i[o*16+9]),d(2,12,22,24,i[o*16+10],i[o*16+11]),d(4,14,16,26,i[o*16+12],i[o*16+13]),d(6,8,18,28,i[o*16+14],i[o*16+15]);for(o=0;o<16;o++)t.h[o]=t.h[o]^a[o]^a[o+16]}const x=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function A(t,c,o,g){if(t===0||t>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(c&&c.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(o&&o.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(g&&g.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const y={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:t};x.fill(0),x[0]=t,c&&(x[1]=c.length),x[2]=1,x[3]=1,o&&x.set(o,32),g&&x.set(g,48);for(let U=0;U<16;U++)y.h[U]=s[U]^b(x,U*4);return c&&(m(y,c),y.c=128),y}function m(t,c){for(let o=0;o<c.length;o++)t.c===128&&(t.t+=t.c,p(t,!1),t.c=0),t.b[t.c++]=c[o]}function l(t){for(t.t+=t.c;t.c<128;)t.b[t.c++]=0;p(t,!0);const c=new Uint8Array(t.outlen);for(let o=0;o<t.outlen;o++)c[o]=t.h[o>>2]>>8*(o&3);return c}function h(t,c,o,g,y){o=o||64,t=e.normalizeInput(t),g&&(g=e.normalizeInput(g)),y&&(y=e.normalizeInput(y));const U=A(o,c,g,y);return m(U,t),l(U)}function f(t,c,o,g,y){const U=h(t,c,o,g,y);return e.toHex(U)}return C={blake2b:h,blake2bHex:f,blake2bInit:A,blake2bUpdate:m,blake2bFinal:l},C}var M,z;function ce(){if(z)return M;z=1;const e=re();function r(l,h){return l[h]^l[h+1]<<8^l[h+2]<<16^l[h+3]<<24}function n(l,h,f,t,c,o){u[l]=u[l]+u[h]+c,u[t]=b(u[t]^u[l],16),u[f]=u[f]+u[t],u[h]=b(u[h]^u[f],12),u[l]=u[l]+u[h]+o,u[t]=b(u[t]^u[l],8),u[f]=u[f]+u[t],u[h]=b(u[h]^u[f],7)}function b(l,h){return l>>>h^l<<32-h}const d=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),u=new Uint32Array(16),i=new Uint32Array(16);function a(l,h){let f=0;for(f=0;f<8;f++)u[f]=l.h[f],u[f+8]=d[f];for(u[12]^=l.t,u[13]^=l.t/4294967296,h&&(u[14]=~u[14]),f=0;f<16;f++)i[f]=r(l.b,4*f);for(f=0;f<10;f++)n(0,4,8,12,i[s[f*16+0]],i[s[f*16+1]]),n(1,5,9,13,i[s[f*16+2]],i[s[f*16+3]]),n(2,6,10,14,i[s[f*16+4]],i[s[f*16+5]]),n(3,7,11,15,i[s[f*16+6]],i[s[f*16+7]]),n(0,5,10,15,i[s[f*16+8]],i[s[f*16+9]]),n(1,6,11,12,i[s[f*16+10]],i[s[f*16+11]]),n(2,7,8,13,i[s[f*16+12]],i[s[f*16+13]]),n(3,4,9,14,i[s[f*16+14]],i[s[f*16+15]]);for(f=0;f<8;f++)l.h[f]^=u[f]^u[f+8]}function w(l,h){if(!(l>0&&l<=32))throw new Error("Incorrect output length, should be in [1, 32]");const f=h?h.length:0;if(h&&!(f>0&&f<=32))throw new Error("Incorrect key length, should be in [1, 32]");const t={h:new Uint32Array(d),b:new Uint8Array(64),c:0,t:0,outlen:l};return t.h[0]^=16842752^f<<8^l,f>0&&(p(t,h),t.c=64),t}function p(l,h){for(let f=0;f<h.length;f++)l.c===64&&(l.t+=l.c,a(l,!1),l.c=0),l.b[l.c++]=h[f]}function x(l){for(l.t+=l.c;l.c<64;)l.b[l.c++]=0;a(l,!0);const h=new Uint8Array(l.outlen);for(let f=0;f<l.outlen;f++)h[f]=l.h[f>>2]>>8*(f&3)&255;return h}function A(l,h,f){f=f||32,l=e.normalizeInput(l);const t=w(f,h);return p(t,l),x(t)}function m(l,h,f){const t=A(l,h,f);return e.toHex(t)}return M={blake2s:A,blake2sHex:m,blake2sInit:w,blake2sUpdate:p,blake2sFinal:x},M}var j,L;function de(){if(L)return j;L=1;const e=ue(),r=ce();return j={blake2b:e.blake2b,blake2bHex:e.blake2bHex,blake2bInit:e.blake2bInit,blake2bUpdate:e.blake2bUpdate,blake2bFinal:e.blake2bFinal,blake2s:r.blake2s,blake2sHex:r.blake2sHex,blake2sInit:r.blake2sInit,blake2sUpdate:r.blake2sUpdate,blake2sFinal:r.blake2sFinal},j}var Ae=de();export{be as a,we as b,ge as c,Ae as d,pe as f,ye as t};
@@ -1,4 +1,4 @@
1
- import{i as p,b as m}from"./lit-element-B3y9oplH.js";import{n as i}from"./class-map-CxwNmq0D.js";import{c as f}from"./index-BvG65AZz.js";import"./index-C4KlFepO.js";import{d as h,r as b,e as w}from"./index-siSK96BI.js";import{N as d}from"./W3MFrameProviderSingleton-CW1PUUTw.js";const g=h`
1
+ import{i as p,b as m}from"./lit-element-B3y9oplH.js";import{n as i}from"./class-map-CxwNmq0D.js";import{c as f}from"./index-CvqOZGzt.js";import"./index-BPlrOFTC.js";import{d as h,r as b,e as w}from"./index-D24PzU1R.js";import{N as d}from"./W3MFrameProviderSingleton-CpAC0lb5.js";const g=h`
2
2
  :host {
3
3
  width: 100%;
4
4
  }
@@ -1 +1 @@
1
- import{r as k}from"./index-BV8s6ez1.js";import{az as w}from"./sendRawTransaction-CVp_7MRP.js";import{c as I,e as q}from"./hashTypedData-DYmarbOl.js";import"./NetworkUtil-DXqql1Wz.js";import"./sentry-Dx-KuLV3.js";import"./react-BYHuwl8r.js";import"./index-BzGWS8ln.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-CFqPm_mN.js";import"./intl-CBcMB1D2.js";const v=()=>"9.1.0",C=t=>t.toString(16).padStart(2,"0"),R=t=>{const e=new Uint8Array(t/2);return window.crypto.getRandomValues(e),Array.from(e,C).join("")},E=()=>typeof window<"u"?R(10):new Date().getTime().toString(36);class g{}g.makeRequest=(t,e)=>({id:E(),method:t,params:e,env:{sdkVersion:v()}});g.makeResponse=(t,e,s)=>({id:t,success:!0,version:s,data:e});g.makeErrorResponse=(t,e,s)=>({id:t,success:!1,error:e,version:s});var r;(function(t){t.sendTransactions="sendTransactions",t.rpcCall="rpcCall",t.getChainInfo="getChainInfo",t.getSafeInfo="getSafeInfo",t.getTxBySafeTxHash="getTxBySafeTxHash",t.getSafeBalances="getSafeBalances",t.signMessage="signMessage",t.signTypedMessage="signTypedMessage",t.getEnvironmentInfo="getEnvironmentInfo",t.getOffChainSignature="getOffChainSignature",t.requestAddressBook="requestAddressBook",t.wallet_getPermissions="wallet_getPermissions",t.wallet_requestPermissions="wallet_requestPermissions"})(r||(r={}));var f;(function(t){t.requestAddressBook="requestAddressBook"})(f||(f={}));class H{constructor(e=null,s=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:a,data:n,source:i})=>{const o=!n,l=!this.isServer&&i===window.parent,u=typeof n.version<"u"&&parseInt(n.version.split(".")[0]),B=typeof u=="number"&&u>=1;let y=!0;return Array.isArray(this.allowedOrigins)&&(y=this.allowedOrigins.find(P=>P.test(a))!==void 0),!o&&l&&B&&y},this.logIncomingMessage=a=>{console.info(`Safe Apps SDK v1: A message was received from origin ${a.origin}. `,a.data)},this.onParentMessage=a=>{this.isValidMessage(a)&&(this.debugMode&&this.logIncomingMessage(a),this.handleIncomingMessage(a.data))},this.handleIncomingMessage=a=>{const{id:n}=a,i=this.callbacks.get(n);i&&(i(a),this.callbacks.delete(n))},this.send=(a,n)=>{const i=g.makeRequest(a,n);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(i,"*"),new Promise((o,l)=>{this.callbacks.set(i.id,u=>{if(!u.success){l(new Error(u.error));return}o(u)})})},this.allowedOrigins=e,this.debugMode=s,this.isServer||window.addEventListener("message",this.onParentMessage)}}const S=t=>typeof t=="object"&&t!=null&&"domain"in t&&"types"in t&&"message"in t;var m=k();class A{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw new Error("Invalid safeTxHash");return(await this.communicator.send(r.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){const s={message:e};return(await this.communicator.send(r.signMessage,s)).data}async signTypedMessage(e){if(!S(e))throw new Error("Invalid typed data");return(await this.communicator.send(r.signTypedMessage,{typedData:e})).data}async send({txs:e,params:s}){if(!e||!e.length)throw new Error("No transactions were passed");const a={txs:e,params:s};return(await this.communicator.send(r.sendTransactions,a)).data}}const c={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"},h={defaultBlockParam:(t="latest")=>t,returnFullTxObjectParam:(t=!1)=>t,blockNumberToHex:t=>Number.isInteger(t)?`0x${t.toString(16)}`:t};class O{constructor(e){this.communicator=e,this.call=this.buildRequest({call:c.eth_call,formatters:[null,h.defaultBlockParam]}),this.getBalance=this.buildRequest({call:c.eth_getBalance,formatters:[null,h.defaultBlockParam]}),this.getCode=this.buildRequest({call:c.eth_getCode,formatters:[null,h.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:c.eth_getStorageAt,formatters:[null,h.blockNumberToHex,h.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:c.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:c.eth_getBlockByHash,formatters:[null,h.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:c.eth_getBlockByNumber,formatters:[h.blockNumberToHex,h.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:c.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:c.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:c.eth_getTransactionCount,formatters:[null,h.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:c.eth_gasPrice}),this.getEstimateGas=s=>this.buildRequest({call:c.eth_estimateGas})([s]),this.setSafeSettings=this.buildRequest({call:c.safe_setSettings})}buildRequest(e){const{call:s,formatters:a}=e;return async n=>{a&&Array.isArray(n)&&a.forEach((l,u)=>{l&&(n[u]=l(n[u]))});const i={call:s,params:n||[]};return(await this.communicator.send(r.rpcCall,i)).data}}}const x="0x1626ba7e",V="0x20c13b0b",p=4001;class d extends Error{constructor(e,s,a){super(e),this.code=s,this.data=a,Object.setPrototypeOf(this,d.prototype)}}class _{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(r.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new d("Permissions request is invalid",p);try{return(await this.communicator.send(r.wallet_requestPermissions,e)).data}catch{throw new d("Permissions rejected",p)}}isPermissionRequestValid(e){return e.every(s=>typeof s=="object"?Object.keys(s).every(a=>!!Object.values(f).includes(a)):!1)}}const b=(t,e)=>e.some(s=>s.parentCapability===t),M=()=>(t,e,s)=>{const a=s.value;return s.value=async function(){const n=new _(this.communicator);let i=await n.getPermissions();if(b(e,i)||(i=await n.requestPermissions([{[e]:{}}])),!b(e,i))throw new d("Permissions rejected",p);return a.apply(this)},s};var j=function(t,e,s,a){var n=arguments.length,i=n<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,s):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,s,a);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(i=(n<3?o(i):n>3?o(e,s,i):o(e,s))||i);return n>3&&i&&Object.defineProperty(e,s,i),i};class T{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(r.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(r.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e="usd"}={}){return(await this.communicator.send(r.getSafeBalances,{currency:e})).data}async check1271Signature(e,s="0x"){const a=await this.getInfo(),n=w({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===x}catch{return!1}}async check1271SignatureBytes(e,s="0x"){const a=await this.getInfo(),n=w({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===V}catch{return!1}}calculateMessageHash(e){return I(e)}calculateTypedMessageHash(e){const s=typeof e.domain.chainId=="object"?e.domain.chainId.toNumber():Number(e.domain.chainId);let a=e.primaryType;if(!a){const n=Object.values(e.types),i=Object.keys(e.types).filter(o=>n.every(l=>l.every(({type:u})=>u.replace("[","").replace("]","")!==o)));if(i.length===0||i.length>1)throw new Error("Please specify primaryType");a=i[0]}return q({message:e.message,domain:{...e.domain,chainId:s,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt},types:e.types,primaryType:a})}async getOffChainSignature(e){return(await this.communicator.send(r.getOffChainSignature,e)).data}async isMessageSigned(e,s="0x"){let a;if(typeof e=="string"&&(a=async()=>{const n=this.calculateMessageHash(e);return await this.isMessageHashSigned(n,s)}),S(e)&&(a=async()=>{const n=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(n,s)}),a)return await a();throw new Error("Invalid message type")}async isMessageHashSigned(e,s="0x"){const a=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const n of a)if(await n(e,s))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(r.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(r.requestAddressBook,void 0)).data}}j([M()],T.prototype,"requestAddressBook",null);class J{constructor(e={}){const{allowedDomains:s=null,debug:a=!1}=e;this.communicator=new H(s,a),this.eth=new O(this.communicator),this.txs=new A(this.communicator),this.safe=new T(this.communicator),this.wallet=new _(this.communicator)}}const Q=m.Operation,X=m.TokenType,Y=m.TransactionStatus,Z=m.TransferDirection;export{g as MessageFormatter,r as Methods,Q as Operation,c as RPC_CALLS,f as RestrictedMethods,X as TokenType,Y as TransactionStatus,Z as TransferDirection,J as default,v as getSDKVersion,S as isObjectEIP712TypedData};
1
+ import{r as k}from"./index-BV8s6ez1.js";import{az as w}from"./sendRawTransaction-DevIof93.js";import{c as I,e as q}from"./hashTypedData-CPoOrHdV.js";import"./NetworkUtil-DXqql1Wz.js";import"./sentry-Dx-KuLV3.js";import"./react-BYHuwl8r.js";import"./index-uGopMLx_.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-CFqPm_mN.js";import"./intl-CBcMB1D2.js";const v=()=>"9.1.0",C=t=>t.toString(16).padStart(2,"0"),R=t=>{const e=new Uint8Array(t/2);return window.crypto.getRandomValues(e),Array.from(e,C).join("")},E=()=>typeof window<"u"?R(10):new Date().getTime().toString(36);class g{}g.makeRequest=(t,e)=>({id:E(),method:t,params:e,env:{sdkVersion:v()}});g.makeResponse=(t,e,s)=>({id:t,success:!0,version:s,data:e});g.makeErrorResponse=(t,e,s)=>({id:t,success:!1,error:e,version:s});var r;(function(t){t.sendTransactions="sendTransactions",t.rpcCall="rpcCall",t.getChainInfo="getChainInfo",t.getSafeInfo="getSafeInfo",t.getTxBySafeTxHash="getTxBySafeTxHash",t.getSafeBalances="getSafeBalances",t.signMessage="signMessage",t.signTypedMessage="signTypedMessage",t.getEnvironmentInfo="getEnvironmentInfo",t.getOffChainSignature="getOffChainSignature",t.requestAddressBook="requestAddressBook",t.wallet_getPermissions="wallet_getPermissions",t.wallet_requestPermissions="wallet_requestPermissions"})(r||(r={}));var f;(function(t){t.requestAddressBook="requestAddressBook"})(f||(f={}));class H{constructor(e=null,s=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:a,data:n,source:i})=>{const o=!n,l=!this.isServer&&i===window.parent,u=typeof n.version<"u"&&parseInt(n.version.split(".")[0]),B=typeof u=="number"&&u>=1;let y=!0;return Array.isArray(this.allowedOrigins)&&(y=this.allowedOrigins.find(P=>P.test(a))!==void 0),!o&&l&&B&&y},this.logIncomingMessage=a=>{console.info(`Safe Apps SDK v1: A message was received from origin ${a.origin}. `,a.data)},this.onParentMessage=a=>{this.isValidMessage(a)&&(this.debugMode&&this.logIncomingMessage(a),this.handleIncomingMessage(a.data))},this.handleIncomingMessage=a=>{const{id:n}=a,i=this.callbacks.get(n);i&&(i(a),this.callbacks.delete(n))},this.send=(a,n)=>{const i=g.makeRequest(a,n);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(i,"*"),new Promise((o,l)=>{this.callbacks.set(i.id,u=>{if(!u.success){l(new Error(u.error));return}o(u)})})},this.allowedOrigins=e,this.debugMode=s,this.isServer||window.addEventListener("message",this.onParentMessage)}}const S=t=>typeof t=="object"&&t!=null&&"domain"in t&&"types"in t&&"message"in t;var m=k();class A{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw new Error("Invalid safeTxHash");return(await this.communicator.send(r.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){const s={message:e};return(await this.communicator.send(r.signMessage,s)).data}async signTypedMessage(e){if(!S(e))throw new Error("Invalid typed data");return(await this.communicator.send(r.signTypedMessage,{typedData:e})).data}async send({txs:e,params:s}){if(!e||!e.length)throw new Error("No transactions were passed");const a={txs:e,params:s};return(await this.communicator.send(r.sendTransactions,a)).data}}const c={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"},h={defaultBlockParam:(t="latest")=>t,returnFullTxObjectParam:(t=!1)=>t,blockNumberToHex:t=>Number.isInteger(t)?`0x${t.toString(16)}`:t};class O{constructor(e){this.communicator=e,this.call=this.buildRequest({call:c.eth_call,formatters:[null,h.defaultBlockParam]}),this.getBalance=this.buildRequest({call:c.eth_getBalance,formatters:[null,h.defaultBlockParam]}),this.getCode=this.buildRequest({call:c.eth_getCode,formatters:[null,h.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:c.eth_getStorageAt,formatters:[null,h.blockNumberToHex,h.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:c.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:c.eth_getBlockByHash,formatters:[null,h.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:c.eth_getBlockByNumber,formatters:[h.blockNumberToHex,h.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:c.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:c.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:c.eth_getTransactionCount,formatters:[null,h.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:c.eth_gasPrice}),this.getEstimateGas=s=>this.buildRequest({call:c.eth_estimateGas})([s]),this.setSafeSettings=this.buildRequest({call:c.safe_setSettings})}buildRequest(e){const{call:s,formatters:a}=e;return async n=>{a&&Array.isArray(n)&&a.forEach((l,u)=>{l&&(n[u]=l(n[u]))});const i={call:s,params:n||[]};return(await this.communicator.send(r.rpcCall,i)).data}}}const x="0x1626ba7e",V="0x20c13b0b",p=4001;class d extends Error{constructor(e,s,a){super(e),this.code=s,this.data=a,Object.setPrototypeOf(this,d.prototype)}}class _{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(r.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new d("Permissions request is invalid",p);try{return(await this.communicator.send(r.wallet_requestPermissions,e)).data}catch{throw new d("Permissions rejected",p)}}isPermissionRequestValid(e){return e.every(s=>typeof s=="object"?Object.keys(s).every(a=>!!Object.values(f).includes(a)):!1)}}const b=(t,e)=>e.some(s=>s.parentCapability===t),M=()=>(t,e,s)=>{const a=s.value;return s.value=async function(){const n=new _(this.communicator);let i=await n.getPermissions();if(b(e,i)||(i=await n.requestPermissions([{[e]:{}}])),!b(e,i))throw new d("Permissions rejected",p);return a.apply(this)},s};var j=function(t,e,s,a){var n=arguments.length,i=n<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,s):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,s,a);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(i=(n<3?o(i):n>3?o(e,s,i):o(e,s))||i);return n>3&&i&&Object.defineProperty(e,s,i),i};class T{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(r.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(r.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e="usd"}={}){return(await this.communicator.send(r.getSafeBalances,{currency:e})).data}async check1271Signature(e,s="0x"){const a=await this.getInfo(),n=w({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===x}catch{return!1}}async check1271SignatureBytes(e,s="0x"){const a=await this.getInfo(),n=w({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===V}catch{return!1}}calculateMessageHash(e){return I(e)}calculateTypedMessageHash(e){const s=typeof e.domain.chainId=="object"?e.domain.chainId.toNumber():Number(e.domain.chainId);let a=e.primaryType;if(!a){const n=Object.values(e.types),i=Object.keys(e.types).filter(o=>n.every(l=>l.every(({type:u})=>u.replace("[","").replace("]","")!==o)));if(i.length===0||i.length>1)throw new Error("Please specify primaryType");a=i[0]}return q({message:e.message,domain:{...e.domain,chainId:s,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt},types:e.types,primaryType:a})}async getOffChainSignature(e){return(await this.communicator.send(r.getOffChainSignature,e)).data}async isMessageSigned(e,s="0x"){let a;if(typeof e=="string"&&(a=async()=>{const n=this.calculateMessageHash(e);return await this.isMessageHashSigned(n,s)}),S(e)&&(a=async()=>{const n=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(n,s)}),a)return await a();throw new Error("Invalid message type")}async isMessageHashSigned(e,s="0x"){const a=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const n of a)if(await n(e,s))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(r.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(r.requestAddressBook,void 0)).data}}j([M()],T.prototype,"requestAddressBook",null);class J{constructor(e={}){const{allowedDomains:s=null,debug:a=!1}=e;this.communicator=new H(s,a),this.eth=new O(this.communicator),this.txs=new A(this.communicator),this.safe=new T(this.communicator),this.wallet=new _(this.communicator)}}const Q=m.Operation,X=m.TokenType,Y=m.TransactionStatus,Z=m.TransferDirection;export{g as MessageFormatter,r as Methods,Q as Operation,c as RPC_CALLS,f as RestrictedMethods,X as TokenType,Y as TransactionStatus,Z as TransferDirection,J as default,v as getSDKVersion,S as isObjectEIP712TypedData};
@@ -1,4 +1,4 @@
1
- import{w as k,i as W,b as v}from"./lit-element-B3y9oplH.js";import{n as y}from"./class-map-CxwNmq0D.js";import{c as I}from"./index-BvG65AZz.js";import"./index-C4KlFepO.js";import{Q as M}from"./browser-DxF-qILS.js";import{d as O,r as N}from"./index-siSK96BI.js";const Q=.1,_=2.5,$=7;function x(t,a,d){return t===a?!1:(t-a<0?a-t:t-a)<=d+Q}function A(t,a){const d=Array.prototype.slice.call(M.create(t,{errorCorrectionLevel:a}).modules.data,0),l=Math.sqrt(d.length);return d.reduce((h,f,p)=>(p%l===0?h.push([f]):h[h.length-1].push(f))&&h,[])}const q={generate({uri:t,size:a,logoSize:d,padding:l=8,dotColor:h="var(--apkt-colors-black)"}){const p=[],u=A(t,"Q"),n=(a-2*l)/u.length,E=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];E.forEach(({x:i,y:e})=>{const s=(u.length-$)*n*i+l,r=(u.length-$)*n*e+l,c=.45;for(let o=0;o<E.length;o+=1){const m=n*($-o*2);p.push(k`
1
+ import{w as k,i as W,b as v}from"./lit-element-B3y9oplH.js";import{n as y}from"./class-map-CxwNmq0D.js";import{c as I}from"./index-CvqOZGzt.js";import"./index-BPlrOFTC.js";import{Q as M}from"./browser-DxF-qILS.js";import{d as O,r as N}from"./index-D24PzU1R.js";const Q=.1,_=2.5,$=7;function x(t,a,d){return t===a?!1:(t-a<0?a-t:t-a)<=d+Q}function A(t,a){const d=Array.prototype.slice.call(M.create(t,{errorCorrectionLevel:a}).modules.data,0),l=Math.sqrt(d.length);return d.reduce((h,f,p)=>(p%l===0?h.push([f]):h[h.length-1].push(f))&&h,[])}const q={generate({uri:t,size:a,logoSize:d,padding:l=8,dotColor:h="var(--apkt-colors-black)"}){const p=[],u=A(t,"Q"),n=(a-2*l)/u.length,E=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];E.forEach(({x:i,y:e})=>{const s=(u.length-$)*n*i+l,r=(u.length-$)*n*e+l,c=.45;for(let o=0;o<E.length;o+=1){const m=n*($-o*2);p.push(k`
2
2
  <rect
3
3
  fill=${o===2?"var(--apkt-colors-black)":"var(--apkt-colors-white)"}
4
4
  width=${o===0?m-10:m}
@@ -1,4 +1,4 @@
1
- import{i as b,b as c}from"./lit-element-B3y9oplH.js";import{n}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-BvG65AZz.js";import"./index-Bm5-3PXX.js";import{d as g,r as m,e as h}from"./index-siSK96BI.js";const v=g`
1
+ import{i as b,b as c}from"./lit-element-B3y9oplH.js";import{n}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-CvqOZGzt.js";import"./index-BsW8Eyey.js";import{d as g,r as m,e as h}from"./index-D24PzU1R.js";const v=g`
2
2
  :host {
3
3
  width: var(--local-width);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{C as l,E as g,R as h,o as m,S as w,b as c,r as E,t as _}from"./W3MFrameProviderSingleton-CW1PUUTw.js";import{au as R}from"./NetworkUtil-DXqql1Wz.js";import{i as b,b as y}from"./lit-element-B3y9oplH.js";import{n as d,o as O}from"./class-map-CxwNmq0D.js";import{c as v}from"./index-BvG65AZz.js";import{d as C,r as S,e as $}from"./index-siSK96BI.js";function I(){try{return c.returnOpenHref(`${R.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes")}catch{throw new Error("Could not open social popup")}}async function L(){h.push("ConnectingFarcaster");const e=m.getAuthConnector();if(e){const o=l.getAccountData();if(!(o!=null&&o.farcasterUrl))try{const{url:t}=await e.provider.getFarcasterUri();l.setAccountProp("farcasterUrl",t,l.state.activeChain)}catch(t){h.goBack(),w.showError(t)}}}async function T(e){h.push("ConnectingSocial");const o=m.getAuthConnector();let t=null;try{const i=setTimeout(()=>{throw new Error("Social login timed out. Please try again.")},45e3);if(o&&e){if(c.isTelegram()||(t=I()),t)l.setAccountProp("socialWindow",E(t),l.state.activeChain);else if(!c.isTelegram())throw new Error("Could not create social popup");const{uri:n}=await o.provider.getSocialRedirectUri({provider:e});if(!n)throw t==null||t.close(),new Error("Could not fetch the social redirect uri");if(t&&(t.location.href=n),c.isTelegram()){_.setTelegramSocialProvider(e);const r=c.formatTelegramSocialLoginUrl(n);c.openHref(r,"_top")}clearTimeout(i)}}catch(i){t==null||t.close();const n=c.parseError(i);w.showError(n),g.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:e,message:n}})}}async function G(e){l.setAccountProp("socialProvider",e,l.state.activeChain),g.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}}),e==="farcaster"?await L():await T(e)}const U=C`
1
+ import{C as l,E as g,R as h,o as m,S as w,b as c,r as E,t as _}from"./W3MFrameProviderSingleton-CpAC0lb5.js";import{au as R}from"./NetworkUtil-DXqql1Wz.js";import{i as b,b as y}from"./lit-element-B3y9oplH.js";import{n as d,o as O}from"./class-map-CxwNmq0D.js";import{c as v}from"./index-CvqOZGzt.js";import{d as C,r as S,e as $}from"./index-D24PzU1R.js";function I(){try{return c.returnOpenHref(`${R.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes")}catch{throw new Error("Could not open social popup")}}async function L(){h.push("ConnectingFarcaster");const e=m.getAuthConnector();if(e){const o=l.getAccountData();if(!(o!=null&&o.farcasterUrl))try{const{url:t}=await e.provider.getFarcasterUri();l.setAccountProp("farcasterUrl",t,l.state.activeChain)}catch(t){h.goBack(),w.showError(t)}}}async function T(e){h.push("ConnectingSocial");const o=m.getAuthConnector();let t=null;try{const i=setTimeout(()=>{throw new Error("Social login timed out. Please try again.")},45e3);if(o&&e){if(c.isTelegram()||(t=I()),t)l.setAccountProp("socialWindow",E(t),l.state.activeChain);else if(!c.isTelegram())throw new Error("Could not create social popup");const{uri:n}=await o.provider.getSocialRedirectUri({provider:e});if(!n)throw t==null||t.close(),new Error("Could not fetch the social redirect uri");if(t&&(t.location.href=n),c.isTelegram()){_.setTelegramSocialProvider(e);const r=c.formatTelegramSocialLoginUrl(n);c.openHref(r,"_top")}clearTimeout(i)}}catch(i){t==null||t.close();const n=c.parseError(i);w.showError(n),g.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:e,message:n}})}}async function G(e){l.setAccountProp("socialProvider",e,l.state.activeChain),g.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}}),e==="farcaster"?await L():await T(e)}const U=C`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{i as g,b as e}from"./lit-element-B3y9oplH.js";import{r as f,n as w,o as v}from"./class-map-CxwNmq0D.js";import{d as y,r as k,e as P}from"./index-siSK96BI.js";import{c as b}from"./index-BvG65AZz.js";import"./index-WAgD6WPQ.js";import{H as x}from"./HelpersUtil-BZkorgZo.js";import{R as u,E as A}from"./W3MFrameProviderSingleton-CW1PUUTw.js";import"./index-YLh9o5JS.js";import"./index-wv69CvU6.js";const I=y`
1
+ import{i as g,b as e}from"./lit-element-B3y9oplH.js";import{r as f,n as w,o as v}from"./class-map-CxwNmq0D.js";import{d as y,r as k,e as P}from"./index-D24PzU1R.js";import{c as b}from"./index-CvqOZGzt.js";import"./index-BZGM9FWk.js";import{H as x}from"./HelpersUtil-Ic5GpN9l.js";import{R as u,E as A}from"./W3MFrameProviderSingleton-CpAC0lb5.js";import"./index-DtzuonLF.js";import"./index-drIus9if.js";const I=y`
2
2
  :host {
3
3
  display: block;
4
4
  }
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/native-CPZ4GKee.js","_assets/sentry-Dx-KuLV3.js","_assets/react-BYHuwl8r.js"])))=>i.map(i=>d[i]);
2
- import{p as gt,b as Yt,i as Qt,I as Zt,m as bt,s as ut,A as D,e as Xt,g as U,d as te,f as N,r as ee,h as ae,j as ne,k as re,w as se,n as oe,o as ie,q as ce,t as ue,v as de,u as me,x as Z,y as le,z as fe,B as he,C as $,D as pe,E as ye,F as ge,G as be,H as we,J as xe,K as Ee,L as Ie,M as Te,N as St,O as At,P as Ce,Q as Pt,R as _t,S as Rt,T as ve,U as dt,V as qt,W as Se,X as Ae,Y as Ft,Z as Pe,_ as Ut,$ as K,a0 as _e,a1 as Bt,a2 as Re,a3 as qe,a4 as mt,a5 as Fe,a6 as Ue,a7 as Be,a8 as ke,a9 as Ne,aa as kt,ab as Le}from"./parseSignature-BlcmAmYI.js";import{ac as Pr,ad as _r,ae as Rr,af as qr,ag as Fr,ah as Ur,ai as Br,aj as kr,ak as Nr,al as Lr,am as Mr,an as Dr,ao as zr,ap as Gr,aq as $r,ar as Hr,as as Or,at as jr,au as Wr,av as Vr,aw as Kr,ax as Jr,ay as Yr,az as Qr,aA as Zr,aB as Xr,aC as ts,aD as es,aE as as,aF as ns,aG as rs,aH as ss,aI as os,aJ as is,aK as cs,aL as us,aM as ds,aN as ms,aO as ls,aP as fs,aQ as hs,aR as ps,aS as ys,aT as gs,aU as bs,aV as ws,aW as xs,aX as Es,aY as Is,aZ as Ts,a_ as Cs,a$ as vs,b0 as Ss,b1 as As,b2 as Ps,b3 as _s,b4 as Rs,b5 as qs,b6 as Fs,b7 as Us,b8 as Bs,b9 as ks,ba as Ns,bb as Ls,bc as Ms,bd as Ds,be as zs,bf as Gs,bg as $s,bh as Hs,bi as Os,bj as js,bk as Ws,bl as Vs,bm as Ks,bn as Js,bo as Ys,bp as Qs,bq as Zs,br as Xs,bs as to,bt as eo,bu as ao,bv as no,bw as ro,bx as so,by as oo,bz as io,br as co,bA as uo,bB as mo,bC as lo,bD as fo,bE as ho,bF as po,bG as yo,bH as go,bH as bo,bI as wo,bJ as xo,bi as Eo,bj as Io,bK as To,bL as Co,bM as vo,bN as So,bO as Ao}from"./parseSignature-BlcmAmYI.js";import{R as k,b3 as B,S as Me,x as Y,a7 as De,w as ze,b4 as Ge,U as H,V as ct,W as G,B as lt,q as E,E as $e,a2 as He,b5 as j,a1 as wt,G as Nt,b6 as Lt,d as Mt,A as R,m as F,b7 as A,C as Oe,I as je,b8 as We,b9 as xt,y as Ve,ba as Ke,bb as Je,bc as Ye,bd as Et}from"./prepare-contract-call-DDzIRXLv.js";import{be as _o,O as Ro,a8 as qo,bf as Fo,bg as Uo,bh as Bo,bi as ko,bj as No,a9 as Lo,bk as Mo,J as Do,M as zo,bl as Go,bm as $o,bn as Ho,F as Oo,Q as jo,N as Wo,bo as Vo,bp as Ko,bq as Jo,br as Yo,bs as Qo,bt as Zo,bu as Xo,bv as ti,bw as ei,bx as ai,by as ni,bz as ri,bA as si,bB as oi,bC as ii,bD as ci,bE as ui,bF as di,bG as mi,bH as li,j as fi,bI as hi,bJ as pi,bK as yi,bL as gi,K as bi,bM as wi,t as xi,bM as Ei,bN as Ii,bO as Ti,bP as Ci,bQ as vi,bR as Si,bS as Ai,bT as Pi,bU as _i,K as Ri,bM as qi,bU as Fi,t as Ui,bM as Bi}from"./prepare-contract-call-DDzIRXLv.js";import{u as ft}from"./to-serializable-transaction-DmYzeFAP.js";import{b as Ni,B as Li,C as Mi,D as Di,E as zi,m as Gi,n as $i,F as Hi,s as Oi,a as ji}from"./to-serializable-transaction-DmYzeFAP.js";import{w as Qe,h as Ze,g as Xe,v as ta,s as ea}from"./hashTypedData-Drw1v4Gy.js";import{I as Vi,a as Ki,b as Ji,d as Yi,c as Qi,e as Zi}from"./hashTypedData-Drw1v4Gy.js";import{T as aa,a as Q,W as It,b as na,U as ra,R as sa}from"./rpc-L1fXd1Sd.js";import{A as tc,c as ec,B as ac,C as nc,D as rc,H as sc,I as oc,d as ic,e as cc,f as uc,J as dc,L as mc,M as lc,h as fc,P as hc,i as pc,j as yc,k as gc,l as bc,m as wc,S as xc,n as Ec,o as Ic,p as Tc,q as Cc,r as vc,s as Sc}from"./rpc-L1fXd1Sd.js";import{_ as oa}from"./index-BzGWS8ln.js";import{t as ia,H as ca}from"./sha256-CfLwtdyC.js";import{b as Pc,h as _c,a as Rc,c as qc,d as Fc,e as Uc,f as Bc,g as kc,i as Nc,j as Lc,k as Mc,l as Dc,n as zc,o as Gc,p as $c,q as Hc,r as Oc,u as jc,v as Wc,w as Vc,x as Kc,y as Jc,z as Yc,A as Qc,B as Zc,C as Xc,D as tu,E as eu,F as au,G as nu,I as ru,J as su,K as ou,L as iu,M as cu,N as uu,O as du,P as mu,Q as lu,R as fu,S as hu,m as pu,T as yu,U as gu,V as bu,W as wu,X as xu,Y as Eu,Z as Iu,_ as Tu,$ as Cu,a0 as vu,a1 as Su,a2 as Au,a3 as Pu,a4 as _u,a5 as Ru,a6 as qu,a7 as Fu,a8 as Uu,a9 as Bu,aa as ku,ab as Nu,ac as Lu,ad as Mu,ae as Du,af as zu,ag as Gu,ah as $u,ai as Hu,aj as Ou,ak as ju,al as Wu,am as Vu,an as Ku,ao as Ju,ap as Yu,aq as Qu,ar as Zu,as as Xu,at as td,au as ed,av as ad,aw as nd,ax as rd,ay as sd,az as od,aA as id,aB as cd,aC as ud,aD as dd,aE as md,aF as ld,aG as fd,aH as hd,aI as pd,aJ as yd,aK as gd,s as bd}from"./sha256-CfLwtdyC.js";import{i as ht}from"./get-bytecode-BRKTQsHC.js";import{d as xd,a as Ed}from"./get-bytecode-BRKTQsHC.js";import{ccipRequest as Td,ccipRequest as Cd,offchainLookup as vd,offchainLookupAbiItem as Sd,offchainLookupSignature as Ad}from"./ccip-DyPtCXe7.js";import{d as _d,a as Rd,f as qd}from"./transactionReceipt-CYlPad05.js";import"./utils-BQF5MiO5.js";import"./sentry-Dx-KuLV3.js";import"./react-BYHuwl8r.js";import"./transaction-Col-q-Ce.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-CFqPm_mN.js";import"./intl-CBcMB1D2.js";function Qn(t){let e;if(typeof t=="string")e=gt(t,{modifiers:bt});else{const a=Yt(t),n=t.length;for(let r=0;r<n;r++){const s=t[r];if(!Qt(s)){e=gt(s,{modifiers:bt,structs:a});break}}}if(!e)throw new Zt({param:t});return e}async function M(t,e){return M.internal(t,ut,"sendTransaction",e)}(function(t){async function e(a,n,r,s){const{abi:u,account:d=a.account,address:c,args:i,dataSuffix:f,functionName:l,...h}=s;if(typeof d>"u")throw new D({docsPath:"/docs/contract/writeContract"});const o=d?N(d):null,p=Xt({abi:u,args:i,functionName:l});try{return await U(a,n,r)({data:`${p}${f?f.replace("0x",""):""}`,to:c,account:o,...h})}catch(m){throw te(m,{abi:u,address:c,args:i,docsPath:"/docs/contract/writeContract",functionName:l,sender:o==null?void 0:o.address})}}t.internal=e})(M||(M={}));function Zn({abi:t,address:e,client:a}){const n=a,[r,s]=n?"public"in n&&"wallet"in n?[n.public,n.wallet]:"public"in n?[n.public,void 0]:"wallet"in n?[void 0,n.wallet]:[n,n]:[void 0,void 0],u=r!=null,d=s!=null,c={};let i=!1,f=!1,l=!1;for(const h of t)if(h.type==="function"?h.stateMutability==="view"||h.stateMutability==="pure"?i=!0:f=!0:h.type==="event"&&(l=!0),i&&f&&l)break;return u&&(i&&(c.read=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r,ee,"readContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),f&&(c.simulate=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r,ae,"simulateContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),l&&(c.createEventFilter=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,ne,"createContractEventFilter")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.getEvents=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,re,"getContractEvents")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.watchEvent=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,se,"watchContractEvent")({abi:t,address:e,eventName:o,args:y,...w})}}}))),d&&f&&(c.write=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(s,M,"writeContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),(u||d)&&f&&(c.estimateGas=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r??s,oe,"estimateContractGas")({abi:t,address:e,functionName:o,args:m,...y,account:y.account??s.account})}}})),c.address=e,c.abi=t,c}function W(t){const e=t.length&&Array.isArray(t[0]),a=e?t[0]:[],n=(e?t[1]:t[0])??{};return{args:a,options:n}}function rt(t,e){let a=!1;Array.isArray(t[0])?a=!0:t.length===1?a=e.inputs.some(s=>s.indexed):t.length===2&&(a=!0);const n=a?t[0]:void 0,r=(a?t[1]:t[0])??{};return{args:n,options:r}}function Tt(t){return!t||typeof t!="object"||!("BYTES_PER_ELEMENT"in t)?!1:t.BYTES_PER_ELEMENT===1&&t.constructor.name==="Uint8Array"}function Xn(t){return t.opcode==="CREATE2"?da(t):ua(t)}function ua(t){const e=k(B(t.from));let a=k(t.nonce);return a[0]===0&&(a=new Uint8Array([])),B(`0x${Y(ia([e,a],"bytes")).slice(26)}`)}function da(t){const e=k(B(t.from)),a=Me(Tt(t.salt)?t.salt:k(t.salt),{size:32}),n="bytecodeHash"in t?Tt(t.bytecodeHash)?t.bytecodeHash:k(t.bytecodeHash):Y(t.bytecode,"bytes");return B(De(Y(ze([k("0xff"),e,a,n])),12))}function tr({chains:t,id:e}){return t.find(a=>a.id===e)}function Dt(t,e="hex"){const a=(()=>{if(typeof t=="string"){if(t.length>3&&t.length%2!==0)throw new Ge(t);return H(t)}return t})(),n=ct(a,{recursiveReadLimit:Number.POSITIVE_INFINITY});return zt(n,e)}function zt(t,e="hex"){if(t.bytes.length===0)return e==="hex"?G(t.bytes):t.bytes;const a=t.readByte();if(a<128&&t.decrementPosition(1),a<192){const r=Ct(t,a,128),s=t.readBytes(r);return e==="hex"?G(s):s}const n=Ct(t,a,192);return ma(t,n,e)}function Ct(t,e,a){if(a===128&&e<128)return 1;if(e<=a+55)return e-a;if(e===a+55+1)return t.readUint8();if(e===a+55+2)return t.readUint16();if(e===a+55+3)return t.readUint24();if(e===a+55+4)return t.readUint32();throw new lt("Invalid RLP prefix")}function ma(t,e,a){const n=t.position,r=[];for(;t.position-n<e;)r.push(zt(t,a));return r}function la(t){return E(t)&&$e(t)===32}const fa=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Gt=Uint8Array.from(new Array(16).fill(0).map((t,e)=>e)),ha=Gt.map(t=>(9*t+5)%16),$t=(()=>{const a=[[Gt],[ha]];for(let n=0;n<4;n++)for(let r of a)r.push(r[n].map(s=>fa[s]));return a})(),Ht=$t[0],Ot=$t[1],jt=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>Uint8Array.from(t)),pa=Ht.map((t,e)=>t.map(a=>jt[e][a])),ya=Ot.map((t,e)=>t.map(a=>jt[e][a])),ga=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),ba=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function vt(t,e,a,n){return t===0?e^a^n:t===1?e&a|~e&n:t===2?(e|~a)^n:t===3?e&n|a&~n:e^(a|~n)}const V=new Uint32Array(16);class wa extends ca{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:a,h2:n,h3:r,h4:s}=this;return[e,a,n,r,s]}set(e,a,n,r,s){this.h0=e|0,this.h1=a|0,this.h2=n|0,this.h3=r|0,this.h4=s|0}process(e,a){for(let o=0;o<16;o++,a+=4)V[o]=e.getUint32(a,!0);let n=this.h0|0,r=n,s=this.h1|0,u=s,d=this.h2|0,c=d,i=this.h3|0,f=i,l=this.h4|0,h=l;for(let o=0;o<5;o++){const p=4-o,m=ga[o],y=ba[o],w=Ht[o],g=Ot[o],C=pa[o],b=ya[o];for(let x=0;x<16;x++){const I=j(n+vt(o,s,d,i)+V[w[x]]+m,C[x])+l|0;n=l,l=i,i=j(d,10)|0,d=s,s=I}for(let x=0;x<16;x++){const I=j(r+vt(p,u,c,f)+V[g[x]]+y,b[x])+h|0;r=h,h=f,f=j(c,10)|0,c=u,u=I}}this.set(this.h1+d+f|0,this.h2+i+h|0,this.h3+l+r|0,this.h4+n+u|0,this.h0+s+c|0)}roundClean(){wt(V)}destroy(){this.destroyed=!0,wt(this.buffer),this.set(0,0,0,0,0)}}const xa=He(()=>new wa),Ea=xa;function er(t,e){const a=e||"hex",n=Ea(E(t,{strict:!1})?k(t):t);return a==="bytes"?n:Nt(n)}const st=new Map;async function Ia(t){const{getSocket:e,keepAlive:a=!0,key:n="socket",reconnect:r=!0,url:s}=t,{interval:u=3e4}=typeof a=="object"?a:{},{attempts:d=5,delay:c=2e3}=typeof r=="object"?r:{},i=JSON.stringify({keepAlive:a,key:n,url:s,reconnect:r});let f=st.get(i);if(f)return f;let l=0;const{schedule:h}=ie({id:i,fn:async()=>{const m=new Map,y=new Map;let w,g,C,b=!1;function x(){if(r&&l<d){if(b)return;b=!0,l++,g==null||g.close(),setTimeout(async()=>{await I().catch(console.error),b=!1},c)}else m.clear(),y.clear()}async function I(){const T=await e({onClose(){var v,P;for(const S of m.values())(v=S.onError)==null||v.call(S,new Q({url:s}));for(const S of y.values())(P=S.onError)==null||P.call(S,new Q({url:s}));x()},onError(v){var P,S;w=v;for(const _ of m.values())(P=_.onError)==null||P.call(_,w);for(const _ of y.values())(S=_.onError)==null||S.call(_,w);x()},onOpen(){w=void 0,l=0},onResponse(v){const P=v.method==="eth_subscription",S=P?v.params.subscription:v.id,_=P?y:m,q=_.get(S);q&&q.onResponse(v),P||_.delete(S)}});if(g=T,a&&(C&&clearInterval(C),C=setInterval(()=>{var v;return(v=g.ping)==null?void 0:v.call(g)},u)),r&&y.size>0){const v=y.entries();for(const[P,{onResponse:S,body:_,onError:q}]of v)_&&(y.delete(P),f==null||f.request({body:_,onResponse:S,onError:q}))}return T}return await I(),w=void 0,f={close(){C&&clearInterval(C),g.close(),st.delete(i)},get socket(){return g},request({body:T,onError:v,onResponse:P}){w&&v&&v(w);const S=T.id??ce.take(),_=q=>{var z;typeof q.id=="number"&&S!==q.id||(T.method==="eth_subscribe"&&typeof q.result=="string"&&y.set(q.result,{onResponse:_,onError:v,body:T}),T.method==="eth_unsubscribe"&&y.delete((z=T.params)==null?void 0:z[0]),P(q))};m.set(S,{onResponse:_,onError:v});try{g.request({body:{jsonrpc:"2.0",id:S,...T}})}catch(q){v==null||v(q)}},requestAsync({body:T,timeout:v=1e4}){return Qe(()=>new Promise((P,S)=>this.request({body:T,onError:S,onResponse:P})),{errorInstance:new aa({body:T,url:s}),timeout:v})},requests:m,subscriptions:y,url:s},st.set(i,f),[f]}}),[o,[p]]=await h();return p}async function J(t,e={}){const{keepAlive:a,reconnect:n}=e;return Ia({async getSocket({onClose:r,onError:s,onOpen:u,onResponse:d}){const c=await oa(()=>import("./native-CPZ4GKee.js").then(o=>o.n),__vite__mapDeps([0,1,2])).then(o=>o.WebSocket),i=new c(t);function f(){i.removeEventListener("close",f),i.removeEventListener("message",l),i.removeEventListener("error",s),i.removeEventListener("open",u),r()}function l({data:o}){if(!(typeof o=="string"&&o.trim().length===0))try{const p=JSON.parse(o);d(p)}catch(p){s(p)}}i.addEventListener("close",f),i.addEventListener("message",l),i.addEventListener("error",s),i.addEventListener("open",u),i.readyState===c.CONNECTING&&await new Promise((o,p)=>{i&&(i.onopen=o,i.onerror=p)});const{close:h}=i;return Object.assign(i,{close(){h.bind(i)(),f()},ping(){try{if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({url:i.url,cause:new Q({url:i.url})});const o={jsonrpc:"2.0",id:null,method:"net_version",params:[]};i.send(JSON.stringify(o))}catch(o){s(o)}},request({body:o}){if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({body:o,url:i.url,cause:new Q({url:i.url})});return i.send(JSON.stringify(o))}})},keepAlive:a,reconnect:n,url:t})}async function Ta(t){const e=await J(t);return Object.assign(e.socket,{requests:e.requests,subscriptions:e.subscriptions})}function Ca(t){return Lt(t,-32)===ue}function va(t){return de(t)}function ar(t){if(!Ca(t))return{signature:t};const[e,a,n]=Mt([{type:"address"},{type:"bytes"},{type:"bytes"}],t);return{address:e,data:a,signature:n}}function nr(t){if(!va(t))return{signature:t};const{authorization:e,to:a,...n}=me(t);return{authorization:{address:e.address,chainId:e.chainId,nonce:Number(e.nonce),r:R(e.r,{size:32}),s:R(e.s,{size:32}),yParity:e.yParity},...a?{address:a}:{},...n}}async function Sa({message:t,signature:e}){return Z({hash:le(t),signature:e})}async function Aa(t){const{domain:e,message:a,primaryType:n,signature:r,types:s}=t;return Z({hash:Ze({domain:e,message:a,primaryType:n,types:s}),signature:r})}function rr(t){const{address:e,data:a,signature:n,to:r="hex"}=t,s=fe({authorization:{address:t.authorization.address,chainId:t.authorization.chainId,nonce:BigInt(t.authorization.nonce),r:BigInt(t.authorization.r),s:BigInt(t.authorization.s),yParity:t.authorization.yParity},data:a,signature:n,to:e});return r==="hex"?s:H(s)}async function sr({address:t,hash:e,signature:a}){return ht(B(t),await Z({hash:e,signature:a}))}async function or({address:t,message:e,signature:a}){return ht(B(t),await Sa({message:e,signature:a}))}async function ir(t){const{address:e,domain:a,message:n,primaryType:r,signature:s,types:u}=t;return ht(B(e),await Aa({domain:a,message:n,primaryType:r,signature:s,types:u}))}function Pa(t){const e=Lt(t,0,1);if(e==="0x04")return"eip7702";if(e==="0x03")return"eip4844";if(e==="0x02")return"eip1559";if(e==="0x01")return"eip2930";if(e!=="0x"&&F(e)>=192)return"legacy";throw new he({serializedType:e})}function _a(t){const e=Pa(t);return e==="eip1559"?Fa(t):e==="eip2930"?Ua(t):e==="eip4844"?qa(t):e==="eip7702"?Ra(t):Ba(t)}function Ra(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h,o,p]=e;if(e.length!==10&&e.length!==13)throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,authorizationList:l,...e.length>9?{v:h,r:o,s:p}:{}},serializedTransaction:t,type:"eip7702"});const m={chainId:F(a),type:"eip7702"};return E(d)&&d!=="0x"&&(m.to=d),E(u)&&u!=="0x"&&(m.gas=A(u)),E(i)&&i!=="0x"&&(m.data=i),E(n)&&(m.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(m.value=A(c)),E(s)&&s!=="0x"&&(m.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(m.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(m.accessList=tt(f)),l.length!==0&&l!=="0x"&&(m.authorizationList=ka(l)),we(m),{...e.length===13?O(e):void 0,...m}}function qa(t){const e=X(t),a=e.length===4,n=a?e[0]:e,r=a?e.slice(1):[],[s,u,d,c,i,f,l,h,o,p,m,y,w,g]=n,[C,b,x]=r;if(!(n.length===11||n.length===14))throw new $({attributes:{chainId:s,nonce:u,maxPriorityFeePerGas:d,maxFeePerGas:c,gas:i,to:f,value:l,data:h,accessList:o,...n.length>9?{v:y,r:w,s:g}:{}},serializedTransaction:t,type:"eip4844"});const I={blobVersionedHashes:m,chainId:F(s),to:f,type:"eip4844"};return E(i)&&i!=="0x"&&(I.gas=A(i)),E(h)&&h!=="0x"&&(I.data=h),E(u)&&(I.nonce=u==="0x"?0:F(u)),E(l)&&l!=="0x"&&(I.value=A(l)),E(p)&&p!=="0x"&&(I.maxFeePerBlobGas=A(p)),E(c)&&c!=="0x"&&(I.maxFeePerGas=A(c)),E(d)&&d!=="0x"&&(I.maxPriorityFeePerGas=A(d)),o.length!==0&&o!=="0x"&&(I.accessList=tt(o)),C&&b&&x&&(I.sidecars=ge({blobs:C,commitments:b,proofs:x})),be(I),{...n.length===14?O(n):void 0,...I}}function Fa(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h,o]=e;if(!(e.length===9||e.length===12))throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,...e.length>9?{v:l,r:h,s:o}:{}},serializedTransaction:t,type:"eip1559"});const p={chainId:F(a),type:"eip1559"};return E(d)&&d!=="0x"&&(p.to=d),E(u)&&u!=="0x"&&(p.gas=A(u)),E(i)&&i!=="0x"&&(p.data=i),E(n)&&(p.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(p.value=A(c)),E(s)&&s!=="0x"&&(p.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(p.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(p.accessList=tt(f)),pe(p),{...e.length===12?O(e):void 0,...p}}function Ua(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h]=e;if(!(e.length===8||e.length===11))throw new $({attributes:{chainId:a,nonce:n,gasPrice:r,gas:s,to:u,value:d,data:c,accessList:i,...e.length>8?{v:f,r:l,s:h}:{}},serializedTransaction:t,type:"eip2930"});const o={chainId:F(a),type:"eip2930"};return E(u)&&u!=="0x"&&(o.to=u),E(s)&&s!=="0x"&&(o.gas=A(s)),E(c)&&c!=="0x"&&(o.data=c),E(n)&&(o.nonce=n==="0x"?0:F(n)),E(d)&&d!=="0x"&&(o.value=A(d)),E(r)&&r!=="0x"&&(o.gasPrice=A(r)),i.length!==0&&i!=="0x"&&(o.accessList=tt(i)),ye(o),{...e.length===11?O(e):void 0,...o}}function Ba(t){const e=Dt(t,"hex"),[a,n,r,s,u,d,c,i,f]=e;if(!(e.length===6||e.length===9))throw new $({attributes:{nonce:a,gasPrice:n,gas:r,to:s,value:u,data:d,...e.length>6?{v:c,r:i,s:f}:{}},serializedTransaction:t,type:"legacy"});const l={type:"legacy"};if(E(s)&&s!=="0x"&&(l.to=s),E(r)&&r!=="0x"&&(l.gas=A(r)),E(d)&&d!=="0x"&&(l.data=d),E(a)&&(l.nonce=a==="0x"?0:F(a)),E(u)&&u!=="0x"&&(l.value=A(u)),E(n)&&n!=="0x"&&(l.gasPrice=A(n)),xe(l),e.length===6)return l;const h=E(c)&&c!=="0x"?A(c):0n;if(f==="0x"&&i==="0x")return h>0&&(l.chainId=Number(h)),l;const o=h,p=Number((o-35n)/2n);if(p>0)l.chainId=p;else if(o!==27n&&o!==28n)throw new Ee({v:o});return l.v=o,l.s=f,l.r=i,l.yParity=o%2n===0n?1:0,l}function X(t){return Dt(`0x${t.slice(4)}`,"hex")}function tt(t){const e=[];for(let a=0;a<t.length;a++){const[n,r]=t[a];if(!Oe(n,{strict:!1}))throw new je({address:n});e.push({address:n,storageKeys:r.map(s=>la(s)?s:We(s))})}return e}function ka(t){const e=[];for(let a=0;a<t.length;a++){const[n,r,s,u,d,c]=t[a];e.push({address:r,chainId:n==="0x"?0:F(n),nonce:s==="0x"?0:F(s),...O([u,d,c])})}return e}function O(t){const e=t.slice(-3),a=e[0]==="0x"||A(e[0])===0n?27n:28n;return{r:xt(e[1],{size:32}),s:xt(e[2],{size:32}),v:a,yParity:a===27n?0:1}}class Na extends lt{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function Wt(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new Na({value:t});let[a,n="0"]=t.split(".");const r=a.startsWith("-");if(r&&(a=a.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(a=`${BigInt(a)+1n}`),n="";else if(n.length>e){const[s,u,d]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],c=Math.round(+`${u}.${d}`);c>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${c}`,n.length>e&&(n=n.slice(1),a=`${BigInt(a)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${r?"-":""}${a}${n}`)}function cr(t,e="wei"){return Wt(t,Ie[e])}function ur(t,e="wei"){return Wt(t,Te[e])}async function La(t,{hash:e}){await t.request({method:`${t.mode}_dropTransaction`,params:[e]})}async function Ma(t){return t.request({method:`${t.mode}_dumpState`})}async function Da(t){return t.mode==="ganache"?await t.request({method:"eth_mining"}):await t.request({method:`${t.mode}_getAutomine`})}async function za(t){return await t.request({method:"txpool_content"})}async function Ga(t){const{pending:e,queued:a}=await t.request({method:"txpool_status"});return{pending:F(e),queued:F(a)}}async function $a(t,{address:e}){await t.request({method:`${t.mode}_impersonateAccount`,params:[e]})}async function Ha(t,{seconds:e}){return await t.request({method:"evm_increaseTime",params:[R(e)]})}async function Oa(t){return await t.request({method:"txpool_inspect"})}async function ja(t,{state:e}){await t.request({method:`${t.mode}_loadState`,params:[e]})}async function Wa(t,{blocks:e,interval:a}){t.mode==="ganache"?await t.request({method:"evm_mine",params:[{blocks:R(e)}]}):await t.request({method:`${t.mode}_mine`,params:[R(e),R(a||0)]})}async function Va(t){await t.request({method:`${t.mode}_removeBlockTimestampInterval`})}async function Ka(t,{blockNumber:e,jsonRpcUrl:a}={}){await t.request({method:`${t.mode}_reset`,params:[{forking:{blockNumber:Number(e),jsonRpcUrl:a}}]})}async function Ja(t,{id:e}){await t.request({method:"evm_revert",params:[e]})}async function Ya(t,e){var w,g,C;const{accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:l,...h}=e,o=(C=(g=(w=t.chain)==null?void 0:w.formatters)==null?void 0:g.transactionRequest)==null?void 0:C.format,m=(o||ft)({...St(h,{format:o}),accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:l},"sendUnsignedTransaction");return await t.request({method:"eth_sendUnsignedTransaction",params:[m]})}async function Qa(t,e){t.mode==="ganache"?e?await t.request({method:"miner_start"}):await t.request({method:"miner_stop"}):await t.request({method:"evm_setAutomine",params:[e]})}async function Za(t,{address:e,value:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountBalance",params:[e,R(a)]}):await t.request({method:`${t.mode}_setBalance`,params:[e,R(a)]})}async function Xa(t,{gasLimit:e}){await t.request({method:"evm_setBlockGasLimit",params:[R(e)]})}async function tn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:`${t.mode}_setBlockTimestampInterval`,params:[a]})}async function en(t,{address:e,bytecode:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountCode",params:[e,a]}):await t.request({method:`${t.mode}_setCode`,params:[e,a]})}async function an(t,{address:e}){await t.request({method:`${t.mode}_setCoinbase`,params:[e]})}async function nn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:"evm_setIntervalMining",params:[a]})}async function rn(t,e){await t.request({method:`${t.mode}_setLoggingEnabled`,params:[e]})}async function sn(t,{gasPrice:e}){await t.request({method:`${t.mode}_setMinGasPrice`,params:[R(e)]})}async function on(t,{baseFeePerGas:e}){await t.request({method:`${t.mode}_setNextBlockBaseFeePerGas`,params:[R(e)]})}async function cn(t,{timestamp:e}){await t.request({method:"evm_setNextBlockTimestamp",params:[R(e)]})}async function un(t,{address:e,nonce:a}){await t.request({method:`${t.mode}_setNonce`,params:[e,R(a)]})}async function dn(t,e){await t.request({method:`${t.mode}_setRpcUrl`,params:[e]})}async function mn(t,{address:e,index:a,value:n}){await t.request({method:`${t.mode}_setStorageAt`,params:[e,typeof a=="number"?R(a):a,n]})}async function ln(t){return await t.request({method:"evm_snapshot"})}async function fn(t,{address:e}){await t.request({method:`${t.mode}_stopImpersonatingAccount`,params:[e]})}function hn({mode:t}){return e=>{const a=e.extend(()=>({mode:t}));return{dropTransaction:n=>La(a,n),dumpState:()=>Ma(a),getAutomine:()=>Da(a),getTxpoolContent:()=>za(a),getTxpoolStatus:()=>Ga(a),impersonateAccount:n=>$a(a,n),increaseTime:n=>Ha(a,n),inspectTxpool:()=>Oa(a),loadState:n=>ja(a,n),mine:n=>Wa(a,n),removeBlockTimestampInterval:()=>Va(a),reset:n=>Ka(a,n),revert:n=>Ja(a,n),sendUnsignedTransaction:n=>Ya(a,n),setAutomine:n=>Qa(a,n),setBalance:n=>Za(a,n),setBlockGasLimit:n=>Xa(a,n),setBlockTimestampInterval:n=>tn(a,n),setCode:n=>en(a,n),setCoinbase:n=>an(a,n),setIntervalMining:n=>nn(a,n),setLoggingEnabled:n=>rn(a,n),setMinGasPrice:n=>sn(a,n),setNextBlockBaseFeePerGas:n=>on(a,n),setNextBlockTimestamp:n=>cn(a,n),setNonce:n=>un(a,n),setRpcUrl:n=>dn(a,n),setStorageAt:n=>mn(a,n),snapshot:()=>ln(a),stopImpersonatingAccount:n=>fn(a,n)}}}function dr(t){const{key:e="test",name:a="Test Client",mode:n}=t;return At({...t,key:e,name:a,type:"testClient"}).extend(s=>({mode:n,...hn({mode:n})(s)}))}async function pn(t,{chain:e}){const{id:a,name:n,nativeCurrency:r,rpcUrls:s,blockExplorers:u}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:R(a),chainName:n,nativeCurrency:r,rpcUrls:s.default.http,blockExplorerUrls:u?Object.values(u).map(({url:d})=>d):void 0}]},{dedupe:!0,retryCount:0})}function yn(t,e){const{abi:a,args:n,bytecode:r,...s}=e,u=Ce({abi:a,args:n,bytecode:r});return ut(t,{...s,...s.authorizationList?{to:null}:{},data:u})}async function gn(t){var a;return((a=t.account)==null?void 0:a.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(n=>Ve(n))}async function bn(t,e={}){const{account:a=t.account,chainId:n}=e,r=a?N(a):void 0,s=n?[r==null?void 0:r.address,[R(n)]]:[r==null?void 0:r.address],u=await t.request({method:"wallet_getCapabilities",params:s}),d={};for(const[c,i]of Object.entries(u)){d[Number(c)]={};for(let[f,l]of Object.entries(i))f==="addSubAccount"&&(f="unstable_addSubAccount"),d[Number(c)][f]=l}return typeof n=="number"?d[n]:d}async function wn(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function xn(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(a=>B(a))}async function En(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function In(t,e){const{chain:a=t.chain}=e,n=e.timeout??Math.max(((a==null?void 0:a.blockTime)??0)*3,5e3),r=await Pt(t,e);return await _t(t,{...e,id:r.id,timeout:n})}const ot=new Ke(128);async function Vt(t,e){var x,I,T,v;const{account:a=t.account,chain:n=t.chain,accessList:r,authorizationList:s,blobs:u,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,pollingInterval:p,throwOnReceiptRevert:m,type:y,value:w,...g}=e,C=e.timeout??Math.max(((n==null?void 0:n.blockTime)??0)*3,5e3);if(typeof a>"u")throw new D({docsPath:"/docs/actions/wallet/sendTransactionSync"});const b=a?N(a):null;try{Rt(e);const P=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await ve({authorization:s[0]}).catch(()=>{throw new lt("`to` is required. Could not infer from `authorizationList`.")})})();if((b==null?void 0:b.type)==="json-rpc"||b===null){let S;n!==null&&(S=await U(t,dt,"getChainId")({}),qt({currentChainId:S,chain:n}));const _=(T=(I=(x=t.chain)==null?void 0:x.formatters)==null?void 0:I.transactionRequest)==null?void 0:T.format,z=(_||ft)({...St(g,{format:_}),accessList:r,account:b,authorizationList:s,blobs:u,chainId:S,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,to:P,type:y,value:w},"sendTransaction"),pt=ot.get(t.uid),Kt=pt?"wallet_sendTransaction":"eth_sendTransaction",Jt=await(async()=>{try{return await t.request({method:Kt,params:[z]},{retryCount:0})}catch(yt){if(pt===!1)throw yt;const L=yt;if(L.name==="InvalidInputRpcError"||L.name==="InvalidParamsRpcError"||L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[z]},{retryCount:0}).then(at=>(ot.set(t.uid,!0),at)).catch(at=>{const nt=at;throw nt.name==="MethodNotFoundRpcError"||nt.name==="MethodNotSupportedRpcError"?(ot.set(t.uid,!1),L):nt});throw L}})(),et=await U(t,Se,"waitForTransactionReceipt")({checkReplacement:!1,hash:Jt,pollingInterval:p,timeout:C});if(m&&et.status==="reverted")throw new Ae({receipt:et});return et}if((b==null?void 0:b.type)==="local"){const S=await U(t,Ft,"prepareTransactionRequest")({account:b,accessList:r,authorizationList:s,blobs:u,chain:n,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,nonceManager:b.nonceManager,parameters:[...Pe,"sidecars"],type:y,value:w,...g,to:P}),_=(v=n==null?void 0:n.serializers)==null?void 0:v.transaction,q=await b.signTransaction(S,{serializer:_});return await U(t,Ut,"sendRawTransactionSync")({serializedTransaction:q,throwOnReceiptRevert:m})}throw(b==null?void 0:b.type)==="smart"?new K({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new K({docsPath:"/docs/actions/wallet/sendTransactionSync",type:b==null?void 0:b.type})}catch(P){throw P instanceof K?P:_e(P,{...e,account:b,chain:e.chain||void 0})}}async function Tn(t,e){const{id:a}=e;await t.request({method:"wallet_showCallsStatus",params:[a]})}async function Cn(t,e){const{account:a=t.account}=e;if(!a)throw new D({docsPath:"/docs/eip7702/signAuthorization"});const n=N(a);if(!n.signAuthorization)throw new K({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const r=await Bt(t,e);return n.signAuthorization(r)}async function vn(t,{account:e=t.account,message:a}){if(!e)throw new D({docsPath:"/docs/actions/wallet/signMessage"});const n=N(e);if(n.signMessage)return n.signMessage({message:a});const r=typeof a=="string"?Je(a):a.raw instanceof Uint8Array?Nt(a.raw):a.raw;return t.request({method:"personal_sign",params:[r,n.address]},{retryCount:0})}async function Sn(t,e){var i,f,l,h;const{account:a=t.account,chain:n=t.chain,...r}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTransaction"});const s=N(a);Rt({account:s,...e});const u=await U(t,dt,"getChainId")({});n!==null&&qt({currentChainId:u,chain:n});const d=(n==null?void 0:n.formatters)||((i=t.chain)==null?void 0:i.formatters),c=((f=d==null?void 0:d.transactionRequest)==null?void 0:f.format)||ft;return s.signTransaction?s.signTransaction({...r,chainId:u},{serializer:(h=(l=t.chain)==null?void 0:l.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...c({...r,account:s},"signTransaction"),chainId:R(u),from:s.address}]},{retryCount:0})}async function An(t,e){const{account:a=t.account,domain:n,message:r,primaryType:s}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTypedData"});const u=N(a),d={EIP712Domain:Xe({domain:n}),...e.types};if(ta({domain:n,message:r,primaryType:s,types:d}),u.signTypedData)return u.signTypedData({domain:n,message:r,primaryType:s,types:d});const c=ea({domain:n,message:r,primaryType:s,types:d});return t.request({method:"eth_signTypedData_v4",params:[u.address,c]},{retryCount:0})}async function Pn(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:R(e)}]},{retryCount:0})}async function _n(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}async function Rn(t,e){return M.internal(t,Vt,"sendTransactionSync",e)}function qn(t){return{addChain:e=>pn(t,e),deployContract:e=>yn(t,e),getAddresses:()=>gn(t),getCallsStatus:e=>qe(t,e),getCapabilities:e=>bn(t,e),getChainId:()=>dt(t),getPermissions:()=>wn(t),prepareAuthorization:e=>Bt(t,e),prepareTransactionRequest:e=>Ft(t,e),requestAddresses:()=>xn(t),requestPermissions:e=>En(t,e),sendCalls:e=>Pt(t,e),sendCallsSync:e=>In(t,e),sendRawTransaction:e=>Re(t,e),sendRawTransactionSync:e=>Ut(t,e),sendTransaction:e=>ut(t,e),sendTransactionSync:e=>Vt(t,e),showCallsStatus:e=>Tn(t,e),signAuthorization:e=>Cn(t,e),signMessage:e=>vn(t,e),signTransaction:e=>Sn(t,e),signTypedData:e=>An(t,e),switchChain:e=>Pn(t,e),waitForCallsStatus:e=>_t(t,e),watchAsset:e=>_n(t,e),writeContract:e=>M(t,e),writeContractSync:e=>Rn(t,e)}}function mr(t){const{key:e="wallet",name:a="Wallet Client",transport:n}=t;return At({...t,key:e,name:a,transport:n,type:"walletClient"}).extend(qn)}function lr(t,e={}){const{key:a="custom",methods:n,name:r="Custom Provider",retryDelay:s}=e;return({retryCount:u})=>mt({key:a,methods:n,name:r,request:t.request.bind(t),retryCount:e.retryCount??u,retryDelay:s,type:"custom"})}function fr(t,e={}){const{key:a="fallback",name:n="Fallback",rank:r=!1,shouldThrow:s=Fn,retryCount:u,retryDelay:d}=e;return(({chain:c,pollingInterval:i=4e3,timeout:f,...l})=>{let h=t,o=()=>{};const p=mt({key:a,name:n,async request({method:m,params:y}){let w;const g=async(C=0)=>{const b=h[C]({...l,chain:c,retryCount:0,timeout:f});try{const x=await b.request({method:m,params:y});return o({method:m,params:y,response:x,transport:b,status:"success"}),x}catch(x){if(o({error:x,method:m,params:y,transport:b,status:"error"}),s(x)||C===h.length-1||(w??(w=h.slice(C+1).some(I=>{const{include:T,exclude:v}=I({chain:c}).config.methods||{};return T?T.includes(m):v?!v.includes(m):!0})),!w))throw x;return g(C+1)}};return g()},retryCount:u,retryDelay:d,type:"fallback"},{onResponse:m=>o=m,transports:h.map(m=>m({chain:c,retryCount:0}))});if(r){const m=typeof r=="object"?r:{};Un({chain:c,interval:m.interval??i,onTransports:y=>h=y,ping:m.ping,sampleCount:m.sampleCount,timeout:m.timeout,transports:h,weights:m.weights})}return p})}function Fn(t){return!!("code"in t&&typeof t.code=="number"&&(t.code===na.code||t.code===ra.code||Fe.nodeMessage.test(t.message)||t.code===5e3))}function Un({chain:t,interval:e=4e3,onTransports:a,ping:n,sampleCount:r=10,timeout:s=1e3,transports:u,weights:d={}}){const{stability:c=.7,latency:i=.3}=d,f=[],l=async()=>{const h=await Promise.all(u.map(async m=>{const y=m({chain:t,retryCount:0,timeout:s}),w=Date.now();let g,C;try{await(n?n({transport:y}):y.request({method:"net_listening"})),C=1}catch{C=0}finally{g=Date.now()}return{latency:g-w,success:C}}));f.push(h),f.length>r&&f.shift();const o=Math.max(...f.map(m=>Math.max(...m.map(({latency:y})=>y)))),p=u.map((m,y)=>{const w=f.map(I=>I[y].latency),C=1-w.reduce((I,T)=>I+T,0)/w.length/o,b=f.map(I=>I[y].success),x=b.reduce((I,T)=>I+T,0)/b.length;return x===0?[0,y]:[i*C+c*x,y]}).sort((m,y)=>y[0]-m[0]);a(p.map(([,m])=>u[m])),await Ue(e),l()};l()}function hr(t,e={}){const{keepAlive:a,key:n="webSocket",methods:r,name:s="WebSocket JSON-RPC",reconnect:u,retryDelay:d}=e;return({chain:c,retryCount:i,timeout:f})=>{var m;const l=e.retryCount??i,h=f??e.timeout??1e4,o=t||((m=c==null?void 0:c.rpcUrls.default.webSocket)==null?void 0:m[0]),p={keepAlive:a,reconnect:u};if(!o)throw new Be;return mt({key:n,methods:r,name:s,async request({method:y,params:w}){const g={method:y,params:w},C=await J(o,p),{error:b,result:x}=await C.requestAsync({body:g,timeout:h});if(b)throw new sa({body:g,error:b,url:o});return x},retryCount:l,retryDelay:d,timeout:h,type:"webSocket"},{getSocket(){return Ta(o)},getRpcClient(){return J(o,p)},async subscribe({params:y,onData:w,onError:g}){const C=await J(o,p),{result:b}=await new Promise((x,I)=>C.request({body:{method:"eth_subscribe",params:y},onError(T){I(T),g==null||g(T)},onResponse(T){if(T.error){I(T.error),g==null||g(T.error);return}if(typeof T.id=="number"){x(T);return}T.method==="eth_subscription"&&w(T.params)}}));return{subscriptionId:b,async unsubscribe(){return new Promise(x=>C.request({body:{method:"eth_unsubscribe",params:[b]},onResponse:x}))}}}})}}class pr extends Error{constructor(e,a){super(a),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e,this.details=a}}const it="/docs/contract/decodeDeployData";function yr(t){const{abi:e,bytecode:a,data:n}=t;if(n===a)return{bytecode:a};const r=e.find(u=>"type"in u&&u.type==="constructor");if(!r)throw new Ye({docsPath:it});if(!("inputs"in r))throw new Et({docsPath:it});if(!r.inputs||r.inputs.length===0)throw new Et({docsPath:it});return{args:Mt(r.inputs,`0x${n.replace(a,"")}`),bytecode:a}}function gr(t){const e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),a=typeof t.blobs[0]=="string"?t.blobs.map(d=>H(d)):t.blobs,n=a.reduce((d,c)=>d+c.length,0),r=ct(new Uint8Array(n));let s=!0;for(const d of a){const c=ct(d);for(;s&&c.position<d.length;){c.incrementPosition(1);let i=31;d.length-c.position<31&&(i=d.length-c.position);for(const f in Array.from({length:i})){const l=c.readByte();if(l===128&&!c.inspectBytes(c.remaining).includes(128)){s=!1;break}r.pushByte(l)}}}const u=r.bytes.slice(0,r.position);return e==="hex"?G(u):u}function br(t){const{sidecars:e,version:a}=t,n=t.to??(typeof e[0].blob=="string"?"hex":"bytes"),r=[];for(const{commitment:s}of e)r.push(ke({commitment:s,to:n,version:a}));return r}const Bn=2147483648;function wr(t){if(t===1)return 60n;if(t>=Bn||t<0)throw new Ne({chainId:t});return BigInt((2147483648|t)>>>0)}function kn({blobToKzgCommitment:t,computeBlobKzgProof:e}){return{blobToKzgCommitment:t,computeBlobKzgProof:e}}function xr(t,e){try{t.loadTrustedSetup(e)}catch(a){const n=a;if(!n.message.includes("trusted setup is already loaded"))throw n}return kn(t)}function Er({r:t,yParityAndS:e}){const a=H(e),n=a[0]&128?1:0,r=a;return n===1&&(r[0]&=127),{r:t,s:G(r),yParity:n}}function Ir(t){const{r:e,s:a}=kt.Signature.fromCompact(t.slice(2,130));return{r:R(e,{size:32}),yParityAndS:R(a,{size:32})}}async function Tr(t){const{serializedTransaction:e,signature:a}=t,n=_a(e),r=a??{r:n.r,s:n.s,v:n.v,yParity:n.yParity},s=Le({...n,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await Z({hash:Y(s),signature:r})}function Cr({r:t,yParityAndS:e}){return`0x${new kt.Signature(A(t),A(e)).toCompactHex()}`}function vr(t){const{r:e,s:a,v:n,yParity:r}=t,s=Number(r??n-27n);let u=a;if(s===1){const d=H(a);d[0]|=128,u=G(d)}return{r:e,yParityAndS:u}}export{Ye as AbiConstructorNotFoundError,Et as AbiConstructorParamsNotFoundError,_o as AbiDecodingDataSizeInvalidError,Ro as AbiDecodingDataSizeTooSmallError,qo as AbiDecodingZeroDataError,Fo as AbiEncodingArrayLengthMismatchError,Uo as AbiEncodingBytesSizeMismatchError,Bo as AbiEncodingLengthMismatchError,ko as AbiErrorInputsNotFoundError,No as AbiErrorNotFoundError,Lo as AbiErrorSignatureNotFoundError,Mo as AbiEventNotFoundError,Do as AbiEventSignatureEmptyTopicsError,zo as AbiEventSignatureNotFoundError,Go as AbiFunctionNotFoundError,$o as AbiFunctionOutputsNotFoundError,Ho as AbiFunctionSignatureNotFoundError,Pr as AccountStateConflictError,tc as AtomicReadyWalletRejectedUpgradeError,ec as AtomicityNotSupportedError,lt as BaseError,_r as BaseFeeScalarError,Rr as BlockNotFoundError,qr as BundleFailedError,ac as BundleTooLargeError,Oo as BytesSizeMismatchError,Fr as CallExecutionError,nc as ChainDisconnectedError,Ur as ChainDoesNotSupportContract,Br as ChainMismatchError,kr as ChainNotFoundError,Nr as CircularReferenceError,Lr as ClientChainNotConfiguredError,Mr as ContractFunctionExecutionError,Dr as ContractFunctionRevertedError,zr as ContractFunctionZeroDataError,Gr as CounterfactualDeploymentFailedError,jo as DecodeLogDataMismatch,Wo as DecodeLogTopicsMismatch,rc as DuplicateIdError,pr as EIP1193ProviderRpcError,$r as Eip1559FeesNotSupportedError,Hr as EnsAvatarInvalidNftUriError,Or as EnsAvatarUnsupportedNamespaceError,jr as EnsAvatarUriResolutionError,Ne as EnsInvalidChainIdError,Wr as EstimateGasExecutionError,Fe as ExecutionRevertedError,Vr as FeeCapTooHighError,Kr as FeeCapTooLowError,Jr as FeeConflictError,Vo as FilterTypeNotSupportedError,sc as HttpRequestError,Yr as InsufficientFundsError,Ko as IntegerOutOfRangeError,oc as InternalRpcError,Qr as IntrinsicGasTooHighError,Zr as IntrinsicGasTooLowError,Jo as InvalidAbiDecodingTypeError,Yo as InvalidAbiEncodingTypeError,Xr as InvalidAbiItemError,Zt as InvalidAbiParameterError,ts as InvalidAbiParametersError,es as InvalidAbiTypeParameterError,je as InvalidAddressError,Qo as InvalidArrayError,Zo as InvalidBytesBooleanError,as as InvalidChainIdError,Na as InvalidDecimalNumberError,Xo as InvalidDefinitionTypeError,Vi as InvalidDomainError,ns as InvalidFunctionModifierError,ti as InvalidHexBooleanError,Ge as InvalidHexValueError,ic as InvalidInputRpcError,Ee as InvalidLegacyVError,rs as InvalidModifierError,ss as InvalidParameterError,cc as InvalidParamsRpcError,os as InvalidParenthesisError,Ki as InvalidPrimaryTypeError,uc as InvalidRequestRpcError,is as InvalidSerializableTransactionError,$ as InvalidSerializedTransactionError,he as InvalidSerializedTransactionTypeError,cs as InvalidSignatureError,us as InvalidStorageKeySizeError,ds as InvalidStructSignatureError,Ji as InvalidStructTypeError,dc as JsonRpcVersionUnsupportedError,mc as LimitExceededRpcError,ms as MaxFeePerGasTooLowError,lc as MethodNotFoundRpcError,fc as MethodNotSupportedRpcError,ls as NonceMaxValueError,fs as NonceTooHighError,hs as NonceTooLowError,hc as ParseRpcError,pc as ProviderDisconnectedError,yc as ProviderRpcError,ps as RawContractError,gc as ResourceNotFoundRpcError,bc as ResourceUnavailableRpcError,wc as RpcError,sa as RpcRequestError,ei as SizeExceedsPaddingSizeError,ai as SizeOverflowError,ni as SliceOffsetOutOfBoundsError,Q as SocketClosedError,ys as SolidityProtectedKeywordError,gs as StateAssignmentConflictError,xc as SwitchChainError,aa as TimeoutError,bs as TipAboveFeeCapError,ws as TransactionExecutionError,xs as TransactionNotFoundError,Es as TransactionReceiptNotFoundError,na as TransactionRejectedRpcError,Is as TransactionTypeNotSupportedError,Ec as UnauthorizedProviderError,Ic as UnknownBundleIdError,Ts as UnknownNodeError,Tc as UnknownRpcError,Cs as UnknownSignatureError,vs as UnknownTypeError,Cc as UnsupportedChainIdError,vc as UnsupportedNonOptionalCapabilityError,ri as UnsupportedPackedAbiType,Sc as UnsupportedProviderMethodError,Be as UrlRequiredError,ra as UserRejectedRequestError,Ss as WaitForCallsStatusTimeoutError,As as WaitForTransactionReceiptTimeoutError,It as WebSocketRequestError,qt as assertCurrentChain,Rt as assertRequest,pe as assertTransactionEIP1559,ye as assertTransactionEIP2930,xe as assertTransactionLegacy,Ps as blobsToCommitments,_s as blobsToProofs,si as boolToBytes,oi as boolToHex,ii as bytesToBigInt,ci as bytesToBool,G as bytesToHex,ui as bytesToNumber,Pc as bytesToRlp,di as bytesToString,Td as ccipFetch,Cd as ccipRequest,Ve as checksumAddress,ke as commitmentToVersionedHash,Rs as commitmentsToVersionedHashes,Cr as compactSignatureToHex,Er as compactSignatureToSignature,ze as concat,mi as concatBytes,li as concatHex,At as createClient,qs as createNonceManager,Fs as createPublicClient,dr as createTestClient,mt as createTransport,mr as createWalletClient,lr as custom,Mt as decodeAbiParameters,yr as decodeDeployData,Ni as decodeErrorResult,xd as decodeEventLog,Us as decodeFunctionData,Bs as decodeFunctionResult,Li as defineBlock,Mi as defineChain,kn as defineKzg,Di as defineTransaction,_d as defineTransactionReceipt,zi as defineTransactionRequest,ks as deploylessCallViaBytecodeBytecode,Ns as deploylessCallViaFactoryBytecode,Yi as domainSeparator,fi as encodeAbiParameters,Ce as encodeDeployData,Ls as encodeErrorResult,hi as encodeEventTopics,Xt as encodeFunctionData,Ms as encodeFunctionResult,Ds as encodePacked,zs as erc1155Abi,Gs as erc20Abi,$s as erc20Abi_bytes32,Hs as erc4626Abi,Os as erc6492SignatureValidatorAbi,js as erc6492SignatureValidatorByteCode,Ws as erc721Abi,Vs as ethAddress,Ie as etherUnits,tr as extractChain,fr as fallback,Gi as formatBlock,Ks as formatEther,Js as formatGwei,Rd as formatLog,$i as formatTransaction,qd as formatTransactionReceipt,ft as formatTransactionRequest,Ys as formatUnits,gr as fromBlobs,pi as fromBytes,yi as fromHex,Dt as fromRlp,gi as getAbiItem,B as getAddress,Qs as getChainContractAddress,Zn as getContract,Xn as getContractAddress,te as getContractError,da as getCreate2Address,ua as getCreateAddress,bi as getEventSelector,wi as getEventSignature,xi as getFunctionSelector,Ei as getFunctionSignature,Pa as getSerializedTransactionType,Zs as getTransactionType,Xe as getTypesForEIP712Domain,Te as gweiUnits,Qi as hashDomain,le as hashMessage,Zi as hashStruct,Ze as hashTypedData,A as hexToBigInt,Ii as hexToBool,H as hexToBytes,Ir as hexToCompactSignature,F as hexToNumber,_c as hexToRlp,Xs as hexToSignature,Ti as hexToString,to as http,Oe as isAddress,ht as isAddressEqual,Tt as isBytes,Ca as isErc6492Signature,va as isErc8010Signature,la as isHash,E as isHex,Y as keccak256,eo as labelhash,Rc as maxInt104,qc as maxInt112,Fc as maxInt120,Uc as maxInt128,Bc as maxInt136,kc as maxInt144,Nc as maxInt152,Lc as maxInt16,Mc as maxInt160,Dc as maxInt168,zc as maxInt176,Gc as maxInt184,$c as maxInt192,Hc as maxInt200,Oc as maxInt208,jc as maxInt216,Wc as maxInt224,Vc as maxInt232,Kc as maxInt24,Jc as maxInt240,Yc as maxInt248,Qc as maxInt256,Zc as maxInt32,Xc as maxInt40,tu as maxInt48,eu as maxInt56,au as maxInt64,nu as maxInt72,ru as maxInt8,su as maxInt80,ou as maxInt88,iu as maxInt96,cu as maxUint104,uu as maxUint112,du as maxUint120,mu as maxUint128,lu as maxUint136,fu as maxUint144,hu as maxUint152,pu as maxUint16,yu as maxUint160,gu as maxUint168,bu as maxUint176,wu as maxUint184,xu as maxUint192,Eu as maxUint200,Iu as maxUint208,Tu as maxUint216,Cu as maxUint224,vu as maxUint232,Su as maxUint24,Au as maxUint240,Pu as maxUint248,_u as maxUint256,Ru as maxUint32,qu as maxUint40,Fu as maxUint48,Uu as maxUint56,Bu as maxUint64,ku as maxUint72,Nu as maxUint8,Lu as maxUint80,Mu as maxUint88,Du as maxUint96,zu as minInt104,Gu as minInt112,$u as minInt120,Hu as minInt128,Ou as minInt136,ju as minInt144,Wu as minInt152,Vu as minInt16,Ku as minInt160,Ju as minInt168,Yu as minInt176,Qu as minInt184,Zu as minInt192,Xu as minInt200,td as minInt208,ed as minInt216,ad as minInt224,nd as minInt232,rd as minInt24,sd as minInt240,od as minInt248,id as minInt256,cd as minInt32,ud as minInt40,dd as minInt48,md as minInt56,ld as minInt64,fd as minInt72,hd as minInt8,pd as minInt80,yd as minInt88,gd as minInt96,ao as multicall3Abi,no as namehash,ro as nonceManager,Ci as numberToBytes,R as numberToHex,vd as offchainLookup,Sd as offchainLookupAbiItem,Ad as offchainLookupSignature,Me as pad,vi as padBytes,xt as padHex,so as parseAbi,oo as parseAbiItem,Qn as parseAbiParameter,io as parseAbiParameters,Ir as parseCompactSignature,ar as parseErc6492Signature,nr as parseErc8010Signature,cr as parseEther,Ed as parseEventLogs,ur as parseGwei,co as parseSignature,_a as parseTransaction,Wt as parseUnits,uo as prepareEncodeFunctionData,mo as presignMessagePrefix,lo as publicActions,Z as recoverAddress,Sa as recoverMessageAddress,fo as recoverPublicKey,Tr as recoverTransactionAddress,Aa as recoverTypedDataAddress,er as ripemd160,ho as rpcSchema,Hi as rpcTransactionType,po as serializeAccessList,Cr as serializeCompactSignature,yo as serializeErc6492Signature,rr as serializeErc8010Signature,go as serializeSignature,Le as serializeTransaction,ea as serializeTypedData,Si as setErrorConfig,xr as setupKzg,bd as sha256,Fn as shouldThrow,br as sidecarsToVersionedHashes,vr as signatureToCompactSignature,bo as signatureToHex,$e as size,De as slice,Ai as sliceBytes,Lt as sliceHex,Pi as stringToBytes,Je as stringToHex,Oi as stringify,hn as testActions,ge as toBlobSidecars,wo as toBlobs,k as toBytes,wr as toCoinType,_i as toEventHash,Ri as toEventSelector,qi as toEventSignature,Fi as toFunctionHash,Ui as toFunctionSelector,Bi as toFunctionSignature,Nt as toHex,xo as toPrefixedMessage,ia as toRlp,ji as transactionType,We as trim,Eo as universalSignatureValidatorAbi,Io as universalSignatureValidatorByteCode,ta as validateTypedData,sr as verifyHash,or as verifyMessage,ir as verifyTypedData,qn as walletActions,hr as webSocket,To as weiUnits,Co as withCache,vo as withRetry,Qe as withTimeout,So as zeroAddress,Ao as zeroHash};
2
+ import{p as gt,b as Yt,i as Qt,I as Zt,m as bt,s as ut,A as D,e as Xt,g as U,d as te,f as N,r as ee,h as ae,j as ne,k as re,w as se,n as oe,o as ie,q as ce,t as ue,v as de,u as me,x as Z,y as le,z as fe,B as he,C as $,D as pe,E as ye,F as ge,G as be,H as we,J as xe,K as Ee,L as Ie,M as Te,N as St,O as At,P as Ce,Q as Pt,R as _t,S as Rt,T as ve,U as dt,V as qt,W as Se,X as Ae,Y as Ft,Z as Pe,_ as Ut,$ as K,a0 as _e,a1 as Bt,a2 as Re,a3 as qe,a4 as mt,a5 as Fe,a6 as Ue,a7 as Be,a8 as ke,a9 as Ne,aa as kt,ab as Le}from"./parseSignature-d_qU1nsa.js";import{ac as Pr,ad as _r,ae as Rr,af as qr,ag as Fr,ah as Ur,ai as Br,aj as kr,ak as Nr,al as Lr,am as Mr,an as Dr,ao as zr,ap as Gr,aq as $r,ar as Hr,as as Or,at as jr,au as Wr,av as Vr,aw as Kr,ax as Jr,ay as Yr,az as Qr,aA as Zr,aB as Xr,aC as ts,aD as es,aE as as,aF as ns,aG as rs,aH as ss,aI as os,aJ as is,aK as cs,aL as us,aM as ds,aN as ms,aO as ls,aP as fs,aQ as hs,aR as ps,aS as ys,aT as gs,aU as bs,aV as ws,aW as xs,aX as Es,aY as Is,aZ as Ts,a_ as Cs,a$ as vs,b0 as Ss,b1 as As,b2 as Ps,b3 as _s,b4 as Rs,b5 as qs,b6 as Fs,b7 as Us,b8 as Bs,b9 as ks,ba as Ns,bb as Ls,bc as Ms,bd as Ds,be as zs,bf as Gs,bg as $s,bh as Hs,bi as Os,bj as js,bk as Ws,bl as Vs,bm as Ks,bn as Js,bo as Ys,bp as Qs,bq as Zs,br as Xs,bs as to,bt as eo,bu as ao,bv as no,bw as ro,bx as so,by as oo,bz as io,br as co,bA as uo,bB as mo,bC as lo,bD as fo,bE as ho,bF as po,bG as yo,bH as go,bH as bo,bI as wo,bJ as xo,bi as Eo,bj as Io,bK as To,bL as Co,bM as vo,bN as So,bO as Ao}from"./parseSignature-d_qU1nsa.js";import{R as k,b3 as B,S as Me,x as Y,a7 as De,w as ze,b4 as Ge,U as H,V as ct,W as G,B as lt,q as E,E as $e,a2 as He,b5 as j,a1 as wt,G as Nt,b6 as Lt,d as Mt,A as R,m as F,b7 as A,C as Oe,I as je,b8 as We,b9 as xt,y as Ve,ba as Ke,bb as Je,bc as Ye,bd as Et}from"./prepare-contract-call-DDzIRXLv.js";import{be as _o,O as Ro,a8 as qo,bf as Fo,bg as Uo,bh as Bo,bi as ko,bj as No,a9 as Lo,bk as Mo,J as Do,M as zo,bl as Go,bm as $o,bn as Ho,F as Oo,Q as jo,N as Wo,bo as Vo,bp as Ko,bq as Jo,br as Yo,bs as Qo,bt as Zo,bu as Xo,bv as ti,bw as ei,bx as ai,by as ni,bz as ri,bA as si,bB as oi,bC as ii,bD as ci,bE as ui,bF as di,bG as mi,bH as li,j as fi,bI as hi,bJ as pi,bK as yi,bL as gi,K as bi,bM as wi,t as xi,bM as Ei,bN as Ii,bO as Ti,bP as Ci,bQ as vi,bR as Si,bS as Ai,bT as Pi,bU as _i,K as Ri,bM as qi,bU as Fi,t as Ui,bM as Bi}from"./prepare-contract-call-DDzIRXLv.js";import{u as ft}from"./to-serializable-transaction-VMfkzTnh.js";import{b as Ni,B as Li,C as Mi,D as Di,E as zi,m as Gi,n as $i,F as Hi,s as Oi,a as ji}from"./to-serializable-transaction-VMfkzTnh.js";import{w as Qe,h as Ze,g as Xe,v as ta,s as ea}from"./hashTypedData-D6j6Ztal.js";import{I as Vi,a as Ki,b as Ji,d as Yi,c as Qi,e as Zi}from"./hashTypedData-D6j6Ztal.js";import{T as aa,a as Q,W as It,b as na,U as ra,R as sa}from"./rpc-B_5Ot3q6.js";import{A as tc,c as ec,B as ac,C as nc,D as rc,H as sc,I as oc,d as ic,e as cc,f as uc,J as dc,L as mc,M as lc,h as fc,P as hc,i as pc,j as yc,k as gc,l as bc,m as wc,S as xc,n as Ec,o as Ic,p as Tc,q as Cc,r as vc,s as Sc}from"./rpc-B_5Ot3q6.js";import{_ as oa}from"./index-uGopMLx_.js";import{t as ia,H as ca}from"./sha256-CfLwtdyC.js";import{b as Pc,h as _c,a as Rc,c as qc,d as Fc,e as Uc,f as Bc,g as kc,i as Nc,j as Lc,k as Mc,l as Dc,n as zc,o as Gc,p as $c,q as Hc,r as Oc,u as jc,v as Wc,w as Vc,x as Kc,y as Jc,z as Yc,A as Qc,B as Zc,C as Xc,D as tu,E as eu,F as au,G as nu,I as ru,J as su,K as ou,L as iu,M as cu,N as uu,O as du,P as mu,Q as lu,R as fu,S as hu,m as pu,T as yu,U as gu,V as bu,W as wu,X as xu,Y as Eu,Z as Iu,_ as Tu,$ as Cu,a0 as vu,a1 as Su,a2 as Au,a3 as Pu,a4 as _u,a5 as Ru,a6 as qu,a7 as Fu,a8 as Uu,a9 as Bu,aa as ku,ab as Nu,ac as Lu,ad as Mu,ae as Du,af as zu,ag as Gu,ah as $u,ai as Hu,aj as Ou,ak as ju,al as Wu,am as Vu,an as Ku,ao as Ju,ap as Yu,aq as Qu,ar as Zu,as as Xu,at as td,au as ed,av as ad,aw as nd,ax as rd,ay as sd,az as od,aA as id,aB as cd,aC as ud,aD as dd,aE as md,aF as ld,aG as fd,aH as hd,aI as pd,aJ as yd,aK as gd,s as bd}from"./sha256-CfLwtdyC.js";import{i as ht}from"./get-bytecode-BRKTQsHC.js";import{d as xd,a as Ed}from"./get-bytecode-BRKTQsHC.js";import{ccipRequest as Td,ccipRequest as Cd,offchainLookup as vd,offchainLookupAbiItem as Sd,offchainLookupSignature as Ad}from"./ccip-CrlybRWE.js";import{d as _d,a as Rd,f as qd}from"./transactionReceipt-BD6aaYgU.js";import"./utils-BQF5MiO5.js";import"./sentry-Dx-KuLV3.js";import"./react-BYHuwl8r.js";import"./transaction-Col-q-Ce.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-CFqPm_mN.js";import"./intl-CBcMB1D2.js";function Qn(t){let e;if(typeof t=="string")e=gt(t,{modifiers:bt});else{const a=Yt(t),n=t.length;for(let r=0;r<n;r++){const s=t[r];if(!Qt(s)){e=gt(s,{modifiers:bt,structs:a});break}}}if(!e)throw new Zt({param:t});return e}async function M(t,e){return M.internal(t,ut,"sendTransaction",e)}(function(t){async function e(a,n,r,s){const{abi:u,account:d=a.account,address:c,args:i,dataSuffix:f,functionName:l,...h}=s;if(typeof d>"u")throw new D({docsPath:"/docs/contract/writeContract"});const o=d?N(d):null,p=Xt({abi:u,args:i,functionName:l});try{return await U(a,n,r)({data:`${p}${f?f.replace("0x",""):""}`,to:c,account:o,...h})}catch(m){throw te(m,{abi:u,address:c,args:i,docsPath:"/docs/contract/writeContract",functionName:l,sender:o==null?void 0:o.address})}}t.internal=e})(M||(M={}));function Zn({abi:t,address:e,client:a}){const n=a,[r,s]=n?"public"in n&&"wallet"in n?[n.public,n.wallet]:"public"in n?[n.public,void 0]:"wallet"in n?[void 0,n.wallet]:[n,n]:[void 0,void 0],u=r!=null,d=s!=null,c={};let i=!1,f=!1,l=!1;for(const h of t)if(h.type==="function"?h.stateMutability==="view"||h.stateMutability==="pure"?i=!0:f=!0:h.type==="event"&&(l=!0),i&&f&&l)break;return u&&(i&&(c.read=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r,ee,"readContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),f&&(c.simulate=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r,ae,"simulateContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),l&&(c.createEventFilter=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,ne,"createContractEventFilter")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.getEvents=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,re,"getContractEvents")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.watchEvent=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,se,"watchContractEvent")({abi:t,address:e,eventName:o,args:y,...w})}}}))),d&&f&&(c.write=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(s,M,"writeContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),(u||d)&&f&&(c.estimateGas=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r??s,oe,"estimateContractGas")({abi:t,address:e,functionName:o,args:m,...y,account:y.account??s.account})}}})),c.address=e,c.abi=t,c}function W(t){const e=t.length&&Array.isArray(t[0]),a=e?t[0]:[],n=(e?t[1]:t[0])??{};return{args:a,options:n}}function rt(t,e){let a=!1;Array.isArray(t[0])?a=!0:t.length===1?a=e.inputs.some(s=>s.indexed):t.length===2&&(a=!0);const n=a?t[0]:void 0,r=(a?t[1]:t[0])??{};return{args:n,options:r}}function Tt(t){return!t||typeof t!="object"||!("BYTES_PER_ELEMENT"in t)?!1:t.BYTES_PER_ELEMENT===1&&t.constructor.name==="Uint8Array"}function Xn(t){return t.opcode==="CREATE2"?da(t):ua(t)}function ua(t){const e=k(B(t.from));let a=k(t.nonce);return a[0]===0&&(a=new Uint8Array([])),B(`0x${Y(ia([e,a],"bytes")).slice(26)}`)}function da(t){const e=k(B(t.from)),a=Me(Tt(t.salt)?t.salt:k(t.salt),{size:32}),n="bytecodeHash"in t?Tt(t.bytecodeHash)?t.bytecodeHash:k(t.bytecodeHash):Y(t.bytecode,"bytes");return B(De(Y(ze([k("0xff"),e,a,n])),12))}function tr({chains:t,id:e}){return t.find(a=>a.id===e)}function Dt(t,e="hex"){const a=(()=>{if(typeof t=="string"){if(t.length>3&&t.length%2!==0)throw new Ge(t);return H(t)}return t})(),n=ct(a,{recursiveReadLimit:Number.POSITIVE_INFINITY});return zt(n,e)}function zt(t,e="hex"){if(t.bytes.length===0)return e==="hex"?G(t.bytes):t.bytes;const a=t.readByte();if(a<128&&t.decrementPosition(1),a<192){const r=Ct(t,a,128),s=t.readBytes(r);return e==="hex"?G(s):s}const n=Ct(t,a,192);return ma(t,n,e)}function Ct(t,e,a){if(a===128&&e<128)return 1;if(e<=a+55)return e-a;if(e===a+55+1)return t.readUint8();if(e===a+55+2)return t.readUint16();if(e===a+55+3)return t.readUint24();if(e===a+55+4)return t.readUint32();throw new lt("Invalid RLP prefix")}function ma(t,e,a){const n=t.position,r=[];for(;t.position-n<e;)r.push(zt(t,a));return r}function la(t){return E(t)&&$e(t)===32}const fa=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Gt=Uint8Array.from(new Array(16).fill(0).map((t,e)=>e)),ha=Gt.map(t=>(9*t+5)%16),$t=(()=>{const a=[[Gt],[ha]];for(let n=0;n<4;n++)for(let r of a)r.push(r[n].map(s=>fa[s]));return a})(),Ht=$t[0],Ot=$t[1],jt=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>Uint8Array.from(t)),pa=Ht.map((t,e)=>t.map(a=>jt[e][a])),ya=Ot.map((t,e)=>t.map(a=>jt[e][a])),ga=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),ba=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function vt(t,e,a,n){return t===0?e^a^n:t===1?e&a|~e&n:t===2?(e|~a)^n:t===3?e&n|a&~n:e^(a|~n)}const V=new Uint32Array(16);class wa extends ca{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:a,h2:n,h3:r,h4:s}=this;return[e,a,n,r,s]}set(e,a,n,r,s){this.h0=e|0,this.h1=a|0,this.h2=n|0,this.h3=r|0,this.h4=s|0}process(e,a){for(let o=0;o<16;o++,a+=4)V[o]=e.getUint32(a,!0);let n=this.h0|0,r=n,s=this.h1|0,u=s,d=this.h2|0,c=d,i=this.h3|0,f=i,l=this.h4|0,h=l;for(let o=0;o<5;o++){const p=4-o,m=ga[o],y=ba[o],w=Ht[o],g=Ot[o],C=pa[o],b=ya[o];for(let x=0;x<16;x++){const I=j(n+vt(o,s,d,i)+V[w[x]]+m,C[x])+l|0;n=l,l=i,i=j(d,10)|0,d=s,s=I}for(let x=0;x<16;x++){const I=j(r+vt(p,u,c,f)+V[g[x]]+y,b[x])+h|0;r=h,h=f,f=j(c,10)|0,c=u,u=I}}this.set(this.h1+d+f|0,this.h2+i+h|0,this.h3+l+r|0,this.h4+n+u|0,this.h0+s+c|0)}roundClean(){wt(V)}destroy(){this.destroyed=!0,wt(this.buffer),this.set(0,0,0,0,0)}}const xa=He(()=>new wa),Ea=xa;function er(t,e){const a=e||"hex",n=Ea(E(t,{strict:!1})?k(t):t);return a==="bytes"?n:Nt(n)}const st=new Map;async function Ia(t){const{getSocket:e,keepAlive:a=!0,key:n="socket",reconnect:r=!0,url:s}=t,{interval:u=3e4}=typeof a=="object"?a:{},{attempts:d=5,delay:c=2e3}=typeof r=="object"?r:{},i=JSON.stringify({keepAlive:a,key:n,url:s,reconnect:r});let f=st.get(i);if(f)return f;let l=0;const{schedule:h}=ie({id:i,fn:async()=>{const m=new Map,y=new Map;let w,g,C,b=!1;function x(){if(r&&l<d){if(b)return;b=!0,l++,g==null||g.close(),setTimeout(async()=>{await I().catch(console.error),b=!1},c)}else m.clear(),y.clear()}async function I(){const T=await e({onClose(){var v,P;for(const S of m.values())(v=S.onError)==null||v.call(S,new Q({url:s}));for(const S of y.values())(P=S.onError)==null||P.call(S,new Q({url:s}));x()},onError(v){var P,S;w=v;for(const _ of m.values())(P=_.onError)==null||P.call(_,w);for(const _ of y.values())(S=_.onError)==null||S.call(_,w);x()},onOpen(){w=void 0,l=0},onResponse(v){const P=v.method==="eth_subscription",S=P?v.params.subscription:v.id,_=P?y:m,q=_.get(S);q&&q.onResponse(v),P||_.delete(S)}});if(g=T,a&&(C&&clearInterval(C),C=setInterval(()=>{var v;return(v=g.ping)==null?void 0:v.call(g)},u)),r&&y.size>0){const v=y.entries();for(const[P,{onResponse:S,body:_,onError:q}]of v)_&&(y.delete(P),f==null||f.request({body:_,onResponse:S,onError:q}))}return T}return await I(),w=void 0,f={close(){C&&clearInterval(C),g.close(),st.delete(i)},get socket(){return g},request({body:T,onError:v,onResponse:P}){w&&v&&v(w);const S=T.id??ce.take(),_=q=>{var z;typeof q.id=="number"&&S!==q.id||(T.method==="eth_subscribe"&&typeof q.result=="string"&&y.set(q.result,{onResponse:_,onError:v,body:T}),T.method==="eth_unsubscribe"&&y.delete((z=T.params)==null?void 0:z[0]),P(q))};m.set(S,{onResponse:_,onError:v});try{g.request({body:{jsonrpc:"2.0",id:S,...T}})}catch(q){v==null||v(q)}},requestAsync({body:T,timeout:v=1e4}){return Qe(()=>new Promise((P,S)=>this.request({body:T,onError:S,onResponse:P})),{errorInstance:new aa({body:T,url:s}),timeout:v})},requests:m,subscriptions:y,url:s},st.set(i,f),[f]}}),[o,[p]]=await h();return p}async function J(t,e={}){const{keepAlive:a,reconnect:n}=e;return Ia({async getSocket({onClose:r,onError:s,onOpen:u,onResponse:d}){const c=await oa(()=>import("./native-CPZ4GKee.js").then(o=>o.n),__vite__mapDeps([0,1,2])).then(o=>o.WebSocket),i=new c(t);function f(){i.removeEventListener("close",f),i.removeEventListener("message",l),i.removeEventListener("error",s),i.removeEventListener("open",u),r()}function l({data:o}){if(!(typeof o=="string"&&o.trim().length===0))try{const p=JSON.parse(o);d(p)}catch(p){s(p)}}i.addEventListener("close",f),i.addEventListener("message",l),i.addEventListener("error",s),i.addEventListener("open",u),i.readyState===c.CONNECTING&&await new Promise((o,p)=>{i&&(i.onopen=o,i.onerror=p)});const{close:h}=i;return Object.assign(i,{close(){h.bind(i)(),f()},ping(){try{if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({url:i.url,cause:new Q({url:i.url})});const o={jsonrpc:"2.0",id:null,method:"net_version",params:[]};i.send(JSON.stringify(o))}catch(o){s(o)}},request({body:o}){if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({body:o,url:i.url,cause:new Q({url:i.url})});return i.send(JSON.stringify(o))}})},keepAlive:a,reconnect:n,url:t})}async function Ta(t){const e=await J(t);return Object.assign(e.socket,{requests:e.requests,subscriptions:e.subscriptions})}function Ca(t){return Lt(t,-32)===ue}function va(t){return de(t)}function ar(t){if(!Ca(t))return{signature:t};const[e,a,n]=Mt([{type:"address"},{type:"bytes"},{type:"bytes"}],t);return{address:e,data:a,signature:n}}function nr(t){if(!va(t))return{signature:t};const{authorization:e,to:a,...n}=me(t);return{authorization:{address:e.address,chainId:e.chainId,nonce:Number(e.nonce),r:R(e.r,{size:32}),s:R(e.s,{size:32}),yParity:e.yParity},...a?{address:a}:{},...n}}async function Sa({message:t,signature:e}){return Z({hash:le(t),signature:e})}async function Aa(t){const{domain:e,message:a,primaryType:n,signature:r,types:s}=t;return Z({hash:Ze({domain:e,message:a,primaryType:n,types:s}),signature:r})}function rr(t){const{address:e,data:a,signature:n,to:r="hex"}=t,s=fe({authorization:{address:t.authorization.address,chainId:t.authorization.chainId,nonce:BigInt(t.authorization.nonce),r:BigInt(t.authorization.r),s:BigInt(t.authorization.s),yParity:t.authorization.yParity},data:a,signature:n,to:e});return r==="hex"?s:H(s)}async function sr({address:t,hash:e,signature:a}){return ht(B(t),await Z({hash:e,signature:a}))}async function or({address:t,message:e,signature:a}){return ht(B(t),await Sa({message:e,signature:a}))}async function ir(t){const{address:e,domain:a,message:n,primaryType:r,signature:s,types:u}=t;return ht(B(e),await Aa({domain:a,message:n,primaryType:r,signature:s,types:u}))}function Pa(t){const e=Lt(t,0,1);if(e==="0x04")return"eip7702";if(e==="0x03")return"eip4844";if(e==="0x02")return"eip1559";if(e==="0x01")return"eip2930";if(e!=="0x"&&F(e)>=192)return"legacy";throw new he({serializedType:e})}function _a(t){const e=Pa(t);return e==="eip1559"?Fa(t):e==="eip2930"?Ua(t):e==="eip4844"?qa(t):e==="eip7702"?Ra(t):Ba(t)}function Ra(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h,o,p]=e;if(e.length!==10&&e.length!==13)throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,authorizationList:l,...e.length>9?{v:h,r:o,s:p}:{}},serializedTransaction:t,type:"eip7702"});const m={chainId:F(a),type:"eip7702"};return E(d)&&d!=="0x"&&(m.to=d),E(u)&&u!=="0x"&&(m.gas=A(u)),E(i)&&i!=="0x"&&(m.data=i),E(n)&&(m.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(m.value=A(c)),E(s)&&s!=="0x"&&(m.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(m.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(m.accessList=tt(f)),l.length!==0&&l!=="0x"&&(m.authorizationList=ka(l)),we(m),{...e.length===13?O(e):void 0,...m}}function qa(t){const e=X(t),a=e.length===4,n=a?e[0]:e,r=a?e.slice(1):[],[s,u,d,c,i,f,l,h,o,p,m,y,w,g]=n,[C,b,x]=r;if(!(n.length===11||n.length===14))throw new $({attributes:{chainId:s,nonce:u,maxPriorityFeePerGas:d,maxFeePerGas:c,gas:i,to:f,value:l,data:h,accessList:o,...n.length>9?{v:y,r:w,s:g}:{}},serializedTransaction:t,type:"eip4844"});const I={blobVersionedHashes:m,chainId:F(s),to:f,type:"eip4844"};return E(i)&&i!=="0x"&&(I.gas=A(i)),E(h)&&h!=="0x"&&(I.data=h),E(u)&&(I.nonce=u==="0x"?0:F(u)),E(l)&&l!=="0x"&&(I.value=A(l)),E(p)&&p!=="0x"&&(I.maxFeePerBlobGas=A(p)),E(c)&&c!=="0x"&&(I.maxFeePerGas=A(c)),E(d)&&d!=="0x"&&(I.maxPriorityFeePerGas=A(d)),o.length!==0&&o!=="0x"&&(I.accessList=tt(o)),C&&b&&x&&(I.sidecars=ge({blobs:C,commitments:b,proofs:x})),be(I),{...n.length===14?O(n):void 0,...I}}function Fa(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h,o]=e;if(!(e.length===9||e.length===12))throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,...e.length>9?{v:l,r:h,s:o}:{}},serializedTransaction:t,type:"eip1559"});const p={chainId:F(a),type:"eip1559"};return E(d)&&d!=="0x"&&(p.to=d),E(u)&&u!=="0x"&&(p.gas=A(u)),E(i)&&i!=="0x"&&(p.data=i),E(n)&&(p.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(p.value=A(c)),E(s)&&s!=="0x"&&(p.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(p.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(p.accessList=tt(f)),pe(p),{...e.length===12?O(e):void 0,...p}}function Ua(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h]=e;if(!(e.length===8||e.length===11))throw new $({attributes:{chainId:a,nonce:n,gasPrice:r,gas:s,to:u,value:d,data:c,accessList:i,...e.length>8?{v:f,r:l,s:h}:{}},serializedTransaction:t,type:"eip2930"});const o={chainId:F(a),type:"eip2930"};return E(u)&&u!=="0x"&&(o.to=u),E(s)&&s!=="0x"&&(o.gas=A(s)),E(c)&&c!=="0x"&&(o.data=c),E(n)&&(o.nonce=n==="0x"?0:F(n)),E(d)&&d!=="0x"&&(o.value=A(d)),E(r)&&r!=="0x"&&(o.gasPrice=A(r)),i.length!==0&&i!=="0x"&&(o.accessList=tt(i)),ye(o),{...e.length===11?O(e):void 0,...o}}function Ba(t){const e=Dt(t,"hex"),[a,n,r,s,u,d,c,i,f]=e;if(!(e.length===6||e.length===9))throw new $({attributes:{nonce:a,gasPrice:n,gas:r,to:s,value:u,data:d,...e.length>6?{v:c,r:i,s:f}:{}},serializedTransaction:t,type:"legacy"});const l={type:"legacy"};if(E(s)&&s!=="0x"&&(l.to=s),E(r)&&r!=="0x"&&(l.gas=A(r)),E(d)&&d!=="0x"&&(l.data=d),E(a)&&(l.nonce=a==="0x"?0:F(a)),E(u)&&u!=="0x"&&(l.value=A(u)),E(n)&&n!=="0x"&&(l.gasPrice=A(n)),xe(l),e.length===6)return l;const h=E(c)&&c!=="0x"?A(c):0n;if(f==="0x"&&i==="0x")return h>0&&(l.chainId=Number(h)),l;const o=h,p=Number((o-35n)/2n);if(p>0)l.chainId=p;else if(o!==27n&&o!==28n)throw new Ee({v:o});return l.v=o,l.s=f,l.r=i,l.yParity=o%2n===0n?1:0,l}function X(t){return Dt(`0x${t.slice(4)}`,"hex")}function tt(t){const e=[];for(let a=0;a<t.length;a++){const[n,r]=t[a];if(!Oe(n,{strict:!1}))throw new je({address:n});e.push({address:n,storageKeys:r.map(s=>la(s)?s:We(s))})}return e}function ka(t){const e=[];for(let a=0;a<t.length;a++){const[n,r,s,u,d,c]=t[a];e.push({address:r,chainId:n==="0x"?0:F(n),nonce:s==="0x"?0:F(s),...O([u,d,c])})}return e}function O(t){const e=t.slice(-3),a=e[0]==="0x"||A(e[0])===0n?27n:28n;return{r:xt(e[1],{size:32}),s:xt(e[2],{size:32}),v:a,yParity:a===27n?0:1}}class Na extends lt{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function Wt(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new Na({value:t});let[a,n="0"]=t.split(".");const r=a.startsWith("-");if(r&&(a=a.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(a=`${BigInt(a)+1n}`),n="";else if(n.length>e){const[s,u,d]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],c=Math.round(+`${u}.${d}`);c>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${c}`,n.length>e&&(n=n.slice(1),a=`${BigInt(a)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${r?"-":""}${a}${n}`)}function cr(t,e="wei"){return Wt(t,Ie[e])}function ur(t,e="wei"){return Wt(t,Te[e])}async function La(t,{hash:e}){await t.request({method:`${t.mode}_dropTransaction`,params:[e]})}async function Ma(t){return t.request({method:`${t.mode}_dumpState`})}async function Da(t){return t.mode==="ganache"?await t.request({method:"eth_mining"}):await t.request({method:`${t.mode}_getAutomine`})}async function za(t){return await t.request({method:"txpool_content"})}async function Ga(t){const{pending:e,queued:a}=await t.request({method:"txpool_status"});return{pending:F(e),queued:F(a)}}async function $a(t,{address:e}){await t.request({method:`${t.mode}_impersonateAccount`,params:[e]})}async function Ha(t,{seconds:e}){return await t.request({method:"evm_increaseTime",params:[R(e)]})}async function Oa(t){return await t.request({method:"txpool_inspect"})}async function ja(t,{state:e}){await t.request({method:`${t.mode}_loadState`,params:[e]})}async function Wa(t,{blocks:e,interval:a}){t.mode==="ganache"?await t.request({method:"evm_mine",params:[{blocks:R(e)}]}):await t.request({method:`${t.mode}_mine`,params:[R(e),R(a||0)]})}async function Va(t){await t.request({method:`${t.mode}_removeBlockTimestampInterval`})}async function Ka(t,{blockNumber:e,jsonRpcUrl:a}={}){await t.request({method:`${t.mode}_reset`,params:[{forking:{blockNumber:Number(e),jsonRpcUrl:a}}]})}async function Ja(t,{id:e}){await t.request({method:"evm_revert",params:[e]})}async function Ya(t,e){var w,g,C;const{accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:l,...h}=e,o=(C=(g=(w=t.chain)==null?void 0:w.formatters)==null?void 0:g.transactionRequest)==null?void 0:C.format,m=(o||ft)({...St(h,{format:o}),accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:l},"sendUnsignedTransaction");return await t.request({method:"eth_sendUnsignedTransaction",params:[m]})}async function Qa(t,e){t.mode==="ganache"?e?await t.request({method:"miner_start"}):await t.request({method:"miner_stop"}):await t.request({method:"evm_setAutomine",params:[e]})}async function Za(t,{address:e,value:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountBalance",params:[e,R(a)]}):await t.request({method:`${t.mode}_setBalance`,params:[e,R(a)]})}async function Xa(t,{gasLimit:e}){await t.request({method:"evm_setBlockGasLimit",params:[R(e)]})}async function tn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:`${t.mode}_setBlockTimestampInterval`,params:[a]})}async function en(t,{address:e,bytecode:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountCode",params:[e,a]}):await t.request({method:`${t.mode}_setCode`,params:[e,a]})}async function an(t,{address:e}){await t.request({method:`${t.mode}_setCoinbase`,params:[e]})}async function nn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:"evm_setIntervalMining",params:[a]})}async function rn(t,e){await t.request({method:`${t.mode}_setLoggingEnabled`,params:[e]})}async function sn(t,{gasPrice:e}){await t.request({method:`${t.mode}_setMinGasPrice`,params:[R(e)]})}async function on(t,{baseFeePerGas:e}){await t.request({method:`${t.mode}_setNextBlockBaseFeePerGas`,params:[R(e)]})}async function cn(t,{timestamp:e}){await t.request({method:"evm_setNextBlockTimestamp",params:[R(e)]})}async function un(t,{address:e,nonce:a}){await t.request({method:`${t.mode}_setNonce`,params:[e,R(a)]})}async function dn(t,e){await t.request({method:`${t.mode}_setRpcUrl`,params:[e]})}async function mn(t,{address:e,index:a,value:n}){await t.request({method:`${t.mode}_setStorageAt`,params:[e,typeof a=="number"?R(a):a,n]})}async function ln(t){return await t.request({method:"evm_snapshot"})}async function fn(t,{address:e}){await t.request({method:`${t.mode}_stopImpersonatingAccount`,params:[e]})}function hn({mode:t}){return e=>{const a=e.extend(()=>({mode:t}));return{dropTransaction:n=>La(a,n),dumpState:()=>Ma(a),getAutomine:()=>Da(a),getTxpoolContent:()=>za(a),getTxpoolStatus:()=>Ga(a),impersonateAccount:n=>$a(a,n),increaseTime:n=>Ha(a,n),inspectTxpool:()=>Oa(a),loadState:n=>ja(a,n),mine:n=>Wa(a,n),removeBlockTimestampInterval:()=>Va(a),reset:n=>Ka(a,n),revert:n=>Ja(a,n),sendUnsignedTransaction:n=>Ya(a,n),setAutomine:n=>Qa(a,n),setBalance:n=>Za(a,n),setBlockGasLimit:n=>Xa(a,n),setBlockTimestampInterval:n=>tn(a,n),setCode:n=>en(a,n),setCoinbase:n=>an(a,n),setIntervalMining:n=>nn(a,n),setLoggingEnabled:n=>rn(a,n),setMinGasPrice:n=>sn(a,n),setNextBlockBaseFeePerGas:n=>on(a,n),setNextBlockTimestamp:n=>cn(a,n),setNonce:n=>un(a,n),setRpcUrl:n=>dn(a,n),setStorageAt:n=>mn(a,n),snapshot:()=>ln(a),stopImpersonatingAccount:n=>fn(a,n)}}}function dr(t){const{key:e="test",name:a="Test Client",mode:n}=t;return At({...t,key:e,name:a,type:"testClient"}).extend(s=>({mode:n,...hn({mode:n})(s)}))}async function pn(t,{chain:e}){const{id:a,name:n,nativeCurrency:r,rpcUrls:s,blockExplorers:u}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:R(a),chainName:n,nativeCurrency:r,rpcUrls:s.default.http,blockExplorerUrls:u?Object.values(u).map(({url:d})=>d):void 0}]},{dedupe:!0,retryCount:0})}function yn(t,e){const{abi:a,args:n,bytecode:r,...s}=e,u=Ce({abi:a,args:n,bytecode:r});return ut(t,{...s,...s.authorizationList?{to:null}:{},data:u})}async function gn(t){var a;return((a=t.account)==null?void 0:a.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(n=>Ve(n))}async function bn(t,e={}){const{account:a=t.account,chainId:n}=e,r=a?N(a):void 0,s=n?[r==null?void 0:r.address,[R(n)]]:[r==null?void 0:r.address],u=await t.request({method:"wallet_getCapabilities",params:s}),d={};for(const[c,i]of Object.entries(u)){d[Number(c)]={};for(let[f,l]of Object.entries(i))f==="addSubAccount"&&(f="unstable_addSubAccount"),d[Number(c)][f]=l}return typeof n=="number"?d[n]:d}async function wn(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function xn(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(a=>B(a))}async function En(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function In(t,e){const{chain:a=t.chain}=e,n=e.timeout??Math.max(((a==null?void 0:a.blockTime)??0)*3,5e3),r=await Pt(t,e);return await _t(t,{...e,id:r.id,timeout:n})}const ot=new Ke(128);async function Vt(t,e){var x,I,T,v;const{account:a=t.account,chain:n=t.chain,accessList:r,authorizationList:s,blobs:u,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,pollingInterval:p,throwOnReceiptRevert:m,type:y,value:w,...g}=e,C=e.timeout??Math.max(((n==null?void 0:n.blockTime)??0)*3,5e3);if(typeof a>"u")throw new D({docsPath:"/docs/actions/wallet/sendTransactionSync"});const b=a?N(a):null;try{Rt(e);const P=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await ve({authorization:s[0]}).catch(()=>{throw new lt("`to` is required. Could not infer from `authorizationList`.")})})();if((b==null?void 0:b.type)==="json-rpc"||b===null){let S;n!==null&&(S=await U(t,dt,"getChainId")({}),qt({currentChainId:S,chain:n}));const _=(T=(I=(x=t.chain)==null?void 0:x.formatters)==null?void 0:I.transactionRequest)==null?void 0:T.format,z=(_||ft)({...St(g,{format:_}),accessList:r,account:b,authorizationList:s,blobs:u,chainId:S,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,to:P,type:y,value:w},"sendTransaction"),pt=ot.get(t.uid),Kt=pt?"wallet_sendTransaction":"eth_sendTransaction",Jt=await(async()=>{try{return await t.request({method:Kt,params:[z]},{retryCount:0})}catch(yt){if(pt===!1)throw yt;const L=yt;if(L.name==="InvalidInputRpcError"||L.name==="InvalidParamsRpcError"||L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[z]},{retryCount:0}).then(at=>(ot.set(t.uid,!0),at)).catch(at=>{const nt=at;throw nt.name==="MethodNotFoundRpcError"||nt.name==="MethodNotSupportedRpcError"?(ot.set(t.uid,!1),L):nt});throw L}})(),et=await U(t,Se,"waitForTransactionReceipt")({checkReplacement:!1,hash:Jt,pollingInterval:p,timeout:C});if(m&&et.status==="reverted")throw new Ae({receipt:et});return et}if((b==null?void 0:b.type)==="local"){const S=await U(t,Ft,"prepareTransactionRequest")({account:b,accessList:r,authorizationList:s,blobs:u,chain:n,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,nonceManager:b.nonceManager,parameters:[...Pe,"sidecars"],type:y,value:w,...g,to:P}),_=(v=n==null?void 0:n.serializers)==null?void 0:v.transaction,q=await b.signTransaction(S,{serializer:_});return await U(t,Ut,"sendRawTransactionSync")({serializedTransaction:q,throwOnReceiptRevert:m})}throw(b==null?void 0:b.type)==="smart"?new K({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new K({docsPath:"/docs/actions/wallet/sendTransactionSync",type:b==null?void 0:b.type})}catch(P){throw P instanceof K?P:_e(P,{...e,account:b,chain:e.chain||void 0})}}async function Tn(t,e){const{id:a}=e;await t.request({method:"wallet_showCallsStatus",params:[a]})}async function Cn(t,e){const{account:a=t.account}=e;if(!a)throw new D({docsPath:"/docs/eip7702/signAuthorization"});const n=N(a);if(!n.signAuthorization)throw new K({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const r=await Bt(t,e);return n.signAuthorization(r)}async function vn(t,{account:e=t.account,message:a}){if(!e)throw new D({docsPath:"/docs/actions/wallet/signMessage"});const n=N(e);if(n.signMessage)return n.signMessage({message:a});const r=typeof a=="string"?Je(a):a.raw instanceof Uint8Array?Nt(a.raw):a.raw;return t.request({method:"personal_sign",params:[r,n.address]},{retryCount:0})}async function Sn(t,e){var i,f,l,h;const{account:a=t.account,chain:n=t.chain,...r}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTransaction"});const s=N(a);Rt({account:s,...e});const u=await U(t,dt,"getChainId")({});n!==null&&qt({currentChainId:u,chain:n});const d=(n==null?void 0:n.formatters)||((i=t.chain)==null?void 0:i.formatters),c=((f=d==null?void 0:d.transactionRequest)==null?void 0:f.format)||ft;return s.signTransaction?s.signTransaction({...r,chainId:u},{serializer:(h=(l=t.chain)==null?void 0:l.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...c({...r,account:s},"signTransaction"),chainId:R(u),from:s.address}]},{retryCount:0})}async function An(t,e){const{account:a=t.account,domain:n,message:r,primaryType:s}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTypedData"});const u=N(a),d={EIP712Domain:Xe({domain:n}),...e.types};if(ta({domain:n,message:r,primaryType:s,types:d}),u.signTypedData)return u.signTypedData({domain:n,message:r,primaryType:s,types:d});const c=ea({domain:n,message:r,primaryType:s,types:d});return t.request({method:"eth_signTypedData_v4",params:[u.address,c]},{retryCount:0})}async function Pn(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:R(e)}]},{retryCount:0})}async function _n(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}async function Rn(t,e){return M.internal(t,Vt,"sendTransactionSync",e)}function qn(t){return{addChain:e=>pn(t,e),deployContract:e=>yn(t,e),getAddresses:()=>gn(t),getCallsStatus:e=>qe(t,e),getCapabilities:e=>bn(t,e),getChainId:()=>dt(t),getPermissions:()=>wn(t),prepareAuthorization:e=>Bt(t,e),prepareTransactionRequest:e=>Ft(t,e),requestAddresses:()=>xn(t),requestPermissions:e=>En(t,e),sendCalls:e=>Pt(t,e),sendCallsSync:e=>In(t,e),sendRawTransaction:e=>Re(t,e),sendRawTransactionSync:e=>Ut(t,e),sendTransaction:e=>ut(t,e),sendTransactionSync:e=>Vt(t,e),showCallsStatus:e=>Tn(t,e),signAuthorization:e=>Cn(t,e),signMessage:e=>vn(t,e),signTransaction:e=>Sn(t,e),signTypedData:e=>An(t,e),switchChain:e=>Pn(t,e),waitForCallsStatus:e=>_t(t,e),watchAsset:e=>_n(t,e),writeContract:e=>M(t,e),writeContractSync:e=>Rn(t,e)}}function mr(t){const{key:e="wallet",name:a="Wallet Client",transport:n}=t;return At({...t,key:e,name:a,transport:n,type:"walletClient"}).extend(qn)}function lr(t,e={}){const{key:a="custom",methods:n,name:r="Custom Provider",retryDelay:s}=e;return({retryCount:u})=>mt({key:a,methods:n,name:r,request:t.request.bind(t),retryCount:e.retryCount??u,retryDelay:s,type:"custom"})}function fr(t,e={}){const{key:a="fallback",name:n="Fallback",rank:r=!1,shouldThrow:s=Fn,retryCount:u,retryDelay:d}=e;return(({chain:c,pollingInterval:i=4e3,timeout:f,...l})=>{let h=t,o=()=>{};const p=mt({key:a,name:n,async request({method:m,params:y}){let w;const g=async(C=0)=>{const b=h[C]({...l,chain:c,retryCount:0,timeout:f});try{const x=await b.request({method:m,params:y});return o({method:m,params:y,response:x,transport:b,status:"success"}),x}catch(x){if(o({error:x,method:m,params:y,transport:b,status:"error"}),s(x)||C===h.length-1||(w??(w=h.slice(C+1).some(I=>{const{include:T,exclude:v}=I({chain:c}).config.methods||{};return T?T.includes(m):v?!v.includes(m):!0})),!w))throw x;return g(C+1)}};return g()},retryCount:u,retryDelay:d,type:"fallback"},{onResponse:m=>o=m,transports:h.map(m=>m({chain:c,retryCount:0}))});if(r){const m=typeof r=="object"?r:{};Un({chain:c,interval:m.interval??i,onTransports:y=>h=y,ping:m.ping,sampleCount:m.sampleCount,timeout:m.timeout,transports:h,weights:m.weights})}return p})}function Fn(t){return!!("code"in t&&typeof t.code=="number"&&(t.code===na.code||t.code===ra.code||Fe.nodeMessage.test(t.message)||t.code===5e3))}function Un({chain:t,interval:e=4e3,onTransports:a,ping:n,sampleCount:r=10,timeout:s=1e3,transports:u,weights:d={}}){const{stability:c=.7,latency:i=.3}=d,f=[],l=async()=>{const h=await Promise.all(u.map(async m=>{const y=m({chain:t,retryCount:0,timeout:s}),w=Date.now();let g,C;try{await(n?n({transport:y}):y.request({method:"net_listening"})),C=1}catch{C=0}finally{g=Date.now()}return{latency:g-w,success:C}}));f.push(h),f.length>r&&f.shift();const o=Math.max(...f.map(m=>Math.max(...m.map(({latency:y})=>y)))),p=u.map((m,y)=>{const w=f.map(I=>I[y].latency),C=1-w.reduce((I,T)=>I+T,0)/w.length/o,b=f.map(I=>I[y].success),x=b.reduce((I,T)=>I+T,0)/b.length;return x===0?[0,y]:[i*C+c*x,y]}).sort((m,y)=>y[0]-m[0]);a(p.map(([,m])=>u[m])),await Ue(e),l()};l()}function hr(t,e={}){const{keepAlive:a,key:n="webSocket",methods:r,name:s="WebSocket JSON-RPC",reconnect:u,retryDelay:d}=e;return({chain:c,retryCount:i,timeout:f})=>{var m;const l=e.retryCount??i,h=f??e.timeout??1e4,o=t||((m=c==null?void 0:c.rpcUrls.default.webSocket)==null?void 0:m[0]),p={keepAlive:a,reconnect:u};if(!o)throw new Be;return mt({key:n,methods:r,name:s,async request({method:y,params:w}){const g={method:y,params:w},C=await J(o,p),{error:b,result:x}=await C.requestAsync({body:g,timeout:h});if(b)throw new sa({body:g,error:b,url:o});return x},retryCount:l,retryDelay:d,timeout:h,type:"webSocket"},{getSocket(){return Ta(o)},getRpcClient(){return J(o,p)},async subscribe({params:y,onData:w,onError:g}){const C=await J(o,p),{result:b}=await new Promise((x,I)=>C.request({body:{method:"eth_subscribe",params:y},onError(T){I(T),g==null||g(T)},onResponse(T){if(T.error){I(T.error),g==null||g(T.error);return}if(typeof T.id=="number"){x(T);return}T.method==="eth_subscription"&&w(T.params)}}));return{subscriptionId:b,async unsubscribe(){return new Promise(x=>C.request({body:{method:"eth_unsubscribe",params:[b]},onResponse:x}))}}}})}}class pr extends Error{constructor(e,a){super(a),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e,this.details=a}}const it="/docs/contract/decodeDeployData";function yr(t){const{abi:e,bytecode:a,data:n}=t;if(n===a)return{bytecode:a};const r=e.find(u=>"type"in u&&u.type==="constructor");if(!r)throw new Ye({docsPath:it});if(!("inputs"in r))throw new Et({docsPath:it});if(!r.inputs||r.inputs.length===0)throw new Et({docsPath:it});return{args:Mt(r.inputs,`0x${n.replace(a,"")}`),bytecode:a}}function gr(t){const e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),a=typeof t.blobs[0]=="string"?t.blobs.map(d=>H(d)):t.blobs,n=a.reduce((d,c)=>d+c.length,0),r=ct(new Uint8Array(n));let s=!0;for(const d of a){const c=ct(d);for(;s&&c.position<d.length;){c.incrementPosition(1);let i=31;d.length-c.position<31&&(i=d.length-c.position);for(const f in Array.from({length:i})){const l=c.readByte();if(l===128&&!c.inspectBytes(c.remaining).includes(128)){s=!1;break}r.pushByte(l)}}}const u=r.bytes.slice(0,r.position);return e==="hex"?G(u):u}function br(t){const{sidecars:e,version:a}=t,n=t.to??(typeof e[0].blob=="string"?"hex":"bytes"),r=[];for(const{commitment:s}of e)r.push(ke({commitment:s,to:n,version:a}));return r}const Bn=2147483648;function wr(t){if(t===1)return 60n;if(t>=Bn||t<0)throw new Ne({chainId:t});return BigInt((2147483648|t)>>>0)}function kn({blobToKzgCommitment:t,computeBlobKzgProof:e}){return{blobToKzgCommitment:t,computeBlobKzgProof:e}}function xr(t,e){try{t.loadTrustedSetup(e)}catch(a){const n=a;if(!n.message.includes("trusted setup is already loaded"))throw n}return kn(t)}function Er({r:t,yParityAndS:e}){const a=H(e),n=a[0]&128?1:0,r=a;return n===1&&(r[0]&=127),{r:t,s:G(r),yParity:n}}function Ir(t){const{r:e,s:a}=kt.Signature.fromCompact(t.slice(2,130));return{r:R(e,{size:32}),yParityAndS:R(a,{size:32})}}async function Tr(t){const{serializedTransaction:e,signature:a}=t,n=_a(e),r=a??{r:n.r,s:n.s,v:n.v,yParity:n.yParity},s=Le({...n,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await Z({hash:Y(s),signature:r})}function Cr({r:t,yParityAndS:e}){return`0x${new kt.Signature(A(t),A(e)).toCompactHex()}`}function vr(t){const{r:e,s:a,v:n,yParity:r}=t,s=Number(r??n-27n);let u=a;if(s===1){const d=H(a);d[0]|=128,u=G(d)}return{r:e,yParityAndS:u}}export{Ye as AbiConstructorNotFoundError,Et as AbiConstructorParamsNotFoundError,_o as AbiDecodingDataSizeInvalidError,Ro as AbiDecodingDataSizeTooSmallError,qo as AbiDecodingZeroDataError,Fo as AbiEncodingArrayLengthMismatchError,Uo as AbiEncodingBytesSizeMismatchError,Bo as AbiEncodingLengthMismatchError,ko as AbiErrorInputsNotFoundError,No as AbiErrorNotFoundError,Lo as AbiErrorSignatureNotFoundError,Mo as AbiEventNotFoundError,Do as AbiEventSignatureEmptyTopicsError,zo as AbiEventSignatureNotFoundError,Go as AbiFunctionNotFoundError,$o as AbiFunctionOutputsNotFoundError,Ho as AbiFunctionSignatureNotFoundError,Pr as AccountStateConflictError,tc as AtomicReadyWalletRejectedUpgradeError,ec as AtomicityNotSupportedError,lt as BaseError,_r as BaseFeeScalarError,Rr as BlockNotFoundError,qr as BundleFailedError,ac as BundleTooLargeError,Oo as BytesSizeMismatchError,Fr as CallExecutionError,nc as ChainDisconnectedError,Ur as ChainDoesNotSupportContract,Br as ChainMismatchError,kr as ChainNotFoundError,Nr as CircularReferenceError,Lr as ClientChainNotConfiguredError,Mr as ContractFunctionExecutionError,Dr as ContractFunctionRevertedError,zr as ContractFunctionZeroDataError,Gr as CounterfactualDeploymentFailedError,jo as DecodeLogDataMismatch,Wo as DecodeLogTopicsMismatch,rc as DuplicateIdError,pr as EIP1193ProviderRpcError,$r as Eip1559FeesNotSupportedError,Hr as EnsAvatarInvalidNftUriError,Or as EnsAvatarUnsupportedNamespaceError,jr as EnsAvatarUriResolutionError,Ne as EnsInvalidChainIdError,Wr as EstimateGasExecutionError,Fe as ExecutionRevertedError,Vr as FeeCapTooHighError,Kr as FeeCapTooLowError,Jr as FeeConflictError,Vo as FilterTypeNotSupportedError,sc as HttpRequestError,Yr as InsufficientFundsError,Ko as IntegerOutOfRangeError,oc as InternalRpcError,Qr as IntrinsicGasTooHighError,Zr as IntrinsicGasTooLowError,Jo as InvalidAbiDecodingTypeError,Yo as InvalidAbiEncodingTypeError,Xr as InvalidAbiItemError,Zt as InvalidAbiParameterError,ts as InvalidAbiParametersError,es as InvalidAbiTypeParameterError,je as InvalidAddressError,Qo as InvalidArrayError,Zo as InvalidBytesBooleanError,as as InvalidChainIdError,Na as InvalidDecimalNumberError,Xo as InvalidDefinitionTypeError,Vi as InvalidDomainError,ns as InvalidFunctionModifierError,ti as InvalidHexBooleanError,Ge as InvalidHexValueError,ic as InvalidInputRpcError,Ee as InvalidLegacyVError,rs as InvalidModifierError,ss as InvalidParameterError,cc as InvalidParamsRpcError,os as InvalidParenthesisError,Ki as InvalidPrimaryTypeError,uc as InvalidRequestRpcError,is as InvalidSerializableTransactionError,$ as InvalidSerializedTransactionError,he as InvalidSerializedTransactionTypeError,cs as InvalidSignatureError,us as InvalidStorageKeySizeError,ds as InvalidStructSignatureError,Ji as InvalidStructTypeError,dc as JsonRpcVersionUnsupportedError,mc as LimitExceededRpcError,ms as MaxFeePerGasTooLowError,lc as MethodNotFoundRpcError,fc as MethodNotSupportedRpcError,ls as NonceMaxValueError,fs as NonceTooHighError,hs as NonceTooLowError,hc as ParseRpcError,pc as ProviderDisconnectedError,yc as ProviderRpcError,ps as RawContractError,gc as ResourceNotFoundRpcError,bc as ResourceUnavailableRpcError,wc as RpcError,sa as RpcRequestError,ei as SizeExceedsPaddingSizeError,ai as SizeOverflowError,ni as SliceOffsetOutOfBoundsError,Q as SocketClosedError,ys as SolidityProtectedKeywordError,gs as StateAssignmentConflictError,xc as SwitchChainError,aa as TimeoutError,bs as TipAboveFeeCapError,ws as TransactionExecutionError,xs as TransactionNotFoundError,Es as TransactionReceiptNotFoundError,na as TransactionRejectedRpcError,Is as TransactionTypeNotSupportedError,Ec as UnauthorizedProviderError,Ic as UnknownBundleIdError,Ts as UnknownNodeError,Tc as UnknownRpcError,Cs as UnknownSignatureError,vs as UnknownTypeError,Cc as UnsupportedChainIdError,vc as UnsupportedNonOptionalCapabilityError,ri as UnsupportedPackedAbiType,Sc as UnsupportedProviderMethodError,Be as UrlRequiredError,ra as UserRejectedRequestError,Ss as WaitForCallsStatusTimeoutError,As as WaitForTransactionReceiptTimeoutError,It as WebSocketRequestError,qt as assertCurrentChain,Rt as assertRequest,pe as assertTransactionEIP1559,ye as assertTransactionEIP2930,xe as assertTransactionLegacy,Ps as blobsToCommitments,_s as blobsToProofs,si as boolToBytes,oi as boolToHex,ii as bytesToBigInt,ci as bytesToBool,G as bytesToHex,ui as bytesToNumber,Pc as bytesToRlp,di as bytesToString,Td as ccipFetch,Cd as ccipRequest,Ve as checksumAddress,ke as commitmentToVersionedHash,Rs as commitmentsToVersionedHashes,Cr as compactSignatureToHex,Er as compactSignatureToSignature,ze as concat,mi as concatBytes,li as concatHex,At as createClient,qs as createNonceManager,Fs as createPublicClient,dr as createTestClient,mt as createTransport,mr as createWalletClient,lr as custom,Mt as decodeAbiParameters,yr as decodeDeployData,Ni as decodeErrorResult,xd as decodeEventLog,Us as decodeFunctionData,Bs as decodeFunctionResult,Li as defineBlock,Mi as defineChain,kn as defineKzg,Di as defineTransaction,_d as defineTransactionReceipt,zi as defineTransactionRequest,ks as deploylessCallViaBytecodeBytecode,Ns as deploylessCallViaFactoryBytecode,Yi as domainSeparator,fi as encodeAbiParameters,Ce as encodeDeployData,Ls as encodeErrorResult,hi as encodeEventTopics,Xt as encodeFunctionData,Ms as encodeFunctionResult,Ds as encodePacked,zs as erc1155Abi,Gs as erc20Abi,$s as erc20Abi_bytes32,Hs as erc4626Abi,Os as erc6492SignatureValidatorAbi,js as erc6492SignatureValidatorByteCode,Ws as erc721Abi,Vs as ethAddress,Ie as etherUnits,tr as extractChain,fr as fallback,Gi as formatBlock,Ks as formatEther,Js as formatGwei,Rd as formatLog,$i as formatTransaction,qd as formatTransactionReceipt,ft as formatTransactionRequest,Ys as formatUnits,gr as fromBlobs,pi as fromBytes,yi as fromHex,Dt as fromRlp,gi as getAbiItem,B as getAddress,Qs as getChainContractAddress,Zn as getContract,Xn as getContractAddress,te as getContractError,da as getCreate2Address,ua as getCreateAddress,bi as getEventSelector,wi as getEventSignature,xi as getFunctionSelector,Ei as getFunctionSignature,Pa as getSerializedTransactionType,Zs as getTransactionType,Xe as getTypesForEIP712Domain,Te as gweiUnits,Qi as hashDomain,le as hashMessage,Zi as hashStruct,Ze as hashTypedData,A as hexToBigInt,Ii as hexToBool,H as hexToBytes,Ir as hexToCompactSignature,F as hexToNumber,_c as hexToRlp,Xs as hexToSignature,Ti as hexToString,to as http,Oe as isAddress,ht as isAddressEqual,Tt as isBytes,Ca as isErc6492Signature,va as isErc8010Signature,la as isHash,E as isHex,Y as keccak256,eo as labelhash,Rc as maxInt104,qc as maxInt112,Fc as maxInt120,Uc as maxInt128,Bc as maxInt136,kc as maxInt144,Nc as maxInt152,Lc as maxInt16,Mc as maxInt160,Dc as maxInt168,zc as maxInt176,Gc as maxInt184,$c as maxInt192,Hc as maxInt200,Oc as maxInt208,jc as maxInt216,Wc as maxInt224,Vc as maxInt232,Kc as maxInt24,Jc as maxInt240,Yc as maxInt248,Qc as maxInt256,Zc as maxInt32,Xc as maxInt40,tu as maxInt48,eu as maxInt56,au as maxInt64,nu as maxInt72,ru as maxInt8,su as maxInt80,ou as maxInt88,iu as maxInt96,cu as maxUint104,uu as maxUint112,du as maxUint120,mu as maxUint128,lu as maxUint136,fu as maxUint144,hu as maxUint152,pu as maxUint16,yu as maxUint160,gu as maxUint168,bu as maxUint176,wu as maxUint184,xu as maxUint192,Eu as maxUint200,Iu as maxUint208,Tu as maxUint216,Cu as maxUint224,vu as maxUint232,Su as maxUint24,Au as maxUint240,Pu as maxUint248,_u as maxUint256,Ru as maxUint32,qu as maxUint40,Fu as maxUint48,Uu as maxUint56,Bu as maxUint64,ku as maxUint72,Nu as maxUint8,Lu as maxUint80,Mu as maxUint88,Du as maxUint96,zu as minInt104,Gu as minInt112,$u as minInt120,Hu as minInt128,Ou as minInt136,ju as minInt144,Wu as minInt152,Vu as minInt16,Ku as minInt160,Ju as minInt168,Yu as minInt176,Qu as minInt184,Zu as minInt192,Xu as minInt200,td as minInt208,ed as minInt216,ad as minInt224,nd as minInt232,rd as minInt24,sd as minInt240,od as minInt248,id as minInt256,cd as minInt32,ud as minInt40,dd as minInt48,md as minInt56,ld as minInt64,fd as minInt72,hd as minInt8,pd as minInt80,yd as minInt88,gd as minInt96,ao as multicall3Abi,no as namehash,ro as nonceManager,Ci as numberToBytes,R as numberToHex,vd as offchainLookup,Sd as offchainLookupAbiItem,Ad as offchainLookupSignature,Me as pad,vi as padBytes,xt as padHex,so as parseAbi,oo as parseAbiItem,Qn as parseAbiParameter,io as parseAbiParameters,Ir as parseCompactSignature,ar as parseErc6492Signature,nr as parseErc8010Signature,cr as parseEther,Ed as parseEventLogs,ur as parseGwei,co as parseSignature,_a as parseTransaction,Wt as parseUnits,uo as prepareEncodeFunctionData,mo as presignMessagePrefix,lo as publicActions,Z as recoverAddress,Sa as recoverMessageAddress,fo as recoverPublicKey,Tr as recoverTransactionAddress,Aa as recoverTypedDataAddress,er as ripemd160,ho as rpcSchema,Hi as rpcTransactionType,po as serializeAccessList,Cr as serializeCompactSignature,yo as serializeErc6492Signature,rr as serializeErc8010Signature,go as serializeSignature,Le as serializeTransaction,ea as serializeTypedData,Si as setErrorConfig,xr as setupKzg,bd as sha256,Fn as shouldThrow,br as sidecarsToVersionedHashes,vr as signatureToCompactSignature,bo as signatureToHex,$e as size,De as slice,Ai as sliceBytes,Lt as sliceHex,Pi as stringToBytes,Je as stringToHex,Oi as stringify,hn as testActions,ge as toBlobSidecars,wo as toBlobs,k as toBytes,wr as toCoinType,_i as toEventHash,Ri as toEventSelector,qi as toEventSignature,Fi as toFunctionHash,Ui as toFunctionSelector,Bi as toFunctionSignature,Nt as toHex,xo as toPrefixedMessage,ia as toRlp,ji as transactionType,We as trim,Eo as universalSignatureValidatorAbi,Io as universalSignatureValidatorByteCode,ta as validateTypedData,sr as verifyHash,or as verifyMessage,ir as verifyTypedData,qn as walletActions,hr as webSocket,To as weiUnits,Co as withCache,vo as withRetry,Qe as withTimeout,So as zeroAddress,Ao as zeroHash};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/decimals-CMCAWgOh.js","_assets/utils-BQF5MiO5.js","_assets/sentry-Dx-KuLV3.js","_assets/react-BYHuwl8r.js","_assets/decimals-CqRsKj6U.js","_assets/prepare-contract-call-DDzIRXLv.js","_assets/signing-D6VaYziU.js","_assets/index-BzGWS8ln.js","_assets/dcl-schemas-CmtP3U6y.js","_assets/ethers-CFqPm_mN.js","_assets/intl-CBcMB1D2.js","_assets/index-l2QjlKjX.css","_assets/to-serializable-transaction-DmYzeFAP.js","_assets/transaction-Col-q-Ce.js","_assets/get-bytecode-BRKTQsHC.js","_assets/in-app-wallet-calls-BPQLmHd_.js","_assets/wait-for-tx-receipt-D_Gb9jAL.js","_assets/transactionReceipt-CYlPad05.js","_assets/sleep-mAKpSMLY.js","_assets/send-batch-transaction-koPW-Xx-.js","_assets/send-transaction-vVmLV10q.js","_assets/execute-D1vpEx_6.js","_assets/detectExtension-DX7grDLh.js"])))=>i.map(i=>d[i]);
2
- import{_ as T}from"./index-BzGWS8ln.js";import{t as V,i as ct,a as ot}from"./transaction-Col-q-Ce.js";import{e as dt,i as mt,a as F}from"./utils-BQF5MiO5.js";import{f as pt,h as q,e as $,i as ut,g as L,j as lt,t as yt}from"./to-serializable-transaction-DmYzeFAP.js";import{r as C,a5 as B,w as E,S as O,G as x,s as z,h as _,l as D,H as ft,k as wt,e as At,T as Gt,g as K}from"./prepare-contract-call-DDzIRXLv.js";import{o as j,r as gt}from"./execute-D1vpEx_6.js";import{Z,a as Y,p as Q,m as ht,b as Tt,d as J,e as Pt}from"./signing-D6VaYziU.js";import{t as vt,p as Lt,s as Dt}from"./send-eip712-transaction-D_0yg9Nh.js";import{s as Ot}from"./send-transaction-vVmLV10q.js";import{p as xt}from"./linkAccount-BtAQZlYa.js";import{g as X,E as S,h as St,a as k,b as Ct,c as _t,d as Et,e as U,D as tt,f as at,i as Ft,j as Vt,k as Ut,l as It}from"./index-u6d-Hhga.js";import{M as Ae}from"./wallets-DSYNibaO.js";import"./react-BYHuwl8r.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-CFqPm_mN.js";import"./intl-CBcMB1D2.js";import"./detectExtension-DX7grDLh.js";import"./get-bytecode-BRKTQsHC.js";import"./eth_sendRawTransaction-DPdnXbFR.js";import"./sha256-CfLwtdyC.js";import"./ethereum-CBeS7QFR.js";import"./types-DC0Zmj1B.js";import"./store-CraP4F4Y.js";import"./hashTypedData-Drw1v4Gy.js";import"./index-C8RkDmvI.js";import"./events-DQ172AOg.js";import"./index-BJ7QDORu.js";import"./index-w01WQ1OT.js";import"./index-nibyPLVP.js";import"./index-CJdot1dH.js";import"./index-Bf38MyW2.js";const bt="0xdd62ed3e",Rt=[{name:"owner",type:"address"},{name:"spender",type:"address"}],Nt=[{type:"uint256"}];async function $t(a){return C({contract:a.contract,method:[bt,Rt,Nt],params:[a.owner,a.spender]})}const kt="0x095ea7b3",Ht=[{name:"spender",type:"address"},{name:"value",type:"uint256"}],Mt=[{type:"bool"}];function Wt(a){const e=j(async()=>"asyncParams"in a?await a.asyncParams():a);return B({accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList},contract:a.contract,erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},method:[kt,Ht,Mt],nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},params:async()=>{const t=await e();return[t.spender,t.value]},value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value}})}function qt(a){return Wt({asyncParams:async()=>{let e;if("amount"in a){const{decimals:t}=await T(async()=>{const{decimals:r}=await import("./decimals-CMCAWgOh.js");return{decimals:r}},__vite__mapDeps([0,1,2,3,4,5])),i=await t(a).catch(()=>18);e=pt(a.amount.toString(),i)}else e=a.amountWei;return{overrides:{erc20Value:{amountWei:e,tokenAddress:a.contract.address},...a.overrides},spender:a.spender,value:e}},contract:a.contract})}const Bt="0xf15d424e",zt=[{name:"signer",type:"address"}],Kt=[{components:[{name:"signer",type:"address"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"startTimestamp",type:"uint128"},{name:"endTimestamp",type:"uint128"}],name:"permissions",type:"tuple"}];async function jt(a){return C({contract:a.contract,method:[Bt,zt,Kt],params:[a.signer]})}const Zt="0x5892e236",Yt=[{components:[{name:"signer",type:"address"},{name:"isAdmin",type:"uint8"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"permissionStartTimestamp",type:"uint128"},{name:"permissionEndTimestamp",type:"uint128"},{name:"reqValidityStartTimestamp",type:"uint128"},{name:"reqValidityEndTimestamp",type:"uint128"},{name:"uid",type:"bytes32"}],name:"req",type:"tuple"},{name:"signature",type:"bytes"}],Qt=[];function Jt(a){const e=j(async()=>"asyncParams"in a?await a.asyncParams():a);return B({accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList},contract:a.contract,erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},method:[Zt,Yt,Qt],nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},params:async()=>{const t=await e();return[t.req,t.signature]},value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value}})}function W(){return new Date(Date.now()+1e3*60*60*24*365*10)}function b(a){return vt(Math.floor(a.getTime()/1e3))}const Xt=[{name:"signer",type:"address"},{name:"isAdmin",type:"uint8"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"permissionStartTimestamp",type:"uint128"},{name:"permissionEndTimestamp",type:"uint128"},{name:"reqValidityStartTimestamp",type:"uint128"},{name:"reqValidityEndTimestamp",type:"uint128"},{name:"uid",type:"bytes32"}];async function ta(a){const{account:e,contract:t,req:i}=a,r=await e.signTypedData({domain:{chainId:t.chain.id,name:"Account",verifyingContract:t.address,version:"1"},message:i,primaryType:"SignerPermissionRequest",types:{SignerPermissionRequest:Xt}});return{req:i,signature:r}}async function aa(a){var i;const{target:e,permissions:t}=a;return{approvedTargets:t.approvedTargets==="*"?[Z]:t.approvedTargets,isAdmin:0,nativeTokenLimitPerTransaction:q(((i=t.nativeTokenLimitPerTransaction)==null?void 0:i.toString())||"0"),permissionEndTimestamp:b(t.permissionEndTimestamp||W()),permissionStartTimestamp:b(t.permissionStartTimestamp||new Date(0)),reqValidityEndTimestamp:b(W()),reqValidityStartTimestamp:0n,signer:e,uid:await gt()}}function ea(a){const{contract:e,sessionKeyAddress:t,account:i,permissions:r}=a;return Jt({async asyncParams(){const{req:n,signature:c}=await ta({account:i,contract:e,req:await aa({permissions:r,target:t})});return{req:n,signature:c}},contract:e})}async function sa(a){var c;const{accountContract:e,sessionKeyAddress:t,newPermissions:i}=a;if(!await Y(e))return!0;const n=await jt({contract:e,signer:t});return!!(n.endTimestamp&&n.endTimestamp<Math.floor(Date.now()/1e3)||!na(n.approvedTargets,i.approvedTargets)||q(((c=i.nativeTokenLimitPerTransaction)==null?void 0:c.toString())??"0")>n.nativeTokenLimitPerTransaction)}function na(a,e){return e==="*"&&a.length===1&&a[0]===Z?!0:e!=="*"?e.map(t=>t.toLowerCase()).every(t=>a.map(i=>i.toLowerCase()).includes(t)):!1}const ra=2n**96n-1n,ia="0x35567e1a",ca=[{name:"sender",type:"address"},{name:"key",type:"uint192"}],oa=[{name:"nonce",type:"uint256"}];async function da(a){return C({contract:a.contract,method:[ia,ca,oa],params:[a.sender,a.key]})}const ma="0xa6193531",pa=[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],ua=[{type:"bytes32"}];async function la(a){return C({contract:a.contract,method:[ma,pa,ua],params:[a.userOp]})}const ya="0x22cdde4c",fa=[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],wa=[{type:"bytes32"}];async function Aa(a){return C({contract:a.contract,method:[ya,fa,wa],params:[a.userOp]})}function Ga(a){return a.factory?E([a.factory,a.factoryData||"0x"]):"0x"}function ga(a){return E([O(x(BigInt(a.verificationGasLimit)),{size:16}),O(x(BigInt(a.callGasLimit)),{size:16})])}function ha(a){return E([O(x(BigInt(a.maxPriorityFeePerGas)),{size:16}),O(x(BigInt(a.maxFeePerGas)),{size:16})])}function Ta(a){return a.paymaster?E([a.paymaster,O(x(BigInt(a.paymasterVerificationGasLimit||0)),{size:16}),O(x(BigInt(a.paymasterPostOpGasLimit||0)),{size:16}),a.paymasterData||"0x"]):"0x"}const Pa=a=>({accountGasLimits:ga(a),callData:a.callData,gasFees:ha(a),initCode:Ga(a),nonce:BigInt(a.nonce),paymasterAndData:Ta(a),preVerificationGas:BigInt(a.preVerificationGas),sender:a.sender,signature:a.signature});async function I(a){var A;const{userOp:e,paymasterOverride:t,client:i,chain:r,entrypointAddress:n}=a;if(t)return t(e);const c={"Content-Type":"application/json"},s=n??S,o=X(r),d={id:1,jsonrpc:"2.0",method:"pm_sponsorUserOperation",params:[St(e),s]},y=await dt(i)(o,{body:z(d),headers:c,method:"POST"});if(!y.ok){const G=await y.text()||y.statusText;throw new Error(`Paymaster error: ${y.status} - ${G}`)}const p=await y.json();if(p.result)return typeof p.result=="string"?{paymasterAndData:p.result}:(p.result.reason&&console.warn(`Paymaster policy rejected this transaction with reason: ${p.result.reason} ${p.result.policyId?`(policyId: ${p.result.policyId})`:""}`),{callGasLimit:p.result.callGasLimit?_(p.result.callGasLimit):void 0,paymaster:p.result.paymaster,paymasterAndData:p.result.paymasterAndData,paymasterData:p.result.paymasterData,paymasterPostOpGasLimit:p.result.paymasterPostOpGasLimit?_(p.result.paymasterPostOpGasLimit):void 0,paymasterVerificationGasLimit:p.result.paymasterVerificationGasLimit?_(p.result.paymasterVerificationGasLimit):void 0,preVerificationGas:p.result.preVerificationGas?_(p.result.preVerificationGas):void 0,verificationGasLimit:p.result.verificationGasLimit?_(p.result.verificationGasLimit):void 0});const w=((A=p.error)==null?void 0:A.message)||p.error||y.statusText||"unknown error";throw new Error(`Paymaster error from ${o}: ${w}`)}const H=new Set,M=a=>`${a.chain.id}:${a.address}`,et=a=>{H.add(M(a))},st=a=>{H.delete(M(a))},nt=a=>H.has(M(a));async function va(a){const e=a.timeoutMs||12e4,t=a.intervalMs||1e3,i=Date.now()+e;for(;Date.now()<i;){const r=await Ct(a);if(r)return r;await new Promise(n=>setTimeout(n,t))}throw new Error(`Timeout waiting for userOp to be mined on chain ${a.chain.id} with UserOp hash: ${a.userOpHash}`)}async function La(a){var P;const{transaction:e,accountContract:t,factoryContract:i,adminAddress:r,overrides:n,sponsorGas:c,waitForDeployment:s=!0,isDeployedOverride:o}=a,d=e.chain,l=e.client,y={bundlerUrl:n==null?void 0:n.bundlerUrl,chain:d,client:l,entrypointAddress:n==null?void 0:n.entrypointAddress},p=k(((P=a.overrides)==null?void 0:P.entrypointAddress)||S),[w,A,G,g,f]=await Promise.all([typeof o=="boolean"?o:Y(t).then(h=>h||nt(t)),$(e),D(e.gas),Da({bundlerOptions:y,chain:d,client:l,executeTx:e}),Ea({accountContract:t,chain:d,client:l,entrypointAddress:n==null?void 0:n.entrypointAddress,getNonceOverride:n==null?void 0:n.getAccountNonce})]),{maxFeePerGas:m,maxPriorityFeePerGas:u}=g;return p==="v0.7"?Oa({accountContract:t,adminAddress:r,bundlerOptions:y,callData:A,callGasLimit:G,factoryContract:i,isDeployed:w,maxFeePerGas:m,maxPriorityFeePerGas:u,nonce:f,overrides:n,sponsorGas:c,waitForDeployment:s}):xa({accountContract:t,adminAddress:r,bundlerOptions:y,callData:A,callGasLimit:G,factoryContract:i,isDeployed:w,maxFeePerGas:m,maxPriorityFeePerGas:u,nonce:f,overrides:n,sponsorGas:c,waitForDeployment:s})}async function Da(a){const{executeTx:e,bundlerOptions:t,chain:i,client:r}=a;let{maxFeePerGas:n,maxPriorityFeePerGas:c}=e;const s=(t==null?void 0:t.bundlerUrl)??X(i);if(mt(s)){const o=await _t({options:t});n=o.maxFeePerGas,c=o.maxPriorityFeePerGas}else{const[o,d]=await Promise.all([D(n),D(c)]);if(o&&d)n=o,c=d;else{const l=await ut(r,i);c=d??l.maxPriorityFeePerGas??0n,n=o??l.maxFeePerGas??0n}}return{maxFeePerGas:n,maxPriorityFeePerGas:c}}async function Oa(a){const{bundlerOptions:e,isDeployed:t,factoryContract:i,accountContract:r,adminAddress:n,sponsorGas:c,overrides:s,nonce:o,callData:d,callGasLimit:l,maxFeePerGas:y,maxPriorityFeePerGas:p,waitForDeployment:w}=a,{chain:A,client:G}=e;let g,f;t?(f="0x",w&&await rt(r)):(g=i.address,f=await $(Q({accountSalt:s==null?void 0:s.accountSalt,adminAddress:n,createAccountOverride:s==null?void 0:s.createAccount,factoryContract:i})),w&&et(r));const m={callData:d,callGasLimit:l??0n,factory:g,factoryData:f,maxFeePerGas:y,maxPriorityFeePerGas:p,nonce:o,paymaster:void 0,paymasterData:"0x",paymasterPostOpGasLimit:0n,paymasterVerificationGasLimit:0n,preVerificationGas:0n,sender:r.address,signature:tt,verificationGasLimit:0n};if(c){const u=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:m});if(u.paymaster&&u.paymasterData&&(m.paymaster=u.paymaster,m.paymasterData=u.paymasterData),u.callGasLimit&&u.verificationGasLimit&&u.preVerificationGas&&u.paymasterPostOpGasLimit&&u.paymasterVerificationGasLimit)m.callGasLimit=u.callGasLimit,m.verificationGasLimit=u.verificationGasLimit,m.preVerificationGas=u.preVerificationGas,m.paymasterPostOpGasLimit=u.paymasterPostOpGasLimit,m.paymasterVerificationGasLimit=u.paymasterVerificationGasLimit;else{const P=s!=null&&s.tokenPaymaster?{[s.tokenPaymaster.tokenAddress]:{stateDiff:{[wt(At([{type:"address"},{type:"uint256"}],[r.address,s.tokenPaymaster.balanceStorageSlot]))]:Gt(ht,{size:32})}}}:void 0,h=await U({options:e,userOp:m},P);m.callGasLimit=h.callGasLimit,m.verificationGasLimit=h.verificationGasLimit,m.preVerificationGas=h.preVerificationGas,m.paymasterPostOpGasLimit=s!=null&&s.tokenPaymaster?500000n:h.paymasterPostOpGasLimit||0n,m.paymasterVerificationGasLimit=h.paymasterVerificationGasLimit||0n;const v=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:m});v.paymaster&&v.paymasterData&&(m.paymaster=v.paymaster,m.paymasterData=v.paymasterData)}}else{const u=await U({options:e,userOp:m});m.callGasLimit=u.callGasLimit,m.verificationGasLimit=u.verificationGasLimit,m.preVerificationGas=u.preVerificationGas,m.paymasterPostOpGasLimit=u.paymasterPostOpGasLimit||0n,m.paymasterVerificationGasLimit=u.paymasterVerificationGasLimit||0n}return{...m,signature:"0x"}}async function xa(a){const{bundlerOptions:e,isDeployed:t,factoryContract:i,accountContract:r,adminAddress:n,sponsorGas:c,overrides:s,nonce:o,callData:d,callGasLimit:l,maxFeePerGas:y,maxPriorityFeePerGas:p,waitForDeployment:w}=a,{chain:A,client:G}=e;let g;t?(g="0x",w&&await rt(r)):(g=await _a({accountSalt:s==null?void 0:s.accountSalt,adminAddress:n,createAccountOverride:s==null?void 0:s.createAccount,factoryContract:i}),w&&et(r));const f={callData:d,callGasLimit:l??0n,initCode:g,maxFeePerGas:y,maxPriorityFeePerGas:p,nonce:o,paymasterAndData:"0x",preVerificationGas:0n,sender:r.address,signature:tt,verificationGasLimit:0n};if(c){const m=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:f}),u="paymasterAndData"in m?m.paymasterAndData:"0x";if(u&&u!=="0x"&&(f.paymasterAndData=u),m.callGasLimit&&m.verificationGasLimit&&m.preVerificationGas)f.callGasLimit=m.callGasLimit,f.verificationGasLimit=m.verificationGasLimit,f.preVerificationGas=m.preVerificationGas;else{const P=await U({options:e,userOp:f});if(f.callGasLimit=P.callGasLimit,f.verificationGasLimit=P.verificationGasLimit,f.preVerificationGas=P.preVerificationGas,u&&u!=="0x"){const h=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:f}),v="paymasterAndData"in h?h.paymasterAndData:"0x";v&&v!=="0x"&&(f.paymasterAndData=v)}}}else{const m=await U({options:e,userOp:f});f.callGasLimit=m.callGasLimit,f.verificationGasLimit=m.verificationGasLimit,f.preVerificationGas=m.preVerificationGas}return{...f,signature:"0x"}}async function Sa(a){const{userOp:e,chain:t,entrypointAddress:i,adminAccount:r}=a,n=await Ca({chain:t,client:a.client,entrypointAddress:i,userOp:e});if(r.signMessage){const c=await r.signMessage({chainId:t.id,message:{raw:ft(n)},originalMessage:z(e)});return{...e,signature:c}}throw new Error("signMessage not implemented in signingAccount")}async function Ca(a){const{userOp:e,chain:t,entrypointAddress:i}=a,r=k(i||S);let n;if(r==="v0.7"){const c=Pa(e);n=await Aa({contract:L({address:i||at,chain:t,client:a.client}),userOp:c})}else n=await la({contract:L({address:i||S,chain:t,client:a.client}),userOp:e});return n}async function _a(a){const{factoryContract:e,adminAddress:t,accountSalt:i,createAccountOverride:r}=a,n=Q({accountSalt:i,adminAddress:t,createAccountOverride:r,factoryContract:e});return E([e.address,await $(n)])}async function Ea(a){const{accountContract:e,chain:t,client:i,entrypointAddress:r,getNonceOverride:n}=a;return n?n(e):await da({contract:L({address:r||S,chain:t,client:i}),key:Et(),sender:e.address})}async function rt(a){const e=Date.now();for(;nt(a);){if(Date.now()-e>6e4)throw st(a),new Error("Account deployment is taking too long (over 1 minute). Please try again.");await new Promise(t=>setTimeout(t,500))}}const it=new WeakMap,R=new WeakMap;async function le(a,e){var p,w,A,G,g,f,m;const{personalAccount:t,client:i}=a;if(!t)throw new Error("No personal account provided for smart account connection");const r=e,n=e.chain,c="gasless"in r?r.gasless:r.sponsorGas;if(await lt(n))return[Ua({chain:n,connectionOptions:a,creationOptions:e,sponsorGas:c}),n];if(r.factoryAddress&&!((p=r.overrides)!=null&&p.entrypointAddress)){const u=await Ia(r.factoryAddress,i,n);u&&(r.overrides={...r.overrides,entrypointAddress:u})}(w=r.overrides)!=null&&w.tokenPaymaster&&!((A=r.overrides)!=null&&A.entrypointAddress)&&(r.overrides={...r.overrides,entrypointAddress:at});const s=r.factoryAddress??Ft((G=r.overrides)==null?void 0:G.entrypointAddress),o=L({address:s,chain:n,client:i}),d=await Tt({accountAddress:(g=r.overrides)==null?void 0:g.accountAddress,accountSalt:(f=r.overrides)==null?void 0:f.accountSalt,adminAddress:t.address,factoryContract:o,predictAddressOverride:(m=r.overrides)==null?void 0:m.predictAddress}).then(u=>u).catch(u=>{throw new Error(`Failed to get account address with factory contract ${o.address} on chain ID ${n.id}: ${(u==null?void 0:u.message)||"unknown error"}`,{cause:u})}),l=L({address:d,chain:n,client:i}),y=await Fa({...r,accountContract:l,chain:n,client:i,factoryContract:o,personalAccount:t,sponsorGas:c});if(it.set(t,y),R.set(y,t),r.sessionKey&&await sa({accountContract:l,newPermissions:r.sessionKey.permissions,sessionKeyAddress:r.sessionKey.address})){const u=ea({account:t,contract:l,permissions:r.sessionKey.permissions,sessionKeyAddress:r.sessionKey.address});await Ot({account:y,transaction:u})}return[y,n]}async function ye(a){const e=R.get(a);e&&(it.delete(e),R.delete(a))}async function Fa(a){var n,c;const e=(n=a.overrides)==null?void 0:n.tokenPaymaster;if(e&&k(((c=a.overrides)==null?void 0:c.entrypointAddress)||S)!=="v0.7")throw new Error("Token paymaster is only supported for entrypoint version v0.7");const t=a.sponsorGas;let i=a.accountContract;const r={address:K(i.address),async onTransactionRequested(s){var o,d;return(d=(o=a.personalAccount).onTransactionRequested)==null?void 0:d.call(o,s)},async sendBatchTransaction(s){var p,w;const o=Pt({accountContract:i,executeBatchOverride:(p=a.overrides)==null?void 0:p.executeBatch,transactions:s});if(s.length===0)throw new Error("No transactions to send");const d=s[0];if(!d)throw new Error("No transactions to send");const l=F(d.chainId),y=await N({executeTx:o,options:{...a,accountContract:i,chain:l}});return V({chainId:l.id,client:a.client,contractAddress:((w=s[0])==null?void 0:w.to)??void 0,transactionHash:y.transactionHash,walletAddress:a.accountContract.address,walletType:"smart"}),y},async sendTransaction(s){var p,w,A;let o;if(e){await Va({accountContract:i,erc20Paymaster:e,options:a});const G=async()=>({paymaster:e.paymasterAddress,paymasterData:"0x"});o=((p=a.overrides)==null?void 0:p.paymaster)||G}else o=(w=a.overrides)==null?void 0:w.paymaster;s.chainId!==i.chain.id&&(i=L({address:r.address,chain:F(s.chainId),client:a.client}));const d=J({accountContract:i,executeOverride:(A=a.overrides)==null?void 0:A.execute,transaction:s}),l=F(s.chainId),y=await N({executeTx:d,options:{...a,accountContract:i,chain:l,overrides:{...a.overrides,paymaster:o}}});return V({chainId:l.id,client:a.client,contractAddress:s.to??void 0,transactionHash:y.transactionHash,walletAddress:a.accountContract.address,walletType:"smart"}),y},async signMessage({message:s}){var d;if((d=a.overrides)!=null&&d.signMessage)return a.overrides.signMessage({accountContract:i,adminAccount:a.personalAccount,factoryContract:a.factoryContract,message:s});const{smartAccountSignMessage:o}=await T(async()=>{const{smartAccountSignMessage:l}=await import("./signing-D6VaYziU.js").then(y=>y.Q);return{smartAccountSignMessage:l}},__vite__mapDeps([6,5,1,2,3,7,8,9,10,11,12,13,14]));return o({accountContract:i,factoryContract:a.factoryContract,message:s,options:a})},async signTypedData(s){var d;if((d=a.overrides)!=null&&d.signTypedData)return a.overrides.signTypedData({accountContract:i,adminAccount:a.personalAccount,factoryContract:a.factoryContract,typedData:s});const{smartAccountSignTypedData:o}=await T(async()=>{const{smartAccountSignTypedData:l}=await import("./signing-D6VaYziU.js").then(y=>y.Q);return{smartAccountSignTypedData:l}},__vite__mapDeps([6,5,1,2,3,7,8,9,10,11,12,13,14]));return o({accountContract:i,factoryContract:a.factoryContract,options:a,typedData:s})},sendCalls:async s=>{const{inAppWalletSendCalls:o}=await T(async()=>{const{inAppWalletSendCalls:w}=await import("./in-app-wallet-calls-BPQLmHd_.js");return{inAppWalletSendCalls:w}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22])),d=s.calls[0];if(!d)throw new Error("No calls to send");const l=d.client,y=d.chain||s.chain,p=await o({account:r,calls:s.calls,chain:y});return{chain:y,client:l,id:p}},getCallsStatus:async s=>{const{inAppWalletGetCallsStatus:o}=await T(async()=>{const{inAppWalletGetCallsStatus:d}=await import("./in-app-wallet-calls-BPQLmHd_.js");return{inAppWalletGetCallsStatus:d}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return o(s)},getCallsStatusRaw:async s=>{const{inAppWalletGetCallsStatusRaw:o}=await T(async()=>{const{inAppWalletGetCallsStatusRaw:d}=await import("./in-app-wallet-calls-BPQLmHd_.js");return{inAppWalletGetCallsStatusRaw:d}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return o(s)},getCapabilities:async s=>({[s.chainId??1]:{atomic:{status:"supported"},paymasterService:{supported:t??!1}}})};return r}async function Va(a){var l;const{accountContract:e,erc20Paymaster:t,options:i}=a,r=t.tokenAddress,n=L({address:r,chain:e.chain,client:e.client});if(await $t({contract:n,owner:e.address,spender:t.paymasterAddress})>0n)return;const s=qt({amountWei:ra-1n,contract:n,spender:t.paymasterAddress}),o=await yt({from:e.address,transaction:s}),d=J({accountContract:e,executeOverride:(l=i.overrides)==null?void 0:l.execute,transaction:o});await N({executeTx:d,options:{...i,overrides:{...i.overrides,tokenPaymaster:void 0}}})}function Ua(a){const{creationOptions:e,connectionOptions:t,chain:i}=a,r={address:K(t.personalAccount.address),async onTransactionRequested(n){var c,s;return(s=(c=t.personalAccount).onTransactionRequested)==null?void 0:s.call(c,n)},async sendTransaction(n){var l,y,p,w;const c={chain:F(n.chainId),client:t.client,data:n.data,eip712:n.eip712,to:n.to??void 0,value:n.value??0n};let s=await Lt({account:r,transaction:c});if(a.sponsorGas&&!s.paymaster){const A=await Vt({options:{bundlerUrl:(l=e.overrides)==null?void 0:l.bundlerUrl,chain:i,client:t.client,entrypointAddress:(y=e.overrides)==null?void 0:y.entrypointAddress},transaction:s});s={...s,...A}}const o=await Dt({account:r,chainId:i.id,eip712Transaction:s}),d=await Ut({options:{bundlerUrl:(p=e.overrides)==null?void 0:p.bundlerUrl,chain:i,client:t.client,entrypointAddress:(w=e.overrides)==null?void 0:w.entrypointAddress},signedTransaction:o,transaction:s});return V({chainId:i.id,client:t.client,contractAddress:n.to??void 0,transactionHash:d.transactionHash,walletAddress:r.address,walletType:"smart"}),{chain:i,client:t.client,transactionHash:d.transactionHash}},async signMessage({message:n}){return t.personalAccount.signMessage({message:n})},async signTypedData(n){const c=xt(n);return t.personalAccount.signTypedData(c)},sendCalls:async n=>{const{inAppWalletSendCalls:c}=await T(async()=>{const{inAppWalletSendCalls:y}=await import("./in-app-wallet-calls-BPQLmHd_.js");return{inAppWalletSendCalls:y}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22])),s=n.calls[0];if(!s)throw new Error("No calls to send");const o=s.client,d=s.chain||n.chain,l=await c({account:r,calls:n.calls,chain:d});return{chain:d,client:o,id:l}},getCallsStatus:async n=>{const{inAppWalletGetCallsStatus:c}=await T(async()=>{const{inAppWalletGetCallsStatus:s}=await import("./in-app-wallet-calls-BPQLmHd_.js");return{inAppWalletGetCallsStatus:s}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return c(n)},getCallsStatusRaw:async n=>{const{inAppWalletGetCallsStatusRaw:c}=await T(async()=>{const{inAppWalletGetCallsStatusRaw:s}=await import("./in-app-wallet-calls-BPQLmHd_.js");return{inAppWalletGetCallsStatusRaw:s}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return c(n)},getCapabilities:async n=>({[n.chainId??1]:{atomic:{status:"unsupported"},paymasterService:{supported:a.sponsorGas??!1}}})};return r}async function N(a){var i,r,n;const{executeTx:e,options:t}=a;try{const c=await La({accountContract:t.accountContract,adminAddress:t.personalAccount.address,factoryContract:t.factoryContract,overrides:t.overrides,sponsorGas:t.sponsorGas,transaction:e}),s=await Sa({adminAccount:t.personalAccount,chain:t.chain,client:t.client,entrypointAddress:(i=t.overrides)==null?void 0:i.entrypointAddress,userOp:c}),o={bundlerUrl:(r=t.overrides)==null?void 0:r.bundlerUrl,chain:t.chain,client:t.client,entrypointAddress:(n=t.overrides)==null?void 0:n.entrypointAddress},d=await It({options:o,userOp:s}),l=await va({...o,userOpHash:d});return V({chainId:t.chain.id,client:t.client,contractAddress:await D(e.to??void 0),transactionHash:l.transactionHash,walletAddress:t.accountContract.address,walletType:"smart"}),{chain:t.chain,client:t.client,transactionHash:l.transactionHash}}catch(c){throw ct(c)&&ot({chainId:t.chain.id,client:t.client,contractAddress:await D(e.to??void 0),error:c,transactionValue:await D(e.value),walletAddress:t.accountContract.address}),c}finally{st(t.accountContract)}}async function Ia(a,e,t){const i=L({address:a,chain:t,client:e});try{return await C({contract:i,method:"function entrypoint() public view returns (address)"})}catch{return}}export{le as connectSmartAccount,ye as disconnectSmartAccount,Ia as getEntrypointFromFactory,Ae as isSmartWallet};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/decimals-CMCAWgOh.js","_assets/utils-BQF5MiO5.js","_assets/sentry-Dx-KuLV3.js","_assets/react-BYHuwl8r.js","_assets/decimals-CqRsKj6U.js","_assets/prepare-contract-call-DDzIRXLv.js","_assets/signing-QBKrHvr9.js","_assets/index-uGopMLx_.js","_assets/dcl-schemas-CmtP3U6y.js","_assets/ethers-CFqPm_mN.js","_assets/intl-CBcMB1D2.js","_assets/index-l2QjlKjX.css","_assets/to-serializable-transaction-VMfkzTnh.js","_assets/transaction-Col-q-Ce.js","_assets/get-bytecode-BRKTQsHC.js","_assets/in-app-wallet-calls-zHwhzKhq.js","_assets/wait-for-tx-receipt-BnCyfeD5.js","_assets/transactionReceipt-BD6aaYgU.js","_assets/sleep-mAKpSMLY.js","_assets/send-batch-transaction-C98vx0Si.js","_assets/send-transaction-D7omgpzp.js","_assets/execute-BKGpV3HT.js","_assets/detectExtension-DX7grDLh.js"])))=>i.map(i=>d[i]);
2
+ import{_ as T}from"./index-uGopMLx_.js";import{t as V,i as ct,a as ot}from"./transaction-Col-q-Ce.js";import{e as dt,i as mt,a as F}from"./utils-BQF5MiO5.js";import{f as pt,h as q,e as $,i as ut,g as L,j as lt,t as yt}from"./to-serializable-transaction-VMfkzTnh.js";import{r as C,a5 as B,w as E,S as O,G as x,s as z,h as _,l as D,H as ft,k as wt,e as At,T as Gt,g as K}from"./prepare-contract-call-DDzIRXLv.js";import{o as j,r as gt}from"./execute-BKGpV3HT.js";import{Z,a as Y,p as Q,m as ht,b as Tt,d as J,e as Pt}from"./signing-QBKrHvr9.js";import{t as vt,p as Lt,s as Dt}from"./send-eip712-transaction-B9uhwtxq.js";import{s as Ot}from"./send-transaction-D7omgpzp.js";import{p as xt}from"./linkAccount-BtAQZlYa.js";import{g as X,E as S,h as St,a as k,b as Ct,c as _t,d as Et,e as U,D as tt,f as at,i as Ft,j as Vt,k as Ut,l as It}from"./index-CteyodZT.js";import{M as Ae}from"./wallets-HnCmZe2C.js";import"./react-BYHuwl8r.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-CFqPm_mN.js";import"./intl-CBcMB1D2.js";import"./detectExtension-DX7grDLh.js";import"./get-bytecode-BRKTQsHC.js";import"./eth_sendRawTransaction-DPdnXbFR.js";import"./sha256-CfLwtdyC.js";import"./ethereum-CBeS7QFR.js";import"./types-DC0Zmj1B.js";import"./store-CraP4F4Y.js";import"./hashTypedData-D6j6Ztal.js";import"./index-BcgGNlqh.js";import"./events-DQ172AOg.js";import"./index-CtQ9l7ML.js";import"./index-w01WQ1OT.js";import"./index-nibyPLVP.js";import"./index-CJdot1dH.js";import"./index-D3IKI6V4.js";const bt="0xdd62ed3e",Rt=[{name:"owner",type:"address"},{name:"spender",type:"address"}],Nt=[{type:"uint256"}];async function $t(a){return C({contract:a.contract,method:[bt,Rt,Nt],params:[a.owner,a.spender]})}const kt="0x095ea7b3",Ht=[{name:"spender",type:"address"},{name:"value",type:"uint256"}],Mt=[{type:"bool"}];function Wt(a){const e=j(async()=>"asyncParams"in a?await a.asyncParams():a);return B({accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList},contract:a.contract,erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},method:[kt,Ht,Mt],nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},params:async()=>{const t=await e();return[t.spender,t.value]},value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value}})}function qt(a){return Wt({asyncParams:async()=>{let e;if("amount"in a){const{decimals:t}=await T(async()=>{const{decimals:r}=await import("./decimals-CMCAWgOh.js");return{decimals:r}},__vite__mapDeps([0,1,2,3,4,5])),i=await t(a).catch(()=>18);e=pt(a.amount.toString(),i)}else e=a.amountWei;return{overrides:{erc20Value:{amountWei:e,tokenAddress:a.contract.address},...a.overrides},spender:a.spender,value:e}},contract:a.contract})}const Bt="0xf15d424e",zt=[{name:"signer",type:"address"}],Kt=[{components:[{name:"signer",type:"address"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"startTimestamp",type:"uint128"},{name:"endTimestamp",type:"uint128"}],name:"permissions",type:"tuple"}];async function jt(a){return C({contract:a.contract,method:[Bt,zt,Kt],params:[a.signer]})}const Zt="0x5892e236",Yt=[{components:[{name:"signer",type:"address"},{name:"isAdmin",type:"uint8"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"permissionStartTimestamp",type:"uint128"},{name:"permissionEndTimestamp",type:"uint128"},{name:"reqValidityStartTimestamp",type:"uint128"},{name:"reqValidityEndTimestamp",type:"uint128"},{name:"uid",type:"bytes32"}],name:"req",type:"tuple"},{name:"signature",type:"bytes"}],Qt=[];function Jt(a){const e=j(async()=>"asyncParams"in a?await a.asyncParams():a);return B({accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList},contract:a.contract,erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},method:[Zt,Yt,Qt],nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},params:async()=>{const t=await e();return[t.req,t.signature]},value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value}})}function W(){return new Date(Date.now()+1e3*60*60*24*365*10)}function b(a){return vt(Math.floor(a.getTime()/1e3))}const Xt=[{name:"signer",type:"address"},{name:"isAdmin",type:"uint8"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"permissionStartTimestamp",type:"uint128"},{name:"permissionEndTimestamp",type:"uint128"},{name:"reqValidityStartTimestamp",type:"uint128"},{name:"reqValidityEndTimestamp",type:"uint128"},{name:"uid",type:"bytes32"}];async function ta(a){const{account:e,contract:t,req:i}=a,r=await e.signTypedData({domain:{chainId:t.chain.id,name:"Account",verifyingContract:t.address,version:"1"},message:i,primaryType:"SignerPermissionRequest",types:{SignerPermissionRequest:Xt}});return{req:i,signature:r}}async function aa(a){var i;const{target:e,permissions:t}=a;return{approvedTargets:t.approvedTargets==="*"?[Z]:t.approvedTargets,isAdmin:0,nativeTokenLimitPerTransaction:q(((i=t.nativeTokenLimitPerTransaction)==null?void 0:i.toString())||"0"),permissionEndTimestamp:b(t.permissionEndTimestamp||W()),permissionStartTimestamp:b(t.permissionStartTimestamp||new Date(0)),reqValidityEndTimestamp:b(W()),reqValidityStartTimestamp:0n,signer:e,uid:await gt()}}function ea(a){const{contract:e,sessionKeyAddress:t,account:i,permissions:r}=a;return Jt({async asyncParams(){const{req:n,signature:c}=await ta({account:i,contract:e,req:await aa({permissions:r,target:t})});return{req:n,signature:c}},contract:e})}async function sa(a){var c;const{accountContract:e,sessionKeyAddress:t,newPermissions:i}=a;if(!await Y(e))return!0;const n=await jt({contract:e,signer:t});return!!(n.endTimestamp&&n.endTimestamp<Math.floor(Date.now()/1e3)||!na(n.approvedTargets,i.approvedTargets)||q(((c=i.nativeTokenLimitPerTransaction)==null?void 0:c.toString())??"0")>n.nativeTokenLimitPerTransaction)}function na(a,e){return e==="*"&&a.length===1&&a[0]===Z?!0:e!=="*"?e.map(t=>t.toLowerCase()).every(t=>a.map(i=>i.toLowerCase()).includes(t)):!1}const ra=2n**96n-1n,ia="0x35567e1a",ca=[{name:"sender",type:"address"},{name:"key",type:"uint192"}],oa=[{name:"nonce",type:"uint256"}];async function da(a){return C({contract:a.contract,method:[ia,ca,oa],params:[a.sender,a.key]})}const ma="0xa6193531",pa=[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],ua=[{type:"bytes32"}];async function la(a){return C({contract:a.contract,method:[ma,pa,ua],params:[a.userOp]})}const ya="0x22cdde4c",fa=[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],wa=[{type:"bytes32"}];async function Aa(a){return C({contract:a.contract,method:[ya,fa,wa],params:[a.userOp]})}function Ga(a){return a.factory?E([a.factory,a.factoryData||"0x"]):"0x"}function ga(a){return E([O(x(BigInt(a.verificationGasLimit)),{size:16}),O(x(BigInt(a.callGasLimit)),{size:16})])}function ha(a){return E([O(x(BigInt(a.maxPriorityFeePerGas)),{size:16}),O(x(BigInt(a.maxFeePerGas)),{size:16})])}function Ta(a){return a.paymaster?E([a.paymaster,O(x(BigInt(a.paymasterVerificationGasLimit||0)),{size:16}),O(x(BigInt(a.paymasterPostOpGasLimit||0)),{size:16}),a.paymasterData||"0x"]):"0x"}const Pa=a=>({accountGasLimits:ga(a),callData:a.callData,gasFees:ha(a),initCode:Ga(a),nonce:BigInt(a.nonce),paymasterAndData:Ta(a),preVerificationGas:BigInt(a.preVerificationGas),sender:a.sender,signature:a.signature});async function I(a){var A;const{userOp:e,paymasterOverride:t,client:i,chain:r,entrypointAddress:n}=a;if(t)return t(e);const c={"Content-Type":"application/json"},s=n??S,o=X(r),d={id:1,jsonrpc:"2.0",method:"pm_sponsorUserOperation",params:[St(e),s]},y=await dt(i)(o,{body:z(d),headers:c,method:"POST"});if(!y.ok){const G=await y.text()||y.statusText;throw new Error(`Paymaster error: ${y.status} - ${G}`)}const p=await y.json();if(p.result)return typeof p.result=="string"?{paymasterAndData:p.result}:(p.result.reason&&console.warn(`Paymaster policy rejected this transaction with reason: ${p.result.reason} ${p.result.policyId?`(policyId: ${p.result.policyId})`:""}`),{callGasLimit:p.result.callGasLimit?_(p.result.callGasLimit):void 0,paymaster:p.result.paymaster,paymasterAndData:p.result.paymasterAndData,paymasterData:p.result.paymasterData,paymasterPostOpGasLimit:p.result.paymasterPostOpGasLimit?_(p.result.paymasterPostOpGasLimit):void 0,paymasterVerificationGasLimit:p.result.paymasterVerificationGasLimit?_(p.result.paymasterVerificationGasLimit):void 0,preVerificationGas:p.result.preVerificationGas?_(p.result.preVerificationGas):void 0,verificationGasLimit:p.result.verificationGasLimit?_(p.result.verificationGasLimit):void 0});const w=((A=p.error)==null?void 0:A.message)||p.error||y.statusText||"unknown error";throw new Error(`Paymaster error from ${o}: ${w}`)}const H=new Set,M=a=>`${a.chain.id}:${a.address}`,et=a=>{H.add(M(a))},st=a=>{H.delete(M(a))},nt=a=>H.has(M(a));async function va(a){const e=a.timeoutMs||12e4,t=a.intervalMs||1e3,i=Date.now()+e;for(;Date.now()<i;){const r=await Ct(a);if(r)return r;await new Promise(n=>setTimeout(n,t))}throw new Error(`Timeout waiting for userOp to be mined on chain ${a.chain.id} with UserOp hash: ${a.userOpHash}`)}async function La(a){var P;const{transaction:e,accountContract:t,factoryContract:i,adminAddress:r,overrides:n,sponsorGas:c,waitForDeployment:s=!0,isDeployedOverride:o}=a,d=e.chain,l=e.client,y={bundlerUrl:n==null?void 0:n.bundlerUrl,chain:d,client:l,entrypointAddress:n==null?void 0:n.entrypointAddress},p=k(((P=a.overrides)==null?void 0:P.entrypointAddress)||S),[w,A,G,g,f]=await Promise.all([typeof o=="boolean"?o:Y(t).then(h=>h||nt(t)),$(e),D(e.gas),Da({bundlerOptions:y,chain:d,client:l,executeTx:e}),Ea({accountContract:t,chain:d,client:l,entrypointAddress:n==null?void 0:n.entrypointAddress,getNonceOverride:n==null?void 0:n.getAccountNonce})]),{maxFeePerGas:m,maxPriorityFeePerGas:u}=g;return p==="v0.7"?Oa({accountContract:t,adminAddress:r,bundlerOptions:y,callData:A,callGasLimit:G,factoryContract:i,isDeployed:w,maxFeePerGas:m,maxPriorityFeePerGas:u,nonce:f,overrides:n,sponsorGas:c,waitForDeployment:s}):xa({accountContract:t,adminAddress:r,bundlerOptions:y,callData:A,callGasLimit:G,factoryContract:i,isDeployed:w,maxFeePerGas:m,maxPriorityFeePerGas:u,nonce:f,overrides:n,sponsorGas:c,waitForDeployment:s})}async function Da(a){const{executeTx:e,bundlerOptions:t,chain:i,client:r}=a;let{maxFeePerGas:n,maxPriorityFeePerGas:c}=e;const s=(t==null?void 0:t.bundlerUrl)??X(i);if(mt(s)){const o=await _t({options:t});n=o.maxFeePerGas,c=o.maxPriorityFeePerGas}else{const[o,d]=await Promise.all([D(n),D(c)]);if(o&&d)n=o,c=d;else{const l=await ut(r,i);c=d??l.maxPriorityFeePerGas??0n,n=o??l.maxFeePerGas??0n}}return{maxFeePerGas:n,maxPriorityFeePerGas:c}}async function Oa(a){const{bundlerOptions:e,isDeployed:t,factoryContract:i,accountContract:r,adminAddress:n,sponsorGas:c,overrides:s,nonce:o,callData:d,callGasLimit:l,maxFeePerGas:y,maxPriorityFeePerGas:p,waitForDeployment:w}=a,{chain:A,client:G}=e;let g,f;t?(f="0x",w&&await rt(r)):(g=i.address,f=await $(Q({accountSalt:s==null?void 0:s.accountSalt,adminAddress:n,createAccountOverride:s==null?void 0:s.createAccount,factoryContract:i})),w&&et(r));const m={callData:d,callGasLimit:l??0n,factory:g,factoryData:f,maxFeePerGas:y,maxPriorityFeePerGas:p,nonce:o,paymaster:void 0,paymasterData:"0x",paymasterPostOpGasLimit:0n,paymasterVerificationGasLimit:0n,preVerificationGas:0n,sender:r.address,signature:tt,verificationGasLimit:0n};if(c){const u=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:m});if(u.paymaster&&u.paymasterData&&(m.paymaster=u.paymaster,m.paymasterData=u.paymasterData),u.callGasLimit&&u.verificationGasLimit&&u.preVerificationGas&&u.paymasterPostOpGasLimit&&u.paymasterVerificationGasLimit)m.callGasLimit=u.callGasLimit,m.verificationGasLimit=u.verificationGasLimit,m.preVerificationGas=u.preVerificationGas,m.paymasterPostOpGasLimit=u.paymasterPostOpGasLimit,m.paymasterVerificationGasLimit=u.paymasterVerificationGasLimit;else{const P=s!=null&&s.tokenPaymaster?{[s.tokenPaymaster.tokenAddress]:{stateDiff:{[wt(At([{type:"address"},{type:"uint256"}],[r.address,s.tokenPaymaster.balanceStorageSlot]))]:Gt(ht,{size:32})}}}:void 0,h=await U({options:e,userOp:m},P);m.callGasLimit=h.callGasLimit,m.verificationGasLimit=h.verificationGasLimit,m.preVerificationGas=h.preVerificationGas,m.paymasterPostOpGasLimit=s!=null&&s.tokenPaymaster?500000n:h.paymasterPostOpGasLimit||0n,m.paymasterVerificationGasLimit=h.paymasterVerificationGasLimit||0n;const v=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:m});v.paymaster&&v.paymasterData&&(m.paymaster=v.paymaster,m.paymasterData=v.paymasterData)}}else{const u=await U({options:e,userOp:m});m.callGasLimit=u.callGasLimit,m.verificationGasLimit=u.verificationGasLimit,m.preVerificationGas=u.preVerificationGas,m.paymasterPostOpGasLimit=u.paymasterPostOpGasLimit||0n,m.paymasterVerificationGasLimit=u.paymasterVerificationGasLimit||0n}return{...m,signature:"0x"}}async function xa(a){const{bundlerOptions:e,isDeployed:t,factoryContract:i,accountContract:r,adminAddress:n,sponsorGas:c,overrides:s,nonce:o,callData:d,callGasLimit:l,maxFeePerGas:y,maxPriorityFeePerGas:p,waitForDeployment:w}=a,{chain:A,client:G}=e;let g;t?(g="0x",w&&await rt(r)):(g=await _a({accountSalt:s==null?void 0:s.accountSalt,adminAddress:n,createAccountOverride:s==null?void 0:s.createAccount,factoryContract:i}),w&&et(r));const f={callData:d,callGasLimit:l??0n,initCode:g,maxFeePerGas:y,maxPriorityFeePerGas:p,nonce:o,paymasterAndData:"0x",preVerificationGas:0n,sender:r.address,signature:tt,verificationGasLimit:0n};if(c){const m=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:f}),u="paymasterAndData"in m?m.paymasterAndData:"0x";if(u&&u!=="0x"&&(f.paymasterAndData=u),m.callGasLimit&&m.verificationGasLimit&&m.preVerificationGas)f.callGasLimit=m.callGasLimit,f.verificationGasLimit=m.verificationGasLimit,f.preVerificationGas=m.preVerificationGas;else{const P=await U({options:e,userOp:f});if(f.callGasLimit=P.callGasLimit,f.verificationGasLimit=P.verificationGasLimit,f.preVerificationGas=P.preVerificationGas,u&&u!=="0x"){const h=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:f}),v="paymasterAndData"in h?h.paymasterAndData:"0x";v&&v!=="0x"&&(f.paymasterAndData=v)}}}else{const m=await U({options:e,userOp:f});f.callGasLimit=m.callGasLimit,f.verificationGasLimit=m.verificationGasLimit,f.preVerificationGas=m.preVerificationGas}return{...f,signature:"0x"}}async function Sa(a){const{userOp:e,chain:t,entrypointAddress:i,adminAccount:r}=a,n=await Ca({chain:t,client:a.client,entrypointAddress:i,userOp:e});if(r.signMessage){const c=await r.signMessage({chainId:t.id,message:{raw:ft(n)},originalMessage:z(e)});return{...e,signature:c}}throw new Error("signMessage not implemented in signingAccount")}async function Ca(a){const{userOp:e,chain:t,entrypointAddress:i}=a,r=k(i||S);let n;if(r==="v0.7"){const c=Pa(e);n=await Aa({contract:L({address:i||at,chain:t,client:a.client}),userOp:c})}else n=await la({contract:L({address:i||S,chain:t,client:a.client}),userOp:e});return n}async function _a(a){const{factoryContract:e,adminAddress:t,accountSalt:i,createAccountOverride:r}=a,n=Q({accountSalt:i,adminAddress:t,createAccountOverride:r,factoryContract:e});return E([e.address,await $(n)])}async function Ea(a){const{accountContract:e,chain:t,client:i,entrypointAddress:r,getNonceOverride:n}=a;return n?n(e):await da({contract:L({address:r||S,chain:t,client:i}),key:Et(),sender:e.address})}async function rt(a){const e=Date.now();for(;nt(a);){if(Date.now()-e>6e4)throw st(a),new Error("Account deployment is taking too long (over 1 minute). Please try again.");await new Promise(t=>setTimeout(t,500))}}const it=new WeakMap,R=new WeakMap;async function le(a,e){var p,w,A,G,g,f,m;const{personalAccount:t,client:i}=a;if(!t)throw new Error("No personal account provided for smart account connection");const r=e,n=e.chain,c="gasless"in r?r.gasless:r.sponsorGas;if(await lt(n))return[Ua({chain:n,connectionOptions:a,creationOptions:e,sponsorGas:c}),n];if(r.factoryAddress&&!((p=r.overrides)!=null&&p.entrypointAddress)){const u=await Ia(r.factoryAddress,i,n);u&&(r.overrides={...r.overrides,entrypointAddress:u})}(w=r.overrides)!=null&&w.tokenPaymaster&&!((A=r.overrides)!=null&&A.entrypointAddress)&&(r.overrides={...r.overrides,entrypointAddress:at});const s=r.factoryAddress??Ft((G=r.overrides)==null?void 0:G.entrypointAddress),o=L({address:s,chain:n,client:i}),d=await Tt({accountAddress:(g=r.overrides)==null?void 0:g.accountAddress,accountSalt:(f=r.overrides)==null?void 0:f.accountSalt,adminAddress:t.address,factoryContract:o,predictAddressOverride:(m=r.overrides)==null?void 0:m.predictAddress}).then(u=>u).catch(u=>{throw new Error(`Failed to get account address with factory contract ${o.address} on chain ID ${n.id}: ${(u==null?void 0:u.message)||"unknown error"}`,{cause:u})}),l=L({address:d,chain:n,client:i}),y=await Fa({...r,accountContract:l,chain:n,client:i,factoryContract:o,personalAccount:t,sponsorGas:c});if(it.set(t,y),R.set(y,t),r.sessionKey&&await sa({accountContract:l,newPermissions:r.sessionKey.permissions,sessionKeyAddress:r.sessionKey.address})){const u=ea({account:t,contract:l,permissions:r.sessionKey.permissions,sessionKeyAddress:r.sessionKey.address});await Ot({account:y,transaction:u})}return[y,n]}async function ye(a){const e=R.get(a);e&&(it.delete(e),R.delete(a))}async function Fa(a){var n,c;const e=(n=a.overrides)==null?void 0:n.tokenPaymaster;if(e&&k(((c=a.overrides)==null?void 0:c.entrypointAddress)||S)!=="v0.7")throw new Error("Token paymaster is only supported for entrypoint version v0.7");const t=a.sponsorGas;let i=a.accountContract;const r={address:K(i.address),async onTransactionRequested(s){var o,d;return(d=(o=a.personalAccount).onTransactionRequested)==null?void 0:d.call(o,s)},async sendBatchTransaction(s){var p,w;const o=Pt({accountContract:i,executeBatchOverride:(p=a.overrides)==null?void 0:p.executeBatch,transactions:s});if(s.length===0)throw new Error("No transactions to send");const d=s[0];if(!d)throw new Error("No transactions to send");const l=F(d.chainId),y=await N({executeTx:o,options:{...a,accountContract:i,chain:l}});return V({chainId:l.id,client:a.client,contractAddress:((w=s[0])==null?void 0:w.to)??void 0,transactionHash:y.transactionHash,walletAddress:a.accountContract.address,walletType:"smart"}),y},async sendTransaction(s){var p,w,A;let o;if(e){await Va({accountContract:i,erc20Paymaster:e,options:a});const G=async()=>({paymaster:e.paymasterAddress,paymasterData:"0x"});o=((p=a.overrides)==null?void 0:p.paymaster)||G}else o=(w=a.overrides)==null?void 0:w.paymaster;s.chainId!==i.chain.id&&(i=L({address:r.address,chain:F(s.chainId),client:a.client}));const d=J({accountContract:i,executeOverride:(A=a.overrides)==null?void 0:A.execute,transaction:s}),l=F(s.chainId),y=await N({executeTx:d,options:{...a,accountContract:i,chain:l,overrides:{...a.overrides,paymaster:o}}});return V({chainId:l.id,client:a.client,contractAddress:s.to??void 0,transactionHash:y.transactionHash,walletAddress:a.accountContract.address,walletType:"smart"}),y},async signMessage({message:s}){var d;if((d=a.overrides)!=null&&d.signMessage)return a.overrides.signMessage({accountContract:i,adminAccount:a.personalAccount,factoryContract:a.factoryContract,message:s});const{smartAccountSignMessage:o}=await T(async()=>{const{smartAccountSignMessage:l}=await import("./signing-QBKrHvr9.js").then(y=>y.Q);return{smartAccountSignMessage:l}},__vite__mapDeps([6,5,1,2,3,7,8,9,10,11,12,13,14]));return o({accountContract:i,factoryContract:a.factoryContract,message:s,options:a})},async signTypedData(s){var d;if((d=a.overrides)!=null&&d.signTypedData)return a.overrides.signTypedData({accountContract:i,adminAccount:a.personalAccount,factoryContract:a.factoryContract,typedData:s});const{smartAccountSignTypedData:o}=await T(async()=>{const{smartAccountSignTypedData:l}=await import("./signing-QBKrHvr9.js").then(y=>y.Q);return{smartAccountSignTypedData:l}},__vite__mapDeps([6,5,1,2,3,7,8,9,10,11,12,13,14]));return o({accountContract:i,factoryContract:a.factoryContract,options:a,typedData:s})},sendCalls:async s=>{const{inAppWalletSendCalls:o}=await T(async()=>{const{inAppWalletSendCalls:w}=await import("./in-app-wallet-calls-zHwhzKhq.js");return{inAppWalletSendCalls:w}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22])),d=s.calls[0];if(!d)throw new Error("No calls to send");const l=d.client,y=d.chain||s.chain,p=await o({account:r,calls:s.calls,chain:y});return{chain:y,client:l,id:p}},getCallsStatus:async s=>{const{inAppWalletGetCallsStatus:o}=await T(async()=>{const{inAppWalletGetCallsStatus:d}=await import("./in-app-wallet-calls-zHwhzKhq.js");return{inAppWalletGetCallsStatus:d}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return o(s)},getCallsStatusRaw:async s=>{const{inAppWalletGetCallsStatusRaw:o}=await T(async()=>{const{inAppWalletGetCallsStatusRaw:d}=await import("./in-app-wallet-calls-zHwhzKhq.js");return{inAppWalletGetCallsStatusRaw:d}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return o(s)},getCapabilities:async s=>({[s.chainId??1]:{atomic:{status:"supported"},paymasterService:{supported:t??!1}}})};return r}async function Va(a){var l;const{accountContract:e,erc20Paymaster:t,options:i}=a,r=t.tokenAddress,n=L({address:r,chain:e.chain,client:e.client});if(await $t({contract:n,owner:e.address,spender:t.paymasterAddress})>0n)return;const s=qt({amountWei:ra-1n,contract:n,spender:t.paymasterAddress}),o=await yt({from:e.address,transaction:s}),d=J({accountContract:e,executeOverride:(l=i.overrides)==null?void 0:l.execute,transaction:o});await N({executeTx:d,options:{...i,overrides:{...i.overrides,tokenPaymaster:void 0}}})}function Ua(a){const{creationOptions:e,connectionOptions:t,chain:i}=a,r={address:K(t.personalAccount.address),async onTransactionRequested(n){var c,s;return(s=(c=t.personalAccount).onTransactionRequested)==null?void 0:s.call(c,n)},async sendTransaction(n){var l,y,p,w;const c={chain:F(n.chainId),client:t.client,data:n.data,eip712:n.eip712,to:n.to??void 0,value:n.value??0n};let s=await Lt({account:r,transaction:c});if(a.sponsorGas&&!s.paymaster){const A=await Vt({options:{bundlerUrl:(l=e.overrides)==null?void 0:l.bundlerUrl,chain:i,client:t.client,entrypointAddress:(y=e.overrides)==null?void 0:y.entrypointAddress},transaction:s});s={...s,...A}}const o=await Dt({account:r,chainId:i.id,eip712Transaction:s}),d=await Ut({options:{bundlerUrl:(p=e.overrides)==null?void 0:p.bundlerUrl,chain:i,client:t.client,entrypointAddress:(w=e.overrides)==null?void 0:w.entrypointAddress},signedTransaction:o,transaction:s});return V({chainId:i.id,client:t.client,contractAddress:n.to??void 0,transactionHash:d.transactionHash,walletAddress:r.address,walletType:"smart"}),{chain:i,client:t.client,transactionHash:d.transactionHash}},async signMessage({message:n}){return t.personalAccount.signMessage({message:n})},async signTypedData(n){const c=xt(n);return t.personalAccount.signTypedData(c)},sendCalls:async n=>{const{inAppWalletSendCalls:c}=await T(async()=>{const{inAppWalletSendCalls:y}=await import("./in-app-wallet-calls-zHwhzKhq.js");return{inAppWalletSendCalls:y}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22])),s=n.calls[0];if(!s)throw new Error("No calls to send");const o=s.client,d=s.chain||n.chain,l=await c({account:r,calls:n.calls,chain:d});return{chain:d,client:o,id:l}},getCallsStatus:async n=>{const{inAppWalletGetCallsStatus:c}=await T(async()=>{const{inAppWalletGetCallsStatus:s}=await import("./in-app-wallet-calls-zHwhzKhq.js");return{inAppWalletGetCallsStatus:s}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return c(n)},getCallsStatusRaw:async n=>{const{inAppWalletGetCallsStatusRaw:c}=await T(async()=>{const{inAppWalletGetCallsStatusRaw:s}=await import("./in-app-wallet-calls-zHwhzKhq.js");return{inAppWalletGetCallsStatusRaw:s}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return c(n)},getCapabilities:async n=>({[n.chainId??1]:{atomic:{status:"unsupported"},paymasterService:{supported:a.sponsorGas??!1}}})};return r}async function N(a){var i,r,n;const{executeTx:e,options:t}=a;try{const c=await La({accountContract:t.accountContract,adminAddress:t.personalAccount.address,factoryContract:t.factoryContract,overrides:t.overrides,sponsorGas:t.sponsorGas,transaction:e}),s=await Sa({adminAccount:t.personalAccount,chain:t.chain,client:t.client,entrypointAddress:(i=t.overrides)==null?void 0:i.entrypointAddress,userOp:c}),o={bundlerUrl:(r=t.overrides)==null?void 0:r.bundlerUrl,chain:t.chain,client:t.client,entrypointAddress:(n=t.overrides)==null?void 0:n.entrypointAddress},d=await It({options:o,userOp:s}),l=await va({...o,userOpHash:d});return V({chainId:t.chain.id,client:t.client,contractAddress:await D(e.to??void 0),transactionHash:l.transactionHash,walletAddress:t.accountContract.address,walletType:"smart"}),{chain:t.chain,client:t.client,transactionHash:l.transactionHash}}catch(c){throw ct(c)&&ot({chainId:t.chain.id,client:t.client,contractAddress:await D(e.to??void 0),error:c,transactionValue:await D(e.value),walletAddress:t.accountContract.address}),c}finally{st(t.accountContract)}}async function Ia(a,e,t){const i=L({address:a,chain:t,client:e});try{return await C({contract:i,method:"function entrypoint() public view returns (address)"})}catch{return}}export{le as connectSmartAccount,ye as disconnectSmartAccount,Ia as getEntrypointFromFactory,Ae as isSmartWallet};
@@ -1,4 +1,4 @@
1
- import{i as c,b as a}from"./lit-element-B3y9oplH.js";import{n as o,o as h}from"./class-map-CxwNmq0D.js";import{e as m,n as b}from"./ref-BsAZ42-h.js";import{c as x}from"./index-BvG65AZz.js";import{d as f,r as $,e as g}from"./index-siSK96BI.js";const w=f`
1
+ import{i as c,b as a}from"./lit-element-B3y9oplH.js";import{n as o,o as h}from"./class-map-CxwNmq0D.js";import{e as m,n as b}from"./ref-BsAZ42-h.js";import{c as x}from"./index-CvqOZGzt.js";import{d as f,r as $,e as g}from"./index-D24PzU1R.js";const w=f`
2
2
  :host {
3
3
  position: relative;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{i as u,b as h}from"./lit-element-B3y9oplH.js";import{n as d,o as f}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-BvG65AZz.js";import{d as g,r as m,e as b}from"./index-siSK96BI.js";const y=g`
1
+ import{i as u,b as h}from"./lit-element-B3y9oplH.js";import{n as d,o as f}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-CvqOZGzt.js";import{d as g,r as m,e as b}from"./index-D24PzU1R.js";const y=g`
2
2
  :host {
3
3
  display: inline-flex;
4
4
  justify-content: center;