@dcl/blog-site 0.2.3-24088316758.commit-34384cf → 0.3.0
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.
- package/assets/{QueryClientProvider-DFnrqjxK.js → QueryClientProvider-DVt1z-lo.js} +1 -1
- package/assets/{SignInRedirect-YsS_y43O.js → SignInRedirect-DQ2EXIlf.js} +2 -2
- package/assets/{X-DQRyaTAP.js → X-_bf2yze4.js} +1 -1
- package/assets/{__federation_expose_App-BWDr6ljs.js → __federation_expose_App-DpSY-Y9d.js} +1 -1
- package/assets/{__federation_fn_import-DsoKw508.js → __federation_fn_import-D82-s3kA.js} +1 -1
- package/assets/__federation_shared_@dcl/{hooks-P78bsY9M.js → hooks-35itWugh.js} +3 -3
- package/assets/__federation_shared_@emotion/react-LISJiiTk.js +1 -0
- package/assets/__federation_shared_@emotion/{styled-CtXq_gFe.js → styled-CER0OT-8.js} +1 -1
- package/assets/{__federation_shared_decentraland-ui2-DRl5ehN-.js → __federation_shared_decentraland-ui2-qV0BHWTj.js} +6 -6
- package/assets/{__federation_shared_react-redux-DRaqgPHP.js → __federation_shared_react-redux-7pAtHZvO.js} +1 -1
- package/assets/{__federation_shared_react-router-dom-ClUJIur8.js → __federation_shared_react-router-dom-DM3U0-DJ.js} +1 -1
- package/assets/{__federation_shared_viem-OkDZ_da3.js → __federation_shared_viem-B7de3aIh.js} +1 -1
- package/assets/{__federation_shared_wagmi-DxQyjTpB.js → __federation_shared_wagmi-B-FL62eC.js} +1 -1
- package/assets/{add-BJhrLyz2.js → add-D95ShjVd.js} +1 -1
- package/assets/{all-wallets-BKl1d9ay.js → all-wallets-BY6r5fcR.js} +1 -1
- package/assets/{app-store-Cz4wx5Ml.js → app-store-SmbPBgEb.js} +1 -1
- package/assets/{apple-ZB0nqM0P.js → apple-D8pqe3de.js} +1 -1
- package/assets/{arrow-bottom-DPabveW2.js → arrow-bottom-DQy0lFo0.js} +1 -1
- package/assets/{arrow-bottom-circle-qQ6xlCaO.js → arrow-bottom-circle-OyHlN-U-.js} +1 -1
- package/assets/{arrow-left-D_0jfro8.js → arrow-left-CXPqeZRE.js} +1 -1
- package/assets/{arrow-right-Bxr-_0TM.js → arrow-right-BI45gebZ.js} +1 -1
- package/assets/{arrow-top-CcZJfPaY.js → arrow-top-BxYGxPQg.js} +1 -1
- package/assets/{auto-track-CXTejErn.js → auto-track-IXpT7xap.js} +1 -1
- package/assets/{bank-qzSNVmpL.js → bank-DvWpLZQG.js} +1 -1
- package/assets/{basic-CriAqicR.js → basic-DENnvNSD.js} +1 -1
- package/assets/{biconomy-7PcFs3b0.js → biconomy-GzbQEJRq.js} +1 -1
- package/assets/{browser-B01ZPlHW.js → browser-COUlM8GK.js} +1 -1
- package/assets/{card-C8yazSyG.js → card-DCZ4hxW7.js} +1 -1
- package/assets/{ccip-D0tvzkwi.js → ccip-DGW5U0-8.js} +1 -1
- package/assets/{checkmark-DEpAI8yr.js → checkmark-C3MmlUGU.js} +1 -1
- package/assets/{checkmark-bold-CmJidmVJ.js → checkmark-bold-BZz12uQW.js} +1 -1
- package/assets/{chevron-bottom-DWsbL4vJ.js → chevron-bottom-BITHvcvn.js} +1 -1
- package/assets/{chevron-left-DLMg9i5k.js → chevron-left-DLcgw6J3.js} +1 -1
- package/assets/{chevron-right-BR2L5tDn.js → chevron-right-CgvlwKH_.js} +1 -1
- package/assets/{chevron-top-BWtZfQ2F.js → chevron-top-E2kQk6Yb.js} +1 -1
- package/assets/{chrome-store-BGE1p2Hx.js → chrome-store-IGBWJmfs.js} +1 -1
- package/assets/{clock-B12ZBUD7.js → clock-Dnnqv_UX.js} +1 -1
- package/assets/{close-B54jTe2O.js → close-h_pw4dRD.js} +1 -1
- package/assets/{coinPlaceholder-B5PhQfVg.js → coinPlaceholder-CpzdwguN.js} +1 -1
- package/assets/{compass-CEs6S01I.js → compass-CLIqD2Io.js} +1 -1
- package/assets/{controller-n5F8mc3X.js → controller-DOHoljGI.js} +2 -2
- package/assets/{copy-DwrKUUfz.js → copy-56eIYa9K.js} +1 -1
- package/assets/{core-DPOUi4Tl.js → core-iy2F1EJT.js} +3 -3
- package/assets/{createBundlerClient-YqcE2yqs.js → createBundlerClient-Cb3DWn31.js} +1 -1
- package/assets/{createClient-BxHhKlNq.js → createClient-BJ5w543s.js} +1 -1
- package/assets/{cursor-CGBFNPoh.js → cursor-DHAIalN2.js} +1 -1
- package/assets/{cursor-transparent-D3nfFufs.js → cursor-transparent-USINvuuv.js} +1 -1
- package/assets/{decimals-D0IunObY.js → decimals-CVjZGYo0.js} +1 -1
- package/assets/{decimals-BMO-32AD.js → decimals-DIZDmdnI.js} +1 -1
- package/assets/{desktop-Bjkc6WkG.js → desktop-Ck9zNNDL.js} +1 -1
- package/assets/{detectExtension-BEr9WLqO.js → detectExtension-DQNsMd7m.js} +1 -1
- package/assets/{disconnect-D9dYAsxs.js → disconnect-B6rD3ARw.js} +1 -1
- package/assets/{discord-DZuYBrqS.js → discord-QyDy6H2Z.js} +1 -1
- package/assets/{emotion-react.browser.esm-Ce2LppU1.js → emotion-react.browser.esm-BHtRLI5r.js} +1 -1
- package/assets/{emotion-use-insertion-effect-with-fallbacks.browser.esm-ByQDcQjl.js → emotion-use-insertion-effect-with-fallbacks.browser.esm-DxyPSsfO.js} +1 -1
- package/assets/{encode-cHgp5mHv.js → encode-JOmK-dAM.js} +2 -2
- package/assets/{engine-BVbFCTQK.js → engine-Cr6ElJJw.js} +1 -1
- package/assets/{estimate-gas-DBgT8NWo.js → estimate-gas-CMPxVjuF.js} +3 -3
- package/assets/{estimate-l1-fee-C2ptcVct.js → estimate-l1-fee-B90S_dRF.js} +1 -1
- package/assets/{eth_getStorageAt-B9Y_JVAm.js → eth_getStorageAt-BzWA0XEw.js} +1 -1
- package/assets/{etherscan-oUtlOsmK.js → etherscan-BSyc5b_s.js} +1 -1
- package/assets/{exclamation-triangle-BdB5oh3a.js → exclamation-triangle-Cbq68j9M.js} +1 -1
- package/assets/{extension-CjK6xfgN.js → extension-Ef7aJ2Fj.js} +1 -1
- package/assets/{external-link-dD0-Gy7Y.js → external-link-bVFEWzQf.js} +1 -1
- package/assets/{extractIPFS-BN8-L65J.js → extractIPFS-kNuMOSPp.js} +1 -1
- package/assets/{facebook-CInWYo4e.js → facebook-KWDQXnqW.js} +1 -1
- package/assets/{farcaster-Dk7xCnWZ.js → farcaster-OZKU6ag9.js} +1 -1
- package/assets/{fee-data-DBS1-uI-.js → fee-data-BCMgs11D.js} +1 -1
- package/assets/{fetchTokenMetadata-sBUH3xE3.js → fetchTokenMetadata-BPHUGga-.js} +2 -2
- package/assets/{filters-CQJE56FO.js → filters-hVFxrfbM.js} +1 -1
- package/assets/{get-ecosystem-wallet-info-DkhEjWQL.js → get-ecosystem-wallet-info-mPW-S8xG.js} +1 -1
- package/assets/{getBalance-NroDyfvQ.js → getBalance-B1iUU342.js} +1 -1
- package/assets/{getInstalledModules-DFAdG78-.js → getInstalledModules-BnNuIBJw.js} +1 -1
- package/assets/{getNFT-CM6jDDoS.js → getNFT-BPxN7Ctt.js} +1 -1
- package/assets/{getNFT-CZphITDU.js → getNFT-DF0DVjz_.js} +2 -2
- package/assets/{github-D7bNXBE_.js → github-BzQnkFuN.js} +1 -1
- package/assets/{google-C7wxpdtc.js → google-Gdkba30S.js} +1 -1
- package/assets/{help-circle-jHfnx5-M.js → help-circle-CzuLd4UT.js} +1 -1
- package/assets/{id-B0bg6br2.js → id--DiZoCMN.js} +1 -1
- package/assets/{image-CFkOYVVZ.js → image-S2doqbWs.js} +1 -1
- package/assets/{in-app-wallet-calls-CUJMAfNk.js → in-app-wallet-calls-C1SY2oWN.js} +1 -1
- package/assets/{index-DyFSxszr.js → index-1ERaFZsE.js} +1 -1
- package/assets/index-BjzJcZq6.js +1 -1
- package/assets/{index-B6POK61z.js → index-C52TjtZ8.js} +1 -1
- package/assets/{index-CgabfD28.js → index-CH2z5aZN.js} +2 -2
- package/assets/{index-C9ZtSkAF.js → index-CfDhCkmV.js} +1 -1
- package/assets/{index-p2T8GhRA.js → index-CgkAqmHX.js} +1 -1
- package/assets/{index-C2t4sTPE.js → index-CwwTvCG6.js} +1 -1
- package/assets/{index-BgKyyaW6.js → index-D7VWCQbE.js} +1 -1
- package/assets/index-DIxygMtO.js +1 -0
- package/assets/{index-CDUZj6Gh.js → index-Dg2V4ned.js} +1 -1
- package/assets/index-Dy0yjznp.js +1 -1
- package/assets/{index-DuUs6XE9.js → index-T692f3s9.js} +1 -1
- package/assets/{index-BqaO8h_q.js → index-b9i0Ibxp.js} +2 -2
- package/assets/{index-CK_y9rJC.js → index-f2LDpGwT.js} +3 -3
- package/assets/{index-HwVh-q7L.js → index-ww85HWCV.js} +1 -1
- package/assets/{index.es-DiIxomE4.js → index.es-CzqZMQ08.js} +3 -3
- package/assets/{index.es-C4uogg3R.js → index.es-D_Iyl52g.js} +1 -1
- package/assets/{info-a5qnZWSp.js → info-DEpm9K4l.js} +1 -1
- package/assets/{info-circle-CtpHiT1K.js → info-circle-BFBSJV6L.js} +1 -1
- package/assets/jsx-runtime-DncYoG30.js +1 -1
- package/assets/{lightbulb-Cedc0rYJ.js → lightbulb-GZWMuOVt.js} +1 -1
- package/assets/{localBatchGatewayRequest-xHNW-Ehl.js → localBatchGatewayRequest-Df9EBRM7.js} +1 -1
- package/assets/{mail-D96xVokz.js → mail-CUdb6dNj.js} +1 -1
- package/assets/{mobile-DsDxm8mI.js → mobile-BeQz2cn_.js} +1 -1
- package/assets/{more-BedDVxwf.js → more-TsN-CR-t.js} +1 -1
- package/assets/{network-placeholder-CpA4BghL.js → network-placeholder-DwFC6B_7.js} +1 -1
- package/assets/{nftPlaceholder-E0nNrT1f.js → nftPlaceholder-CiT4A3-l.js} +1 -1
- package/assets/{off-C8YtcDJA.js → off-CUv-83kc.js} +1 -1
- package/assets/{openzeppelin-CQer_fI1.js → openzeppelin-BBJIIsPB.js} +1 -1
- package/assets/{ownerOf-GjaKoeq1.js → ownerOf-DYtTCeNU.js} +1 -1
- package/assets/{parseNft-CxF6cVbB.js → parseNft-Buclbv5Y.js} +2 -2
- package/assets/{play-store-wzv988wO.js → play-store-RQqRTPUT.js} +1 -1
- package/assets/{plus-BOnP2W3B.js → plus-C7MITUNH.js} +1 -1
- package/assets/preload-helper-BokH5fd6.js +1 -0
- package/assets/{qr-code-5Zy3Jwmz.js → qr-code-CpEPSAYR.js} +1 -1
- package/assets/{qr-overlay-qPTQSVWY.js → qr-overlay-DryFOQCX.js} +1 -1
- package/assets/{recycle-horizontal-BiLXE1ph.js → recycle-horizontal-B1QKxNTd.js} +1 -1
- package/assets/{refresh-DrIaQxXR.js → refresh-DdqLkUQx.js} +1 -1
- package/assets/remoteEntry.js +1 -1
- package/assets/{reown-logo-C50d_2u-.js → reown-logo-_t3NoThE.js} +1 -1
- package/assets/{resolveImplementation-Bp817C6y.js → resolveImplementation--gaCsV-s.js} +1 -1
- package/assets/{search-CtoMI8IW.js → search-B8WbQmvE.js} +1 -1
- package/assets/{secp256k1-lKd37s6b.js → secp256k1-DtCHzlC3.js} +1 -1
- package/assets/{send-DjyS4WAU.js → send-BFNT_o0R.js} +1 -1
- package/assets/{send-batch-transaction-DBV6UBBv.js → send-batch-transaction-ZanhTs8a.js} +1 -1
- package/assets/{send-eip712-transaction-CI65hvCl.js → send-eip712-transaction-CxRy-sD1.js} +2 -2
- package/assets/{send-gasless-transaction-C7lHksJD.js → send-gasless-transaction-Iz8ZLiHO.js} +2 -2
- package/assets/{serializeTransaction-6LlbmJwH.js → serializeTransaction-BufQeOel.js} +1 -1
- package/assets/{session-proposal-BJ6dUV4k.js → session-proposal-BD47nRI-.js} +1 -1
- package/assets/{session-request-Cen_JpY8.js → session-request-TkgpbjLp.js} +2 -2
- package/assets/{signing-BsPRCC1P.js → signing-TLGj9K79.js} +3 -3
- package/assets/{swapHorizontal-DUMDblJm.js → swapHorizontal-BiFAMUuS.js} +1 -1
- package/assets/{swapHorizontalBold-Du4gzczl.js → swapHorizontalBold-CP3dUSZb.js} +1 -1
- package/assets/{swapHorizontalMedium-BkSTzo9o.js → swapHorizontalMedium-BRNlkDrO.js} +1 -1
- package/assets/{swapHorizontalRoundedBold-CQD5i-I5.js → swapHorizontalRoundedBold-CHqEVcBs.js} +1 -1
- package/assets/{swapVertical-CjSXuBHb.js → swapVertical-Du0QoNAI.js} +1 -1
- package/assets/{telegram-uAGG8XwG.js → telegram-DQef1ILU.js} +1 -1
- package/assets/{thirdweb-DOoFBA7F.js → thirdweb-E-fErz2x.js} +3 -3
- package/assets/{three-dots-BWtFKrpY.js → three-dots-ByXtSGCV.js} +1 -1
- package/assets/{totalSupply-CjCaaPZD.js → totalSupply-DNIfxfBv.js} +1 -1
- package/assets/{twitch-VH9Dk-Bx.js → twitch-DIxDFqku.js} +1 -1
- package/assets/{twitterIcon-Bfs32uTm.js → twitterIcon-B-SNXvpz.js} +1 -1
- package/assets/{uid-XfAtrElX.js → uid-Bq9ktEE-.js} +3 -3
- package/assets/{verify-4fUj-WRm.js → verify-BT-sFhiZ.js} +1 -1
- package/assets/{verify-filled-sllS8Nrv.js → verify-filled-DUDJcSxD.js} +1 -1
- package/assets/{w3m-modal-Blb5XI95.js → w3m-modal-Ck71GkBa.js} +1 -1
- package/assets/{wait-for-tx-receipt-BR33kfvc.js → wait-for-tx-receipt-C5afrCK7.js} +1 -1
- package/assets/{wallet-DuQpuU5E.js → wallet-DiXkPY80.js} +1 -1
- package/assets/{wallet-placeholder-CERukyIC.js → wallet-placeholder-DHuJakoz.js} +1 -1
- package/assets/{walletconnect-CsB9GzlO.js → walletconnect-LtvddLlL.js} +1 -1
- package/assets/{wallets-vcnqEomN.js → wallets-BmZ-KVbp.js} +5 -5
- package/assets/{warning-circle-C8yGFMlX.js → warning-circle-DEf5ta8Y.js} +1 -1
- package/assets/{web-connector-Jj-2yhMg.js → web-connector-6KYcG8gr.js} +3 -3
- package/assets/{webSocket-BfTFTYzP.js → webSocket-2Mm3WVrI.js} +1 -1
- package/assets/{x-BXVsZnMK.js → x-Cl1yAHbN.js} +1 -1
- package/index.html +17 -17
- package/package.json +2 -2
- package/assets/__federation_shared_@emotion/react-CtCvVI4H.js +0 -1
- package/assets/index-Dot3cU3_.js +0 -1
- package/assets/preload-helper-2M-6abck.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__fileDeps=["assets/utils-CozXUO91.js","assets/withCache-DYumIHzL.js","assets/send-eip712-transaction-
|
|
2
|
-
import{n as le,h as us,m as Rt,o as re,q as R,i as I,v as Dn,r as fs,w as D,B as S,x as ut,y as j,z as ft,e as Vn,A as dt,C as X,D as ds,E as jn,F as qn,G as Zn,H as ls,I as Ne,J as Fn,K as hs,L as Ue,c as Zt,M as We,N as tt,p as we,j as ps,s as Ft,O as Be,u as ys,l as ms,P as Gn,t as Kn}from"./hex-B0Rx0hII.js";import{b as gs,a as bs,L as ws,w as xs}from"./withCache-DYumIHzL.js";import{importShared as De}from"./__federation_fn_import-DsoKw508.js";import{_ as he}from"./preload-helper-2M-6abck.js";import{j as Es}from"./fee-data-DBS1-uI-.js";import{getRpcClient as lt}from"./rpc-ti0b0r_u.js";import{v as wn,x as vs,y as Bs,I as Is,g as Ce,n as As,z as Ss,A as Ct,B as Ps,b as ht,i as $s,a as Bt,s as xn,u as _s,k as fe}from"./estimate-gas-DBgT8NWo.js";import{r as ce}from"./op-gas-fee-reducer-CfxMcvXl.js";import{encode as Gt}from"./encode-cHgp5mHv.js";import{stringify as Ts}from"./json-BHzNJmTy.js";const Ie=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function pt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ke(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function se(e,...t){if(!pt(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Yn(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");ke(e.outputLen),ke(e.blockLen)}function Te(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Wn(e,t){se(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Os(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Oe(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function It(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function W(e,t){return e<<32-t|e>>>t}const Ls=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function zs(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Rs(e){for(let t=0;t<e.length;t++)e[t]=zs(e[t]);return e}const En=Ls?e=>e:Rs,Xn=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Cs=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Pe(e){if(se(e),Xn)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Cs[e[n]];return t}const ee={_0:48,_9:57,A:65,F:70,a:97,f:102};function vn(e){if(e>=ee._0&&e<=ee._9)return e-ee._0;if(e>=ee.A&&e<=ee.F)return e-(ee.A-10);if(e>=ee.a&&e<=ee.f)return e-(ee.a-10)}function nt(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Xn)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let s=0,i=0;s<n;s++,i+=2){const o=vn(e.charCodeAt(i)),a=vn(e.charCodeAt(i+1));if(o===void 0||a===void 0){const c=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}r[s]=o*16+a}return r}function Ns(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function yt(e){return typeof e=="string"&&(e=Ns(e)),se(e),e}function ue(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];se(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const i=e[r];n.set(i,s),s+=i.length}return n}class Kt{}function Qn(e){const t=r=>e().update(yt(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Jn(e=32){if(Ie&&typeof Ie.getRandomValues=="function")return Ie.getRandomValues(new Uint8Array(e));if(Ie&&typeof Ie.randomBytes=="function")return Uint8Array.from(Ie.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Yt=BigInt(0),Nt=BigInt(1);function rt(e,t=""){if(typeof e!="boolean"){const n=t&&`"${t}"`;throw new Error(n+"expected boolean, got type="+typeof e)}return e}function me(e,t,n=""){const r=pt(e),s=e?.length,i=t!==void 0;if(!r||i&&s!==t){const o=n&&`"${n}" `,a=i?` of length ${t}`:"",c=r?`length=${s}`:`type=${typeof e}`;throw new Error(o+"expected Uint8Array"+a+", got "+c)}return e}function Xe(e){const t=e.toString(16);return t.length&1?"0"+t:t}function er(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Yt:BigInt("0x"+e)}function mt(e){return er(Pe(e))}function tr(e){return se(e),er(Pe(Uint8Array.from(e).reverse()))}function Wt(e,t){return nt(e.toString(16).padStart(t*2,"0"))}function nr(e,t){return Wt(e,t).reverse()}function Z(e,t,n){let r;if(typeof t=="string")try{r=nt(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(pt(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");return r.length,r}const At=e=>typeof e=="bigint"&&Yt<=e;function Us(e,t,n){return At(e)&&At(t)&&At(n)&&t<=e&&e<n}function ks(e,t,n,r){if(!Us(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function rr(e){let t;for(t=0;e>Yt;e>>=Nt,t+=1);return t}const Ve=e=>(Nt<<BigInt(e))-Nt;function Hs(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");const r=h=>new Uint8Array(h),s=h=>Uint8Array.of(h);let i=r(e),o=r(e),a=0;const c=()=>{i.fill(1),o.fill(0),a=0},u=(...h)=>n(o,i,...h),l=(h=r(0))=>{o=u(s(0),h),i=u(),h.length!==0&&(o=u(s(1),h),i=u())},f=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const g=[];for(;h<t;){i=u();const w=i.slice();g.push(w),h+=i.length}return ue(...g)};return(h,g)=>{c(),l(h);let w;for(;!(w=g(f()));)l();return c(),w}}function Xt(e,t,n={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function r(s,i,o){const a=e[s];if(o&&a===void 0)return;const c=typeof a;if(c!==i||a===null)throw new Error(`param "${s}" is invalid: expected ${i}, got ${c}`)}Object.entries(t).forEach(([s,i])=>r(s,i,!1)),Object.entries(n).forEach(([s,i])=>r(s,i,!0))}function Bn(e){const t=new WeakMap;return(n,...r)=>{const s=t.get(n);if(s!==void 0)return s;const i=e(n,...r);return t.set(n,i),i}}const Ms="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";function Pc(e){return e.toLowerCase()===Ms}const $c="0x0000000000000000000000000000000000000000";async function sr(e){if(e.id===1337||e.id===31337)return!1;if(e.id===324||e.id===300||e.id===302||e.id===11124||e.id===282||e.id===388||e.id===4654||e.id===333271||e.id===37111||e.id===978658||e.id===531050104||e.id===4457845||e.id===2741||e.id===240||e.id===555271||e.id===61166||e.id===555272)return!0;try{const{getChainMetadata:t}=await he(async()=>{const{getChainMetadata:r}=await import("./utils-CozXUO91.js");return{getChainMetadata:r}},__vite__mapDeps([0,1]));return(await t(e)).stackType==="zksync_stack"}catch{return!1}}function Le(e){let t;if(typeof e=="string")t=wn(e);else{const n=vs(e),r=e.length;for(let s=0;s<r;s++){const i=e[s];if(!Bs(i)){t=wn(i,n);break}}}if(!t)throw new Is({signature:e});return t}async function Ds(e){if(await sr(e.transaction.chain)){const{getZkGasFees:w}=await he(async()=>{const{getZkGasFees:C}=await import("./send-eip712-transaction-CI65hvCl.js").then(J=>J.a);return{getZkGasFees:C}},__vite__mapDeps([2,3,4,5,0,1,6,7,8,9,10,11,12])),{gas:P,maxFeePerGas:z,maxPriorityFeePerGas:pe}=await w({from:typeof e.from=="string"?Ce(e.from):e.from!==void 0?Ce(e.from.address):void 0,transaction:e.transaction});e.transaction={...e.transaction,gas:P,maxFeePerGas:z,maxPriorityFeePerGas:pe}}const n=lt(e.transaction),r=e.transaction.chain.id,s=e.from;let[i,o,a,c,u,l,f,d,h]=await Promise.all([Gt(e.transaction),(async()=>{const w=await ce(e.transaction.nonce);return w!==void 0?w:s?await he(async()=>{const{eth_getTransactionCount:P}=await import("./eth_getTransactionCount-DWnnw2mX.js");return{eth_getTransactionCount:P}},__vite__mapDeps([13,8])).then(({eth_getTransactionCount:P})=>P(n,{address:typeof s=="string"?Ce(s):Ce(s.address),blockTag:"pending"})):void 0})(),As({...e,from:e.from}),Es(e.transaction),ce(e.transaction.to),ce(e.transaction.accessList),ce(e.transaction.value),ce(e.transaction.authorizationList),ce(e.transaction.type)]);const g=await ce(e.transaction.extraGas);return g&&(a+=g),{accessList:l,authorizationList:d,chainId:r,data:i,gas:a,nonce:o,to:u,type:h,value:f,...c}}function Vs(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,{balance:n.balance?le(n.balance):void 0,code:n.code,nonce:n.nonce?le(n.nonce):void 0,state:n.state,stateDiff:n.stateDiff}]))}async function ir(e,t){const{blockNumber:n,blockTag:r,...s}=t,o=(n?le(n):void 0)||r||"latest";return await e({method:"eth_call",params:t.stateOverrides?[s,o,Vs(t.stateOverrides)]:[s,o]})}async function _c(e,t){const n=await e({method:"eth_getBalance",params:[t.address,t.blockTag||"latest"]});return us(n)}async function js(e,t){return e({method:"eth_getCode",params:[t.address,t.blockTag||"latest"]})}async function Tc(e,t){return await e({method:"eth_sendRawTransaction",params:[t]})}async function Oc({client:e,walletAddress:t,email:n,phone:r,id:s,externalWalletAddress:i,ecosystem:o}){if(!e.secretKey)throw new Error("A secret key is required to query for users. If you're making this request from the server, please add a secret key to your client.");const a=new URL(`${gs("inAppWallet")}/api/2023-11-30/embedded-wallet/user-details`);if(t)a.searchParams.set("queryBy","walletAddress"),a.searchParams.set("walletAddress",t);else if(n)a.searchParams.set("queryBy","email"),a.searchParams.set("email",n);else if(r)a.searchParams.set("queryBy","phone"),a.searchParams.set("phone",r);else if(s)a.searchParams.set("queryBy","id"),a.searchParams.set("id",s);else if(i)a.searchParams.set("queryBy","externalWalletAddress"),a.searchParams.set("externalWalletAddress",i);else throw new Error("Please provide a walletAddress, email, phone, id, or externalWalletAddress to query for users.");const u=await bs(e,o)(a.toString());if(!u.ok){const f=await u.text().catch(()=>"Unknown error");throw new Error(`Failed to get profiles. ${u.status} ${u.statusText}: ${f}`)}return(await u.json()).map(f=>({createdAt:f.createdAt,email:f.email,phone:f.phone,profiles:f.linkedAccounts.map(d=>({details:d.details,type:d.type==="siwe"?"wallet":d.type})),smartAccountAddress:f.smartAccountAddress,userId:f.userId,walletAddress:f.walletAddress}))[0]||null}function qs(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="event")}const{encodeEventTopics:Zs,toEventHash:Fs}=await De("viem");function Lc(e){const{signature:t}=e;let n;return qs(t)?n=t:n=Le(t),{abiEvent:n,hash:Fs(n),topics:Zs({abi:[n],args:e.filters})}}const{parseEventLogs:Gs}=await De("viem");function zc(e){const{logs:t,events:n,strict:r}=e;return Gs({abi:n.map(s=>s.abiEvent),logs:t,strict:r})}function Ks(e){for(const t of e)if(typeof t!="string")return!1;return!0}function Ys(e){return Ks(e)?Ss(e):e}function Ws(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,a,r)}function Xs(e,t,n){return e&t^~e&n}function Qs(e,t,n){return e&t^e&n^t&n}class Js extends Kt{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=It(this.buffer)}update(t){Te(this),t=yt(t),se(t);const{view:n,buffer:r,blockLen:s}=this,i=t.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const c=It(t);for(;s<=i-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Te(this),Wn(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;n[o++]=128,Oe(this.buffer.subarray(o)),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;Ws(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=It(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,l[f],i)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return t.destroyed=o,t.finished=i,t.length=s,t.pos=a,s%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const oe=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qe=BigInt(2**32-1),In=BigInt(32);function ei(e,t=!1){return t?{h:Number(e&Qe),l:Number(e>>In&Qe)}:{h:Number(e>>In&Qe)|0,l:Number(e&Qe)|0}}function ti(e,t=!1){const n=e.length;let r=new Uint32Array(n),s=new Uint32Array(n);for(let i=0;i<n;i++){const{h:o,l:a}=ei(e[i],t);[r[i],s[i]]=[o,a]}return[r,s]}const ni=(e,t,n)=>e<<n|t>>>32-n,ri=(e,t,n)=>t<<n|e>>>32-n,si=(e,t,n)=>t<<n-32|e>>>64-n,ii=(e,t,n)=>e<<n-32|t>>>64-n,oi=BigInt(0),Re=BigInt(1),ai=BigInt(2),ci=BigInt(7),ui=BigInt(256),fi=BigInt(113),or=[],ar=[],cr=[];for(let e=0,t=Re,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],or.push(2*(5*r+n)),ar.push((e+1)*(e+2)/2%64);let s=oi;for(let i=0;i<7;i++)t=(t<<Re^(t>>ci)*fi)%ui,t&ai&&(s^=Re<<(Re<<BigInt(i))-Re);cr.push(s)}const ur=ti(cr,!0),di=ur[0],li=ur[1],An=(e,t,n)=>n>32?si(e,t,n):ni(e,t,n),Sn=(e,t,n)=>n>32?ii(e,t,n):ri(e,t,n);function hi(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=n[c],l=n[c+1],f=An(u,l,1)^n[a],d=Sn(u,l,1)^n[a+1];for(let h=0;h<50;h+=10)e[o+h]^=f,e[o+h+1]^=d}let s=e[2],i=e[3];for(let o=0;o<24;o++){const a=ar[o],c=An(s,i,a),u=Sn(s,i,a),l=or[o];s=e[l],i=e[l+1],e[l]=c,e[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=di[r],e[1]^=li[r]}Oe(n)}class Qt extends Kt{constructor(t,n,r,s=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=i,ke(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Os(this.state)}clone(){return this._cloneInto()}keccak(){En(this.state32),hi(this.state32,this.rounds),En(this.state32),this.posOut=0,this.pos=0}update(t){Te(this),t=yt(t),se(t);const{blockLen:n,state:r}=this,s=t.length;for(let i=0;i<s;){const o=Math.min(n-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){Te(this,!1),se(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,i=t.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return ke(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Wn(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Oe(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return t||(t=new Qt(n,r,s,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}}const pi=(e,t,n)=>Qn(()=>new Qt(t,e,n)),yi=pi(1,136,256/8),mi=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ae=new Uint32Array(64);class gi extends Js{constructor(t=32){super(64,t,8,!1),this.A=oe[0]|0,this.B=oe[1]|0,this.C=oe[2]|0,this.D=oe[3]|0,this.E=oe[4]|0,this.F=oe[5]|0,this.G=oe[6]|0,this.H=oe[7]|0}get(){const{A:t,B:n,C:r,D:s,E:i,F:o,G:a,H:c}=this;return[t,n,r,s,i,o,a,c]}set(t,n,r,s,i,o,a,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(t,n){for(let f=0;f<16;f++,n+=4)ae[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const d=ae[f-15],h=ae[f-2],g=W(d,7)^W(d,18)^d>>>3,w=W(h,17)^W(h,19)^h>>>10;ae[f]=w+ae[f-7]+g+ae[f-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){const d=W(a,6)^W(a,11)^W(a,25),h=l+d+Xs(a,c,u)+mi[f]+ae[f]|0,w=(W(r,2)^W(r,13)^W(r,22))+Qs(r,s,i)|0;l=u,u=c,c=a,a=o+h|0,o=i,i=s,s=r,r=h+w|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(r,s,i,o,a,c,u,l)}roundClean(){Oe(ae)}destroy(){this.set(0,0,0,0,0,0,0,0),Oe(this.buffer)}}const bi=Qn(()=>new gi);function K(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=yi(Rt(e));return n==="Bytes"?r:re(r)}class wi extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const xi={checksum:new wi(8192)},St=xi.checksum;function fr(e,t={}){const{compressed:n}=t,{prefix:r,x:s,y:i}=e;if(n===!1||typeof s=="bigint"&&typeof i=="bigint"){if(r!==4)throw new Pn({prefix:r,cause:new Si});return}if(n===!0||typeof s=="bigint"&&typeof i>"u"){if(r!==3&&r!==2)throw new Pn({prefix:r,cause:new Ai});return}throw new Ii({publicKey:e})}function Ei(e){const t=(()=>{if(Dn(e))return dr(e);if(fs(e))return vi(e);const{prefix:n,x:r,y:s}=e;return typeof r=="bigint"&&typeof s=="bigint"?{prefix:n??4,x:r,y:s}:{prefix:n,x:r}})();return fr(t),t}function vi(e){return dr(re(e))}function dr(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new Pi({publicKey:e});if(e.length===130){const r=BigInt(D(e,0,32)),s=BigInt(D(e,32,64));return{prefix:4,x:r,y:s}}if(e.length===132){const r=Number(D(e,0,1)),s=BigInt(D(e,1,33)),i=BigInt(D(e,33,65));return{prefix:r,x:s,y:i}}const t=Number(D(e,0,1)),n=BigInt(D(e,1,33));return{prefix:t,x:n}}function Bi(e,t={}){fr(e);const{prefix:n,x:r,y:s}=e,{includePrefix:i=!0}=t;return R(i?I(n,{size:1}):"0x",I(r,{size:32}),typeof s=="bigint"?I(s,{size:32}):"0x")}class Ii extends S{constructor({publicKey:t}){super(`Value \`${ut(t)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class Pn extends S{constructor({prefix:t,cause:n}){super(`Prefix "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class Ai extends S{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class Si extends S{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let Pi=class extends S{constructor({publicKey:t}){super(`Value \`${t}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${j(ft(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const $i=/^0x[a-fA-F0-9]{40}$/;function Q(e,t={}){const{strict:n=!0}=t;if(!$i.test(e))throw new Ut({address:e,cause:new lr});if(n){if(e.toLowerCase()===e)return;if(Jt(e)!==e)throw new Ut({address:e,cause:new Oi})}}function Jt(e){if(St.has(e))return St.get(e);Q(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=K(Vn(t),{as:"Bytes"}),r=t.split("");for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&r[i]&&(r[i]=r[i].toUpperCase()),(n[i>>1]&15)>=8&&r[i+1]&&(r[i+1]=r[i+1].toUpperCase());const s=`0x${r.join("")}`;return St.set(e,s),s}function _i(e,t={}){const{checksum:n=!1}=t;return Q(e),n?Jt(e):e}function Ti(e,t={}){const n=K(`0x${Bi(e).slice(4)}`).substring(26);return _i(`0x${n}`,t)}function st(e,t={}){const{strict:n=!0}=t??{};try{return Q(e,{strict:n}),!0}catch{return!1}}class Ut extends S{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class lr extends S{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class Oi extends S{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function kt(e){let t=!0,n="",r=0,s="",i=!1;for(let o=0;o<e.length;o++){const a=e[o];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function","error",""].includes(s))s="";else if(s+=a,a===")"){i=!0;break}continue}if(a===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=a,n+=a}}if(!i)throw new S("Unable to normalize signature.");return s}function Ht(e,t){const n=typeof e,r=t.type;switch(r){case"address":return st(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,i)=>Ht(Object.values(e)[i],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>Ht(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function hr(e,t,n){for(const r in e){const s=e[r],i=t[r];if(s.type==="tuple"&&i.type==="tuple"&&"components"in s&&"components"in i)return hr(s.components,i.components,n[r]);const o=[s.type,i.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?st(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?st(n[r],{strict:!1}):!1)return o}}function Li(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?Le(e):e;return{...r,...n?{hash:Ae(r)}:{}}}function zi(e,t,n){const{args:r=[],prepare:s=!0}=n??{},i=Dn(t,{strict:!1}),o=e.filter(u=>i?u.type==="function"||u.type==="error"?pr(u)===D(t,0,4):u.type==="event"?Ae(u)===t:!1:"name"in u&&u.name===t);if(o.length===0)throw new it({name:t});if(o.length===1)return{...o[0],...s?{hash:Ae(o[0])}:{}};let a;for(const u of o){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...s?{hash:Ae(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((f,d)=>{const h="inputs"in u&&u.inputs[d];return h?Ht(f,h):!1})){if(a&&"inputs"in a&&a.inputs){const f=hr(u.inputs,a.inputs,r);if(f)throw new Ci({abiItem:u,type:f[0]},{abiItem:a,type:f[1]})}a=u}}const c=(()=>{if(a)return a;const[u,...l]=o;return{...u,overloads:l}})();if(!c)throw new it({name:t});return{...c,...s?{hash:Ae(c)}:{}}}function pr(e){return D(Ae(e),0,4)}function Ri(e){const t=typeof e=="string"?e:Ct(e);return kt(t)}function Ae(e){return typeof e!="string"&&"hash"in e&&e.hash?e.hash:K(dt(Ri(e)))}class Ci extends S{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${kt(Ct(t.abiItem))}\`, and`,`\`${n.type}\` in \`${kt(Ct(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class it extends S{constructor({name:t,data:n,type:r="item"}){const s=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}class Ni extends S{constructor({data:t}){super(`Selector size is invalid. Expected 4 bytes. Received ${j(t)} bytes ("${t}").`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.InvalidSelectorSizeError"})}}const Ui=/^(.*)\[([0-9]*)\]$/,yr=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,en=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Cc=2n**96n-1n,$n=2n**256n-1n;function $e(e,t,n){const{checksumAddress:r,staticPosition:s}=n,i=rn(t.type);if(i){const[o,a]=i;return Hi(e,{...t,type:a},{checksumAddress:r,length:o,staticPosition:s})}if(t.type==="tuple")return ji(e,t,{checksumAddress:r,staticPosition:s});if(t.type==="address")return ki(e,{checksum:r});if(t.type==="bool")return Mi(e);if(t.type.startsWith("bytes"))return Di(e,t,{staticPosition:s});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Vi(e,t);if(t.type==="string")return qi(e,{staticPosition:s});throw new sn(t.type)}const _n=32,Mt=32;function ki(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(i=>n?Jt(i):i)(re(ds(r,-20))),32]}function Hi(e,t,n){const{checksumAddress:r,length:s,staticPosition:i}=n;if(!s){const c=X(e.readBytes(Mt)),u=i+c,l=u+_n;e.setPosition(u);const f=X(e.readBytes(_n)),d=He(t);let h=0;const g=[];for(let w=0;w<f;++w){e.setPosition(l+(d?w*32:h));const[P,z]=$e(e,t,{checksumAddress:r,staticPosition:l});h+=z,g.push(P)}return e.setPosition(i+32),[g,32]}if(He(t)){const c=X(e.readBytes(Mt)),u=i+c,l=[];for(let f=0;f<s;++f){e.setPosition(u+f*32);const[d]=$e(e,t,{checksumAddress:r,staticPosition:u});l.push(d)}return e.setPosition(i+32),[l,32]}let o=0;const a=[];for(let c=0;c<s;++c){const[u,l]=$e(e,t,{checksumAddress:r,staticPosition:i+o});o+=l,a.push(u)}return[a,o]}function Mi(e){return[jn(e.readBytes(32),{size:32}),32]}function Di(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const o=X(e.readBytes(32));e.setPosition(n+o);const a=X(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(a);return e.setPosition(n+32),[re(c),32]}return[re(e.readBytes(Number.parseInt(s),32)),32]}function Vi(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),s=e.readBytes(32);return[r>48?qn(s,{signed:n}):X(s,{signed:n}),32]}function ji(e,t,n){const{checksumAddress:r,staticPosition:s}=n,i=t.components.length===0||t.components.some(({name:c})=>!c),o=i?[]:{};let a=0;if(He(t)){const c=X(e.readBytes(Mt)),u=s+c;for(let l=0;l<t.components.length;++l){const f=t.components[l];e.setPosition(u+a);const[d,h]=$e(e,f,{checksumAddress:r,staticPosition:u});a+=h,o[i?l:f?.name]=d}return e.setPosition(s+32),[o,32]}for(let c=0;c<t.components.length;++c){const u=t.components[c],[l,f]=$e(e,u,{checksumAddress:r,staticPosition:s});o[i?c:u?.name]=l,a+=f}return[o,a]}function qi(e,{staticPosition:t}){const n=X(e.readBytes(32)),r=t+n;e.setPosition(r);const s=X(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const i=e.readBytes(s,32),o=Zn(ls(i));return e.setPosition(t+32),[o,32]}function Zi({checksumAddress:e,parameters:t,values:n}){const r=[];for(let s=0;s<t.length;s++)r.push(tn({checksumAddress:e,parameter:t[s],value:n[s]}));return r}function tn({checksumAddress:e=!1,parameter:t,value:n}){const r=t,s=rn(r.type);if(s){const[i,o]=s;return Gi(n,{checksumAddress:e,length:i,parameter:{...r,type:o}})}if(r.type==="tuple")return Qi(n,{checksumAddress:e,parameter:r});if(r.type==="address")return Fi(n,{checksum:e});if(r.type==="bool")return Yi(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const i=r.type.startsWith("int"),[,,o="256"]=en.exec(r.type)??[];return Wi(n,{signed:i,size:Number(o)})}if(r.type.startsWith("bytes"))return Ki(n,{type:r.type});if(r.type==="string")return Xi(n);throw new sn(r.type)}function nn(e){let t=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:a}=e[i];o?t+=32:t+=j(a)}const n=[],r=[];let s=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:a}=e[i];o?(n.push(I(t+s,{size:32})),r.push(a),s+=j(a)):n.push(a)}return R(...n,...r)}function Fi(e,t){const{checksum:n=!1}=t;return Q(e,{strict:n}),{dynamic:!1,encoded:Ne(e.toLowerCase())}}function Gi(e,t){const{checksumAddress:n,length:r,parameter:s}=t,i=r===null;if(!Array.isArray(e))throw new oo(e);if(!i&&e.length!==r)throw new io({expectedLength:r,givenLength:e.length,type:`${s.type}[${r}]`});let o=!1;const a=[];for(let c=0;c<e.length;c++){const u=tn({checksumAddress:n,parameter:s,value:e[c]});u.dynamic&&(o=!0),a.push(u)}if(i||o){const c=nn(a);if(i){const u=I(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?R(u,c):u}}if(o)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:R(...a.map(({encoded:c})=>c))}}function Ki(e,{type:t}){const[,n]=t.split("bytes"),r=j(e);if(!n){let s=e;return r%32!==0&&(s=Ue(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:R(Ne(I(r,{size:32})),s)}}if(r!==Number.parseInt(n))throw new gr({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:Ue(e)}}function Yi(e){if(typeof e!="boolean")throw new S(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Ne(Fn(e))}}function Wi(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new hs({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:I(e,{size:32,signed:t})}}function Xi(e){const t=dt(e),n=Math.ceil(j(t)/32),r=[];for(let s=0;s<n;s++)r.push(Ue(D(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:R(Ue(I(j(t),{size:32})),...r)}}function Qi(e,t){const{checksumAddress:n,parameter:r}=t;let s=!1;const i=[];for(let o=0;o<r.components.length;o++){const a=r.components[o],c=Array.isArray(e)?o:a.name,u=tn({checksumAddress:n,parameter:a,value:e[c]});i.push(u),u.dynamic&&(s=!0)}return{dynamic:s,encoded:s?nn(i):R(...i.map(({encoded:o})=>o))}}function rn(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function He(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(He);const n=rn(e.type);return!!(n&&He({...e,type:n[1]}))}const Ji={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new to({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new eo({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Tn({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Tn({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function mr(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Ji);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class Tn extends S{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class eo extends S{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class to extends S{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function no(e,t,n={}){const{as:r="Array",checksumAddress:s=!1}=n,i=typeof t=="string"?Zt(t):t,o=mr(i);if(We(i)===0&&e.length>0)throw new so;if(We(i)&&We(i)<32)throw new ro({data:typeof t=="string"?t:re(t),parameters:e,size:We(i)});let a=0;const c=r==="Array"?[]:{};for(let u=0;u<e.length;++u){const l=e[u];o.setPosition(a);const[f,d]=$e(o,l,{checksumAddress:s,staticPosition:0});a+=d,r==="Array"?c.push(f):c[l.name??u]=f}return c}function gt(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new br({expectedLength:e.length,givenLength:t.length});const s=Zi({checksumAddress:r,parameters:e,values:t}),i=nn(s);return i.length===0?"0x":i}function Dt(e,t){if(e.length!==t.length)throw new br({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r];n.push(Dt.encode(s,i))}return R(...n)}(function(e){function t(n,r,s=!1){if(n==="address"){const c=r;return Q(c),Ne(c.toLowerCase(),s?32:0)}if(n==="string")return dt(r);if(n==="bytes")return r;if(n==="bool")return Ne(Fn(r),s?32:1);const i=n.match(en);if(i){const[c,u,l="256"]=i,f=Number.parseInt(l)/8;return I(r,{size:s?32:f,signed:u==="int"})}const o=n.match(yr);if(o){const[c,u]=o;if(Number.parseInt(u)!==(r.length-2)/2)throw new gr({expectedSize:Number.parseInt(u),value:r});return Ue(r,s?32:0)}const a=n.match(Ui);if(a&&Array.isArray(r)){const[c,u]=a,l=[];for(let f=0;f<r.length;f++)l.push(t(u,r[f],!0));return l.length===0?"0x":R(...l)}throw new sn(n)}e.encode=t})(Dt||(Dt={}));class ro extends S{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Ps(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class so extends S{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class io extends S{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}let gr=class extends S{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${j(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}};class br extends S{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
|
|
1
|
+
const __vite__fileDeps=["assets/utils-CozXUO91.js","assets/withCache-DYumIHzL.js","assets/send-eip712-transaction-CxRy-sD1.js","assets/preload-helper-BokH5fd6.js","assets/__federation_fn_import-D82-s3kA.js","assets/rpc-ti0b0r_u.js","assets/json-BHzNJmTy.js","assets/estimate-gas-CMPxVjuF.js","assets/hex-B0Rx0hII.js","assets/op-gas-fee-reducer-CfxMcvXl.js","assets/encode-JOmK-dAM.js","assets/utils-C7urdXtO.js","assets/sha256-DYtpy1Qz.js","assets/eth_getTransactionCount-DWnnw2mX.js","assets/send-gasless-transaction-Iz8ZLiHO.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
|
|
2
|
+
import{n as le,h as us,m as Rt,o as re,q as R,i as I,v as Dn,r as fs,w as D,B as S,x as ut,y as j,z as ft,e as Vn,A as dt,C as X,D as ds,E as jn,F as qn,G as Zn,H as ls,I as Ne,J as Fn,K as hs,L as Ue,c as Zt,M as We,N as tt,p as we,j as ps,s as Ft,O as Be,u as ys,l as ms,P as Gn,t as Kn}from"./hex-B0Rx0hII.js";import{b as gs,a as bs,L as ws,w as xs}from"./withCache-DYumIHzL.js";import{importShared as De}from"./__federation_fn_import-D82-s3kA.js";import{_ as he}from"./preload-helper-BokH5fd6.js";import{j as Es}from"./fee-data-BCMgs11D.js";import{getRpcClient as lt}from"./rpc-ti0b0r_u.js";import{v as wn,x as vs,y as Bs,I as Is,g as Ce,n as As,z as Ss,A as Ct,B as Ps,b as ht,i as $s,a as Bt,s as xn,u as _s,k as fe}from"./estimate-gas-CMPxVjuF.js";import{r as ce}from"./op-gas-fee-reducer-CfxMcvXl.js";import{encode as Gt}from"./encode-JOmK-dAM.js";import{stringify as Ts}from"./json-BHzNJmTy.js";const Ie=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function pt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ke(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function se(e,...t){if(!pt(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Yn(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");ke(e.outputLen),ke(e.blockLen)}function Te(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Wn(e,t){se(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Os(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Oe(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function It(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function W(e,t){return e<<32-t|e>>>t}const Ls=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function zs(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Rs(e){for(let t=0;t<e.length;t++)e[t]=zs(e[t]);return e}const En=Ls?e=>e:Rs,Xn=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Cs=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Pe(e){if(se(e),Xn)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Cs[e[n]];return t}const ee={_0:48,_9:57,A:65,F:70,a:97,f:102};function vn(e){if(e>=ee._0&&e<=ee._9)return e-ee._0;if(e>=ee.A&&e<=ee.F)return e-(ee.A-10);if(e>=ee.a&&e<=ee.f)return e-(ee.a-10)}function nt(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Xn)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let s=0,i=0;s<n;s++,i+=2){const o=vn(e.charCodeAt(i)),a=vn(e.charCodeAt(i+1));if(o===void 0||a===void 0){const c=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}r[s]=o*16+a}return r}function Ns(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function yt(e){return typeof e=="string"&&(e=Ns(e)),se(e),e}function ue(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];se(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const i=e[r];n.set(i,s),s+=i.length}return n}class Kt{}function Qn(e){const t=r=>e().update(yt(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Jn(e=32){if(Ie&&typeof Ie.getRandomValues=="function")return Ie.getRandomValues(new Uint8Array(e));if(Ie&&typeof Ie.randomBytes=="function")return Uint8Array.from(Ie.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Yt=BigInt(0),Nt=BigInt(1);function rt(e,t=""){if(typeof e!="boolean"){const n=t&&`"${t}"`;throw new Error(n+"expected boolean, got type="+typeof e)}return e}function me(e,t,n=""){const r=pt(e),s=e?.length,i=t!==void 0;if(!r||i&&s!==t){const o=n&&`"${n}" `,a=i?` of length ${t}`:"",c=r?`length=${s}`:`type=${typeof e}`;throw new Error(o+"expected Uint8Array"+a+", got "+c)}return e}function Xe(e){const t=e.toString(16);return t.length&1?"0"+t:t}function er(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Yt:BigInt("0x"+e)}function mt(e){return er(Pe(e))}function tr(e){return se(e),er(Pe(Uint8Array.from(e).reverse()))}function Wt(e,t){return nt(e.toString(16).padStart(t*2,"0"))}function nr(e,t){return Wt(e,t).reverse()}function Z(e,t,n){let r;if(typeof t=="string")try{r=nt(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(pt(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");return r.length,r}const At=e=>typeof e=="bigint"&&Yt<=e;function Us(e,t,n){return At(e)&&At(t)&&At(n)&&t<=e&&e<n}function ks(e,t,n,r){if(!Us(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function rr(e){let t;for(t=0;e>Yt;e>>=Nt,t+=1);return t}const Ve=e=>(Nt<<BigInt(e))-Nt;function Hs(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");const r=h=>new Uint8Array(h),s=h=>Uint8Array.of(h);let i=r(e),o=r(e),a=0;const c=()=>{i.fill(1),o.fill(0),a=0},u=(...h)=>n(o,i,...h),l=(h=r(0))=>{o=u(s(0),h),i=u(),h.length!==0&&(o=u(s(1),h),i=u())},f=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const g=[];for(;h<t;){i=u();const w=i.slice();g.push(w),h+=i.length}return ue(...g)};return(h,g)=>{c(),l(h);let w;for(;!(w=g(f()));)l();return c(),w}}function Xt(e,t,n={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function r(s,i,o){const a=e[s];if(o&&a===void 0)return;const c=typeof a;if(c!==i||a===null)throw new Error(`param "${s}" is invalid: expected ${i}, got ${c}`)}Object.entries(t).forEach(([s,i])=>r(s,i,!1)),Object.entries(n).forEach(([s,i])=>r(s,i,!0))}function Bn(e){const t=new WeakMap;return(n,...r)=>{const s=t.get(n);if(s!==void 0)return s;const i=e(n,...r);return t.set(n,i),i}}const Ms="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";function Pc(e){return e.toLowerCase()===Ms}const $c="0x0000000000000000000000000000000000000000";async function sr(e){if(e.id===1337||e.id===31337)return!1;if(e.id===324||e.id===300||e.id===302||e.id===11124||e.id===282||e.id===388||e.id===4654||e.id===333271||e.id===37111||e.id===978658||e.id===531050104||e.id===4457845||e.id===2741||e.id===240||e.id===555271||e.id===61166||e.id===555272)return!0;try{const{getChainMetadata:t}=await he(async()=>{const{getChainMetadata:r}=await import("./utils-CozXUO91.js");return{getChainMetadata:r}},__vite__mapDeps([0,1]));return(await t(e)).stackType==="zksync_stack"}catch{return!1}}function Le(e){let t;if(typeof e=="string")t=wn(e);else{const n=vs(e),r=e.length;for(let s=0;s<r;s++){const i=e[s];if(!Bs(i)){t=wn(i,n);break}}}if(!t)throw new Is({signature:e});return t}async function Ds(e){if(await sr(e.transaction.chain)){const{getZkGasFees:w}=await he(async()=>{const{getZkGasFees:C}=await import("./send-eip712-transaction-CxRy-sD1.js").then(J=>J.a);return{getZkGasFees:C}},__vite__mapDeps([2,3,4,5,0,1,6,7,8,9,10,11,12])),{gas:P,maxFeePerGas:z,maxPriorityFeePerGas:pe}=await w({from:typeof e.from=="string"?Ce(e.from):e.from!==void 0?Ce(e.from.address):void 0,transaction:e.transaction});e.transaction={...e.transaction,gas:P,maxFeePerGas:z,maxPriorityFeePerGas:pe}}const n=lt(e.transaction),r=e.transaction.chain.id,s=e.from;let[i,o,a,c,u,l,f,d,h]=await Promise.all([Gt(e.transaction),(async()=>{const w=await ce(e.transaction.nonce);return w!==void 0?w:s?await he(async()=>{const{eth_getTransactionCount:P}=await import("./eth_getTransactionCount-DWnnw2mX.js");return{eth_getTransactionCount:P}},__vite__mapDeps([13,8])).then(({eth_getTransactionCount:P})=>P(n,{address:typeof s=="string"?Ce(s):Ce(s.address),blockTag:"pending"})):void 0})(),As({...e,from:e.from}),Es(e.transaction),ce(e.transaction.to),ce(e.transaction.accessList),ce(e.transaction.value),ce(e.transaction.authorizationList),ce(e.transaction.type)]);const g=await ce(e.transaction.extraGas);return g&&(a+=g),{accessList:l,authorizationList:d,chainId:r,data:i,gas:a,nonce:o,to:u,type:h,value:f,...c}}function Vs(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,{balance:n.balance?le(n.balance):void 0,code:n.code,nonce:n.nonce?le(n.nonce):void 0,state:n.state,stateDiff:n.stateDiff}]))}async function ir(e,t){const{blockNumber:n,blockTag:r,...s}=t,o=(n?le(n):void 0)||r||"latest";return await e({method:"eth_call",params:t.stateOverrides?[s,o,Vs(t.stateOverrides)]:[s,o]})}async function _c(e,t){const n=await e({method:"eth_getBalance",params:[t.address,t.blockTag||"latest"]});return us(n)}async function js(e,t){return e({method:"eth_getCode",params:[t.address,t.blockTag||"latest"]})}async function Tc(e,t){return await e({method:"eth_sendRawTransaction",params:[t]})}async function Oc({client:e,walletAddress:t,email:n,phone:r,id:s,externalWalletAddress:i,ecosystem:o}){if(!e.secretKey)throw new Error("A secret key is required to query for users. If you're making this request from the server, please add a secret key to your client.");const a=new URL(`${gs("inAppWallet")}/api/2023-11-30/embedded-wallet/user-details`);if(t)a.searchParams.set("queryBy","walletAddress"),a.searchParams.set("walletAddress",t);else if(n)a.searchParams.set("queryBy","email"),a.searchParams.set("email",n);else if(r)a.searchParams.set("queryBy","phone"),a.searchParams.set("phone",r);else if(s)a.searchParams.set("queryBy","id"),a.searchParams.set("id",s);else if(i)a.searchParams.set("queryBy","externalWalletAddress"),a.searchParams.set("externalWalletAddress",i);else throw new Error("Please provide a walletAddress, email, phone, id, or externalWalletAddress to query for users.");const u=await bs(e,o)(a.toString());if(!u.ok){const f=await u.text().catch(()=>"Unknown error");throw new Error(`Failed to get profiles. ${u.status} ${u.statusText}: ${f}`)}return(await u.json()).map(f=>({createdAt:f.createdAt,email:f.email,phone:f.phone,profiles:f.linkedAccounts.map(d=>({details:d.details,type:d.type==="siwe"?"wallet":d.type})),smartAccountAddress:f.smartAccountAddress,userId:f.userId,walletAddress:f.walletAddress}))[0]||null}function qs(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="event")}const{encodeEventTopics:Zs,toEventHash:Fs}=await De("viem");function Lc(e){const{signature:t}=e;let n;return qs(t)?n=t:n=Le(t),{abiEvent:n,hash:Fs(n),topics:Zs({abi:[n],args:e.filters})}}const{parseEventLogs:Gs}=await De("viem");function zc(e){const{logs:t,events:n,strict:r}=e;return Gs({abi:n.map(s=>s.abiEvent),logs:t,strict:r})}function Ks(e){for(const t of e)if(typeof t!="string")return!1;return!0}function Ys(e){return Ks(e)?Ss(e):e}function Ws(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,a,r)}function Xs(e,t,n){return e&t^~e&n}function Qs(e,t,n){return e&t^e&n^t&n}class Js extends Kt{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=It(this.buffer)}update(t){Te(this),t=yt(t),se(t);const{view:n,buffer:r,blockLen:s}=this,i=t.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const c=It(t);for(;s<=i-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Te(this),Wn(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;n[o++]=128,Oe(this.buffer.subarray(o)),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;Ws(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=It(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,l[f],i)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return t.destroyed=o,t.finished=i,t.length=s,t.pos=a,s%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const oe=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qe=BigInt(2**32-1),In=BigInt(32);function ei(e,t=!1){return t?{h:Number(e&Qe),l:Number(e>>In&Qe)}:{h:Number(e>>In&Qe)|0,l:Number(e&Qe)|0}}function ti(e,t=!1){const n=e.length;let r=new Uint32Array(n),s=new Uint32Array(n);for(let i=0;i<n;i++){const{h:o,l:a}=ei(e[i],t);[r[i],s[i]]=[o,a]}return[r,s]}const ni=(e,t,n)=>e<<n|t>>>32-n,ri=(e,t,n)=>t<<n|e>>>32-n,si=(e,t,n)=>t<<n-32|e>>>64-n,ii=(e,t,n)=>e<<n-32|t>>>64-n,oi=BigInt(0),Re=BigInt(1),ai=BigInt(2),ci=BigInt(7),ui=BigInt(256),fi=BigInt(113),or=[],ar=[],cr=[];for(let e=0,t=Re,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],or.push(2*(5*r+n)),ar.push((e+1)*(e+2)/2%64);let s=oi;for(let i=0;i<7;i++)t=(t<<Re^(t>>ci)*fi)%ui,t&ai&&(s^=Re<<(Re<<BigInt(i))-Re);cr.push(s)}const ur=ti(cr,!0),di=ur[0],li=ur[1],An=(e,t,n)=>n>32?si(e,t,n):ni(e,t,n),Sn=(e,t,n)=>n>32?ii(e,t,n):ri(e,t,n);function hi(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=n[c],l=n[c+1],f=An(u,l,1)^n[a],d=Sn(u,l,1)^n[a+1];for(let h=0;h<50;h+=10)e[o+h]^=f,e[o+h+1]^=d}let s=e[2],i=e[3];for(let o=0;o<24;o++){const a=ar[o],c=An(s,i,a),u=Sn(s,i,a),l=or[o];s=e[l],i=e[l+1],e[l]=c,e[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=di[r],e[1]^=li[r]}Oe(n)}class Qt extends Kt{constructor(t,n,r,s=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=i,ke(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Os(this.state)}clone(){return this._cloneInto()}keccak(){En(this.state32),hi(this.state32,this.rounds),En(this.state32),this.posOut=0,this.pos=0}update(t){Te(this),t=yt(t),se(t);const{blockLen:n,state:r}=this,s=t.length;for(let i=0;i<s;){const o=Math.min(n-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){Te(this,!1),se(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,i=t.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return ke(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Wn(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Oe(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return t||(t=new Qt(n,r,s,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}}const pi=(e,t,n)=>Qn(()=>new Qt(t,e,n)),yi=pi(1,136,256/8),mi=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ae=new Uint32Array(64);class gi extends Js{constructor(t=32){super(64,t,8,!1),this.A=oe[0]|0,this.B=oe[1]|0,this.C=oe[2]|0,this.D=oe[3]|0,this.E=oe[4]|0,this.F=oe[5]|0,this.G=oe[6]|0,this.H=oe[7]|0}get(){const{A:t,B:n,C:r,D:s,E:i,F:o,G:a,H:c}=this;return[t,n,r,s,i,o,a,c]}set(t,n,r,s,i,o,a,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(t,n){for(let f=0;f<16;f++,n+=4)ae[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const d=ae[f-15],h=ae[f-2],g=W(d,7)^W(d,18)^d>>>3,w=W(h,17)^W(h,19)^h>>>10;ae[f]=w+ae[f-7]+g+ae[f-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){const d=W(a,6)^W(a,11)^W(a,25),h=l+d+Xs(a,c,u)+mi[f]+ae[f]|0,w=(W(r,2)^W(r,13)^W(r,22))+Qs(r,s,i)|0;l=u,u=c,c=a,a=o+h|0,o=i,i=s,s=r,r=h+w|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(r,s,i,o,a,c,u,l)}roundClean(){Oe(ae)}destroy(){this.set(0,0,0,0,0,0,0,0),Oe(this.buffer)}}const bi=Qn(()=>new gi);function K(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=yi(Rt(e));return n==="Bytes"?r:re(r)}class wi extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const xi={checksum:new wi(8192)},St=xi.checksum;function fr(e,t={}){const{compressed:n}=t,{prefix:r,x:s,y:i}=e;if(n===!1||typeof s=="bigint"&&typeof i=="bigint"){if(r!==4)throw new Pn({prefix:r,cause:new Si});return}if(n===!0||typeof s=="bigint"&&typeof i>"u"){if(r!==3&&r!==2)throw new Pn({prefix:r,cause:new Ai});return}throw new Ii({publicKey:e})}function Ei(e){const t=(()=>{if(Dn(e))return dr(e);if(fs(e))return vi(e);const{prefix:n,x:r,y:s}=e;return typeof r=="bigint"&&typeof s=="bigint"?{prefix:n??4,x:r,y:s}:{prefix:n,x:r}})();return fr(t),t}function vi(e){return dr(re(e))}function dr(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new Pi({publicKey:e});if(e.length===130){const r=BigInt(D(e,0,32)),s=BigInt(D(e,32,64));return{prefix:4,x:r,y:s}}if(e.length===132){const r=Number(D(e,0,1)),s=BigInt(D(e,1,33)),i=BigInt(D(e,33,65));return{prefix:r,x:s,y:i}}const t=Number(D(e,0,1)),n=BigInt(D(e,1,33));return{prefix:t,x:n}}function Bi(e,t={}){fr(e);const{prefix:n,x:r,y:s}=e,{includePrefix:i=!0}=t;return R(i?I(n,{size:1}):"0x",I(r,{size:32}),typeof s=="bigint"?I(s,{size:32}):"0x")}class Ii extends S{constructor({publicKey:t}){super(`Value \`${ut(t)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class Pn extends S{constructor({prefix:t,cause:n}){super(`Prefix "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class Ai extends S{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class Si extends S{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let Pi=class extends S{constructor({publicKey:t}){super(`Value \`${t}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${j(ft(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const $i=/^0x[a-fA-F0-9]{40}$/;function Q(e,t={}){const{strict:n=!0}=t;if(!$i.test(e))throw new Ut({address:e,cause:new lr});if(n){if(e.toLowerCase()===e)return;if(Jt(e)!==e)throw new Ut({address:e,cause:new Oi})}}function Jt(e){if(St.has(e))return St.get(e);Q(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=K(Vn(t),{as:"Bytes"}),r=t.split("");for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&r[i]&&(r[i]=r[i].toUpperCase()),(n[i>>1]&15)>=8&&r[i+1]&&(r[i+1]=r[i+1].toUpperCase());const s=`0x${r.join("")}`;return St.set(e,s),s}function _i(e,t={}){const{checksum:n=!1}=t;return Q(e),n?Jt(e):e}function Ti(e,t={}){const n=K(`0x${Bi(e).slice(4)}`).substring(26);return _i(`0x${n}`,t)}function st(e,t={}){const{strict:n=!0}=t??{};try{return Q(e,{strict:n}),!0}catch{return!1}}class Ut extends S{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class lr extends S{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class Oi extends S{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function kt(e){let t=!0,n="",r=0,s="",i=!1;for(let o=0;o<e.length;o++){const a=e[o];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function","error",""].includes(s))s="";else if(s+=a,a===")"){i=!0;break}continue}if(a===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=a,n+=a}}if(!i)throw new S("Unable to normalize signature.");return s}function Ht(e,t){const n=typeof e,r=t.type;switch(r){case"address":return st(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,i)=>Ht(Object.values(e)[i],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>Ht(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function hr(e,t,n){for(const r in e){const s=e[r],i=t[r];if(s.type==="tuple"&&i.type==="tuple"&&"components"in s&&"components"in i)return hr(s.components,i.components,n[r]);const o=[s.type,i.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?st(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?st(n[r],{strict:!1}):!1)return o}}function Li(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?Le(e):e;return{...r,...n?{hash:Ae(r)}:{}}}function zi(e,t,n){const{args:r=[],prepare:s=!0}=n??{},i=Dn(t,{strict:!1}),o=e.filter(u=>i?u.type==="function"||u.type==="error"?pr(u)===D(t,0,4):u.type==="event"?Ae(u)===t:!1:"name"in u&&u.name===t);if(o.length===0)throw new it({name:t});if(o.length===1)return{...o[0],...s?{hash:Ae(o[0])}:{}};let a;for(const u of o){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...s?{hash:Ae(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((f,d)=>{const h="inputs"in u&&u.inputs[d];return h?Ht(f,h):!1})){if(a&&"inputs"in a&&a.inputs){const f=hr(u.inputs,a.inputs,r);if(f)throw new Ci({abiItem:u,type:f[0]},{abiItem:a,type:f[1]})}a=u}}const c=(()=>{if(a)return a;const[u,...l]=o;return{...u,overloads:l}})();if(!c)throw new it({name:t});return{...c,...s?{hash:Ae(c)}:{}}}function pr(e){return D(Ae(e),0,4)}function Ri(e){const t=typeof e=="string"?e:Ct(e);return kt(t)}function Ae(e){return typeof e!="string"&&"hash"in e&&e.hash?e.hash:K(dt(Ri(e)))}class Ci extends S{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${kt(Ct(t.abiItem))}\`, and`,`\`${n.type}\` in \`${kt(Ct(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class it extends S{constructor({name:t,data:n,type:r="item"}){const s=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}class Ni extends S{constructor({data:t}){super(`Selector size is invalid. Expected 4 bytes. Received ${j(t)} bytes ("${t}").`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.InvalidSelectorSizeError"})}}const Ui=/^(.*)\[([0-9]*)\]$/,yr=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,en=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Cc=2n**96n-1n,$n=2n**256n-1n;function $e(e,t,n){const{checksumAddress:r,staticPosition:s}=n,i=rn(t.type);if(i){const[o,a]=i;return Hi(e,{...t,type:a},{checksumAddress:r,length:o,staticPosition:s})}if(t.type==="tuple")return ji(e,t,{checksumAddress:r,staticPosition:s});if(t.type==="address")return ki(e,{checksum:r});if(t.type==="bool")return Mi(e);if(t.type.startsWith("bytes"))return Di(e,t,{staticPosition:s});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Vi(e,t);if(t.type==="string")return qi(e,{staticPosition:s});throw new sn(t.type)}const _n=32,Mt=32;function ki(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(i=>n?Jt(i):i)(re(ds(r,-20))),32]}function Hi(e,t,n){const{checksumAddress:r,length:s,staticPosition:i}=n;if(!s){const c=X(e.readBytes(Mt)),u=i+c,l=u+_n;e.setPosition(u);const f=X(e.readBytes(_n)),d=He(t);let h=0;const g=[];for(let w=0;w<f;++w){e.setPosition(l+(d?w*32:h));const[P,z]=$e(e,t,{checksumAddress:r,staticPosition:l});h+=z,g.push(P)}return e.setPosition(i+32),[g,32]}if(He(t)){const c=X(e.readBytes(Mt)),u=i+c,l=[];for(let f=0;f<s;++f){e.setPosition(u+f*32);const[d]=$e(e,t,{checksumAddress:r,staticPosition:u});l.push(d)}return e.setPosition(i+32),[l,32]}let o=0;const a=[];for(let c=0;c<s;++c){const[u,l]=$e(e,t,{checksumAddress:r,staticPosition:i+o});o+=l,a.push(u)}return[a,o]}function Mi(e){return[jn(e.readBytes(32),{size:32}),32]}function Di(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const o=X(e.readBytes(32));e.setPosition(n+o);const a=X(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(a);return e.setPosition(n+32),[re(c),32]}return[re(e.readBytes(Number.parseInt(s),32)),32]}function Vi(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),s=e.readBytes(32);return[r>48?qn(s,{signed:n}):X(s,{signed:n}),32]}function ji(e,t,n){const{checksumAddress:r,staticPosition:s}=n,i=t.components.length===0||t.components.some(({name:c})=>!c),o=i?[]:{};let a=0;if(He(t)){const c=X(e.readBytes(Mt)),u=s+c;for(let l=0;l<t.components.length;++l){const f=t.components[l];e.setPosition(u+a);const[d,h]=$e(e,f,{checksumAddress:r,staticPosition:u});a+=h,o[i?l:f?.name]=d}return e.setPosition(s+32),[o,32]}for(let c=0;c<t.components.length;++c){const u=t.components[c],[l,f]=$e(e,u,{checksumAddress:r,staticPosition:s});o[i?c:u?.name]=l,a+=f}return[o,a]}function qi(e,{staticPosition:t}){const n=X(e.readBytes(32)),r=t+n;e.setPosition(r);const s=X(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const i=e.readBytes(s,32),o=Zn(ls(i));return e.setPosition(t+32),[o,32]}function Zi({checksumAddress:e,parameters:t,values:n}){const r=[];for(let s=0;s<t.length;s++)r.push(tn({checksumAddress:e,parameter:t[s],value:n[s]}));return r}function tn({checksumAddress:e=!1,parameter:t,value:n}){const r=t,s=rn(r.type);if(s){const[i,o]=s;return Gi(n,{checksumAddress:e,length:i,parameter:{...r,type:o}})}if(r.type==="tuple")return Qi(n,{checksumAddress:e,parameter:r});if(r.type==="address")return Fi(n,{checksum:e});if(r.type==="bool")return Yi(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const i=r.type.startsWith("int"),[,,o="256"]=en.exec(r.type)??[];return Wi(n,{signed:i,size:Number(o)})}if(r.type.startsWith("bytes"))return Ki(n,{type:r.type});if(r.type==="string")return Xi(n);throw new sn(r.type)}function nn(e){let t=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:a}=e[i];o?t+=32:t+=j(a)}const n=[],r=[];let s=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:a}=e[i];o?(n.push(I(t+s,{size:32})),r.push(a),s+=j(a)):n.push(a)}return R(...n,...r)}function Fi(e,t){const{checksum:n=!1}=t;return Q(e,{strict:n}),{dynamic:!1,encoded:Ne(e.toLowerCase())}}function Gi(e,t){const{checksumAddress:n,length:r,parameter:s}=t,i=r===null;if(!Array.isArray(e))throw new oo(e);if(!i&&e.length!==r)throw new io({expectedLength:r,givenLength:e.length,type:`${s.type}[${r}]`});let o=!1;const a=[];for(let c=0;c<e.length;c++){const u=tn({checksumAddress:n,parameter:s,value:e[c]});u.dynamic&&(o=!0),a.push(u)}if(i||o){const c=nn(a);if(i){const u=I(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?R(u,c):u}}if(o)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:R(...a.map(({encoded:c})=>c))}}function Ki(e,{type:t}){const[,n]=t.split("bytes"),r=j(e);if(!n){let s=e;return r%32!==0&&(s=Ue(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:R(Ne(I(r,{size:32})),s)}}if(r!==Number.parseInt(n))throw new gr({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:Ue(e)}}function Yi(e){if(typeof e!="boolean")throw new S(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Ne(Fn(e))}}function Wi(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new hs({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:I(e,{size:32,signed:t})}}function Xi(e){const t=dt(e),n=Math.ceil(j(t)/32),r=[];for(let s=0;s<n;s++)r.push(Ue(D(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:R(Ue(I(j(t),{size:32})),...r)}}function Qi(e,t){const{checksumAddress:n,parameter:r}=t;let s=!1;const i=[];for(let o=0;o<r.components.length;o++){const a=r.components[o],c=Array.isArray(e)?o:a.name,u=tn({checksumAddress:n,parameter:a,value:e[c]});i.push(u),u.dynamic&&(s=!0)}return{dynamic:s,encoded:s?nn(i):R(...i.map(({encoded:o})=>o))}}function rn(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function He(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(He);const n=rn(e.type);return!!(n&&He({...e,type:n[1]}))}const Ji={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new to({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new eo({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Tn({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Tn({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function mr(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Ji);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class Tn extends S{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class eo extends S{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class to extends S{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function no(e,t,n={}){const{as:r="Array",checksumAddress:s=!1}=n,i=typeof t=="string"?Zt(t):t,o=mr(i);if(We(i)===0&&e.length>0)throw new so;if(We(i)&&We(i)<32)throw new ro({data:typeof t=="string"?t:re(t),parameters:e,size:We(i)});let a=0;const c=r==="Array"?[]:{};for(let u=0;u<e.length;++u){const l=e[u];o.setPosition(a);const[f,d]=$e(o,l,{checksumAddress:s,staticPosition:0});a+=d,r==="Array"?c.push(f):c[l.name??u]=f}return c}function gt(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new br({expectedLength:e.length,givenLength:t.length});const s=Zi({checksumAddress:r,parameters:e,values:t}),i=nn(s);return i.length===0?"0x":i}function Dt(e,t){if(e.length!==t.length)throw new br({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r];n.push(Dt.encode(s,i))}return R(...n)}(function(e){function t(n,r,s=!1){if(n==="address"){const c=r;return Q(c),Ne(c.toLowerCase(),s?32:0)}if(n==="string")return dt(r);if(n==="bytes")return r;if(n==="bool")return Ne(Fn(r),s?32:1);const i=n.match(en);if(i){const[c,u,l="256"]=i,f=Number.parseInt(l)/8;return I(r,{size:s?32:f,signed:u==="int"})}const o=n.match(yr);if(o){const[c,u]=o;if(Number.parseInt(u)!==(r.length-2)/2)throw new gr({expectedSize:Number.parseInt(u),value:r});return Ue(r,s?32:0)}const a=n.match(Ui);if(a&&Array.isArray(r)){const[c,u]=a,l=[];for(let f=0;f<r.length;f++)l.push(t(u,r[f],!0));return l.length===0?"0x":R(...l)}throw new sn(n)}e.encode=t})(Dt||(Dt={}));class ro extends S{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Ps(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class so extends S{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class io extends S{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}let gr=class extends S{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${j(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}};class br extends S{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
|
|
3
3
|
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class oo extends S{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class sn extends S{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function ao(e,t){const{bytecode:n,args:r}=t;return R(n,e.inputs?.length&&r?.length?gt(e.inputs,r):"0x")}function co(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new it({name:"constructor"});return t}function Uc(e,t){const{overloads:n}=e;if(j(t)<4)throw new Ni({data:t});if(e.inputs.length===0)return;const r=n?on([e,...n],t):e;if(!(j(t)<=4))return no(r.inputs,D(t,4))}function uo(e,...t){const{overloads:n}=e,r=n?on([e,...n],e.name,{args:t[0]}):e,s=fo(r),i=t.length>0?gt(r.inputs,t[0]):void 0;return i?R(s,i):s}function kc(e,t={}){return Li(e,t)}function on(e,t,n){const r=zi(e,t,n);if(r.type!=="function")throw new it({name:t,type:"function"});return r}function fo(e){return pr(e)}function an(e){if(!e||e.length===0)return[];const t=[];for(const{address:n,storageKeys:r}of e){for(let s=0;s<r.length;s++)if(j(r[s])!==32)throw new lo({storageKey:r[s]});n&&Q(n,{strict:!1}),t.push([n,r])}return t}class lo extends S{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${j(t)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccessList.InvalidStorageKeySizeError"})}}function ho(e,t){const{as:n}=t,r=wr(e),s=mr(new Uint8Array(r.length));return r.encode(s),n==="Hex"?re(s.bytes):s.bytes}function je(e,t={}){const{as:n="Hex"}=t;return ho(e,{as:n})}function wr(e){return Array.isArray(e)?po(e.map(t=>wr(t))):yo(e)}function po(e){const t=e.reduce((s,i)=>s+i.length,0),n=xr(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:i}of e)i(s)}}}function yo(e){const t=typeof e=="string"?Zt(e):e,n=xr(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function xr(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new S("Length is too large.")}class Er extends Kt{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Yn(t);const r=yt(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?t.create().update(r).digest():r);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=t.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),Oe(i)}update(t){return Te(this),this.iHash.update(t),this}digestInto(t){Te(this),se(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return t=t,t.finished=s,t.destroyed=i,t.blockLen=o,t.outputLen=a,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const vr=(e,t,n)=>new Er(e,t).update(n).digest();vr.create=(e,t)=>new Er(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const F=BigInt(0),V=BigInt(1),ge=BigInt(2),Br=BigInt(3),Ir=BigInt(4),Ar=BigInt(5),mo=BigInt(7),Sr=BigInt(8),go=BigInt(9),Pr=BigInt(16);function Y(e,t){const n=e%t;return n>=F?n:t+n}function G(e,t,n){let r=e;for(;t-- >F;)r*=r,r%=n;return r}function On(e,t){if(e===F)throw new Error("invert: expected non-zero number");if(t<=F)throw new Error("invert: expected positive modulus, got "+t);let n=Y(e,t),r=t,s=F,i=V;for(;n!==F;){const a=r/n,c=r%n,u=s-i*a;r=n,n=c,s=i,i=u}if(r!==V)throw new Error("invert: does not exist");return Y(s,t)}function cn(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error("Cannot find square root")}function $r(e,t){const n=(e.ORDER+V)/Ir,r=e.pow(t,n);return cn(e,r,t),r}function bo(e,t){const n=(e.ORDER-Ar)/Sr,r=e.mul(t,ge),s=e.pow(r,n),i=e.mul(t,s),o=e.mul(e.mul(i,ge),s),a=e.mul(i,e.sub(o,e.ONE));return cn(e,a,t),a}function wo(e){const t=qe(e),n=_r(e),r=n(t,t.neg(t.ONE)),s=n(t,r),i=n(t,t.neg(r)),o=(e+mo)/Pr;return(a,c)=>{let u=a.pow(c,o),l=a.mul(u,r);const f=a.mul(u,s),d=a.mul(u,i),h=a.eql(a.sqr(l),c),g=a.eql(a.sqr(f),c);u=a.cmov(u,l,h),l=a.cmov(d,f,g);const w=a.eql(a.sqr(l),c),P=a.cmov(u,l,w);return cn(a,P,c),P}}function _r(e){if(e<Br)throw new Error("sqrt is not defined for small field");let t=e-V,n=0;for(;t%ge===F;)t/=ge,n++;let r=ge;const s=qe(e);for(;Ln(s,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return $r;let i=s.pow(r,t);const o=(t+V)/ge;return function(c,u){if(c.is0(u))return u;if(Ln(c,u)!==1)throw new Error("Cannot find square root");let l=n,f=c.mul(c.ONE,i),d=c.pow(u,t),h=c.pow(u,o);for(;!c.eql(d,c.ONE);){if(c.is0(d))return c.ZERO;let g=1,w=c.sqr(d);for(;!c.eql(w,c.ONE);)if(g++,w=c.sqr(w),g===l)throw new Error("Cannot find square root");const P=V<<BigInt(l-g-1),z=c.pow(f,P);l=g,f=c.sqr(z),d=c.mul(d,f),h=c.mul(h,z)}return h}}function xo(e){return e%Ir===Br?$r:e%Sr===Ar?bo:e%Pr===go?wo(e):_r(e)}const Eo=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function vo(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},n=Eo.reduce((r,s)=>(r[s]="function",r),t);return Xt(e,n),e}function Bo(e,t,n){if(n<F)throw new Error("invalid exponent, negatives unsupported");if(n===F)return e.ONE;if(n===V)return t;let r=e.ONE,s=t;for(;n>F;)n&V&&(r=e.mul(r,s)),s=e.sqr(s),n>>=V;return r}function Tr(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),s=t.reduce((o,a,c)=>e.is0(a)?o:(r[c]=o,e.mul(o,a)),e.ONE),i=e.inv(s);return t.reduceRight((o,a,c)=>e.is0(a)?o:(r[c]=e.mul(o,r[c]),e.mul(o,a)),i),r}function Ln(e,t){const n=(e.ORDER-V)/ge,r=e.pow(t,n),s=e.eql(r,e.ONE),i=e.eql(r,e.ZERO),o=e.eql(r,e.neg(e.ONE));if(!s&&!i&&!o)throw new Error("invalid Legendre symbol result");return s?1:i?0:-1}function Or(e,t){t!==void 0&&ke(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function qe(e,t,n=!1,r={}){if(e<=F)throw new Error("invalid field: expected ORDER > 0, got "+e);let s,i,o=!1,a;if(typeof t=="object"&&t!=null){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const d=t;d.BITS&&(s=d.BITS),d.sqrt&&(i=d.sqrt),typeof d.isLE=="boolean"&&(n=d.isLE),typeof d.modFromBytes=="boolean"&&(o=d.modFromBytes),a=d.allowedLengths}else typeof t=="number"&&(s=t),r.sqrt&&(i=r.sqrt);const{nBitLength:c,nByteLength:u}=Or(e,s);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let l;const f=Object.freeze({ORDER:e,isLE:n,BITS:c,BYTES:u,MASK:Ve(c),ZERO:F,ONE:V,allowedLengths:a,create:d=>Y(d,e),isValid:d=>{if(typeof d!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof d);return F<=d&&d<e},is0:d=>d===F,isValidNot0:d=>!f.is0(d)&&f.isValid(d),isOdd:d=>(d&V)===V,neg:d=>Y(-d,e),eql:(d,h)=>d===h,sqr:d=>Y(d*d,e),add:(d,h)=>Y(d+h,e),sub:(d,h)=>Y(d-h,e),mul:(d,h)=>Y(d*h,e),pow:(d,h)=>Bo(f,d,h),div:(d,h)=>Y(d*On(h,e),e),sqrN:d=>d*d,addN:(d,h)=>d+h,subN:(d,h)=>d-h,mulN:(d,h)=>d*h,inv:d=>On(d,e),sqrt:i||(d=>(l||(l=xo(e)),l(f,d))),toBytes:d=>n?nr(d,u):Wt(d,u),fromBytes:(d,h=!0)=>{if(a){if(!a.includes(d.length)||d.length>u)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+d.length);const w=new Uint8Array(u);w.set(d,n?0:w.length-d.length),d=w}if(d.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+d.length);let g=n?tr(d):mt(d);if(o&&(g=Y(g,e)),!h&&!f.isValid(g))throw new Error("invalid field element: outside of range 0..ORDER");return g},invertBatch:d=>Tr(f,d),cmov:(d,h,g)=>g?h:d});return Object.freeze(f)}function Lr(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function zr(e){const t=Lr(e);return t+Math.ceil(t/2)}function Io(e,t,n=!1){const r=e.length,s=Lr(t),i=zr(t);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const o=n?tr(e):mt(e),a=Y(o,t-V)+V;return n?nr(a,s):Wt(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ze=BigInt(0),be=BigInt(1);function ot(e,t){const n=t.negate();return e?n:t}function Pt(e,t){const n=Tr(e.Fp,t.map(r=>r.Z));return t.map((r,s)=>e.fromAffine(r.toAffine(n[s])))}function Rr(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function $t(e,t){Rr(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),s=2**e,i=Ve(e),o=BigInt(e);return{windows:n,windowSize:r,mask:i,maxNumber:s,shiftBy:o}}function zn(e,t,n){const{windowSize:r,mask:s,maxNumber:i,shiftBy:o}=n;let a=Number(e&s),c=e>>o;a>r&&(a-=i,c+=be);const u=t*r,l=u+Math.abs(a)-1,f=a===0,d=a<0,h=t%2!==0;return{nextN:c,offset:l,isZero:f,isNeg:d,isNegF:h,offsetF:u}}function Ao(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function So(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const _t=new WeakMap,Cr=new WeakMap;function Tt(e){return Cr.get(e)||1}function Rn(e){if(e!==ze)throw new Error("invalid wNAF")}class Po{constructor(t,n){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=n}_unsafeLadder(t,n,r=this.ZERO){let s=t;for(;n>ze;)n&be&&(r=r.add(s)),s=s.double(),n>>=be;return r}precomputeWindow(t,n){const{windows:r,windowSize:s}=$t(n,this.bits),i=[];let o=t,a=o;for(let c=0;c<r;c++){a=o,i.push(a);for(let u=1;u<s;u++)a=a.add(o),i.push(a);o=a.double()}return i}wNAF(t,n,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let s=this.ZERO,i=this.BASE;const o=$t(t,this.bits);for(let a=0;a<o.windows;a++){const{nextN:c,offset:u,isZero:l,isNeg:f,isNegF:d,offsetF:h}=zn(r,a,o);r=c,l?i=i.add(ot(d,n[h])):s=s.add(ot(f,n[u]))}return Rn(r),{p:s,f:i}}wNAFUnsafe(t,n,r,s=this.ZERO){const i=$t(t,this.bits);for(let o=0;o<i.windows&&r!==ze;o++){const{nextN:a,offset:c,isZero:u,isNeg:l}=zn(r,o,i);if(r=a,!u){const f=n[c];s=s.add(l?f.negate():f)}}return Rn(r),s}getPrecomputes(t,n,r){let s=_t.get(n);return s||(s=this.precomputeWindow(n,t),t!==1&&(typeof r=="function"&&(s=r(s)),_t.set(n,s))),s}cached(t,n,r){const s=Tt(t);return this.wNAF(s,this.getPrecomputes(s,t,r),n)}unsafe(t,n,r,s){const i=Tt(t);return i===1?this._unsafeLadder(t,n,s):this.wNAFUnsafe(i,this.getPrecomputes(i,t,r),n,s)}createCache(t,n){Rr(n,this.bits),Cr.set(t,n),_t.delete(t)}hasCache(t){return Tt(t)!==1}}function $o(e,t,n,r){let s=t,i=e.ZERO,o=e.ZERO;for(;n>ze||r>ze;)n&be&&(i=i.add(s)),r&be&&(o=o.add(s)),s=s.double(),n>>=be,r>>=be;return{p1:i,p2:o}}function _o(e,t,n,r){Ao(n,e),So(r,t);const s=n.length,i=r.length;if(s!==i)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,a=rr(BigInt(s));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const u=Ve(c),l=new Array(Number(u)+1).fill(o),f=Math.floor((t.BITS-1)/c)*c;let d=o;for(let h=f;h>=0;h-=c){l.fill(o);for(let w=0;w<i;w++){const P=r[w],z=Number(P>>BigInt(h)&u);l[z]=l[z].add(n[w])}let g=o;for(let w=l.length-1,P=o;w>0;w--)P=P.add(l[w]),g=g.add(P);if(d=d.add(g),h!==0)for(let w=0;w<c;w++)d=d.double()}return d}function Cn(e,t,n){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return vo(t),t}else return qe(e,{isLE:n})}function To(e,t,n={},r){if(r===void 0&&(r=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(const c of["p","n","h"]){const u=t[c];if(!(typeof u=="bigint"&&u>ze))throw new Error(`CURVE.${c} must be positive bigint`)}const s=Cn(t.p,n.Fp,r),i=Cn(t.n,n.Fn,r),a=["Gx","Gy","a","b"];for(const c of a)if(!s.isValid(t[c]))throw new Error(`CURVE.${c} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:s,Fn:i}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Nn=(e,t)=>(e+(e>=0?t:-t)/Nr)/t;function Oo(e,t,n){const[[r,s],[i,o]]=t,a=Nn(o*e,n),c=Nn(-s*e,n);let u=e-a*r-c*i,l=-a*s-c*o;const f=u<ne,d=l<ne;f&&(u=-u),d&&(l=-l);const h=Ve(Math.ceil(rr(n)/2))+_e;if(u<ne||u>=h||l<ne||l>=h)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:f,k1:u,k2neg:d,k2:l}}function Vt(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function Ot(e,t){const n={};for(let r of Object.keys(t))n[r]=e[r]===void 0?t[r]:e[r];return rt(n.lowS,"lowS"),rt(n.prehash,"prehash"),n.format!==void 0&&Vt(n.format),n}class Lo extends Error{constructor(t=""){super(t)}}const te={Err:Lo,_tlv:{encode:(e,t)=>{const{Err:n}=te;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,s=Xe(r);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const i=r>127?Xe(s.length/2|128):"";return Xe(e)+i+s+t},decode(e,t){const{Err:n}=te;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const s=t[r++],i=!!(s&128);let o=0;if(!i)o=s;else{const c=s&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const u=t.subarray(r,r+c);if(u.length!==c)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const l of u)o=o<<8|l;if(r+=c,o<128)throw new n("tlv.decode(long): not minimal encoding")}const a=t.subarray(r,r+o);if(a.length!==o)throw new n("tlv.decode: wrong value length");return{v:a,l:t.subarray(r+o)}}},_int:{encode(e){const{Err:t}=te;if(e<ne)throw new t("integer: negative integers are not allowed");let n=Xe(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=te;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return mt(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=te,s=Z("signature",e),{v:i,l:o}=r.decode(48,s);if(o.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,i),{v:u,l}=r.decode(2,c);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=te,r=t.encode(2,n.encode(e.r)),s=t.encode(2,n.encode(e.s)),i=r+s;return t.encode(48,i)}},ne=BigInt(0),_e=BigInt(1),Nr=BigInt(2),Je=BigInt(3),zo=BigInt(4);function Se(e,t){const{BYTES:n}=e;let r;if(typeof t=="bigint")r=t;else{let s=Z("private key",t);try{r=e.fromBytes(s)}catch{throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`)}}if(!e.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function Ro(e,t={}){const n=To("weierstrass",e,t),{Fp:r,Fn:s}=n;let i=n.CURVE;const{h:o,n:a}=i;Xt(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=t;if(c&&(!r.is0(i.a)||typeof c.beta!="bigint"||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const u=kr(r,s);function l(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function f(O,m,y){const{x:p,y:b}=m.toAffine(),x=r.toBytes(p);if(rt(y,"isCompressed"),y){l();const B=!r.isOdd(b);return ue(Ur(B),x)}else return ue(Uint8Array.of(4),x,r.toBytes(b))}function d(O){me(O,void 0,"Point");const{publicKey:m,publicKeyUncompressed:y}=u,p=O.length,b=O[0],x=O.subarray(1);if(p===m&&(b===2||b===3)){const B=r.fromBytes(x);if(!r.isValid(B))throw new Error("bad point: is not on curve, wrong x");const v=w(B);let E;try{E=r.sqrt(v)}catch(k){const L=k instanceof Error?": "+k.message:"";throw new Error("bad point: is not on curve, sqrt error"+L)}l();const A=r.isOdd(E);return(b&1)===1!==A&&(E=r.neg(E)),{x:B,y:E}}else if(p===y&&b===4){const B=r.BYTES,v=r.fromBytes(x.subarray(0,B)),E=r.fromBytes(x.subarray(B,B*2));if(!P(v,E))throw new Error("bad point: is not on curve");return{x:v,y:E}}else throw new Error(`bad point: got length ${p}, expected compressed=${m} or uncompressed=${y}`)}const h=t.toBytes||f,g=t.fromBytes||d;function w(O){const m=r.sqr(O),y=r.mul(m,O);return r.add(r.add(y,r.mul(O,i.a)),i.b)}function P(O,m){const y=r.sqr(m),p=w(O);return r.eql(y,p)}if(!P(i.Gx,i.Gy))throw new Error("bad curve params: generator point");const z=r.mul(r.pow(i.a,Je),zo),pe=r.mul(r.sqr(i.b),BigInt(27));if(r.is0(r.add(z,pe)))throw new Error("bad curve params: a or b");function C(O,m,y=!1){if(!r.isValid(m)||y&&r.is0(m))throw new Error(`bad point coordinate ${O}`);return m}function J(O){if(!(O instanceof _))throw new Error("ProjectivePoint expected")}function ie(O){if(!c||!c.basises)throw new Error("no endo");return Oo(O,c.basises,s.ORDER)}const Ee=Bn((O,m)=>{const{X:y,Y:p,Z:b}=O;if(r.eql(b,r.ONE))return{x:y,y:p};const x=O.is0();m==null&&(m=x?r.ONE:r.inv(b));const B=r.mul(y,m),v=r.mul(p,m),E=r.mul(b,m);if(x)return{x:r.ZERO,y:r.ZERO};if(!r.eql(E,r.ONE))throw new Error("invZ was invalid");return{x:B,y:v}}),Ge=Bn(O=>{if(O.is0()){if(t.allowInfinityPoint&&!r.is0(O.Y))return;throw new Error("bad point: ZERO")}const{x:m,y}=O.toAffine();if(!r.isValid(m)||!r.isValid(y))throw new Error("bad point: x or y not field elements");if(!P(m,y))throw new Error("bad point: equation left != right");if(!O.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function ve(O,m,y,p,b){return y=new _(r.mul(y.X,O),y.Y,y.Z),m=ot(p,m),y=ot(b,y),m.add(y)}class _{constructor(m,y,p){this.X=C("x",m),this.Y=C("y",y,!0),this.Z=C("z",p),Object.freeze(this)}static CURVE(){return i}static fromAffine(m){const{x:y,y:p}=m||{};if(!m||!r.isValid(y)||!r.isValid(p))throw new Error("invalid affine point");if(m instanceof _)throw new Error("projective point not allowed");return r.is0(y)&&r.is0(p)?_.ZERO:new _(y,p,r.ONE)}static fromBytes(m){const y=_.fromAffine(g(me(m,void 0,"point")));return y.assertValidity(),y}static fromHex(m){return _.fromBytes(Z("pointHex",m))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(m=8,y=!0){return ye.createCache(this,m),y||this.multiply(Je),this}assertValidity(){Ge(this)}hasEvenY(){const{y:m}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(m)}equals(m){J(m);const{X:y,Y:p,Z:b}=this,{X:x,Y:B,Z:v}=m,E=r.eql(r.mul(y,v),r.mul(x,b)),A=r.eql(r.mul(p,v),r.mul(B,b));return E&&A}negate(){return new _(this.X,r.neg(this.Y),this.Z)}double(){const{a:m,b:y}=i,p=r.mul(y,Je),{X:b,Y:x,Z:B}=this;let v=r.ZERO,E=r.ZERO,A=r.ZERO,$=r.mul(b,b),k=r.mul(x,x),L=r.mul(B,B),T=r.mul(b,x);return T=r.add(T,T),A=r.mul(b,B),A=r.add(A,A),v=r.mul(m,A),E=r.mul(p,L),E=r.add(v,E),v=r.sub(k,E),E=r.add(k,E),E=r.mul(v,E),v=r.mul(T,v),A=r.mul(p,A),L=r.mul(m,L),T=r.sub($,L),T=r.mul(m,T),T=r.add(T,A),A=r.add($,$),$=r.add(A,$),$=r.add($,L),$=r.mul($,T),E=r.add(E,$),L=r.mul(x,B),L=r.add(L,L),$=r.mul(L,T),v=r.sub(v,$),A=r.mul(L,k),A=r.add(A,A),A=r.add(A,A),new _(v,E,A)}add(m){J(m);const{X:y,Y:p,Z:b}=this,{X:x,Y:B,Z:v}=m;let E=r.ZERO,A=r.ZERO,$=r.ZERO;const k=i.a,L=r.mul(i.b,Je);let T=r.mul(y,x),N=r.mul(p,B),H=r.mul(b,v),q=r.add(y,p),U=r.add(x,B);q=r.mul(q,U),U=r.add(T,N),q=r.sub(q,U),U=r.add(y,b);let M=r.add(x,v);return U=r.mul(U,M),M=r.add(T,H),U=r.sub(U,M),M=r.add(p,b),E=r.add(B,v),M=r.mul(M,E),E=r.add(N,H),M=r.sub(M,E),$=r.mul(k,U),E=r.mul(L,H),$=r.add(E,$),E=r.sub(N,$),$=r.add(N,$),A=r.mul(E,$),N=r.add(T,T),N=r.add(N,T),H=r.mul(k,H),U=r.mul(L,U),N=r.add(N,H),H=r.sub(T,H),H=r.mul(k,H),U=r.add(U,H),T=r.mul(N,U),A=r.add(A,T),T=r.mul(M,U),E=r.mul(q,E),E=r.sub(E,T),T=r.mul(q,N),$=r.mul(M,$),$=r.add($,T),new _(E,A,$)}subtract(m){return this.add(m.negate())}is0(){return this.equals(_.ZERO)}multiply(m){const{endo:y}=t;if(!s.isValidNot0(m))throw new Error("invalid scalar: out of range");let p,b;const x=B=>ye.cached(this,B,v=>Pt(_,v));if(y){const{k1neg:B,k1:v,k2neg:E,k2:A}=ie(m),{p:$,f:k}=x(v),{p:L,f:T}=x(A);b=k.add(T),p=ve(y.beta,$,L,B,E)}else{const{p:B,f:v}=x(m);p=B,b=v}return Pt(_,[p,b])[0]}multiplyUnsafe(m){const{endo:y}=t,p=this;if(!s.isValid(m))throw new Error("invalid scalar: out of range");if(m===ne||p.is0())return _.ZERO;if(m===_e)return p;if(ye.hasCache(this))return this.multiply(m);if(y){const{k1neg:b,k1:x,k2neg:B,k2:v}=ie(m),{p1:E,p2:A}=$o(_,p,x,v);return ve(y.beta,E,A,b,B)}else return ye.unsafe(p,m)}multiplyAndAddUnsafe(m,y,p){const b=this.multiplyUnsafe(y).add(m.multiplyUnsafe(p));return b.is0()?void 0:b}toAffine(m){return Ee(this,m)}isTorsionFree(){const{isTorsionFree:m}=t;return o===_e?!0:m?m(_,this):ye.unsafe(this,a).is0()}clearCofactor(){const{clearCofactor:m}=t;return o===_e?this:m?m(_,this):this.multiplyUnsafe(o)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}toBytes(m=!0){return rt(m,"isCompressed"),this.assertValidity(),h(_,this,m)}toHex(m=!0){return Pe(this.toBytes(m))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(m=!0){return this.toBytes(m)}_setWindowSize(m){this.precompute(m)}static normalizeZ(m){return Pt(_,m)}static msm(m,y){return _o(_,s,m,y)}static fromPrivateKey(m){return _.BASE.multiply(Se(s,m))}}_.BASE=new _(i.Gx,i.Gy,r.ONE),_.ZERO=new _(r.ZERO,r.ONE,r.ZERO),_.Fp=r,_.Fn=s;const Ke=s.BITS,ye=new Po(_,t.endo?Math.ceil(Ke/2):Ke);return _.BASE.precompute(8),_}function Ur(e){return Uint8Array.of(e?2:3)}function kr(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Co(e,t={}){const{Fn:n}=e,r=t.randomBytes||Jn,s=Object.assign(kr(e.Fp,n),{seed:zr(n.ORDER)});function i(h){try{return!!Se(n,h)}catch{return!1}}function o(h,g){const{publicKey:w,publicKeyUncompressed:P}=s;try{const z=h.length;return g===!0&&z!==w||g===!1&&z!==P?!1:!!e.fromBytes(h)}catch{return!1}}function a(h=r(s.seed)){return Io(me(h,s.seed,"seed"),n.ORDER)}function c(h,g=!0){return e.BASE.multiply(Se(n,h)).toBytes(g)}function u(h){const g=a(h);return{secretKey:g,publicKey:c(g)}}function l(h){if(typeof h=="bigint")return!1;if(h instanceof e)return!0;const{secretKey:g,publicKey:w,publicKeyUncompressed:P}=s;if(n.allowedLengths||g===w)return;const z=Z("key",h).length;return z===w||z===P}function f(h,g,w=!0){if(l(h)===!0)throw new Error("first arg must be private key");if(l(g)===!1)throw new Error("second arg must be public key");const P=Se(n,h);return e.fromHex(g).multiply(P).toBytes(w)}return Object.freeze({getPublicKey:c,getSharedSecret:f,keygen:u,Point:e,utils:{isValidSecretKey:i,isValidPublicKey:o,randomSecretKey:a,isValidPrivateKey:i,randomPrivateKey:a,normPrivateKeyToScalar:h=>Se(n,h),precompute(h=8,g=e.BASE){return g.precompute(h,!1)}},lengths:s})}function No(e,t,n={}){Yn(t),Xt(n,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=n.randomBytes||Jn,s=n.hmac||((y,...p)=>vr(t,y,ue(...p))),{Fp:i,Fn:o}=e,{ORDER:a,BITS:c}=o,{keygen:u,getPublicKey:l,getSharedSecret:f,utils:d,lengths:h}=Co(e,n),g={prehash:!1,lowS:typeof n.lowS=="boolean"?n.lowS:!1,format:void 0,extraEntropy:!1},w="compact";function P(y){const p=a>>_e;return y>p}function z(y,p){if(!o.isValidNot0(p))throw new Error(`invalid signature ${y}: out of range 1..Point.Fn.ORDER`);return p}function pe(y,p){Vt(p);const b=h.signature,x=p==="compact"?b:p==="recovered"?b+1:void 0;return me(y,x,`${p} signature`)}class C{constructor(p,b,x){this.r=z("r",p),this.s=z("s",b),x!=null&&(this.recovery=x),Object.freeze(this)}static fromBytes(p,b=w){pe(p,b);let x;if(b==="der"){const{r:A,s:$}=te.toSig(me(p));return new C(A,$)}b==="recovered"&&(x=p[0],b="compact",p=p.subarray(1));const B=o.BYTES,v=p.subarray(0,B),E=p.subarray(B,B*2);return new C(o.fromBytes(v),o.fromBytes(E),x)}static fromHex(p,b){return this.fromBytes(nt(p),b)}addRecoveryBit(p){return new C(this.r,this.s,p)}recoverPublicKey(p){const b=i.ORDER,{r:x,s:B,recovery:v}=this;if(v==null||![0,1,2,3].includes(v))throw new Error("recovery id invalid");if(a*Nr<b&&v>1)throw new Error("recovery id is ambiguous for h>1 curve");const A=v===2||v===3?x+a:x;if(!i.isValid(A))throw new Error("recovery id 2 or 3 invalid");const $=i.toBytes(A),k=e.fromBytes(ue(Ur((v&1)===0),$)),L=o.inv(A),T=ie(Z("msgHash",p)),N=o.create(-T*L),H=o.create(B*L),q=e.BASE.multiplyUnsafe(N).add(k.multiplyUnsafe(H));if(q.is0())throw new Error("point at infinify");return q.assertValidity(),q}hasHighS(){return P(this.s)}toBytes(p=w){if(Vt(p),p==="der")return nt(te.hexFromSig(this));const b=o.toBytes(this.r),x=o.toBytes(this.s);if(p==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return ue(Uint8Array.of(this.recovery),b,x)}return ue(b,x)}toHex(p){return Pe(this.toBytes(p))}assertValidity(){}static fromCompact(p){return C.fromBytes(Z("sig",p),"compact")}static fromDER(p){return C.fromBytes(Z("sig",p),"der")}normalizeS(){return this.hasHighS()?new C(this.r,o.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Pe(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Pe(this.toBytes("compact"))}}const J=n.bits2int||function(p){if(p.length>8192)throw new Error("input is too large");const b=mt(p),x=p.length*8-c;return x>0?b>>BigInt(x):b},ie=n.bits2int_modN||function(p){return o.create(J(p))},Ee=Ve(c);function Ge(y){return ks("num < 2^"+c,y,ne,Ee),o.toBytes(y)}function ve(y,p){return me(y,void 0,"message"),p?me(t(y),void 0,"prehashed message"):y}function _(y,p,b){if(["recovered","canonical"].some(N=>N in b))throw new Error("sign() legacy options not supported");const{lowS:x,prehash:B,extraEntropy:v}=Ot(b,g);y=ve(y,B);const E=ie(y),A=Se(o,p),$=[Ge(A),Ge(E)];if(v!=null&&v!==!1){const N=v===!0?r(h.secretKey):v;$.push(Z("extraEntropy",N))}const k=ue(...$),L=E;function T(N){const H=J(N);if(!o.isValidNot0(H))return;const q=o.inv(H),U=e.BASE.multiply(H).toAffine(),M=o.create(U.x);if(M===ne)return;const Ye=o.create(q*o.create(L+M*A));if(Ye===ne)return;let gn=(U.x===M?0:2)|Number(U.y&_e),bn=Ye;return x&&P(Ye)&&(bn=o.neg(Ye),gn^=1),new C(M,bn,gn)}return{seed:k,k2sig:T}}function Ke(y,p,b={}){y=Z("message",y);const{seed:x,k2sig:B}=_(y,p,b);return Hs(t.outputLen,o.BYTES,s)(x,B)}function ye(y){let p;const b=typeof y=="string"||pt(y),x=!b&&y!==null&&typeof y=="object"&&typeof y.r=="bigint"&&typeof y.s=="bigint";if(!b&&!x)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(x)p=new C(y.r,y.s);else if(b){try{p=C.fromBytes(Z("sig",y),"der")}catch(B){if(!(B instanceof te.Err))throw B}if(!p)try{p=C.fromBytes(Z("sig",y),"compact")}catch{return!1}}return p||!1}function O(y,p,b,x={}){const{lowS:B,prehash:v,format:E}=Ot(x,g);if(b=Z("publicKey",b),p=ve(Z("message",p),v),"strict"in x)throw new Error("options.strict was renamed to lowS");const A=E===void 0?ye(y):C.fromBytes(Z("sig",y),E);if(A===!1)return!1;try{const $=e.fromBytes(b);if(B&&A.hasHighS())return!1;const{r:k,s:L}=A,T=ie(p),N=o.inv(L),H=o.create(T*N),q=o.create(k*N),U=e.BASE.multiplyUnsafe(H).add($.multiplyUnsafe(q));return U.is0()?!1:o.create(U.x)===k}catch{return!1}}function m(y,p,b={}){const{prehash:x}=Ot(b,g);return p=ve(p,x),C.fromBytes(y,"recovered").recoverPublicKey(p).toBytes()}return Object.freeze({keygen:u,getPublicKey:l,getSharedSecret:f,utils:d,lengths:h,Point:e,sign:Ke,verify:O,recoverPublicKey:m,Signature:C,hash:t})}function Uo(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp;let r=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(o=>Math.ceil(o/2)))):void 0;const s=qe(t.n,{BITS:e.nBitLength,allowedLengths:r,modFromBytes:e.wrapPrivateKey}),i={Fp:n,Fn:s,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:t,curveOpts:i}}function ko(e){const{CURVE:t,curveOpts:n}=Uo(e),r={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,hash:e.hash,ecdsaOpts:r}}function Ho(e,t){const n=t.Point;return Object.assign({},t,{ProjectivePoint:n,CURVE:Object.assign({},e,Or(n.Fn.ORDER,n.Fn.BITS))})}function Mo(e){const{CURVE:t,curveOpts:n,hash:r,ecdsaOpts:s}=ko(e),i=Ro(t,n),o=No(i,r,s);return Ho(e,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Do(e,t){const n=r=>Mo({...e,hash:r});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const un={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},Vo={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},Un=BigInt(2);function jo(e){const t=un.p,n=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,f=G(l,n,t)*l%t,d=G(f,n,t)*l%t,h=G(d,Un,t)*u%t,g=G(h,s,t)*h%t,w=G(g,i,t)*g%t,P=G(w,a,t)*w%t,z=G(P,c,t)*P%t,pe=G(z,a,t)*w%t,C=G(pe,n,t)*l%t,J=G(C,o,t)*g%t,ie=G(J,r,t)*u%t,Ee=G(ie,Un,t);if(!jt.eql(jt.sqr(Ee),e))throw new Error("Cannot find square root");return Ee}const jt=qe(un.p,{sqrt:jo}),fn=Do({...un,Fp:jt,lowS:!0,endo:Vo},bi);function Hr(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new Lt({signature:e});if(typeof e.s>"u")throw new Lt({signature:e});if(n&&typeof e.yParity>"u")throw new Lt({signature:e});if(e.r<0n||e.r>$n)throw new Wo({value:e.r});if(e.s<0n||e.s>$n)throw new Xo({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new xt({value:e.yParity})}function qo(e){return Mr(re(e))}function Mr(e){if(e.length!==130&&e.length!==132)throw new Yo({signature:e});const t=BigInt(D(e,0,32)),n=BigInt(D(e,32,64)),r=(()=>{const s=+`0x${e.slice(130)}`;if(!Number.isNaN(s))try{return wt(s)}catch{throw new xt({value:s})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function Ze(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return Zo(e)}function Zo(e){const t=typeof e=="string"?Mr(e):e instanceof Uint8Array?qo(e):typeof e.r=="string"?Fo(e):e.v?Dr(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return Hr(t),t}function Dr(e){return{r:e.r,s:e.s,yParity:wt(e.v)}}function Fo(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=wt(n)),typeof r!="number")throw new xt({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function Go(e){Hr(e);const t=e.r,n=e.s;return R(I(t,{size:32}),I(n,{size:32}),typeof e.yParity=="number"?I(Vr(e.yParity),{size:1}):"0x")}function Ko(e){const{r:t,s:n,yParity:r}=e;return{r:I(t,{size:32}),s:I(n,{size:32}),yParity:r===0?"0x0":"0x1"}}function bt(e){const{r:t,s:n,yParity:r}=e;return[r?"0x01":"0x",t===0n?"0x":tt(I(t)),n===0n?"0x":tt(I(n))]}function wt(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new jr({value:e})}function Vr(e){if(e===0)return 27;if(e===1)return 28;throw new xt({value:e})}class Yo extends S{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${j(ft(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Lt extends S{constructor({signature:t}){super(`Signature \`${ut(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class Wo extends S{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class Xo extends S{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class xt extends S{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class jr extends S{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function Hc(e,t={}){return typeof e.chainId=="string"?Qo(e):{...e,...t.signature}}function Qo(e){const{address:t,chainId:n,nonce:r}=e,s=Ze(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...s}}function Mc(e){return Jo(e)}function Jo(e){return K(R("0x05",je(qr(e))))}function ea(e){const{address:t,chainId:n,nonce:r,...s}=e;return{address:t,chainId:I(n),nonce:I(r),...Ko(s)}}function Dc(e){return e.map(ea)}function qr(e){const{address:t,chainId:n,nonce:r}=e,s=Ze(e);return[n?I(n):"0x",t,r?I(r):"0x",...s?bt(s):[]]}function ta(e){if(!e||e.length===0)return[];const t=[];for(const n of e)t.push(qr(n));return t}let na=!1;function Vc(e={}){const{as:t="Hex"}=e,n=fn.utils.randomPrivateKey();return t==="Hex"?re(n):n}function jc(e){return Ti(ra(e))}function ra(e){const{payload:t,signature:n}=e,{r,s,yParity:i}=n,a=new fn.Signature(BigInt(r),BigInt(s)).addRecoveryBit(i).recoverPublicKey(ft(t).substring(2));return Ei(a)}function sa(e){const{extraEntropy:t=na,hash:n,payload:r,privateKey:s}=e,{r:i,s:o,recovery:a}=fn.sign(Rt(r),Rt(s),{extraEntropy:typeof t=="boolean"?t:ft(t).slice(2),lowS:!0,...n?{prehash:!0}:{}});return{r:i,s:o,yParity:a}}const kn={wei:0,gwei:9,szabo:12,finney:15,ether:18};function ia(e,t=0){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${i?`.${i}`:""}`}function at(e,t="wei"){return ia(e,kn.gwei-kn[t])}function qc(e,t=0){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new oa({value:e});let[n="",r="0"]=e.split(".");const s=n.startsWith("-");if(s&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),t===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){const[i,o,a]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],c=Math.round(+`${o}.${a}`);c>9?r=`${BigInt(i)+BigInt(1)}0`.padStart(i.length+1,"0"):r=`${i}${c}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${s?"-":""}${n}${r}`)}class oa extends S{constructor({value:t}){super(`Value \`${t}\` is not a valid decimal number.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalNumberError"})}}class aa extends S{constructor({feeCap:t}={}){super(`The fee cap (\`maxFeePerGas\`/\`maxPriorityFeePerGas\`${t?` = ${at(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.FeeCapTooHighError"})}}class Zr extends S{constructor({gasPrice:t}={}){super(`The gas price (\`gasPrice\`${t?` = ${at(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.GasPriceTooHighError"})}}class Et extends S{constructor({chainId:t}){super(typeof t<"u"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidChainIdError"})}}class ca extends S{constructor({maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${at(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${at(n)} gwei`:""}).`].join(`
|
|
4
|
-
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.TipAboveFeeCapError"})}}function Fr(e){const{chainId:t,gasPrice:n,to:r}=e;if(r&&Q(r,{strict:!1}),typeof t<"u"&&t<=0)throw new Et({chainId:t});if(n&&BigInt(n)>2n**256n-1n)throw new Zr({gasPrice:n})}function ua(e,t={}){const{chainId:n=0,gas:r,data:s,input:i,nonce:o,to:a,value:c,gasPrice:u}=e;Fr(e);let l=[o?I(o):"0x",u?I(u):"0x",r?I(r):"0x",a??"0x",c?I(c):"0x",s??i??"0x"];const f=(()=>{if(t.signature)return{r:t.signature.r,s:t.signature.s,v:Vr(t.signature.yParity)};if(!(typeof e.r>"u"||typeof e.s>"u"))return{r:e.r,s:e.s,v:e.v}})();if(f){const d=(()=>{if(f.v>=35)return Math.floor((f.v-35)/2)>0?f.v:27+(f.v===35?0:1);if(n>0)return n*2+35+f.v-27;const h=27+(f.v===27?0:1);if(f.v!==h)throw new jr({value:f.v});return h})();l=[...l,I(d),f.r===0n?"0x":tt(I(f.r)),f.s===0n?"0x":tt(I(f.s))]}else n>0&&(l=[...l,I(n),"0x","0x"]);return je(l)}const fa="0x02";function dn(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new Et({chainId:t});if(s&&Q(s,{strict:!1}),r&&BigInt(r)>2n**256n-1n)throw new aa({feeCap:r});if(n&&r&&n>r)throw new ca({maxFeePerGas:r,maxPriorityFeePerGas:n})}function da(e,t={}){const{chainId:n,gas:r,nonce:s,to:i,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:u,data:l,input:f}=e;dn(e);const d=an(u),h=Ze(t.signature||e),g=[I(n),s?I(s):"0x",c?I(c):"0x",a?I(a):"0x",r?I(r):"0x",i??"0x",o?I(o):"0x",l??f??"0x",d,...h?bt(h):[]];return R(fa,je(g))}function Gr(e){const{chainId:t,gasPrice:n,to:r}=e;if(t<=0)throw new Et({chainId:t});if(r&&Q(r,{strict:!1}),n&&BigInt(n)>2n**256n-1n)throw new Zr({gasPrice:n})}function la(e,t={}){const{chainId:n,gas:r,data:s,input:i,nonce:o,to:a,value:c,accessList:u,gasPrice:l}=e;Gr(e);const f=an(u),d=Ze(t.signature||e),h=[I(n),o?I(o):"0x",l?I(l):"0x",r?I(r):"0x",a??"0x",c?I(c):"0x",s??i??"0x",f,...d?bt(d):[]];return R("0x01",je(h))}const ha="0x04";function Kr(e){const{authorizationList:t}=e;if(t)for(const n of t){const{address:r,chainId:s}=n;if(r&&Q(r,{strict:!1}),Number(s)<0)throw new Et({chainId:s})}dn(e)}function pa(e,t={}){const{authorizationList:n,chainId:r,gas:s,nonce:i,to:o,value:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:l,data:f,input:d}=e;Kr(e);const h=an(l),g=ta(n),w=Ze(t.signature||e),P=[I(r),i?I(i):"0x",u?I(u):"0x",c?I(c):"0x",s?I(s):"0x",o??"0x",a?I(a):"0x",f??d??"0x",h,g,...w?bt(w):[]];return R(ha,je(P))}function Yr(e){const{domain:t,message:n,primaryType:r,types:s}=e,i=(o,a)=>{for(const c of o){const{name:u,type:l}=c,f=a[u],d=l.match(en);if(d&&(typeof f=="number"||typeof f=="bigint")){const[,w,P]=d;I(f,{signed:w==="int",size:Number.parseInt(P??"")/8})}if(l==="address"&&typeof f=="string"&&!st(f))throw new Ut({address:f,cause:new lr});const h=l.match(yr);if(h){const[,w]=h;if(w&&j(f)!==Number.parseInt(w))throw new ba({expectedSize:Number.parseInt(w),givenSize:j(f)})}const g=s[l];g&&(Ba(l),i(g,f))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new wa({domain:t});i(s.EIP712Domain,t)}if(r!=="EIP712Domain")if(s[r])i(s[r],n);else throw new xa({primaryType:r,types:s})}function ya(e){const{domain:t={},message:n,primaryType:r}=e,s={EIP712Domain:vt(t),...e.types};Yr({domain:t,message:n,primaryType:r,types:s});const i=["0x19","0x01"];return t&&i.push(Wr({domain:t,types:s})),r!=="EIP712Domain"&&i.push(Xr({data:n,primaryType:r,types:s})),R(...i)}function ma(e){const{primaryType:t,types:n}=e;let r="";const s=es({primaryType:t,types:n});s.delete(t);const i=[t,...Array.from(s).sort()];for(const o of i)r+=`${o}(${(n[o]??[]).map(({name:a,type:c})=>`${c} ${a}`).join(",")})`;return r}function vt(e){return[typeof e?.name=="string"&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},typeof e?.chainId=="number"&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Zc(e){return K(ya(e))}function Wr(e){const{domain:t,types:n}=e;return Xr({data:t,primaryType:"EIP712Domain",types:{...n,EIP712Domain:n?.EIP712Domain||vt(t)}})}function Xr(e){const{data:t,primaryType:n,types:r}=e,s=Qr({data:t,primaryType:n,types:r});return K(s)}function Fc(e){const{domain:t,message:n,primaryType:r,types:s}=e,i=(c,u)=>{const l={...u};for(const f of c){const{name:d,type:h}=f;h==="address"&&(l[d]=l[d].toLowerCase())}return l},o=(()=>{if(!t)return{};const c=s.EIP712Domain??vt(t);return i(c,t)})(),a=(()=>{if(r!=="EIP712Domain")return s[r]?i(s[r],n):{}})();return ut({domain:o,message:a,primaryType:r,types:s},(c,u)=>typeof u=="bigint"?u.toString():u)}function ga(e){try{return Yr(e),!0}catch{return!1}}class ba extends S{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.BytesSizeMismatchError"})}}class wa extends S{constructor({domain:t}){super(`Invalid domain "${ut(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.InvalidDomainError"})}}class xa extends S{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{metaMessages:["Check that the primary type is a key in `types`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.InvalidPrimaryTypeError"})}}class Ea extends S{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.InvalidStructTypeError"})}}function Qr(e){const{data:t,primaryType:n,types:r}=e,s=[{type:"bytes32"}],i=[va({primaryType:n,types:r})];for(const o of r[n]??[]){const[a,c]=Jr({types:r,name:o.name,type:o.type,value:t[o.name]});s.push(a),i.push(c)}return gt(s,i)}function va(e){const{primaryType:t,types:n}=e,r=dt(ma({primaryType:t,types:n}));return K(r)}function Jr(e){let{types:t,name:n,type:r,value:s}=e;if(t[r]!==void 0)return[{type:"bytes32"},K(Qr({data:s,primaryType:r,types:t}))];if(r==="bytes")return s=`0x${(s.length%2?"0":"")+s.slice(2)}`,[{type:"bytes32"},K(s,{as:"Hex"})];if(r==="string")return[{type:"bytes32"},K(Vn(s),{as:"Hex"})];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),o=s.map(a=>Jr({name:n,type:i,types:t,value:a}));return[{type:"bytes32"},K(gt(o.map(([a])=>a),o.map(([,a])=>a)))]}return[{type:r},s]}function es(e,t=new Set){const{primaryType:n,types:r}=e,i=n.match(/^\w*/u)?.[0];if(t.has(i)||r[i]===void 0)return t;t.add(i);for(const o of r[i])es({primaryType:o.type,types:r},t);return t}function Ba(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new Ea({type:e})}function Me(e){return ht(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function xe(e,t){if(e.length!==t.length)throw new Error("The number of parameters and values must match.");const n=Ia({params:e,values:t}),r=hn(n);return r.length===0?"0x":r}function Ia({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(ln({param:e[r],value:t[r]}));return n}function ln({param:e,value:t}){const n=La(e.type);if(n){const[r,s]=n;return Sa(t,{length:r,param:{...e,type:s}})}if(e.type==="tuple")return Oa(t,{param:e});if(e.type==="address")return Aa(t);if(e.type==="bool")return $a(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int");return _a(t,{signed:r})}if(e.type.startsWith("bytes"))return Pa(t,{param:e});if(e.type==="string")return Ta(t);throw new Error(`Unsupported parameter type: ${e.type}`)}function hn(e){let t=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:a}=e[i];o?t+=32:t+=Me(a)}const n=[],r=[];let s=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:a}=e[i];o?(n.push(le(t+s,{size:32})),r.push(a),s+=Me(a)):n.push(a)}return R(...n,...r)}function Aa(e){if(e!==""&&e!==void 0&&!$s(e))throw new Error(`Invalid address: ${e}`);return{dynamic:!1,encoded:we(e.toLowerCase())}}function Sa(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Error("Invalid array value.");if(!r&&e.length!==t)throw new Error("Invalid array length.");let s=!1;const i=[];for(let o=0;o<e.length;o++){const a=ln({param:n,value:e[o]});a.dynamic&&(s=!0),i.push(a)}if(r||s){const o=hn(i);if(r){const a=le(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?R(a,o):a}}if(s)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:R(...i.map(({encoded:o})=>o))}}function Pa(e,{param:t}){const[,n]=t.type.split("bytes"),r=Me(e);if(!n){let s=e;return r%32!==0&&(s=we(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:R(we(le(r,{size:32})),s)}}if(r!==Number.parseInt(n))throw new Error(`Invalid bytes${n} size: ${r}`);return{dynamic:!1,encoded:we(e,{dir:"right"})}}function $a(e){return{dynamic:!1,encoded:we(ps(e))}}function _a(e,{signed:t}){return{dynamic:!1,encoded:le(e,{signed:t,size:32})}}function Ta(e){const t=Ft(e),n=Math.ceil(Me(t)/32),r=[];for(let s=0;s<n;s++)r.push(we(D(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:R(we(le(Me(t),{size:32})),...r)}}function Oa(e,{param:t}){let n=!1;const r=[];for(let s=0;s<t.components.length;s++){const i=t.components[s],o=Array.isArray(e)?s:i.name,a=ln({param:i,value:e[o]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?hn(r):R(...r.map(({encoded:s})=>s))}}function La(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const{toFunctionSelector:za}=await De("viem"),zt=new ws(4096);function de(e){const t=typeof e=="string"?e:Ts(e);if(zt.has(t))return zt.get(t);const n=typeof e=="string"?Le(e):e,s=[za(n),n.inputs,n.outputs];return zt.set(t,s),s}function ts(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="function")}const{decodeAbiParameters:Ra}=await De("viem");async function pn(e){const{contract:t,method:n,params:r}=e,s=async()=>{if(Array.isArray(n))return n;if(ts(n))return de(n);if(typeof n=="function")return de(await n(t));if(typeof n=="string"&&n.startsWith("function ")){const f=Le(n);if(f.type==="function")return de(f);throw new Error('"method" passed is not of type "function"')}if(t.abi&&t.abi?.length>0){const f=t.abi?.find(d=>d.type==="function"&&d.name===n);if(f)return de(f)}throw new Error(`Could not resolve method "${n}".`)},[i,o]=await Promise.all([s(),typeof r=="function"?r():r]);let a;i[1].length===0?a=i[0]:a=i[0]+xe(i[1],o).slice(2);const c=lt({chain:t.chain,client:t.client}),u=await ir(c,{data:a,from:e.from?Ce(e.from):void 0,to:t.address}),l=Ra(i[2],u);return Array.isArray(l)&&l.length===1?l[0]:l}const Gc=Object.freeze(Object.defineProperty({__proto__:null,readContract:pn},Symbol.toStringTag,{value:"Module"}));function Ca(e){const t=new Set;let n=e;const r=()=>{for(const s of t)s()};return{getValue(){return n},setValue(s){s!==n&&(n=s,r())},subscribe(s){return t.add(s),()=>{t.delete(s)}}}}const qt=new Map;function Na(e){const t=qt.get(e);if(t)return t;const n=Ca([]);return qt.set(e,n),n}function Ua(e){const{address:t,transactionHash:n,chainId:r}=e,s=Na(t);s.setValue([...s.getValue(),{chainId:r,transactionHash:n}]),qt.set(t,s)}async function ka(e){let{account:t,transaction:n,gasless:r}=e;if(t.onTransactionRequested&&await t.onTransactionRequested(n),n.eip712){const{sendEip712Transaction:o}=await he(async()=>{const{sendEip712Transaction:a}=await import("./send-eip712-transaction-CI65hvCl.js").then(c=>c.a);return{sendEip712Transaction:a}},__vite__mapDeps([2,3,4,5,0,1,6,7,8,9,10,11,12]));return o({account:t,transaction:n})}const s=await Ds({from:t,transaction:n});if(r){const{sendGaslessTransaction:o}=await he(async()=>{const{sendGaslessTransaction:a}=await import("./send-gasless-transaction-C7lHksJD.js");return{sendGaslessTransaction:a}},__vite__mapDeps([14,3]));return o({account:t,gasless:r,serializableTransaction:s,transaction:n})}const i=await t.sendTransaction(s);return Ua({address:t.address,chainId:n.chain.id,transactionHash:i.transactionHash}),{...i,chain:n.chain,client:n.client}}const Ha=Object.freeze(Object.defineProperty({__proto__:null,sendTransaction:ka},Symbol.toStringTag,{value:"Module"}));function Hn(e){const{transaction:t}=e,n=Ma(t),r=(()=>{if(e.signature)return"v"in e.signature&&typeof e.signature.v<"u"?Dr({r:Be(e.signature.r),s:Be(e.signature.s),v:Number(e.signature.v)}):{r:Be(e.signature.r),s:Be(e.signature.s),yParity:e.signature.yParity};if(!(typeof t.v>"u"&&typeof t.yParity>"u")){if(t.r===void 0||t.s===void 0)throw new Error("Invalid signature provided with transaction");return{r:typeof t.r=="bigint"?t.r:Be(t.r),s:typeof t.s=="bigint"?t.s:Be(t.s),yParity:typeof t.v<"u"&&typeof t.yParity>"u"?wt(Number(t.v)):Number(t.yParity)}}})();if(n==="eip1559"){const s=t;return dn(s),da(s,{signature:r})}if(n==="legacy"){const s=t;return Fr(s),ua(s,{signature:r})}if(n==="eip2930"){const s=t;return Gr(s),la(s,{signature:r})}if(n==="eip7702"){const s=t;return Kr(s),pa(s,{signature:r})}throw new Error("Invalid transaction type")}function Ma(e){if(typeof e.type<"u")return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new Error("Invalid transaction type")}function Kc({transaction:e,privateKey:t}){const n=Hn({transaction:e}),r=sa({payload:K(n),privateKey:t});return Hn({transaction:{...e,...r}})}const Da={eip1559:1,eip2930:2,eip4844:3,eip7702:4,legacy:0};function ns(e,t){return t&&(e.__preparedMethod=t.preparedMethod,e.__contract=t.contract),e}const Va=Object.freeze(Object.defineProperty({__proto__:null,TransactionTypeMap:Da,prepareTransaction:ns},Symbol.toStringTag,{value:"Module"}));function yn(e){const{contract:t,method:n,params:r,...s}=e,i=()=>(async()=>{if(Array.isArray(n))return n;if(ts(n))return de(n);if(typeof n=="function")return de(await n(t));if(typeof n=="string"&&n.startsWith("function ")){const o=Le(n);if(o.type==="function")return de(o);throw new Error('"method" passed is not of type "function"')}if(t.abi&&t.abi?.length>0){const o=t.abi?.find(a=>a.type==="function"&&a.name===n);if(o)return de(o)}throw new Error(`Could not resolve method "${n}".`)})();return ns({...s,chain:t.chain,client:t.client,data:async()=>{let o;return Array.isArray(n)?o=n:o=await i(),o[1].length===0?o[0]:o[0]+xe(o[1],await ce(r??[])).slice(2)},to:t.address},{contract:t,preparedMethod:i})}function ja(e,t){const n=typeof t=="string"?{to:t}:t;switch(n.to){case"number":return Fa(e,n);case"bigint":return qa(e,n);case"boolean":return Za(e,n);case"string":return Ga(e,n);default:return ys(e,n)}}function qa(e,t={}){return qn(e,t)}function Za(e,t={}){return jn(e,t)}function Fa(e,t={}){return X(e,t)}function Ga(e,t={}){return Zn(e,t)}function rs(e){return R(...e)}const Yc=Object.freeze(Object.defineProperty({__proto__:null,concatHex:rs},Symbol.toStringTag,{value:"Module"})),Ka="0x6492649264926492649264926492649264926492649264926492649264926492",Ya="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",Wa=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function Xa(e){if(D(e,-32)!==Ka)throw new Ja(e)}function Qa(e){try{return Xa(e),!0}catch{return!1}}class Ja extends S{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WrappedSignature.InvalidWrappedSignatureError"})}}const{decodeAbiParameters:Wc}=await De("viem"),ec="0x1626ba7e",tc=[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],nc=[{type:"bytes4"}];async function rc(e){return pn({contract:e.contract,method:[ec,tc,nc],params:[e.hash,e.signature]})}const et=new WeakMap;function sc(e){if(et.has(e))return et.get(e);const t=(async()=>{const n=lt(e),r=await js(n,{address:e.address,blockTag:"latest"});return r==="0x"&&et.delete(e),r})();return et.set(e,t),t}const Mn=new WeakSet;async function Fe(e){if(Mn.has(e))return!0;const n=await sc(e)!=="0x";return n&&Mn.add(e),n}const ic=Object.freeze(Object.defineProperty({__proto__:null,isContractDeployed:Fe},Symbol.toStringTag,{value:"Module"})),oc="0x6492649264926492649264926492649264926492649264926492649264926492";function mn({address:e,data:t,signature:n}){return rs([xe([{type:"address"},{type:"bytes"},{type:"bytes"}],[e,t,n]),oc])}const ac="0xfB688330379976DA81eB64Fe4BF50d7401763B9C";async function Xc({hash:e,signature:t,address:n,client:r,chain:s,accountFactory:i}){const o=(()=>{if(ht(t))return t;if(typeof t=="object"&&"r"in t&&"s"in t)return Go(t);if(t instanceof Uint8Array)return ja(t,"hex");throw new Error(`Invalid signature type for signature ${t}: ${typeof t}`)})();if(await Fe(Bt({address:n,chain:s,client:r}))&&await ct({contract:Bt({address:n,chain:s,client:r}),hash:e,signature:o}).catch(g=>(console.error("Error verifying EIP-1271 signature",g),!1)))return!0;const c=await(async()=>!i||Qa(o)?o:mn({address:i.address,data:i.verificationCalldata,signature:o}))();let u;const l=await sr(s),f=Ys(Wa);if(l)u={data:uo(on(f,"isValidSig"),[n,e,c]),to:ac};else{const h=co(f);u={data:ao(h,{args:[n,e,c],bytecode:Ya})}}const d=lt({chain:s,client:r});try{const h=await ir(d,u);return ms(h)}catch{return!!await ct({contract:Bt({address:n,chain:s,client:r}),hash:e,signature:o}).catch(g=>(console.error("Error verifying EIP-1271 signature",g),!1))}}const cc="0x1626ba7e";async function ct({hash:e,signature:t,contract:n}){try{return await rc({contract:n,hash:e,signature:t})===cc}catch(r){return console.error("Error verifying EIP-1271 signature",r),!1}}const uc=`Ethereum Signed Message:
|
|
4
|
+
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.TipAboveFeeCapError"})}}function Fr(e){const{chainId:t,gasPrice:n,to:r}=e;if(r&&Q(r,{strict:!1}),typeof t<"u"&&t<=0)throw new Et({chainId:t});if(n&&BigInt(n)>2n**256n-1n)throw new Zr({gasPrice:n})}function ua(e,t={}){const{chainId:n=0,gas:r,data:s,input:i,nonce:o,to:a,value:c,gasPrice:u}=e;Fr(e);let l=[o?I(o):"0x",u?I(u):"0x",r?I(r):"0x",a??"0x",c?I(c):"0x",s??i??"0x"];const f=(()=>{if(t.signature)return{r:t.signature.r,s:t.signature.s,v:Vr(t.signature.yParity)};if(!(typeof e.r>"u"||typeof e.s>"u"))return{r:e.r,s:e.s,v:e.v}})();if(f){const d=(()=>{if(f.v>=35)return Math.floor((f.v-35)/2)>0?f.v:27+(f.v===35?0:1);if(n>0)return n*2+35+f.v-27;const h=27+(f.v===27?0:1);if(f.v!==h)throw new jr({value:f.v});return h})();l=[...l,I(d),f.r===0n?"0x":tt(I(f.r)),f.s===0n?"0x":tt(I(f.s))]}else n>0&&(l=[...l,I(n),"0x","0x"]);return je(l)}const fa="0x02";function dn(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new Et({chainId:t});if(s&&Q(s,{strict:!1}),r&&BigInt(r)>2n**256n-1n)throw new aa({feeCap:r});if(n&&r&&n>r)throw new ca({maxFeePerGas:r,maxPriorityFeePerGas:n})}function da(e,t={}){const{chainId:n,gas:r,nonce:s,to:i,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:u,data:l,input:f}=e;dn(e);const d=an(u),h=Ze(t.signature||e),g=[I(n),s?I(s):"0x",c?I(c):"0x",a?I(a):"0x",r?I(r):"0x",i??"0x",o?I(o):"0x",l??f??"0x",d,...h?bt(h):[]];return R(fa,je(g))}function Gr(e){const{chainId:t,gasPrice:n,to:r}=e;if(t<=0)throw new Et({chainId:t});if(r&&Q(r,{strict:!1}),n&&BigInt(n)>2n**256n-1n)throw new Zr({gasPrice:n})}function la(e,t={}){const{chainId:n,gas:r,data:s,input:i,nonce:o,to:a,value:c,accessList:u,gasPrice:l}=e;Gr(e);const f=an(u),d=Ze(t.signature||e),h=[I(n),o?I(o):"0x",l?I(l):"0x",r?I(r):"0x",a??"0x",c?I(c):"0x",s??i??"0x",f,...d?bt(d):[]];return R("0x01",je(h))}const ha="0x04";function Kr(e){const{authorizationList:t}=e;if(t)for(const n of t){const{address:r,chainId:s}=n;if(r&&Q(r,{strict:!1}),Number(s)<0)throw new Et({chainId:s})}dn(e)}function pa(e,t={}){const{authorizationList:n,chainId:r,gas:s,nonce:i,to:o,value:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:l,data:f,input:d}=e;Kr(e);const h=an(l),g=ta(n),w=Ze(t.signature||e),P=[I(r),i?I(i):"0x",u?I(u):"0x",c?I(c):"0x",s?I(s):"0x",o??"0x",a?I(a):"0x",f??d??"0x",h,g,...w?bt(w):[]];return R(ha,je(P))}function Yr(e){const{domain:t,message:n,primaryType:r,types:s}=e,i=(o,a)=>{for(const c of o){const{name:u,type:l}=c,f=a[u],d=l.match(en);if(d&&(typeof f=="number"||typeof f=="bigint")){const[,w,P]=d;I(f,{signed:w==="int",size:Number.parseInt(P??"")/8})}if(l==="address"&&typeof f=="string"&&!st(f))throw new Ut({address:f,cause:new lr});const h=l.match(yr);if(h){const[,w]=h;if(w&&j(f)!==Number.parseInt(w))throw new ba({expectedSize:Number.parseInt(w),givenSize:j(f)})}const g=s[l];g&&(Ba(l),i(g,f))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new wa({domain:t});i(s.EIP712Domain,t)}if(r!=="EIP712Domain")if(s[r])i(s[r],n);else throw new xa({primaryType:r,types:s})}function ya(e){const{domain:t={},message:n,primaryType:r}=e,s={EIP712Domain:vt(t),...e.types};Yr({domain:t,message:n,primaryType:r,types:s});const i=["0x19","0x01"];return t&&i.push(Wr({domain:t,types:s})),r!=="EIP712Domain"&&i.push(Xr({data:n,primaryType:r,types:s})),R(...i)}function ma(e){const{primaryType:t,types:n}=e;let r="";const s=es({primaryType:t,types:n});s.delete(t);const i=[t,...Array.from(s).sort()];for(const o of i)r+=`${o}(${(n[o]??[]).map(({name:a,type:c})=>`${c} ${a}`).join(",")})`;return r}function vt(e){return[typeof e?.name=="string"&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},typeof e?.chainId=="number"&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Zc(e){return K(ya(e))}function Wr(e){const{domain:t,types:n}=e;return Xr({data:t,primaryType:"EIP712Domain",types:{...n,EIP712Domain:n?.EIP712Domain||vt(t)}})}function Xr(e){const{data:t,primaryType:n,types:r}=e,s=Qr({data:t,primaryType:n,types:r});return K(s)}function Fc(e){const{domain:t,message:n,primaryType:r,types:s}=e,i=(c,u)=>{const l={...u};for(const f of c){const{name:d,type:h}=f;h==="address"&&(l[d]=l[d].toLowerCase())}return l},o=(()=>{if(!t)return{};const c=s.EIP712Domain??vt(t);return i(c,t)})(),a=(()=>{if(r!=="EIP712Domain")return s[r]?i(s[r],n):{}})();return ut({domain:o,message:a,primaryType:r,types:s},(c,u)=>typeof u=="bigint"?u.toString():u)}function ga(e){try{return Yr(e),!0}catch{return!1}}class ba extends S{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.BytesSizeMismatchError"})}}class wa extends S{constructor({domain:t}){super(`Invalid domain "${ut(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.InvalidDomainError"})}}class xa extends S{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{metaMessages:["Check that the primary type is a key in `types`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.InvalidPrimaryTypeError"})}}class Ea extends S{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.InvalidStructTypeError"})}}function Qr(e){const{data:t,primaryType:n,types:r}=e,s=[{type:"bytes32"}],i=[va({primaryType:n,types:r})];for(const o of r[n]??[]){const[a,c]=Jr({types:r,name:o.name,type:o.type,value:t[o.name]});s.push(a),i.push(c)}return gt(s,i)}function va(e){const{primaryType:t,types:n}=e,r=dt(ma({primaryType:t,types:n}));return K(r)}function Jr(e){let{types:t,name:n,type:r,value:s}=e;if(t[r]!==void 0)return[{type:"bytes32"},K(Qr({data:s,primaryType:r,types:t}))];if(r==="bytes")return s=`0x${(s.length%2?"0":"")+s.slice(2)}`,[{type:"bytes32"},K(s,{as:"Hex"})];if(r==="string")return[{type:"bytes32"},K(Vn(s),{as:"Hex"})];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),o=s.map(a=>Jr({name:n,type:i,types:t,value:a}));return[{type:"bytes32"},K(gt(o.map(([a])=>a),o.map(([,a])=>a)))]}return[{type:r},s]}function es(e,t=new Set){const{primaryType:n,types:r}=e,i=n.match(/^\w*/u)?.[0];if(t.has(i)||r[i]===void 0)return t;t.add(i);for(const o of r[i])es({primaryType:o.type,types:r},t);return t}function Ba(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new Ea({type:e})}function Me(e){return ht(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function xe(e,t){if(e.length!==t.length)throw new Error("The number of parameters and values must match.");const n=Ia({params:e,values:t}),r=hn(n);return r.length===0?"0x":r}function Ia({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(ln({param:e[r],value:t[r]}));return n}function ln({param:e,value:t}){const n=La(e.type);if(n){const[r,s]=n;return Sa(t,{length:r,param:{...e,type:s}})}if(e.type==="tuple")return Oa(t,{param:e});if(e.type==="address")return Aa(t);if(e.type==="bool")return $a(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int");return _a(t,{signed:r})}if(e.type.startsWith("bytes"))return Pa(t,{param:e});if(e.type==="string")return Ta(t);throw new Error(`Unsupported parameter type: ${e.type}`)}function hn(e){let t=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:a}=e[i];o?t+=32:t+=Me(a)}const n=[],r=[];let s=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:a}=e[i];o?(n.push(le(t+s,{size:32})),r.push(a),s+=Me(a)):n.push(a)}return R(...n,...r)}function Aa(e){if(e!==""&&e!==void 0&&!$s(e))throw new Error(`Invalid address: ${e}`);return{dynamic:!1,encoded:we(e.toLowerCase())}}function Sa(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Error("Invalid array value.");if(!r&&e.length!==t)throw new Error("Invalid array length.");let s=!1;const i=[];for(let o=0;o<e.length;o++){const a=ln({param:n,value:e[o]});a.dynamic&&(s=!0),i.push(a)}if(r||s){const o=hn(i);if(r){const a=le(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?R(a,o):a}}if(s)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:R(...i.map(({encoded:o})=>o))}}function Pa(e,{param:t}){const[,n]=t.type.split("bytes"),r=Me(e);if(!n){let s=e;return r%32!==0&&(s=we(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:R(we(le(r,{size:32})),s)}}if(r!==Number.parseInt(n))throw new Error(`Invalid bytes${n} size: ${r}`);return{dynamic:!1,encoded:we(e,{dir:"right"})}}function $a(e){return{dynamic:!1,encoded:we(ps(e))}}function _a(e,{signed:t}){return{dynamic:!1,encoded:le(e,{signed:t,size:32})}}function Ta(e){const t=Ft(e),n=Math.ceil(Me(t)/32),r=[];for(let s=0;s<n;s++)r.push(we(D(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:R(we(le(Me(t),{size:32})),...r)}}function Oa(e,{param:t}){let n=!1;const r=[];for(let s=0;s<t.components.length;s++){const i=t.components[s],o=Array.isArray(e)?s:i.name,a=ln({param:i,value:e[o]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?hn(r):R(...r.map(({encoded:s})=>s))}}function La(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const{toFunctionSelector:za}=await De("viem"),zt=new ws(4096);function de(e){const t=typeof e=="string"?e:Ts(e);if(zt.has(t))return zt.get(t);const n=typeof e=="string"?Le(e):e,s=[za(n),n.inputs,n.outputs];return zt.set(t,s),s}function ts(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="function")}const{decodeAbiParameters:Ra}=await De("viem");async function pn(e){const{contract:t,method:n,params:r}=e,s=async()=>{if(Array.isArray(n))return n;if(ts(n))return de(n);if(typeof n=="function")return de(await n(t));if(typeof n=="string"&&n.startsWith("function ")){const f=Le(n);if(f.type==="function")return de(f);throw new Error('"method" passed is not of type "function"')}if(t.abi&&t.abi?.length>0){const f=t.abi?.find(d=>d.type==="function"&&d.name===n);if(f)return de(f)}throw new Error(`Could not resolve method "${n}".`)},[i,o]=await Promise.all([s(),typeof r=="function"?r():r]);let a;i[1].length===0?a=i[0]:a=i[0]+xe(i[1],o).slice(2);const c=lt({chain:t.chain,client:t.client}),u=await ir(c,{data:a,from:e.from?Ce(e.from):void 0,to:t.address}),l=Ra(i[2],u);return Array.isArray(l)&&l.length===1?l[0]:l}const Gc=Object.freeze(Object.defineProperty({__proto__:null,readContract:pn},Symbol.toStringTag,{value:"Module"}));function Ca(e){const t=new Set;let n=e;const r=()=>{for(const s of t)s()};return{getValue(){return n},setValue(s){s!==n&&(n=s,r())},subscribe(s){return t.add(s),()=>{t.delete(s)}}}}const qt=new Map;function Na(e){const t=qt.get(e);if(t)return t;const n=Ca([]);return qt.set(e,n),n}function Ua(e){const{address:t,transactionHash:n,chainId:r}=e,s=Na(t);s.setValue([...s.getValue(),{chainId:r,transactionHash:n}]),qt.set(t,s)}async function ka(e){let{account:t,transaction:n,gasless:r}=e;if(t.onTransactionRequested&&await t.onTransactionRequested(n),n.eip712){const{sendEip712Transaction:o}=await he(async()=>{const{sendEip712Transaction:a}=await import("./send-eip712-transaction-CxRy-sD1.js").then(c=>c.a);return{sendEip712Transaction:a}},__vite__mapDeps([2,3,4,5,0,1,6,7,8,9,10,11,12]));return o({account:t,transaction:n})}const s=await Ds({from:t,transaction:n});if(r){const{sendGaslessTransaction:o}=await he(async()=>{const{sendGaslessTransaction:a}=await import("./send-gasless-transaction-Iz8ZLiHO.js");return{sendGaslessTransaction:a}},__vite__mapDeps([14,3]));return o({account:t,gasless:r,serializableTransaction:s,transaction:n})}const i=await t.sendTransaction(s);return Ua({address:t.address,chainId:n.chain.id,transactionHash:i.transactionHash}),{...i,chain:n.chain,client:n.client}}const Ha=Object.freeze(Object.defineProperty({__proto__:null,sendTransaction:ka},Symbol.toStringTag,{value:"Module"}));function Hn(e){const{transaction:t}=e,n=Ma(t),r=(()=>{if(e.signature)return"v"in e.signature&&typeof e.signature.v<"u"?Dr({r:Be(e.signature.r),s:Be(e.signature.s),v:Number(e.signature.v)}):{r:Be(e.signature.r),s:Be(e.signature.s),yParity:e.signature.yParity};if(!(typeof t.v>"u"&&typeof t.yParity>"u")){if(t.r===void 0||t.s===void 0)throw new Error("Invalid signature provided with transaction");return{r:typeof t.r=="bigint"?t.r:Be(t.r),s:typeof t.s=="bigint"?t.s:Be(t.s),yParity:typeof t.v<"u"&&typeof t.yParity>"u"?wt(Number(t.v)):Number(t.yParity)}}})();if(n==="eip1559"){const s=t;return dn(s),da(s,{signature:r})}if(n==="legacy"){const s=t;return Fr(s),ua(s,{signature:r})}if(n==="eip2930"){const s=t;return Gr(s),la(s,{signature:r})}if(n==="eip7702"){const s=t;return Kr(s),pa(s,{signature:r})}throw new Error("Invalid transaction type")}function Ma(e){if(typeof e.type<"u")return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new Error("Invalid transaction type")}function Kc({transaction:e,privateKey:t}){const n=Hn({transaction:e}),r=sa({payload:K(n),privateKey:t});return Hn({transaction:{...e,...r}})}const Da={eip1559:1,eip2930:2,eip4844:3,eip7702:4,legacy:0};function ns(e,t){return t&&(e.__preparedMethod=t.preparedMethod,e.__contract=t.contract),e}const Va=Object.freeze(Object.defineProperty({__proto__:null,TransactionTypeMap:Da,prepareTransaction:ns},Symbol.toStringTag,{value:"Module"}));function yn(e){const{contract:t,method:n,params:r,...s}=e,i=()=>(async()=>{if(Array.isArray(n))return n;if(ts(n))return de(n);if(typeof n=="function")return de(await n(t));if(typeof n=="string"&&n.startsWith("function ")){const o=Le(n);if(o.type==="function")return de(o);throw new Error('"method" passed is not of type "function"')}if(t.abi&&t.abi?.length>0){const o=t.abi?.find(a=>a.type==="function"&&a.name===n);if(o)return de(o)}throw new Error(`Could not resolve method "${n}".`)})();return ns({...s,chain:t.chain,client:t.client,data:async()=>{let o;return Array.isArray(n)?o=n:o=await i(),o[1].length===0?o[0]:o[0]+xe(o[1],await ce(r??[])).slice(2)},to:t.address},{contract:t,preparedMethod:i})}function ja(e,t){const n=typeof t=="string"?{to:t}:t;switch(n.to){case"number":return Fa(e,n);case"bigint":return qa(e,n);case"boolean":return Za(e,n);case"string":return Ga(e,n);default:return ys(e,n)}}function qa(e,t={}){return qn(e,t)}function Za(e,t={}){return jn(e,t)}function Fa(e,t={}){return X(e,t)}function Ga(e,t={}){return Zn(e,t)}function rs(e){return R(...e)}const Yc=Object.freeze(Object.defineProperty({__proto__:null,concatHex:rs},Symbol.toStringTag,{value:"Module"})),Ka="0x6492649264926492649264926492649264926492649264926492649264926492",Ya="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",Wa=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function Xa(e){if(D(e,-32)!==Ka)throw new Ja(e)}function Qa(e){try{return Xa(e),!0}catch{return!1}}class Ja extends S{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WrappedSignature.InvalidWrappedSignatureError"})}}const{decodeAbiParameters:Wc}=await De("viem"),ec="0x1626ba7e",tc=[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],nc=[{type:"bytes4"}];async function rc(e){return pn({contract:e.contract,method:[ec,tc,nc],params:[e.hash,e.signature]})}const et=new WeakMap;function sc(e){if(et.has(e))return et.get(e);const t=(async()=>{const n=lt(e),r=await js(n,{address:e.address,blockTag:"latest"});return r==="0x"&&et.delete(e),r})();return et.set(e,t),t}const Mn=new WeakSet;async function Fe(e){if(Mn.has(e))return!0;const n=await sc(e)!=="0x";return n&&Mn.add(e),n}const ic=Object.freeze(Object.defineProperty({__proto__:null,isContractDeployed:Fe},Symbol.toStringTag,{value:"Module"})),oc="0x6492649264926492649264926492649264926492649264926492649264926492";function mn({address:e,data:t,signature:n}){return rs([xe([{type:"address"},{type:"bytes"},{type:"bytes"}],[e,t,n]),oc])}const ac="0xfB688330379976DA81eB64Fe4BF50d7401763B9C";async function Xc({hash:e,signature:t,address:n,client:r,chain:s,accountFactory:i}){const o=(()=>{if(ht(t))return t;if(typeof t=="object"&&"r"in t&&"s"in t)return Go(t);if(t instanceof Uint8Array)return ja(t,"hex");throw new Error(`Invalid signature type for signature ${t}: ${typeof t}`)})();if(await Fe(Bt({address:n,chain:s,client:r}))&&await ct({contract:Bt({address:n,chain:s,client:r}),hash:e,signature:o}).catch(g=>(console.error("Error verifying EIP-1271 signature",g),!1)))return!0;const c=await(async()=>!i||Qa(o)?o:mn({address:i.address,data:i.verificationCalldata,signature:o}))();let u;const l=await sr(s),f=Ys(Wa);if(l)u={data:uo(on(f,"isValidSig"),[n,e,c]),to:ac};else{const h=co(f);u={data:ao(h,{args:[n,e,c],bytecode:Ya})}}const d=lt({chain:s,client:r});try{const h=await ir(d,u);return ms(h)}catch{return!!await ct({contract:Bt({address:n,chain:s,client:r}),hash:e,signature:o}).catch(g=>(console.error("Error verifying EIP-1271 signature",g),!1))}}const cc="0x1626ba7e";async function ct({hash:e,signature:t,contract:n}){try{return await rc({contract:n,hash:e,signature:t})===cc}catch(r){return console.error("Error verifying EIP-1271 signature",r),!1}}const uc=`Ethereum Signed Message:
|
|
5
5
|
`;function fc(e,t){const n=typeof e=="string"?xn(e):e.raw instanceof Uint8Array?e.raw:_s(e.raw),r=xn(`${uc}${n.length}`);return fe(Gn(r,n),t)}function dc(e){const{domain:t={},message:n,primaryType:r}=e,s={EIP712Domain:vt(t),...e.types};ga({domain:t,message:n,primaryType:r,types:s});const i=["0x1901"];if(t&&i.push(Wr({domain:t,types:s})),r!=="EIP712Domain"){const o=(()=>{const a=ss({data:n,primaryType:r,types:s});return fe(a)})();i.push(o)}return fe(Gn(...i.map(o=>Zt(o))))}function ss({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],s=[lc({primaryType:t,types:n})];if(!n[t])throw new Error("Invalid types");for(const i of n[t]){const[o,a]=os({name:i.name,type:i.type,types:n,value:e[i.name]});r.push(o),s.push(a)}return xe(r,s)}function lc({primaryType:e,types:t}){const n=Kn(hc({primaryType:e,types:t}));return fe(n)}function hc({primaryType:e,types:t}){let n="";const r=is({primaryType:e,types:t});r.delete(e);const s=[e,...Array.from(r).sort()];for(const i of s){if(!t[i])throw new Error("Invalid types");n+=`${i}(${t[i].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`}return n}function is({primaryType:e,types:t},n=new Set){const s=e.match(/^\w*/u)?.[0];if(n.has(s)||t[s]===void 0)return n;n.add(s);for(const i of t[s])is({primaryType:i.type,types:t},n);return n}function os({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},fe(ss({data:r,primaryType:n,types:e}))];if(n==="bytes")return r=`0x${(r.length%2?"0":"")+r.slice(2)}`,[{type:"bytes32"},fe(r)];if(n==="string")return[{type:"bytes32"},fe(Kn(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),i=r.map(o=>os({name:t,type:s,types:e,value:o}));return[{type:"bytes32"},fe(xe(i.map(([o])=>o),i.map(([,o])=>o)))]}return[{type:n},r]}async function Qc(e){const{factoryContract:t,predictAddressOverride:n,adminAddress:r,accountSalt:s,accountAddress:i}=e;if(n)return n(t,r);if(i)return i;if(!r)throw new Error("Account address is required to predict the smart wallet address.");return xs(async()=>{const o=s&&ht(s)?s:Ft(s??"");let a,c=0;const u=3;for(;c<=u;)try{a=await pn({contract:t,method:"function getAddress(address, bytes) returns (address)",params:[r,o]});break}catch(l){if(c===u)throw l;const f=2**(c+1)*200;await new Promise(d=>setTimeout(d,f)),c++}if(!a)throw new Error(`No smart account address found for admin address ${r} and salt ${s}`);return a},{cacheKey:`${e.factoryContract.chain.id}-${e.factoryContract.address}-${e.adminAddress}-${e.accountSalt}`,cacheTime:1e3*60*60*24})}function as(e){const{adminAddress:t,factoryContract:n,createAccountOverride:r,accountSalt:s}=e;if(r)return r(n,t);const i=s&&ht(s)?s:Ft(s??"");return yn({contract:n,method:"function createAccount(address, bytes) returns (address)",params:[t,i]})}function Jc(e){const{accountContract:t,transaction:n,executeOverride:r}=e;if(r)return r(t,n);let s=n.value||0n;return(n.chainId===295||n.chainId===296)&&(s=BigInt(s)/BigInt(10**10)),yn({contract:t,gas:n.gas?n.gas+21000n:void 0,method:"function execute(address, uint256, bytes)",params:[n.to||"",s,n.data||"0x"]})}function eu(e){const{accountContract:t,transactions:n,executeBatchOverride:r}=e;if(r)return r(t,n);let s=n.map(o=>o.value||0n);const i=n[0]?.chainId;return(i===295||i===296)&&(s=s.map(o=>BigInt(o)/BigInt(10**10))),yn({contract:t,method:"function executeBatch(address[], uint256[], bytes[])",params:[n.map(o=>o.to||""),s,n.map(o=>o.data||"0x")]})}async function pc({accountContract:e,factoryContract:t,options:n,message:r}){const s=fc(r);let i;const o=xe([{type:"bytes32"}],[s]);if(i=await n.personalAccount.signTypedData({domain:{chainId:n.chain.id,name:"Account",verifyingContract:e.address,version:"1"},message:{message:o},primaryType:"AccountMessage",types:{AccountMessage:[{name:"message",type:"bytes"}]}}),await Fe(e)){if(await ct({contract:e,hash:s,signature:i}))return i;throw new Error("Failed to verify signature")}else{const c=as({accountSalt:n.overrides?.accountSalt,adminAddress:n.personalAccount.address,createAccountOverride:n.overrides?.createAccount,factoryContract:t});if(!c)throw new Error("Create account override not provided");const u=await Gt(c);return mn({address:t.address,data:u,signature:i})}}async function yc({accountContract:e,factoryContract:t,options:n,typedData:r}){if(r.domain?.verifyingContract?.toLowerCase()===e.address?.toLowerCase())return n.personalAccount.signTypedData(r);const i=dc(r);let o;const a=xe([{type:"bytes32"}],[i]);if(o=await n.personalAccount.signTypedData({domain:{chainId:n.chain.id,name:"Account",verifyingContract:e.address,version:"1"},message:{message:a},primaryType:"AccountMessage",types:{AccountMessage:[{name:"message",type:"bytes"}]}}),await Fe(e)){if(await ct({contract:e,hash:i,signature:o}))return o;throw new Error("Failed to verify signature")}else{const u=as({accountSalt:n.overrides?.accountSalt,adminAddress:n.personalAccount.address,createAccountOverride:n.overrides?.createAccount,factoryContract:t});if(!u)throw new Error("Create account override not provided");const l=await Gt(u);return mn({address:t.address,data:l,signature:o})}}async function cs(e){const{accountContract:t}=e,n=Date.now(),r=6e4,{isContractDeployed:s}=await he(async()=>{const{isContractDeployed:o}=await Promise.resolve().then(()=>ic);return{isContractDeployed:o}},void 0);let i=await s(t);for(;!i;){if(Date.now()-n>r)throw new Error("Timeout: Smart account deployment not confirmed after 1 minute");await new Promise(o=>setTimeout(o,500)),i=await s(t)}}async function mc(e){const{chain:t,client:n,smartAccount:r,accountContract:s}=e;if(await Fe(s))return;const[{sendTransaction:o},{prepareTransaction:a}]=await Promise.all([he(()=>Promise.resolve().then(()=>Ha),void 0),he(()=>Promise.resolve().then(()=>Va),void 0)]),c=a({chain:t,client:n,gas:50000n,to:s.address,value:0n}),u=await o({account:r,transaction:c});return await cs({accountContract:s}),u}const tu=Object.freeze(Object.defineProperty({__proto__:null,confirmContractDeployment:cs,deploySmartAccount:mc,smartAccountSignMessage:pc,smartAccountSignTypedData:yc},Symbol.toStringTag,{value:"Module"}));export{Ca as $,Le as A,Zc as B,jc as C,Mr as D,Xc as E,qa as F,Za as G,Fa as H,Ga as I,mc as J,_c as K,js as L,ja as M,Ms as N,Oc as O,ns as P,Kc as Q,K as R,vt as S,ga as T,Fc as U,Mc as V,Dc as W,sa as X,Go as Y,$c as Z,Hc as _,Ua as a,Vc as a0,Gc as a1,Yc as a2,tu as a3,ka as b,Tc as c,rs as d,xe as e,Fe as f,sc as g,as as h,Pc as i,sr as j,Qc as k,Jc as l,Cc as m,eu as n,qs as o,yn as p,Lc as q,pn as r,Hn as s,Ds as t,zc as u,qc as v,kc as w,Uc as x,ia as y,ir as z};
|
package/assets/{swapHorizontalRoundedBold-CQD5i-I5.js → swapHorizontalRoundedBold-CHqEVcBs.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as C}from"./core-
|
|
1
|
+
import{w as C}from"./core-iy2F1EJT.js";const L=C`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as t}from"./core-
|
|
1
|
+
import{w as t}from"./core-iy2F1EJT.js";const l=t`<svg width="32" height="32" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
|
2
2
|
<g clip-path="url(#a)">
|
|
3
3
|
<path fill="url(#b)" d="M0 0h32v32H0z"/>
|
|
4
4
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.034 15.252c4.975-2.167 8.293-3.596 9.953-4.287 4.74-1.971 5.725-2.314 6.366-2.325.142-.002.457.033.662.198.172.14.22.33.243.463.022.132.05.435.028.671-.257 2.7-1.368 9.248-1.933 12.27-.24 1.28-.71 1.708-1.167 1.75-.99.091-1.743-.655-2.703-1.284-1.502-.985-2.351-1.598-3.81-2.558-1.684-1.11-.592-1.721.368-2.718.252-.261 4.619-4.233 4.703-4.594.01-.045.02-.213-.08-.301-.1-.09-.246-.059-.353-.035-.15.034-2.55 1.62-7.198 4.758-.682.468-1.298.696-1.851.684-.61-.013-1.782-.344-2.653-.628-1.069-.347-1.918-.53-1.845-1.12.039-.308.462-.623 1.27-.944Z" fill="#fff"/>
|