@dcl/shop 0.1.0-28849951791.commit-e0fa315 → 0.1.0-28866858903.commit-27edcd7
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/{Assets-uXzVK3Qk.js → Assets-CT28s3tn.js} +1 -1
- package/assets/{Cart-B_feHFWP.js → Cart-DM50ezI4.js} +1 -1
- package/assets/{CircularProgress-MlGhFCHM.js → CircularProgress-DG2FpN0J.js} +1 -1
- package/assets/{Collection-HISXJvQ9.js → Collection-C1Lg8iud.js} +1 -1
- package/assets/{Creator-DckKaL-1.js → Creator-DEfpeOuR.js} +1 -1
- package/assets/{ExchangeController-Baa0YVeA.js → ExchangeController-CgeVuXaK.js} +1 -1
- package/assets/{GetCredits-DqKwryal.js → GetCredits-D2PhJWRd.js} +2 -2
- package/assets/{HelpersUtil-BVXkvMyH.js → HelpersUtil-BMvoH0KX.js} +1 -1
- package/assets/{ImportListings-3PSkCxI9.js → ImportListings-BW6Whd2Z.js} +1 -1
- package/assets/{ItemDetail-Ck5cudTI.js → ItemDetail-Cm6-wcV1.js} +1 -1
- package/assets/{Market-r9wggpqR.js → Market-ByTd4_V6.js} +1 -1
- package/assets/{MenuItem-CTKZTFhj.js → MenuItem-fSoZrIOB.js} +1 -1
- package/assets/{MyAssets-DbjlwVgI.js → MyAssets-DrK5wf4w.js} +1 -1
- package/assets/{MyFavorites-CUJsTl4U.js → MyFavorites-BYYLAkSE.js} +1 -1
- package/assets/{MyPurchases-D231IumZ.js → MyPurchases-uiVXvPAV.js} +1 -1
- package/assets/{NotFound-MYCYhimC.js → NotFound-DBcHTJ9Q.js} +1 -1
- package/assets/{RealCheckout-_Z3g7ZbH.js → RealCheckout-BH-IXEKW.js} +1 -1
- package/assets/{ShopFooterInner-gDzKrctg.js → ShopFooterInner-BecaIUMc.js} +2 -2
- package/assets/{Success-vyQPaFjH.js → Success-XVaAYlbU.js} +1 -1
- package/assets/{SvgIcon-DHNKm7fg.js → SvgIcon-_uqtXVDj.js} +1 -1
- package/assets/{SwapController-C28NtHea.js → SwapController-Dt7v7c5Z.js} +1 -1
- package/assets/{TradeService-CV6tm-S-.js → TradeService-BtTy0G3e.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-CPW2Gx43.js → W3MFrameProviderSingleton-BGrWzqsE.js} +3 -3
- package/assets/{WebCryptoP256-CJ8gEFrP.js → WebCryptoP256-Ddd92cBG.js} +1 -1
- package/assets/{basic-Cp5xCH29.js → basic-Cs_uWRSy.js} +1 -1
- package/assets/{biconomy-DE6VN2MK.js → biconomy-C-red-Y4.js} +1 -1
- package/assets/{buy-gasless-C0vjtz9e.js → buy-gasless-k9AJLehR.js} +1 -1
- package/assets/{buy-DW_YPH6-.js → buy-ywa6QYOz.js} +1 -1
- package/assets/{ccip-Dw1-xWm0.js → ccip-C-81g62f.js} +1 -1
- package/assets/{ccip-CO-J9tPJ.js → ccip-DZmtf0-e.js} +1 -1
- package/assets/{collection-gU9snfSG.js → collection-BgiwV3T2.js} +1 -1
- package/assets/{controller-Dp-L0bGU.js → controller-Ujfw8iYY.js} +2 -2
- package/assets/{core-DOKNMejd.js → core-BBXU740E.js} +4 -4
- package/assets/{custom-DrZvVkR4.js → custom-DdewCaHO.js} +1 -1
- package/assets/{data-capture-CWmntLCH.js → data-capture-CAQuoq2H.js} +1 -1
- package/assets/decimals-Bf_Oizd2.js +1 -0
- package/assets/{decimals-BpJkRsKM.js → decimals-DbV6JWsZ.js} +1 -1
- package/assets/{detectExtension-BOrmaly3.js → detectExtension-BsnimyTc.js} +1 -1
- package/assets/{email-DTaLpEKv.js → email-D-Gg6ktV.js} +1 -1
- package/assets/{embedded-wallet-DVickMII.js → embedded-wallet-BygK-cU5.js} +1 -1
- package/assets/{engine-Cyf0wDMH.js → engine-CqQgekFY.js} +1 -1
- package/assets/{estimate-l1-fee-Ci_3qNsd.js → estimate-l1-fee-CON30Z4C.js} +1 -1
- package/assets/{eth_estimateGas-Bu7KbsjJ.js → eth_estimateGas-CDpfukc1.js} +1 -1
- package/assets/{eth_getStorageAt-gEhkd3Dl.js → eth_getStorageAt-B88Q9upn.js} +1 -1
- package/assets/{eth_getTransactionCount-CZrmDIpa.js → eth_getTransactionCount-C4d33r-r.js} +1 -1
- package/assets/{extractIPFS-HSGbtFdH.js → extractIPFS-SF68IVsy.js} +1 -1
- package/assets/{features-CjtSZKbI.js → features-CCBnPBuN.js} +1 -1
- package/assets/{fetchTokenMetadata-DcoAGAFy.js → fetchTokenMetadata-D8XVhXk_.js} +2 -2
- package/assets/{generateUtilityClasses-DMMGtITh.js → generateUtilityClasses-CKIya6ur.js} +1 -1
- package/assets/{get-ecosystem-wallet-info-GpWofI03.js → get-ecosystem-wallet-info-CyYDgfFp.js} +1 -1
- package/assets/{getBalance-IAhn1Sx7.js → getBalance-BfAqIBxL.js} +1 -1
- package/assets/{getInstalledModules-Clea_yJr.js → getInstalledModules-mqQipjK8.js} +1 -1
- package/assets/{getNFT-CbT_NWLy.js → getNFT-BtODCVGa.js} +2 -2
- package/assets/{getNFT-BkaCCDU5.js → getNFT-DErJLjpR.js} +1 -1
- package/assets/{hashTypedData-DAd66wY6.js → hashTypedData-BYNlhvPL.js} +1 -1
- package/assets/{hashTypedData-PYLB7hJl.js → hashTypedData-CW0ZlbZA.js} +1 -1
- package/assets/{import-dVEuzimB.js → import-Bw-yAc9q.js} +1 -1
- package/assets/{in-app-wallet-calls-l67EA4DZ.js → in-app-wallet-calls-NeNIVGtZ.js} +1 -1
- package/assets/{index-D1gEge8-.js → index-0GXqquxu.js} +3 -3
- package/assets/{index-B_NuPdf0.js → index-B0XE7Qzl.js} +1 -1
- package/assets/{index-B6lLVyUf.js → index-BB2MAbAB.js} +1 -1
- package/assets/{index-DnQG3NAn.js → index-BFHCiXWB.js} +1 -1
- package/assets/{index-B1ZF46Ko.js → index-BKh4fLim.js} +1 -1
- package/assets/{index-BWbKKFVK.js → index-B_F6pJEu.js} +1 -1
- package/assets/{index-DVcL7J_t.js → index-B_TejJ9A.js} +1 -1
- package/assets/{index-Bd4x7TMP.js → index-Be3GyXzC.js} +1 -1
- package/assets/{index-B94ghhpu.js → index-Bpm2At5Q.js} +1 -1
- package/assets/{index-BcZPRgUv.js → index-C0cx32sg.js} +1 -1
- package/assets/{index-BeUILvqM.js → index-C4D-6CtP.js} +1 -1
- package/assets/{index-a4k6LaYK.js → index-C6e6OYT7.js} +1 -1
- package/assets/{index-BjptEpaJ.js → index-C8d0rRhd.js} +1 -1
- package/assets/{index-CqnsV9lR.js → index-CAsWPx_4.js} +1 -1
- package/assets/{index-zbujtMDB.js → index-CI9qvWc6.js} +1 -1
- package/assets/{index-D5JjqjjU.js → index-CMgbQJrl.js} +1 -1
- package/assets/{index-CENUxZfv.js → index-CMnbAjSo.js} +1 -1
- package/assets/{index-rk-RtPGh.js → index-CORGgUhI.js} +1 -1
- package/assets/{index-BuedKT8D.js → index-CWKaW9cZ.js} +2 -2
- package/assets/{index-jCrNn234.js → index-CYiwoWgV.js} +1 -1
- package/assets/{index-CcsWoBJK.js → index-CZG-YTaJ.js} +1 -1
- package/assets/{index-DURh1PEo.js → index-C_jnF2T8.js} +1 -1
- package/assets/{index-CsVrdKM8.js → index-CqovlPfY.js} +1 -1
- package/assets/{index-CdO-kfoS.js → index-Cv6gBdhQ.js} +1 -1
- package/assets/{index-zVvLDKBh.js → index-CxlLn_V3.js} +2 -2
- package/assets/{index-7rWaFD7f.js → index-Cxu2kNxx.js} +1 -1
- package/assets/{index-o3xLbiUm.js → index-D2F7BUhb.js} +1 -1
- package/assets/{index-CuBAn4iR.js → index-D5Bpra19.js} +1 -1
- package/assets/{index-u77btqjQ.js → index-D6o05Q0p.js} +1 -1
- package/assets/{index-Bv11rzVa.js → index-D9OsLyrU.js} +1 -1
- package/assets/{index-o2j-czuk.js → index-DKI889w4.js} +1 -1
- package/assets/{index-u8nH4Rw0.js → index-DNkn2UX9.js} +1 -1
- package/assets/{index-Df6GKZpc.js → index-DUjm2IcF.js} +2 -2
- package/assets/{index-BVcNzXap.js → index-DaF3Vnaw.js} +1 -1
- package/assets/{index-CbyAJw4-.js → index-DauDncRr.js} +1 -1
- package/assets/{index-CAXOAo7E.js → index-De3Z7JXD.js} +1 -1
- package/assets/{index-C7St4Q5o.js → index-DeRdsl6L.js} +1 -1
- package/assets/{index-D9XZpwfV.js → index-Dh_23qfs.js} +5 -5
- package/assets/{index-CcUfpaSP.js → index-Dq_E0wOW.js} +1 -1
- package/assets/{index-DxWP3gak.js → index-DtsePI_i.js} +1 -1
- package/assets/{index-DOLdge0g.js → index-DuUdctHy.js} +1 -1
- package/assets/{index-BrR0WZ0Y.js → index-KR_pcYvC.js} +1 -1
- package/assets/{index-Dv41StGm.js → index-PX_c3Qb_.js} +1 -1
- package/assets/{index-B3P6BPci.js → index-QmaSqjcW.js} +1 -1
- package/assets/{index-uzc4dT8s.js → index-RYxtgu1n.js} +1 -1
- package/assets/{index-Bl9N3aWR.js → index-RbaKVJaM.js} +1 -1
- package/assets/{index-BKA2Kk9C.js → index-TS-e7Dqh.js} +1 -1
- package/assets/{index-BYg62rD6.js → index-ZkliCE3r.js} +1 -1
- package/assets/{index-C6uhDE9h.js → index-_K2YCvAG.js} +1 -1
- package/assets/{index-B0--HMVL.js → index-sV0xAzf6.js} +3 -3
- package/assets/{index-DqnX5uAR.js → index-uDlFzubM.js} +1 -1
- package/assets/{index.es-CYMyZCD-.js → index.es-CCdB6eaE.js} +1 -1
- package/assets/{index.es-DJUkBdGr.js → index.es-CQ0R_jWA.js} +1 -1
- package/assets/{index.es-UvEfkSna.js → index.es-d5kuURHY.js} +4 -4
- package/assets/{localBatchGatewayRequest-C9D88kZr.js → localBatchGatewayRequest-BexY9Mde.js} +1 -1
- package/assets/{mana-rate-Dx_lqKWQ.js → mana-rate-embrvpxV.js} +1 -1
- package/assets/network-mdKz8jdP.js +1 -0
- package/assets/{networks-KbQXXD7P.js → networks-ATqZYe-g.js} +1 -1
- package/assets/{onramp-iekcmGjJ.js → onramp-CC_Mk4Gm.js} +1 -1
- package/assets/{openzeppelin-41206uN_.js → openzeppelin-bDyc7per.js} +1 -1
- package/assets/{ownerOf-DH7SAQYs.js → ownerOf-B3YC-1gG.js} +1 -1
- package/assets/{parseNft-Dy8OsAtf.js → parseNft-Bp_loQO2.js} +2 -2
- package/assets/{parseSignature-BiaWpR8i.js → parseSignature-G8Ir60N1.js} +1 -1
- package/assets/{parseSignature-D9IuPuaA.js → parseSignature-k_e-4JPE.js} +3 -3
- package/assets/{pay-with-exchange-D0U4VJXZ.js → pay-with-exchange-C9Y_CGg6.js} +1 -1
- package/assets/{qr-overlay-35KmnL99.js → qr-overlay-KvaIp7-h.js} +1 -1
- package/assets/{receive-D80uh9Rj.js → receive-8erCTY1F.js} +1 -1
- package/assets/{resolveImplementation-BuxyNBBw.js → resolveImplementation-D0m-RM9g.js} +1 -1
- package/assets/{rpc-CV4XQPwJ.js → rpc-Db5G0SW1.js} +1 -1
- package/assets/{secp256k1-CZj9lLpY.js → secp256k1-CqOSmkL9.js} +1 -1
- package/assets/{secp256k1-lf00rTSa.js → secp256k1-d1PVlyhU.js} +1 -1
- package/assets/{secp256k1-Bz9G1VTq.js → secp256k1-hr2xO75Q.js} +1 -1
- package/assets/{send-batch-transaction-uDBYU3an.js → send-batch-transaction-DLM-_LrZ.js} +1 -1
- package/assets/{send-eip712-transaction-DR18L-sh.js → send-eip712-transaction-DP17AWWu.js} +2 -2
- package/assets/{send-gasless-transaction-BfuwoIYy.js → send-gasless-transaction-BFbMbtLp.js} +2 -2
- package/assets/{send-CZjs1yZc.js → send-oFAx02yK.js} +1 -1
- package/assets/{sendRawTransaction-BUgSPkVd.js → sendRawTransaction-B-N14GCq.js} +3 -3
- package/assets/{serializeTransaction-Dmi33xSK.js → serializeTransaction-BLc8aQzS.js} +1 -1
- package/assets/{session-proposal-BOa4yxBl.js → session-proposal-M_2My__Q.js} +1 -1
- package/assets/{session-request-Bcaq75nd.js → session-request-DBYaO4q5.js} +2 -2
- package/assets/{sha256-zMI7s0-F.js → sha256-Cx7Ij8et.js} +1 -1
- package/assets/{signing-Cvv8O8BI.js → signing-DbptdEFO.js} +4 -4
- package/assets/{socials-C_Nw_-aT.js → socials-DAwqYnxC.js} +1 -1
- package/assets/{swaps-DrEprVp5.js → swaps-D7FObwMZ.js} +1 -1
- package/assets/{thirdweb-D3908hZR.js → thirdweb-CI-IL5Al.js} +3 -3
- package/assets/{totalSupply-CpI009r1.js → totalSupply-CnFxFHEm.js} +1 -1
- package/assets/{transactionReceipt-CRiBJ28i.js → transactionReceipt-BZFMW0kN.js} +1 -1
- package/assets/{transactions-63jnvtFL.js → transactions-40IT23nK.js} +1 -1
- package/assets/{useInfiniteGrid-xOdKaR3H.js → useInfiniteGrid-CjjuujTH.js} +1 -1
- package/assets/{verifyHash-BR9R1RG0.js → verifyHash-ClHnvqLw.js} +1 -1
- package/assets/{w3m-modal-lZE_ZuOa.js → w3m-modal-CNI9aYj6.js} +1 -1
- package/assets/{w3m-modal-BlMrqGaw.js → w3m-modal-cIgLRAbD.js} +1 -1
- package/assets/{wait-for-tx-receipt-Do82Sucy.js → wait-for-tx-receipt-RA8zh0o7.js} +1 -1
- package/assets/{wallet-kind-WAQetlRX.js → wallet-kind-DspYSL12.js} +1 -1
- package/assets/{wallets-CoP2jTeJ.js → wallets-CdAU3xHZ.js} +6 -6
- package/assets/{web-connector-uOzuTTW_.js → web-connector-BVaGSh3Y.js} +3 -3
- package/assets/{writeContract-D-hfmcKA.js → writeContract-DCf0vGST.js} +1 -1
- package/assets/{zoraTestnet-BMgpy9AE.js → zoraTestnet-DeE2yd9D.js} +1 -1
- package/index.html +8 -8
- package/package.json +2 -2
- package/assets/decimals-D1rmvFNT.js +0 -1
- package/assets/network-CCTP_tzM.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-zogUBnfz.js","assets/ethers-CU3Ctw5k.js","assets/react-4iaCnQ6n.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{p as gt,b as Yt,i as Zt,I as Qt,m as bt,s as ut,A as D,e as Xt,g as U,d as te,f as N,r as ee,h as ae,j as ne,k as re,w as se,n as oe,o as ie,q as ce,t as ue,v as de,u as le,x as Q,y as me,z as fe,B as he,C as $,D as pe,E as ye,F as ge,G as be,H as we,J as xe,K as Ee,L as Ie,M as Te,N as St,O as At,P as Ce,Q as Pt,R as _t,S as Rt,T as ve,U as dt,V as qt,W as Se,X as Ae,Y as Ft,Z as Pe,_ as Ut,$ as J,a0 as _e,a1 as kt,a2 as Re,a3 as qe,a4 as lt,a5 as Fe,a6 as Ue,a7 as ke,a8 as Be,a9 as Ne,aa as Bt,ab as Le}from"./parseSignature-D9IuPuaA.js";import{ac as Ir,ad as Tr,ae as Cr,af as vr,ag as Sr,ah as Ar,ai as Pr,aj as _r,ak as Rr,al as qr,am as Fr,an as Ur,ao as kr,ap as Br,aq as Nr,ar as Lr,as as Mr,at as Dr,au as zr,av as Gr,aw as $r,ax as Hr,ay as Or,az as jr,aA as Wr,aB as Vr,aC as Jr,aD as Kr,aE as Yr,aF as Zr,aG as Qr,aH as Xr,aI as ts,aJ as es,aK as as,aL as ns,aM as rs,aN as ss,aO as os,aP as is,aQ as cs,aR as us,aS as ds,aT as ls,aU as ms,aV as fs,aW as hs,aX as ps,aY as ys,aZ as gs,a_ as bs,a$ as ws,b0 as xs,b1 as Es,b2 as Is,b3 as Ts,b4 as Cs,b5 as vs,b6 as Ss,b7 as As,b8 as Ps,b9 as _s,ba as Rs,bb as qs,bc as Fs,bd as Us,be as ks,bf as Bs,bg as Ns,bh as Ls,bi as Ms,bj as Ds,bk as zs,bl as Gs,bm as $s,bn as Hs,bo as Os,bp as js,bq as Ws,br as Vs,bs as Js,bt as Ks,bu as Ys,bv as Zs,bw as Qs,bx as Xs,by as to,bz as eo,br as ao,bA as no,bB as ro,bC as so,bD as oo,bE as io,bF as co,bG as uo,bH as lo,bH as mo,bI as fo,bJ as ho,bi as po,bj as yo,bK as go,bL as bo,bM as wo,bN as xo,bO as Eo}from"./parseSignature-D9IuPuaA.js";import{T as B,b9 as k,U as Me,I as Y,ba as De,G as ze,bb as Ge,X as H,_ as ct,$ as G,B as mt,D as E,P as $e,a7 as He,bc as j,a6 as wt,R as Nt,bd as Lt,d as Mt,L as R,F as ft,A as F,be as A,M as Oe,N as je,bf as We,bg as xt,aG as ht,J as Ve,bh as Je,bi as Ke,bj as Ye,bk as Et}from"./signing-Cvv8O8BI.js";import{bl as To,bm as Co,bn as vo,bo as So,bp as Ao,bq as Po,br as _o,bs as Ro,bt as qo,bu as Fo,bv as Uo,bw as ko,bx as Bo,by as No,bz as Lo,Q as Mo,bA as Do,bB as zo,bC as Go,bD as $o,bE as Ho,bF as Oo,bG as jo,bH as Wo,bI as Vo,bJ as Jo,bK as Ko,bL as Yo,bM as Zo,bN as Qo,bO as Xo,bP as ti,bQ as ei,bR as ai,bS as ni,bT as ri,bU as si,bV as oi,E as ii,bW as ci,bX as ui,bY as di,bZ as li,b_ as mi,p as fi,b$ as hi,at as pi,au as yi,c0 as gi,c1 as bi,c2 as wi,c3 as xi,c4 as Ei,f as Ii,c4 as Ti,c5 as Ci,c6 as vi,c7 as Si,c8 as Ai,c9 as Pi,ca as _i,cb as Ri,cc as qi,cd as Fi,C as Ui,ce as ki,c3 as Bi,c4 as Ni,ce as Li,f as Mi,c4 as Di,z as zi}from"./signing-Cvv8O8BI.js";import{w as Ze,h as Qe,g as Xe,v as ta,s as ea}from"./hashTypedData-DAd66wY6.js";import{I as $i,a as Hi,b as Oi,d as ji,c as Wi,e as Vi}from"./hashTypedData-DAd66wY6.js";import{T as aa,a as Z,W as It,b as na,U as ra,R as sa}from"./rpc-CV4XQPwJ.js";import{A as Ki,c as Yi,B as Zi,C as Qi,D as Xi,H as tc,I as ec,d as ac,e as nc,f as rc,J as sc,L as oc,M as ic,h as cc,P as uc,i as dc,j as lc,k as mc,l as fc,m as hc,S as pc,n as yc,o as gc,p as bc,q as wc,r as xc,s as Ec}from"./rpc-CV4XQPwJ.js";import{_ as oa}from"./index-D9XZpwfV.js";import{t as ia,H as ca}from"./sha256-zMI7s0-F.js";import{b as Tc,h as Cc,a as vc,c as Sc,d as Ac,e as Pc,f as _c,g as Rc,i as qc,j as Fc,k as Uc,l as kc,n as Bc,o as Nc,p as Lc,q as Mc,r as Dc,u as zc,v as Gc,w as $c,x as Hc,y as Oc,z as jc,A as Wc,B as Vc,C as Jc,D as Kc,E as Yc,F as Zc,G as Qc,I as Xc,J as tu,K as eu,L as au,M as nu,N as ru,O as su,P as ou,Q as iu,R as cu,S as uu,m as du,T as lu,U as mu,V as fu,W as hu,X as pu,Y as yu,Z as gu,_ as bu,$ as wu,a0 as xu,a1 as Eu,a2 as Iu,a3 as Tu,a4 as Cu,a5 as vu,a6 as Su,a7 as Au,a8 as Pu,a9 as _u,aa as Ru,ab as qu,ac as Fu,ad as Uu,ae as ku,af as Bu,ag as Nu,ah as Lu,ai as Mu,aj as Du,ak as zu,al as Gu,am as $u,an as Hu,ao as Ou,ap as ju,aq as Wu,ar as Vu,as as Ju,at as Ku,au as Yu,av as Zu,aw as Qu,ax as Xu,ay as td,az as ed,aA as ad,aB as nd,aC as rd,aD as sd,aE as od,aF as id,aG as cd,aH as ud,aI as dd,aJ as ld,aK as md,s as fd}from"./sha256-zMI7s0-F.js";import{ccipRequest as pd,ccipRequest as yd,offchainLookup as gd,offchainLookupAbiItem as bd,offchainLookupSignature as wd}from"./ccip-CO-J9tPJ.js";import{d as Ed,a as Id,f as Td}from"./transactionReceipt-CRiBJ28i.js";import"./utils-kxirIM46.js";import"./ethers-CU3Ctw5k.js";import"./react-4iaCnQ6n.js";function jn(t){let e;if(typeof t=="string")e=gt(t,{modifiers:bt});else{const a=Yt(t),n=t.length;for(let r=0;r<n;r++){const s=t[r];if(!Zt(s)){e=gt(s,{modifiers:bt,structs:a});break}}}if(!e)throw new Qt({param:t});return e}async function M(t,e){return M.internal(t,ut,"sendTransaction",e)}(function(t){async function e(a,n,r,s){const{abi:u,account:d=a.account,address:c,args:i,dataSuffix:f,functionName:m,...h}=s;if(typeof d>"u")throw new D({docsPath:"/docs/contract/writeContract"});const o=d?N(d):null,p=Xt({abi:u,args:i,functionName:m});try{return await U(a,n,r)({data:`${p}${f?f.replace("0x",""):""}`,to:c,account:o,...h})}catch(l){throw te(l,{abi:u,address:c,args:i,docsPath:"/docs/contract/writeContract",functionName:m,sender:o==null?void 0:o.address})}}t.internal=e})(M||(M={}));function Wn({abi:t,address:e,client:a}){const n=a,[r,s]=n?"public"in n&&"wallet"in n?[n.public,n.wallet]:"public"in n?[n.public,void 0]:"wallet"in n?[void 0,n.wallet]:[n,n]:[void 0,void 0],u=r!=null,d=s!=null,c={};let i=!1,f=!1,m=!1;for(const h of t)if(h.type==="function"?h.stateMutability==="view"||h.stateMutability==="pure"?i=!0:f=!0:h.type==="event"&&(m=!0),i&&f&&m)break;return u&&(i&&(c.read=new Proxy({},{get(h,o){return(...p)=>{const{args:l,options:y}=W(p);return U(r,ee,"readContract")({abi:t,address:e,functionName:o,args:l,...y})}}})),f&&(c.simulate=new Proxy({},{get(h,o){return(...p)=>{const{args:l,options:y}=W(p);return U(r,ae,"simulateContract")({abi:t,address:e,functionName:o,args:l,...y})}}})),m&&(c.createEventFilter=new Proxy({},{get(h,o){return(...p)=>{const l=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,l);return U(r,ne,"createContractEventFilter")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.getEvents=new Proxy({},{get(h,o){return(...p)=>{const l=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,l);return U(r,re,"getContractEvents")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.watchEvent=new Proxy({},{get(h,o){return(...p)=>{const l=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,l);return U(r,se,"watchContractEvent")({abi:t,address:e,eventName:o,args:y,...w})}}}))),d&&f&&(c.write=new Proxy({},{get(h,o){return(...p)=>{const{args:l,options:y}=W(p);return U(s,M,"writeContract")({abi:t,address:e,functionName:o,args:l,...y})}}})),(u||d)&&f&&(c.estimateGas=new Proxy({},{get(h,o){return(...p)=>{const{args:l,options:y}=W(p);return U(r??s,oe,"estimateContractGas")({abi:t,address:e,functionName:o,args:l,...y,account:y.account??s.account})}}})),c.address=e,c.abi=t,c}function W(t){const e=t.length&&Array.isArray(t[0]),a=e?t[0]:[],n=(e?t[1]:t[0])??{};return{args:a,options:n}}function rt(t,e){let a=!1;Array.isArray(t[0])?a=!0:t.length===1?a=e.inputs.some(s=>s.indexed):t.length===2&&(a=!0);const n=a?t[0]:void 0,r=(a?t[1]:t[0])??{};return{args:n,options:r}}function Tt(t){return!t||typeof t!="object"||!("BYTES_PER_ELEMENT"in t)?!1:t.BYTES_PER_ELEMENT===1&&t.constructor.name==="Uint8Array"}function Vn(t){return t.opcode==="CREATE2"?da(t):ua(t)}function ua(t){const e=B(k(t.from));let a=B(t.nonce);return a[0]===0&&(a=new Uint8Array([])),k(`0x${Y(ia([e,a],"bytes")).slice(26)}`)}function da(t){const e=B(k(t.from)),a=Me(Tt(t.salt)?t.salt:B(t.salt),{size:32}),n="bytecodeHash"in t?Tt(t.bytecodeHash)?t.bytecodeHash:B(t.bytecodeHash):Y(t.bytecode,"bytes");return k(De(Y(ze([B("0xff"),e,a,n])),12))}function Jn({chains:t,id:e}){return t.find(a=>a.id===e)}function Dt(t,e="hex"){const a=(()=>{if(typeof t=="string"){if(t.length>3&&t.length%2!==0)throw new Ge(t);return H(t)}return t})(),n=ct(a,{recursiveReadLimit:Number.POSITIVE_INFINITY});return zt(n,e)}function zt(t,e="hex"){if(t.bytes.length===0)return e==="hex"?G(t.bytes):t.bytes;const a=t.readByte();if(a<128&&t.decrementPosition(1),a<192){const r=Ct(t,a,128),s=t.readBytes(r);return e==="hex"?G(s):s}const n=Ct(t,a,192);return la(t,n,e)}function Ct(t,e,a){if(a===128&&e<128)return 1;if(e<=a+55)return e-a;if(e===a+55+1)return t.readUint8();if(e===a+55+2)return t.readUint16();if(e===a+55+3)return t.readUint24();if(e===a+55+4)return t.readUint32();throw new mt("Invalid RLP prefix")}function la(t,e,a){const n=t.position,r=[];for(;t.position-n<e;)r.push(zt(t,a));return r}function ma(t){return E(t)&&$e(t)===32}const fa=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Gt=Uint8Array.from(new Array(16).fill(0).map((t,e)=>e)),ha=Gt.map(t=>(9*t+5)%16),$t=(()=>{const a=[[Gt],[ha]];for(let n=0;n<4;n++)for(let r of a)r.push(r[n].map(s=>fa[s]));return a})(),Ht=$t[0],Ot=$t[1],jt=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>Uint8Array.from(t)),pa=Ht.map((t,e)=>t.map(a=>jt[e][a])),ya=Ot.map((t,e)=>t.map(a=>jt[e][a])),ga=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),ba=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function vt(t,e,a,n){return t===0?e^a^n:t===1?e&a|~e&n:t===2?(e|~a)^n:t===3?e&n|a&~n:e^(a|~n)}const V=new Uint32Array(16);class wa extends ca{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:a,h2:n,h3:r,h4:s}=this;return[e,a,n,r,s]}set(e,a,n,r,s){this.h0=e|0,this.h1=a|0,this.h2=n|0,this.h3=r|0,this.h4=s|0}process(e,a){for(let o=0;o<16;o++,a+=4)V[o]=e.getUint32(a,!0);let n=this.h0|0,r=n,s=this.h1|0,u=s,d=this.h2|0,c=d,i=this.h3|0,f=i,m=this.h4|0,h=m;for(let o=0;o<5;o++){const p=4-o,l=ga[o],y=ba[o],w=Ht[o],g=Ot[o],C=pa[o],b=ya[o];for(let x=0;x<16;x++){const I=j(n+vt(o,s,d,i)+V[w[x]]+l,C[x])+m|0;n=m,m=i,i=j(d,10)|0,d=s,s=I}for(let x=0;x<16;x++){const I=j(r+vt(p,u,c,f)+V[g[x]]+y,b[x])+h|0;r=h,h=f,f=j(c,10)|0,c=u,u=I}}this.set(this.h1+d+f|0,this.h2+i+h|0,this.h3+m+r|0,this.h4+n+u|0,this.h0+s+c|0)}roundClean(){wt(V)}destroy(){this.destroyed=!0,wt(this.buffer),this.set(0,0,0,0,0)}}const xa=He(()=>new wa),Ea=xa;function Kn(t,e){const a=e||"hex",n=Ea(E(t,{strict:!1})?B(t):t);return a==="bytes"?n:Nt(n)}const st=new Map;async function Ia(t){const{getSocket:e,keepAlive:a=!0,key:n="socket",reconnect:r=!0,url:s}=t,{interval:u=3e4}=typeof a=="object"?a:{},{attempts:d=5,delay:c=2e3}=typeof r=="object"?r:{},i=JSON.stringify({keepAlive:a,key:n,url:s,reconnect:r});let f=st.get(i);if(f)return f;let m=0;const{schedule:h}=ie({id:i,fn:async()=>{const l=new Map,y=new Map;let w,g,C,b=!1;function x(){if(r&&m<d){if(b)return;b=!0,m++,g==null||g.close(),setTimeout(async()=>{await I().catch(console.error),b=!1},c)}else l.clear(),y.clear()}async function I(){const T=await e({onClose(){var v,P;for(const S of l.values())(v=S.onError)==null||v.call(S,new Z({url:s}));for(const S of y.values())(P=S.onError)==null||P.call(S,new Z({url:s}));x()},onError(v){var P,S;w=v;for(const _ of l.values())(P=_.onError)==null||P.call(_,w);for(const _ of y.values())(S=_.onError)==null||S.call(_,w);x()},onOpen(){w=void 0,m=0},onResponse(v){const P=v.method==="eth_subscription",S=P?v.params.subscription:v.id,_=P?y:l,q=_.get(S);q&&q.onResponse(v),P||_.delete(S)}});if(g=T,a&&(C&&clearInterval(C),C=setInterval(()=>{var v;return(v=g.ping)==null?void 0:v.call(g)},u)),r&&y.size>0){const v=y.entries();for(const[P,{onResponse:S,body:_,onError:q}]of v)_&&(y.delete(P),f==null||f.request({body:_,onResponse:S,onError:q}))}return T}return await I(),w=void 0,f={close(){C&&clearInterval(C),g.close(),st.delete(i)},get socket(){return g},request({body:T,onError:v,onResponse:P}){w&&v&&v(w);const S=T.id??ce.take(),_=q=>{var z;typeof q.id=="number"&&S!==q.id||(T.method==="eth_subscribe"&&typeof q.result=="string"&&y.set(q.result,{onResponse:_,onError:v,body:T}),T.method==="eth_unsubscribe"&&y.delete((z=T.params)==null?void 0:z[0]),P(q))};l.set(S,{onResponse:_,onError:v});try{g.request({body:{jsonrpc:"2.0",id:S,...T}})}catch(q){v==null||v(q)}},requestAsync({body:T,timeout:v=1e4}){return Ze(()=>new Promise((P,S)=>this.request({body:T,onError:S,onResponse:P})),{errorInstance:new aa({body:T,url:s}),timeout:v})},requests:l,subscriptions:y,url:s},st.set(i,f),[f]}}),[o,[p]]=await h();return p}async function K(t,e={}){const{keepAlive:a,reconnect:n}=e;return Ia({async getSocket({onClose:r,onError:s,onOpen:u,onResponse:d}){const c=await oa(()=>import("./native-zogUBnfz.js").then(o=>o.n),__vite__mapDeps([0,1,2])).then(o=>o.WebSocket),i=new c(t);function f(){i.removeEventListener("close",f),i.removeEventListener("message",m),i.removeEventListener("error",s),i.removeEventListener("open",u),r()}function m({data:o}){if(!(typeof o=="string"&&o.trim().length===0))try{const p=JSON.parse(o);d(p)}catch(p){s(p)}}i.addEventListener("close",f),i.addEventListener("message",m),i.addEventListener("error",s),i.addEventListener("open",u),i.readyState===c.CONNECTING&&await new Promise((o,p)=>{i&&(i.onopen=o,i.onerror=p)});const{close:h}=i;return Object.assign(i,{close(){h.bind(i)(),f()},ping(){try{if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({url:i.url,cause:new Z({url:i.url})});const o={jsonrpc:"2.0",id:null,method:"net_version",params:[]};i.send(JSON.stringify(o))}catch(o){s(o)}},request({body:o}){if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({body:o,url:i.url,cause:new Z({url:i.url})});return i.send(JSON.stringify(o))}})},keepAlive:a,reconnect:n,url:t})}async function Ta(t){const e=await K(t);return Object.assign(e.socket,{requests:e.requests,subscriptions:e.subscriptions})}function Ca(t){return Lt(t,-32)===ue}function va(t){return de(t)}function Yn(t){if(!Ca(t))return{signature:t};const[e,a,n]=Mt([{type:"address"},{type:"bytes"},{type:"bytes"}],t);return{address:e,data:a,signature:n}}function Zn(t){if(!va(t))return{signature:t};const{authorization:e,to:a,...n}=le(t);return{authorization:{address:e.address,chainId:e.chainId,nonce:Number(e.nonce),r:R(e.r,{size:32}),s:R(e.s,{size:32}),yParity:e.yParity},...a?{address:a}:{},...n}}async function Sa({message:t,signature:e}){return Q({hash:me(t),signature:e})}async function Aa(t){const{domain:e,message:a,primaryType:n,signature:r,types:s}=t;return Q({hash:Qe({domain:e,message:a,primaryType:n,types:s}),signature:r})}function Qn(t){const{address:e,data:a,signature:n,to:r="hex"}=t,s=fe({authorization:{address:t.authorization.address,chainId:t.authorization.chainId,nonce:BigInt(t.authorization.nonce),r:BigInt(t.authorization.r),s:BigInt(t.authorization.s),yParity:t.authorization.yParity},data:a,signature:n,to:e});return r==="hex"?s:H(s)}async function Xn({address:t,hash:e,signature:a}){return ft(k(t),await Q({hash:e,signature:a}))}async function tr({address:t,message:e,signature:a}){return ft(k(t),await Sa({message:e,signature:a}))}async function er(t){const{address:e,domain:a,message:n,primaryType:r,signature:s,types:u}=t;return ft(k(e),await Aa({domain:a,message:n,primaryType:r,signature:s,types:u}))}function Pa(t){const e=Lt(t,0,1);if(e==="0x04")return"eip7702";if(e==="0x03")return"eip4844";if(e==="0x02")return"eip1559";if(e==="0x01")return"eip2930";if(e!=="0x"&&F(e)>=192)return"legacy";throw new he({serializedType:e})}function _a(t){const e=Pa(t);return e==="eip1559"?Fa(t):e==="eip2930"?Ua(t):e==="eip4844"?qa(t):e==="eip7702"?Ra(t):ka(t)}function Ra(t){const e=X(t),[a,n,r,s,u,d,c,i,f,m,h,o,p]=e;if(e.length!==10&&e.length!==13)throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,authorizationList:m,...e.length>9?{v:h,r:o,s:p}:{}},serializedTransaction:t,type:"eip7702"});const l={chainId:F(a),type:"eip7702"};return E(d)&&d!=="0x"&&(l.to=d),E(u)&&u!=="0x"&&(l.gas=A(u)),E(i)&&i!=="0x"&&(l.data=i),E(n)&&(l.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(l.value=A(c)),E(s)&&s!=="0x"&&(l.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(l.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(l.accessList=tt(f)),m.length!==0&&m!=="0x"&&(l.authorizationList=Ba(m)),we(l),{...e.length===13?O(e):void 0,...l}}function qa(t){const e=X(t),a=e.length===4,n=a?e[0]:e,r=a?e.slice(1):[],[s,u,d,c,i,f,m,h,o,p,l,y,w,g]=n,[C,b,x]=r;if(!(n.length===11||n.length===14))throw new $({attributes:{chainId:s,nonce:u,maxPriorityFeePerGas:d,maxFeePerGas:c,gas:i,to:f,value:m,data:h,accessList:o,...n.length>9?{v:y,r:w,s:g}:{}},serializedTransaction:t,type:"eip4844"});const I={blobVersionedHashes:l,chainId:F(s),to:f,type:"eip4844"};return E(i)&&i!=="0x"&&(I.gas=A(i)),E(h)&&h!=="0x"&&(I.data=h),E(u)&&(I.nonce=u==="0x"?0:F(u)),E(m)&&m!=="0x"&&(I.value=A(m)),E(p)&&p!=="0x"&&(I.maxFeePerBlobGas=A(p)),E(c)&&c!=="0x"&&(I.maxFeePerGas=A(c)),E(d)&&d!=="0x"&&(I.maxPriorityFeePerGas=A(d)),o.length!==0&&o!=="0x"&&(I.accessList=tt(o)),C&&b&&x&&(I.sidecars=ge({blobs:C,commitments:b,proofs:x})),be(I),{...n.length===14?O(n):void 0,...I}}function Fa(t){const e=X(t),[a,n,r,s,u,d,c,i,f,m,h,o]=e;if(!(e.length===9||e.length===12))throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,...e.length>9?{v:m,r:h,s:o}:{}},serializedTransaction:t,type:"eip1559"});const p={chainId:F(a),type:"eip1559"};return E(d)&&d!=="0x"&&(p.to=d),E(u)&&u!=="0x"&&(p.gas=A(u)),E(i)&&i!=="0x"&&(p.data=i),E(n)&&(p.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(p.value=A(c)),E(s)&&s!=="0x"&&(p.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(p.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(p.accessList=tt(f)),pe(p),{...e.length===12?O(e):void 0,...p}}function Ua(t){const e=X(t),[a,n,r,s,u,d,c,i,f,m,h]=e;if(!(e.length===8||e.length===11))throw new $({attributes:{chainId:a,nonce:n,gasPrice:r,gas:s,to:u,value:d,data:c,accessList:i,...e.length>8?{v:f,r:m,s:h}:{}},serializedTransaction:t,type:"eip2930"});const o={chainId:F(a),type:"eip2930"};return E(u)&&u!=="0x"&&(o.to=u),E(s)&&s!=="0x"&&(o.gas=A(s)),E(c)&&c!=="0x"&&(o.data=c),E(n)&&(o.nonce=n==="0x"?0:F(n)),E(d)&&d!=="0x"&&(o.value=A(d)),E(r)&&r!=="0x"&&(o.gasPrice=A(r)),i.length!==0&&i!=="0x"&&(o.accessList=tt(i)),ye(o),{...e.length===11?O(e):void 0,...o}}function ka(t){const e=Dt(t,"hex"),[a,n,r,s,u,d,c,i,f]=e;if(!(e.length===6||e.length===9))throw new $({attributes:{nonce:a,gasPrice:n,gas:r,to:s,value:u,data:d,...e.length>6?{v:c,r:i,s:f}:{}},serializedTransaction:t,type:"legacy"});const m={type:"legacy"};if(E(s)&&s!=="0x"&&(m.to=s),E(r)&&r!=="0x"&&(m.gas=A(r)),E(d)&&d!=="0x"&&(m.data=d),E(a)&&(m.nonce=a==="0x"?0:F(a)),E(u)&&u!=="0x"&&(m.value=A(u)),E(n)&&n!=="0x"&&(m.gasPrice=A(n)),xe(m),e.length===6)return m;const h=E(c)&&c!=="0x"?A(c):0n;if(f==="0x"&&i==="0x")return h>0&&(m.chainId=Number(h)),m;const o=h,p=Number((o-35n)/2n);if(p>0)m.chainId=p;else if(o!==27n&&o!==28n)throw new Ee({v:o});return m.v=o,m.s=f,m.r=i,m.yParity=o%2n===0n?1:0,m}function X(t){return Dt(`0x${t.slice(4)}`,"hex")}function tt(t){const e=[];for(let a=0;a<t.length;a++){const[n,r]=t[a];if(!Oe(n,{strict:!1}))throw new je({address:n});e.push({address:n,storageKeys:r.map(s=>ma(s)?s:We(s))})}return e}function Ba(t){const e=[];for(let a=0;a<t.length;a++){const[n,r,s,u,d,c]=t[a];e.push({address:r,chainId:n==="0x"?0:F(n),nonce:s==="0x"?0:F(s),...O([u,d,c])})}return e}function O(t){const e=t.slice(-3),a=e[0]==="0x"||A(e[0])===0n?27n:28n;return{r:xt(e[1],{size:32}),s:xt(e[2],{size:32}),v:a,yParity:a===27n?0:1}}class Na extends mt{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function Wt(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new Na({value:t});let[a,n="0"]=t.split(".");const r=a.startsWith("-");if(r&&(a=a.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(a=`${BigInt(a)+1n}`),n="";else if(n.length>e){const[s,u,d]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],c=Math.round(+`${u}.${d}`);c>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${c}`,n.length>e&&(n=n.slice(1),a=`${BigInt(a)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${r?"-":""}${a}${n}`)}function ar(t,e="wei"){return Wt(t,Ie[e])}function nr(t,e="wei"){return Wt(t,Te[e])}async function La(t,{hash:e}){await t.request({method:`${t.mode}_dropTransaction`,params:[e]})}async function Ma(t){return t.request({method:`${t.mode}_dumpState`})}async function Da(t){return t.mode==="ganache"?await t.request({method:"eth_mining"}):await t.request({method:`${t.mode}_getAutomine`})}async function za(t){return await t.request({method:"txpool_content"})}async function Ga(t){const{pending:e,queued:a}=await t.request({method:"txpool_status"});return{pending:F(e),queued:F(a)}}async function $a(t,{address:e}){await t.request({method:`${t.mode}_impersonateAccount`,params:[e]})}async function Ha(t,{seconds:e}){return await t.request({method:"evm_increaseTime",params:[R(e)]})}async function Oa(t){return await t.request({method:"txpool_inspect"})}async function ja(t,{state:e}){await t.request({method:`${t.mode}_loadState`,params:[e]})}async function Wa(t,{blocks:e,interval:a}){t.mode==="ganache"?await t.request({method:"evm_mine",params:[{blocks:R(e)}]}):await t.request({method:`${t.mode}_mine`,params:[R(e),R(a||0)]})}async function Va(t){await t.request({method:`${t.mode}_removeBlockTimestampInterval`})}async function Ja(t,{blockNumber:e,jsonRpcUrl:a}={}){await t.request({method:`${t.mode}_reset`,params:[{forking:{blockNumber:Number(e),jsonRpcUrl:a}}]})}async function Ka(t,{id:e}){await t.request({method:"evm_revert",params:[e]})}async function Ya(t,e){var w,g,C;const{accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:m,...h}=e,o=(C=(g=(w=t.chain)==null?void 0:w.formatters)==null?void 0:g.transactionRequest)==null?void 0:C.format,l=(o||ht)({...St(h,{format:o}),accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:m},"sendUnsignedTransaction");return await t.request({method:"eth_sendUnsignedTransaction",params:[l]})}async function Za(t,e){t.mode==="ganache"?e?await t.request({method:"miner_start"}):await t.request({method:"miner_stop"}):await t.request({method:"evm_setAutomine",params:[e]})}async function Qa(t,{address:e,value:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountBalance",params:[e,R(a)]}):await t.request({method:`${t.mode}_setBalance`,params:[e,R(a)]})}async function Xa(t,{gasLimit:e}){await t.request({method:"evm_setBlockGasLimit",params:[R(e)]})}async function tn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:`${t.mode}_setBlockTimestampInterval`,params:[a]})}async function en(t,{address:e,bytecode:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountCode",params:[e,a]}):await t.request({method:`${t.mode}_setCode`,params:[e,a]})}async function an(t,{address:e}){await t.request({method:`${t.mode}_setCoinbase`,params:[e]})}async function nn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:"evm_setIntervalMining",params:[a]})}async function rn(t,e){await t.request({method:`${t.mode}_setLoggingEnabled`,params:[e]})}async function sn(t,{gasPrice:e}){await t.request({method:`${t.mode}_setMinGasPrice`,params:[R(e)]})}async function on(t,{baseFeePerGas:e}){await t.request({method:`${t.mode}_setNextBlockBaseFeePerGas`,params:[R(e)]})}async function cn(t,{timestamp:e}){await t.request({method:"evm_setNextBlockTimestamp",params:[R(e)]})}async function un(t,{address:e,nonce:a}){await t.request({method:`${t.mode}_setNonce`,params:[e,R(a)]})}async function dn(t,e){await t.request({method:`${t.mode}_setRpcUrl`,params:[e]})}async function ln(t,{address:e,index:a,value:n}){await t.request({method:`${t.mode}_setStorageAt`,params:[e,typeof a=="number"?R(a):a,n]})}async function mn(t){return await t.request({method:"evm_snapshot"})}async function fn(t,{address:e}){await t.request({method:`${t.mode}_stopImpersonatingAccount`,params:[e]})}function hn({mode:t}){return e=>{const a=e.extend(()=>({mode:t}));return{dropTransaction:n=>La(a,n),dumpState:()=>Ma(a),getAutomine:()=>Da(a),getTxpoolContent:()=>za(a),getTxpoolStatus:()=>Ga(a),impersonateAccount:n=>$a(a,n),increaseTime:n=>Ha(a,n),inspectTxpool:()=>Oa(a),loadState:n=>ja(a,n),mine:n=>Wa(a,n),removeBlockTimestampInterval:()=>Va(a),reset:n=>Ja(a,n),revert:n=>Ka(a,n),sendUnsignedTransaction:n=>Ya(a,n),setAutomine:n=>Za(a,n),setBalance:n=>Qa(a,n),setBlockGasLimit:n=>Xa(a,n),setBlockTimestampInterval:n=>tn(a,n),setCode:n=>en(a,n),setCoinbase:n=>an(a,n),setIntervalMining:n=>nn(a,n),setLoggingEnabled:n=>rn(a,n),setMinGasPrice:n=>sn(a,n),setNextBlockBaseFeePerGas:n=>on(a,n),setNextBlockTimestamp:n=>cn(a,n),setNonce:n=>un(a,n),setRpcUrl:n=>dn(a,n),setStorageAt:n=>ln(a,n),snapshot:()=>mn(a),stopImpersonatingAccount:n=>fn(a,n)}}}function rr(t){const{key:e="test",name:a="Test Client",mode:n}=t;return At({...t,key:e,name:a,type:"testClient"}).extend(s=>({mode:n,...hn({mode:n})(s)}))}async function pn(t,{chain:e}){const{id:a,name:n,nativeCurrency:r,rpcUrls:s,blockExplorers:u}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:R(a),chainName:n,nativeCurrency:r,rpcUrls:s.default.http,blockExplorerUrls:u?Object.values(u).map(({url:d})=>d):void 0}]},{dedupe:!0,retryCount:0})}function yn(t,e){const{abi:a,args:n,bytecode:r,...s}=e,u=Ce({abi:a,args:n,bytecode:r});return ut(t,{...s,...s.authorizationList?{to:null}:{},data:u})}async function gn(t){var a;return((a=t.account)==null?void 0:a.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(n=>Ve(n))}async function bn(t,e={}){const{account:a=t.account,chainId:n}=e,r=a?N(a):void 0,s=n?[r==null?void 0:r.address,[R(n)]]:[r==null?void 0:r.address],u=await t.request({method:"wallet_getCapabilities",params:s}),d={};for(const[c,i]of Object.entries(u)){d[Number(c)]={};for(let[f,m]of Object.entries(i))f==="addSubAccount"&&(f="unstable_addSubAccount"),d[Number(c)][f]=m}return typeof n=="number"?d[n]:d}async function wn(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function xn(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(a=>k(a))}async function En(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function In(t,e){const{chain:a=t.chain}=e,n=e.timeout??Math.max(((a==null?void 0:a.blockTime)??0)*3,5e3),r=await Pt(t,e);return await _t(t,{...e,id:r.id,timeout:n})}const ot=new Je(128);async function Vt(t,e){var x,I,T,v;const{account:a=t.account,chain:n=t.chain,accessList:r,authorizationList:s,blobs:u,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:m,maxPriorityFeePerGas:h,nonce:o,pollingInterval:p,throwOnReceiptRevert:l,type:y,value:w,...g}=e,C=e.timeout??Math.max(((n==null?void 0:n.blockTime)??0)*3,5e3);if(typeof a>"u")throw new D({docsPath:"/docs/actions/wallet/sendTransactionSync"});const b=a?N(a):null;try{Rt(e);const P=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await ve({authorization:s[0]}).catch(()=>{throw new mt("`to` is required. Could not infer from `authorizationList`.")})})();if((b==null?void 0:b.type)==="json-rpc"||b===null){let S;n!==null&&(S=await U(t,dt,"getChainId")({}),qt({currentChainId:S,chain:n}));const _=(T=(I=(x=t.chain)==null?void 0:x.formatters)==null?void 0:I.transactionRequest)==null?void 0:T.format,z=(_||ht)({...St(g,{format:_}),accessList:r,account:b,authorizationList:s,blobs:u,chainId:S,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:m,maxPriorityFeePerGas:h,nonce:o,to:P,type:y,value:w},"sendTransaction"),pt=ot.get(t.uid),Jt=pt?"wallet_sendTransaction":"eth_sendTransaction",Kt=await(async()=>{try{return await t.request({method:Jt,params:[z]},{retryCount:0})}catch(yt){if(pt===!1)throw yt;const L=yt;if(L.name==="InvalidInputRpcError"||L.name==="InvalidParamsRpcError"||L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[z]},{retryCount:0}).then(at=>(ot.set(t.uid,!0),at)).catch(at=>{const nt=at;throw nt.name==="MethodNotFoundRpcError"||nt.name==="MethodNotSupportedRpcError"?(ot.set(t.uid,!1),L):nt});throw L}})(),et=await U(t,Se,"waitForTransactionReceipt")({checkReplacement:!1,hash:Kt,pollingInterval:p,timeout:C});if(l&&et.status==="reverted")throw new Ae({receipt:et});return et}if((b==null?void 0:b.type)==="local"){const S=await U(t,Ft,"prepareTransactionRequest")({account:b,accessList:r,authorizationList:s,blobs:u,chain:n,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:m,maxPriorityFeePerGas:h,nonce:o,nonceManager:b.nonceManager,parameters:[...Pe,"sidecars"],type:y,value:w,...g,to:P}),_=(v=n==null?void 0:n.serializers)==null?void 0:v.transaction,q=await b.signTransaction(S,{serializer:_});return await U(t,Ut,"sendRawTransactionSync")({serializedTransaction:q,throwOnReceiptRevert:l})}throw(b==null?void 0:b.type)==="smart"?new J({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new J({docsPath:"/docs/actions/wallet/sendTransactionSync",type:b==null?void 0:b.type})}catch(P){throw P instanceof J?P:_e(P,{...e,account:b,chain:e.chain||void 0})}}async function Tn(t,e){const{id:a}=e;await t.request({method:"wallet_showCallsStatus",params:[a]})}async function Cn(t,e){const{account:a=t.account}=e;if(!a)throw new D({docsPath:"/docs/eip7702/signAuthorization"});const n=N(a);if(!n.signAuthorization)throw new J({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const r=await kt(t,e);return n.signAuthorization(r)}async function vn(t,{account:e=t.account,message:a}){if(!e)throw new D({docsPath:"/docs/actions/wallet/signMessage"});const n=N(e);if(n.signMessage)return n.signMessage({message:a});const r=typeof a=="string"?Ke(a):a.raw instanceof Uint8Array?Nt(a.raw):a.raw;return t.request({method:"personal_sign",params:[r,n.address]},{retryCount:0})}async function Sn(t,e){var i,f,m,h;const{account:a=t.account,chain:n=t.chain,...r}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTransaction"});const s=N(a);Rt({account:s,...e});const u=await U(t,dt,"getChainId")({});n!==null&&qt({currentChainId:u,chain:n});const d=(n==null?void 0:n.formatters)||((i=t.chain)==null?void 0:i.formatters),c=((f=d==null?void 0:d.transactionRequest)==null?void 0:f.format)||ht;return s.signTransaction?s.signTransaction({...r,chainId:u},{serializer:(h=(m=t.chain)==null?void 0:m.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...c({...r,account:s},"signTransaction"),chainId:R(u),from:s.address}]},{retryCount:0})}async function An(t,e){const{account:a=t.account,domain:n,message:r,primaryType:s}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTypedData"});const u=N(a),d={EIP712Domain:Xe({domain:n}),...e.types};if(ta({domain:n,message:r,primaryType:s,types:d}),u.signTypedData)return u.signTypedData({domain:n,message:r,primaryType:s,types:d});const c=ea({domain:n,message:r,primaryType:s,types:d});return t.request({method:"eth_signTypedData_v4",params:[u.address,c]},{retryCount:0})}async function Pn(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:R(e)}]},{retryCount:0})}async function _n(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}async function Rn(t,e){return M.internal(t,Vt,"sendTransactionSync",e)}function qn(t){return{addChain:e=>pn(t,e),deployContract:e=>yn(t,e),getAddresses:()=>gn(t),getCallsStatus:e=>qe(t,e),getCapabilities:e=>bn(t,e),getChainId:()=>dt(t),getPermissions:()=>wn(t),prepareAuthorization:e=>kt(t,e),prepareTransactionRequest:e=>Ft(t,e),requestAddresses:()=>xn(t),requestPermissions:e=>En(t,e),sendCalls:e=>Pt(t,e),sendCallsSync:e=>In(t,e),sendRawTransaction:e=>Re(t,e),sendRawTransactionSync:e=>Ut(t,e),sendTransaction:e=>ut(t,e),sendTransactionSync:e=>Vt(t,e),showCallsStatus:e=>Tn(t,e),signAuthorization:e=>Cn(t,e),signMessage:e=>vn(t,e),signTransaction:e=>Sn(t,e),signTypedData:e=>An(t,e),switchChain:e=>Pn(t,e),waitForCallsStatus:e=>_t(t,e),watchAsset:e=>_n(t,e),writeContract:e=>M(t,e),writeContractSync:e=>Rn(t,e)}}function sr(t){const{key:e="wallet",name:a="Wallet Client",transport:n}=t;return At({...t,key:e,name:a,transport:n,type:"walletClient"}).extend(qn)}function or(t,e={}){const{key:a="custom",methods:n,name:r="Custom Provider",retryDelay:s}=e;return({retryCount:u})=>lt({key:a,methods:n,name:r,request:t.request.bind(t),retryCount:e.retryCount??u,retryDelay:s,type:"custom"})}function ir(t,e={}){const{key:a="fallback",name:n="Fallback",rank:r=!1,shouldThrow:s=Fn,retryCount:u,retryDelay:d}=e;return(({chain:c,pollingInterval:i=4e3,timeout:f,...m})=>{let h=t,o=()=>{};const p=lt({key:a,name:n,async request({method:l,params:y}){let w;const g=async(C=0)=>{const b=h[C]({...m,chain:c,retryCount:0,timeout:f});try{const x=await b.request({method:l,params:y});return o({method:l,params:y,response:x,transport:b,status:"success"}),x}catch(x){if(o({error:x,method:l,params:y,transport:b,status:"error"}),s(x)||C===h.length-1||(w??(w=h.slice(C+1).some(I=>{const{include:T,exclude:v}=I({chain:c}).config.methods||{};return T?T.includes(l):v?!v.includes(l):!0})),!w))throw x;return g(C+1)}};return g()},retryCount:u,retryDelay:d,type:"fallback"},{onResponse:l=>o=l,transports:h.map(l=>l({chain:c,retryCount:0}))});if(r){const l=typeof r=="object"?r:{};Un({chain:c,interval:l.interval??i,onTransports:y=>h=y,ping:l.ping,sampleCount:l.sampleCount,timeout:l.timeout,transports:h,weights:l.weights})}return p})}function Fn(t){return!!("code"in t&&typeof t.code=="number"&&(t.code===na.code||t.code===ra.code||Fe.nodeMessage.test(t.message)||t.code===5e3))}function Un({chain:t,interval:e=4e3,onTransports:a,ping:n,sampleCount:r=10,timeout:s=1e3,transports:u,weights:d={}}){const{stability:c=.7,latency:i=.3}=d,f=[],m=async()=>{const h=await Promise.all(u.map(async l=>{const y=l({chain:t,retryCount:0,timeout:s}),w=Date.now();let g,C;try{await(n?n({transport:y}):y.request({method:"net_listening"})),C=1}catch{C=0}finally{g=Date.now()}return{latency:g-w,success:C}}));f.push(h),f.length>r&&f.shift();const o=Math.max(...f.map(l=>Math.max(...l.map(({latency:y})=>y)))),p=u.map((l,y)=>{const w=f.map(I=>I[y].latency),C=1-w.reduce((I,T)=>I+T,0)/w.length/o,b=f.map(I=>I[y].success),x=b.reduce((I,T)=>I+T,0)/b.length;return x===0?[0,y]:[i*C+c*x,y]}).sort((l,y)=>y[0]-l[0]);a(p.map(([,l])=>u[l])),await Ue(e),m()};m()}function cr(t,e={}){const{keepAlive:a,key:n="webSocket",methods:r,name:s="WebSocket JSON-RPC",reconnect:u,retryDelay:d}=e;return({chain:c,retryCount:i,timeout:f})=>{var l;const m=e.retryCount??i,h=f??e.timeout??1e4,o=t||((l=c==null?void 0:c.rpcUrls.default.webSocket)==null?void 0:l[0]),p={keepAlive:a,reconnect:u};if(!o)throw new ke;return lt({key:n,methods:r,name:s,async request({method:y,params:w}){const g={method:y,params:w},C=await K(o,p),{error:b,result:x}=await C.requestAsync({body:g,timeout:h});if(b)throw new sa({body:g,error:b,url:o});return x},retryCount:m,retryDelay:d,timeout:h,type:"webSocket"},{getSocket(){return Ta(o)},getRpcClient(){return K(o,p)},async subscribe({params:y,onData:w,onError:g}){const C=await K(o,p),{result:b}=await new Promise((x,I)=>C.request({body:{method:"eth_subscribe",params:y},onError(T){I(T),g==null||g(T)},onResponse(T){if(T.error){I(T.error),g==null||g(T.error);return}if(typeof T.id=="number"){x(T);return}T.method==="eth_subscription"&&w(T.params)}}));return{subscriptionId:b,async unsubscribe(){return new Promise(x=>C.request({body:{method:"eth_unsubscribe",params:[b]},onResponse:x}))}}}})}}class ur extends Error{constructor(e,a){super(a),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e,this.details=a}}const it="/docs/contract/decodeDeployData";function dr(t){const{abi:e,bytecode:a,data:n}=t;if(n===a)return{bytecode:a};const r=e.find(u=>"type"in u&&u.type==="constructor");if(!r)throw new Ye({docsPath:it});if(!("inputs"in r))throw new Et({docsPath:it});if(!r.inputs||r.inputs.length===0)throw new Et({docsPath:it});return{args:Mt(r.inputs,`0x${n.replace(a,"")}`),bytecode:a}}function lr(t){const e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),a=typeof t.blobs[0]=="string"?t.blobs.map(d=>H(d)):t.blobs,n=a.reduce((d,c)=>d+c.length,0),r=ct(new Uint8Array(n));let s=!0;for(const d of a){const c=ct(d);for(;s&&c.position<d.length;){c.incrementPosition(1);let i=31;d.length-c.position<31&&(i=d.length-c.position);for(const f in Array.from({length:i})){const m=c.readByte();if(m===128&&!c.inspectBytes(c.remaining).includes(128)){s=!1;break}r.pushByte(m)}}}const u=r.bytes.slice(0,r.position);return e==="hex"?G(u):u}function mr(t){const{sidecars:e,version:a}=t,n=t.to??(typeof e[0].blob=="string"?"hex":"bytes"),r=[];for(const{commitment:s}of e)r.push(Be({commitment:s,to:n,version:a}));return r}const kn=2147483648;function fr(t){if(t===1)return 60n;if(t>=kn||t<0)throw new Ne({chainId:t});return BigInt((2147483648|t)>>>0)}function Bn({blobToKzgCommitment:t,computeBlobKzgProof:e}){return{blobToKzgCommitment:t,computeBlobKzgProof:e}}function hr(t,e){try{t.loadTrustedSetup(e)}catch(a){const n=a;if(!n.message.includes("trusted setup is already loaded"))throw n}return Bn(t)}function pr({r:t,yParityAndS:e}){const a=H(e),n=a[0]&128?1:0,r=a;return n===1&&(r[0]&=127),{r:t,s:G(r),yParity:n}}function yr(t){const{r:e,s:a}=Bt.Signature.fromCompact(t.slice(2,130));return{r:R(e,{size:32}),yParityAndS:R(a,{size:32})}}async function gr(t){const{serializedTransaction:e,signature:a}=t,n=_a(e),r=a??{r:n.r,s:n.s,v:n.v,yParity:n.yParity},s=Le({...n,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await Q({hash:Y(s),signature:r})}function br({r:t,yParityAndS:e}){return`0x${new Bt.Signature(A(t),A(e)).toCompactHex()}`}function wr(t){const{r:e,s:a,v:n,yParity:r}=t,s=Number(r??n-27n);let u=a;if(s===1){const d=H(a);d[0]|=128,u=G(d)}return{r:e,yParityAndS:u}}export{Ye as AbiConstructorNotFoundError,Et as AbiConstructorParamsNotFoundError,To as AbiDecodingDataSizeInvalidError,Co as AbiDecodingDataSizeTooSmallError,vo as AbiDecodingZeroDataError,So as AbiEncodingArrayLengthMismatchError,Ao as AbiEncodingBytesSizeMismatchError,Po as AbiEncodingLengthMismatchError,_o as AbiErrorInputsNotFoundError,Ro as AbiErrorNotFoundError,qo as AbiErrorSignatureNotFoundError,Fo as AbiEventNotFoundError,Uo as AbiEventSignatureEmptyTopicsError,ko as AbiEventSignatureNotFoundError,Bo as AbiFunctionNotFoundError,No as AbiFunctionOutputsNotFoundError,Lo as AbiFunctionSignatureNotFoundError,Ir as AccountStateConflictError,Ki as AtomicReadyWalletRejectedUpgradeError,Yi as AtomicityNotSupportedError,mt as BaseError,Tr as BaseFeeScalarError,Cr as BlockNotFoundError,vr as BundleFailedError,Zi as BundleTooLargeError,Mo as BytesSizeMismatchError,Sr as CallExecutionError,Qi as ChainDisconnectedError,Ar as ChainDoesNotSupportContract,Pr as ChainMismatchError,_r as ChainNotFoundError,Rr as CircularReferenceError,qr as ClientChainNotConfiguredError,Fr as ContractFunctionExecutionError,Ur as ContractFunctionRevertedError,kr as ContractFunctionZeroDataError,Br as CounterfactualDeploymentFailedError,Do as DecodeLogDataMismatch,zo as DecodeLogTopicsMismatch,Xi as DuplicateIdError,ur as EIP1193ProviderRpcError,Nr as Eip1559FeesNotSupportedError,Lr as EnsAvatarInvalidNftUriError,Mr as EnsAvatarUnsupportedNamespaceError,Dr as EnsAvatarUriResolutionError,Ne as EnsInvalidChainIdError,zr as EstimateGasExecutionError,Fe as ExecutionRevertedError,Gr as FeeCapTooHighError,$r as FeeCapTooLowError,Hr as FeeConflictError,Go as FilterTypeNotSupportedError,tc as HttpRequestError,Or as InsufficientFundsError,$o as IntegerOutOfRangeError,ec as InternalRpcError,jr as IntrinsicGasTooHighError,Wr as IntrinsicGasTooLowError,Ho as InvalidAbiDecodingTypeError,Oo as InvalidAbiEncodingTypeError,Vr as InvalidAbiItemError,Qt as InvalidAbiParameterError,Jr as InvalidAbiParametersError,Kr as InvalidAbiTypeParameterError,je as InvalidAddressError,jo as InvalidArrayError,Wo as InvalidBytesBooleanError,Yr as InvalidChainIdError,Na as InvalidDecimalNumberError,Vo as InvalidDefinitionTypeError,$i as InvalidDomainError,Zr as InvalidFunctionModifierError,Jo as InvalidHexBooleanError,Ge as InvalidHexValueError,ac as InvalidInputRpcError,Ee as InvalidLegacyVError,Qr as InvalidModifierError,Xr as InvalidParameterError,nc as InvalidParamsRpcError,ts as InvalidParenthesisError,Hi as InvalidPrimaryTypeError,rc as InvalidRequestRpcError,es as InvalidSerializableTransactionError,$ as InvalidSerializedTransactionError,he as InvalidSerializedTransactionTypeError,as as InvalidSignatureError,ns as InvalidStorageKeySizeError,rs as InvalidStructSignatureError,Oi as InvalidStructTypeError,sc as JsonRpcVersionUnsupportedError,oc as LimitExceededRpcError,ss as MaxFeePerGasTooLowError,ic as MethodNotFoundRpcError,cc as MethodNotSupportedRpcError,os as NonceMaxValueError,is as NonceTooHighError,cs as NonceTooLowError,uc as ParseRpcError,dc as ProviderDisconnectedError,lc as ProviderRpcError,us as RawContractError,mc as ResourceNotFoundRpcError,fc as ResourceUnavailableRpcError,hc as RpcError,sa as RpcRequestError,Ko as SizeExceedsPaddingSizeError,Yo as SizeOverflowError,Zo as SliceOffsetOutOfBoundsError,Z as SocketClosedError,ds as SolidityProtectedKeywordError,ls as StateAssignmentConflictError,pc as SwitchChainError,aa as TimeoutError,ms as TipAboveFeeCapError,fs as TransactionExecutionError,hs as TransactionNotFoundError,ps as TransactionReceiptNotFoundError,na as TransactionRejectedRpcError,ys as TransactionTypeNotSupportedError,yc as UnauthorizedProviderError,gc as UnknownBundleIdError,gs as UnknownNodeError,bc as UnknownRpcError,bs as UnknownSignatureError,ws as UnknownTypeError,wc as UnsupportedChainIdError,xc as UnsupportedNonOptionalCapabilityError,Qo as UnsupportedPackedAbiType,Ec as UnsupportedProviderMethodError,ke as UrlRequiredError,ra as UserRejectedRequestError,xs as WaitForCallsStatusTimeoutError,Es as WaitForTransactionReceiptTimeoutError,It as WebSocketRequestError,qt as assertCurrentChain,Rt as assertRequest,pe as assertTransactionEIP1559,ye as assertTransactionEIP2930,xe as assertTransactionLegacy,Is as blobsToCommitments,Ts as blobsToProofs,Xo as boolToBytes,ti as boolToHex,ei as bytesToBigInt,ai as bytesToBool,G as bytesToHex,ni as bytesToNumber,Tc as bytesToRlp,ri as bytesToString,pd as ccipFetch,yd as ccipRequest,Ve as checksumAddress,Be as commitmentToVersionedHash,Cs as commitmentsToVersionedHashes,br as compactSignatureToHex,pr as compactSignatureToSignature,ze as concat,si as concatBytes,oi as concatHex,At as createClient,vs as createNonceManager,Ss as createPublicClient,rr as createTestClient,lt as createTransport,sr as createWalletClient,or as custom,Mt as decodeAbiParameters,dr as decodeDeployData,ii as decodeErrorResult,ci as decodeEventLog,As as decodeFunctionData,Ps as decodeFunctionResult,ui as defineBlock,di as defineChain,Bn as defineKzg,li as defineTransaction,Ed as defineTransactionReceipt,mi as defineTransactionRequest,_s as deploylessCallViaBytecodeBytecode,Rs as deploylessCallViaFactoryBytecode,ji as domainSeparator,fi as encodeAbiParameters,Ce as encodeDeployData,qs as encodeErrorResult,hi as encodeEventTopics,Xt as encodeFunctionData,Fs as encodeFunctionResult,Us as encodePacked,ks as erc1155Abi,Bs as erc20Abi,Ns as erc20Abi_bytes32,Ls as erc4626Abi,Ms as erc6492SignatureValidatorAbi,Ds as erc6492SignatureValidatorByteCode,zs as erc721Abi,Gs as ethAddress,Ie as etherUnits,Jn as extractChain,ir as fallback,pi as formatBlock,$s as formatEther,Hs as formatGwei,Id as formatLog,yi as formatTransaction,Td as formatTransactionReceipt,ht as formatTransactionRequest,Os as formatUnits,lr as fromBlobs,gi as fromBytes,bi as fromHex,Dt as fromRlp,wi as getAbiItem,k as getAddress,js as getChainContractAddress,Wn as getContract,Vn as getContractAddress,te as getContractError,da as getCreate2Address,ua as getCreateAddress,xi as getEventSelector,Ei as getEventSignature,Ii as getFunctionSelector,Ti as getFunctionSignature,Pa as getSerializedTransactionType,Ws as getTransactionType,Xe as getTypesForEIP712Domain,Te as gweiUnits,Wi as hashDomain,me as hashMessage,Vi as hashStruct,Qe as hashTypedData,A as hexToBigInt,Ci as hexToBool,H as hexToBytes,yr as hexToCompactSignature,F as hexToNumber,Cc as hexToRlp,Vs as hexToSignature,vi as hexToString,Js as http,Oe as isAddress,ft as isAddressEqual,Tt as isBytes,Ca as isErc6492Signature,va as isErc8010Signature,ma as isHash,E as isHex,Y as keccak256,Ks as labelhash,vc as maxInt104,Sc as maxInt112,Ac as maxInt120,Pc as maxInt128,_c as maxInt136,Rc as maxInt144,qc as maxInt152,Fc as maxInt16,Uc as maxInt160,kc as maxInt168,Bc as maxInt176,Nc as maxInt184,Lc as maxInt192,Mc as maxInt200,Dc as maxInt208,zc as maxInt216,Gc as maxInt224,$c as maxInt232,Hc as maxInt24,Oc as maxInt240,jc as maxInt248,Wc as maxInt256,Vc as maxInt32,Jc as maxInt40,Kc as maxInt48,Yc as maxInt56,Zc as maxInt64,Qc as maxInt72,Xc as maxInt8,tu as maxInt80,eu as maxInt88,au as maxInt96,nu as maxUint104,ru as maxUint112,su as maxUint120,ou as maxUint128,iu as maxUint136,cu as maxUint144,uu as maxUint152,du as maxUint16,lu as maxUint160,mu as maxUint168,fu as maxUint176,hu as maxUint184,pu as maxUint192,yu as maxUint200,gu as maxUint208,bu as maxUint216,wu as maxUint224,xu as maxUint232,Eu as maxUint24,Iu as maxUint240,Tu as maxUint248,Cu as maxUint256,vu as maxUint32,Su as maxUint40,Au as maxUint48,Pu as maxUint56,_u as maxUint64,Ru as maxUint72,qu as maxUint8,Fu as maxUint80,Uu as maxUint88,ku as maxUint96,Bu as minInt104,Nu as minInt112,Lu as minInt120,Mu as minInt128,Du as minInt136,zu as minInt144,Gu as minInt152,$u as minInt16,Hu as minInt160,Ou as minInt168,ju as minInt176,Wu as minInt184,Vu as minInt192,Ju as minInt200,Ku as minInt208,Yu as minInt216,Zu as minInt224,Qu as minInt232,Xu as minInt24,td as minInt240,ed as minInt248,ad as minInt256,nd as minInt32,rd as minInt40,sd as minInt48,od as minInt56,id as minInt64,cd as minInt72,ud as minInt8,dd as minInt80,ld as minInt88,md as minInt96,Ys as multicall3Abi,Zs as namehash,Qs as nonceManager,Si as numberToBytes,R as numberToHex,gd as offchainLookup,bd as offchainLookupAbiItem,wd as offchainLookupSignature,Me as pad,Ai as padBytes,xt as padHex,Xs as parseAbi,to as parseAbiItem,jn as parseAbiParameter,eo as parseAbiParameters,yr as parseCompactSignature,Yn as parseErc6492Signature,Zn as parseErc8010Signature,ar as parseEther,Pi as parseEventLogs,nr as parseGwei,ao as parseSignature,_a as parseTransaction,Wt as parseUnits,no as prepareEncodeFunctionData,ro as presignMessagePrefix,so as publicActions,Q as recoverAddress,Sa as recoverMessageAddress,oo as recoverPublicKey,gr as recoverTransactionAddress,Aa as recoverTypedDataAddress,Kn as ripemd160,io as rpcSchema,_i as rpcTransactionType,co as serializeAccessList,br as serializeCompactSignature,uo as serializeErc6492Signature,Qn as serializeErc8010Signature,lo as serializeSignature,Le as serializeTransaction,ea as serializeTypedData,Ri as setErrorConfig,hr as setupKzg,fd as sha256,Fn as shouldThrow,mr as sidecarsToVersionedHashes,wr as signatureToCompactSignature,mo as signatureToHex,$e as size,De as slice,qi as sliceBytes,Lt as sliceHex,Fi as stringToBytes,Ke as stringToHex,Ui as stringify,hn as testActions,ge as toBlobSidecars,fo as toBlobs,B as toBytes,fr as toCoinType,ki as toEventHash,Bi as toEventSelector,Ni as toEventSignature,Li as toFunctionHash,Mi as toFunctionSelector,Di as toFunctionSignature,Nt as toHex,ho as toPrefixedMessage,ia as toRlp,zi as transactionType,We as trim,po as universalSignatureValidatorAbi,yo as universalSignatureValidatorByteCode,ta as validateTypedData,Xn as verifyHash,tr as verifyMessage,er as verifyTypedData,qn as walletActions,cr as webSocket,go as weiUnits,bo as withCache,wo as withRetry,Ze as withTimeout,xo as zeroAddress,Eo as zeroHash};
|
|
2
|
+
import{p as gt,b as Yt,i as Zt,I as Qt,m as bt,s as ut,A as D,e as Xt,g as U,d as te,f as N,r as ee,h as ae,j as ne,k as re,w as se,n as oe,o as ie,q as ce,t as ue,v as de,u as le,x as Q,y as me,z as fe,B as he,C as $,D as pe,E as ye,F as ge,G as be,H as we,J as xe,K as Ee,L as Ie,M as Te,N as St,O as At,P as Ce,Q as Pt,R as _t,S as Rt,T as ve,U as dt,V as qt,W as Se,X as Ae,Y as Ft,Z as Pe,_ as Ut,$ as J,a0 as _e,a1 as kt,a2 as Re,a3 as qe,a4 as lt,a5 as Fe,a6 as Ue,a7 as ke,a8 as Be,a9 as Ne,aa as Bt,ab as Le}from"./parseSignature-k_e-4JPE.js";import{ac as Ir,ad as Tr,ae as Cr,af as vr,ag as Sr,ah as Ar,ai as Pr,aj as _r,ak as Rr,al as qr,am as Fr,an as Ur,ao as kr,ap as Br,aq as Nr,ar as Lr,as as Mr,at as Dr,au as zr,av as Gr,aw as $r,ax as Hr,ay as Or,az as jr,aA as Wr,aB as Vr,aC as Jr,aD as Kr,aE as Yr,aF as Zr,aG as Qr,aH as Xr,aI as ts,aJ as es,aK as as,aL as ns,aM as rs,aN as ss,aO as os,aP as is,aQ as cs,aR as us,aS as ds,aT as ls,aU as ms,aV as fs,aW as hs,aX as ps,aY as ys,aZ as gs,a_ as bs,a$ as ws,b0 as xs,b1 as Es,b2 as Is,b3 as Ts,b4 as Cs,b5 as vs,b6 as Ss,b7 as As,b8 as Ps,b9 as _s,ba as Rs,bb as qs,bc as Fs,bd as Us,be as ks,bf as Bs,bg as Ns,bh as Ls,bi as Ms,bj as Ds,bk as zs,bl as Gs,bm as $s,bn as Hs,bo as Os,bp as js,bq as Ws,br as Vs,bs as Js,bt as Ks,bu as Ys,bv as Zs,bw as Qs,bx as Xs,by as to,bz as eo,br as ao,bA as no,bB as ro,bC as so,bD as oo,bE as io,bF as co,bG as uo,bH as lo,bH as mo,bI as fo,bJ as ho,bi as po,bj as yo,bK as go,bL as bo,bM as wo,bN as xo,bO as Eo}from"./parseSignature-k_e-4JPE.js";import{T as B,b9 as k,U as Me,I as Y,ba as De,G as ze,bb as Ge,X as H,_ as ct,$ as G,B as mt,D as E,P as $e,a7 as He,bc as j,a6 as wt,R as Nt,bd as Lt,d as Mt,L as R,F as ft,A as F,be as A,M as Oe,N as je,bf as We,bg as xt,aG as ht,J as Ve,bh as Je,bi as Ke,bj as Ye,bk as Et}from"./signing-DbptdEFO.js";import{bl as To,bm as Co,bn as vo,bo as So,bp as Ao,bq as Po,br as _o,bs as Ro,bt as qo,bu as Fo,bv as Uo,bw as ko,bx as Bo,by as No,bz as Lo,Q as Mo,bA as Do,bB as zo,bC as Go,bD as $o,bE as Ho,bF as Oo,bG as jo,bH as Wo,bI as Vo,bJ as Jo,bK as Ko,bL as Yo,bM as Zo,bN as Qo,bO as Xo,bP as ti,bQ as ei,bR as ai,bS as ni,bT as ri,bU as si,bV as oi,E as ii,bW as ci,bX as ui,bY as di,bZ as li,b_ as mi,p as fi,b$ as hi,at as pi,au as yi,c0 as gi,c1 as bi,c2 as wi,c3 as xi,c4 as Ei,f as Ii,c4 as Ti,c5 as Ci,c6 as vi,c7 as Si,c8 as Ai,c9 as Pi,ca as _i,cb as Ri,cc as qi,cd as Fi,C as Ui,ce as ki,c3 as Bi,c4 as Ni,ce as Li,f as Mi,c4 as Di,z as zi}from"./signing-DbptdEFO.js";import{w as Ze,h as Qe,g as Xe,v as ta,s as ea}from"./hashTypedData-BYNlhvPL.js";import{I as $i,a as Hi,b as Oi,d as ji,c as Wi,e as Vi}from"./hashTypedData-BYNlhvPL.js";import{T as aa,a as Z,W as It,b as na,U as ra,R as sa}from"./rpc-Db5G0SW1.js";import{A as Ki,c as Yi,B as Zi,C as Qi,D as Xi,H as tc,I as ec,d as ac,e as nc,f as rc,J as sc,L as oc,M as ic,h as cc,P as uc,i as dc,j as lc,k as mc,l as fc,m as hc,S as pc,n as yc,o as gc,p as bc,q as wc,r as xc,s as Ec}from"./rpc-Db5G0SW1.js";import{_ as oa}from"./index-Dh_23qfs.js";import{t as ia,H as ca}from"./sha256-Cx7Ij8et.js";import{b as Tc,h as Cc,a as vc,c as Sc,d as Ac,e as Pc,f as _c,g as Rc,i as qc,j as Fc,k as Uc,l as kc,n as Bc,o as Nc,p as Lc,q as Mc,r as Dc,u as zc,v as Gc,w as $c,x as Hc,y as Oc,z as jc,A as Wc,B as Vc,C as Jc,D as Kc,E as Yc,F as Zc,G as Qc,I as Xc,J as tu,K as eu,L as au,M as nu,N as ru,O as su,P as ou,Q as iu,R as cu,S as uu,m as du,T as lu,U as mu,V as fu,W as hu,X as pu,Y as yu,Z as gu,_ as bu,$ as wu,a0 as xu,a1 as Eu,a2 as Iu,a3 as Tu,a4 as Cu,a5 as vu,a6 as Su,a7 as Au,a8 as Pu,a9 as _u,aa as Ru,ab as qu,ac as Fu,ad as Uu,ae as ku,af as Bu,ag as Nu,ah as Lu,ai as Mu,aj as Du,ak as zu,al as Gu,am as $u,an as Hu,ao as Ou,ap as ju,aq as Wu,ar as Vu,as as Ju,at as Ku,au as Yu,av as Zu,aw as Qu,ax as Xu,ay as td,az as ed,aA as ad,aB as nd,aC as rd,aD as sd,aE as od,aF as id,aG as cd,aH as ud,aI as dd,aJ as ld,aK as md,s as fd}from"./sha256-Cx7Ij8et.js";import{ccipRequest as pd,ccipRequest as yd,offchainLookup as gd,offchainLookupAbiItem as bd,offchainLookupSignature as wd}from"./ccip-DZmtf0-e.js";import{d as Ed,a as Id,f as Td}from"./transactionReceipt-BZFMW0kN.js";import"./utils-kxirIM46.js";import"./ethers-CU3Ctw5k.js";import"./react-4iaCnQ6n.js";function jn(t){let e;if(typeof t=="string")e=gt(t,{modifiers:bt});else{const a=Yt(t),n=t.length;for(let r=0;r<n;r++){const s=t[r];if(!Zt(s)){e=gt(s,{modifiers:bt,structs:a});break}}}if(!e)throw new Qt({param:t});return e}async function M(t,e){return M.internal(t,ut,"sendTransaction",e)}(function(t){async function e(a,n,r,s){const{abi:u,account:d=a.account,address:c,args:i,dataSuffix:f,functionName:m,...h}=s;if(typeof d>"u")throw new D({docsPath:"/docs/contract/writeContract"});const o=d?N(d):null,p=Xt({abi:u,args:i,functionName:m});try{return await U(a,n,r)({data:`${p}${f?f.replace("0x",""):""}`,to:c,account:o,...h})}catch(l){throw te(l,{abi:u,address:c,args:i,docsPath:"/docs/contract/writeContract",functionName:m,sender:o==null?void 0:o.address})}}t.internal=e})(M||(M={}));function Wn({abi:t,address:e,client:a}){const n=a,[r,s]=n?"public"in n&&"wallet"in n?[n.public,n.wallet]:"public"in n?[n.public,void 0]:"wallet"in n?[void 0,n.wallet]:[n,n]:[void 0,void 0],u=r!=null,d=s!=null,c={};let i=!1,f=!1,m=!1;for(const h of t)if(h.type==="function"?h.stateMutability==="view"||h.stateMutability==="pure"?i=!0:f=!0:h.type==="event"&&(m=!0),i&&f&&m)break;return u&&(i&&(c.read=new Proxy({},{get(h,o){return(...p)=>{const{args:l,options:y}=W(p);return U(r,ee,"readContract")({abi:t,address:e,functionName:o,args:l,...y})}}})),f&&(c.simulate=new Proxy({},{get(h,o){return(...p)=>{const{args:l,options:y}=W(p);return U(r,ae,"simulateContract")({abi:t,address:e,functionName:o,args:l,...y})}}})),m&&(c.createEventFilter=new Proxy({},{get(h,o){return(...p)=>{const l=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,l);return U(r,ne,"createContractEventFilter")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.getEvents=new Proxy({},{get(h,o){return(...p)=>{const l=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,l);return U(r,re,"getContractEvents")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.watchEvent=new Proxy({},{get(h,o){return(...p)=>{const l=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,l);return U(r,se,"watchContractEvent")({abi:t,address:e,eventName:o,args:y,...w})}}}))),d&&f&&(c.write=new Proxy({},{get(h,o){return(...p)=>{const{args:l,options:y}=W(p);return U(s,M,"writeContract")({abi:t,address:e,functionName:o,args:l,...y})}}})),(u||d)&&f&&(c.estimateGas=new Proxy({},{get(h,o){return(...p)=>{const{args:l,options:y}=W(p);return U(r??s,oe,"estimateContractGas")({abi:t,address:e,functionName:o,args:l,...y,account:y.account??s.account})}}})),c.address=e,c.abi=t,c}function W(t){const e=t.length&&Array.isArray(t[0]),a=e?t[0]:[],n=(e?t[1]:t[0])??{};return{args:a,options:n}}function rt(t,e){let a=!1;Array.isArray(t[0])?a=!0:t.length===1?a=e.inputs.some(s=>s.indexed):t.length===2&&(a=!0);const n=a?t[0]:void 0,r=(a?t[1]:t[0])??{};return{args:n,options:r}}function Tt(t){return!t||typeof t!="object"||!("BYTES_PER_ELEMENT"in t)?!1:t.BYTES_PER_ELEMENT===1&&t.constructor.name==="Uint8Array"}function Vn(t){return t.opcode==="CREATE2"?da(t):ua(t)}function ua(t){const e=B(k(t.from));let a=B(t.nonce);return a[0]===0&&(a=new Uint8Array([])),k(`0x${Y(ia([e,a],"bytes")).slice(26)}`)}function da(t){const e=B(k(t.from)),a=Me(Tt(t.salt)?t.salt:B(t.salt),{size:32}),n="bytecodeHash"in t?Tt(t.bytecodeHash)?t.bytecodeHash:B(t.bytecodeHash):Y(t.bytecode,"bytes");return k(De(Y(ze([B("0xff"),e,a,n])),12))}function Jn({chains:t,id:e}){return t.find(a=>a.id===e)}function Dt(t,e="hex"){const a=(()=>{if(typeof t=="string"){if(t.length>3&&t.length%2!==0)throw new Ge(t);return H(t)}return t})(),n=ct(a,{recursiveReadLimit:Number.POSITIVE_INFINITY});return zt(n,e)}function zt(t,e="hex"){if(t.bytes.length===0)return e==="hex"?G(t.bytes):t.bytes;const a=t.readByte();if(a<128&&t.decrementPosition(1),a<192){const r=Ct(t,a,128),s=t.readBytes(r);return e==="hex"?G(s):s}const n=Ct(t,a,192);return la(t,n,e)}function Ct(t,e,a){if(a===128&&e<128)return 1;if(e<=a+55)return e-a;if(e===a+55+1)return t.readUint8();if(e===a+55+2)return t.readUint16();if(e===a+55+3)return t.readUint24();if(e===a+55+4)return t.readUint32();throw new mt("Invalid RLP prefix")}function la(t,e,a){const n=t.position,r=[];for(;t.position-n<e;)r.push(zt(t,a));return r}function ma(t){return E(t)&&$e(t)===32}const fa=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Gt=Uint8Array.from(new Array(16).fill(0).map((t,e)=>e)),ha=Gt.map(t=>(9*t+5)%16),$t=(()=>{const a=[[Gt],[ha]];for(let n=0;n<4;n++)for(let r of a)r.push(r[n].map(s=>fa[s]));return a})(),Ht=$t[0],Ot=$t[1],jt=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>Uint8Array.from(t)),pa=Ht.map((t,e)=>t.map(a=>jt[e][a])),ya=Ot.map((t,e)=>t.map(a=>jt[e][a])),ga=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),ba=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function vt(t,e,a,n){return t===0?e^a^n:t===1?e&a|~e&n:t===2?(e|~a)^n:t===3?e&n|a&~n:e^(a|~n)}const V=new Uint32Array(16);class wa extends ca{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:a,h2:n,h3:r,h4:s}=this;return[e,a,n,r,s]}set(e,a,n,r,s){this.h0=e|0,this.h1=a|0,this.h2=n|0,this.h3=r|0,this.h4=s|0}process(e,a){for(let o=0;o<16;o++,a+=4)V[o]=e.getUint32(a,!0);let n=this.h0|0,r=n,s=this.h1|0,u=s,d=this.h2|0,c=d,i=this.h3|0,f=i,m=this.h4|0,h=m;for(let o=0;o<5;o++){const p=4-o,l=ga[o],y=ba[o],w=Ht[o],g=Ot[o],C=pa[o],b=ya[o];for(let x=0;x<16;x++){const I=j(n+vt(o,s,d,i)+V[w[x]]+l,C[x])+m|0;n=m,m=i,i=j(d,10)|0,d=s,s=I}for(let x=0;x<16;x++){const I=j(r+vt(p,u,c,f)+V[g[x]]+y,b[x])+h|0;r=h,h=f,f=j(c,10)|0,c=u,u=I}}this.set(this.h1+d+f|0,this.h2+i+h|0,this.h3+m+r|0,this.h4+n+u|0,this.h0+s+c|0)}roundClean(){wt(V)}destroy(){this.destroyed=!0,wt(this.buffer),this.set(0,0,0,0,0)}}const xa=He(()=>new wa),Ea=xa;function Kn(t,e){const a=e||"hex",n=Ea(E(t,{strict:!1})?B(t):t);return a==="bytes"?n:Nt(n)}const st=new Map;async function Ia(t){const{getSocket:e,keepAlive:a=!0,key:n="socket",reconnect:r=!0,url:s}=t,{interval:u=3e4}=typeof a=="object"?a:{},{attempts:d=5,delay:c=2e3}=typeof r=="object"?r:{},i=JSON.stringify({keepAlive:a,key:n,url:s,reconnect:r});let f=st.get(i);if(f)return f;let m=0;const{schedule:h}=ie({id:i,fn:async()=>{const l=new Map,y=new Map;let w,g,C,b=!1;function x(){if(r&&m<d){if(b)return;b=!0,m++,g==null||g.close(),setTimeout(async()=>{await I().catch(console.error),b=!1},c)}else l.clear(),y.clear()}async function I(){const T=await e({onClose(){var v,P;for(const S of l.values())(v=S.onError)==null||v.call(S,new Z({url:s}));for(const S of y.values())(P=S.onError)==null||P.call(S,new Z({url:s}));x()},onError(v){var P,S;w=v;for(const _ of l.values())(P=_.onError)==null||P.call(_,w);for(const _ of y.values())(S=_.onError)==null||S.call(_,w);x()},onOpen(){w=void 0,m=0},onResponse(v){const P=v.method==="eth_subscription",S=P?v.params.subscription:v.id,_=P?y:l,q=_.get(S);q&&q.onResponse(v),P||_.delete(S)}});if(g=T,a&&(C&&clearInterval(C),C=setInterval(()=>{var v;return(v=g.ping)==null?void 0:v.call(g)},u)),r&&y.size>0){const v=y.entries();for(const[P,{onResponse:S,body:_,onError:q}]of v)_&&(y.delete(P),f==null||f.request({body:_,onResponse:S,onError:q}))}return T}return await I(),w=void 0,f={close(){C&&clearInterval(C),g.close(),st.delete(i)},get socket(){return g},request({body:T,onError:v,onResponse:P}){w&&v&&v(w);const S=T.id??ce.take(),_=q=>{var z;typeof q.id=="number"&&S!==q.id||(T.method==="eth_subscribe"&&typeof q.result=="string"&&y.set(q.result,{onResponse:_,onError:v,body:T}),T.method==="eth_unsubscribe"&&y.delete((z=T.params)==null?void 0:z[0]),P(q))};l.set(S,{onResponse:_,onError:v});try{g.request({body:{jsonrpc:"2.0",id:S,...T}})}catch(q){v==null||v(q)}},requestAsync({body:T,timeout:v=1e4}){return Ze(()=>new Promise((P,S)=>this.request({body:T,onError:S,onResponse:P})),{errorInstance:new aa({body:T,url:s}),timeout:v})},requests:l,subscriptions:y,url:s},st.set(i,f),[f]}}),[o,[p]]=await h();return p}async function K(t,e={}){const{keepAlive:a,reconnect:n}=e;return Ia({async getSocket({onClose:r,onError:s,onOpen:u,onResponse:d}){const c=await oa(()=>import("./native-zogUBnfz.js").then(o=>o.n),__vite__mapDeps([0,1,2])).then(o=>o.WebSocket),i=new c(t);function f(){i.removeEventListener("close",f),i.removeEventListener("message",m),i.removeEventListener("error",s),i.removeEventListener("open",u),r()}function m({data:o}){if(!(typeof o=="string"&&o.trim().length===0))try{const p=JSON.parse(o);d(p)}catch(p){s(p)}}i.addEventListener("close",f),i.addEventListener("message",m),i.addEventListener("error",s),i.addEventListener("open",u),i.readyState===c.CONNECTING&&await new Promise((o,p)=>{i&&(i.onopen=o,i.onerror=p)});const{close:h}=i;return Object.assign(i,{close(){h.bind(i)(),f()},ping(){try{if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({url:i.url,cause:new Z({url:i.url})});const o={jsonrpc:"2.0",id:null,method:"net_version",params:[]};i.send(JSON.stringify(o))}catch(o){s(o)}},request({body:o}){if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({body:o,url:i.url,cause:new Z({url:i.url})});return i.send(JSON.stringify(o))}})},keepAlive:a,reconnect:n,url:t})}async function Ta(t){const e=await K(t);return Object.assign(e.socket,{requests:e.requests,subscriptions:e.subscriptions})}function Ca(t){return Lt(t,-32)===ue}function va(t){return de(t)}function Yn(t){if(!Ca(t))return{signature:t};const[e,a,n]=Mt([{type:"address"},{type:"bytes"},{type:"bytes"}],t);return{address:e,data:a,signature:n}}function Zn(t){if(!va(t))return{signature:t};const{authorization:e,to:a,...n}=le(t);return{authorization:{address:e.address,chainId:e.chainId,nonce:Number(e.nonce),r:R(e.r,{size:32}),s:R(e.s,{size:32}),yParity:e.yParity},...a?{address:a}:{},...n}}async function Sa({message:t,signature:e}){return Q({hash:me(t),signature:e})}async function Aa(t){const{domain:e,message:a,primaryType:n,signature:r,types:s}=t;return Q({hash:Qe({domain:e,message:a,primaryType:n,types:s}),signature:r})}function Qn(t){const{address:e,data:a,signature:n,to:r="hex"}=t,s=fe({authorization:{address:t.authorization.address,chainId:t.authorization.chainId,nonce:BigInt(t.authorization.nonce),r:BigInt(t.authorization.r),s:BigInt(t.authorization.s),yParity:t.authorization.yParity},data:a,signature:n,to:e});return r==="hex"?s:H(s)}async function Xn({address:t,hash:e,signature:a}){return ft(k(t),await Q({hash:e,signature:a}))}async function tr({address:t,message:e,signature:a}){return ft(k(t),await Sa({message:e,signature:a}))}async function er(t){const{address:e,domain:a,message:n,primaryType:r,signature:s,types:u}=t;return ft(k(e),await Aa({domain:a,message:n,primaryType:r,signature:s,types:u}))}function Pa(t){const e=Lt(t,0,1);if(e==="0x04")return"eip7702";if(e==="0x03")return"eip4844";if(e==="0x02")return"eip1559";if(e==="0x01")return"eip2930";if(e!=="0x"&&F(e)>=192)return"legacy";throw new he({serializedType:e})}function _a(t){const e=Pa(t);return e==="eip1559"?Fa(t):e==="eip2930"?Ua(t):e==="eip4844"?qa(t):e==="eip7702"?Ra(t):ka(t)}function Ra(t){const e=X(t),[a,n,r,s,u,d,c,i,f,m,h,o,p]=e;if(e.length!==10&&e.length!==13)throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,authorizationList:m,...e.length>9?{v:h,r:o,s:p}:{}},serializedTransaction:t,type:"eip7702"});const l={chainId:F(a),type:"eip7702"};return E(d)&&d!=="0x"&&(l.to=d),E(u)&&u!=="0x"&&(l.gas=A(u)),E(i)&&i!=="0x"&&(l.data=i),E(n)&&(l.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(l.value=A(c)),E(s)&&s!=="0x"&&(l.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(l.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(l.accessList=tt(f)),m.length!==0&&m!=="0x"&&(l.authorizationList=Ba(m)),we(l),{...e.length===13?O(e):void 0,...l}}function qa(t){const e=X(t),a=e.length===4,n=a?e[0]:e,r=a?e.slice(1):[],[s,u,d,c,i,f,m,h,o,p,l,y,w,g]=n,[C,b,x]=r;if(!(n.length===11||n.length===14))throw new $({attributes:{chainId:s,nonce:u,maxPriorityFeePerGas:d,maxFeePerGas:c,gas:i,to:f,value:m,data:h,accessList:o,...n.length>9?{v:y,r:w,s:g}:{}},serializedTransaction:t,type:"eip4844"});const I={blobVersionedHashes:l,chainId:F(s),to:f,type:"eip4844"};return E(i)&&i!=="0x"&&(I.gas=A(i)),E(h)&&h!=="0x"&&(I.data=h),E(u)&&(I.nonce=u==="0x"?0:F(u)),E(m)&&m!=="0x"&&(I.value=A(m)),E(p)&&p!=="0x"&&(I.maxFeePerBlobGas=A(p)),E(c)&&c!=="0x"&&(I.maxFeePerGas=A(c)),E(d)&&d!=="0x"&&(I.maxPriorityFeePerGas=A(d)),o.length!==0&&o!=="0x"&&(I.accessList=tt(o)),C&&b&&x&&(I.sidecars=ge({blobs:C,commitments:b,proofs:x})),be(I),{...n.length===14?O(n):void 0,...I}}function Fa(t){const e=X(t),[a,n,r,s,u,d,c,i,f,m,h,o]=e;if(!(e.length===9||e.length===12))throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,...e.length>9?{v:m,r:h,s:o}:{}},serializedTransaction:t,type:"eip1559"});const p={chainId:F(a),type:"eip1559"};return E(d)&&d!=="0x"&&(p.to=d),E(u)&&u!=="0x"&&(p.gas=A(u)),E(i)&&i!=="0x"&&(p.data=i),E(n)&&(p.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(p.value=A(c)),E(s)&&s!=="0x"&&(p.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(p.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(p.accessList=tt(f)),pe(p),{...e.length===12?O(e):void 0,...p}}function Ua(t){const e=X(t),[a,n,r,s,u,d,c,i,f,m,h]=e;if(!(e.length===8||e.length===11))throw new $({attributes:{chainId:a,nonce:n,gasPrice:r,gas:s,to:u,value:d,data:c,accessList:i,...e.length>8?{v:f,r:m,s:h}:{}},serializedTransaction:t,type:"eip2930"});const o={chainId:F(a),type:"eip2930"};return E(u)&&u!=="0x"&&(o.to=u),E(s)&&s!=="0x"&&(o.gas=A(s)),E(c)&&c!=="0x"&&(o.data=c),E(n)&&(o.nonce=n==="0x"?0:F(n)),E(d)&&d!=="0x"&&(o.value=A(d)),E(r)&&r!=="0x"&&(o.gasPrice=A(r)),i.length!==0&&i!=="0x"&&(o.accessList=tt(i)),ye(o),{...e.length===11?O(e):void 0,...o}}function ka(t){const e=Dt(t,"hex"),[a,n,r,s,u,d,c,i,f]=e;if(!(e.length===6||e.length===9))throw new $({attributes:{nonce:a,gasPrice:n,gas:r,to:s,value:u,data:d,...e.length>6?{v:c,r:i,s:f}:{}},serializedTransaction:t,type:"legacy"});const m={type:"legacy"};if(E(s)&&s!=="0x"&&(m.to=s),E(r)&&r!=="0x"&&(m.gas=A(r)),E(d)&&d!=="0x"&&(m.data=d),E(a)&&(m.nonce=a==="0x"?0:F(a)),E(u)&&u!=="0x"&&(m.value=A(u)),E(n)&&n!=="0x"&&(m.gasPrice=A(n)),xe(m),e.length===6)return m;const h=E(c)&&c!=="0x"?A(c):0n;if(f==="0x"&&i==="0x")return h>0&&(m.chainId=Number(h)),m;const o=h,p=Number((o-35n)/2n);if(p>0)m.chainId=p;else if(o!==27n&&o!==28n)throw new Ee({v:o});return m.v=o,m.s=f,m.r=i,m.yParity=o%2n===0n?1:0,m}function X(t){return Dt(`0x${t.slice(4)}`,"hex")}function tt(t){const e=[];for(let a=0;a<t.length;a++){const[n,r]=t[a];if(!Oe(n,{strict:!1}))throw new je({address:n});e.push({address:n,storageKeys:r.map(s=>ma(s)?s:We(s))})}return e}function Ba(t){const e=[];for(let a=0;a<t.length;a++){const[n,r,s,u,d,c]=t[a];e.push({address:r,chainId:n==="0x"?0:F(n),nonce:s==="0x"?0:F(s),...O([u,d,c])})}return e}function O(t){const e=t.slice(-3),a=e[0]==="0x"||A(e[0])===0n?27n:28n;return{r:xt(e[1],{size:32}),s:xt(e[2],{size:32}),v:a,yParity:a===27n?0:1}}class Na extends mt{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function Wt(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new Na({value:t});let[a,n="0"]=t.split(".");const r=a.startsWith("-");if(r&&(a=a.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(a=`${BigInt(a)+1n}`),n="";else if(n.length>e){const[s,u,d]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],c=Math.round(+`${u}.${d}`);c>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${c}`,n.length>e&&(n=n.slice(1),a=`${BigInt(a)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${r?"-":""}${a}${n}`)}function ar(t,e="wei"){return Wt(t,Ie[e])}function nr(t,e="wei"){return Wt(t,Te[e])}async function La(t,{hash:e}){await t.request({method:`${t.mode}_dropTransaction`,params:[e]})}async function Ma(t){return t.request({method:`${t.mode}_dumpState`})}async function Da(t){return t.mode==="ganache"?await t.request({method:"eth_mining"}):await t.request({method:`${t.mode}_getAutomine`})}async function za(t){return await t.request({method:"txpool_content"})}async function Ga(t){const{pending:e,queued:a}=await t.request({method:"txpool_status"});return{pending:F(e),queued:F(a)}}async function $a(t,{address:e}){await t.request({method:`${t.mode}_impersonateAccount`,params:[e]})}async function Ha(t,{seconds:e}){return await t.request({method:"evm_increaseTime",params:[R(e)]})}async function Oa(t){return await t.request({method:"txpool_inspect"})}async function ja(t,{state:e}){await t.request({method:`${t.mode}_loadState`,params:[e]})}async function Wa(t,{blocks:e,interval:a}){t.mode==="ganache"?await t.request({method:"evm_mine",params:[{blocks:R(e)}]}):await t.request({method:`${t.mode}_mine`,params:[R(e),R(a||0)]})}async function Va(t){await t.request({method:`${t.mode}_removeBlockTimestampInterval`})}async function Ja(t,{blockNumber:e,jsonRpcUrl:a}={}){await t.request({method:`${t.mode}_reset`,params:[{forking:{blockNumber:Number(e),jsonRpcUrl:a}}]})}async function Ka(t,{id:e}){await t.request({method:"evm_revert",params:[e]})}async function Ya(t,e){var w,g,C;const{accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:m,...h}=e,o=(C=(g=(w=t.chain)==null?void 0:w.formatters)==null?void 0:g.transactionRequest)==null?void 0:C.format,l=(o||ht)({...St(h,{format:o}),accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:m},"sendUnsignedTransaction");return await t.request({method:"eth_sendUnsignedTransaction",params:[l]})}async function Za(t,e){t.mode==="ganache"?e?await t.request({method:"miner_start"}):await t.request({method:"miner_stop"}):await t.request({method:"evm_setAutomine",params:[e]})}async function Qa(t,{address:e,value:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountBalance",params:[e,R(a)]}):await t.request({method:`${t.mode}_setBalance`,params:[e,R(a)]})}async function Xa(t,{gasLimit:e}){await t.request({method:"evm_setBlockGasLimit",params:[R(e)]})}async function tn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:`${t.mode}_setBlockTimestampInterval`,params:[a]})}async function en(t,{address:e,bytecode:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountCode",params:[e,a]}):await t.request({method:`${t.mode}_setCode`,params:[e,a]})}async function an(t,{address:e}){await t.request({method:`${t.mode}_setCoinbase`,params:[e]})}async function nn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:"evm_setIntervalMining",params:[a]})}async function rn(t,e){await t.request({method:`${t.mode}_setLoggingEnabled`,params:[e]})}async function sn(t,{gasPrice:e}){await t.request({method:`${t.mode}_setMinGasPrice`,params:[R(e)]})}async function on(t,{baseFeePerGas:e}){await t.request({method:`${t.mode}_setNextBlockBaseFeePerGas`,params:[R(e)]})}async function cn(t,{timestamp:e}){await t.request({method:"evm_setNextBlockTimestamp",params:[R(e)]})}async function un(t,{address:e,nonce:a}){await t.request({method:`${t.mode}_setNonce`,params:[e,R(a)]})}async function dn(t,e){await t.request({method:`${t.mode}_setRpcUrl`,params:[e]})}async function ln(t,{address:e,index:a,value:n}){await t.request({method:`${t.mode}_setStorageAt`,params:[e,typeof a=="number"?R(a):a,n]})}async function mn(t){return await t.request({method:"evm_snapshot"})}async function fn(t,{address:e}){await t.request({method:`${t.mode}_stopImpersonatingAccount`,params:[e]})}function hn({mode:t}){return e=>{const a=e.extend(()=>({mode:t}));return{dropTransaction:n=>La(a,n),dumpState:()=>Ma(a),getAutomine:()=>Da(a),getTxpoolContent:()=>za(a),getTxpoolStatus:()=>Ga(a),impersonateAccount:n=>$a(a,n),increaseTime:n=>Ha(a,n),inspectTxpool:()=>Oa(a),loadState:n=>ja(a,n),mine:n=>Wa(a,n),removeBlockTimestampInterval:()=>Va(a),reset:n=>Ja(a,n),revert:n=>Ka(a,n),sendUnsignedTransaction:n=>Ya(a,n),setAutomine:n=>Za(a,n),setBalance:n=>Qa(a,n),setBlockGasLimit:n=>Xa(a,n),setBlockTimestampInterval:n=>tn(a,n),setCode:n=>en(a,n),setCoinbase:n=>an(a,n),setIntervalMining:n=>nn(a,n),setLoggingEnabled:n=>rn(a,n),setMinGasPrice:n=>sn(a,n),setNextBlockBaseFeePerGas:n=>on(a,n),setNextBlockTimestamp:n=>cn(a,n),setNonce:n=>un(a,n),setRpcUrl:n=>dn(a,n),setStorageAt:n=>ln(a,n),snapshot:()=>mn(a),stopImpersonatingAccount:n=>fn(a,n)}}}function rr(t){const{key:e="test",name:a="Test Client",mode:n}=t;return At({...t,key:e,name:a,type:"testClient"}).extend(s=>({mode:n,...hn({mode:n})(s)}))}async function pn(t,{chain:e}){const{id:a,name:n,nativeCurrency:r,rpcUrls:s,blockExplorers:u}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:R(a),chainName:n,nativeCurrency:r,rpcUrls:s.default.http,blockExplorerUrls:u?Object.values(u).map(({url:d})=>d):void 0}]},{dedupe:!0,retryCount:0})}function yn(t,e){const{abi:a,args:n,bytecode:r,...s}=e,u=Ce({abi:a,args:n,bytecode:r});return ut(t,{...s,...s.authorizationList?{to:null}:{},data:u})}async function gn(t){var a;return((a=t.account)==null?void 0:a.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(n=>Ve(n))}async function bn(t,e={}){const{account:a=t.account,chainId:n}=e,r=a?N(a):void 0,s=n?[r==null?void 0:r.address,[R(n)]]:[r==null?void 0:r.address],u=await t.request({method:"wallet_getCapabilities",params:s}),d={};for(const[c,i]of Object.entries(u)){d[Number(c)]={};for(let[f,m]of Object.entries(i))f==="addSubAccount"&&(f="unstable_addSubAccount"),d[Number(c)][f]=m}return typeof n=="number"?d[n]:d}async function wn(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function xn(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(a=>k(a))}async function En(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function In(t,e){const{chain:a=t.chain}=e,n=e.timeout??Math.max(((a==null?void 0:a.blockTime)??0)*3,5e3),r=await Pt(t,e);return await _t(t,{...e,id:r.id,timeout:n})}const ot=new Je(128);async function Vt(t,e){var x,I,T,v;const{account:a=t.account,chain:n=t.chain,accessList:r,authorizationList:s,blobs:u,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:m,maxPriorityFeePerGas:h,nonce:o,pollingInterval:p,throwOnReceiptRevert:l,type:y,value:w,...g}=e,C=e.timeout??Math.max(((n==null?void 0:n.blockTime)??0)*3,5e3);if(typeof a>"u")throw new D({docsPath:"/docs/actions/wallet/sendTransactionSync"});const b=a?N(a):null;try{Rt(e);const P=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await ve({authorization:s[0]}).catch(()=>{throw new mt("`to` is required. Could not infer from `authorizationList`.")})})();if((b==null?void 0:b.type)==="json-rpc"||b===null){let S;n!==null&&(S=await U(t,dt,"getChainId")({}),qt({currentChainId:S,chain:n}));const _=(T=(I=(x=t.chain)==null?void 0:x.formatters)==null?void 0:I.transactionRequest)==null?void 0:T.format,z=(_||ht)({...St(g,{format:_}),accessList:r,account:b,authorizationList:s,blobs:u,chainId:S,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:m,maxPriorityFeePerGas:h,nonce:o,to:P,type:y,value:w},"sendTransaction"),pt=ot.get(t.uid),Jt=pt?"wallet_sendTransaction":"eth_sendTransaction",Kt=await(async()=>{try{return await t.request({method:Jt,params:[z]},{retryCount:0})}catch(yt){if(pt===!1)throw yt;const L=yt;if(L.name==="InvalidInputRpcError"||L.name==="InvalidParamsRpcError"||L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[z]},{retryCount:0}).then(at=>(ot.set(t.uid,!0),at)).catch(at=>{const nt=at;throw nt.name==="MethodNotFoundRpcError"||nt.name==="MethodNotSupportedRpcError"?(ot.set(t.uid,!1),L):nt});throw L}})(),et=await U(t,Se,"waitForTransactionReceipt")({checkReplacement:!1,hash:Kt,pollingInterval:p,timeout:C});if(l&&et.status==="reverted")throw new Ae({receipt:et});return et}if((b==null?void 0:b.type)==="local"){const S=await U(t,Ft,"prepareTransactionRequest")({account:b,accessList:r,authorizationList:s,blobs:u,chain:n,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:m,maxPriorityFeePerGas:h,nonce:o,nonceManager:b.nonceManager,parameters:[...Pe,"sidecars"],type:y,value:w,...g,to:P}),_=(v=n==null?void 0:n.serializers)==null?void 0:v.transaction,q=await b.signTransaction(S,{serializer:_});return await U(t,Ut,"sendRawTransactionSync")({serializedTransaction:q,throwOnReceiptRevert:l})}throw(b==null?void 0:b.type)==="smart"?new J({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new J({docsPath:"/docs/actions/wallet/sendTransactionSync",type:b==null?void 0:b.type})}catch(P){throw P instanceof J?P:_e(P,{...e,account:b,chain:e.chain||void 0})}}async function Tn(t,e){const{id:a}=e;await t.request({method:"wallet_showCallsStatus",params:[a]})}async function Cn(t,e){const{account:a=t.account}=e;if(!a)throw new D({docsPath:"/docs/eip7702/signAuthorization"});const n=N(a);if(!n.signAuthorization)throw new J({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const r=await kt(t,e);return n.signAuthorization(r)}async function vn(t,{account:e=t.account,message:a}){if(!e)throw new D({docsPath:"/docs/actions/wallet/signMessage"});const n=N(e);if(n.signMessage)return n.signMessage({message:a});const r=typeof a=="string"?Ke(a):a.raw instanceof Uint8Array?Nt(a.raw):a.raw;return t.request({method:"personal_sign",params:[r,n.address]},{retryCount:0})}async function Sn(t,e){var i,f,m,h;const{account:a=t.account,chain:n=t.chain,...r}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTransaction"});const s=N(a);Rt({account:s,...e});const u=await U(t,dt,"getChainId")({});n!==null&&qt({currentChainId:u,chain:n});const d=(n==null?void 0:n.formatters)||((i=t.chain)==null?void 0:i.formatters),c=((f=d==null?void 0:d.transactionRequest)==null?void 0:f.format)||ht;return s.signTransaction?s.signTransaction({...r,chainId:u},{serializer:(h=(m=t.chain)==null?void 0:m.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...c({...r,account:s},"signTransaction"),chainId:R(u),from:s.address}]},{retryCount:0})}async function An(t,e){const{account:a=t.account,domain:n,message:r,primaryType:s}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTypedData"});const u=N(a),d={EIP712Domain:Xe({domain:n}),...e.types};if(ta({domain:n,message:r,primaryType:s,types:d}),u.signTypedData)return u.signTypedData({domain:n,message:r,primaryType:s,types:d});const c=ea({domain:n,message:r,primaryType:s,types:d});return t.request({method:"eth_signTypedData_v4",params:[u.address,c]},{retryCount:0})}async function Pn(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:R(e)}]},{retryCount:0})}async function _n(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}async function Rn(t,e){return M.internal(t,Vt,"sendTransactionSync",e)}function qn(t){return{addChain:e=>pn(t,e),deployContract:e=>yn(t,e),getAddresses:()=>gn(t),getCallsStatus:e=>qe(t,e),getCapabilities:e=>bn(t,e),getChainId:()=>dt(t),getPermissions:()=>wn(t),prepareAuthorization:e=>kt(t,e),prepareTransactionRequest:e=>Ft(t,e),requestAddresses:()=>xn(t),requestPermissions:e=>En(t,e),sendCalls:e=>Pt(t,e),sendCallsSync:e=>In(t,e),sendRawTransaction:e=>Re(t,e),sendRawTransactionSync:e=>Ut(t,e),sendTransaction:e=>ut(t,e),sendTransactionSync:e=>Vt(t,e),showCallsStatus:e=>Tn(t,e),signAuthorization:e=>Cn(t,e),signMessage:e=>vn(t,e),signTransaction:e=>Sn(t,e),signTypedData:e=>An(t,e),switchChain:e=>Pn(t,e),waitForCallsStatus:e=>_t(t,e),watchAsset:e=>_n(t,e),writeContract:e=>M(t,e),writeContractSync:e=>Rn(t,e)}}function sr(t){const{key:e="wallet",name:a="Wallet Client",transport:n}=t;return At({...t,key:e,name:a,transport:n,type:"walletClient"}).extend(qn)}function or(t,e={}){const{key:a="custom",methods:n,name:r="Custom Provider",retryDelay:s}=e;return({retryCount:u})=>lt({key:a,methods:n,name:r,request:t.request.bind(t),retryCount:e.retryCount??u,retryDelay:s,type:"custom"})}function ir(t,e={}){const{key:a="fallback",name:n="Fallback",rank:r=!1,shouldThrow:s=Fn,retryCount:u,retryDelay:d}=e;return(({chain:c,pollingInterval:i=4e3,timeout:f,...m})=>{let h=t,o=()=>{};const p=lt({key:a,name:n,async request({method:l,params:y}){let w;const g=async(C=0)=>{const b=h[C]({...m,chain:c,retryCount:0,timeout:f});try{const x=await b.request({method:l,params:y});return o({method:l,params:y,response:x,transport:b,status:"success"}),x}catch(x){if(o({error:x,method:l,params:y,transport:b,status:"error"}),s(x)||C===h.length-1||(w??(w=h.slice(C+1).some(I=>{const{include:T,exclude:v}=I({chain:c}).config.methods||{};return T?T.includes(l):v?!v.includes(l):!0})),!w))throw x;return g(C+1)}};return g()},retryCount:u,retryDelay:d,type:"fallback"},{onResponse:l=>o=l,transports:h.map(l=>l({chain:c,retryCount:0}))});if(r){const l=typeof r=="object"?r:{};Un({chain:c,interval:l.interval??i,onTransports:y=>h=y,ping:l.ping,sampleCount:l.sampleCount,timeout:l.timeout,transports:h,weights:l.weights})}return p})}function Fn(t){return!!("code"in t&&typeof t.code=="number"&&(t.code===na.code||t.code===ra.code||Fe.nodeMessage.test(t.message)||t.code===5e3))}function Un({chain:t,interval:e=4e3,onTransports:a,ping:n,sampleCount:r=10,timeout:s=1e3,transports:u,weights:d={}}){const{stability:c=.7,latency:i=.3}=d,f=[],m=async()=>{const h=await Promise.all(u.map(async l=>{const y=l({chain:t,retryCount:0,timeout:s}),w=Date.now();let g,C;try{await(n?n({transport:y}):y.request({method:"net_listening"})),C=1}catch{C=0}finally{g=Date.now()}return{latency:g-w,success:C}}));f.push(h),f.length>r&&f.shift();const o=Math.max(...f.map(l=>Math.max(...l.map(({latency:y})=>y)))),p=u.map((l,y)=>{const w=f.map(I=>I[y].latency),C=1-w.reduce((I,T)=>I+T,0)/w.length/o,b=f.map(I=>I[y].success),x=b.reduce((I,T)=>I+T,0)/b.length;return x===0?[0,y]:[i*C+c*x,y]}).sort((l,y)=>y[0]-l[0]);a(p.map(([,l])=>u[l])),await Ue(e),m()};m()}function cr(t,e={}){const{keepAlive:a,key:n="webSocket",methods:r,name:s="WebSocket JSON-RPC",reconnect:u,retryDelay:d}=e;return({chain:c,retryCount:i,timeout:f})=>{var l;const m=e.retryCount??i,h=f??e.timeout??1e4,o=t||((l=c==null?void 0:c.rpcUrls.default.webSocket)==null?void 0:l[0]),p={keepAlive:a,reconnect:u};if(!o)throw new ke;return lt({key:n,methods:r,name:s,async request({method:y,params:w}){const g={method:y,params:w},C=await K(o,p),{error:b,result:x}=await C.requestAsync({body:g,timeout:h});if(b)throw new sa({body:g,error:b,url:o});return x},retryCount:m,retryDelay:d,timeout:h,type:"webSocket"},{getSocket(){return Ta(o)},getRpcClient(){return K(o,p)},async subscribe({params:y,onData:w,onError:g}){const C=await K(o,p),{result:b}=await new Promise((x,I)=>C.request({body:{method:"eth_subscribe",params:y},onError(T){I(T),g==null||g(T)},onResponse(T){if(T.error){I(T.error),g==null||g(T.error);return}if(typeof T.id=="number"){x(T);return}T.method==="eth_subscription"&&w(T.params)}}));return{subscriptionId:b,async unsubscribe(){return new Promise(x=>C.request({body:{method:"eth_unsubscribe",params:[b]},onResponse:x}))}}}})}}class ur extends Error{constructor(e,a){super(a),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e,this.details=a}}const it="/docs/contract/decodeDeployData";function dr(t){const{abi:e,bytecode:a,data:n}=t;if(n===a)return{bytecode:a};const r=e.find(u=>"type"in u&&u.type==="constructor");if(!r)throw new Ye({docsPath:it});if(!("inputs"in r))throw new Et({docsPath:it});if(!r.inputs||r.inputs.length===0)throw new Et({docsPath:it});return{args:Mt(r.inputs,`0x${n.replace(a,"")}`),bytecode:a}}function lr(t){const e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),a=typeof t.blobs[0]=="string"?t.blobs.map(d=>H(d)):t.blobs,n=a.reduce((d,c)=>d+c.length,0),r=ct(new Uint8Array(n));let s=!0;for(const d of a){const c=ct(d);for(;s&&c.position<d.length;){c.incrementPosition(1);let i=31;d.length-c.position<31&&(i=d.length-c.position);for(const f in Array.from({length:i})){const m=c.readByte();if(m===128&&!c.inspectBytes(c.remaining).includes(128)){s=!1;break}r.pushByte(m)}}}const u=r.bytes.slice(0,r.position);return e==="hex"?G(u):u}function mr(t){const{sidecars:e,version:a}=t,n=t.to??(typeof e[0].blob=="string"?"hex":"bytes"),r=[];for(const{commitment:s}of e)r.push(Be({commitment:s,to:n,version:a}));return r}const kn=2147483648;function fr(t){if(t===1)return 60n;if(t>=kn||t<0)throw new Ne({chainId:t});return BigInt((2147483648|t)>>>0)}function Bn({blobToKzgCommitment:t,computeBlobKzgProof:e}){return{blobToKzgCommitment:t,computeBlobKzgProof:e}}function hr(t,e){try{t.loadTrustedSetup(e)}catch(a){const n=a;if(!n.message.includes("trusted setup is already loaded"))throw n}return Bn(t)}function pr({r:t,yParityAndS:e}){const a=H(e),n=a[0]&128?1:0,r=a;return n===1&&(r[0]&=127),{r:t,s:G(r),yParity:n}}function yr(t){const{r:e,s:a}=Bt.Signature.fromCompact(t.slice(2,130));return{r:R(e,{size:32}),yParityAndS:R(a,{size:32})}}async function gr(t){const{serializedTransaction:e,signature:a}=t,n=_a(e),r=a??{r:n.r,s:n.s,v:n.v,yParity:n.yParity},s=Le({...n,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await Q({hash:Y(s),signature:r})}function br({r:t,yParityAndS:e}){return`0x${new Bt.Signature(A(t),A(e)).toCompactHex()}`}function wr(t){const{r:e,s:a,v:n,yParity:r}=t,s=Number(r??n-27n);let u=a;if(s===1){const d=H(a);d[0]|=128,u=G(d)}return{r:e,yParityAndS:u}}export{Ye as AbiConstructorNotFoundError,Et as AbiConstructorParamsNotFoundError,To as AbiDecodingDataSizeInvalidError,Co as AbiDecodingDataSizeTooSmallError,vo as AbiDecodingZeroDataError,So as AbiEncodingArrayLengthMismatchError,Ao as AbiEncodingBytesSizeMismatchError,Po as AbiEncodingLengthMismatchError,_o as AbiErrorInputsNotFoundError,Ro as AbiErrorNotFoundError,qo as AbiErrorSignatureNotFoundError,Fo as AbiEventNotFoundError,Uo as AbiEventSignatureEmptyTopicsError,ko as AbiEventSignatureNotFoundError,Bo as AbiFunctionNotFoundError,No as AbiFunctionOutputsNotFoundError,Lo as AbiFunctionSignatureNotFoundError,Ir as AccountStateConflictError,Ki as AtomicReadyWalletRejectedUpgradeError,Yi as AtomicityNotSupportedError,mt as BaseError,Tr as BaseFeeScalarError,Cr as BlockNotFoundError,vr as BundleFailedError,Zi as BundleTooLargeError,Mo as BytesSizeMismatchError,Sr as CallExecutionError,Qi as ChainDisconnectedError,Ar as ChainDoesNotSupportContract,Pr as ChainMismatchError,_r as ChainNotFoundError,Rr as CircularReferenceError,qr as ClientChainNotConfiguredError,Fr as ContractFunctionExecutionError,Ur as ContractFunctionRevertedError,kr as ContractFunctionZeroDataError,Br as CounterfactualDeploymentFailedError,Do as DecodeLogDataMismatch,zo as DecodeLogTopicsMismatch,Xi as DuplicateIdError,ur as EIP1193ProviderRpcError,Nr as Eip1559FeesNotSupportedError,Lr as EnsAvatarInvalidNftUriError,Mr as EnsAvatarUnsupportedNamespaceError,Dr as EnsAvatarUriResolutionError,Ne as EnsInvalidChainIdError,zr as EstimateGasExecutionError,Fe as ExecutionRevertedError,Gr as FeeCapTooHighError,$r as FeeCapTooLowError,Hr as FeeConflictError,Go as FilterTypeNotSupportedError,tc as HttpRequestError,Or as InsufficientFundsError,$o as IntegerOutOfRangeError,ec as InternalRpcError,jr as IntrinsicGasTooHighError,Wr as IntrinsicGasTooLowError,Ho as InvalidAbiDecodingTypeError,Oo as InvalidAbiEncodingTypeError,Vr as InvalidAbiItemError,Qt as InvalidAbiParameterError,Jr as InvalidAbiParametersError,Kr as InvalidAbiTypeParameterError,je as InvalidAddressError,jo as InvalidArrayError,Wo as InvalidBytesBooleanError,Yr as InvalidChainIdError,Na as InvalidDecimalNumberError,Vo as InvalidDefinitionTypeError,$i as InvalidDomainError,Zr as InvalidFunctionModifierError,Jo as InvalidHexBooleanError,Ge as InvalidHexValueError,ac as InvalidInputRpcError,Ee as InvalidLegacyVError,Qr as InvalidModifierError,Xr as InvalidParameterError,nc as InvalidParamsRpcError,ts as InvalidParenthesisError,Hi as InvalidPrimaryTypeError,rc as InvalidRequestRpcError,es as InvalidSerializableTransactionError,$ as InvalidSerializedTransactionError,he as InvalidSerializedTransactionTypeError,as as InvalidSignatureError,ns as InvalidStorageKeySizeError,rs as InvalidStructSignatureError,Oi as InvalidStructTypeError,sc as JsonRpcVersionUnsupportedError,oc as LimitExceededRpcError,ss as MaxFeePerGasTooLowError,ic as MethodNotFoundRpcError,cc as MethodNotSupportedRpcError,os as NonceMaxValueError,is as NonceTooHighError,cs as NonceTooLowError,uc as ParseRpcError,dc as ProviderDisconnectedError,lc as ProviderRpcError,us as RawContractError,mc as ResourceNotFoundRpcError,fc as ResourceUnavailableRpcError,hc as RpcError,sa as RpcRequestError,Ko as SizeExceedsPaddingSizeError,Yo as SizeOverflowError,Zo as SliceOffsetOutOfBoundsError,Z as SocketClosedError,ds as SolidityProtectedKeywordError,ls as StateAssignmentConflictError,pc as SwitchChainError,aa as TimeoutError,ms as TipAboveFeeCapError,fs as TransactionExecutionError,hs as TransactionNotFoundError,ps as TransactionReceiptNotFoundError,na as TransactionRejectedRpcError,ys as TransactionTypeNotSupportedError,yc as UnauthorizedProviderError,gc as UnknownBundleIdError,gs as UnknownNodeError,bc as UnknownRpcError,bs as UnknownSignatureError,ws as UnknownTypeError,wc as UnsupportedChainIdError,xc as UnsupportedNonOptionalCapabilityError,Qo as UnsupportedPackedAbiType,Ec as UnsupportedProviderMethodError,ke as UrlRequiredError,ra as UserRejectedRequestError,xs as WaitForCallsStatusTimeoutError,Es as WaitForTransactionReceiptTimeoutError,It as WebSocketRequestError,qt as assertCurrentChain,Rt as assertRequest,pe as assertTransactionEIP1559,ye as assertTransactionEIP2930,xe as assertTransactionLegacy,Is as blobsToCommitments,Ts as blobsToProofs,Xo as boolToBytes,ti as boolToHex,ei as bytesToBigInt,ai as bytesToBool,G as bytesToHex,ni as bytesToNumber,Tc as bytesToRlp,ri as bytesToString,pd as ccipFetch,yd as ccipRequest,Ve as checksumAddress,Be as commitmentToVersionedHash,Cs as commitmentsToVersionedHashes,br as compactSignatureToHex,pr as compactSignatureToSignature,ze as concat,si as concatBytes,oi as concatHex,At as createClient,vs as createNonceManager,Ss as createPublicClient,rr as createTestClient,lt as createTransport,sr as createWalletClient,or as custom,Mt as decodeAbiParameters,dr as decodeDeployData,ii as decodeErrorResult,ci as decodeEventLog,As as decodeFunctionData,Ps as decodeFunctionResult,ui as defineBlock,di as defineChain,Bn as defineKzg,li as defineTransaction,Ed as defineTransactionReceipt,mi as defineTransactionRequest,_s as deploylessCallViaBytecodeBytecode,Rs as deploylessCallViaFactoryBytecode,ji as domainSeparator,fi as encodeAbiParameters,Ce as encodeDeployData,qs as encodeErrorResult,hi as encodeEventTopics,Xt as encodeFunctionData,Fs as encodeFunctionResult,Us as encodePacked,ks as erc1155Abi,Bs as erc20Abi,Ns as erc20Abi_bytes32,Ls as erc4626Abi,Ms as erc6492SignatureValidatorAbi,Ds as erc6492SignatureValidatorByteCode,zs as erc721Abi,Gs as ethAddress,Ie as etherUnits,Jn as extractChain,ir as fallback,pi as formatBlock,$s as formatEther,Hs as formatGwei,Id as formatLog,yi as formatTransaction,Td as formatTransactionReceipt,ht as formatTransactionRequest,Os as formatUnits,lr as fromBlobs,gi as fromBytes,bi as fromHex,Dt as fromRlp,wi as getAbiItem,k as getAddress,js as getChainContractAddress,Wn as getContract,Vn as getContractAddress,te as getContractError,da as getCreate2Address,ua as getCreateAddress,xi as getEventSelector,Ei as getEventSignature,Ii as getFunctionSelector,Ti as getFunctionSignature,Pa as getSerializedTransactionType,Ws as getTransactionType,Xe as getTypesForEIP712Domain,Te as gweiUnits,Wi as hashDomain,me as hashMessage,Vi as hashStruct,Qe as hashTypedData,A as hexToBigInt,Ci as hexToBool,H as hexToBytes,yr as hexToCompactSignature,F as hexToNumber,Cc as hexToRlp,Vs as hexToSignature,vi as hexToString,Js as http,Oe as isAddress,ft as isAddressEqual,Tt as isBytes,Ca as isErc6492Signature,va as isErc8010Signature,ma as isHash,E as isHex,Y as keccak256,Ks as labelhash,vc as maxInt104,Sc as maxInt112,Ac as maxInt120,Pc as maxInt128,_c as maxInt136,Rc as maxInt144,qc as maxInt152,Fc as maxInt16,Uc as maxInt160,kc as maxInt168,Bc as maxInt176,Nc as maxInt184,Lc as maxInt192,Mc as maxInt200,Dc as maxInt208,zc as maxInt216,Gc as maxInt224,$c as maxInt232,Hc as maxInt24,Oc as maxInt240,jc as maxInt248,Wc as maxInt256,Vc as maxInt32,Jc as maxInt40,Kc as maxInt48,Yc as maxInt56,Zc as maxInt64,Qc as maxInt72,Xc as maxInt8,tu as maxInt80,eu as maxInt88,au as maxInt96,nu as maxUint104,ru as maxUint112,su as maxUint120,ou as maxUint128,iu as maxUint136,cu as maxUint144,uu as maxUint152,du as maxUint16,lu as maxUint160,mu as maxUint168,fu as maxUint176,hu as maxUint184,pu as maxUint192,yu as maxUint200,gu as maxUint208,bu as maxUint216,wu as maxUint224,xu as maxUint232,Eu as maxUint24,Iu as maxUint240,Tu as maxUint248,Cu as maxUint256,vu as maxUint32,Su as maxUint40,Au as maxUint48,Pu as maxUint56,_u as maxUint64,Ru as maxUint72,qu as maxUint8,Fu as maxUint80,Uu as maxUint88,ku as maxUint96,Bu as minInt104,Nu as minInt112,Lu as minInt120,Mu as minInt128,Du as minInt136,zu as minInt144,Gu as minInt152,$u as minInt16,Hu as minInt160,Ou as minInt168,ju as minInt176,Wu as minInt184,Vu as minInt192,Ju as minInt200,Ku as minInt208,Yu as minInt216,Zu as minInt224,Qu as minInt232,Xu as minInt24,td as minInt240,ed as minInt248,ad as minInt256,nd as minInt32,rd as minInt40,sd as minInt48,od as minInt56,id as minInt64,cd as minInt72,ud as minInt8,dd as minInt80,ld as minInt88,md as minInt96,Ys as multicall3Abi,Zs as namehash,Qs as nonceManager,Si as numberToBytes,R as numberToHex,gd as offchainLookup,bd as offchainLookupAbiItem,wd as offchainLookupSignature,Me as pad,Ai as padBytes,xt as padHex,Xs as parseAbi,to as parseAbiItem,jn as parseAbiParameter,eo as parseAbiParameters,yr as parseCompactSignature,Yn as parseErc6492Signature,Zn as parseErc8010Signature,ar as parseEther,Pi as parseEventLogs,nr as parseGwei,ao as parseSignature,_a as parseTransaction,Wt as parseUnits,no as prepareEncodeFunctionData,ro as presignMessagePrefix,so as publicActions,Q as recoverAddress,Sa as recoverMessageAddress,oo as recoverPublicKey,gr as recoverTransactionAddress,Aa as recoverTypedDataAddress,Kn as ripemd160,io as rpcSchema,_i as rpcTransactionType,co as serializeAccessList,br as serializeCompactSignature,uo as serializeErc6492Signature,Qn as serializeErc8010Signature,lo as serializeSignature,Le as serializeTransaction,ea as serializeTypedData,Ri as setErrorConfig,hr as setupKzg,fd as sha256,Fn as shouldThrow,mr as sidecarsToVersionedHashes,wr as signatureToCompactSignature,mo as signatureToHex,$e as size,De as slice,qi as sliceBytes,Lt as sliceHex,Fi as stringToBytes,Ke as stringToHex,Ui as stringify,hn as testActions,ge as toBlobSidecars,fo as toBlobs,B as toBytes,fr as toCoinType,ki as toEventHash,Bi as toEventSelector,Ni as toEventSignature,Li as toFunctionHash,Mi as toFunctionSelector,Di as toFunctionSignature,Nt as toHex,ho as toPrefixedMessage,ia as toRlp,zi as transactionType,We as trim,po as universalSignatureValidatorAbi,yo as universalSignatureValidatorByteCode,ta as validateTypedData,Xn as verifyHash,tr as verifyMessage,er as verifyTypedData,qn as walletActions,cr as webSocket,go as weiUnits,bo as withCache,wo as withRetry,Ze as withTimeout,xo as zeroAddress,Eo as zeroHash};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as d,b as u}from"./lit-element-B3y9oplH.js";import{n as p}from"./class-map-CxwNmq0D.js";import{c as m}from"./index-
|
|
1
|
+
import{i as d,b as u}from"./lit-element-B3y9oplH.js";import{n as p}from"./class-map-CxwNmq0D.js";import{c as m}from"./index-DuUdctHy.js";import{d as f,r as h}from"./index-sV0xAzf6.js";const g=f`
|
|
2
2
|
:host {
|
|
3
3
|
position: relative;
|
|
4
4
|
display: flex;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as m,b as n}from"./lit-element-B3y9oplH.js";import{n as r}from"./class-map-CxwNmq0D.js";import{c as u}from"./index-
|
|
1
|
+
import{i as m,b as n}from"./lit-element-B3y9oplH.js";import{n as r}from"./class-map-CxwNmq0D.js";import{c as u}from"./index-DuUdctHy.js";import"./index-CqovlPfY.js";import"./index-B_TejJ9A.js";import{d as g,r as p,e as x}from"./index-sV0xAzf6.js";const b=g`
|
|
2
2
|
button {
|
|
3
3
|
display: block;
|
|
4
4
|
display: flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as t,A as i,a as u}from"./index-
|
|
1
|
+
import{P as t,A as i,a as u}from"./index-C0cx32sg.js";import{W as ye,b as Se,c as De}from"./index-C0cx32sg.js";import"./lit-element-B3y9oplH.js";import"./class-map-CxwNmq0D.js";import"./index-sV0xAzf6.js";import"./index-Dh_23qfs.js";import"./react-4iaCnQ6n.js";import"./ethers-CU3Ctw5k.js";import"./W3MFrameProviderSingleton-BGrWzqsE.js";import"./index-B67hpoq5.js";import"./index-CxlLn_V3.js";import"./browser-ponyfill-Be08WuKC.js";import"./NetworkUtil-aE1iGnVj.js";import"./index-B_F6pJEu.js";import"./index-nibyPLVP.js";import"./index-C4D-6CtP.js";import"./index.es-CQ0R_jWA.js";import"./index-DuUdctHy.js";import"./index-Cv6gBdhQ.js";import"./index-DeRdsl6L.js";import"./index-KR_pcYvC.js";import"./index-CqovlPfY.js";import"./index-Dq_E0wOW.js";import"./index-RYxtgu1n.js";import"./index-C6e6OYT7.js";import"./index-D9OsLyrU.js";import"./index-B_TejJ9A.js";import"./MathUtil-BGCe3rZ3.js";const C=3e5;async function U(e){return t.handleOpenPay(e)}async function V(e,r=C){if(r<=0)throw new i(u.INVALID_PAYMENT_CONFIG,"Timeout must be greater than 0");try{await U(e)}catch(s){throw s instanceof i?s:new i(u.UNABLE_TO_INITIATE_PAYMENT,s.message)}return new Promise((s,l)=>{let o=!1;const c=setTimeout(()=>{o||(o=!0,m(),l(new i(u.GENERIC_PAYMENT_ERROR,"Payment timeout")))},r);function n(){if(o)return;const a=t.state.currentPayment,p=t.state.error,D=t.state.isPaymentInProgress;if((a==null?void 0:a.status)==="SUCCESS"){o=!0,m(),clearTimeout(c),s({success:!0,result:a.result});return}if((a==null?void 0:a.status)==="FAILED"){o=!0,m(),clearTimeout(c),s({success:!1,error:p||"Payment failed"});return}p&&!D&&!a&&(o=!0,m(),clearTimeout(c),s({success:!1,error:p}))}const b=d("currentPayment",n),y=d("error",n),S=d("isPaymentInProgress",n),m=E([b,y,S]);n()})}function Z(){return t.getExchanges()}function j(){var e;return(e=t.state.currentPayment)==null?void 0:e.result}function Q(){return t.state.error}function X(){return t.state.isPaymentInProgress}function d(e,r){return t.subscribeKey(e,r)}function E(e){return()=>{e.forEach(r=>{try{r()}catch{}})}}const $={network:"eip155:8453",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}},ee={network:"eip155:8453",asset:"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},te={network:"eip155:84532",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}},ae={network:"eip155:1",asset:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},se={network:"eip155:10",asset:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},re={network:"eip155:42161",asset:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},oe={network:"eip155:137",asset:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},ne={network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},me={network:"eip155:1",asset:"0xdAC17F958D2ee523a2206206994597C13D831ec7",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},ie={network:"eip155:10",asset:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},ce={network:"eip155:42161",asset:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},pe={network:"eip155:137",asset:"0xc2132d05d31c914a87c6611c10748aeb04b58e8f",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},ue={network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},de={network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"native",metadata:{name:"Solana",symbol:"SOL",decimals:9}};export{t as PayController,ye as W3mPayLoadingView,Se as W3mPayQuoteView,De as W3mPayView,re as arbitrumUSDC,ce as arbitrumUSDT,$ as baseETH,te as baseSepoliaETH,ee as baseUSDC,ae as ethereumUSDC,me as ethereumUSDT,Z as getExchanges,X as getIsPaymentInProgress,Q as getPayError,j as getPayResult,U as openPay,se as optimismUSDC,ie as optimismUSDT,V as pay,oe as polygonUSDC,pe as polygonUSDT,de as solanaSOL,ne as solanaUSDC,ue as solanaUSDT};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/decimals-
|
|
2
|
-
import{_ as T}from"./index-D9XZpwfV.js";import{r as C,ab as q,ac as ct,Z as B,ad as z,ae as K,G as E,U as D,R as x,j as Z,h as _,w as $,x as O,S as ot,af as dt,b as L,ag as j,q as pt,e as mt,V as ut,ah as lt,ai as yt,aj as ft,v as wt,g as Y,l as V,ak as X,al as At,t as Gt,am as gt,an as ht}from"./signing-Cvv8O8BI.js";import{c as Tt,i as Pt,a as F}from"./utils-kxirIM46.js";import{R as J,r as vt,S as Q,T as S,U as Lt,W as k,X as Ot,Z as Dt,_ as xt,$ as U,a0 as tt,a1 as at,a2 as St,p as Ct,a3 as _t,a4 as Et,a5 as Ft}from"./wallets-CoP2jTeJ.js";import{a6 as se}from"./wallets-CoP2jTeJ.js";import{t as Vt,p as Ut,s as It}from"./send-eip712-transaction-DR18L-sh.js";import"./react-4iaCnQ6n.js";import"./ethers-CU3Ctw5k.js";import"./store-CraP4F4Y.js";import"./hashTypedData-DAd66wY6.js";import"./index-zVvLDKBh.js";import"./index-BWbKKFVK.js";import"./index-B67hpoq5.js";import"./index-nibyPLVP.js";import"./index-CJdot1dH.js";import"./index-BeUILvqM.js";import"./ethereum-XjVKsXdf.js";import"./sha256-zMI7s0-F.js";const bt="0xdd62ed3e",Rt=[{name:"owner",type:"address"},{name:"spender",type:"address"}],Nt=[{type:"uint256"}];async function $t(a){return C({contract:a.contract,method:[bt,Rt,Nt],params:[a.owner,a.spender]})}const kt="0x095ea7b3",Ht=[{name:"spender",type:"address"},{name:"value",type:"uint256"}],Mt=[{type:"bool"}];function Wt(a){const e=J(async()=>"asyncParams"in a?await a.asyncParams():a);return q({accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList},contract:a.contract,erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},method:[kt,Ht,Mt],nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},params:async()=>{const t=await e();return[t.spender,t.value]},value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value}})}function qt(a){return Wt({asyncParams:async()=>{let e;if("amount"in a){const{decimals:t}=await T(async()=>{const{decimals:r}=await import("./decimals-D1rmvFNT.js");return{decimals:r}},__vite__mapDeps([0,1,2,3,4,5,6,7])),i=await t(a).catch(()=>18);e=ct(a.amount.toString(),i)}else e=a.amountWei;return{overrides:{erc20Value:{amountWei:e,tokenAddress:a.contract.address},...a.overrides},spender:a.spender,value:e}},contract:a.contract})}const Bt="0xf15d424e",zt=[{name:"signer",type:"address"}],Kt=[{components:[{name:"signer",type:"address"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"startTimestamp",type:"uint128"},{name:"endTimestamp",type:"uint128"}],name:"permissions",type:"tuple"}];async function Zt(a){return C({contract:a.contract,method:[Bt,zt,Kt],params:[a.signer]})}const jt="0x5892e236",Yt=[{components:[{name:"signer",type:"address"},{name:"isAdmin",type:"uint8"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"permissionStartTimestamp",type:"uint128"},{name:"permissionEndTimestamp",type:"uint128"},{name:"reqValidityStartTimestamp",type:"uint128"},{name:"reqValidityEndTimestamp",type:"uint128"},{name:"uid",type:"bytes32"}],name:"req",type:"tuple"},{name:"signature",type:"bytes"}],Xt=[];function Jt(a){const e=J(async()=>"asyncParams"in a?await a.asyncParams():a);return q({accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList},contract:a.contract,erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},method:[jt,Yt,Xt],nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},params:async()=>{const t=await e();return[t.req,t.signature]},value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value}})}function W(){return new Date(Date.now()+1e3*60*60*24*365*10)}function b(a){return Vt(Math.floor(a.getTime()/1e3))}const Qt=[{name:"signer",type:"address"},{name:"isAdmin",type:"uint8"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"permissionStartTimestamp",type:"uint128"},{name:"permissionEndTimestamp",type:"uint128"},{name:"reqValidityStartTimestamp",type:"uint128"},{name:"reqValidityEndTimestamp",type:"uint128"},{name:"uid",type:"bytes32"}];async function ta(a){const{account:e,contract:t,req:i}=a,r=await e.signTypedData({domain:{chainId:t.chain.id,name:"Account",verifyingContract:t.address,version:"1"},message:i,primaryType:"SignerPermissionRequest",types:{SignerPermissionRequest:Qt}});return{req:i,signature:r}}async function aa(a){var i;const{target:e,permissions:t}=a;return{approvedTargets:t.approvedTargets==="*"?[B]:t.approvedTargets,isAdmin:0,nativeTokenLimitPerTransaction:z(((i=t.nativeTokenLimitPerTransaction)==null?void 0:i.toString())||"0"),permissionEndTimestamp:b(t.permissionEndTimestamp||W()),permissionStartTimestamp:b(t.permissionStartTimestamp||new Date(0)),reqValidityEndTimestamp:b(W()),reqValidityStartTimestamp:0n,signer:e,uid:await vt()}}function ea(a){const{contract:e,sessionKeyAddress:t,account:i,permissions:r}=a;return Jt({async asyncParams(){const{req:n,signature:c}=await ta({account:i,contract:e,req:await aa({permissions:r,target:t})});return{req:n,signature:c}},contract:e})}async function sa(a){var c;const{accountContract:e,sessionKeyAddress:t,newPermissions:i}=a;if(!await K(e))return!0;const n=await Zt({contract:e,signer:t});return!!(n.endTimestamp&&n.endTimestamp<Math.floor(Date.now()/1e3)||!na(n.approvedTargets,i.approvedTargets)||z(((c=i.nativeTokenLimitPerTransaction)==null?void 0:c.toString())??"0")>n.nativeTokenLimitPerTransaction)}function na(a,e){return e==="*"&&a.length===1&&a[0]===B?!0:e!=="*"?e.map(t=>t.toLowerCase()).every(t=>a.map(i=>i.toLowerCase()).includes(t)):!1}const ra=2n**96n-1n,ia="0x35567e1a",ca=[{name:"sender",type:"address"},{name:"key",type:"uint192"}],oa=[{name:"nonce",type:"uint256"}];async function da(a){return C({contract:a.contract,method:[ia,ca,oa],params:[a.sender,a.key]})}const pa="0xa6193531",ma=[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],ua=[{type:"bytes32"}];async function la(a){return C({contract:a.contract,method:[pa,ma,ua],params:[a.userOp]})}const ya="0x22cdde4c",fa=[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],wa=[{type:"bytes32"}];async function Aa(a){return C({contract:a.contract,method:[ya,fa,wa],params:[a.userOp]})}function Ga(a){return a.factory?E([a.factory,a.factoryData||"0x"]):"0x"}function ga(a){return E([D(x(BigInt(a.verificationGasLimit)),{size:16}),D(x(BigInt(a.callGasLimit)),{size:16})])}function ha(a){return E([D(x(BigInt(a.maxPriorityFeePerGas)),{size:16}),D(x(BigInt(a.maxFeePerGas)),{size:16})])}function Ta(a){return a.paymaster?E([a.paymaster,D(x(BigInt(a.paymasterVerificationGasLimit||0)),{size:16}),D(x(BigInt(a.paymasterPostOpGasLimit||0)),{size:16}),a.paymasterData||"0x"]):"0x"}const Pa=a=>({accountGasLimits:ga(a),callData:a.callData,gasFees:ha(a),initCode:Ga(a),nonce:BigInt(a.nonce),paymasterAndData:Ta(a),preVerificationGas:BigInt(a.preVerificationGas),sender:a.sender,signature:a.signature});async function I(a){var A;const{userOp:e,paymasterOverride:t,client:i,chain:r,entrypointAddress:n}=a;if(t)return t(e);const c={"Content-Type":"application/json"},s=n??S,o=Q(r),d={id:1,jsonrpc:"2.0",method:"pm_sponsorUserOperation",params:[Lt(e),s]},y=await Tt(i)(o,{body:Z(d),headers:c,method:"POST"});if(!y.ok){const G=await y.text()||y.statusText;throw new Error(`Paymaster error: ${y.status} - ${G}`)}const m=await y.json();if(m.result)return typeof m.result=="string"?{paymasterAndData:m.result}:(m.result.reason&&console.warn(`Paymaster policy rejected this transaction with reason: ${m.result.reason} ${m.result.policyId?`(policyId: ${m.result.policyId})`:""}`),{callGasLimit:m.result.callGasLimit?_(m.result.callGasLimit):void 0,paymaster:m.result.paymaster,paymasterAndData:m.result.paymasterAndData,paymasterData:m.result.paymasterData,paymasterPostOpGasLimit:m.result.paymasterPostOpGasLimit?_(m.result.paymasterPostOpGasLimit):void 0,paymasterVerificationGasLimit:m.result.paymasterVerificationGasLimit?_(m.result.paymasterVerificationGasLimit):void 0,preVerificationGas:m.result.preVerificationGas?_(m.result.preVerificationGas):void 0,verificationGasLimit:m.result.verificationGasLimit?_(m.result.verificationGasLimit):void 0});const w=((A=m.error)==null?void 0:A.message)||m.error||y.statusText||"unknown error";throw new Error(`Paymaster error from ${o}: ${w}`)}const H=new Set,M=a=>`${a.chain.id}:${a.address}`,et=a=>{H.add(M(a))},st=a=>{H.delete(M(a))},nt=a=>H.has(M(a));async function va(a){const e=a.timeoutMs||12e4,t=a.intervalMs||1e3,i=Date.now()+e;for(;Date.now()<i;){const r=await Ot(a);if(r)return r;await new Promise(n=>setTimeout(n,t))}throw new Error(`Timeout waiting for userOp to be mined on chain ${a.chain.id} with UserOp hash: ${a.userOpHash}`)}async function La(a){var P;const{transaction:e,accountContract:t,factoryContract:i,adminAddress:r,overrides:n,sponsorGas:c,waitForDeployment:s=!0,isDeployedOverride:o}=a,d=e.chain,l=e.client,y={bundlerUrl:n==null?void 0:n.bundlerUrl,chain:d,client:l,entrypointAddress:n==null?void 0:n.entrypointAddress},m=k(((P=a.overrides)==null?void 0:P.entrypointAddress)||S),[w,A,G,g,f]=await Promise.all([typeof o=="boolean"?o:K(t).then(h=>h||nt(t)),$(e),O(e.gas),Oa({bundlerOptions:y,chain:d,client:l,executeTx:e}),Ea({accountContract:t,chain:d,client:l,entrypointAddress:n==null?void 0:n.entrypointAddress,getNonceOverride:n==null?void 0:n.getAccountNonce})]),{maxFeePerGas:p,maxPriorityFeePerGas:u}=g;return m==="v0.7"?Da({accountContract:t,adminAddress:r,bundlerOptions:y,callData:A,callGasLimit:G,factoryContract:i,isDeployed:w,maxFeePerGas:p,maxPriorityFeePerGas:u,nonce:f,overrides:n,sponsorGas:c,waitForDeployment:s}):xa({accountContract:t,adminAddress:r,bundlerOptions:y,callData:A,callGasLimit:G,factoryContract:i,isDeployed:w,maxFeePerGas:p,maxPriorityFeePerGas:u,nonce:f,overrides:n,sponsorGas:c,waitForDeployment:s})}async function Oa(a){const{executeTx:e,bundlerOptions:t,chain:i,client:r}=a;let{maxFeePerGas:n,maxPriorityFeePerGas:c}=e;const s=(t==null?void 0:t.bundlerUrl)??Q(i);if(Pt(s)){const o=await Dt({options:t});n=o.maxFeePerGas,c=o.maxPriorityFeePerGas}else{const[o,d]=await Promise.all([O(n),O(c)]);if(o&&d)n=o,c=d;else{const l=await dt(r,i);c=d??l.maxPriorityFeePerGas??0n,n=o??l.maxFeePerGas??0n}}return{maxFeePerGas:n,maxPriorityFeePerGas:c}}async function Da(a){const{bundlerOptions:e,isDeployed:t,factoryContract:i,accountContract:r,adminAddress:n,sponsorGas:c,overrides:s,nonce:o,callData:d,callGasLimit:l,maxFeePerGas:y,maxPriorityFeePerGas:m,waitForDeployment:w}=a,{chain:A,client:G}=e;let g,f;t?(f="0x",w&&await rt(r)):(g=i.address,f=await $(j({accountSalt:s==null?void 0:s.accountSalt,adminAddress:n,createAccountOverride:s==null?void 0:s.createAccount,factoryContract:i})),w&&et(r));const p={callData:d,callGasLimit:l??0n,factory:g,factoryData:f,maxFeePerGas:y,maxPriorityFeePerGas:m,nonce:o,paymaster:void 0,paymasterData:"0x",paymasterPostOpGasLimit:0n,paymasterVerificationGasLimit:0n,preVerificationGas:0n,sender:r.address,signature:tt,verificationGasLimit:0n};if(c){const u=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:p});if(u.paymaster&&u.paymasterData&&(p.paymaster=u.paymaster,p.paymasterData=u.paymasterData),u.callGasLimit&&u.verificationGasLimit&&u.preVerificationGas&&u.paymasterPostOpGasLimit&&u.paymasterVerificationGasLimit)p.callGasLimit=u.callGasLimit,p.verificationGasLimit=u.verificationGasLimit,p.preVerificationGas=u.preVerificationGas,p.paymasterPostOpGasLimit=u.paymasterPostOpGasLimit,p.paymasterVerificationGasLimit=u.paymasterVerificationGasLimit;else{const P=s!=null&&s.tokenPaymaster?{[s.tokenPaymaster.tokenAddress]:{stateDiff:{[pt(mt([{type:"address"},{type:"uint256"}],[r.address,s.tokenPaymaster.balanceStorageSlot]))]:ut(lt,{size:32})}}}:void 0,h=await U({options:e,userOp:p},P);p.callGasLimit=h.callGasLimit,p.verificationGasLimit=h.verificationGasLimit,p.preVerificationGas=h.preVerificationGas,p.paymasterPostOpGasLimit=s!=null&&s.tokenPaymaster?500000n:h.paymasterPostOpGasLimit||0n,p.paymasterVerificationGasLimit=h.paymasterVerificationGasLimit||0n;const v=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:p});v.paymaster&&v.paymasterData&&(p.paymaster=v.paymaster,p.paymasterData=v.paymasterData)}}else{const u=await U({options:e,userOp:p});p.callGasLimit=u.callGasLimit,p.verificationGasLimit=u.verificationGasLimit,p.preVerificationGas=u.preVerificationGas,p.paymasterPostOpGasLimit=u.paymasterPostOpGasLimit||0n,p.paymasterVerificationGasLimit=u.paymasterVerificationGasLimit||0n}return{...p,signature:"0x"}}async function xa(a){const{bundlerOptions:e,isDeployed:t,factoryContract:i,accountContract:r,adminAddress:n,sponsorGas:c,overrides:s,nonce:o,callData:d,callGasLimit:l,maxFeePerGas:y,maxPriorityFeePerGas:m,waitForDeployment:w}=a,{chain:A,client:G}=e;let g;t?(g="0x",w&&await rt(r)):(g=await _a({accountSalt:s==null?void 0:s.accountSalt,adminAddress:n,createAccountOverride:s==null?void 0:s.createAccount,factoryContract:i}),w&&et(r));const f={callData:d,callGasLimit:l??0n,initCode:g,maxFeePerGas:y,maxPriorityFeePerGas:m,nonce:o,paymasterAndData:"0x",preVerificationGas:0n,sender:r.address,signature:tt,verificationGasLimit:0n};if(c){const p=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:f}),u="paymasterAndData"in p?p.paymasterAndData:"0x";if(u&&u!=="0x"&&(f.paymasterAndData=u),p.callGasLimit&&p.verificationGasLimit&&p.preVerificationGas)f.callGasLimit=p.callGasLimit,f.verificationGasLimit=p.verificationGasLimit,f.preVerificationGas=p.preVerificationGas;else{const P=await U({options:e,userOp:f});if(f.callGasLimit=P.callGasLimit,f.verificationGasLimit=P.verificationGasLimit,f.preVerificationGas=P.preVerificationGas,u&&u!=="0x"){const h=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:f}),v="paymasterAndData"in h?h.paymasterAndData:"0x";v&&v!=="0x"&&(f.paymasterAndData=v)}}}else{const p=await U({options:e,userOp:f});f.callGasLimit=p.callGasLimit,f.verificationGasLimit=p.verificationGasLimit,f.preVerificationGas=p.preVerificationGas}return{...f,signature:"0x"}}async function Sa(a){const{userOp:e,chain:t,entrypointAddress:i,adminAccount:r}=a,n=await Ca({chain:t,client:a.client,entrypointAddress:i,userOp:e});if(r.signMessage){const c=await r.signMessage({chainId:t.id,message:{raw:ot(n)},originalMessage:Z(e)});return{...e,signature:c}}throw new Error("signMessage not implemented in signingAccount")}async function Ca(a){const{userOp:e,chain:t,entrypointAddress:i}=a,r=k(i||S);let n;if(r==="v0.7"){const c=Pa(e);n=await Aa({contract:L({address:i||at,chain:t,client:a.client}),userOp:c})}else n=await la({contract:L({address:i||S,chain:t,client:a.client}),userOp:e});return n}async function _a(a){const{factoryContract:e,adminAddress:t,accountSalt:i,createAccountOverride:r}=a,n=j({accountSalt:i,adminAddress:t,createAccountOverride:r,factoryContract:e});return E([e.address,await $(n)])}async function Ea(a){const{accountContract:e,chain:t,client:i,entrypointAddress:r,getNonceOverride:n}=a;return n?n(e):await da({contract:L({address:r||S,chain:t,client:i}),key:xt(),sender:e.address})}async function rt(a){const e=Date.now();for(;nt(a);){if(Date.now()-e>6e4)throw st(a),new Error("Account deployment is taking too long (over 1 minute). Please try again.");await new Promise(t=>setTimeout(t,500))}}const it=new WeakMap,R=new WeakMap;async function Qa(a,e){var m,w,A,G,g,f,p;const{personalAccount:t,client:i}=a;if(!t)throw new Error("No personal account provided for smart account connection");const r=e,n=e.chain,c="gasless"in r?r.gasless:r.sponsorGas;if(await yt(n))return[Ua({chain:n,connectionOptions:a,creationOptions:e,sponsorGas:c}),n];if(r.factoryAddress&&!((m=r.overrides)!=null&&m.entrypointAddress)){const u=await Ia(r.factoryAddress,i,n);u&&(r.overrides={...r.overrides,entrypointAddress:u})}(w=r.overrides)!=null&&w.tokenPaymaster&&!((A=r.overrides)!=null&&A.entrypointAddress)&&(r.overrides={...r.overrides,entrypointAddress:at});const s=r.factoryAddress??St((G=r.overrides)==null?void 0:G.entrypointAddress),o=L({address:s,chain:n,client:i}),d=await ft({accountAddress:(g=r.overrides)==null?void 0:g.accountAddress,accountSalt:(f=r.overrides)==null?void 0:f.accountSalt,adminAddress:t.address,factoryContract:o,predictAddressOverride:(p=r.overrides)==null?void 0:p.predictAddress}).then(u=>u).catch(u=>{throw new Error(`Failed to get account address with factory contract ${o.address} on chain ID ${n.id}: ${(u==null?void 0:u.message)||"unknown error"}`,{cause:u})}),l=L({address:d,chain:n,client:i}),y=await Fa({...r,accountContract:l,chain:n,client:i,factoryContract:o,personalAccount:t,sponsorGas:c});if(it.set(t,y),R.set(y,t),r.sessionKey&&await sa({accountContract:l,newPermissions:r.sessionKey.permissions,sessionKeyAddress:r.sessionKey.address})){const u=ea({account:t,contract:l,permissions:r.sessionKey.permissions,sessionKeyAddress:r.sessionKey.address});await wt({account:y,transaction:u})}return[y,n]}async function te(a){const e=R.get(a);e&&(it.delete(e),R.delete(a))}async function Fa(a){var n,c;const e=(n=a.overrides)==null?void 0:n.tokenPaymaster;if(e&&k(((c=a.overrides)==null?void 0:c.entrypointAddress)||S)!=="v0.7")throw new Error("Token paymaster is only supported for entrypoint version v0.7");const t=a.sponsorGas;let i=a.accountContract;const r={address:Y(i.address),async onTransactionRequested(s){var o,d;return(d=(o=a.personalAccount).onTransactionRequested)==null?void 0:d.call(o,s)},async sendBatchTransaction(s){var m,w;const o=At({accountContract:i,executeBatchOverride:(m=a.overrides)==null?void 0:m.executeBatch,transactions:s});if(s.length===0)throw new Error("No transactions to send");const d=s[0];if(!d)throw new Error("No transactions to send");const l=F(d.chainId),y=await N({executeTx:o,options:{...a,accountContract:i,chain:l}});return V({chainId:l.id,client:a.client,contractAddress:((w=s[0])==null?void 0:w.to)??void 0,transactionHash:y.transactionHash,walletAddress:a.accountContract.address,walletType:"smart"}),y},async sendTransaction(s){var m,w,A;let o;if(e){await Va({accountContract:i,erc20Paymaster:e,options:a});const G=async()=>({paymaster:e.paymasterAddress,paymasterData:"0x"});o=((m=a.overrides)==null?void 0:m.paymaster)||G}else o=(w=a.overrides)==null?void 0:w.paymaster;s.chainId!==i.chain.id&&(i=L({address:r.address,chain:F(s.chainId),client:a.client}));const d=X({accountContract:i,executeOverride:(A=a.overrides)==null?void 0:A.execute,transaction:s}),l=F(s.chainId),y=await N({executeTx:d,options:{...a,accountContract:i,chain:l,overrides:{...a.overrides,paymaster:o}}});return V({chainId:l.id,client:a.client,contractAddress:s.to??void 0,transactionHash:y.transactionHash,walletAddress:a.accountContract.address,walletType:"smart"}),y},async signMessage({message:s}){var d;if((d=a.overrides)!=null&&d.signMessage)return a.overrides.signMessage({accountContract:i,adminAccount:a.personalAccount,factoryContract:a.factoryContract,message:s});const{smartAccountSignMessage:o}=await T(async()=>{const{smartAccountSignMessage:l}=await import("./signing-Cvv8O8BI.js").then(y=>y.cY);return{smartAccountSignMessage:l}},__vite__mapDeps([5,1,2,3,6,7]));return o({accountContract:i,factoryContract:a.factoryContract,message:s,options:a})},async signTypedData(s){var d;if((d=a.overrides)!=null&&d.signTypedData)return a.overrides.signTypedData({accountContract:i,adminAccount:a.personalAccount,factoryContract:a.factoryContract,typedData:s});const{smartAccountSignTypedData:o}=await T(async()=>{const{smartAccountSignTypedData:l}=await import("./signing-Cvv8O8BI.js").then(y=>y.cY);return{smartAccountSignTypedData:l}},__vite__mapDeps([5,1,2,3,6,7]));return o({accountContract:i,factoryContract:a.factoryContract,options:a,typedData:s})},sendCalls:async s=>{const{inAppWalletSendCalls:o}=await T(async()=>{const{inAppWalletSendCalls:w}=await import("./in-app-wallet-calls-l67EA4DZ.js");return{inAppWalletSendCalls:w}},__vite__mapDeps([8,9,10,5,1,2,3,6,7,11,12,13,14,15,16,17,18,19,20,21,22])),d=s.calls[0];if(!d)throw new Error("No calls to send");const l=d.client,y=d.chain||s.chain,m=await o({account:r,calls:s.calls,chain:y});return{chain:y,client:l,id:m}},getCallsStatus:async s=>{const{inAppWalletGetCallsStatus:o}=await T(async()=>{const{inAppWalletGetCallsStatus:d}=await import("./in-app-wallet-calls-l67EA4DZ.js");return{inAppWalletGetCallsStatus:d}},__vite__mapDeps([8,9,10,5,1,2,3,6,7,11,12,13,14,15,16,17,18,19,20,21,22]));return o(s)},getCallsStatusRaw:async s=>{const{inAppWalletGetCallsStatusRaw:o}=await T(async()=>{const{inAppWalletGetCallsStatusRaw:d}=await import("./in-app-wallet-calls-l67EA4DZ.js");return{inAppWalletGetCallsStatusRaw:d}},__vite__mapDeps([8,9,10,5,1,2,3,6,7,11,12,13,14,15,16,17,18,19,20,21,22]));return o(s)},getCapabilities:async s=>({[s.chainId??1]:{atomic:{status:"supported"},paymasterService:{supported:t??!1}}})};return r}async function Va(a){var l;const{accountContract:e,erc20Paymaster:t,options:i}=a,r=t.tokenAddress,n=L({address:r,chain:e.chain,client:e.client});if(await $t({contract:n,owner:e.address,spender:t.paymasterAddress})>0n)return;const s=qt({amountWei:ra-1n,contract:n,spender:t.paymasterAddress}),o=await Gt({from:e.address,transaction:s}),d=X({accountContract:e,executeOverride:(l=i.overrides)==null?void 0:l.execute,transaction:o});await N({executeTx:d,options:{...i,overrides:{...i.overrides,tokenPaymaster:void 0}}})}function Ua(a){const{creationOptions:e,connectionOptions:t,chain:i}=a,r={address:Y(t.personalAccount.address),async onTransactionRequested(n){var c,s;return(s=(c=t.personalAccount).onTransactionRequested)==null?void 0:s.call(c,n)},async sendTransaction(n){var l,y,m,w;const c={chain:F(n.chainId),client:t.client,data:n.data,eip712:n.eip712,to:n.to??void 0,value:n.value??0n};let s=await Ut({account:r,transaction:c});if(a.sponsorGas&&!s.paymaster){const A=await _t({options:{bundlerUrl:(l=e.overrides)==null?void 0:l.bundlerUrl,chain:i,client:t.client,entrypointAddress:(y=e.overrides)==null?void 0:y.entrypointAddress},transaction:s});s={...s,...A}}const o=await It({account:r,chainId:i.id,eip712Transaction:s}),d=await Et({options:{bundlerUrl:(m=e.overrides)==null?void 0:m.bundlerUrl,chain:i,client:t.client,entrypointAddress:(w=e.overrides)==null?void 0:w.entrypointAddress},signedTransaction:o,transaction:s});return V({chainId:i.id,client:t.client,contractAddress:n.to??void 0,transactionHash:d.transactionHash,walletAddress:r.address,walletType:"smart"}),{chain:i,client:t.client,transactionHash:d.transactionHash}},async signMessage({message:n}){return t.personalAccount.signMessage({message:n})},async signTypedData(n){const c=Ct(n);return t.personalAccount.signTypedData(c)},sendCalls:async n=>{const{inAppWalletSendCalls:c}=await T(async()=>{const{inAppWalletSendCalls:y}=await import("./in-app-wallet-calls-l67EA4DZ.js");return{inAppWalletSendCalls:y}},__vite__mapDeps([8,9,10,5,1,2,3,6,7,11,12,13,14,15,16,17,18,19,20,21,22])),s=n.calls[0];if(!s)throw new Error("No calls to send");const o=s.client,d=s.chain||n.chain,l=await c({account:r,calls:n.calls,chain:d});return{chain:d,client:o,id:l}},getCallsStatus:async n=>{const{inAppWalletGetCallsStatus:c}=await T(async()=>{const{inAppWalletGetCallsStatus:s}=await import("./in-app-wallet-calls-l67EA4DZ.js");return{inAppWalletGetCallsStatus:s}},__vite__mapDeps([8,9,10,5,1,2,3,6,7,11,12,13,14,15,16,17,18,19,20,21,22]));return c(n)},getCallsStatusRaw:async n=>{const{inAppWalletGetCallsStatusRaw:c}=await T(async()=>{const{inAppWalletGetCallsStatusRaw:s}=await import("./in-app-wallet-calls-l67EA4DZ.js");return{inAppWalletGetCallsStatusRaw:s}},__vite__mapDeps([8,9,10,5,1,2,3,6,7,11,12,13,14,15,16,17,18,19,20,21,22]));return c(n)},getCapabilities:async n=>({[n.chainId??1]:{atomic:{status:"unsupported"},paymasterService:{supported:a.sponsorGas??!1}}})};return r}async function N(a){var i,r,n;const{executeTx:e,options:t}=a;try{const c=await La({accountContract:t.accountContract,adminAddress:t.personalAccount.address,factoryContract:t.factoryContract,overrides:t.overrides,sponsorGas:t.sponsorGas,transaction:e}),s=await Sa({adminAccount:t.personalAccount,chain:t.chain,client:t.client,entrypointAddress:(i=t.overrides)==null?void 0:i.entrypointAddress,userOp:c}),o={bundlerUrl:(r=t.overrides)==null?void 0:r.bundlerUrl,chain:t.chain,client:t.client,entrypointAddress:(n=t.overrides)==null?void 0:n.entrypointAddress},d=await Ft({options:o,userOp:s}),l=await va({...o,userOpHash:d});return V({chainId:t.chain.id,client:t.client,contractAddress:await O(e.to??void 0),transactionHash:l.transactionHash,walletAddress:t.accountContract.address,walletType:"smart"}),{chain:t.chain,client:t.client,transactionHash:l.transactionHash}}catch(c){throw gt(c)&&ht({chainId:t.chain.id,client:t.client,contractAddress:await O(e.to??void 0),error:c,transactionValue:await O(e.value),walletAddress:t.accountContract.address}),c}finally{st(t.accountContract)}}async function Ia(a,e,t){const i=L({address:a,chain:t,client:e});try{return await C({contract:i,method:"function entrypoint() public view returns (address)"})}catch{return}}export{Qa as connectSmartAccount,te as disconnectSmartAccount,Ia as getEntrypointFromFactory,se as isSmartWallet};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/decimals-Bf_Oizd2.js","assets/utils-kxirIM46.js","assets/ethers-CU3Ctw5k.js","assets/react-4iaCnQ6n.js","assets/decimals-DbV6JWsZ.js","assets/signing-DbptdEFO.js","assets/index-Dh_23qfs.js","assets/index-Pws_ODuR.css","assets/in-app-wallet-calls-NeNIVGtZ.js","assets/wait-for-tx-receipt-RA8zh0o7.js","assets/transactionReceipt-BZFMW0kN.js","assets/sleep-mAKpSMLY.js","assets/send-batch-transaction-DLM-_LrZ.js","assets/wallets-CdAU3xHZ.js","assets/store-CraP4F4Y.js","assets/hashTypedData-BYNlhvPL.js","assets/index-CxlLn_V3.js","assets/index-B_F6pJEu.js","assets/index-B67hpoq5.js","assets/index-nibyPLVP.js","assets/index-CJdot1dH.js","assets/index-C4D-6CtP.js","assets/ethereum-XjVKsXdf.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as T}from"./index-Dh_23qfs.js";import{r as C,ab as q,ac as ct,Z as B,ad as z,ae as K,G as E,U as D,R as x,j as Z,h as _,w as $,x as O,S as ot,af as dt,b as L,ag as j,q as pt,e as mt,V as ut,ah as lt,ai as yt,aj as ft,v as wt,g as Y,l as V,ak as X,al as At,t as Gt,am as gt,an as ht}from"./signing-DbptdEFO.js";import{c as Tt,i as Pt,a as F}from"./utils-kxirIM46.js";import{R as J,r as vt,S as Q,T as S,U as Lt,W as k,X as Ot,Z as Dt,_ as xt,$ as U,a0 as tt,a1 as at,a2 as St,p as Ct,a3 as _t,a4 as Et,a5 as Ft}from"./wallets-CdAU3xHZ.js";import{a6 as se}from"./wallets-CdAU3xHZ.js";import{t as Vt,p as Ut,s as It}from"./send-eip712-transaction-DP17AWWu.js";import"./react-4iaCnQ6n.js";import"./ethers-CU3Ctw5k.js";import"./store-CraP4F4Y.js";import"./hashTypedData-BYNlhvPL.js";import"./index-CxlLn_V3.js";import"./index-B_F6pJEu.js";import"./index-B67hpoq5.js";import"./index-nibyPLVP.js";import"./index-CJdot1dH.js";import"./index-C4D-6CtP.js";import"./ethereum-XjVKsXdf.js";import"./sha256-Cx7Ij8et.js";const bt="0xdd62ed3e",Rt=[{name:"owner",type:"address"},{name:"spender",type:"address"}],Nt=[{type:"uint256"}];async function $t(a){return C({contract:a.contract,method:[bt,Rt,Nt],params:[a.owner,a.spender]})}const kt="0x095ea7b3",Ht=[{name:"spender",type:"address"},{name:"value",type:"uint256"}],Mt=[{type:"bool"}];function Wt(a){const e=J(async()=>"asyncParams"in a?await a.asyncParams():a);return q({accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList},contract:a.contract,erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},method:[kt,Ht,Mt],nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},params:async()=>{const t=await e();return[t.spender,t.value]},value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value}})}function qt(a){return Wt({asyncParams:async()=>{let e;if("amount"in a){const{decimals:t}=await T(async()=>{const{decimals:r}=await import("./decimals-Bf_Oizd2.js");return{decimals:r}},__vite__mapDeps([0,1,2,3,4,5,6,7])),i=await t(a).catch(()=>18);e=ct(a.amount.toString(),i)}else e=a.amountWei;return{overrides:{erc20Value:{amountWei:e,tokenAddress:a.contract.address},...a.overrides},spender:a.spender,value:e}},contract:a.contract})}const Bt="0xf15d424e",zt=[{name:"signer",type:"address"}],Kt=[{components:[{name:"signer",type:"address"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"startTimestamp",type:"uint128"},{name:"endTimestamp",type:"uint128"}],name:"permissions",type:"tuple"}];async function Zt(a){return C({contract:a.contract,method:[Bt,zt,Kt],params:[a.signer]})}const jt="0x5892e236",Yt=[{components:[{name:"signer",type:"address"},{name:"isAdmin",type:"uint8"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"permissionStartTimestamp",type:"uint128"},{name:"permissionEndTimestamp",type:"uint128"},{name:"reqValidityStartTimestamp",type:"uint128"},{name:"reqValidityEndTimestamp",type:"uint128"},{name:"uid",type:"bytes32"}],name:"req",type:"tuple"},{name:"signature",type:"bytes"}],Xt=[];function Jt(a){const e=J(async()=>"asyncParams"in a?await a.asyncParams():a);return q({accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList},contract:a.contract,erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},method:[jt,Yt,Xt],nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},params:async()=>{const t=await e();return[t.req,t.signature]},value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value}})}function W(){return new Date(Date.now()+1e3*60*60*24*365*10)}function b(a){return Vt(Math.floor(a.getTime()/1e3))}const Qt=[{name:"signer",type:"address"},{name:"isAdmin",type:"uint8"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"permissionStartTimestamp",type:"uint128"},{name:"permissionEndTimestamp",type:"uint128"},{name:"reqValidityStartTimestamp",type:"uint128"},{name:"reqValidityEndTimestamp",type:"uint128"},{name:"uid",type:"bytes32"}];async function ta(a){const{account:e,contract:t,req:i}=a,r=await e.signTypedData({domain:{chainId:t.chain.id,name:"Account",verifyingContract:t.address,version:"1"},message:i,primaryType:"SignerPermissionRequest",types:{SignerPermissionRequest:Qt}});return{req:i,signature:r}}async function aa(a){var i;const{target:e,permissions:t}=a;return{approvedTargets:t.approvedTargets==="*"?[B]:t.approvedTargets,isAdmin:0,nativeTokenLimitPerTransaction:z(((i=t.nativeTokenLimitPerTransaction)==null?void 0:i.toString())||"0"),permissionEndTimestamp:b(t.permissionEndTimestamp||W()),permissionStartTimestamp:b(t.permissionStartTimestamp||new Date(0)),reqValidityEndTimestamp:b(W()),reqValidityStartTimestamp:0n,signer:e,uid:await vt()}}function ea(a){const{contract:e,sessionKeyAddress:t,account:i,permissions:r}=a;return Jt({async asyncParams(){const{req:n,signature:c}=await ta({account:i,contract:e,req:await aa({permissions:r,target:t})});return{req:n,signature:c}},contract:e})}async function sa(a){var c;const{accountContract:e,sessionKeyAddress:t,newPermissions:i}=a;if(!await K(e))return!0;const n=await Zt({contract:e,signer:t});return!!(n.endTimestamp&&n.endTimestamp<Math.floor(Date.now()/1e3)||!na(n.approvedTargets,i.approvedTargets)||z(((c=i.nativeTokenLimitPerTransaction)==null?void 0:c.toString())??"0")>n.nativeTokenLimitPerTransaction)}function na(a,e){return e==="*"&&a.length===1&&a[0]===B?!0:e!=="*"?e.map(t=>t.toLowerCase()).every(t=>a.map(i=>i.toLowerCase()).includes(t)):!1}const ra=2n**96n-1n,ia="0x35567e1a",ca=[{name:"sender",type:"address"},{name:"key",type:"uint192"}],oa=[{name:"nonce",type:"uint256"}];async function da(a){return C({contract:a.contract,method:[ia,ca,oa],params:[a.sender,a.key]})}const pa="0xa6193531",ma=[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],ua=[{type:"bytes32"}];async function la(a){return C({contract:a.contract,method:[pa,ma,ua],params:[a.userOp]})}const ya="0x22cdde4c",fa=[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],wa=[{type:"bytes32"}];async function Aa(a){return C({contract:a.contract,method:[ya,fa,wa],params:[a.userOp]})}function Ga(a){return a.factory?E([a.factory,a.factoryData||"0x"]):"0x"}function ga(a){return E([D(x(BigInt(a.verificationGasLimit)),{size:16}),D(x(BigInt(a.callGasLimit)),{size:16})])}function ha(a){return E([D(x(BigInt(a.maxPriorityFeePerGas)),{size:16}),D(x(BigInt(a.maxFeePerGas)),{size:16})])}function Ta(a){return a.paymaster?E([a.paymaster,D(x(BigInt(a.paymasterVerificationGasLimit||0)),{size:16}),D(x(BigInt(a.paymasterPostOpGasLimit||0)),{size:16}),a.paymasterData||"0x"]):"0x"}const Pa=a=>({accountGasLimits:ga(a),callData:a.callData,gasFees:ha(a),initCode:Ga(a),nonce:BigInt(a.nonce),paymasterAndData:Ta(a),preVerificationGas:BigInt(a.preVerificationGas),sender:a.sender,signature:a.signature});async function I(a){var A;const{userOp:e,paymasterOverride:t,client:i,chain:r,entrypointAddress:n}=a;if(t)return t(e);const c={"Content-Type":"application/json"},s=n??S,o=Q(r),d={id:1,jsonrpc:"2.0",method:"pm_sponsorUserOperation",params:[Lt(e),s]},y=await Tt(i)(o,{body:Z(d),headers:c,method:"POST"});if(!y.ok){const G=await y.text()||y.statusText;throw new Error(`Paymaster error: ${y.status} - ${G}`)}const m=await y.json();if(m.result)return typeof m.result=="string"?{paymasterAndData:m.result}:(m.result.reason&&console.warn(`Paymaster policy rejected this transaction with reason: ${m.result.reason} ${m.result.policyId?`(policyId: ${m.result.policyId})`:""}`),{callGasLimit:m.result.callGasLimit?_(m.result.callGasLimit):void 0,paymaster:m.result.paymaster,paymasterAndData:m.result.paymasterAndData,paymasterData:m.result.paymasterData,paymasterPostOpGasLimit:m.result.paymasterPostOpGasLimit?_(m.result.paymasterPostOpGasLimit):void 0,paymasterVerificationGasLimit:m.result.paymasterVerificationGasLimit?_(m.result.paymasterVerificationGasLimit):void 0,preVerificationGas:m.result.preVerificationGas?_(m.result.preVerificationGas):void 0,verificationGasLimit:m.result.verificationGasLimit?_(m.result.verificationGasLimit):void 0});const w=((A=m.error)==null?void 0:A.message)||m.error||y.statusText||"unknown error";throw new Error(`Paymaster error from ${o}: ${w}`)}const H=new Set,M=a=>`${a.chain.id}:${a.address}`,et=a=>{H.add(M(a))},st=a=>{H.delete(M(a))},nt=a=>H.has(M(a));async function va(a){const e=a.timeoutMs||12e4,t=a.intervalMs||1e3,i=Date.now()+e;for(;Date.now()<i;){const r=await Ot(a);if(r)return r;await new Promise(n=>setTimeout(n,t))}throw new Error(`Timeout waiting for userOp to be mined on chain ${a.chain.id} with UserOp hash: ${a.userOpHash}`)}async function La(a){var P;const{transaction:e,accountContract:t,factoryContract:i,adminAddress:r,overrides:n,sponsorGas:c,waitForDeployment:s=!0,isDeployedOverride:o}=a,d=e.chain,l=e.client,y={bundlerUrl:n==null?void 0:n.bundlerUrl,chain:d,client:l,entrypointAddress:n==null?void 0:n.entrypointAddress},m=k(((P=a.overrides)==null?void 0:P.entrypointAddress)||S),[w,A,G,g,f]=await Promise.all([typeof o=="boolean"?o:K(t).then(h=>h||nt(t)),$(e),O(e.gas),Oa({bundlerOptions:y,chain:d,client:l,executeTx:e}),Ea({accountContract:t,chain:d,client:l,entrypointAddress:n==null?void 0:n.entrypointAddress,getNonceOverride:n==null?void 0:n.getAccountNonce})]),{maxFeePerGas:p,maxPriorityFeePerGas:u}=g;return m==="v0.7"?Da({accountContract:t,adminAddress:r,bundlerOptions:y,callData:A,callGasLimit:G,factoryContract:i,isDeployed:w,maxFeePerGas:p,maxPriorityFeePerGas:u,nonce:f,overrides:n,sponsorGas:c,waitForDeployment:s}):xa({accountContract:t,adminAddress:r,bundlerOptions:y,callData:A,callGasLimit:G,factoryContract:i,isDeployed:w,maxFeePerGas:p,maxPriorityFeePerGas:u,nonce:f,overrides:n,sponsorGas:c,waitForDeployment:s})}async function Oa(a){const{executeTx:e,bundlerOptions:t,chain:i,client:r}=a;let{maxFeePerGas:n,maxPriorityFeePerGas:c}=e;const s=(t==null?void 0:t.bundlerUrl)??Q(i);if(Pt(s)){const o=await Dt({options:t});n=o.maxFeePerGas,c=o.maxPriorityFeePerGas}else{const[o,d]=await Promise.all([O(n),O(c)]);if(o&&d)n=o,c=d;else{const l=await dt(r,i);c=d??l.maxPriorityFeePerGas??0n,n=o??l.maxFeePerGas??0n}}return{maxFeePerGas:n,maxPriorityFeePerGas:c}}async function Da(a){const{bundlerOptions:e,isDeployed:t,factoryContract:i,accountContract:r,adminAddress:n,sponsorGas:c,overrides:s,nonce:o,callData:d,callGasLimit:l,maxFeePerGas:y,maxPriorityFeePerGas:m,waitForDeployment:w}=a,{chain:A,client:G}=e;let g,f;t?(f="0x",w&&await rt(r)):(g=i.address,f=await $(j({accountSalt:s==null?void 0:s.accountSalt,adminAddress:n,createAccountOverride:s==null?void 0:s.createAccount,factoryContract:i})),w&&et(r));const p={callData:d,callGasLimit:l??0n,factory:g,factoryData:f,maxFeePerGas:y,maxPriorityFeePerGas:m,nonce:o,paymaster:void 0,paymasterData:"0x",paymasterPostOpGasLimit:0n,paymasterVerificationGasLimit:0n,preVerificationGas:0n,sender:r.address,signature:tt,verificationGasLimit:0n};if(c){const u=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:p});if(u.paymaster&&u.paymasterData&&(p.paymaster=u.paymaster,p.paymasterData=u.paymasterData),u.callGasLimit&&u.verificationGasLimit&&u.preVerificationGas&&u.paymasterPostOpGasLimit&&u.paymasterVerificationGasLimit)p.callGasLimit=u.callGasLimit,p.verificationGasLimit=u.verificationGasLimit,p.preVerificationGas=u.preVerificationGas,p.paymasterPostOpGasLimit=u.paymasterPostOpGasLimit,p.paymasterVerificationGasLimit=u.paymasterVerificationGasLimit;else{const P=s!=null&&s.tokenPaymaster?{[s.tokenPaymaster.tokenAddress]:{stateDiff:{[pt(mt([{type:"address"},{type:"uint256"}],[r.address,s.tokenPaymaster.balanceStorageSlot]))]:ut(lt,{size:32})}}}:void 0,h=await U({options:e,userOp:p},P);p.callGasLimit=h.callGasLimit,p.verificationGasLimit=h.verificationGasLimit,p.preVerificationGas=h.preVerificationGas,p.paymasterPostOpGasLimit=s!=null&&s.tokenPaymaster?500000n:h.paymasterPostOpGasLimit||0n,p.paymasterVerificationGasLimit=h.paymasterVerificationGasLimit||0n;const v=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:p});v.paymaster&&v.paymasterData&&(p.paymaster=v.paymaster,p.paymasterData=v.paymasterData)}}else{const u=await U({options:e,userOp:p});p.callGasLimit=u.callGasLimit,p.verificationGasLimit=u.verificationGasLimit,p.preVerificationGas=u.preVerificationGas,p.paymasterPostOpGasLimit=u.paymasterPostOpGasLimit||0n,p.paymasterVerificationGasLimit=u.paymasterVerificationGasLimit||0n}return{...p,signature:"0x"}}async function xa(a){const{bundlerOptions:e,isDeployed:t,factoryContract:i,accountContract:r,adminAddress:n,sponsorGas:c,overrides:s,nonce:o,callData:d,callGasLimit:l,maxFeePerGas:y,maxPriorityFeePerGas:m,waitForDeployment:w}=a,{chain:A,client:G}=e;let g;t?(g="0x",w&&await rt(r)):(g=await _a({accountSalt:s==null?void 0:s.accountSalt,adminAddress:n,createAccountOverride:s==null?void 0:s.createAccount,factoryContract:i}),w&&et(r));const f={callData:d,callGasLimit:l??0n,initCode:g,maxFeePerGas:y,maxPriorityFeePerGas:m,nonce:o,paymasterAndData:"0x",preVerificationGas:0n,sender:r.address,signature:tt,verificationGasLimit:0n};if(c){const p=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:f}),u="paymasterAndData"in p?p.paymasterAndData:"0x";if(u&&u!=="0x"&&(f.paymasterAndData=u),p.callGasLimit&&p.verificationGasLimit&&p.preVerificationGas)f.callGasLimit=p.callGasLimit,f.verificationGasLimit=p.verificationGasLimit,f.preVerificationGas=p.preVerificationGas;else{const P=await U({options:e,userOp:f});if(f.callGasLimit=P.callGasLimit,f.verificationGasLimit=P.verificationGasLimit,f.preVerificationGas=P.preVerificationGas,u&&u!=="0x"){const h=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:f}),v="paymasterAndData"in h?h.paymasterAndData:"0x";v&&v!=="0x"&&(f.paymasterAndData=v)}}}else{const p=await U({options:e,userOp:f});f.callGasLimit=p.callGasLimit,f.verificationGasLimit=p.verificationGasLimit,f.preVerificationGas=p.preVerificationGas}return{...f,signature:"0x"}}async function Sa(a){const{userOp:e,chain:t,entrypointAddress:i,adminAccount:r}=a,n=await Ca({chain:t,client:a.client,entrypointAddress:i,userOp:e});if(r.signMessage){const c=await r.signMessage({chainId:t.id,message:{raw:ot(n)},originalMessage:Z(e)});return{...e,signature:c}}throw new Error("signMessage not implemented in signingAccount")}async function Ca(a){const{userOp:e,chain:t,entrypointAddress:i}=a,r=k(i||S);let n;if(r==="v0.7"){const c=Pa(e);n=await Aa({contract:L({address:i||at,chain:t,client:a.client}),userOp:c})}else n=await la({contract:L({address:i||S,chain:t,client:a.client}),userOp:e});return n}async function _a(a){const{factoryContract:e,adminAddress:t,accountSalt:i,createAccountOverride:r}=a,n=j({accountSalt:i,adminAddress:t,createAccountOverride:r,factoryContract:e});return E([e.address,await $(n)])}async function Ea(a){const{accountContract:e,chain:t,client:i,entrypointAddress:r,getNonceOverride:n}=a;return n?n(e):await da({contract:L({address:r||S,chain:t,client:i}),key:xt(),sender:e.address})}async function rt(a){const e=Date.now();for(;nt(a);){if(Date.now()-e>6e4)throw st(a),new Error("Account deployment is taking too long (over 1 minute). Please try again.");await new Promise(t=>setTimeout(t,500))}}const it=new WeakMap,R=new WeakMap;async function Qa(a,e){var m,w,A,G,g,f,p;const{personalAccount:t,client:i}=a;if(!t)throw new Error("No personal account provided for smart account connection");const r=e,n=e.chain,c="gasless"in r?r.gasless:r.sponsorGas;if(await yt(n))return[Ua({chain:n,connectionOptions:a,creationOptions:e,sponsorGas:c}),n];if(r.factoryAddress&&!((m=r.overrides)!=null&&m.entrypointAddress)){const u=await Ia(r.factoryAddress,i,n);u&&(r.overrides={...r.overrides,entrypointAddress:u})}(w=r.overrides)!=null&&w.tokenPaymaster&&!((A=r.overrides)!=null&&A.entrypointAddress)&&(r.overrides={...r.overrides,entrypointAddress:at});const s=r.factoryAddress??St((G=r.overrides)==null?void 0:G.entrypointAddress),o=L({address:s,chain:n,client:i}),d=await ft({accountAddress:(g=r.overrides)==null?void 0:g.accountAddress,accountSalt:(f=r.overrides)==null?void 0:f.accountSalt,adminAddress:t.address,factoryContract:o,predictAddressOverride:(p=r.overrides)==null?void 0:p.predictAddress}).then(u=>u).catch(u=>{throw new Error(`Failed to get account address with factory contract ${o.address} on chain ID ${n.id}: ${(u==null?void 0:u.message)||"unknown error"}`,{cause:u})}),l=L({address:d,chain:n,client:i}),y=await Fa({...r,accountContract:l,chain:n,client:i,factoryContract:o,personalAccount:t,sponsorGas:c});if(it.set(t,y),R.set(y,t),r.sessionKey&&await sa({accountContract:l,newPermissions:r.sessionKey.permissions,sessionKeyAddress:r.sessionKey.address})){const u=ea({account:t,contract:l,permissions:r.sessionKey.permissions,sessionKeyAddress:r.sessionKey.address});await wt({account:y,transaction:u})}return[y,n]}async function te(a){const e=R.get(a);e&&(it.delete(e),R.delete(a))}async function Fa(a){var n,c;const e=(n=a.overrides)==null?void 0:n.tokenPaymaster;if(e&&k(((c=a.overrides)==null?void 0:c.entrypointAddress)||S)!=="v0.7")throw new Error("Token paymaster is only supported for entrypoint version v0.7");const t=a.sponsorGas;let i=a.accountContract;const r={address:Y(i.address),async onTransactionRequested(s){var o,d;return(d=(o=a.personalAccount).onTransactionRequested)==null?void 0:d.call(o,s)},async sendBatchTransaction(s){var m,w;const o=At({accountContract:i,executeBatchOverride:(m=a.overrides)==null?void 0:m.executeBatch,transactions:s});if(s.length===0)throw new Error("No transactions to send");const d=s[0];if(!d)throw new Error("No transactions to send");const l=F(d.chainId),y=await N({executeTx:o,options:{...a,accountContract:i,chain:l}});return V({chainId:l.id,client:a.client,contractAddress:((w=s[0])==null?void 0:w.to)??void 0,transactionHash:y.transactionHash,walletAddress:a.accountContract.address,walletType:"smart"}),y},async sendTransaction(s){var m,w,A;let o;if(e){await Va({accountContract:i,erc20Paymaster:e,options:a});const G=async()=>({paymaster:e.paymasterAddress,paymasterData:"0x"});o=((m=a.overrides)==null?void 0:m.paymaster)||G}else o=(w=a.overrides)==null?void 0:w.paymaster;s.chainId!==i.chain.id&&(i=L({address:r.address,chain:F(s.chainId),client:a.client}));const d=X({accountContract:i,executeOverride:(A=a.overrides)==null?void 0:A.execute,transaction:s}),l=F(s.chainId),y=await N({executeTx:d,options:{...a,accountContract:i,chain:l,overrides:{...a.overrides,paymaster:o}}});return V({chainId:l.id,client:a.client,contractAddress:s.to??void 0,transactionHash:y.transactionHash,walletAddress:a.accountContract.address,walletType:"smart"}),y},async signMessage({message:s}){var d;if((d=a.overrides)!=null&&d.signMessage)return a.overrides.signMessage({accountContract:i,adminAccount:a.personalAccount,factoryContract:a.factoryContract,message:s});const{smartAccountSignMessage:o}=await T(async()=>{const{smartAccountSignMessage:l}=await import("./signing-DbptdEFO.js").then(y=>y.cY);return{smartAccountSignMessage:l}},__vite__mapDeps([5,1,2,3,6,7]));return o({accountContract:i,factoryContract:a.factoryContract,message:s,options:a})},async signTypedData(s){var d;if((d=a.overrides)!=null&&d.signTypedData)return a.overrides.signTypedData({accountContract:i,adminAccount:a.personalAccount,factoryContract:a.factoryContract,typedData:s});const{smartAccountSignTypedData:o}=await T(async()=>{const{smartAccountSignTypedData:l}=await import("./signing-DbptdEFO.js").then(y=>y.cY);return{smartAccountSignTypedData:l}},__vite__mapDeps([5,1,2,3,6,7]));return o({accountContract:i,factoryContract:a.factoryContract,options:a,typedData:s})},sendCalls:async s=>{const{inAppWalletSendCalls:o}=await T(async()=>{const{inAppWalletSendCalls:w}=await import("./in-app-wallet-calls-NeNIVGtZ.js");return{inAppWalletSendCalls:w}},__vite__mapDeps([8,9,10,5,1,2,3,6,7,11,12,13,14,15,16,17,18,19,20,21,22])),d=s.calls[0];if(!d)throw new Error("No calls to send");const l=d.client,y=d.chain||s.chain,m=await o({account:r,calls:s.calls,chain:y});return{chain:y,client:l,id:m}},getCallsStatus:async s=>{const{inAppWalletGetCallsStatus:o}=await T(async()=>{const{inAppWalletGetCallsStatus:d}=await import("./in-app-wallet-calls-NeNIVGtZ.js");return{inAppWalletGetCallsStatus:d}},__vite__mapDeps([8,9,10,5,1,2,3,6,7,11,12,13,14,15,16,17,18,19,20,21,22]));return o(s)},getCallsStatusRaw:async s=>{const{inAppWalletGetCallsStatusRaw:o}=await T(async()=>{const{inAppWalletGetCallsStatusRaw:d}=await import("./in-app-wallet-calls-NeNIVGtZ.js");return{inAppWalletGetCallsStatusRaw:d}},__vite__mapDeps([8,9,10,5,1,2,3,6,7,11,12,13,14,15,16,17,18,19,20,21,22]));return o(s)},getCapabilities:async s=>({[s.chainId??1]:{atomic:{status:"supported"},paymasterService:{supported:t??!1}}})};return r}async function Va(a){var l;const{accountContract:e,erc20Paymaster:t,options:i}=a,r=t.tokenAddress,n=L({address:r,chain:e.chain,client:e.client});if(await $t({contract:n,owner:e.address,spender:t.paymasterAddress})>0n)return;const s=qt({amountWei:ra-1n,contract:n,spender:t.paymasterAddress}),o=await Gt({from:e.address,transaction:s}),d=X({accountContract:e,executeOverride:(l=i.overrides)==null?void 0:l.execute,transaction:o});await N({executeTx:d,options:{...i,overrides:{...i.overrides,tokenPaymaster:void 0}}})}function Ua(a){const{creationOptions:e,connectionOptions:t,chain:i}=a,r={address:Y(t.personalAccount.address),async onTransactionRequested(n){var c,s;return(s=(c=t.personalAccount).onTransactionRequested)==null?void 0:s.call(c,n)},async sendTransaction(n){var l,y,m,w;const c={chain:F(n.chainId),client:t.client,data:n.data,eip712:n.eip712,to:n.to??void 0,value:n.value??0n};let s=await Ut({account:r,transaction:c});if(a.sponsorGas&&!s.paymaster){const A=await _t({options:{bundlerUrl:(l=e.overrides)==null?void 0:l.bundlerUrl,chain:i,client:t.client,entrypointAddress:(y=e.overrides)==null?void 0:y.entrypointAddress},transaction:s});s={...s,...A}}const o=await It({account:r,chainId:i.id,eip712Transaction:s}),d=await Et({options:{bundlerUrl:(m=e.overrides)==null?void 0:m.bundlerUrl,chain:i,client:t.client,entrypointAddress:(w=e.overrides)==null?void 0:w.entrypointAddress},signedTransaction:o,transaction:s});return V({chainId:i.id,client:t.client,contractAddress:n.to??void 0,transactionHash:d.transactionHash,walletAddress:r.address,walletType:"smart"}),{chain:i,client:t.client,transactionHash:d.transactionHash}},async signMessage({message:n}){return t.personalAccount.signMessage({message:n})},async signTypedData(n){const c=Ct(n);return t.personalAccount.signTypedData(c)},sendCalls:async n=>{const{inAppWalletSendCalls:c}=await T(async()=>{const{inAppWalletSendCalls:y}=await import("./in-app-wallet-calls-NeNIVGtZ.js");return{inAppWalletSendCalls:y}},__vite__mapDeps([8,9,10,5,1,2,3,6,7,11,12,13,14,15,16,17,18,19,20,21,22])),s=n.calls[0];if(!s)throw new Error("No calls to send");const o=s.client,d=s.chain||n.chain,l=await c({account:r,calls:n.calls,chain:d});return{chain:d,client:o,id:l}},getCallsStatus:async n=>{const{inAppWalletGetCallsStatus:c}=await T(async()=>{const{inAppWalletGetCallsStatus:s}=await import("./in-app-wallet-calls-NeNIVGtZ.js");return{inAppWalletGetCallsStatus:s}},__vite__mapDeps([8,9,10,5,1,2,3,6,7,11,12,13,14,15,16,17,18,19,20,21,22]));return c(n)},getCallsStatusRaw:async n=>{const{inAppWalletGetCallsStatusRaw:c}=await T(async()=>{const{inAppWalletGetCallsStatusRaw:s}=await import("./in-app-wallet-calls-NeNIVGtZ.js");return{inAppWalletGetCallsStatusRaw:s}},__vite__mapDeps([8,9,10,5,1,2,3,6,7,11,12,13,14,15,16,17,18,19,20,21,22]));return c(n)},getCapabilities:async n=>({[n.chainId??1]:{atomic:{status:"unsupported"},paymasterService:{supported:a.sponsorGas??!1}}})};return r}async function N(a){var i,r,n;const{executeTx:e,options:t}=a;try{const c=await La({accountContract:t.accountContract,adminAddress:t.personalAccount.address,factoryContract:t.factoryContract,overrides:t.overrides,sponsorGas:t.sponsorGas,transaction:e}),s=await Sa({adminAccount:t.personalAccount,chain:t.chain,client:t.client,entrypointAddress:(i=t.overrides)==null?void 0:i.entrypointAddress,userOp:c}),o={bundlerUrl:(r=t.overrides)==null?void 0:r.bundlerUrl,chain:t.chain,client:t.client,entrypointAddress:(n=t.overrides)==null?void 0:n.entrypointAddress},d=await Ft({options:o,userOp:s}),l=await va({...o,userOpHash:d});return V({chainId:t.chain.id,client:t.client,contractAddress:await O(e.to??void 0),transactionHash:l.transactionHash,walletAddress:t.accountContract.address,walletType:"smart"}),{chain:t.chain,client:t.client,transactionHash:l.transactionHash}}catch(c){throw gt(c)&&ht({chainId:t.chain.id,client:t.client,contractAddress:await O(e.to??void 0),error:c,transactionValue:await O(e.value),walletAddress:t.accountContract.address}),c}finally{st(t.accountContract)}}async function Ia(a,e,t){const i=L({address:a,chain:t,client:e});try{return await C({contract:i,method:"function entrypoint() public view returns (address)"})}catch{return}}export{Qa as connectSmartAccount,te as disconnectSmartAccount,Ia as getEntrypointFromFactory,se as isSmartWallet};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as g,b as e}from"./lit-element-B3y9oplH.js";import{r as f,n as w,o as v}from"./class-map-CxwNmq0D.js";import{d as y,r as k,e as P}from"./index-
|
|
1
|
+
import{i as g,b as e}from"./lit-element-B3y9oplH.js";import{r as f,n as w,o as v}from"./class-map-CxwNmq0D.js";import{d as y,r as k,e as P}from"./index-sV0xAzf6.js";import{c as b}from"./index-DuUdctHy.js";import"./index-PX_c3Qb_.js";import{H as x}from"./HelpersUtil-BMvoH0KX.js";import{R as u,E as A}from"./W3MFrameProviderSingleton-BGrWzqsE.js";import"./index-C6e6OYT7.js";import"./index-RYxtgu1n.js";const I=y`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as b,i as g,b as m}from"./lit-element-B3y9oplH.js";import{n as v,r as h}from"./class-map-CxwNmq0D.js";import{d as y}from"./index-
|
|
1
|
+
import{a as b,i as g,b as m}from"./lit-element-B3y9oplH.js";import{n as v,r as h}from"./class-map-CxwNmq0D.js";import{d as y}from"./index-sV0xAzf6.js";import{c as w}from"./index-DuUdctHy.js";import{j as x,e as $,i as R,p as T,R as C,M as P}from"./W3MFrameProviderSingleton-BGrWzqsE.js";const s=T({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),_={state:s,subscribe(t){return R(s,()=>t(s))},subscribeKey(t,e){return $(s,t,e)},showTooltip({message:t,triggerRect:e,variant:o}){s.open=!0,s.message=t,s.triggerRect=e,s.variant=o},hide(){s.open=!1,s.message="",s.triggerRect={width:0,height:0,top:0,left:0}}},a=x(_),j=b`
|
|
2
2
|
:host {
|
|
3
3
|
width: 100%;
|
|
4
4
|
display: block;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as k}from"./index-BV8s6ez1.js";import{az as w}from"./sendRawTransaction-
|
|
1
|
+
import{r as k}from"./index-BV8s6ez1.js";import{az as w}from"./sendRawTransaction-B-N14GCq.js";import{c as I,e as q}from"./hashTypedData-CW0ZlbZA.js";import"./NetworkUtil-aE1iGnVj.js";import"./ethers-CU3Ctw5k.js";import"./react-4iaCnQ6n.js";import"./index-Dh_23qfs.js";const v=()=>"9.1.0",C=t=>t.toString(16).padStart(2,"0"),R=t=>{const e=new Uint8Array(t/2);return window.crypto.getRandomValues(e),Array.from(e,C).join("")},E=()=>typeof window<"u"?R(10):new Date().getTime().toString(36);class g{}g.makeRequest=(t,e)=>({id:E(),method:t,params:e,env:{sdkVersion:v()}});g.makeResponse=(t,e,s)=>({id:t,success:!0,version:s,data:e});g.makeErrorResponse=(t,e,s)=>({id:t,success:!1,error:e,version:s});var r;(function(t){t.sendTransactions="sendTransactions",t.rpcCall="rpcCall",t.getChainInfo="getChainInfo",t.getSafeInfo="getSafeInfo",t.getTxBySafeTxHash="getTxBySafeTxHash",t.getSafeBalances="getSafeBalances",t.signMessage="signMessage",t.signTypedMessage="signTypedMessage",t.getEnvironmentInfo="getEnvironmentInfo",t.getOffChainSignature="getOffChainSignature",t.requestAddressBook="requestAddressBook",t.wallet_getPermissions="wallet_getPermissions",t.wallet_requestPermissions="wallet_requestPermissions"})(r||(r={}));var f;(function(t){t.requestAddressBook="requestAddressBook"})(f||(f={}));class H{constructor(e=null,s=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:a,data:n,source:i})=>{const o=!n,l=!this.isServer&&i===window.parent,u=typeof n.version<"u"&&parseInt(n.version.split(".")[0]),B=typeof u=="number"&&u>=1;let y=!0;return Array.isArray(this.allowedOrigins)&&(y=this.allowedOrigins.find(P=>P.test(a))!==void 0),!o&&l&&B&&y},this.logIncomingMessage=a=>{console.info(`Safe Apps SDK v1: A message was received from origin ${a.origin}. `,a.data)},this.onParentMessage=a=>{this.isValidMessage(a)&&(this.debugMode&&this.logIncomingMessage(a),this.handleIncomingMessage(a.data))},this.handleIncomingMessage=a=>{const{id:n}=a,i=this.callbacks.get(n);i&&(i(a),this.callbacks.delete(n))},this.send=(a,n)=>{const i=g.makeRequest(a,n);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(i,"*"),new Promise((o,l)=>{this.callbacks.set(i.id,u=>{if(!u.success){l(new Error(u.error));return}o(u)})})},this.allowedOrigins=e,this.debugMode=s,this.isServer||window.addEventListener("message",this.onParentMessage)}}const S=t=>typeof t=="object"&&t!=null&&"domain"in t&&"types"in t&&"message"in t;var m=k();class A{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw new Error("Invalid safeTxHash");return(await this.communicator.send(r.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){const s={message:e};return(await this.communicator.send(r.signMessage,s)).data}async signTypedMessage(e){if(!S(e))throw new Error("Invalid typed data");return(await this.communicator.send(r.signTypedMessage,{typedData:e})).data}async send({txs:e,params:s}){if(!e||!e.length)throw new Error("No transactions were passed");const a={txs:e,params:s};return(await this.communicator.send(r.sendTransactions,a)).data}}const c={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"},h={defaultBlockParam:(t="latest")=>t,returnFullTxObjectParam:(t=!1)=>t,blockNumberToHex:t=>Number.isInteger(t)?`0x${t.toString(16)}`:t};class O{constructor(e){this.communicator=e,this.call=this.buildRequest({call:c.eth_call,formatters:[null,h.defaultBlockParam]}),this.getBalance=this.buildRequest({call:c.eth_getBalance,formatters:[null,h.defaultBlockParam]}),this.getCode=this.buildRequest({call:c.eth_getCode,formatters:[null,h.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:c.eth_getStorageAt,formatters:[null,h.blockNumberToHex,h.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:c.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:c.eth_getBlockByHash,formatters:[null,h.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:c.eth_getBlockByNumber,formatters:[h.blockNumberToHex,h.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:c.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:c.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:c.eth_getTransactionCount,formatters:[null,h.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:c.eth_gasPrice}),this.getEstimateGas=s=>this.buildRequest({call:c.eth_estimateGas})([s]),this.setSafeSettings=this.buildRequest({call:c.safe_setSettings})}buildRequest(e){const{call:s,formatters:a}=e;return async n=>{a&&Array.isArray(n)&&a.forEach((l,u)=>{l&&(n[u]=l(n[u]))});const i={call:s,params:n||[]};return(await this.communicator.send(r.rpcCall,i)).data}}}const x="0x1626ba7e",V="0x20c13b0b",p=4001;class d extends Error{constructor(e,s,a){super(e),this.code=s,this.data=a,Object.setPrototypeOf(this,d.prototype)}}class _{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(r.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new d("Permissions request is invalid",p);try{return(await this.communicator.send(r.wallet_requestPermissions,e)).data}catch{throw new d("Permissions rejected",p)}}isPermissionRequestValid(e){return e.every(s=>typeof s=="object"?Object.keys(s).every(a=>!!Object.values(f).includes(a)):!1)}}const b=(t,e)=>e.some(s=>s.parentCapability===t),M=()=>(t,e,s)=>{const a=s.value;return s.value=async function(){const n=new _(this.communicator);let i=await n.getPermissions();if(b(e,i)||(i=await n.requestPermissions([{[e]:{}}])),!b(e,i))throw new d("Permissions rejected",p);return a.apply(this)},s};var j=function(t,e,s,a){var n=arguments.length,i=n<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,s):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,s,a);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(i=(n<3?o(i):n>3?o(e,s,i):o(e,s))||i);return n>3&&i&&Object.defineProperty(e,s,i),i};class T{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(r.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(r.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e="usd"}={}){return(await this.communicator.send(r.getSafeBalances,{currency:e})).data}async check1271Signature(e,s="0x"){const a=await this.getInfo(),n=w({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===x}catch{return!1}}async check1271SignatureBytes(e,s="0x"){const a=await this.getInfo(),n=w({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===V}catch{return!1}}calculateMessageHash(e){return I(e)}calculateTypedMessageHash(e){const s=typeof e.domain.chainId=="object"?e.domain.chainId.toNumber():Number(e.domain.chainId);let a=e.primaryType;if(!a){const n=Object.values(e.types),i=Object.keys(e.types).filter(o=>n.every(l=>l.every(({type:u})=>u.replace("[","").replace("]","")!==o)));if(i.length===0||i.length>1)throw new Error("Please specify primaryType");a=i[0]}return q({message:e.message,domain:{...e.domain,chainId:s,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt},types:e.types,primaryType:a})}async getOffChainSignature(e){return(await this.communicator.send(r.getOffChainSignature,e)).data}async isMessageSigned(e,s="0x"){let a;if(typeof e=="string"&&(a=async()=>{const n=this.calculateMessageHash(e);return await this.isMessageHashSigned(n,s)}),S(e)&&(a=async()=>{const n=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(n,s)}),a)return await a();throw new Error("Invalid message type")}async isMessageHashSigned(e,s="0x"){const a=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const n of a)if(await n(e,s))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(r.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(r.requestAddressBook,void 0)).data}}j([M()],T.prototype,"requestAddressBook",null);class W{constructor(e={}){const{allowedDomains:s=null,debug:a=!1}=e;this.communicator=new H(s,a),this.eth=new O(this.communicator),this.txs=new A(this.communicator),this.safe=new T(this.communicator),this.wallet=new _(this.communicator)}}const $=m.Operation,z=m.TokenType,J=m.TransactionStatus,Q=m.TransferDirection;export{g as MessageFormatter,r as Methods,$ as Operation,c as RPC_CALLS,f as RestrictedMethods,z as TokenType,J as TransactionStatus,Q as TransferDirection,W as default,v as getSDKVersion,S as isObjectEIP712TypedData};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as d,i as p,b as m}from"./lit-element-B3y9oplH.js";import{n as h}from"./class-map-CxwNmq0D.js";import{r as f,v as r}from"./index-
|
|
1
|
+
import{a as d,i as p,b as m}from"./lit-element-B3y9oplH.js";import{n as h}from"./class-map-CxwNmq0D.js";import{r as f,v as r}from"./index-sV0xAzf6.js";import{c as x}from"./index-DuUdctHy.js";const g=d`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
}
|