@dcl/shop 0.1.0-29030398160.commit-dedc8ac → 0.1.0-29111888971.commit-e1b927a
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/{AnimatedBackground-8aI4vJAl.js → AnimatedBackground-XZF9g9Bk.js} +3 -3
- package/assets/{Assets-O86HcPf_.js → Assets-CZPTo1jO.js} +1 -1
- package/assets/{Button-D1faXtxc.js → Button-B2TDtyup.js} +1 -1
- package/assets/{Cart-wT4YY2XB.js → Cart-DhU4_S6H.js} +1 -1
- package/assets/{CircularProgress-ByISsJtD.js → CircularProgress-Cf__730y.js} +1 -1
- package/assets/{Collection-B-SrzrlP.js → Collection-CRBxkkqX.js} +1 -1
- package/assets/{Creator-3SRIb5GI.js → Creator-DO__19RD.js} +1 -1
- package/assets/{ExchangeController-CtvD9TxU.js → ExchangeController-txwSQL2Z.js} +1 -1
- package/assets/{GetCredits-BntbDm9-.js → GetCredits-DS1z5pyp.js} +2 -2
- package/assets/{HelpersUtil-zGctDzqI.js → HelpersUtil-CMysbO5y.js} +1 -1
- package/assets/{ImportListings-DvqpDa-s.js → ImportListings-ChNZ2UwM.js} +1 -1
- package/assets/{ItemDetail-CjSWRE3L.js → ItemDetail-Do5cjFW8.js} +2 -2
- package/assets/{Market-Hqywp2wQ.js → Market-Z4jp-uLb.js} +1 -1
- package/assets/{MenuItem-BzIPsU3-.js → MenuItem-B4U0TYKf.js} +1 -1
- package/assets/{MyAssets-nfsXXyUv.js → MyAssets-C7QdtDYF.js} +1 -1
- package/assets/{MyFavorites-B6_8hr5-.js → MyFavorites-Bu2IDcdJ.js} +1 -1
- package/assets/{MyPurchases-33hyTefC.js → MyPurchases-CDUC3XzQ.js} +1 -1
- package/assets/{NotFound-DXluG5-7.js → NotFound-D5sXjRPf.js} +1 -1
- package/assets/{RealCheckout-tQms6dAo.js → RealCheckout-DBL3uxEj.js} +1 -1
- package/assets/{ShopFooterInner-DV3X__jb.js → ShopFooterInner-BHh4OUAv.js} +2 -2
- package/assets/{Success-BblXOFEG.js → Success-BrvAPmP4.js} +1 -1
- package/assets/{SvgIcon-CVoRZ89M.js → SvgIcon-Cg5l4LDh.js} +1 -1
- package/assets/{SwapController-BEHLqATV.js → SwapController-BDZMxnNb.js} +1 -1
- package/assets/{TradeService-a9BKe-Oz.js → TradeService-CkLYTYcJ.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-HtGM3kiI.js → W3MFrameProviderSingleton-D4DCXtQm.js} +3 -3
- package/assets/{WebCryptoP256-bPjiT7wY.js → WebCryptoP256-OE37a6hF.js} +1 -1
- package/assets/{basic-awR2CJat.js → basic-SUHSB6nZ.js} +1 -1
- package/assets/{biconomy-CBCMLM9k.js → biconomy-C6flCXA4.js} +1 -1
- package/assets/{buy-C8v-ou6b.js → buy-YkuLG1h7.js} +1 -1
- package/assets/{buy-gasless-CUtIigP0.js → buy-gasless-gRmZHjsE.js} +1 -1
- package/assets/{ccip-BMCE_sFa.js → ccip-7fqLW_t2.js} +1 -1
- package/assets/{ccip-DiW7RkRR.js → ccip-ByQiZ_aq.js} +1 -1
- package/assets/{collection-D-oaSVfu.js → collection-2CKCNH2O.js} +1 -1
- package/assets/{controller-CJz3LUjz.js → controller-BO0zre2A.js} +2 -2
- package/assets/{core-CGoVaJvD.js → core-D-mQUZ3X.js} +4 -4
- package/assets/{custom-CLQCvu9h.js → custom-C6VO1Je_.js} +1 -1
- package/assets/{data-capture-C1enk8q3.js → data-capture-DdxbO7dd.js} +1 -1
- package/assets/decimals-ByIlBo-2.js +1 -0
- package/assets/{decimals-C8GSUqDy.js → decimals-Di7mGY-D.js} +1 -1
- package/assets/{detectExtension-Bdev6B_Y.js → detectExtension-DsE82Ej6.js} +1 -1
- package/assets/{email-DI1UmfjV.js → email-BTEyDEk6.js} +1 -1
- package/assets/{embedded-wallet-CUaCp934.js → embedded-wallet-QGoIGdCB.js} +1 -1
- package/assets/{engine-NUwMDIUh.js → engine-Bjifrd8K.js} +1 -1
- package/assets/{estimate-l1-fee-CkQ_-gw6.js → estimate-l1-fee-Bqou6JLl.js} +1 -1
- package/assets/{eth_estimateGas-DaI_qfS7.js → eth_estimateGas-CarYiSgL.js} +1 -1
- package/assets/{eth_getStorageAt-DqNZYObO.js → eth_getStorageAt-B-cqm2CG.js} +1 -1
- package/assets/{eth_getTransactionCount-BBYhaRkF.js → eth_getTransactionCount-Dfx3JW2Q.js} +1 -1
- package/assets/{extractIPFS-COY4B3_o.js → extractIPFS-C5EI4cZz.js} +1 -1
- package/assets/{features-DW4K2ZKu.js → features-U-ULFF0v.js} +1 -1
- package/assets/{fetchTokenMetadata-D4vVc_nQ.js → fetchTokenMetadata-DHc2WWGs.js} +2 -2
- package/assets/{generateUtilityClasses-D15hK3nM.js → generateUtilityClasses-BAjjhm6X.js} +1 -1
- package/assets/{get-ecosystem-wallet-info-QCLNyKk6.js → get-ecosystem-wallet-info-CWcGnKL4.js} +1 -1
- package/assets/{getBalance-CndsdQzG.js → getBalance-C8i1-K0c.js} +1 -1
- package/assets/{getInstalledModules-BZgUgPCr.js → getInstalledModules-BXhbS0To.js} +1 -1
- package/assets/{getNFT-Bw4qn7ry.js → getNFT-CzHwZ4FU.js} +2 -2
- package/assets/{getNFT-BQyw29TQ.js → getNFT-D3XSi6wm.js} +1 -1
- package/assets/{hashTypedData-Er6Ia-O7.js → hashTypedData-BOc0w62Q.js} +1 -1
- package/assets/{hashTypedData-CaO8N883.js → hashTypedData-DX5YrpbP.js} +1 -1
- package/assets/{import-NJqh-zgj.js → import-BulayqYM.js} +1 -1
- package/assets/{in-app-wallet-calls-BDq_Ik7W.js → in-app-wallet-calls-BI0pU06-.js} +1 -1
- package/assets/{index-P5U8LYs6.js → index--_rHc9Od.js} +1 -1
- package/assets/{index-BZIVWDQd.js → index-2NUAW7ds.js} +1 -1
- package/assets/{index-CDAYsxA6.js → index-BF6unOoT.js} +1 -1
- package/assets/{index-Hn-DbSZA.js → index-BKSTjS_b.js} +1 -1
- package/assets/{index-LDSpzB15.js → index-BLQJ40Mi.js} +1 -1
- package/assets/{index-CfKqUBFA.js → index-BNH6Xzon.js} +2 -2
- package/assets/{index-Bo34Cx12.js → index-BOQwd6ZB.js} +1 -1
- package/assets/{index-DwQ4pw8v.js → index-BZ5hUBd_.js} +1 -1
- package/assets/{index-mLXaZKmk.js → index-BaSqmd6J.js} +1 -1
- package/assets/{index-AgzyxgSU.js → index-BlEd83Li.js} +1 -1
- package/assets/{index-BqIdYoG8.js → index-Bo6hVxzu.js} +1 -1
- package/assets/{index-C6QyIhnE.js → index-C2OMQVG4.js} +1 -1
- package/assets/{index-FcUvAZuZ.js → index-C2U9pe20.js} +1 -1
- package/assets/{index-DXfwhNfH.js → index-C6FQ8I_Q.js} +2 -2
- package/assets/{index-Dmfk0azd.js → index-C7-iTfFV.js} +39 -39
- package/assets/{index-CDOPdFEN.js → index-CDMAFM2h.js} +1 -1
- package/assets/{index-zGd0k6zk.js → index-CIPKmOlZ.js} +1 -1
- package/assets/{index-D-VYD1II.js → index-CMavzzI_.js} +1 -1
- package/assets/{index-C1RysQbA.js → index-CbJmVQBN.js} +1 -1
- package/assets/{index-BoZx7TrW.js → index-CcQfGUgB.js} +1 -1
- package/assets/{index-DieH8QTn.js → index-CiIXwK1P.js} +1 -1
- package/assets/{index-DrcFvB51.js → index-CkHNiFzW.js} +1 -1
- package/assets/{index-BexyLNIk.js → index-CkVoCPEe.js} +1 -1
- package/assets/{index-BABCyrjx.js → index-CxyR8sie.js} +1 -1
- package/assets/{index-emGKKyxf.js → index-CzFnbzvY.js} +1 -1
- package/assets/{index-Dav5KOrd.js → index-CzfG6alx.js} +1 -1
- package/assets/{index-BdBYQDrP.js → index-D3hzhbb8.js} +1 -1
- package/assets/{index-PQMQyCqV.js → index-D4VlTBkw.js} +1 -1
- package/assets/{index-BRyy9_FL.js → index-D5qOQwpy.js} +1 -1
- package/assets/{index-BseAcDfV.js → index-DIMSfymy.js} +3 -3
- package/assets/{index-DVQRwKte.js → index-DIw62AgP.js} +1 -1
- package/assets/{index-CCxw-foK.js → index-DJyoXp5I.js} +1 -1
- package/assets/{index-j1oJp18p.js → index-DOTYPGXa.js} +1 -1
- package/assets/{index-Buf412yH.js → index-DQx-sY_c.js} +1 -1
- package/assets/{index-Gr3BFRx7.js → index-DS8DYtub.js} +1 -1
- package/assets/{index-ccNJtibX.js → index-DShBCYos.js} +3 -3
- package/assets/{index-2l5r0dRI.js → index-DV4p99KA.js} +2 -2
- package/assets/{index-KUsuHO11.js → index-DacKA042.js} +1 -1
- package/assets/{index-Ddmzqmxk.js → index-DhBdPYnK.js} +1 -1
- package/assets/{index-CWz8eoAl.js → index-DjPU0-Js.js} +1 -1
- package/assets/{index-CRhrr6gN.js → index-DlllSUoB.js} +1 -1
- package/assets/{index-BEzzzIlC.js → index-DtrBN21c.js} +1 -1
- package/assets/{index-CWHR1ZBn.js → index-Eb-Zd0F2.js} +1 -1
- package/assets/{index-C6xmzvY-.js → index-GAmNssSM.js} +1 -1
- package/assets/{index-CmcvhZsS.js → index-IfYZnKCO.js} +1 -1
- package/assets/{index-FrZezou7.js → index-LSZxonl2.js} +1 -1
- package/assets/{index-CyDCPwX2.js → index-Pp2oEhTr.js} +1 -1
- package/assets/{index-DRm7xERf.js → index-Qzch3HJ1.js} +1 -1
- package/assets/{index-BUaGOTLN.js → index-ULMMROQ0.js} +1 -1
- package/assets/{index-Dm67LTtv.js → index-YfJF6hV4.js} +1 -1
- package/assets/{index-BKg37Q5D.js → index-jYazATJj.js} +1 -1
- package/assets/{index-DJCTaNyE.js → index-kxu93Of2.js} +1 -1
- package/assets/{index-Dq7Rlnvq.js → index-n-cFV5ht.js} +1 -1
- package/assets/{index.es-DZDKrrOX.js → index.es-Dk6KC5kj.js} +1 -1
- package/assets/{index.es-7keraYJG.js → index.es-DnMpNe4m.js} +4 -4
- package/assets/{index.es-C2X55s9j.js → index.es-IGCEipYb.js} +1 -1
- package/assets/{localBatchGatewayRequest-ntoba0Xt.js → localBatchGatewayRequest-BLJAP4fw.js} +1 -1
- package/assets/{mana-rate-D_DTt_S8.js → mana-rate-DkxpKYLQ.js} +1 -1
- package/assets/network-DsCGVBhE.js +1 -0
- package/assets/{networks-DvMCxuQT.js → networks-Bc_Uf_7y.js} +1 -1
- package/assets/{onramp-D4LFsmfg.js → onramp-DnhEoZl6.js} +1 -1
- package/assets/{openzeppelin-CJAun2pO.js → openzeppelin-DwFpqgXP.js} +1 -1
- package/assets/{ownerOf-DrmYf79A.js → ownerOf-Qq7Or7yc.js} +1 -1
- package/assets/{parseNft-Yzo9Plhx.js → parseNft-B-POJxiL.js} +2 -2
- package/assets/{parseSignature-3yq9FfJP.js → parseSignature-ClLI6O4f.js} +3 -3
- package/assets/{parseSignature-h2iJV3NZ.js → parseSignature-kOoafZEo.js} +1 -1
- package/assets/{pay-with-exchange-BWW2tZIp.js → pay-with-exchange-BZR4RMBZ.js} +1 -1
- package/assets/{qr-overlay-hYqgRnm0.js → qr-overlay-9WMDd_PO.js} +1 -1
- package/assets/{receive-BMHwXxqP.js → receive-CtJWuhGM.js} +1 -1
- package/assets/{resolveImplementation-DS1nY4sc.js → resolveImplementation-BJatMhHh.js} +1 -1
- package/assets/{rpc-BC6ESxMB.js → rpc-BA0W82l4.js} +1 -1
- package/assets/{secp256k1-DNCGSF8O.js → secp256k1-B82Rx-TY.js} +1 -1
- package/assets/{secp256k1-BQuyxdaC.js → secp256k1-DFslM7tB.js} +1 -1
- package/assets/{secp256k1-CrZRZ9L5.js → secp256k1-DHqlJ8nk.js} +1 -1
- package/assets/{send-B62L18Hx.js → send-DXVwWcB5.js} +1 -1
- package/assets/{send-batch-transaction-De_pBpa_.js → send-batch-transaction-D1j9aZww.js} +1 -1
- package/assets/{send-eip712-transaction-D-GzcP3o.js → send-eip712-transaction-CrryJAyV.js} +2 -2
- package/assets/{send-gasless-transaction-Iil1KVOe.js → send-gasless-transaction-B7YcLCGg.js} +2 -2
- package/assets/{sendRawTransaction-BqauPPYf.js → sendRawTransaction-DT-ObNx8.js} +3 -3
- package/assets/{serializeTransaction-B4qzULZO.js → serializeTransaction-DawhfTu0.js} +1 -1
- package/assets/{session-proposal-C4Cz1cln.js → session-proposal-lgMupzDT.js} +1 -1
- package/assets/{session-request-De0p90UO.js → session-request-DacijEHD.js} +2 -2
- package/assets/{sha256-bg_KfcLv.js → sha256-BxR-wXll.js} +1 -1
- package/assets/{signing-BGpVago5.js → signing-CoPa7cSW.js} +4 -4
- package/assets/{socials-vOukOtuh.js → socials-CMh8u0Ej.js} +1 -1
- package/assets/{swaps-FEWWVCcs.js → swaps-B0Q00kKq.js} +1 -1
- package/assets/{thirdweb-C8ToELvu.js → thirdweb-9c12J_EF.js} +3 -3
- package/assets/{totalSupply-C5jxuFw1.js → totalSupply-BCZn9Djj.js} +1 -1
- package/assets/{transactionReceipt-CbcThGoC.js → transactionReceipt-C2iQ3ozz.js} +1 -1
- package/assets/{transactions-CaxBviMm.js → transactions-Dqx74UWQ.js} +1 -1
- package/assets/{useInfiniteGrid-BiC1UMEK.js → useInfiniteGrid-DgSsqvQS.js} +1 -1
- package/assets/{verifyHash-JbNzrsYR.js → verifyHash-BVbpPoSf.js} +1 -1
- package/assets/{w3m-modal-BUwENQ4T.js → w3m-modal-CGHylzdj.js} +1 -1
- package/assets/{w3m-modal-BfRGsEzF.js → w3m-modal-DvCL5Oh_.js} +1 -1
- package/assets/{wait-for-tx-receipt-BJDKOLGI.js → wait-for-tx-receipt-Dm2aAIs1.js} +1 -1
- package/assets/{wallet-kind-CuaDlRao.js → wallet-kind-vciDs8sO.js} +1 -1
- package/assets/{wallets-BnBHCJi8.js → wallets-D8labJv_.js} +6 -6
- package/assets/{web-connector-CJKlFm6H.js → web-connector-C9MeCxtf.js} +3 -3
- package/assets/{writeContract-CtBYiULm.js → writeContract-C3IzBPhR.js} +1 -1
- package/assets/{zoraTestnet-CJMxifqR.js → zoraTestnet-CduWQC79.js} +1 -1
- package/index.html +8 -8
- package/package.json +2 -2
- package/assets/decimals-DnNelAv5.js +0 -1
- package/assets/network-CFFySFe9.js +0 -1
|
@@ -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-DlllSUoB.js";import{W as ye,b as Se,c as De}from"./index-DlllSUoB.js";import"./lit-element-B3y9oplH.js";import"./class-map-CxwNmq0D.js";import"./index-DIMSfymy.js";import"./index-C7-iTfFV.js";import"./react-Vu6nbGi5.js";import"./ethers-DHDSyreX.js";import"./W3MFrameProviderSingleton-D4DCXtQm.js";import"./index-CdfeQ7YK.js";import"./index-C6FQ8I_Q.js";import"./browser-ponyfill-rND5WOqr.js";import"./NetworkUtil-Ddexw9-U.js";import"./index-Pp2oEhTr.js";import"./index-nibyPLVP.js";import"./index-jYazATJj.js";import"./index.es-IGCEipYb.js";import"./index-BOQwd6ZB.js";import"./index-BZ5hUBd_.js";import"./index-CbJmVQBN.js";import"./index-YfJF6hV4.js";import"./index--_rHc9Od.js";import"./index-BLQJ40Mi.js";import"./index-CkHNiFzW.js";import"./index-D3hzhbb8.js";import"./index-CzfG6alx.js";import"./index-CMavzzI_.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,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{w as Me,a as We,l as Ie,C as k,o as Le,a5 as ye,F as W,a6 as J,A as x,Z as qe,t as H,O as D,a7 as $e,e as xe,p as De,b as ne,a8 as He,a9 as X,aa as j,L as Fe,a3 as Y,ab as Q,X as be,ac as Be}from"./W3MFrameProviderSingleton-
|
|
3
|
-
`),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=s,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return ke(this,ce,"m",Re).call(this,this,e)}}ce=new WeakSet,Re=function o(e,t){return t!=null&&t(e)?e:e.cause?ke(this,ce,"m",o).call(this,e.cause,t):e};class z extends O{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class ht extends O{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class ft extends O{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class gt extends O{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class mt extends O{constructor({connectionChainId:e,connectorChainId:t}){super(`The current chain of the connector (id: ${t}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Ct extends O{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function ue(o,e){var n;let t;if(typeof e.connector=="function"?t=o._internal.connectors.setup(e.connector):t=e.connector,t.uid===o.state.current)throw new ht;try{o.setState(c=>({...c,status:"connecting"})),t.emitter.emit("message",{type:"connecting"});const{connector:s,...i}=e,u=await t.connect(i);return t.emitter.off("connect",o._internal.events.connect),t.emitter.on("change",o._internal.events.change),t.emitter.on("disconnect",o._internal.events.disconnect),await((n=o.storage)==null?void 0:n.setItem("recentConnectorId",t.id)),o.setState(c=>({...c,connections:new Map(c.connections).set(t.uid,{accounts:i.withCapabilities?u.accounts.map(d=>typeof d=="object"?d.address:d):u.accounts,chainId:u.chainId,connector:t}),current:t.uid,status:"connected"})),{accounts:i.withCapabilities?u.accounts.map(c=>typeof c=="object"?c:{address:c,capabilities:{}}):u.accounts,chainId:u.chainId}}catch(s){throw o.setState(i=>({...i,status:i.current?"connected":"disconnected"})),s}}async function G(o,e={}){const{assertChainId:t=!0}=e;let n;if(e.connector){const{connector:r}=e;if(o.state.status==="reconnecting"&&!r.getAccounts&&!r.getChainId)throw new Ct({connector:r});const[l,g]=await Promise.all([r.getAccounts().catch(f=>{if(e.account===null)return[];throw f}),r.getChainId()]);n={accounts:l,chainId:g,connector:r}}else n=o.state.connections.get(o.state.current);if(!n)throw new ft;const s=e.chainId??n.chainId,i=await n.connector.getChainId();if(t&&i!==s)throw new mt({connectionChainId:s,connectorChainId:i});const u=n.connector;if(u.getClient)return u.getClient({chainId:s});const c=Te(e.account??n.accounts[0]);if(c&&(c.address=q(c.address)),e.account&&!n.accounts.some(r=>r.toLowerCase()===c.address.toLowerCase()))throw new gt({address:c.address,connector:u});const d=o.chains.find(r=>r.id===s),a=await n.connector.getProvider({chainId:s});return Pe({account:c,chain:d,name:"Connector Client",transport:r=>nt(a)({...r,retryCount:0})})}async function ve(o,e={}){var s,i;let t;if(e.connector)t=e.connector;else{const{connections:u,current:c}=o.state,d=u.get(c);t=d==null?void 0:d.connector}const n=o.state.connections;t&&(await t.disconnect(),t.emitter.off("change",o._internal.events.change),t.emitter.off("disconnect",o._internal.events.disconnect),t.emitter.on("connect",o._internal.events.connect),n.delete(t.uid)),o.setState(u=>{if(n.size===0)return{...u,connections:new Map,current:null,status:"disconnected"};const c=n.values().next().value;return{...u,connections:new Map(n),current:c.connector.uid}});{const u=o.state.current;if(!u)return;const c=(s=o.state.connections.get(u))==null?void 0:s.connector;if(!c)return;await((i=o.storage)==null?void 0:i.setItem("recentConnectorId",c.id))}}async function wt(o,e){const{chainId:t,connector:n,...s}=e;let i;e.account?i=e.account:i=(await G(o,{account:e.account,assertChainId:!1,chainId:t,connector:n})).account;const u=o.getClient({chainId:t});return U(u,Xe,"estimateGas")({...s,account:i})}async function pt(o,e){const{address:t,blockNumber:n,blockTag:s,chainId:i}=e,u=o.getClient({chainId:i}),d=await U(u,it,"getBalance")(n?{address:t,blockNumber:n}:{address:t,blockTag:s}),a=o.chains.find(r=>r.id===i)??u.chain;return{decimals:a.nativeCurrency.decimals,symbol:a.nativeCurrency.symbol,value:d}}function V(o,e){if(o===e)return!0;if(o&&e&&typeof o=="object"&&typeof e=="object"){if(o.constructor!==e.constructor)return!1;let t,n;if(Array.isArray(o)&&Array.isArray(e)){if(t=o.length,t!==e.length)return!1;for(n=t;n--!==0;)if(!V(o[n],e[n]))return!1;return!0}if(typeof o.valueOf=="function"&&o.valueOf!==Object.prototype.valueOf)return o.valueOf()===e.valueOf();if(typeof o.toString=="function"&&o.toString!==Object.prototype.toString)return o.toString()===e.toString();const s=Object.keys(o);if(t=s.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!Object.hasOwn(e,s[n]))return!1;for(n=t;n--!==0;){const i=s[n];if(i&&!V(o[i],e[i]))return!1}return!0}return o!==o&&e!==e}function se(o){const e=o.state.current,t=o.state.connections.get(e),n=t==null?void 0:t.accounts,s=n==null?void 0:n[0],i=o.chains.find(c=>c.id===(t==null?void 0:t.chainId)),u=o.state.status;switch(u){case"connected":return{address:s,addresses:n,chain:i,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:u};case"reconnecting":return{address:s,addresses:n,chain:i,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!!s,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:u};case"connecting":return{address:s,addresses:n,chain:i,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:u};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:u}}}let Z=[];function M(o){const e=[...o.state.connections.values()];return o.state.status==="reconnecting"||V(Z,e)?Z:(Z=e,e)}async function It(o,e){const{account:t,chainId:n,connector:s,...i}=e;let u;return typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=o.getClient({chainId:n}):u=await G(o,{account:t??void 0,assertChainId:!1,chainId:n,connector:s}),U(u,Ye,"prepareTransactionRequest")({...i,...t?{account:t}:{}})}let le=!1;async function he(o,e={}){var a,r;if(le)return[];le=!0,o.setState(l=>({...l,status:l.current?"reconnecting":"connecting"}));const t=[];if((a=e.connectors)!=null&&a.length)for(const l of e.connectors){let g;typeof l=="function"?g=o._internal.connectors.setup(l):g=l,t.push(g)}else t.push(...o.connectors);let n;try{n=await((r=o.storage)==null?void 0:r.getItem("recentConnectorId"))}catch{}const s={};for(const[,l]of o.state.connections)s[l.connector.id]=1;n&&(s[n]=0);const i=Object.keys(s).length>0?[...t].sort((l,g)=>(s[l.id]??10)-(s[g.id]??10)):t;let u=!1;const c=[],d=[];for(const l of i){const g=await l.getProvider().catch(()=>{});if(!g||d.some(m=>m===g)||!await l.isAuthorized())continue;const p=await l.connect({isReconnecting:!0}).catch(()=>null);p&&(l.emitter.off("connect",o._internal.events.connect),l.emitter.on("change",o._internal.events.change),l.emitter.on("disconnect",o._internal.events.disconnect),o.setState(m=>{const I=new Map(u?m.connections:new Map).set(l.uid,{accounts:p.accounts,chainId:p.chainId,connector:l});return{...m,current:u?m.current:l.uid,connections:I}}),c.push({accounts:p.accounts,chainId:p.chainId,connector:l}),d.push(g),u=!0)}return(o.state.status==="reconnecting"||o.state.status==="connecting")&&(u?o.setState(l=>({...l,status:"connected"})):o.setState(l=>({...l,connections:new Map,current:null,status:"disconnected"}))),le=!1,c}async function yt(o,e){const{account:t,chainId:n,connector:s,...i}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=o.getClient({chainId:n}):u=await G(o,{account:t??void 0,assertChainId:!1,chainId:n,connector:s});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,at,"sendTransaction")({...i,...t?{account:t}:{},assertChainId:!!n,chain:c,gas:i.gas??void 0})}async function bt(o,e){const{account:t,connector:n,...s}=e;let i;return typeof t=="object"&&t.type==="local"?i=o.getClient():i=await G(o,{account:t,connector:n}),U(i,ut,"signMessage")({...s,...t?{account:t}:{}})}class L extends O{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class vt extends O{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function Ae(o,e){var u;const{addEthereumChainParameter:t,chainId:n}=e,s=o.state.connections.get(((u=e.connector)==null?void 0:u.uid)??o.state.current);if(s){const c=s.connector;if(!c.switchChain)throw new vt({connector:c});return await c.switchChain({addEthereumChainParameter:t,chainId:n})}const i=o.chains.find(c=>c.id===n);if(!i)throw new z;return o.setState(c=>({...c,chainId:n})),i}async function At(o,e){const{chainId:t,timeout:n=0,...s}=e,i=o.getClient({chainId:t}),c=await U(i,st,"waitForTransactionReceipt")({...s,timeout:n});if(c.status==="reverted"){const d=U(i,ot,"getTransaction"),{from:a,...r}=await d({hash:c.transactionHash}),g=await U(i,Qe,"call")({...r,account:a,data:r.input,gasPrice:r.type!=="eip1559"?r.gasPrice:void 0,maxFeePerGas:r.type==="eip1559"?r.maxFeePerGas:void 0,maxPriorityFeePerGas:r.type==="eip1559"?r.maxPriorityFeePerGas:void 0}),f=g!=null&&g.data?Ge(`0x${g.data.substring(138)}`):"unknown reason";throw new Error(f)}return{...c,chainId:i.chain.id}}function Nt(o,e){const{onChange:t}=e;return o.subscribe(()=>se(o),t,{equalityFn(n,s){const{connector:i,...u}=n,{connector:c,...d}=s;return V(u,d)&&(i==null?void 0:i.id)===(c==null?void 0:c.id)&&(i==null?void 0:i.uid)===(c==null?void 0:c.uid)}})}function Et(o,e){const{onChange:t}=e;return o.subscribe(()=>M(o),t,{equalityFn:V})}function St(o,e){const{onChange:t}=e;return o._internal.connectors.subscribe((n,s)=>{t(Object.values(n),s)})}function _t(o,e){const{syncConnectedChain:t=o._internal.syncConnectedChain,...n}=e;let s;const i=d=>{s&&s();const a=o.getClient({chainId:d});return s=U(a,rt,"watchPendingTransactions")(n),s},u=i(e.chainId);let c;return t&&!e.chainId&&(c=o.subscribe(({chainId:d})=>d,async d=>i(d))),()=>{u==null||u(),c==null||c()}}async function Tt(o,e){const{account:t,chainId:n,connector:s,...i}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=o.getClient({chainId:n}):u=await G(o,{account:t??void 0,assertChainId:!1,chainId:n,connector:s});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,dt,"writeContract")({...i,...t?{account:t}:{},assertChainId:!!n,chain:c})}function an(o){return o}ae.type="injected";function ae(o={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:t}=o;function n(){const d=o.target;if(typeof d=="function"){const a=d();if(a)return a}return typeof d=="object"?d:typeof d=="string"?{...Pt[d]??{id:d,name:`${d[0].toUpperCase()}${d.slice(1)}`,provider:`is${d[0].toUpperCase()}${d.slice(1)}`}}:{id:"injected",name:"Injected",provider(a){return a==null?void 0:a.ethereum}}}let s,i,u,c;return d=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},type:ae.type,async setup(){const a=await this.getProvider();a!=null&&a.on&&o.target&&(u||(u=this.onConnect.bind(this),a.on("connect",u)),s||(s=this.onAccountsChanged.bind(this),a.on("accountsChanged",s)))},async connect({chainId:a,isReconnecting:r,withCapabilities:l}={}){var p,m,I,v,y,E;const g=await this.getProvider();if(!g)throw new L;let f=[];if(r)f=await this.getAccounts().catch(()=>[]);else if(e)try{f=(v=(I=(m=(p=(await g.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:p.caveats)==null?void 0:m[0])==null?void 0:I.value)==null?void 0:v.map(h=>q(h)),f.length>0&&(f=await this.getAccounts())}catch(N){const h=N;if(h.code===_.code)throw new _(h);if(h.code===de.code)throw h}try{!(f!=null&&f.length)&&!r&&(f=(await g.request({method:"eth_requestAccounts"})).map(C=>q(C))),u&&(g.removeListener("connect",u),u=void 0),s||(s=this.onAccountsChanged.bind(this),g.on("accountsChanged",s)),i||(i=this.onChainChanged.bind(this),g.on("chainChanged",i)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c));let N=await this.getChainId();if(a&&N!==a){const h=await this.switchChain({chainId:a}).catch(C=>{if(C.code===_.code)throw C;return{id:N}});N=(h==null?void 0:h.id)??N}return e&&await((y=d.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),o.target||await((E=d.storage)==null?void 0:E.setItem("injected.connected",!0)),{accounts:l?f.map(h=>({address:h,capabilities:{}})):f,chainId:N}}catch(N){const h=N;throw h.code===_.code?new _(h):h.code===de.code?new de(h):h}},async disconnect(){var r,l;const a=await this.getProvider();if(!a)throw new L;i&&(a.removeListener("chainChanged",i),i=void 0),c&&(a.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),a.on("connect",u));try{await We(()=>a.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((r=d.storage)==null?void 0:r.setItem(`${this.id}.disconnected`,!0)),o.target||await((l=d.storage)==null?void 0:l.removeItem("injected.connected"))},async getAccounts(){const a=await this.getProvider();if(!a)throw new L;return(await a.request({method:"eth_accounts"})).map(l=>q(l))},async getChainId(){const a=await this.getProvider();if(!a)throw new L;const r=await a.request({method:"eth_chainId"});return Number(r)},async getProvider(){if(typeof window>"u")return;let a;const r=n();return typeof r.provider=="function"?a=r.provider(window):typeof r.provider=="string"?a=oe(window,r.provider):a=r.provider,a&&!a.removeListener&&("off"in a&&typeof a.off=="function"?a.removeListener=a.off:a.removeListener=()=>{}),a},async isAuthorized(){var a,r;try{if(e&&await((a=d.storage)==null?void 0:a.getItem(`${this.id}.disconnected`))||!o.target&&!await((r=d.storage)==null?void 0:r.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(t!==void 0&&t!==!1){const p=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",p),!!await this.getProvider()),m=typeof t=="number"?t:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(v=>window.addEventListener("ethereum#initialized",()=>v(p()),{once:!0}))]:[],new Promise(v=>setTimeout(()=>v(p()),m))]))return!0}throw new L}return!!(await Me(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:a,chainId:r}){var p,m,I,v;const l=await this.getProvider();if(!l)throw new L;const g=d.chains.find(y=>y.id===r);if(!g)throw new B(new z);const f=new Promise(y=>{const E=(N=>{"chainId"in N&&N.chainId===r&&(d.emitter.off("change",E),y())});d.emitter.on("change",E)});try{return await Promise.all([l.request({method:"wallet_switchEthereumChain",params:[{chainId:re(r)}]}).then(async()=>{await this.getChainId()===r&&d.emitter.emit("change",{chainId:r})}),f]),g}catch(y){const E=y;if(E.code===4902||((m=(p=E==null?void 0:E.data)==null?void 0:p.originalError)==null?void 0:m.code)===4902)try{const{default:N,...h}=g.blockExplorers??{};let C;a!=null&&a.blockExplorerUrls?C=a.blockExplorerUrls:N&&(C=[N.url,...Object.values(h).map(b=>b.url)]);let w;(I=a==null?void 0:a.rpcUrls)!=null&&I.length?w=a.rpcUrls:w=[((v=g.rpcUrls.default)==null?void 0:v.http[0])??""];const A={blockExplorerUrls:C,chainId:re(r),chainName:(a==null?void 0:a.chainName)??g.name,iconUrls:a==null?void 0:a.iconUrls,nativeCurrency:(a==null?void 0:a.nativeCurrency)??g.nativeCurrency,rpcUrls:w};return await Promise.all([l.request({method:"wallet_addEthereumChain",params:[A]}).then(async()=>{if(await this.getChainId()===r)d.emitter.emit("change",{chainId:r});else throw new _(new Error("User rejected switch after adding network."))}),f]),g}catch(N){throw new _(N)}throw E.code===_.code?new _(E):new B(E)}},async onAccountsChanged(a){var r;if(a.length===0)this.onDisconnect();else if(d.emitter.listenerCount("connect")){const l=(await this.getChainId()).toString();this.onConnect({chainId:l}),e&&await((r=d.storage)==null?void 0:r.removeItem(`${this.id}.disconnected`))}else d.emitter.emit("change",{accounts:a.map(l=>q(l))})},onChainChanged(a){const r=Number(a);d.emitter.emit("change",{chainId:r})},async onConnect(a){const r=await this.getAccounts();if(r.length===0)return;const l=Number(a.chainId);d.emitter.emit("connect",{accounts:r,chainId:l});const g=await this.getProvider();g&&(u&&(g.removeListener("connect",u),u=void 0),s||(s=this.onAccountsChanged.bind(this),g.on("accountsChanged",s)),i||(i=this.onChainChanged.bind(this),g.on("chainChanged",i)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c)))},async onDisconnect(a){const r=await this.getProvider();a&&a.code===1013&&r&&(await this.getAccounts()).length||(d.emitter.emit("disconnect"),r&&(i&&(r.removeListener("chainChanged",i),i=void 0),c&&(r.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),r.on("connect",u))))}})}const Pt={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(o){return o!=null&&o.coinbaseWalletExtension?o.coinbaseWalletExtension:oe(o,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(o){return oe(o,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const t=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const n of t)if(e[n])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(o){var e,t;return(e=o==null?void 0:o.phantom)!=null&&e.ethereum?(t=o.phantom)==null?void 0:t.ethereum:oe(o,"isPhantom")}}};function oe(o,e){function t(s){return typeof e=="function"?e(s):typeof e=="string"?s[e]:!0}const n=o.ethereum;if(n!=null&&n.providers)return n.providers.find(s=>t(s));if(n&&t(n))return n}const kt=o=>(e,t,n)=>{const s=n.subscribe;return n.subscribe=(u,c,d)=>{let a=u;if(c){const r=(d==null?void 0:d.equalityFn)||Object.is;let l=u(n.getState());a=g=>{const f=u(g);if(!r(l,f)){const p=l;c(l=f,p)}},d!=null&&d.fireImmediately&&c(l,l)}return s(a)},o(e,t,n)},Rt=kt;function Ot(o,e){let t;try{t=o()}catch{return}return{getItem:s=>{var i;const u=d=>d===null?null:JSON.parse(d,void 0),c=(i=t.getItem(s))!=null?i:null;return c instanceof Promise?c.then(u):u(c)},setItem:(s,i)=>t.setItem(s,JSON.stringify(i,void 0)),removeItem:s=>t.removeItem(s)}}const me=o=>e=>{try{const t=o(e);return t instanceof Promise?t:{then(n){return me(n)(t)},catch(n){return this}}}catch(t){return{then(n){return this},catch(n){return me(n)(t)}}}},Ut=(o,e)=>(t,n,s)=>{let i={storage:Ot(()=>localStorage),partialize:m=>m,version:0,merge:(m,I)=>({...I,...m}),...e},u=!1;const c=new Set,d=new Set;let a=i.storage;if(!a)return o((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),t(...m)},n,s);const r=()=>{const m=i.partialize({...n()});return a.setItem(i.name,{state:m,version:i.version})},l=s.setState;s.setState=(m,I)=>{l(m,I),r()};const g=o((...m)=>{t(...m),r()},n,s);s.getInitialState=()=>g;let f;const p=()=>{var m,I;if(!a)return;u=!1,c.forEach(y=>{var E;return y((E=n())!=null?E:g)});const v=((I=i.onRehydrateStorage)==null?void 0:I.call(i,(m=n())!=null?m:g))||void 0;return me(a.getItem.bind(a))(i.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==i.version){if(i.migrate)return[!0,i.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var E;const[N,h]=y;if(f=i.merge(h,(E=n())!=null?E:g),t(f,!0),N)return r()}).then(()=>{v==null||v(f,void 0),f=n(),u=!0,d.forEach(y=>y(f))}).catch(y=>{v==null||v(void 0,y)})};return s.persist={setOptions:m=>{i={...i,...m},m.storage&&(a=m.storage)},clearStorage:()=>{a==null||a.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>p(),hasHydrated:()=>u,onHydrate:m=>(c.add(m),()=>{c.delete(m)}),onFinishHydration:m=>(d.add(m),()=>{d.delete(m)})},i.skipHydration||p(),f||g},jt=Ut,Ne=o=>{let e;const t=new Set,n=(a,r)=>{const l=typeof a=="function"?a(e):a;if(!Object.is(l,e)){const g=e;e=r??(typeof l!="object"||l===null)?l:Object.assign({},e,l),t.forEach(f=>f(e,g))}},s=()=>e,c={setState:n,getState:s,getInitialState:()=>d,subscribe:a=>(t.add(a),()=>t.delete(a))},d=e=o(n,s,c);return c},fe=o=>o?Ne(o):Ne;class Mt{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new et})}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,...t){const n=t[0];this._emitter.emit(e,{uid:this.uid,...n})}listenerCount(e){return this._emitter.listenerCount(e)}}function Wt(o){return new Mt(o)}function Lt(o,e){return JSON.parse(o,(t,n)=>{let s=n;return(s==null?void 0:s.__type)==="bigint"&&(s=BigInt(s.value)),(s==null?void 0:s.__type)==="Map"&&(s=new Map(s.value)),(e==null?void 0:e(t,s))??s})}function Ee(o,e){return o.slice(0,e).join(".")||"."}function Se(o,e){const{length:t}=o;for(let n=0;n<t;++n)if(o[n]===e)return n+1;return 0}function qt(o,e){const t=typeof o=="function",n=typeof e=="function",s=[],i=[];return function(c,d){if(typeof d=="object")if(s.length){const a=Se(s,this);a===0?s[s.length]=this:(s.splice(a),i.splice(a)),i[i.length]=c;const r=Se(s,d);if(r!==0)return n?e.call(this,c,d,Ee(i,r)):`[ref=${Ee(i,r)}]`}else s[0]=d,i[0]=c;return t?o.call(this,c,d):d}}function $t(o,e,t,n){return JSON.stringify(o,qt((s,i)=>{let u=i;return typeof u=="bigint"&&(u={__type:"bigint",value:i.toString()}),u instanceof Map&&(u={__type:"Map",value:Array.from(i.entries())}),(e==null?void 0:e(s,u))??u},n),t??void 0)}function xt(o){const{deserialize:e=Lt,key:t="wagmi",serialize:n=$t,storage:s=Oe}=o;function i(u){return u instanceof Promise?u.then(c=>c).catch(()=>null):u}return{...s,key:t,async getItem(u,c){const d=s.getItem(`${t}.${u}`),a=await i(d);return a?e(a)??null:c??null},async setItem(u,c){const d=`${t}.${u}`;c===null?await i(s.removeItem(d)):await i(s.setItem(d,n(c)))},async removeItem(u){await i(s.removeItem(`${t}.${u}`))}}}const Oe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function Dt(){const o=typeof window<"u"&&window.localStorage?window.localStorage:Oe;return{getItem(e){return o.getItem(e)},removeItem(e){o.removeItem(e)},setItem(e,t){try{o.setItem(e,t)}catch{}}}}const Ce=256;let ee=Ce,te;function Ht(o=11){if(!te||ee+o>Ce*2){te="",ee=0;for(let e=0;e<Ce;e++)te+=(256+Math.random()*256|0).toString(16).substring(1)}return te.substring(ee,ee+++o)}function Ft(o){const{multiInjectedProviderDiscovery:e=!0,storage:t=xt({storage:Dt()}),syncConnectedChain:n=!0,ssr:s=!1,...i}=o,u=typeof window<"u"&&e?tt():void 0,c=fe(()=>i.chains),d=fe(()=>{const h=[],C=new Set;for(const w of i.connectors??[]){const A=a(w);if(h.push(A),!s&&A.rdns){const b=typeof A.rdns=="string"?[A.rdns]:A.rdns;for(const T of b)C.add(T)}}if(!s&&u){const w=u.getProviders();for(const A of w)C.has(A.info.rdns)||h.push(a(r(A)))}return h});function a(h){var b;const C=Wt(Ht());let w;const A={...h({emitter:C,chains:c.getState(),get providers(){if(!u||!w)return[];const T=typeof w=="string"?[w]:w,R=u.getProviders();return T.flatMap(K=>R.filter(P=>P.info.rdns===K))},storage:t,transports:i.transports}),emitter:C,uid:C.uid};return w=A.rdns,C.on("connect",E),(b=A.setup)==null||b.call(A),A}function r(h){const{info:C}=h,w=h.provider;return ae({target:{...C,id:C.rdns,provider:w}})}const l=new Map;function g(h={}){const C=h.chainId??I.getState().chainId,w=c.getState().find(b=>b.id===C);if(h.chainId&&!w)throw new z;{const b=l.get(I.getState().chainId);if(b&&!w)return b;if(!w)throw new z}{const b=l.get(C);if(b)return b}let A;if(i.client)A=i.client({chain:w});else{const b=w.id,T=c.getState().map(P=>P.id),R={},K=Object.entries(i);for(const[P,$]of K)if(!(P==="chains"||P==="client"||P==="connectors"||P==="transports"))if(typeof $=="object")if(b in $)R[P]=$[b];else{if(T.some(je=>je in $))continue;R[P]=$}else R[P]=$;A=Pe({...R,chain:w,batch:R.batch??{multicall:!0},transport:P=>i.transports[b]({...P,connectors:d})})}return l.set(C,A),A}function f(){return{chainId:c.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let p;const m="0.0.0-canary-";ie.startsWith(m)?p=Number.parseInt(ie.replace(m,""),10):p=Number.parseInt(ie.split(".")[0]??"0",10);const I=fe(Rt(t?jt(f,{migrate(h,C){if(C===p)return h;const w=f(),A=v(h,w.chainId);return{...w,chainId:A}},name:"store",partialize(h){return{connections:{__type:"Map",value:Array.from(h.connections.entries()).map(([C,w])=>{const{id:A,name:b,type:T,uid:R}=w.connector;return[C,{...w,connector:{id:A,name:b,type:T,uid:R}}]})},chainId:h.chainId,current:h.current}},merge(h,C){typeof h=="object"&&h&&"status"in h&&delete h.status;const w=v(h,C.chainId);return{...C,...h,chainId:w}},skipHydration:s,storage:t,version:p}):f));I.setState(f());function v(h,C){return h&&typeof h=="object"&&"chainId"in h&&typeof h.chainId=="number"&&c.getState().some(w=>w.id===h.chainId)?h.chainId:C}n&&I.subscribe(({connections:h,current:C})=>{var w;return C?(w=h.get(C))==null?void 0:w.chainId:void 0},h=>{if(c.getState().some(w=>w.id===h))return I.setState(w=>({...w,chainId:h??w.chainId}))}),u==null||u.subscribe(h=>{const C=new Set,w=new Set;for(const b of d.getState())if(C.add(b.id),b.rdns){const T=typeof b.rdns=="string"?[b.rdns]:b.rdns;for(const R of T)w.add(R)}const A=[];for(const b of h){if(w.has(b.info.rdns))continue;const T=a(r(b));C.has(T.id)||A.push(T)}t&&!I.persist.hasHydrated()||d.setState(b=>[...b,...A],!0)});function y(h){I.setState(C=>{const w=C.connections.get(h.uid);return w?{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts??w.accounts,chainId:h.chainId??w.chainId,connector:w.connector})}:C})}function E(h){I.getState().status==="connecting"||I.getState().status==="reconnecting"||I.setState(C=>{const w=d.getState().find(A=>A.uid===h.uid);return w?(w.emitter.listenerCount("connect")&&w.emitter.off("connect",y),w.emitter.listenerCount("change")||w.emitter.on("change",y),w.emitter.listenerCount("disconnect")||w.emitter.on("disconnect",N),{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts,chainId:h.chainId,connector:w}),current:h.uid,status:"connected"}):C})}function N(h){I.setState(C=>{const w=C.connections.get(h.uid);if(w){const b=w.connector;b.emitter.listenerCount("change")&&w.connector.emitter.off("change",y),b.emitter.listenerCount("disconnect")&&w.connector.emitter.off("disconnect",N),b.emitter.listenerCount("connect")||w.connector.emitter.on("connect",E)}if(C.connections.delete(h.uid),C.connections.size===0)return{...C,connections:new Map,current:null,status:"disconnected"};const A=C.connections.values().next().value;return{...C,connections:new Map(C.connections),current:A.connector.uid}})}return{get chains(){return c.getState()},get connectors(){return d.getState()},storage:t,getClient:g,get state(){return I.getState()},setState(h){let C;typeof h=="function"?C=h(I.getState()):C=h;const w=f();typeof C!="object"&&(C=w),Object.keys(w).some(b=>!(b in C))&&(C=w),I.setState(C,!0)},subscribe(h,C,w){return I.subscribe(h,C,w?{...w,fireImmediately:w.emitImmediately}:void 0)},_internal:{mipd:u,async revalidate(){const h=I.getState(),C=h.connections;let w=h.current;for(const[,A]of C){const b=A.connector;b.isAuthorized&&await b.isAuthorized()||(C.delete(b.uid),w===b.uid&&(w=null))}I.setState(A=>({...A,connections:C,current:w}))},store:I,ssr:!!s,syncConnectedChain:n,transports:i.transports,chains:{setState(h){const C=typeof h=="function"?h(c.getState()):h;if(C.length!==0)return c.setState(C,!0)},subscribe(h){return c.subscribe(h)}},connectors:{providerDetailToConnector:r,setup:a,setState(h){return d.setState(typeof h=="function"?h(d.getState()):h,!0)},subscribe(h){return d.subscribe(h)}},events:{change:y,connect:E,disconnect:N}}}}function Ue(o){let e=[],t,n;function s(c){var r,l;const d=k.getCaipNetworks(S.CHAIN.EVM);let a=Number(ge.parseEvmChainId(c));if(!d.some(g=>String(g.id)===String(c))){const g=((r=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:r.id)||((l=d[0])==null?void 0:l.id);g&&Number.isInteger(Number(g))&&(a=Number(g))}if(!a)throw new Error("ChainId not found in networks");return a}function i(){var c;return t||(t=ye.getInstance({projectId:o.options.projectId,chainId:(c=J())==null?void 0:c.caipNetworkId,enableLogger:o.options.enableAuthLogger,onTimeout:d=>{d==="iframe_load_failed"?x.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):d==="iframe_request_timeout"?x.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):d==="unverified_domain"&&x.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},abortController:W.EmbeddedWalletAbortController,getActiveCaipNetwork:d=>J(d),getCaipNetworks:d=>k.getCaipNetworks(d)})),t}async function u(c={}){var m;const d=i();let a=c.chainId;if(c.isReconnecting){const I=ge.parseEvmChainId(d.getLastUsedChainId()||""),v=(m=o.chains)==null?void 0:m[0].id;if(a=I||v,!a)throw new Error("ChainId not found in provider")}const r=Ie("eip155"),{address:l,chainId:g,accounts:f}=await qe.authConnectorAuthenticate({authConnector:d,chainId:a,preferredAccountType:r,socialUri:c.socialUri,chainNamespace:S.CHAIN.EVM});e=(f==null?void 0:f.map(I=>I.address))||[l];const p=s(g);return{accounts:e,account:l,chainId:p,chain:{id:p,unsupported:!1}}}return c=>({id:S.CONNECTOR_ID.AUTH,name:S.CONNECTOR_NAMES.AUTH,type:"AUTH",chain:S.CHAIN.EVM,async connect(d={}){if(n){const r=await n;return{accounts:d.withCapabilities?r.accounts.map(l=>({address:l,capabilities:{}})):r.accounts,chainId:r.chainId}}n||(n=new Promise(r=>{r(u(d))}));const a=await n;return n=void 0,{accounts:d.withCapabilities?a.accounts.map(r=>({address:r,capabilities:{}})):a.accounts,chainId:a.chainId}},async disconnect(){await(await this.getProvider()).disconnect()},getAccounts(){return e!=null&&e.length?(c.emitter.emit("change",{accounts:e}),Promise.resolve(e)):Promise.resolve([])},async getProvider(){var d;return this.provider||(this.provider=ye.getInstance({projectId:o.options.projectId,chainId:(d=J())==null?void 0:d.caipNetworkId,enableLogger:o.options.enableAuthLogger,abortController:W.EmbeddedWalletAbortController,onTimeout:a=>{a==="iframe_load_failed"?x.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):a==="iframe_request_timeout"?x.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):a==="unverified_domain"&&x.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:a=>J(a),getCaipNetworks:a=>k.getCaipNetworks(a)})),Promise.resolve(this.provider)},async getChainId(){const d=await this.getProvider(),{chainId:a}=await d.getChainId();return s(a)},async isAuthorized(){const a=k.state.activeChain===S.CHAIN.EVM;if(S.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(g=>Le.getConnectorId(g)===S.CONNECTOR_ID.AUTH)&&!a)return!1;const l=await this.getProvider();return Promise.resolve(l.getLoginEmailUsed())},async switchChain({chainId:d}){var a;try{const r=c.chains.find(p=>p.id===d);if(!r)throw new B(new Error("chain not found on connector."));const l=await this.getProvider(),g=Ie("eip155"),f=await l.connect({chainId:d,preferredAccountType:g});return e=((a=f==null?void 0:f.accounts)==null?void 0:a.map(p=>p.address))||[f.address],c.emitter.emit("change",{chainId:Number(d),accounts:e}),r}catch(r){throw r instanceof Error?new B(r):r}},onAccountsChanged(d){d.length===0?this.onDisconnect():c.emitter.emit("change",{accounts:d.map(q)})},onChainChanged(d){const a=Number(d);c.emitter.emit("change",{chainId:a})},async onDisconnect(d){await(await this.getProvider()).disconnect()}})}pe.type="walletConnect";function pe(o){const e=o.isNewChainsStale??!0;let t,n,s,i,u,c,d;return a=>({id:"walletConnect",name:"WalletConnect",type:pe.type,provider:o.universalProvider,async setup(){const r=await this.getProvider().catch(()=>null);r&&(i||(i=this.onConnect.bind(this),r.on("connect",i)),c||(c=this.onSessionDelete.bind(this),r.on("session_delete",c)))},async connect({...r}={}){var l,g,f;try{const p=k.getCaipNetworks(),m=await this.getProvider();if(!m)throw new L;u||(u=this.onDisplayUri,m.on("display_uri",u));const I=await this.isChainsStale();m.session&&I&&await m.disconnect();const v=D.state.universalProviderConfigOverride;if(!m.session||I){const A=$e.createNamespaces(p,v);await m.connect({optionalNamespaces:A,..."pairingTopic"in r?{pairingTopic:r.pairingTopic}:{}}),this.setRequestedChainsIds(p.map(b=>Number(b.id)))}const y=await this.getAccounts(),E=await this.getChainId(),N=(f=(g=(l=m.session)==null?void 0:l.namespaces)==null?void 0:g.eip155)==null?void 0:f.chains,h=N==null?void 0:N.some(A=>Number(A.split(":")[1])===E);let C=1;h?C=E:N!=null&&N[0]&&(C=Number(N[0].split(":")[1])),u&&(m.removeListener("display_uri",u),u=void 0),i&&(m.removeListener("connect",i),i=void 0),n||(n=this.onAccountsChanged.bind(this),m.on("accountsChanged",n)),s||(s=this.onChainChanged.bind(this),m.on("chainChanged",s)),d||(d=this.onDisconnect.bind(this),m.on("disconnect",d)),c||(c=this.onSessionDelete.bind(this),m.on("session_delete",c));const w=v==null?void 0:v.defaultChain;return m.setDefaultChain(w??`eip155:${C}`),{accounts:y,chainId:C}}catch(p){throw/(user rejected|connection request reset)/i.test(p==null?void 0:p.message)?new _(p):p}},async disconnect(){const r=await this.getProvider();try{await(r==null?void 0:r.disconnect())}catch(l){if(!/No matching key/i.test(l.message))throw l}finally{s&&(r==null||r.removeListener("chainChanged",s),s=void 0),d&&(r==null||r.removeListener("disconnect",d),d=void 0),i||(i=this.onConnect.bind(this),r==null||r.on("connect",i)),n&&(r==null||r.removeListener("accountsChanged",n),n=void 0),c&&(r==null||r.removeListener("session_delete",c),c=void 0),this.setRequestedChainsIds([])}},async getAccounts(){var m,I,v;const r=await this.getProvider();if(!((m=r==null?void 0:r.session)!=null&&m.namespaces))return[];const l=(v=(I=r==null?void 0:r.session)==null?void 0:I.namespaces[S.CHAIN.EVM])==null?void 0:v.accounts,g=(l==null?void 0:l.map(y=>y.split(":")[2]))??[],f=new Set;return g.filter(y=>{const E=y==null?void 0:y.toLowerCase();return f.has(E)?!1:(f.add(E),!0)})},async getProvider({chainId:r}={}){var f,p;t||(t=o.universalProvider,t==null||t.events.setMaxListeners(Number.POSITIVE_INFINITY));const l=H.getActiveNamespace(),g=(f=k.getActiveCaipNetwork())==null?void 0:f.id;if(r&&g!==r&&l){const m=H.getStoredActiveCaipNetworkId(),I=l?k.getCaipNetworks(l):[],v=I==null?void 0:I.find(y=>y.id===m);v&&v.chainNamespace===S.CHAIN.EVM&&await((p=this.switchChain)==null?void 0:p.call(this,{chainId:Number(v.id)}))}return t},async getChainId(){var p,m,I,v;const r=(p=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:p.id;if(r)return r;const g=(v=(I=(m=(await this.getProvider()).session)==null?void 0:m.namespaces[S.CHAIN.EVM])==null?void 0:I.chains)==null?void 0:v[0],f=k.getCaipNetworks().find(y=>y.id===g);return f==null?void 0:f.id},async isAuthorized(){try{const[r,l]=await Promise.all([this.getAccounts(),this.getProvider()]);return r.length?await this.isChainsStale()&&l.session?(await l.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:r,chainId:l}){var p,m,I,v;const g=await this.getProvider();if(!g)throw new L;const f=k.getCaipNetworks().find(y=>y.id===l);if(!f)throw new B(new z);try{await g.request({method:"wallet_switchEthereumChain",params:[{chainId:re(l)}]}),f!=null&&f.caipNetworkId&&g.setDefaultChain(f==null?void 0:f.caipNetworkId),a.emitter.emit("change",{chainId:Number(l)});const y=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...y,l]),{...f,id:f.id}}catch(y){const E=y;if(/(?:user rejected)/iu.test(E.message))throw new _(E);try{let N;r!=null&&r.blockExplorerUrls?N=r.blockExplorerUrls:N=(p=f.blockExplorers)!=null&&p.default.url?[(m=f.blockExplorers)==null?void 0:m.default.url]:[];const h=((v=(I=f.rpcUrls)==null?void 0:I.chainDefault)==null?void 0:v.http)||[],C={blockExplorerUrls:N,chainId:re(l),chainName:f.name,iconUrls:r==null?void 0:r.iconUrls,nativeCurrency:f.nativeCurrency,rpcUrls:h};await g.request({method:"wallet_addEthereumChain",params:[C]});const w=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...w,l]),{...f,id:f.id}}catch(N){throw new _(N)}}},onAccountsChanged(r){r.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:r.map(l=>q(l))})},onChainChanged(r){const l=Number(r);a.emitter.emit("change",{chainId:l})},onConnect(r){this.setRequestedChainsIds(k.getCaipNetworks().map(l=>Number(l.id)))},async onDisconnect(r){this.setRequestedChainsIds([]),a.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),s&&(l.removeListener("chainChanged",s),s=void 0),d&&(l.removeListener("disconnect",d),d=void 0),c&&(l.removeListener("session_delete",c),c=void 0),i||(i=this.onConnect.bind(this),l.on("connect",i))},onDisplayUri(r){a.emitter.emit("message",{type:"display_uri",data:r})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var g,f,p;if(!((g=t==null?void 0:t.session)!=null&&g.namespaces))return[];const r=(p=(f=t==null?void 0:t.session)==null?void 0:f.namespaces[S.CHAIN.EVM])==null?void 0:p.accounts;return(r==null?void 0:r.map(m=>Number.parseInt(m.split(":")[1]??"")))??[]},async getRequestedChainsIds(){var l;const r=await((l=a.storage)==null?void 0:l.getItem(this.requestedChainsStorageKey))??[];return[...new Set(r)]},async isChainsStale(){if(!e)return!1;const r=a.chains.map(f=>f.id),l=this.getNamespaceChainsIds();if(l.length&&!l.some(f=>r.includes(f)))return!1;const g=await this.getRequestedChainsIds();return!r.every(f=>g.includes(Number(f)))},async setRequestedChainsIds(r){var l;await((l=a.storage)==null?void 0:l.setItem(this.requestedChainsStorageKey,r))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}const F=De({pendingTransactions:0}),_e={state:F,subscribeKey(o,e){return xe(F,o,e)},increase(o){F[o]+=1},decrease(o){F[o]-=1},reset(o){F[o]=0}};async function Bt(o){if(ne.isSafeApp()){const{safe:e}=await we(async()=>{const{safe:t}=await import("./index-2l5r0dRI.js");return{safe:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));if(e&&!o.some(t=>t.type==="safe"))return e()}return null}async function zt(o){try{const{baseAccount:e}=await we(async()=>{const{baseAccount:t}=await import("./index-2l5r0dRI.js");return{baseAccount:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));if(e&&!o.some(t=>t.id==="baseAccount"))return e()}catch(e){console.error("Failed to import Base Account SDK:",e)}return null}async function Vt(o){try{const{coinbaseWallet:e}=await we(async()=>{const{coinbaseWallet:t}=await import("./index-2l5r0dRI.js");return{coinbaseWallet:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));if(e&&!o.some(t=>t.id==="coinbaseWallet"))return e()}catch(e){console.error("Failed to import Coinbase Wallet SDK:",e)}return null}const Gt={enable:!1,pollingInterval:3e4};class Kt extends He{constructor(e){const t=X.extendCaipNetworks(e.networks,{projectId:e.projectId,customNetworkImageUrls:{},customRpcUrls:e.customRpcUrls});super(),this.balancePromises={},this.namespace=S.CHAIN.EVM,this.adapterType=S.ADAPTER_TYPES.WAGMI,this.projectId=e.projectId,this.pendingTransactionsFilter={...Gt,...e.pendingTransactionsFilter??{}},this.createConfig({...e,networks:t}),this.checkChainId()}construct(e){this.checkChainId(),this.setupWatchers()}async getAccounts(e){const t=this.getWagmiConnector(e.id);if(!t)return{accounts:[]};if(t.id===S.CONNECTOR_ID.AUTH){const u=await t.getProvider();if(!(u!=null&&u.user))return{accounts:[]};const{address:c,accounts:d,chainId:a}=u.user;return Promise.resolve({accounts:(d||[{address:c,type:"eoa"}]).map(r=>ne.createAccount({caipAddress:`eip155:${a}:${r.address}`,type:r.type}))})}const{addresses:n,address:s,chainId:i}=se(this.wagmiConfig);return Promise.resolve({accounts:i?[...new Set(n||[s])].map(u=>ne.createAccount({caipAddress:`eip155:${i}:${u||""}`,type:"eoa"})):[]})}checkChainId(){const{chainId:e}=se(this.wagmiConfig);e&&this.emit("switchNetwork",{chainId:e})}getWagmiConnector(e){return this.wagmiConfig.connectors.find(t=>t.id===e)}createConfig(e){this.wagmiChains=e.networks.filter(s=>s.chainNamespace===S.CHAIN.EVM);const t={},n=[...e.connectors??[]];this.wagmiChains.forEach(s=>{var c,d;const i=(c=e.transports)==null?void 0:c[s.id],u=X.getCaipNetworkId(s);i?t[s.id]=X.extendWagmiTransports(s,e.projectId,i):t[s.id]=X.getViemTransport(s,e.projectId,(d=e.customRpcUrls)==null?void 0:d[u])}),this.wagmiConfig=Ft({...e,chains:this.wagmiChains,connectors:n,transports:t})}setupWatchPendingTransactions(){if(!this.pendingTransactionsFilter.enable||this.unwatchPendingTransactions)return;this.unwatchPendingTransactions=_t(this.wagmiConfig,{pollingInterval:this.pendingTransactionsFilter.pollingInterval,onError:()=>{},onTransactions:()=>{this.emit("pendingTransactions"),_e.increase("pendingTransactions")}});const e=_e.subscribeKey("pendingTransactions",t=>{var n;t>=S.LIMITS.PENDING_TRANSACTIONS&&((n=this.unwatchPendingTransactions)==null||n.call(this),e())})}setupWatchers(){Et(this.wagmiConfig,{onChange:e=>{this.clearConnections(),this.addConnection(...e.map(t=>{const n=this.getCaipNetworks().find(i=>i.id===t.chainId),s=t.connector.id===S.CONNECTOR_ID.AUTH;return{accounts:t.accounts.map(i=>({address:this.toChecksummedAddress(i)})),caipNetwork:n,connectorId:t.connector.id,auth:s?{name:H.getConnectedSocialProvider(),username:H.getConnectedSocialUsername()}:void 0}}))}}),Nt(this.wagmiConfig,{onChange:(e,t)=>{var n;if(e.status==="disconnected"&&t.address&&this.emit("disconnect"),e!=null&&e.chainId&&(e==null?void 0:e.chainId)!==(t==null?void 0:t.chainId)&&this.emit("switchNetwork",{chainId:e.chainId}),e.status==="connected"){const s=e.address!==(t==null?void 0:t.address),i=e.connector.id!==((n=t.connector)==null?void 0:n.id),u=t.status!=="connected";(s||i||u)&&(this.setupWatchPendingTransactions(),this.handleAccountChanged({address:e.address,chainId:e.chainId,connector:e.connector}))}}})}async addThirdPartyConnectors(){const e=[],{enableCoinbase:t,enableBaseAccount:n}=D.state||{};if(n!==!1){const i=await zt(this.wagmiConfig.connectors);i&&e.push(i)}if(t!==!1){const i=await Vt(this.wagmiConfig.connectors);i&&e.push(i)}const s=await Bt(this.wagmiConfig.connectors);s&&e.push(s),await Promise.all(e.map(i=>{const u=this.configureInternalConnector(i);return this.addWagmiConnector(u)}))}addWagmiConnectors(){const e=[];D.state.enableInjected!==!1&&e.push(ae({shimDisconnect:!0}));const{features:t,remoteFeatures:n,projectId:s,enableAuthLogger:i}=D.state,u=(n==null?void 0:n.email)??(t==null?void 0:t.email)??!0,c=(n==null?void 0:n.socials)??(t==null?void 0:t.socials),d=Array.isArray(c)&&(c==null?void 0:c.length)>0;(u||d)&&e.push(Ue({chains:this.wagmiChains,options:{projectId:s,enableAuthLogger:i}})),e.forEach(a=>{this.configureInternalConnector(a)})}configureInternalConnector(e){const t=this.wagmiConfig._internal.connectors.setup(e);return this.wagmiConfig._internal.connectors.setState(n=>[...n,t]),t}async handleAccountChanged({address:e,chainId:t,connector:n}){if(!this.namespace)throw new Error("WagmiAdapter:handleAccountChanged - namespace is required");const s=await n.getProvider().catch(()=>{});this.emit("accountChanged",{address:this.toChecksummedAddress(e),chainId:t,connector:{id:n.id,name:j.ConnectorNamesMap[n.id]??n.name,imageId:j.ConnectorImageIds[n.id],type:j.ConnectorTypesMap[n.type]??"EXTERNAL",info:n.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:n.id},provider:s,chain:this.namespace,chains:[]}})}async writeSolanaTransaction(){return Promise.resolve({hash:""})}async signMessage(e){try{return{signature:await bt(this.wagmiConfig,{message:e.message,account:e.address})}}catch{throw new Error("WagmiAdapter:signMessage - Sign message failed")}}async sendTransaction(e){var c;const{chainId:t,address:n}=se(this.wagmiConfig),s=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===t),i={account:n,to:e.to,value:Number.isNaN(Number(e.value))?BigInt(0):BigInt(e.value),gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,data:e.data,chain:s,type:"legacy",parameters:["nonce"]};await It(this.wagmiConfig,i);const u=await yt(this.wagmiConfig,i);return await At(this.wagmiConfig,{hash:u,timeout:25e3}),{hash:u}}async writeContract(e){var c;const{caipNetwork:t,...n}=e,s=Number(ge.caipNetworkIdToNumber(t.caipNetworkId)),i=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===s);return{hash:await Tt(this.wagmiConfig,{chain:i,address:n.tokenAddress,account:n.fromAddress,abi:n.abi,functionName:n.method,args:n.args,__mode:"prepared"})}}async estimateGas(e){try{return{gas:await wt(this.wagmiConfig,{account:e.address,to:e.to,data:e.data,type:"legacy"})}}catch{throw new Error("WagmiAdapter:estimateGas - error estimating gas")}}parseUnits(e){return ct(e.value,e.decimals)}formatUnits(e){return Ke(e.value,e.decimals)}async addWagmiConnector(e){if(!this.namespace)throw new Error("WagmiAdapter:addWagmiConnector - namespace is required");const{enableEIP6963:t,enableInjected:n}=D.state||{},s=e.type===S.CONNECTOR_ID.INJECTED,i=e.id===S.CONNECTOR_ID.INJECTED,u=s&&!i;if(i&&n===!1||u&&t===!1||e.id===S.CONNECTOR_ID.AUTH||e.id===S.CONNECTOR_ID.WALLET_CONNECT)return;let c;e.id!==S.CONNECTOR_ID.BASE_ACCOUNT&&(c=await e.getProvider().catch(()=>{}));const d=Fe.state.connectorImages;this.addConnector({id:e.id,explorerId:j.ConnectorExplorerIds[e.id]??j.ConnectorExplorerIds[e.name],imageUrl:(d==null?void 0:d[e.id])??e.icon,name:j.ConnectorNamesMap[e.id]??e.name,imageId:j.ConnectorImageIds[e.id],type:j.ConnectorTypesMap[e.type]??"EXTERNAL",info:e.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:e.id},provider:c,chain:this.namespace,chains:[]})}async syncConnectors(){St(this.wagmiConfig,{onChange:e=>{e.forEach(t=>this.addWagmiConnector(t))}}),this.addWagmiConnectors(),await Promise.all(this.wagmiConfig.connectors.map(e=>this.addWagmiConnector(e))),await this.addThirdPartyConnectors()}async syncConnections(){const e=this.connectors.filter(t=>{const{hasDisconnected:n,hasConnected:s}=Y.getConnectorStorageInfo(t.id,this.namespace);return!n&&s}).map(t=>this.getWagmiConnector(t.id)).filter(Boolean);await he(this.wagmiConfig,{connectors:e})}async syncConnection(e){var a,r;const{id:t,chainId:n}=e,i=M(this.wagmiConfig).find(l=>l.connector.id===t),u=this.getWagmiConnector(t),c=await(u==null?void 0:u.getProvider());if(ne.isSafeApp()&&t===S.CONNECTOR_ID.SAFE&&!(i!=null&&i.accounts.length)){const l=this.getWagmiConnector("safe");if(l){const g=await ue(this.wagmiConfig,{connector:l,chainId:Number(n)}),f=await l.getProvider();return{chainId:Number(n),address:this.toChecksummedAddress(g.accounts[0]),provider:f,type:(a=i==null?void 0:i.connector.type)==null?void 0:a.toUpperCase(),id:i==null?void 0:i.connector.id}}}return{chainId:Number(i==null?void 0:i.chainId),address:this.toChecksummedAddress(i==null?void 0:i.accounts[0]),provider:c,type:(r=i==null?void 0:i.connector.type)==null?void 0:r.toUpperCase(),id:i==null?void 0:i.connector.id}}async connectWalletConnect(e){try{const t=this.getWalletConnectConnector();await t.authenticate();const n=this.getWagmiConnector("walletConnect");if(!n)throw new Error("UniversalAdapter:connectWalletConnect - connector not found");const s=await ue(this.wagmiConfig,{connector:n,chainId:e?Number(e):void 0});return s.chainId!==Number(e)&&await Ae(this.wagmiConfig,{chainId:s.chainId}),{clientId:await t.provider.client.core.crypto.getClientId()}}catch(t){throw t instanceof _?new Q(t):be.isUserRejectedRequestError(t)?new Q(t):t}}async connect(e){var t,n,s,i,u;try{const{id:c,address:d,provider:a,type:r,info:l,chainId:g,socialUri:f}=e,p=this.getWagmiConnector(c);if(!p)throw new Error("connectionControllerClient:connectExternal - connector is undefined");a&&l&&p.id===S.CONNECTOR_ID.EIP6963&&((t=p.setEip6963Wallet)==null||t.call(p,{provider:a,info:l}));const m=(s=(n=this.wagmiConfig.state)==null?void 0:n.connections)==null?void 0:s.get(p.uid);if(m){await((i=this.wagmiConfig.storage)==null?void 0:i.setItem("recentConnectorId",p.id));const y=[...m.accounts].sort((E,N)=>Y.isLowerCaseMatch(E,d)?-1:Y.isLowerCaseMatch(N,d)?1:0);return(u=this.wagmiConfig)==null||u.setState(E=>({...E,connections:new Map(E.connections).set(p.uid,{accounts:y,chainId:m.chainId,connector:m.connector}),current:p.uid,status:"connected"})),{address:this.toChecksummedAddress(y[0]),chainId:m.chainId,provider:a,type:r,id:c}}const I=await ue(this.wagmiConfig,{connector:p,chainId:g?Number(g):void 0,socialUri:f}),v=a??await p.getProvider();return{address:this.toChecksummedAddress(I.accounts[0]),chainId:I.chainId,provider:v,type:r,id:c}}catch(c){throw c instanceof _?new Q(c):be.isUserRejectedRequestError(c)?new Q(c):c}}get connections(){return Array.from(this.wagmiConfig.state.connections.values()).map(e=>({accounts:e.accounts.map(t=>({address:this.toChecksummedAddress(t)})),connectorId:e.connector.id}))}async reconnect(e){const{id:t}=e,n=this.getWagmiConnector(t);if(!n)throw new Error("connectionControllerClient:connectExternal - connector is undefined");await he(this.wagmiConfig,{connectors:[n]})}async getBalance(e){const t=e.address,n=this.getCaipNetworks().find(s=>s.id===e.chainId);if(!t)return Promise.resolve({balance:"0.00",symbol:"ETH"});if(n&&this.wagmiConfig){const s=`${n.caipNetworkId}:${e.address}`,i=this.balancePromises[s];if(i)return i;const u=H.getNativeBalanceCacheForCaipAddress(s);return u?{balance:u.balance,symbol:u.symbol}:(this.balancePromises[s]=new Promise(async c=>{var d,a;try{const r=Number(e.chainId),l=await pt(this.wagmiConfig,{address:e.address,chainId:r,token:(a=(d=e.tokens)==null?void 0:d[n.caipNetworkId])==null?void 0:a.address});H.updateNativeBalanceCache({caipAddress:s,balance:l.formatted,symbol:l.symbol,timestamp:Date.now()}),c({balance:l.formatted,symbol:l.symbol})}catch(r){console.warn("Appkit:WagmiAdapter:getBalance - Error getting balance",r),c({balance:"0.00",symbol:"ETH"})}}).finally(()=>{delete this.balancePromises[s]}),this.balancePromises[s]||{balance:"0.00",symbol:"ETH"})}return{balance:"",symbol:""}}getWalletConnectProvider(){var e;return(e=this.getWagmiConnector("walletConnect"))==null?void 0:e.provider}async disconnect(e){if(e.id){const t=this.getWagmiConnector(e.id),s=M(this.wagmiConfig).find(i=>Y.isLowerCaseMatch(i.connector.id,e.id));return await ve(this.wagmiConfig,{connector:t}),D.state.enableReconnect===!1&&this.deleteConnection(e.id),s?{connections:[{accounts:s.accounts.map(i=>({address:this.toChecksummedAddress(i)})),connectorId:s.connector.id}]}:{connections:[]}}return this.disconnectAll()}async disconnectAll(){const e=M(this.wagmiConfig),t=await Promise.allSettled(e.map(async n=>{const s=this.getWagmiConnector(n.connector.id);return s&&await ve(this.wagmiConfig,{connector:s}),n}));return this.wagmiConfig.state.connections.clear(),{connections:t.filter(n=>n.status==="fulfilled").map(({value:n})=>({accounts:n.accounts.map(s=>({address:this.toChecksummedAddress(s)})),connectorId:n.connector.id}))}}async switchNetwork(e){var f,p,m,I,v;const{caipNetwork:t}=e,n=this.wagmiConfig.chains.find(y=>y.id.toString()===t.id.toString());if(!n)throw new Error("connectionControllerClient:switchNetwork - wagmiChain is undefined");const{name:s,nativeCurrency:i,rpcUrls:u,blockExplorers:c,id:d}=n,a=((m=(p=(f=t.rpcUrls)==null?void 0:f.chainDefault)==null?void 0:p.http)==null?void 0:m[0])??u.default.http[0]??"",r=(c==null?void 0:c.default.url)??((v=(I=t.blockExplorers)==null?void 0:I.default)==null?void 0:v.url)??"",l=i??t.nativeCurrency,g=s??t.name;await Ae(this.wagmiConfig,{chainId:d,addEthereumChainParameter:{chainName:g,nativeCurrency:l,rpcUrls:[a],blockExplorerUrls:[r]}}),await super.switchNetwork(e)}async getCapabilities(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:getCapabilities - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:getCapabilities - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:getCapabilities - provider is undefined");return await i.request({method:"wallet_getCapabilities",params:[e]})}async grantPermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:grantPermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:grantPermissions - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:grantPermissions - provider is undefined");return i.request({method:"wallet_grantPermissions",params:e})}async revokePermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:revokePermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:revokePermissions - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:revokePermissions - provider is undefined");return i.request({method:"wallet_revokePermissions",params:e})}async walletGetAssets(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:walletGetAssets - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:walletGetAssets - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:walletGetAssets - provider is undefined");return i.request({method:"wallet_getAssets",params:[e]})}setAuthProvider(e){if(!this.namespace)throw new Error("WagmiAdapter:setAuthProvider - namespace is required");this.addConnector({id:S.CONNECTOR_ID.AUTH,type:"AUTH",name:S.CONNECTOR_NAMES.AUTH,provider:e,imageId:j.ConnectorImageIds[S.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}async setUniversalProvider(e){e.on("connect",()=>{const n=M(this.wagmiConfig),s=this.getWagmiConnector("walletConnect");if(s&&!n.find(i=>i.connector.id===s.id)){if(k.state.activeChain==="eip155")return;he(this.wagmiConfig,{connectors:[s]})}});const t=pe({universalProvider:e});return this.configureInternalConnector(t),this.addConnector(new Be({provider:e,caipNetworks:this.getCaipNetworks(),namespace:"eip155"})),Promise.resolve()}toChecksummedAddress(e){if(!e)return e;try{return Ze(e.toLowerCase())}catch{return e}}}const dn=Object.freeze(Object.defineProperty({__proto__:null,WagmiAdapter:Kt,authConnector:Ue},Symbol.toStringTag,{value:"Module"}));export{z as C,L as P,ft as a,dn as b,an as c,ae as i};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DV4p99KA.js","assets/index-C7-iTfFV.js","assets/react-Vu6nbGi5.js","assets/ethers-DHDSyreX.js","assets/index-DCrqkiFN.css","assets/sendRawTransaction-DT-ObNx8.js","assets/NetworkUtil-Ddexw9-U.js","assets/W3MFrameProviderSingleton-D4DCXtQm.js","assets/index-CdfeQ7YK.js","assets/index-C6FQ8I_Q.js","assets/browser-ponyfill-rND5WOqr.js","assets/custom-C6VO1Je_.js","assets/index-CQB-2hib.js","assets/index-COjgItKg.js","assets/store-CraP4F4Y.js","assets/writeContract-C3IzBPhR.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{w as Me,a as We,l as Ie,C as k,o as Le,a5 as ye,F as W,a6 as J,A as x,Z as qe,t as H,O as D,a7 as $e,e as xe,p as De,b as ne,a8 as He,a9 as X,aa as j,L as Fe,a3 as Y,ab as Q,X as be,ac as Be}from"./W3MFrameProviderSingleton-D4DCXtQm.js";import{al as ze,ao as Ve,ab as Ge,x as B,af as re,Y as _,r as de,au as S,az as ge,a4 as Ke}from"./NetworkUtil-Ddexw9-U.js";import{b7 as Je,bh as Te,aI as q,cv as Xe,bc as Ye,bi as Qe,ah as Ze}from"./sendRawTransaction-DT-ObNx8.js";import{_ as we}from"./index-C7-iTfFV.js";import"./index-CdfeQ7YK.js";import"./index-C6FQ8I_Q.js";import"./browser-ponyfill-rND5WOqr.js";import{E as et}from"./index-CQB-2hib.js";import{c as tt}from"./store-CraP4F4Y.js";import{c as Pe,a as nt,g as it,b as st,d as ot,e as rt,p as ct}from"./custom-C6VO1Je_.js";import{s as at,w as dt}from"./writeContract-C3IzBPhR.js";async function ut(o,{account:e=o.account,message:t}){if(!e)throw new Je({docsPath:"/docs/actions/wallet/signMessage"});const n=Te(e);if(n.signMessage)return n.signMessage({message:t});const s=typeof t=="string"?ze(t):t.raw instanceof Uint8Array?Ve(t.raw):t.raw;return o.request({method:"personal_sign",params:[s,n.address]},{retryCount:0})}function U(o,e,t){const n=o[e.name];if(typeof n=="function")return n;const s=o[t];return typeof s=="function"?s:i=>e(o,i)}const ie="3.5.5",lt=()=>`@wagmi/core@${ie}`;var ke=function(o,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?o!==e||!n:!e.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(o):n?n.value:e.get(o)},ce,Re;class O extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return lt()}constructor(e,t={}){var i;super(),ce.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const n=t.cause instanceof O?t.cause.details:(i=t.cause)!=null&&i.message?t.cause.message:t.details,s=t.cause instanceof O&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${this.docsBaseUrl}${s}.html${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(`
|
|
3
|
+
`),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=s,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return ke(this,ce,"m",Re).call(this,this,e)}}ce=new WeakSet,Re=function o(e,t){return t!=null&&t(e)?e:e.cause?ke(this,ce,"m",o).call(this,e.cause,t):e};class z extends O{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class ht extends O{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class ft extends O{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class gt extends O{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class mt extends O{constructor({connectionChainId:e,connectorChainId:t}){super(`The current chain of the connector (id: ${t}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Ct extends O{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function ue(o,e){var n;let t;if(typeof e.connector=="function"?t=o._internal.connectors.setup(e.connector):t=e.connector,t.uid===o.state.current)throw new ht;try{o.setState(c=>({...c,status:"connecting"})),t.emitter.emit("message",{type:"connecting"});const{connector:s,...i}=e,u=await t.connect(i);return t.emitter.off("connect",o._internal.events.connect),t.emitter.on("change",o._internal.events.change),t.emitter.on("disconnect",o._internal.events.disconnect),await((n=o.storage)==null?void 0:n.setItem("recentConnectorId",t.id)),o.setState(c=>({...c,connections:new Map(c.connections).set(t.uid,{accounts:i.withCapabilities?u.accounts.map(d=>typeof d=="object"?d.address:d):u.accounts,chainId:u.chainId,connector:t}),current:t.uid,status:"connected"})),{accounts:i.withCapabilities?u.accounts.map(c=>typeof c=="object"?c:{address:c,capabilities:{}}):u.accounts,chainId:u.chainId}}catch(s){throw o.setState(i=>({...i,status:i.current?"connected":"disconnected"})),s}}async function G(o,e={}){const{assertChainId:t=!0}=e;let n;if(e.connector){const{connector:r}=e;if(o.state.status==="reconnecting"&&!r.getAccounts&&!r.getChainId)throw new Ct({connector:r});const[l,g]=await Promise.all([r.getAccounts().catch(f=>{if(e.account===null)return[];throw f}),r.getChainId()]);n={accounts:l,chainId:g,connector:r}}else n=o.state.connections.get(o.state.current);if(!n)throw new ft;const s=e.chainId??n.chainId,i=await n.connector.getChainId();if(t&&i!==s)throw new mt({connectionChainId:s,connectorChainId:i});const u=n.connector;if(u.getClient)return u.getClient({chainId:s});const c=Te(e.account??n.accounts[0]);if(c&&(c.address=q(c.address)),e.account&&!n.accounts.some(r=>r.toLowerCase()===c.address.toLowerCase()))throw new gt({address:c.address,connector:u});const d=o.chains.find(r=>r.id===s),a=await n.connector.getProvider({chainId:s});return Pe({account:c,chain:d,name:"Connector Client",transport:r=>nt(a)({...r,retryCount:0})})}async function ve(o,e={}){var s,i;let t;if(e.connector)t=e.connector;else{const{connections:u,current:c}=o.state,d=u.get(c);t=d==null?void 0:d.connector}const n=o.state.connections;t&&(await t.disconnect(),t.emitter.off("change",o._internal.events.change),t.emitter.off("disconnect",o._internal.events.disconnect),t.emitter.on("connect",o._internal.events.connect),n.delete(t.uid)),o.setState(u=>{if(n.size===0)return{...u,connections:new Map,current:null,status:"disconnected"};const c=n.values().next().value;return{...u,connections:new Map(n),current:c.connector.uid}});{const u=o.state.current;if(!u)return;const c=(s=o.state.connections.get(u))==null?void 0:s.connector;if(!c)return;await((i=o.storage)==null?void 0:i.setItem("recentConnectorId",c.id))}}async function wt(o,e){const{chainId:t,connector:n,...s}=e;let i;e.account?i=e.account:i=(await G(o,{account:e.account,assertChainId:!1,chainId:t,connector:n})).account;const u=o.getClient({chainId:t});return U(u,Xe,"estimateGas")({...s,account:i})}async function pt(o,e){const{address:t,blockNumber:n,blockTag:s,chainId:i}=e,u=o.getClient({chainId:i}),d=await U(u,it,"getBalance")(n?{address:t,blockNumber:n}:{address:t,blockTag:s}),a=o.chains.find(r=>r.id===i)??u.chain;return{decimals:a.nativeCurrency.decimals,symbol:a.nativeCurrency.symbol,value:d}}function V(o,e){if(o===e)return!0;if(o&&e&&typeof o=="object"&&typeof e=="object"){if(o.constructor!==e.constructor)return!1;let t,n;if(Array.isArray(o)&&Array.isArray(e)){if(t=o.length,t!==e.length)return!1;for(n=t;n--!==0;)if(!V(o[n],e[n]))return!1;return!0}if(typeof o.valueOf=="function"&&o.valueOf!==Object.prototype.valueOf)return o.valueOf()===e.valueOf();if(typeof o.toString=="function"&&o.toString!==Object.prototype.toString)return o.toString()===e.toString();const s=Object.keys(o);if(t=s.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!Object.hasOwn(e,s[n]))return!1;for(n=t;n--!==0;){const i=s[n];if(i&&!V(o[i],e[i]))return!1}return!0}return o!==o&&e!==e}function se(o){const e=o.state.current,t=o.state.connections.get(e),n=t==null?void 0:t.accounts,s=n==null?void 0:n[0],i=o.chains.find(c=>c.id===(t==null?void 0:t.chainId)),u=o.state.status;switch(u){case"connected":return{address:s,addresses:n,chain:i,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:u};case"reconnecting":return{address:s,addresses:n,chain:i,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!!s,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:u};case"connecting":return{address:s,addresses:n,chain:i,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:u};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:u}}}let Z=[];function M(o){const e=[...o.state.connections.values()];return o.state.status==="reconnecting"||V(Z,e)?Z:(Z=e,e)}async function It(o,e){const{account:t,chainId:n,connector:s,...i}=e;let u;return typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=o.getClient({chainId:n}):u=await G(o,{account:t??void 0,assertChainId:!1,chainId:n,connector:s}),U(u,Ye,"prepareTransactionRequest")({...i,...t?{account:t}:{}})}let le=!1;async function he(o,e={}){var a,r;if(le)return[];le=!0,o.setState(l=>({...l,status:l.current?"reconnecting":"connecting"}));const t=[];if((a=e.connectors)!=null&&a.length)for(const l of e.connectors){let g;typeof l=="function"?g=o._internal.connectors.setup(l):g=l,t.push(g)}else t.push(...o.connectors);let n;try{n=await((r=o.storage)==null?void 0:r.getItem("recentConnectorId"))}catch{}const s={};for(const[,l]of o.state.connections)s[l.connector.id]=1;n&&(s[n]=0);const i=Object.keys(s).length>0?[...t].sort((l,g)=>(s[l.id]??10)-(s[g.id]??10)):t;let u=!1;const c=[],d=[];for(const l of i){const g=await l.getProvider().catch(()=>{});if(!g||d.some(m=>m===g)||!await l.isAuthorized())continue;const p=await l.connect({isReconnecting:!0}).catch(()=>null);p&&(l.emitter.off("connect",o._internal.events.connect),l.emitter.on("change",o._internal.events.change),l.emitter.on("disconnect",o._internal.events.disconnect),o.setState(m=>{const I=new Map(u?m.connections:new Map).set(l.uid,{accounts:p.accounts,chainId:p.chainId,connector:l});return{...m,current:u?m.current:l.uid,connections:I}}),c.push({accounts:p.accounts,chainId:p.chainId,connector:l}),d.push(g),u=!0)}return(o.state.status==="reconnecting"||o.state.status==="connecting")&&(u?o.setState(l=>({...l,status:"connected"})):o.setState(l=>({...l,connections:new Map,current:null,status:"disconnected"}))),le=!1,c}async function yt(o,e){const{account:t,chainId:n,connector:s,...i}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=o.getClient({chainId:n}):u=await G(o,{account:t??void 0,assertChainId:!1,chainId:n,connector:s});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,at,"sendTransaction")({...i,...t?{account:t}:{},assertChainId:!!n,chain:c,gas:i.gas??void 0})}async function bt(o,e){const{account:t,connector:n,...s}=e;let i;return typeof t=="object"&&t.type==="local"?i=o.getClient():i=await G(o,{account:t,connector:n}),U(i,ut,"signMessage")({...s,...t?{account:t}:{}})}class L extends O{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class vt extends O{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function Ae(o,e){var u;const{addEthereumChainParameter:t,chainId:n}=e,s=o.state.connections.get(((u=e.connector)==null?void 0:u.uid)??o.state.current);if(s){const c=s.connector;if(!c.switchChain)throw new vt({connector:c});return await c.switchChain({addEthereumChainParameter:t,chainId:n})}const i=o.chains.find(c=>c.id===n);if(!i)throw new z;return o.setState(c=>({...c,chainId:n})),i}async function At(o,e){const{chainId:t,timeout:n=0,...s}=e,i=o.getClient({chainId:t}),c=await U(i,st,"waitForTransactionReceipt")({...s,timeout:n});if(c.status==="reverted"){const d=U(i,ot,"getTransaction"),{from:a,...r}=await d({hash:c.transactionHash}),g=await U(i,Qe,"call")({...r,account:a,data:r.input,gasPrice:r.type!=="eip1559"?r.gasPrice:void 0,maxFeePerGas:r.type==="eip1559"?r.maxFeePerGas:void 0,maxPriorityFeePerGas:r.type==="eip1559"?r.maxPriorityFeePerGas:void 0}),f=g!=null&&g.data?Ge(`0x${g.data.substring(138)}`):"unknown reason";throw new Error(f)}return{...c,chainId:i.chain.id}}function Nt(o,e){const{onChange:t}=e;return o.subscribe(()=>se(o),t,{equalityFn(n,s){const{connector:i,...u}=n,{connector:c,...d}=s;return V(u,d)&&(i==null?void 0:i.id)===(c==null?void 0:c.id)&&(i==null?void 0:i.uid)===(c==null?void 0:c.uid)}})}function Et(o,e){const{onChange:t}=e;return o.subscribe(()=>M(o),t,{equalityFn:V})}function St(o,e){const{onChange:t}=e;return o._internal.connectors.subscribe((n,s)=>{t(Object.values(n),s)})}function _t(o,e){const{syncConnectedChain:t=o._internal.syncConnectedChain,...n}=e;let s;const i=d=>{s&&s();const a=o.getClient({chainId:d});return s=U(a,rt,"watchPendingTransactions")(n),s},u=i(e.chainId);let c;return t&&!e.chainId&&(c=o.subscribe(({chainId:d})=>d,async d=>i(d))),()=>{u==null||u(),c==null||c()}}async function Tt(o,e){const{account:t,chainId:n,connector:s,...i}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=o.getClient({chainId:n}):u=await G(o,{account:t??void 0,assertChainId:!1,chainId:n,connector:s});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,dt,"writeContract")({...i,...t?{account:t}:{},assertChainId:!!n,chain:c})}function an(o){return o}ae.type="injected";function ae(o={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:t}=o;function n(){const d=o.target;if(typeof d=="function"){const a=d();if(a)return a}return typeof d=="object"?d:typeof d=="string"?{...Pt[d]??{id:d,name:`${d[0].toUpperCase()}${d.slice(1)}`,provider:`is${d[0].toUpperCase()}${d.slice(1)}`}}:{id:"injected",name:"Injected",provider(a){return a==null?void 0:a.ethereum}}}let s,i,u,c;return d=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},type:ae.type,async setup(){const a=await this.getProvider();a!=null&&a.on&&o.target&&(u||(u=this.onConnect.bind(this),a.on("connect",u)),s||(s=this.onAccountsChanged.bind(this),a.on("accountsChanged",s)))},async connect({chainId:a,isReconnecting:r,withCapabilities:l}={}){var p,m,I,v,y,E;const g=await this.getProvider();if(!g)throw new L;let f=[];if(r)f=await this.getAccounts().catch(()=>[]);else if(e)try{f=(v=(I=(m=(p=(await g.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:p.caveats)==null?void 0:m[0])==null?void 0:I.value)==null?void 0:v.map(h=>q(h)),f.length>0&&(f=await this.getAccounts())}catch(N){const h=N;if(h.code===_.code)throw new _(h);if(h.code===de.code)throw h}try{!(f!=null&&f.length)&&!r&&(f=(await g.request({method:"eth_requestAccounts"})).map(C=>q(C))),u&&(g.removeListener("connect",u),u=void 0),s||(s=this.onAccountsChanged.bind(this),g.on("accountsChanged",s)),i||(i=this.onChainChanged.bind(this),g.on("chainChanged",i)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c));let N=await this.getChainId();if(a&&N!==a){const h=await this.switchChain({chainId:a}).catch(C=>{if(C.code===_.code)throw C;return{id:N}});N=(h==null?void 0:h.id)??N}return e&&await((y=d.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),o.target||await((E=d.storage)==null?void 0:E.setItem("injected.connected",!0)),{accounts:l?f.map(h=>({address:h,capabilities:{}})):f,chainId:N}}catch(N){const h=N;throw h.code===_.code?new _(h):h.code===de.code?new de(h):h}},async disconnect(){var r,l;const a=await this.getProvider();if(!a)throw new L;i&&(a.removeListener("chainChanged",i),i=void 0),c&&(a.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),a.on("connect",u));try{await We(()=>a.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((r=d.storage)==null?void 0:r.setItem(`${this.id}.disconnected`,!0)),o.target||await((l=d.storage)==null?void 0:l.removeItem("injected.connected"))},async getAccounts(){const a=await this.getProvider();if(!a)throw new L;return(await a.request({method:"eth_accounts"})).map(l=>q(l))},async getChainId(){const a=await this.getProvider();if(!a)throw new L;const r=await a.request({method:"eth_chainId"});return Number(r)},async getProvider(){if(typeof window>"u")return;let a;const r=n();return typeof r.provider=="function"?a=r.provider(window):typeof r.provider=="string"?a=oe(window,r.provider):a=r.provider,a&&!a.removeListener&&("off"in a&&typeof a.off=="function"?a.removeListener=a.off:a.removeListener=()=>{}),a},async isAuthorized(){var a,r;try{if(e&&await((a=d.storage)==null?void 0:a.getItem(`${this.id}.disconnected`))||!o.target&&!await((r=d.storage)==null?void 0:r.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(t!==void 0&&t!==!1){const p=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",p),!!await this.getProvider()),m=typeof t=="number"?t:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(v=>window.addEventListener("ethereum#initialized",()=>v(p()),{once:!0}))]:[],new Promise(v=>setTimeout(()=>v(p()),m))]))return!0}throw new L}return!!(await Me(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:a,chainId:r}){var p,m,I,v;const l=await this.getProvider();if(!l)throw new L;const g=d.chains.find(y=>y.id===r);if(!g)throw new B(new z);const f=new Promise(y=>{const E=(N=>{"chainId"in N&&N.chainId===r&&(d.emitter.off("change",E),y())});d.emitter.on("change",E)});try{return await Promise.all([l.request({method:"wallet_switchEthereumChain",params:[{chainId:re(r)}]}).then(async()=>{await this.getChainId()===r&&d.emitter.emit("change",{chainId:r})}),f]),g}catch(y){const E=y;if(E.code===4902||((m=(p=E==null?void 0:E.data)==null?void 0:p.originalError)==null?void 0:m.code)===4902)try{const{default:N,...h}=g.blockExplorers??{};let C;a!=null&&a.blockExplorerUrls?C=a.blockExplorerUrls:N&&(C=[N.url,...Object.values(h).map(b=>b.url)]);let w;(I=a==null?void 0:a.rpcUrls)!=null&&I.length?w=a.rpcUrls:w=[((v=g.rpcUrls.default)==null?void 0:v.http[0])??""];const A={blockExplorerUrls:C,chainId:re(r),chainName:(a==null?void 0:a.chainName)??g.name,iconUrls:a==null?void 0:a.iconUrls,nativeCurrency:(a==null?void 0:a.nativeCurrency)??g.nativeCurrency,rpcUrls:w};return await Promise.all([l.request({method:"wallet_addEthereumChain",params:[A]}).then(async()=>{if(await this.getChainId()===r)d.emitter.emit("change",{chainId:r});else throw new _(new Error("User rejected switch after adding network."))}),f]),g}catch(N){throw new _(N)}throw E.code===_.code?new _(E):new B(E)}},async onAccountsChanged(a){var r;if(a.length===0)this.onDisconnect();else if(d.emitter.listenerCount("connect")){const l=(await this.getChainId()).toString();this.onConnect({chainId:l}),e&&await((r=d.storage)==null?void 0:r.removeItem(`${this.id}.disconnected`))}else d.emitter.emit("change",{accounts:a.map(l=>q(l))})},onChainChanged(a){const r=Number(a);d.emitter.emit("change",{chainId:r})},async onConnect(a){const r=await this.getAccounts();if(r.length===0)return;const l=Number(a.chainId);d.emitter.emit("connect",{accounts:r,chainId:l});const g=await this.getProvider();g&&(u&&(g.removeListener("connect",u),u=void 0),s||(s=this.onAccountsChanged.bind(this),g.on("accountsChanged",s)),i||(i=this.onChainChanged.bind(this),g.on("chainChanged",i)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c)))},async onDisconnect(a){const r=await this.getProvider();a&&a.code===1013&&r&&(await this.getAccounts()).length||(d.emitter.emit("disconnect"),r&&(i&&(r.removeListener("chainChanged",i),i=void 0),c&&(r.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),r.on("connect",u))))}})}const Pt={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(o){return o!=null&&o.coinbaseWalletExtension?o.coinbaseWalletExtension:oe(o,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(o){return oe(o,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const t=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const n of t)if(e[n])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(o){var e,t;return(e=o==null?void 0:o.phantom)!=null&&e.ethereum?(t=o.phantom)==null?void 0:t.ethereum:oe(o,"isPhantom")}}};function oe(o,e){function t(s){return typeof e=="function"?e(s):typeof e=="string"?s[e]:!0}const n=o.ethereum;if(n!=null&&n.providers)return n.providers.find(s=>t(s));if(n&&t(n))return n}const kt=o=>(e,t,n)=>{const s=n.subscribe;return n.subscribe=(u,c,d)=>{let a=u;if(c){const r=(d==null?void 0:d.equalityFn)||Object.is;let l=u(n.getState());a=g=>{const f=u(g);if(!r(l,f)){const p=l;c(l=f,p)}},d!=null&&d.fireImmediately&&c(l,l)}return s(a)},o(e,t,n)},Rt=kt;function Ot(o,e){let t;try{t=o()}catch{return}return{getItem:s=>{var i;const u=d=>d===null?null:JSON.parse(d,void 0),c=(i=t.getItem(s))!=null?i:null;return c instanceof Promise?c.then(u):u(c)},setItem:(s,i)=>t.setItem(s,JSON.stringify(i,void 0)),removeItem:s=>t.removeItem(s)}}const me=o=>e=>{try{const t=o(e);return t instanceof Promise?t:{then(n){return me(n)(t)},catch(n){return this}}}catch(t){return{then(n){return this},catch(n){return me(n)(t)}}}},Ut=(o,e)=>(t,n,s)=>{let i={storage:Ot(()=>localStorage),partialize:m=>m,version:0,merge:(m,I)=>({...I,...m}),...e},u=!1;const c=new Set,d=new Set;let a=i.storage;if(!a)return o((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),t(...m)},n,s);const r=()=>{const m=i.partialize({...n()});return a.setItem(i.name,{state:m,version:i.version})},l=s.setState;s.setState=(m,I)=>{l(m,I),r()};const g=o((...m)=>{t(...m),r()},n,s);s.getInitialState=()=>g;let f;const p=()=>{var m,I;if(!a)return;u=!1,c.forEach(y=>{var E;return y((E=n())!=null?E:g)});const v=((I=i.onRehydrateStorage)==null?void 0:I.call(i,(m=n())!=null?m:g))||void 0;return me(a.getItem.bind(a))(i.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==i.version){if(i.migrate)return[!0,i.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var E;const[N,h]=y;if(f=i.merge(h,(E=n())!=null?E:g),t(f,!0),N)return r()}).then(()=>{v==null||v(f,void 0),f=n(),u=!0,d.forEach(y=>y(f))}).catch(y=>{v==null||v(void 0,y)})};return s.persist={setOptions:m=>{i={...i,...m},m.storage&&(a=m.storage)},clearStorage:()=>{a==null||a.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>p(),hasHydrated:()=>u,onHydrate:m=>(c.add(m),()=>{c.delete(m)}),onFinishHydration:m=>(d.add(m),()=>{d.delete(m)})},i.skipHydration||p(),f||g},jt=Ut,Ne=o=>{let e;const t=new Set,n=(a,r)=>{const l=typeof a=="function"?a(e):a;if(!Object.is(l,e)){const g=e;e=r??(typeof l!="object"||l===null)?l:Object.assign({},e,l),t.forEach(f=>f(e,g))}},s=()=>e,c={setState:n,getState:s,getInitialState:()=>d,subscribe:a=>(t.add(a),()=>t.delete(a))},d=e=o(n,s,c);return c},fe=o=>o?Ne(o):Ne;class Mt{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new et})}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,...t){const n=t[0];this._emitter.emit(e,{uid:this.uid,...n})}listenerCount(e){return this._emitter.listenerCount(e)}}function Wt(o){return new Mt(o)}function Lt(o,e){return JSON.parse(o,(t,n)=>{let s=n;return(s==null?void 0:s.__type)==="bigint"&&(s=BigInt(s.value)),(s==null?void 0:s.__type)==="Map"&&(s=new Map(s.value)),(e==null?void 0:e(t,s))??s})}function Ee(o,e){return o.slice(0,e).join(".")||"."}function Se(o,e){const{length:t}=o;for(let n=0;n<t;++n)if(o[n]===e)return n+1;return 0}function qt(o,e){const t=typeof o=="function",n=typeof e=="function",s=[],i=[];return function(c,d){if(typeof d=="object")if(s.length){const a=Se(s,this);a===0?s[s.length]=this:(s.splice(a),i.splice(a)),i[i.length]=c;const r=Se(s,d);if(r!==0)return n?e.call(this,c,d,Ee(i,r)):`[ref=${Ee(i,r)}]`}else s[0]=d,i[0]=c;return t?o.call(this,c,d):d}}function $t(o,e,t,n){return JSON.stringify(o,qt((s,i)=>{let u=i;return typeof u=="bigint"&&(u={__type:"bigint",value:i.toString()}),u instanceof Map&&(u={__type:"Map",value:Array.from(i.entries())}),(e==null?void 0:e(s,u))??u},n),t??void 0)}function xt(o){const{deserialize:e=Lt,key:t="wagmi",serialize:n=$t,storage:s=Oe}=o;function i(u){return u instanceof Promise?u.then(c=>c).catch(()=>null):u}return{...s,key:t,async getItem(u,c){const d=s.getItem(`${t}.${u}`),a=await i(d);return a?e(a)??null:c??null},async setItem(u,c){const d=`${t}.${u}`;c===null?await i(s.removeItem(d)):await i(s.setItem(d,n(c)))},async removeItem(u){await i(s.removeItem(`${t}.${u}`))}}}const Oe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function Dt(){const o=typeof window<"u"&&window.localStorage?window.localStorage:Oe;return{getItem(e){return o.getItem(e)},removeItem(e){o.removeItem(e)},setItem(e,t){try{o.setItem(e,t)}catch{}}}}const Ce=256;let ee=Ce,te;function Ht(o=11){if(!te||ee+o>Ce*2){te="",ee=0;for(let e=0;e<Ce;e++)te+=(256+Math.random()*256|0).toString(16).substring(1)}return te.substring(ee,ee+++o)}function Ft(o){const{multiInjectedProviderDiscovery:e=!0,storage:t=xt({storage:Dt()}),syncConnectedChain:n=!0,ssr:s=!1,...i}=o,u=typeof window<"u"&&e?tt():void 0,c=fe(()=>i.chains),d=fe(()=>{const h=[],C=new Set;for(const w of i.connectors??[]){const A=a(w);if(h.push(A),!s&&A.rdns){const b=typeof A.rdns=="string"?[A.rdns]:A.rdns;for(const T of b)C.add(T)}}if(!s&&u){const w=u.getProviders();for(const A of w)C.has(A.info.rdns)||h.push(a(r(A)))}return h});function a(h){var b;const C=Wt(Ht());let w;const A={...h({emitter:C,chains:c.getState(),get providers(){if(!u||!w)return[];const T=typeof w=="string"?[w]:w,R=u.getProviders();return T.flatMap(K=>R.filter(P=>P.info.rdns===K))},storage:t,transports:i.transports}),emitter:C,uid:C.uid};return w=A.rdns,C.on("connect",E),(b=A.setup)==null||b.call(A),A}function r(h){const{info:C}=h,w=h.provider;return ae({target:{...C,id:C.rdns,provider:w}})}const l=new Map;function g(h={}){const C=h.chainId??I.getState().chainId,w=c.getState().find(b=>b.id===C);if(h.chainId&&!w)throw new z;{const b=l.get(I.getState().chainId);if(b&&!w)return b;if(!w)throw new z}{const b=l.get(C);if(b)return b}let A;if(i.client)A=i.client({chain:w});else{const b=w.id,T=c.getState().map(P=>P.id),R={},K=Object.entries(i);for(const[P,$]of K)if(!(P==="chains"||P==="client"||P==="connectors"||P==="transports"))if(typeof $=="object")if(b in $)R[P]=$[b];else{if(T.some(je=>je in $))continue;R[P]=$}else R[P]=$;A=Pe({...R,chain:w,batch:R.batch??{multicall:!0},transport:P=>i.transports[b]({...P,connectors:d})})}return l.set(C,A),A}function f(){return{chainId:c.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let p;const m="0.0.0-canary-";ie.startsWith(m)?p=Number.parseInt(ie.replace(m,""),10):p=Number.parseInt(ie.split(".")[0]??"0",10);const I=fe(Rt(t?jt(f,{migrate(h,C){if(C===p)return h;const w=f(),A=v(h,w.chainId);return{...w,chainId:A}},name:"store",partialize(h){return{connections:{__type:"Map",value:Array.from(h.connections.entries()).map(([C,w])=>{const{id:A,name:b,type:T,uid:R}=w.connector;return[C,{...w,connector:{id:A,name:b,type:T,uid:R}}]})},chainId:h.chainId,current:h.current}},merge(h,C){typeof h=="object"&&h&&"status"in h&&delete h.status;const w=v(h,C.chainId);return{...C,...h,chainId:w}},skipHydration:s,storage:t,version:p}):f));I.setState(f());function v(h,C){return h&&typeof h=="object"&&"chainId"in h&&typeof h.chainId=="number"&&c.getState().some(w=>w.id===h.chainId)?h.chainId:C}n&&I.subscribe(({connections:h,current:C})=>{var w;return C?(w=h.get(C))==null?void 0:w.chainId:void 0},h=>{if(c.getState().some(w=>w.id===h))return I.setState(w=>({...w,chainId:h??w.chainId}))}),u==null||u.subscribe(h=>{const C=new Set,w=new Set;for(const b of d.getState())if(C.add(b.id),b.rdns){const T=typeof b.rdns=="string"?[b.rdns]:b.rdns;for(const R of T)w.add(R)}const A=[];for(const b of h){if(w.has(b.info.rdns))continue;const T=a(r(b));C.has(T.id)||A.push(T)}t&&!I.persist.hasHydrated()||d.setState(b=>[...b,...A],!0)});function y(h){I.setState(C=>{const w=C.connections.get(h.uid);return w?{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts??w.accounts,chainId:h.chainId??w.chainId,connector:w.connector})}:C})}function E(h){I.getState().status==="connecting"||I.getState().status==="reconnecting"||I.setState(C=>{const w=d.getState().find(A=>A.uid===h.uid);return w?(w.emitter.listenerCount("connect")&&w.emitter.off("connect",y),w.emitter.listenerCount("change")||w.emitter.on("change",y),w.emitter.listenerCount("disconnect")||w.emitter.on("disconnect",N),{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts,chainId:h.chainId,connector:w}),current:h.uid,status:"connected"}):C})}function N(h){I.setState(C=>{const w=C.connections.get(h.uid);if(w){const b=w.connector;b.emitter.listenerCount("change")&&w.connector.emitter.off("change",y),b.emitter.listenerCount("disconnect")&&w.connector.emitter.off("disconnect",N),b.emitter.listenerCount("connect")||w.connector.emitter.on("connect",E)}if(C.connections.delete(h.uid),C.connections.size===0)return{...C,connections:new Map,current:null,status:"disconnected"};const A=C.connections.values().next().value;return{...C,connections:new Map(C.connections),current:A.connector.uid}})}return{get chains(){return c.getState()},get connectors(){return d.getState()},storage:t,getClient:g,get state(){return I.getState()},setState(h){let C;typeof h=="function"?C=h(I.getState()):C=h;const w=f();typeof C!="object"&&(C=w),Object.keys(w).some(b=>!(b in C))&&(C=w),I.setState(C,!0)},subscribe(h,C,w){return I.subscribe(h,C,w?{...w,fireImmediately:w.emitImmediately}:void 0)},_internal:{mipd:u,async revalidate(){const h=I.getState(),C=h.connections;let w=h.current;for(const[,A]of C){const b=A.connector;b.isAuthorized&&await b.isAuthorized()||(C.delete(b.uid),w===b.uid&&(w=null))}I.setState(A=>({...A,connections:C,current:w}))},store:I,ssr:!!s,syncConnectedChain:n,transports:i.transports,chains:{setState(h){const C=typeof h=="function"?h(c.getState()):h;if(C.length!==0)return c.setState(C,!0)},subscribe(h){return c.subscribe(h)}},connectors:{providerDetailToConnector:r,setup:a,setState(h){return d.setState(typeof h=="function"?h(d.getState()):h,!0)},subscribe(h){return d.subscribe(h)}},events:{change:y,connect:E,disconnect:N}}}}function Ue(o){let e=[],t,n;function s(c){var r,l;const d=k.getCaipNetworks(S.CHAIN.EVM);let a=Number(ge.parseEvmChainId(c));if(!d.some(g=>String(g.id)===String(c))){const g=((r=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:r.id)||((l=d[0])==null?void 0:l.id);g&&Number.isInteger(Number(g))&&(a=Number(g))}if(!a)throw new Error("ChainId not found in networks");return a}function i(){var c;return t||(t=ye.getInstance({projectId:o.options.projectId,chainId:(c=J())==null?void 0:c.caipNetworkId,enableLogger:o.options.enableAuthLogger,onTimeout:d=>{d==="iframe_load_failed"?x.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):d==="iframe_request_timeout"?x.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):d==="unverified_domain"&&x.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},abortController:W.EmbeddedWalletAbortController,getActiveCaipNetwork:d=>J(d),getCaipNetworks:d=>k.getCaipNetworks(d)})),t}async function u(c={}){var m;const d=i();let a=c.chainId;if(c.isReconnecting){const I=ge.parseEvmChainId(d.getLastUsedChainId()||""),v=(m=o.chains)==null?void 0:m[0].id;if(a=I||v,!a)throw new Error("ChainId not found in provider")}const r=Ie("eip155"),{address:l,chainId:g,accounts:f}=await qe.authConnectorAuthenticate({authConnector:d,chainId:a,preferredAccountType:r,socialUri:c.socialUri,chainNamespace:S.CHAIN.EVM});e=(f==null?void 0:f.map(I=>I.address))||[l];const p=s(g);return{accounts:e,account:l,chainId:p,chain:{id:p,unsupported:!1}}}return c=>({id:S.CONNECTOR_ID.AUTH,name:S.CONNECTOR_NAMES.AUTH,type:"AUTH",chain:S.CHAIN.EVM,async connect(d={}){if(n){const r=await n;return{accounts:d.withCapabilities?r.accounts.map(l=>({address:l,capabilities:{}})):r.accounts,chainId:r.chainId}}n||(n=new Promise(r=>{r(u(d))}));const a=await n;return n=void 0,{accounts:d.withCapabilities?a.accounts.map(r=>({address:r,capabilities:{}})):a.accounts,chainId:a.chainId}},async disconnect(){await(await this.getProvider()).disconnect()},getAccounts(){return e!=null&&e.length?(c.emitter.emit("change",{accounts:e}),Promise.resolve(e)):Promise.resolve([])},async getProvider(){var d;return this.provider||(this.provider=ye.getInstance({projectId:o.options.projectId,chainId:(d=J())==null?void 0:d.caipNetworkId,enableLogger:o.options.enableAuthLogger,abortController:W.EmbeddedWalletAbortController,onTimeout:a=>{a==="iframe_load_failed"?x.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):a==="iframe_request_timeout"?x.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):a==="unverified_domain"&&x.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:a=>J(a),getCaipNetworks:a=>k.getCaipNetworks(a)})),Promise.resolve(this.provider)},async getChainId(){const d=await this.getProvider(),{chainId:a}=await d.getChainId();return s(a)},async isAuthorized(){const a=k.state.activeChain===S.CHAIN.EVM;if(S.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(g=>Le.getConnectorId(g)===S.CONNECTOR_ID.AUTH)&&!a)return!1;const l=await this.getProvider();return Promise.resolve(l.getLoginEmailUsed())},async switchChain({chainId:d}){var a;try{const r=c.chains.find(p=>p.id===d);if(!r)throw new B(new Error("chain not found on connector."));const l=await this.getProvider(),g=Ie("eip155"),f=await l.connect({chainId:d,preferredAccountType:g});return e=((a=f==null?void 0:f.accounts)==null?void 0:a.map(p=>p.address))||[f.address],c.emitter.emit("change",{chainId:Number(d),accounts:e}),r}catch(r){throw r instanceof Error?new B(r):r}},onAccountsChanged(d){d.length===0?this.onDisconnect():c.emitter.emit("change",{accounts:d.map(q)})},onChainChanged(d){const a=Number(d);c.emitter.emit("change",{chainId:a})},async onDisconnect(d){await(await this.getProvider()).disconnect()}})}pe.type="walletConnect";function pe(o){const e=o.isNewChainsStale??!0;let t,n,s,i,u,c,d;return a=>({id:"walletConnect",name:"WalletConnect",type:pe.type,provider:o.universalProvider,async setup(){const r=await this.getProvider().catch(()=>null);r&&(i||(i=this.onConnect.bind(this),r.on("connect",i)),c||(c=this.onSessionDelete.bind(this),r.on("session_delete",c)))},async connect({...r}={}){var l,g,f;try{const p=k.getCaipNetworks(),m=await this.getProvider();if(!m)throw new L;u||(u=this.onDisplayUri,m.on("display_uri",u));const I=await this.isChainsStale();m.session&&I&&await m.disconnect();const v=D.state.universalProviderConfigOverride;if(!m.session||I){const A=$e.createNamespaces(p,v);await m.connect({optionalNamespaces:A,..."pairingTopic"in r?{pairingTopic:r.pairingTopic}:{}}),this.setRequestedChainsIds(p.map(b=>Number(b.id)))}const y=await this.getAccounts(),E=await this.getChainId(),N=(f=(g=(l=m.session)==null?void 0:l.namespaces)==null?void 0:g.eip155)==null?void 0:f.chains,h=N==null?void 0:N.some(A=>Number(A.split(":")[1])===E);let C=1;h?C=E:N!=null&&N[0]&&(C=Number(N[0].split(":")[1])),u&&(m.removeListener("display_uri",u),u=void 0),i&&(m.removeListener("connect",i),i=void 0),n||(n=this.onAccountsChanged.bind(this),m.on("accountsChanged",n)),s||(s=this.onChainChanged.bind(this),m.on("chainChanged",s)),d||(d=this.onDisconnect.bind(this),m.on("disconnect",d)),c||(c=this.onSessionDelete.bind(this),m.on("session_delete",c));const w=v==null?void 0:v.defaultChain;return m.setDefaultChain(w??`eip155:${C}`),{accounts:y,chainId:C}}catch(p){throw/(user rejected|connection request reset)/i.test(p==null?void 0:p.message)?new _(p):p}},async disconnect(){const r=await this.getProvider();try{await(r==null?void 0:r.disconnect())}catch(l){if(!/No matching key/i.test(l.message))throw l}finally{s&&(r==null||r.removeListener("chainChanged",s),s=void 0),d&&(r==null||r.removeListener("disconnect",d),d=void 0),i||(i=this.onConnect.bind(this),r==null||r.on("connect",i)),n&&(r==null||r.removeListener("accountsChanged",n),n=void 0),c&&(r==null||r.removeListener("session_delete",c),c=void 0),this.setRequestedChainsIds([])}},async getAccounts(){var m,I,v;const r=await this.getProvider();if(!((m=r==null?void 0:r.session)!=null&&m.namespaces))return[];const l=(v=(I=r==null?void 0:r.session)==null?void 0:I.namespaces[S.CHAIN.EVM])==null?void 0:v.accounts,g=(l==null?void 0:l.map(y=>y.split(":")[2]))??[],f=new Set;return g.filter(y=>{const E=y==null?void 0:y.toLowerCase();return f.has(E)?!1:(f.add(E),!0)})},async getProvider({chainId:r}={}){var f,p;t||(t=o.universalProvider,t==null||t.events.setMaxListeners(Number.POSITIVE_INFINITY));const l=H.getActiveNamespace(),g=(f=k.getActiveCaipNetwork())==null?void 0:f.id;if(r&&g!==r&&l){const m=H.getStoredActiveCaipNetworkId(),I=l?k.getCaipNetworks(l):[],v=I==null?void 0:I.find(y=>y.id===m);v&&v.chainNamespace===S.CHAIN.EVM&&await((p=this.switchChain)==null?void 0:p.call(this,{chainId:Number(v.id)}))}return t},async getChainId(){var p,m,I,v;const r=(p=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:p.id;if(r)return r;const g=(v=(I=(m=(await this.getProvider()).session)==null?void 0:m.namespaces[S.CHAIN.EVM])==null?void 0:I.chains)==null?void 0:v[0],f=k.getCaipNetworks().find(y=>y.id===g);return f==null?void 0:f.id},async isAuthorized(){try{const[r,l]=await Promise.all([this.getAccounts(),this.getProvider()]);return r.length?await this.isChainsStale()&&l.session?(await l.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:r,chainId:l}){var p,m,I,v;const g=await this.getProvider();if(!g)throw new L;const f=k.getCaipNetworks().find(y=>y.id===l);if(!f)throw new B(new z);try{await g.request({method:"wallet_switchEthereumChain",params:[{chainId:re(l)}]}),f!=null&&f.caipNetworkId&&g.setDefaultChain(f==null?void 0:f.caipNetworkId),a.emitter.emit("change",{chainId:Number(l)});const y=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...y,l]),{...f,id:f.id}}catch(y){const E=y;if(/(?:user rejected)/iu.test(E.message))throw new _(E);try{let N;r!=null&&r.blockExplorerUrls?N=r.blockExplorerUrls:N=(p=f.blockExplorers)!=null&&p.default.url?[(m=f.blockExplorers)==null?void 0:m.default.url]:[];const h=((v=(I=f.rpcUrls)==null?void 0:I.chainDefault)==null?void 0:v.http)||[],C={blockExplorerUrls:N,chainId:re(l),chainName:f.name,iconUrls:r==null?void 0:r.iconUrls,nativeCurrency:f.nativeCurrency,rpcUrls:h};await g.request({method:"wallet_addEthereumChain",params:[C]});const w=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...w,l]),{...f,id:f.id}}catch(N){throw new _(N)}}},onAccountsChanged(r){r.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:r.map(l=>q(l))})},onChainChanged(r){const l=Number(r);a.emitter.emit("change",{chainId:l})},onConnect(r){this.setRequestedChainsIds(k.getCaipNetworks().map(l=>Number(l.id)))},async onDisconnect(r){this.setRequestedChainsIds([]),a.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),s&&(l.removeListener("chainChanged",s),s=void 0),d&&(l.removeListener("disconnect",d),d=void 0),c&&(l.removeListener("session_delete",c),c=void 0),i||(i=this.onConnect.bind(this),l.on("connect",i))},onDisplayUri(r){a.emitter.emit("message",{type:"display_uri",data:r})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var g,f,p;if(!((g=t==null?void 0:t.session)!=null&&g.namespaces))return[];const r=(p=(f=t==null?void 0:t.session)==null?void 0:f.namespaces[S.CHAIN.EVM])==null?void 0:p.accounts;return(r==null?void 0:r.map(m=>Number.parseInt(m.split(":")[1]??"")))??[]},async getRequestedChainsIds(){var l;const r=await((l=a.storage)==null?void 0:l.getItem(this.requestedChainsStorageKey))??[];return[...new Set(r)]},async isChainsStale(){if(!e)return!1;const r=a.chains.map(f=>f.id),l=this.getNamespaceChainsIds();if(l.length&&!l.some(f=>r.includes(f)))return!1;const g=await this.getRequestedChainsIds();return!r.every(f=>g.includes(Number(f)))},async setRequestedChainsIds(r){var l;await((l=a.storage)==null?void 0:l.setItem(this.requestedChainsStorageKey,r))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}const F=De({pendingTransactions:0}),_e={state:F,subscribeKey(o,e){return xe(F,o,e)},increase(o){F[o]+=1},decrease(o){F[o]-=1},reset(o){F[o]=0}};async function Bt(o){if(ne.isSafeApp()){const{safe:e}=await we(async()=>{const{safe:t}=await import("./index-DV4p99KA.js");return{safe:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));if(e&&!o.some(t=>t.type==="safe"))return e()}return null}async function zt(o){try{const{baseAccount:e}=await we(async()=>{const{baseAccount:t}=await import("./index-DV4p99KA.js");return{baseAccount:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));if(e&&!o.some(t=>t.id==="baseAccount"))return e()}catch(e){console.error("Failed to import Base Account SDK:",e)}return null}async function Vt(o){try{const{coinbaseWallet:e}=await we(async()=>{const{coinbaseWallet:t}=await import("./index-DV4p99KA.js");return{coinbaseWallet:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));if(e&&!o.some(t=>t.id==="coinbaseWallet"))return e()}catch(e){console.error("Failed to import Coinbase Wallet SDK:",e)}return null}const Gt={enable:!1,pollingInterval:3e4};class Kt extends He{constructor(e){const t=X.extendCaipNetworks(e.networks,{projectId:e.projectId,customNetworkImageUrls:{},customRpcUrls:e.customRpcUrls});super(),this.balancePromises={},this.namespace=S.CHAIN.EVM,this.adapterType=S.ADAPTER_TYPES.WAGMI,this.projectId=e.projectId,this.pendingTransactionsFilter={...Gt,...e.pendingTransactionsFilter??{}},this.createConfig({...e,networks:t}),this.checkChainId()}construct(e){this.checkChainId(),this.setupWatchers()}async getAccounts(e){const t=this.getWagmiConnector(e.id);if(!t)return{accounts:[]};if(t.id===S.CONNECTOR_ID.AUTH){const u=await t.getProvider();if(!(u!=null&&u.user))return{accounts:[]};const{address:c,accounts:d,chainId:a}=u.user;return Promise.resolve({accounts:(d||[{address:c,type:"eoa"}]).map(r=>ne.createAccount({caipAddress:`eip155:${a}:${r.address}`,type:r.type}))})}const{addresses:n,address:s,chainId:i}=se(this.wagmiConfig);return Promise.resolve({accounts:i?[...new Set(n||[s])].map(u=>ne.createAccount({caipAddress:`eip155:${i}:${u||""}`,type:"eoa"})):[]})}checkChainId(){const{chainId:e}=se(this.wagmiConfig);e&&this.emit("switchNetwork",{chainId:e})}getWagmiConnector(e){return this.wagmiConfig.connectors.find(t=>t.id===e)}createConfig(e){this.wagmiChains=e.networks.filter(s=>s.chainNamespace===S.CHAIN.EVM);const t={},n=[...e.connectors??[]];this.wagmiChains.forEach(s=>{var c,d;const i=(c=e.transports)==null?void 0:c[s.id],u=X.getCaipNetworkId(s);i?t[s.id]=X.extendWagmiTransports(s,e.projectId,i):t[s.id]=X.getViemTransport(s,e.projectId,(d=e.customRpcUrls)==null?void 0:d[u])}),this.wagmiConfig=Ft({...e,chains:this.wagmiChains,connectors:n,transports:t})}setupWatchPendingTransactions(){if(!this.pendingTransactionsFilter.enable||this.unwatchPendingTransactions)return;this.unwatchPendingTransactions=_t(this.wagmiConfig,{pollingInterval:this.pendingTransactionsFilter.pollingInterval,onError:()=>{},onTransactions:()=>{this.emit("pendingTransactions"),_e.increase("pendingTransactions")}});const e=_e.subscribeKey("pendingTransactions",t=>{var n;t>=S.LIMITS.PENDING_TRANSACTIONS&&((n=this.unwatchPendingTransactions)==null||n.call(this),e())})}setupWatchers(){Et(this.wagmiConfig,{onChange:e=>{this.clearConnections(),this.addConnection(...e.map(t=>{const n=this.getCaipNetworks().find(i=>i.id===t.chainId),s=t.connector.id===S.CONNECTOR_ID.AUTH;return{accounts:t.accounts.map(i=>({address:this.toChecksummedAddress(i)})),caipNetwork:n,connectorId:t.connector.id,auth:s?{name:H.getConnectedSocialProvider(),username:H.getConnectedSocialUsername()}:void 0}}))}}),Nt(this.wagmiConfig,{onChange:(e,t)=>{var n;if(e.status==="disconnected"&&t.address&&this.emit("disconnect"),e!=null&&e.chainId&&(e==null?void 0:e.chainId)!==(t==null?void 0:t.chainId)&&this.emit("switchNetwork",{chainId:e.chainId}),e.status==="connected"){const s=e.address!==(t==null?void 0:t.address),i=e.connector.id!==((n=t.connector)==null?void 0:n.id),u=t.status!=="connected";(s||i||u)&&(this.setupWatchPendingTransactions(),this.handleAccountChanged({address:e.address,chainId:e.chainId,connector:e.connector}))}}})}async addThirdPartyConnectors(){const e=[],{enableCoinbase:t,enableBaseAccount:n}=D.state||{};if(n!==!1){const i=await zt(this.wagmiConfig.connectors);i&&e.push(i)}if(t!==!1){const i=await Vt(this.wagmiConfig.connectors);i&&e.push(i)}const s=await Bt(this.wagmiConfig.connectors);s&&e.push(s),await Promise.all(e.map(i=>{const u=this.configureInternalConnector(i);return this.addWagmiConnector(u)}))}addWagmiConnectors(){const e=[];D.state.enableInjected!==!1&&e.push(ae({shimDisconnect:!0}));const{features:t,remoteFeatures:n,projectId:s,enableAuthLogger:i}=D.state,u=(n==null?void 0:n.email)??(t==null?void 0:t.email)??!0,c=(n==null?void 0:n.socials)??(t==null?void 0:t.socials),d=Array.isArray(c)&&(c==null?void 0:c.length)>0;(u||d)&&e.push(Ue({chains:this.wagmiChains,options:{projectId:s,enableAuthLogger:i}})),e.forEach(a=>{this.configureInternalConnector(a)})}configureInternalConnector(e){const t=this.wagmiConfig._internal.connectors.setup(e);return this.wagmiConfig._internal.connectors.setState(n=>[...n,t]),t}async handleAccountChanged({address:e,chainId:t,connector:n}){if(!this.namespace)throw new Error("WagmiAdapter:handleAccountChanged - namespace is required");const s=await n.getProvider().catch(()=>{});this.emit("accountChanged",{address:this.toChecksummedAddress(e),chainId:t,connector:{id:n.id,name:j.ConnectorNamesMap[n.id]??n.name,imageId:j.ConnectorImageIds[n.id],type:j.ConnectorTypesMap[n.type]??"EXTERNAL",info:n.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:n.id},provider:s,chain:this.namespace,chains:[]}})}async writeSolanaTransaction(){return Promise.resolve({hash:""})}async signMessage(e){try{return{signature:await bt(this.wagmiConfig,{message:e.message,account:e.address})}}catch{throw new Error("WagmiAdapter:signMessage - Sign message failed")}}async sendTransaction(e){var c;const{chainId:t,address:n}=se(this.wagmiConfig),s=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===t),i={account:n,to:e.to,value:Number.isNaN(Number(e.value))?BigInt(0):BigInt(e.value),gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,data:e.data,chain:s,type:"legacy",parameters:["nonce"]};await It(this.wagmiConfig,i);const u=await yt(this.wagmiConfig,i);return await At(this.wagmiConfig,{hash:u,timeout:25e3}),{hash:u}}async writeContract(e){var c;const{caipNetwork:t,...n}=e,s=Number(ge.caipNetworkIdToNumber(t.caipNetworkId)),i=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===s);return{hash:await Tt(this.wagmiConfig,{chain:i,address:n.tokenAddress,account:n.fromAddress,abi:n.abi,functionName:n.method,args:n.args,__mode:"prepared"})}}async estimateGas(e){try{return{gas:await wt(this.wagmiConfig,{account:e.address,to:e.to,data:e.data,type:"legacy"})}}catch{throw new Error("WagmiAdapter:estimateGas - error estimating gas")}}parseUnits(e){return ct(e.value,e.decimals)}formatUnits(e){return Ke(e.value,e.decimals)}async addWagmiConnector(e){if(!this.namespace)throw new Error("WagmiAdapter:addWagmiConnector - namespace is required");const{enableEIP6963:t,enableInjected:n}=D.state||{},s=e.type===S.CONNECTOR_ID.INJECTED,i=e.id===S.CONNECTOR_ID.INJECTED,u=s&&!i;if(i&&n===!1||u&&t===!1||e.id===S.CONNECTOR_ID.AUTH||e.id===S.CONNECTOR_ID.WALLET_CONNECT)return;let c;e.id!==S.CONNECTOR_ID.BASE_ACCOUNT&&(c=await e.getProvider().catch(()=>{}));const d=Fe.state.connectorImages;this.addConnector({id:e.id,explorerId:j.ConnectorExplorerIds[e.id]??j.ConnectorExplorerIds[e.name],imageUrl:(d==null?void 0:d[e.id])??e.icon,name:j.ConnectorNamesMap[e.id]??e.name,imageId:j.ConnectorImageIds[e.id],type:j.ConnectorTypesMap[e.type]??"EXTERNAL",info:e.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:e.id},provider:c,chain:this.namespace,chains:[]})}async syncConnectors(){St(this.wagmiConfig,{onChange:e=>{e.forEach(t=>this.addWagmiConnector(t))}}),this.addWagmiConnectors(),await Promise.all(this.wagmiConfig.connectors.map(e=>this.addWagmiConnector(e))),await this.addThirdPartyConnectors()}async syncConnections(){const e=this.connectors.filter(t=>{const{hasDisconnected:n,hasConnected:s}=Y.getConnectorStorageInfo(t.id,this.namespace);return!n&&s}).map(t=>this.getWagmiConnector(t.id)).filter(Boolean);await he(this.wagmiConfig,{connectors:e})}async syncConnection(e){var a,r;const{id:t,chainId:n}=e,i=M(this.wagmiConfig).find(l=>l.connector.id===t),u=this.getWagmiConnector(t),c=await(u==null?void 0:u.getProvider());if(ne.isSafeApp()&&t===S.CONNECTOR_ID.SAFE&&!(i!=null&&i.accounts.length)){const l=this.getWagmiConnector("safe");if(l){const g=await ue(this.wagmiConfig,{connector:l,chainId:Number(n)}),f=await l.getProvider();return{chainId:Number(n),address:this.toChecksummedAddress(g.accounts[0]),provider:f,type:(a=i==null?void 0:i.connector.type)==null?void 0:a.toUpperCase(),id:i==null?void 0:i.connector.id}}}return{chainId:Number(i==null?void 0:i.chainId),address:this.toChecksummedAddress(i==null?void 0:i.accounts[0]),provider:c,type:(r=i==null?void 0:i.connector.type)==null?void 0:r.toUpperCase(),id:i==null?void 0:i.connector.id}}async connectWalletConnect(e){try{const t=this.getWalletConnectConnector();await t.authenticate();const n=this.getWagmiConnector("walletConnect");if(!n)throw new Error("UniversalAdapter:connectWalletConnect - connector not found");const s=await ue(this.wagmiConfig,{connector:n,chainId:e?Number(e):void 0});return s.chainId!==Number(e)&&await Ae(this.wagmiConfig,{chainId:s.chainId}),{clientId:await t.provider.client.core.crypto.getClientId()}}catch(t){throw t instanceof _?new Q(t):be.isUserRejectedRequestError(t)?new Q(t):t}}async connect(e){var t,n,s,i,u;try{const{id:c,address:d,provider:a,type:r,info:l,chainId:g,socialUri:f}=e,p=this.getWagmiConnector(c);if(!p)throw new Error("connectionControllerClient:connectExternal - connector is undefined");a&&l&&p.id===S.CONNECTOR_ID.EIP6963&&((t=p.setEip6963Wallet)==null||t.call(p,{provider:a,info:l}));const m=(s=(n=this.wagmiConfig.state)==null?void 0:n.connections)==null?void 0:s.get(p.uid);if(m){await((i=this.wagmiConfig.storage)==null?void 0:i.setItem("recentConnectorId",p.id));const y=[...m.accounts].sort((E,N)=>Y.isLowerCaseMatch(E,d)?-1:Y.isLowerCaseMatch(N,d)?1:0);return(u=this.wagmiConfig)==null||u.setState(E=>({...E,connections:new Map(E.connections).set(p.uid,{accounts:y,chainId:m.chainId,connector:m.connector}),current:p.uid,status:"connected"})),{address:this.toChecksummedAddress(y[0]),chainId:m.chainId,provider:a,type:r,id:c}}const I=await ue(this.wagmiConfig,{connector:p,chainId:g?Number(g):void 0,socialUri:f}),v=a??await p.getProvider();return{address:this.toChecksummedAddress(I.accounts[0]),chainId:I.chainId,provider:v,type:r,id:c}}catch(c){throw c instanceof _?new Q(c):be.isUserRejectedRequestError(c)?new Q(c):c}}get connections(){return Array.from(this.wagmiConfig.state.connections.values()).map(e=>({accounts:e.accounts.map(t=>({address:this.toChecksummedAddress(t)})),connectorId:e.connector.id}))}async reconnect(e){const{id:t}=e,n=this.getWagmiConnector(t);if(!n)throw new Error("connectionControllerClient:connectExternal - connector is undefined");await he(this.wagmiConfig,{connectors:[n]})}async getBalance(e){const t=e.address,n=this.getCaipNetworks().find(s=>s.id===e.chainId);if(!t)return Promise.resolve({balance:"0.00",symbol:"ETH"});if(n&&this.wagmiConfig){const s=`${n.caipNetworkId}:${e.address}`,i=this.balancePromises[s];if(i)return i;const u=H.getNativeBalanceCacheForCaipAddress(s);return u?{balance:u.balance,symbol:u.symbol}:(this.balancePromises[s]=new Promise(async c=>{var d,a;try{const r=Number(e.chainId),l=await pt(this.wagmiConfig,{address:e.address,chainId:r,token:(a=(d=e.tokens)==null?void 0:d[n.caipNetworkId])==null?void 0:a.address});H.updateNativeBalanceCache({caipAddress:s,balance:l.formatted,symbol:l.symbol,timestamp:Date.now()}),c({balance:l.formatted,symbol:l.symbol})}catch(r){console.warn("Appkit:WagmiAdapter:getBalance - Error getting balance",r),c({balance:"0.00",symbol:"ETH"})}}).finally(()=>{delete this.balancePromises[s]}),this.balancePromises[s]||{balance:"0.00",symbol:"ETH"})}return{balance:"",symbol:""}}getWalletConnectProvider(){var e;return(e=this.getWagmiConnector("walletConnect"))==null?void 0:e.provider}async disconnect(e){if(e.id){const t=this.getWagmiConnector(e.id),s=M(this.wagmiConfig).find(i=>Y.isLowerCaseMatch(i.connector.id,e.id));return await ve(this.wagmiConfig,{connector:t}),D.state.enableReconnect===!1&&this.deleteConnection(e.id),s?{connections:[{accounts:s.accounts.map(i=>({address:this.toChecksummedAddress(i)})),connectorId:s.connector.id}]}:{connections:[]}}return this.disconnectAll()}async disconnectAll(){const e=M(this.wagmiConfig),t=await Promise.allSettled(e.map(async n=>{const s=this.getWagmiConnector(n.connector.id);return s&&await ve(this.wagmiConfig,{connector:s}),n}));return this.wagmiConfig.state.connections.clear(),{connections:t.filter(n=>n.status==="fulfilled").map(({value:n})=>({accounts:n.accounts.map(s=>({address:this.toChecksummedAddress(s)})),connectorId:n.connector.id}))}}async switchNetwork(e){var f,p,m,I,v;const{caipNetwork:t}=e,n=this.wagmiConfig.chains.find(y=>y.id.toString()===t.id.toString());if(!n)throw new Error("connectionControllerClient:switchNetwork - wagmiChain is undefined");const{name:s,nativeCurrency:i,rpcUrls:u,blockExplorers:c,id:d}=n,a=((m=(p=(f=t.rpcUrls)==null?void 0:f.chainDefault)==null?void 0:p.http)==null?void 0:m[0])??u.default.http[0]??"",r=(c==null?void 0:c.default.url)??((v=(I=t.blockExplorers)==null?void 0:I.default)==null?void 0:v.url)??"",l=i??t.nativeCurrency,g=s??t.name;await Ae(this.wagmiConfig,{chainId:d,addEthereumChainParameter:{chainName:g,nativeCurrency:l,rpcUrls:[a],blockExplorerUrls:[r]}}),await super.switchNetwork(e)}async getCapabilities(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:getCapabilities - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:getCapabilities - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:getCapabilities - provider is undefined");return await i.request({method:"wallet_getCapabilities",params:[e]})}async grantPermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:grantPermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:grantPermissions - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:grantPermissions - provider is undefined");return i.request({method:"wallet_grantPermissions",params:e})}async revokePermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:revokePermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:revokePermissions - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:revokePermissions - provider is undefined");return i.request({method:"wallet_revokePermissions",params:e})}async walletGetAssets(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:walletGetAssets - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:walletGetAssets - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:walletGetAssets - provider is undefined");return i.request({method:"wallet_getAssets",params:[e]})}setAuthProvider(e){if(!this.namespace)throw new Error("WagmiAdapter:setAuthProvider - namespace is required");this.addConnector({id:S.CONNECTOR_ID.AUTH,type:"AUTH",name:S.CONNECTOR_NAMES.AUTH,provider:e,imageId:j.ConnectorImageIds[S.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}async setUniversalProvider(e){e.on("connect",()=>{const n=M(this.wagmiConfig),s=this.getWagmiConnector("walletConnect");if(s&&!n.find(i=>i.connector.id===s.id)){if(k.state.activeChain==="eip155")return;he(this.wagmiConfig,{connectors:[s]})}});const t=pe({universalProvider:e});return this.configureInternalConnector(t),this.addConnector(new Be({provider:e,caipNetworks:this.getCaipNetworks(),namespace:"eip155"})),Promise.resolve()}toChecksummedAddress(e){if(!e)return e;try{return Ze(e.toLowerCase())}catch{return e}}}const dn=Object.freeze(Object.defineProperty({__proto__:null,WagmiAdapter:Kt,authConnector:Ue},Symbol.toStringTag,{value:"Module"}));export{z as C,L as P,ft as a,dn as b,an as c,ae as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{_ as b}from"./index-Dmfk0azd.js";import{c as T,C as O,a as G,P as k}from"./index-ccNJtibX.js";import{i as zt}from"./index-ccNJtibX.js";import{aI as D,aR as B,bh as F}from"./sendRawTransaction-BqauPPYf.js";import{x as L,af as z,a5 as _,Y as f,u as x,al as H,r as Y}from"./NetworkUtil-Ddexw9-U.js";import{G as J,w as m,a as E}from"./W3MFrameProviderSingleton-HtGM3kiI.js";import{a as P}from"./custom-CLQCvu9h.js";import"./react-Vu6nbGi5.js";import"./ethers-DHDSyreX.js";import"./index-CdfeQ7YK.js";import"./index-DXfwhNfH.js";import"./browser-ponyfill-rND5WOqr.js";import"./index-CQB-2hib.js";import"./index-COjgItKg.js";import"./store-CraP4F4Y.js";import"./writeContract-CtBYiULm.js";function K(l,{body:p,onError:d,onResponse:M}){return l.request({body:p,onError:d,onResponse:M}),l}async function X(l,{body:p,timeout:d=1e4}){return l.requestAsync({body:p,timeout:d})}const U={http(l,p){return J(l).request(p)},webSocket:K,webSocketAsync:X};Q.type="mock";function Q(l){const p=new Map,d=l.features??{defaultConnected:!1};let M=d.defaultConnected,r;return T(o=>({id:"mock",name:"Mock Connector",type:Q.type,async setup(){r=o.chains[0].id},async connect({chainId:t,withCapabilities:e}={}){if(d.connectError)throw typeof d.connectError=="boolean"?new f(new Error("Failed to connect.")):d.connectError;const a=await(await this.getProvider()).request({method:"eth_requestAccounts"});let n=await this.getChainId();return t&&n!==t&&(n=(await this.switchChain({chainId:t})).id),M=!0,{accounts:e?a.map(i=>({address:D(i),capabilities:{foo:{bar:i}}})):a.map(i=>D(i)),chainId:n}},async disconnect(){M=!1},async getAccounts(){if(!M)throw new G;return(await(await this.getProvider()).request({method:"eth_accounts"})).map(c=>D(c))},async getChainId(){const e=await(await this.getProvider()).request({method:"eth_chainId"});return _(e,"number")},async isAuthorized(){return!d.reconnect||!M?!1:!!(await this.getAccounts()).length},async switchChain({chainId:t}){const e=await this.getProvider(),c=o.chains.find(a=>a.id===t);if(!c)throw new L(new O);return await e.request({method:"wallet_switchEthereumChain",params:[{chainId:z(t)}]}),c},onAccountsChanged(t){t.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:t.map(e=>D(e))})},onChainChanged(t){const e=Number(t);o.emitter.emit("change",{chainId:e})},async onDisconnect(t){o.emitter.emit("disconnect"),M=!1},async getProvider({chainId:t}={}){const c=(o.chains.find(n=>n.id===t)??o.chains[0]).rpcUrls.default.http[0];return P({request:async({method:n,params:i})=>{if(n==="eth_chainId")return z(r);if(n==="eth_accounts"||n==="eth_requestAccounts")return l.accounts;if(n==="eth_signTypedData_v4"&&d.signTypedDataError)throw typeof d.signTypedDataError=="boolean"?new f(new Error("Failed to sign typed data.")):d.signTypedDataError;if(n==="wallet_switchEthereumChain"){if(d.switchChainError)throw typeof d.switchChainError=="boolean"?new f(new Error("Failed to switch chain.")):d.switchChainError;r=_(i[0].chainId,"number"),this.onChainChanged(r.toString());return}if(n==="wallet_watchAsset"){if(d.watchAssetError)throw typeof d.watchAssetError=="boolean"?new f(new Error("Failed to switch chain.")):d.watchAssetError;return M}if(n==="wallet_getCapabilities")return{"0x2105":{paymasterService:{supported:i[0]==="0x95132632579b073D12a6673e18Ab05777a6B86f8"},sessionKeys:{supported:!0}},"0x14A34":{paymasterService:{supported:i[0]==="0x95132632579b073D12a6673e18Ab05777a6B86f8"}}};if(n==="wallet_sendCalls"){const w=[],y=i[0].calls,h=i[0].from;for(const j of y){const{result:A,error:v}=await U.http(c,{body:{method:"eth_sendTransaction",params:[{...j,...typeof h<"u"?{from:h}:{}}]}});if(v)throw new x({body:{method:n,params:i},error:v,url:c});w.push(A)}const I=B(H(JSON.stringify(y)));return p.set(I,w),{id:I}}if(n==="wallet_getCallsStatus"){const w=p.get(i[0]);if(!w)return{atomic:!1,chainId:"0x1",id:i[0],status:100,receipts:[],version:"2.0.0"};const h=(await Promise.all(w.map(async I=>{const{result:j,error:A}=await U.http(c,{body:{method:"eth_getTransactionReceipt",params:[I],id:0}});if(A)throw new x({body:{method:n,params:i},error:A,url:c});return j?{blockHash:j.blockHash,blockNumber:j.blockNumber,gasUsed:j.gasUsed,logs:j.logs,status:j.status,transactionHash:j.transactionHash}:null}))).filter(I=>I!==null);return h.length===0?{atomic:!1,chainId:"0x1",id:i[0],status:100,receipts:[],version:"2.0.0"}:{atomic:!1,chainId:"0x1",id:i[0],status:200,receipts:h,version:"2.0.0"}}if(n==="wallet_showCallsStatus")return;if(n==="personal_sign"){if(d.signMessageError)throw typeof d.signMessageError=="boolean"?new f(new Error("Failed to sign message.")):d.signMessageError;n="eth_sign",i=[i[1],i[0]]}const s={method:n,params:i},{error:u,result:g}=await U.http(c,{body:s});if(u)throw new x({body:s,error:u,url:c});return g}})({retryCount:0})}}))}function $(l){var o,t,e;const{chain:p}=l,d=p.rpcUrls.default.http[0];if(!l.transports)return[d];const M=(t=(o=l.transports)==null?void 0:o[p.id])==null?void 0:t.call(o,{chain:p});return(((e=M==null?void 0:M.value)==null?void 0:e.transports)||[M]).map(({value:c})=>(c==null?void 0:c.url)||d)}const tt='data:image/svg+xml,<svg width="269" height="269" viewBox="0 0 269 269" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="269" height="269" fill="black"/><path d="M123.273 190.794H93.445L121.09 105.318H85.7334L93.445 80.2642H191.95L184.238 105.318H150.773L123.273 190.794Z" fill="white"/></svg>';function It(l={}){const{dialog:p,host:d,icon:M=tt,name:r,rdns:o,theme:t,...e}=l;return nt({createAdapter(c){return c.dialog({dialog:p,host:d,icon:M,name:r,rdns:o,theme:t})},icon:M,id:o??"xyz.tempo",name:r??"Tempo Wallet",providerParameters:e,rdns:o??"xyz.tempo",type:"injected"})}function nt(l){return T(p=>{const d=p.chains;let M,r,o,t,e;async function c(){return await b(()=>import("./core-BIHI7g3E.js"),[]).catch(()=>{throw new Error('dependency "accounts" not found')})}async function a(){return M??(M=(async()=>{const n=await c();return n.Provider.create({...l.providerParameters,adapter:l.createAdapter(n),chains:p.chains,transports:p.transports})})()),await M}return{icon:l.icon,id:l.id,name:l.name,rdns:l.rdns,type:l.type,async connect(n={}){const{chainId:i,isReconnecting:s,withCapabilities:u}=n,g="capabilities"in n?n.capabilities:void 0;let w=[],y;s&&(w=await this.getAccounts().then(h=>h.map(I=>({address:I,capabilities:{}}))).catch(()=>[]));try{if(!w.length&&!s&&(w=(await(await a()).request({method:"wallet_connect",params:[{...i?{chainId:i}:{},...g?{capabilities:g}:{}}]})).accounts),y??(y=await this.getChainId()),!y)throw new O;const h=await a();return t&&(h.removeListener("connect",t),t=void 0),r||(r=this.onAccountsChanged.bind(this),h.on("accountsChanged",r)),o||(o=this.onChainChanged.bind(this),h.on("chainChanged",o)),e||(e=this.onDisconnect.bind(this),h.on("disconnect",e)),{accounts:u?w:w.map(I=>I.address),chainId:y}}catch(h){const I=h;throw I.code===f.code?new f(I):I}},async disconnect(){var i;const n=await a();o&&(n.removeListener("chainChanged",o),o=void 0),e&&(n.removeListener("disconnect",e),e=void 0),t||(t=(i=this.onConnect)==null?void 0:i.bind(this),t&&n.on("connect",t)),await n.request({method:"wallet_disconnect"})},async getAccounts(){return await(await a()).request({method:"eth_accounts"})},async getChainId(){const n=await a();return Number(await n.request({method:"eth_chainId"}))},async getClient({chainId:n}={}){const i=await a(),{address:s}=i.getAccount({accessKey:!1});return Object.assign(i.getClient({chainId:n}),{account:F(s)})},async getProvider(){return await a()},async isAuthorized(){try{return!!(await m(()=>this.getAccounts())).length}catch{return!1}},onAccountsChanged(n){p.emitter.emit("change",{accounts:n})},onChainChanged(n){p.emitter.emit("change",{chainId:Number(n)})},async onConnect(n){const i=await this.getAccounts();if(i.length===0)return;const s=Number(n.chainId);p.emitter.emit("connect",{accounts:i,chainId:s});const u=await a();t&&(u.removeListener("connect",t),t=void 0),r||(r=this.onAccountsChanged.bind(this),u.on("accountsChanged",r)),o||(o=this.onChainChanged.bind(this),u.on("chainChanged",o)),e||(e=this.onDisconnect.bind(this),u.on("disconnect",e))},async onDisconnect(n){var s;const i=await a();p.emitter.emit("disconnect"),o&&(i.removeListener("chainChanged",o),o=void 0),e&&(i.removeListener("disconnect",e),e=void 0),t||(t=(s=this.onConnect)==null?void 0:s.bind(this),t&&i.on("connect",t))},async setup(){var n;if(!t){const i=await a();t=(n=this.onConnect)==null?void 0:n.bind(this),t&&i.on("connect",t)}},async switchChain({chainId:n}){const i=d.find(u=>u.id===n);if(!i)throw new L(new O);return await(await a()).request({method:"wallet_switchEthereumChain",params:[{chainId:z(n)}]}),i}}})}function yt(l={}){let p,d,M,r;return T(o=>({id:"baseAccount",name:"Base Account",rdns:"app.base.account",type:"baseAccount",async connect({chainId:t,withCapabilities:e,...c}={}){var a;try{const n=await this.getProvider(),i=t??((a=o.chains[0])==null?void 0:a.id);if(!i)throw new O;let{accounts:s,currentChainId:u}=await(async()=>{if(c.isReconnecting)return{accounts:(await n.request({method:"eth_accounts",params:[]})).map(h=>({address:D(h)})),currentChainId:await this.getChainId()};const g=await n.request({method:"wallet_connect",params:[{capabilities:"capabilities"in c&&c.capabilities?c.capabilities:{},chainIds:[z(i),...o.chains.filter(h=>h.id!==i).map(h=>z(h.id))]}]});return{accounts:(await n.request({method:"eth_accounts"})).map(h=>g.accounts.find(I=>I.address===h)??{address:h}).map(h=>({address:D(h.address),capabilities:h.capabilities??{}})),currentChainId:Number(g.chainIds[0])}})();if(d||(d=this.onAccountsChanged.bind(this),n.on("accountsChanged",d)),M||(M=this.onChainChanged.bind(this),n.on("chainChanged",M)),r||(r=this.onDisconnect.bind(this),n.on("disconnect",r)),t&&u!==t){const g=await this.switchChain({chainId:t}).catch(w=>{if(w.code===f.code)throw w;return{id:u}});u=(g==null?void 0:g.id)??u}return{accounts:e?s:s.map(g=>g.address),chainId:u}}catch(n){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(n.message)?new f(n):n}},async disconnect(){const t=await this.getProvider();d&&(t.removeListener("accountsChanged",d),d=void 0),M&&(t.removeListener("chainChanged",M),M=void 0),r&&(t.removeListener("disconnect",r),r=void 0),t.disconnect()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(e=>D(e))},async getChainId(){const e=await(await this.getProvider()).request({method:"eth_chainId"});return Number(e)},async getProvider(){if(!p){const t=(()=>{var a;return typeof l.preference=="string"?{options:l.preference}:{...l.preference,options:((a=l.preference)==null?void 0:a.options)??"all"}})(),{createBaseAccountSDK:e}=await(()=>{try{return b(()=>import("./index-mLXaZKmk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]))}catch{throw new Error('dependency "@base-org/account" not found')}})();p=e({...l,appChainIds:o.chains.map(a=>a.id),preference:t}).getProvider()}return p},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:t,chainId:e}){var n,i,s,u;const c=o.chains.find(g=>g.id===e);if(!c)throw new L(new O);const a=await this.getProvider();try{return await a.request({method:"wallet_switchEthereumChain",params:[{chainId:z(c.id)}]}),c}catch(g){if(g.code===4902)try{let w;t!=null&&t.blockExplorerUrls?w=t.blockExplorerUrls:w=(n=c.blockExplorers)!=null&&n.default.url?[(i=c.blockExplorers)==null?void 0:i.default.url]:[];let y;(s=t==null?void 0:t.rpcUrls)!=null&&s.length?y=t.rpcUrls:y=[((u=c.rpcUrls.default)==null?void 0:u.http[0])??""];const h={blockExplorerUrls:w,chainId:z(e),chainName:(t==null?void 0:t.chainName)??c.name,iconUrls:t==null?void 0:t.iconUrls,nativeCurrency:(t==null?void 0:t.nativeCurrency)??c.nativeCurrency,rpcUrls:y};return await a.request({method:"wallet_addEthereumChain",params:[h]}),c}catch(w){throw new f(w)}throw new L(g)}},onAccountsChanged(t){t.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:t.map(e=>D(e))})},onChainChanged(t){const e=Number(t);o.emitter.emit("change",{chainId:e})},async onDisconnect(t){o.emitter.emit("disconnect");const e=await this.getProvider();d&&(e.removeListener("accountsChanged",d),d=void 0),M&&(e.removeListener("chainChanged",M),M=void 0),r&&(e.removeListener("disconnect",r),r=void 0)}}))}q.type="coinbaseWallet";function q(l={}){let p,d,M,r;return T(o=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:q.type,async connect({chainId:t,withCapabilities:e,...c}={}){try{const a=await this.getProvider(),n=(await a.request({method:"eth_requestAccounts",params:"instantOnboarding"in c&&c.instantOnboarding?[{onboarding:"instant"}]:[]})).map(s=>D(s));d||(d=this.onAccountsChanged.bind(this),a.on("accountsChanged",d)),M||(M=this.onChainChanged.bind(this),a.on("chainChanged",M)),r||(r=this.onDisconnect.bind(this),a.on("disconnect",r));let i=await this.getChainId();if(t&&i!==t){const s=await this.switchChain({chainId:t}).catch(u=>{if(u.code===f.code)throw u;return{id:i}});i=(s==null?void 0:s.id)??i}return{accounts:e?n.map(s=>({address:s,capabilities:{}})):n,chainId:i}}catch(a){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(a.message)?new f(a):a}},async disconnect(){var e;const t=await this.getProvider();d&&(t.removeListener("accountsChanged",d),d=void 0),M&&(t.removeListener("chainChanged",M),M=void 0),r&&(t.removeListener("disconnect",r),r=void 0),t.disconnect(),(e=t.close)==null||e.call(t)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(e=>D(e))},async getChainId(){const e=await(await this.getProvider()).request({method:"eth_chainId"});return Number(e)},async getProvider(){if(!p){const{createCoinbaseWalletSDK:t}=await(()=>{try{return b(()=>import("./index-Buf412yH.js"),__vite__mapDeps([26,6,4,7,8,1,3,5,18,10,11,19,9,12,13,14,15,16,17,20,21,25]))}catch{throw new Error('dependency "@coinbase/wallet-sdk" not found')}})();p=t({...l,appChainIds:o.chains.map(c=>c.id),preference:{options:"all",...l.preference??{}}}).getProvider()}return p},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:t,chainId:e}){var n,i,s,u;const c=o.chains.find(g=>g.id===e);if(!c)throw new L(new O);const a=await this.getProvider();try{return await a.request({method:"wallet_switchEthereumChain",params:[{chainId:z(c.id)}]}),c}catch(g){if(g.code===4902)try{let w;t!=null&&t.blockExplorerUrls?w=t.blockExplorerUrls:w=(n=c.blockExplorers)!=null&&n.default.url?[(i=c.blockExplorers)==null?void 0:i.default.url]:[];let y;(s=t==null?void 0:t.rpcUrls)!=null&&s.length?y=t.rpcUrls:y=[((u=c.rpcUrls.default)==null?void 0:u.http[0])??""];const h={blockExplorerUrls:w,chainId:z(e),chainName:(t==null?void 0:t.chainName)??c.name,iconUrls:t==null?void 0:t.iconUrls,nativeCurrency:(t==null?void 0:t.nativeCurrency)??c.nativeCurrency,rpcUrls:y};return await a.request({method:"wallet_addEthereumChain",params:[h]}),c}catch(w){throw new f(w)}throw new L(g)}},onAccountsChanged(t){t.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:t.map(e=>D(e))})},onChainChanged(t){const e=Number(t);o.emitter.emit("change",{chainId:e})},async onDisconnect(t){o.emitter.emit("disconnect");const e=await this.getProvider();d&&(e.removeListener("accountsChanged",d),d=void 0),M&&(e.removeListener("chainChanged",M),M=void 0),r&&(e.removeListener("disconnect",r),r=void 0)}}))}R.type="metaMask";function R(l={}){let p,d;return T(M=>({id:"metaMaskSDK",name:"MetaMask",rdns:["io.metamask","io.metamask.mobile"],type:R.type,async connect({chainId:r,isReconnecting:o,withCapabilities:t}={}){const e=await this.getInstance(),c=e.getProvider();let a=[];o&&(a=await this.getAccounts().catch(()=>[]));try{let n,i;if(!(a!=null&&a.length)){const u=M.chains.map(g=>z(g.id));l.connectAndSign||l.connectWith?(l.connectAndSign?n=(await e.connectAndSign({chainIds:u,message:l.connectAndSign})).signature:l.connectWith&&(i=(await e.connectWith({chainIds:u,method:l.connectWith.method,params:l.connectWith.params})).result),a=await this.getAccounts()):a=(await e.connect({chainIds:u})).accounts.map(w=>D(w))}let s=await this.getChainId();if(r&&s!==r){const u=await this.switchChain({chainId:r}).catch(g=>{if(g.code===f.code)throw g;return{id:s}});s=(u==null?void 0:u.id)??s}return n?c.emit("connectAndSign",{accounts:a,chainId:z(s),signResponse:n}):i&&c.emit("connectWith",{accounts:a,chainId:z(s),connectWithResponse:i}),{accounts:t?a.map(u=>({address:u,capabilities:{}})):a,chainId:s}}catch(n){const i=n;throw i.code===f.code?new f(i):i.code===Y.code?new Y(i):i}},async disconnect(){return(await this.getInstance()).disconnect()},async getAccounts(){var e;if(!p&&!d){const c=(e=M.providers[0])==null?void 0:e.provider;if(c)return(await c.request({method:"eth_accounts"})).map(n=>D(n))}const r=await this.getInstance();return r.accounts.length?r.accounts.map(c=>D(c)):(await r.getProvider().request({method:"eth_accounts"})).map(c=>D(c))},async getChainId(){var e;if(!p&&!d){const c=(e=M.providers[0])==null?void 0:e.provider;if(c){const a=await c.request({method:"eth_chainId"});return Number(a)}}const r=await this.getInstance();if(r.getChainId())return Number(r.getChainId());const t=await r.getProvider().request({method:"eth_chainId"});return Number(t)},async getProvider(){var o;if(!p&&!d){const t=(o=M.providers[0])==null?void 0:o.provider;if(t)return t}return(await this.getInstance()).getProvider()},async isAuthorized(){var r;try{if(!p&&!d){const e=(r=M.providers[0])==null?void 0:r.provider;if(e)return(await e.request({method:"eth_accounts"})).length>0}const o=10;return!!(await m(async()=>E(async()=>{const e=await this.getAccounts();if(!e.length)throw new Error("try again");return e},{timeout:o}),{delay:o+1,retryCount:3})).length}catch{return!1}},async switchChain({addEthereumChainParameter:r,chainId:o}){var c,a;const t=M.chains.find(({id:n})=>n===Number(o));if(!t)throw new L(new O);const e=z(o);try{return await(await this.getInstance()).switchChain({chainId:e,chainConfiguration:{blockExplorerUrls:r!=null&&r.blockExplorerUrls?[...r.blockExplorerUrls]:(c=t.blockExplorers)!=null&&c.default.url?[t.blockExplorers.default.url]:void 0,chainId:e,chainName:(r==null?void 0:r.chainName)??t.name,iconUrls:r==null?void 0:r.iconUrls,nativeCurrency:(r==null?void 0:r.nativeCurrency)??t.nativeCurrency,rpcUrls:r!=null&&r.rpcUrls?[...r.rpcUrls]:(a=t.rpcUrls.default)!=null&&a.http?[...t.rpcUrls.default.http]:void 0}}),t}catch(n){const i=n;throw i.code===f.code?new f(i):new L(i)}},async onAccountsChanged(r){M.emitter.emit("change",{accounts:r.map(o=>D(o))})},onChainChanged(r){const o=Number(r);M.emitter.emit("change",{chainId:o})},async onConnect(r){const o=await this.getAccounts();if(o.length===0)return;const t=Number(r.chainId);M.emitter.emit("connect",{accounts:o,chainId:t})},async onDisconnect(r){r&&r.code===1013&&await this.getProvider()&&(await this.getAccounts()).length||M.emitter.emit("disconnect")},onDisplayUri(r){M.emitter.emit("message",{type:"display_uri",data:r})},async getInstance(){var r;if(!p){if(!d){const{createEVMClient:o}=await(async()=>{try{return b(()=>import("./connectors-BkiAkXrA.js"),[])}catch{throw new Error('dependency "@metamask/connect-evm" not found')}})(),t=typeof window>"u"?{name:"wagmi"}:{name:window.location.hostname,url:window.location.href};d=o({...l,skipAutoAnnounce:!0,api:{supportedNetworks:Object.fromEntries(M.chains.map(e=>{var c;return[z(e.id),((c=e.rpcUrls.default)==null?void 0:c.http[0])??""]}))},dapp:l.dapp??{...t,...l.dappMetadata},debug:l.debug??((r=l.logging)==null?void 0:r.sdk),eventHandlers:{accountsChanged:this.onAccountsChanged.bind(this),chainChanged:this.onChainChanged.bind(this),connect:this.onConnect.bind(this),disconnect:this.onDisconnect.bind(this),displayUri:this.onDisplayUri.bind(this)},analytics:{integrationType:"wagmi"},ui:{...l.ui,...l.headless!=null&&{headless:l.headless}},...l.mobile&&{mobile:l.mobile}})}p=await d}return p}}))}function ft(l={}){const p=d=>typeof d.on=="function"&&typeof d.removeListener=="function";return T(d=>{const M=d.chains??l.chains??[],r=d.transports?d.transports:l.transports;let o,t,e,c,a;return{async connect({chainId:n=M[0].id,...i}={}){const s="isReconnecting"in i&&i.isReconnecting||!1,u="withCapabilities"in i&&i.withCapabilities||!1;let g=[],w;if(s&&([g,w]=await Promise.all([this.getAccounts().catch(()=>[]),this.getChainId().catch(()=>{})]),n&&w!==n)){const h=await this.switchChain({chainId:n}).catch(I=>{if(I.code===f.code)throw I;return{id:w}});w=(h==null?void 0:h.id)??w}const y=await this.getProvider();try{if(!(g!=null&&g.length)&&!s){const{RpcSchema:h}=await(()=>{try{return b(()=>import("./connectors-mXb62Iam.js"),[])}catch{throw new Error('dependency "porto" not found')}})(),{z:I}=await(()=>{try{return b(()=>import("./connectors-DAWtxdNk.js"),[])}catch{throw new Error('dependency "porto/internal" not found')}})(),j=await y.request({method:"wallet_connect",params:[{..."capabilities"in i?{capabilities:I.encode(h.wallet_connect.Capabilities,i.capabilities??{})}:{},chainIds:[z(n),...M.filter(A=>A.id!==n).map(A=>z(A.id))]}]});g=j.accounts,w=Number(j.chainIds[0])}if(!w)throw new O;return p(y)&&(c&&(y.removeListener("connect",c),c=void 0),t||(t=this.onAccountsChanged.bind(this),y.on("accountsChanged",t)),e||(e=this.onChainChanged.bind(this),y.on("chainChanged",e)),a||(a=this.onDisconnect.bind(this),y.on("disconnect",a))),{accounts:g.map(h=>typeof h=="object"?u?h:h.address:u?{address:h,capabilities:{}}:h),chainId:w}}catch(h){const I=h;throw I.code===f.code?new f(I):I}},async disconnect(){const n=await this.getProvider();p(n)&&(e&&(n.removeListener("chainChanged",e),e=void 0),a&&(n.removeListener("disconnect",a),a=void 0),c||(c=this.onConnect.bind(this),n.on("connect",c))),await n.request({method:"wallet_disconnect"})},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(s=>D(s))},async getChainId(){const i=await(await this.getProvider()).request({method:"eth_chainId"});return Number(i)},async getPortoInstance(){return o??(o=(async()=>{const{Porto:n}=await(()=>{try{return b(()=>import("./connectors-mXb62Iam.js"),[])}catch{throw new Error('dependency "porto" not found')}})();return n.create({...l,announceProvider:!1,chains:M,transports:r})})()),await o},async getProvider(){return(await this.getPortoInstance()).provider},icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDIyIiBoZWlnaHQ9IjQyMiIgdmlld0JveD0iMCAwIDQyMiA0MjIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSI0MjIiIGhlaWdodD0iNDIyIiBmaWxsPSJibGFjayIvPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfMV8xNSkiPgo8cGF0aCBkPSJNODEgMjg2LjM2NkM4MSAyODAuODkzIDg1LjQ1MDUgMjc2LjQ1NSA5MC45NDA0IDI3Ni40NTVIMzI5LjUxMUMzMzUuMDAxIDI3Ni40NTUgMzM5LjQ1MiAyODAuODkzIDMzOS40NTIgMjg2LjM2NlYzMDYuMTg4QzMzOS40NTIgMzExLjY2MiAzMzUuMDAxIDMxNi4wOTkgMzI5LjUxMSAzMTYuMDk5SDkwLjk0MDRDODUuNDUwNSAzMTYuMDk5IDgxIDMxMS42NjIgODEgMzA2LjE4OFYyODYuMzY2WiIgZmlsbD0id2hpdGUiIGZpbGwtb3BhY2l0eT0iMC41Ii8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTAuOTQwNCAyMzQuODI4Qzg1LjQ1MDUgMjM0LjgyOCA4MSAyMzkuMjY2IDgxIDI0NC43MzlWMjcxLjUzMUM4My44NDMyIDI2OS42MzMgODcuMjYyMiAyNjguNTI2IDkwLjk0MDQgMjY4LjUyNkgzMjkuNTExQzMzMy4xODggMjY4LjUyNiAzMzYuNjA4IDI2OS42MzMgMzM5LjQ1MiAyNzEuNTMxVjI0NC43MzlDMzM5LjQ1MiAyMzkuMjY2IDMzNS4wMDEgMjM0LjgyOCAzMjkuNTExIDIzNC44MjhIOTAuOTQwNFpNMzM5LjQ1MiAyODYuMzY2QzMzOS40NTIgMjgwLjg5MyAzMzUuMDAxIDI3Ni40NTUgMzI5LjUxMSAyNzYuNDU1SDkwLjk0MDRDODUuNDUwNSAyNzYuNDU1IDgxIDI4MC44OTMgODEgMjg2LjM2NlYzMDYuMTlDODEgMzExLjY2NCA4NS40NTA1IDMxNi4xMDEgOTAuOTQwNCAzMTYuMTAxSDMyOS41MTFDMzM1LjAwMSAzMTYuMTAxIDMzOS40NTIgMzExLjY2NCAzMzkuNDUyIDMwNi4xOVYyODYuMzY2WiIgZmlsbD0id2hpdGUiIGZpbGwtb3BhY2l0eT0iMC41Ii8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTAuOTQwNCAxOTMuMjAxQzg1LjQ1MDUgMTkzLjIwMSA4MSAxOTcuNjM4IDgxIDIwMy4xMTJWMjI5LjkwM0M4My44NDMyIDIyOC4wMDYgODcuMjYyMiAyMjYuODk5IDkwLjk0MDQgMjI2Ljg5OUgzMjkuNTExQzMzMy4xODggMjI2Ljg5OSAzMzYuNjA4IDIyOC4wMDYgMzM5LjQ1MiAyMjkuOTAzVjIwMy4xMTJDMzM5LjQ1MiAxOTcuNjM4IDMzNS4wMDEgMTkzLjIwMSAzMjkuNTExIDE5My4yMDFIOTAuOTQwNFpNMzM5LjQ1MiAyNDQuNzM5QzMzOS40NTIgMjM5LjI2NSAzMzUuMDAxIDIzNC44MjggMzI5LjUxMSAyMzQuODI4SDkwLjk0MDRDODUuNDUwNSAyMzQuODI4IDgxIDIzOS4yNjUgODEgMjQ0LjczOVYyNzEuNTNDODEuMjE3NSAyNzEuMzg1IDgxLjQzODMgMjcxLjI0NSA4MS42NjI0IDI3MS4xMDlDODMuODMyNSAyNjkuNzk0IDg2LjMwNTQgMjY4LjkyNyA4OC45NTIzIDI2OC42MzVDODkuNjA1MSAyNjguNTYzIDkwLjI2ODQgMjY4LjUyNiA5MC45NDA0IDI2OC41MjZIMzI5LjUxMUMzMzAuMTgzIDI2OC41MjYgMzMwLjg0NiAyNjguNTYzIDMzMS40OTggMjY4LjYzNUMzMzQuNDE5IDI2OC45NTcgMzM3LjEyOCAyNjkuOTggMzM5LjQ1MiAyNzEuNTNWMjQ0LjczOVpNMzM5LjQ1MiAyODYuMzY2QzMzOS40NTIgMjgxLjAyMSAzMzUuMjA2IDI3Ni42NjMgMzI5Ljg5MyAyNzYuNDYyQzMyOS43NjcgMjc2LjQ1NyAzMjkuNjQgMjc2LjQ1NSAzMjkuNTExIDI3Ni40NTVIOTAuOTQwNEM4NS40NTA1IDI3Ni40NTUgODEgMjgwLjg5MyA4MSAyODYuMzY2VjMwNi4xODhDODEgMzExLjY2MiA4NS40NTA1IDMxNi4xMDEgOTAuOTQwNCAzMTYuMTAxSDMyOS41MTFDMzM1LjAwMSAzMTYuMTAxIDMzOS40NTIgMzExLjY2MiAzMzkuNDUyIDMwNi4xODhWMjg2LjM2NloiIGZpbGw9IndoaXRlIiBmaWxsLW9wYWNpdHk9IjAuNSIvPgo8cGF0aCBvcGFjaXR5PSIwLjMiIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTguMDE0NiAxMDRDODguNjE3NyAxMDQgODEgMTExLjU5NSA4MSAxMjAuOTY1VjE4OC4yNzZDODMuODQzMiAxODYuMzc5IDg3LjI2MjIgMTg1LjI3MiA5MC45NDA0IDE4NS4yNzJIMzI5LjUxMUMzMzMuMTg4IDE4NS4yNzIgMzM2LjYwOCAxODYuMzc5IDMzOS40NTIgMTg4LjI3NlYxMjAuOTY1QzMzOS40NTIgMTExLjU5NSAzMzEuODMzIDEwNCAzMjIuNDM3IDEwNEg5OC4wMTQ2Wk0zMzkuNDUyIDIwMy4xMTJDMzM5LjQ1MiAxOTcuNjM4IDMzNS4wMDEgMTkzLjIwMSAzMjkuNTExIDE5My4yMDFIOTAuOTQwNEM4NS40NTA1IDE5My4yMDEgODEgMTk3LjYzOCA4MSAyMDMuMTEyVjIyOS45MDNDODEuMjE3NSAyMjkuNzU4IDgxLjQzODMgMjI5LjYxOCA4MS42NjI0IDIyOS40ODJDODMuODMyNSAyMjguMTY3IDg2LjMwNTQgMjI3LjMgODguOTUyMyAyMjcuMDA4Qzg5LjYwNTEgMjI2LjkzNiA5MC4yNjg0IDIyNi44OTkgOTAuOTQwNCAyMjYuODk5SDMyOS41MTFDMzMwLjE4MyAyMjYuODk5IDMzMC44NDYgMjI2LjkzNiAzMzEuNDk4IDIyNy4wMDhDMzM0LjQxOSAyMjcuMzMgMzM3LjEyOCAyMjguMzUyIDMzOS40NTIgMjI5LjkwM1YyMDMuMTEyWk0zMzkuNDUyIDI0NC43MzlDMzM5LjQ1MiAyMzkuMzkzIDMzNS4yMDYgMjM1LjAzNiAzMjkuODkzIDIzNC44MzVDMzI5Ljc2NyAyMzQuODMgMzI5LjY0IDIzNC44MjggMzI5LjUxMSAyMzQuODI4SDkwLjk0MDRDODUuNDUwNSAyMzQuODI4IDgxIDIzOS4yNjUgODEgMjQ0LjczOVYyNzEuNTNMODEuMDcwNyAyNzEuNDgzQzgxLjI2NTMgMjcxLjM1NSA4MS40NjI1IDI3MS4yMyA4MS42NjI0IDI3MS4xMDlDODEuOTA4MyAyNzAuOTYgODIuMTU4MSAyNzAuODE3IDgyLjQxMTcgMjcwLjY3OUM4NC4zOTUzIDI2OS42MDUgODYuNjA1NCAyNjguODk0IDg4Ljk1MjMgMjY4LjYzNUM4OS4wMDUyIDI2OC42MjkgODkuMDU4IDI2OC42MjQgODkuMTExIDI2OC42MThDODkuNzEyNSAyNjguNTU3IDkwLjMyMjggMjY4LjUyNiA5MC45NDA0IDI2OC41MjZIMzI5LjUxMUMzMjkuNzM4IDI2OC41MjYgMzI5Ljk2NSAyNjguNTMgMzMwLjE5MiAyNjguNTM5QzMzMC42MzEgMjY4LjU1NSAzMzEuMDY3IDI2OC41ODcgMzMxLjQ5OCAyNjguNjM1QzMzNC40MTkgMjY4Ljk1NyAzMzcuMTI4IDI2OS45OCAzMzkuNDUyIDI3MS41M1YyNDQuNzM5Wk0zMzkuNDUyIDI4Ni4zNjZDMzM5LjQ1MiAyODEuMDIxIDMzNS4yMDYgMjc2LjY2MyAzMjkuODkzIDI3Ni40NjJMMzI5Ljg2NSAyNzYuNDYxQzMyOS43NDggMjc2LjQ1NyAzMjkuNjI5IDI3Ni40NTUgMzI5LjUxMSAyNzYuNDU1SDkwLjk0MDRDODUuNDUwNSAyNzYuNDU1IDgxIDI4MC44OTMgODEgMjg2LjM2NlYzMDYuMTg4QzgxIDMxMS42NjIgODUuNDUwNSAzMTYuMTAxIDkwLjk0MDQgMzE2LjEwMUgzMjkuNTExQzMzNS4wMDEgMzE2LjEwMSAzMzkuNDUyIDMxMS42NjIgMzM5LjQ1MiAzMDYuMTg4VjI4Ni4zNjZaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNMjY5Ljg2OCAxMzEuNzUyQzI2OS44NjggMTI2LjI3OCAyNzQuMzE4IDEyMS44NCAyNzkuODA4IDEyMS44NEgzMTEuNjE4QzMxNy4xMDggMTIxLjg0IDMyMS41NTggMTI2LjI3OCAzMjEuNTU4IDEzMS43NTJWMTYxLjQ4NUMzMjEuNTU4IDE2Ni45NTkgMzE3LjEwOCAxNzEuMzk2IDMxMS42MTggMTcxLjM5NkgyNzkuODA4QzI3NC4zMTggMTcxLjM5NiAyNjkuODY4IDE2Ni45NTkgMjY5Ljg2OCAxNjEuNDg1VjEzMS43NTJaIiBmaWxsPSJ3aGl0ZSIvPgo8L2c+CjxkZWZzPgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzFfMTUiPgo8cmVjdCB3aWR0aD0iMjU5IiBoZWlnaHQ9IjIxMyIgZmlsbD0id2hpdGUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDgxIDEwNCkiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K",id:"xyz.ithaca.porto",async isAuthorized(){try{return!!(await m(()=>this.getAccounts())).length}catch{return!1}},name:"Porto",async onAccountsChanged(n){d.emitter.emit("change",{accounts:n.map(i=>D(i))})},onChainChanged(n){const i=Number(n);d.emitter.emit("change",{chainId:i})},async onConnect(n){const i=await this.getAccounts();if(i.length===0)return;const s=Number(n.chainId);d.emitter.emit("connect",{accounts:i,chainId:s});const u=await this.getProvider();p(u)&&(c&&(u.removeListener("connect",c),c=void 0),t||(t=this.onAccountsChanged.bind(this),u.on("accountsChanged",t)),e||(e=this.onChainChanged.bind(this),u.on("chainChanged",e)),a||(a=this.onDisconnect.bind(this),u.on("disconnect",a)))},async onDisconnect(n){const i=await this.getProvider();d.emitter.emit("disconnect"),p(i)&&(e&&(i.removeListener("chainChanged",e),e=void 0),a&&(i.removeListener("disconnect",a),a=void 0),c||(c=this.onConnect.bind(this),i.on("connect",c)))},async setup(){if(!c){const n=await this.getProvider();if(!p(n))return;c=this.onConnect.bind(this),n.on("connect",c)}},async switchChain({chainId:n}){const i=M.find(u=>u.id===n);if(!i)throw new L(new O);return await(await this.getProvider()).request({method:"wallet_switchEthereumChain",params:[{chainId:z(n)}]}),i},type:"injected"}})}W.type="safe";function W(l={}){const{shimDisconnect:p=!1}=l;let d,M;return T(r=>({id:"safe",name:"Safe",type:W.type,async connect({withCapabilities:o}={}){var a;const t=await this.getProvider();if(!t)throw new k;const e=await this.getAccounts(),c=await this.getChainId();return M||(M=this.onDisconnect.bind(this),t.on("disconnect",M)),p&&await((a=r.storage)==null?void 0:a.removeItem("safe.disconnected")),{accounts:o?e.map(n=>({address:n,capabilities:{}})):e,chainId:c}},async disconnect(){var t;const o=await this.getProvider();if(!o)throw new k;M&&(o.removeListener("disconnect",M),M=void 0),p&&await((t=r.storage)==null?void 0:t.setItem("safe.disconnected",!0))},async getAccounts(){const o=await this.getProvider();if(!o)throw new k;return(await o.request({method:"eth_accounts"})).map(D)},async getProvider(){if(typeof window<"u"&&(window==null?void 0:window.parent)!==window){if(!d){const{default:t}=await(()=>{try{return b(()=>import("./index-DRm7xERf.js"),__vite__mapDeps([27,28,10,11,7,4,6,8,20]))}catch{throw new Error('dependency "@safe-global/safe-apps-sdk" not found')}})(),e=new t(l),c=await E(()=>e.safe.getInfo(),{timeout:l.unstable_getInfoTimeout??10});if(!c)throw new Error("Could not load Safe information");const a=await(async()=>{const n=await(()=>{try{return b(()=>import("./index-j1oJp18p.js").then(i=>i.i),__vite__mapDeps([29,4,28,30,7,15,6,8]))}catch{throw new Error('dependency "@safe-global/safe-apps-provider" not found')}})();return typeof n.SafeAppProvider!="function"&&typeof n.default.SafeAppProvider=="function"?n.default.SafeAppProvider:n.SafeAppProvider})();d=new a(c,e)}return d}},async getChainId(){const o=await this.getProvider();if(!o)throw new k;return Number(o.chainId)},async isAuthorized(){var o;try{return p&&await((o=r.storage)==null?void 0:o.getItem("safe.disconnected"))?!1:!!(await this.getAccounts()).length}catch{return!1}},onAccountsChanged(){},onChainChanged(){},onDisconnect(){r.emitter.emit("disconnect")}}))}const Dt="8.0.20";Z.type="walletConnect";function Z(l){const p=l.isNewChainsStale??!0;let d,M;const r="eip155";let o,t,e,c,a,n;return T(i=>({id:"walletConnect",name:"WalletConnect",type:Z.type,async setup(){const s=await this.getProvider().catch(()=>null);s&&(e||(e=this.onConnect.bind(this),s.on("connect",e)),a||(a=this.onSessionDelete.bind(this),s.on("session_delete",a)))},async connect({chainId:s,withCapabilities:u,...g}={}){var w,y;try{const h=await this.getProvider();if(!h)throw new k;c||(c=this.onDisplayUri,h.on("display_uri",c));let I=s;if(!I){const N=await((w=i.storage)==null?void 0:w.getItem("state"))??{};i.chains.some(S=>S.id===N.chainId)?I=N.chainId:I=(y=i.chains[0])==null?void 0:y.id}if(!I)throw new Error("No chains found on connector.");const j=await this.isChainsStale();if(h.session&&j&&await h.disconnect(),!h.session||j){const N=i.chains.filter(C=>C.id!==I).map(C=>C.id);await h.connect({optionalChains:[I,...N],..."pairingTopic"in g?{pairingTopic:g.pairingTopic}:{}}),this.setRequestedChainsIds(i.chains.map(C=>C.id))}const A=(await h.enable()).map(N=>D(N));let v=await this.getChainId();if(s&&v!==s){const N=await this.switchChain({chainId:s}).catch(C=>{var S;if(C.code===f.code&&((S=C.cause)==null?void 0:S.message)!=="Missing or invalid. request() method: wallet_addEthereumChain")throw C;return{id:v}});v=(N==null?void 0:N.id)??v}return c&&(h.removeListener("display_uri",c),c=void 0),e&&(h.removeListener("connect",e),e=void 0),o||(o=this.onAccountsChanged.bind(this),h.on("accountsChanged",o)),t||(t=this.onChainChanged.bind(this),h.on("chainChanged",t)),n||(n=this.onDisconnect.bind(this),h.on("disconnect",n)),a||(a=this.onSessionDelete.bind(this),h.on("session_delete",a)),{accounts:u?A.map(N=>({address:N,capabilities:{}})):A,chainId:v}}catch(h){throw/(user rejected|connection request reset)/i.test(h==null?void 0:h.message)?new f(h):h}},async disconnect(){const s=await this.getProvider();try{await(s==null?void 0:s.disconnect())}catch(u){if(!/No matching key/i.test(u.message))throw u}finally{t&&(s==null||s.removeListener("chainChanged",t),t=void 0),n&&(s==null||s.removeListener("disconnect",n),n=void 0),e||(e=this.onConnect.bind(this),s==null||s.on("connect",e)),o&&(s==null||s.removeListener("accountsChanged",o),o=void 0),a&&(s==null||s.removeListener("session_delete",a),a=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(u=>D(u))},async getProvider({chainId:s}={}){var g;async function u(){const w=i.chains.map(h=>h.id);if(!w.length)return;const{EthereumProvider:y}=await(()=>{try{return b(()=>import("./index.es-7keraYJG.js").then(h=>h.n),__vite__mapDeps([31,6,4,7,8,15,32,14,25,33,34,16]))}catch{throw new Error('dependency "@walletconnect/ethereum-provider" not found')}})();return await y.init({...l,disableProviderPing:!0,optionalChains:w,projectId:l.projectId,rpcMap:Object.fromEntries(i.chains.map(h=>{const[I]=$({chain:h,transports:i.transports});return[h.id,I]})),showQrModal:l.showQrModal??!0})}return d||(M||(M=u()),d=await M,d==null||d.events.setMaxListeners(Number.POSITIVE_INFINITY)),s&&await((g=this.switchChain)==null?void 0:g.call(this,{chainId:s})),d},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[s,u]=await Promise.all([this.getAccounts(),this.getProvider()]);return s.length?await this.isChainsStale()&&u.session?(await u.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:s,chainId:u}){var h,I,j;const g=await this.getProvider();if(!g)throw new k;const w=i.chains.find(A=>A.id===u);if(!w)throw new L(new O);let y=()=>{};try{await Promise.all([new Promise(v=>{y=N=>{N.chainId===u&&(i.emitter.off("change",y),v())},i.emitter.on("change",y)}),g.request({method:"wallet_switchEthereumChain",params:[{chainId:z(u)}]})]);const A=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...A,u]),w}catch(A){i.emitter.off("change",y);const v=A;if(/(user rejected)/i.test(v.message))throw new f(v);try{let N;s!=null&&s.blockExplorerUrls?N=s.blockExplorerUrls:N=(h=w.blockExplorers)!=null&&h.default.url?[(I=w.blockExplorers)==null?void 0:I.default.url]:[];let C;(j=s==null?void 0:s.rpcUrls)!=null&&j.length?C=s.rpcUrls:C=[...w.rpcUrls.default.http];const S={blockExplorerUrls:N,chainId:z(u),chainName:(s==null?void 0:s.chainName)??w.name,iconUrls:s==null?void 0:s.iconUrls,nativeCurrency:(s==null?void 0:s.nativeCurrency)??w.nativeCurrency,rpcUrls:C};await g.request({method:"wallet_addEthereumChain",params:[S]});const V=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...V,u]),w}catch(N){throw new f(N)}}},onAccountsChanged(s){s.length===0?this.onDisconnect():i.emitter.emit("change",{accounts:s.map(u=>D(u))})},onChainChanged(s){const u=Number(s);i.emitter.emit("change",{chainId:u})},async onConnect(s){const u=Number(s.chainId),g=await this.getAccounts();i.emitter.emit("connect",{accounts:g,chainId:u})},async onDisconnect(s){this.setRequestedChainsIds([]),i.emitter.emit("disconnect");const u=await this.getProvider();o&&(u.removeListener("accountsChanged",o),o=void 0),t&&(u.removeListener("chainChanged",t),t=void 0),n&&(u.removeListener("disconnect",n),n=void 0),a&&(u.removeListener("session_delete",a),a=void 0),e||(e=this.onConnect.bind(this),u.on("connect",e))},onDisplayUri(s){i.emitter.emit("message",{type:"display_uri",data:s})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var u,g,w;return d?((w=(g=(u=d.session)==null?void 0:u.namespaces[r])==null?void 0:g.accounts)==null?void 0:w.map(y=>Number.parseInt(y.split(":")[1]||"",10)))??[]:[]},async getRequestedChainsIds(){var s;return await((s=i.storage)==null?void 0:s.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!p)return!1;const s=i.chains.map(w=>w.id),u=this.getNamespaceChainsIds();if(u.length&&!u.some(w=>s.includes(w)))return!1;const g=await this.getRequestedChainsIds();return!s.every(w=>g.includes(w))},async setRequestedChainsIds(s){var u;await((u=i.storage)==null?void 0:u.setItem(this.requestedChainsStorageKey,s))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}}))}export{yt as baseAccount,q as coinbaseWallet,zt as injected,R as metaMask,Q as mock,ft as porto,W as safe,It as tempoWallet,Dt as version,Z as walletConnect};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BaSqmd6J.js","assets/hooks.module-C4R15-Vr.js","assets/jsxRuntime.module-wfFNtqye.js","assets/index-CQB-2hib.js","assets/react-Vu6nbGi5.js","assets/index-COjgItKg.js","assets/index-C7-iTfFV.js","assets/ethers-DHDSyreX.js","assets/index-DCrqkiFN.css","assets/parseSignature-kOoafZEo.js","assets/sendRawTransaction-DT-ObNx8.js","assets/NetworkUtil-Ddexw9-U.js","assets/custom-C6VO1Je_.js","assets/W3MFrameProviderSingleton-D4DCXtQm.js","assets/index-CdfeQ7YK.js","assets/index-C6FQ8I_Q.js","assets/browser-ponyfill-rND5WOqr.js","assets/localBatchGatewayRequest-BLJAP4fw.js","assets/verifyHash-BVbpPoSf.js","assets/secp256k1-DFslM7tB.js","assets/hashTypedData-BOc0w62Q.js","assets/WebCryptoP256-OE37a6hF.js","assets/zoraTestnet-CduWQC79.js","assets/serializeTransaction-DawhfTu0.js","assets/writeContract-C3IzBPhR.js","assets/index-nibyPLVP.js","assets/index-DQx-sY_c.js","assets/index-Qzch3HJ1.js","assets/index-BV8s6ez1.js","assets/index-DOTYPGXa.js","assets/native-7uSYstXA.js","assets/index.es-DnMpNe4m.js","assets/index-Pp2oEhTr.js","assets/index-CJdot1dH.js","assets/index.es-IGCEipYb.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as b}from"./index-C7-iTfFV.js";import{c as T,C as O,a as G,P as k}from"./index-DShBCYos.js";import{i as zt}from"./index-DShBCYos.js";import{aI as D,aR as B,bh as F}from"./sendRawTransaction-DT-ObNx8.js";import{x as L,af as z,a5 as _,Y as f,u as x,al as H,r as Y}from"./NetworkUtil-Ddexw9-U.js";import{G as J,w as m,a as E}from"./W3MFrameProviderSingleton-D4DCXtQm.js";import{a as P}from"./custom-C6VO1Je_.js";import"./react-Vu6nbGi5.js";import"./ethers-DHDSyreX.js";import"./index-CdfeQ7YK.js";import"./index-C6FQ8I_Q.js";import"./browser-ponyfill-rND5WOqr.js";import"./index-CQB-2hib.js";import"./index-COjgItKg.js";import"./store-CraP4F4Y.js";import"./writeContract-C3IzBPhR.js";function K(l,{body:p,onError:d,onResponse:M}){return l.request({body:p,onError:d,onResponse:M}),l}async function X(l,{body:p,timeout:d=1e4}){return l.requestAsync({body:p,timeout:d})}const U={http(l,p){return J(l).request(p)},webSocket:K,webSocketAsync:X};Q.type="mock";function Q(l){const p=new Map,d=l.features??{defaultConnected:!1};let M=d.defaultConnected,r;return T(o=>({id:"mock",name:"Mock Connector",type:Q.type,async setup(){r=o.chains[0].id},async connect({chainId:t,withCapabilities:e}={}){if(d.connectError)throw typeof d.connectError=="boolean"?new f(new Error("Failed to connect.")):d.connectError;const a=await(await this.getProvider()).request({method:"eth_requestAccounts"});let n=await this.getChainId();return t&&n!==t&&(n=(await this.switchChain({chainId:t})).id),M=!0,{accounts:e?a.map(i=>({address:D(i),capabilities:{foo:{bar:i}}})):a.map(i=>D(i)),chainId:n}},async disconnect(){M=!1},async getAccounts(){if(!M)throw new G;return(await(await this.getProvider()).request({method:"eth_accounts"})).map(c=>D(c))},async getChainId(){const e=await(await this.getProvider()).request({method:"eth_chainId"});return _(e,"number")},async isAuthorized(){return!d.reconnect||!M?!1:!!(await this.getAccounts()).length},async switchChain({chainId:t}){const e=await this.getProvider(),c=o.chains.find(a=>a.id===t);if(!c)throw new L(new O);return await e.request({method:"wallet_switchEthereumChain",params:[{chainId:z(t)}]}),c},onAccountsChanged(t){t.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:t.map(e=>D(e))})},onChainChanged(t){const e=Number(t);o.emitter.emit("change",{chainId:e})},async onDisconnect(t){o.emitter.emit("disconnect"),M=!1},async getProvider({chainId:t}={}){const c=(o.chains.find(n=>n.id===t)??o.chains[0]).rpcUrls.default.http[0];return P({request:async({method:n,params:i})=>{if(n==="eth_chainId")return z(r);if(n==="eth_accounts"||n==="eth_requestAccounts")return l.accounts;if(n==="eth_signTypedData_v4"&&d.signTypedDataError)throw typeof d.signTypedDataError=="boolean"?new f(new Error("Failed to sign typed data.")):d.signTypedDataError;if(n==="wallet_switchEthereumChain"){if(d.switchChainError)throw typeof d.switchChainError=="boolean"?new f(new Error("Failed to switch chain.")):d.switchChainError;r=_(i[0].chainId,"number"),this.onChainChanged(r.toString());return}if(n==="wallet_watchAsset"){if(d.watchAssetError)throw typeof d.watchAssetError=="boolean"?new f(new Error("Failed to switch chain.")):d.watchAssetError;return M}if(n==="wallet_getCapabilities")return{"0x2105":{paymasterService:{supported:i[0]==="0x95132632579b073D12a6673e18Ab05777a6B86f8"},sessionKeys:{supported:!0}},"0x14A34":{paymasterService:{supported:i[0]==="0x95132632579b073D12a6673e18Ab05777a6B86f8"}}};if(n==="wallet_sendCalls"){const w=[],y=i[0].calls,h=i[0].from;for(const j of y){const{result:A,error:v}=await U.http(c,{body:{method:"eth_sendTransaction",params:[{...j,...typeof h<"u"?{from:h}:{}}]}});if(v)throw new x({body:{method:n,params:i},error:v,url:c});w.push(A)}const I=B(H(JSON.stringify(y)));return p.set(I,w),{id:I}}if(n==="wallet_getCallsStatus"){const w=p.get(i[0]);if(!w)return{atomic:!1,chainId:"0x1",id:i[0],status:100,receipts:[],version:"2.0.0"};const h=(await Promise.all(w.map(async I=>{const{result:j,error:A}=await U.http(c,{body:{method:"eth_getTransactionReceipt",params:[I],id:0}});if(A)throw new x({body:{method:n,params:i},error:A,url:c});return j?{blockHash:j.blockHash,blockNumber:j.blockNumber,gasUsed:j.gasUsed,logs:j.logs,status:j.status,transactionHash:j.transactionHash}:null}))).filter(I=>I!==null);return h.length===0?{atomic:!1,chainId:"0x1",id:i[0],status:100,receipts:[],version:"2.0.0"}:{atomic:!1,chainId:"0x1",id:i[0],status:200,receipts:h,version:"2.0.0"}}if(n==="wallet_showCallsStatus")return;if(n==="personal_sign"){if(d.signMessageError)throw typeof d.signMessageError=="boolean"?new f(new Error("Failed to sign message.")):d.signMessageError;n="eth_sign",i=[i[1],i[0]]}const s={method:n,params:i},{error:u,result:g}=await U.http(c,{body:s});if(u)throw new x({body:s,error:u,url:c});return g}})({retryCount:0})}}))}function $(l){var o,t,e;const{chain:p}=l,d=p.rpcUrls.default.http[0];if(!l.transports)return[d];const M=(t=(o=l.transports)==null?void 0:o[p.id])==null?void 0:t.call(o,{chain:p});return(((e=M==null?void 0:M.value)==null?void 0:e.transports)||[M]).map(({value:c})=>(c==null?void 0:c.url)||d)}const tt='data:image/svg+xml,<svg width="269" height="269" viewBox="0 0 269 269" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="269" height="269" fill="black"/><path d="M123.273 190.794H93.445L121.09 105.318H85.7334L93.445 80.2642H191.95L184.238 105.318H150.773L123.273 190.794Z" fill="white"/></svg>';function It(l={}){const{dialog:p,host:d,icon:M=tt,name:r,rdns:o,theme:t,...e}=l;return nt({createAdapter(c){return c.dialog({dialog:p,host:d,icon:M,name:r,rdns:o,theme:t})},icon:M,id:o??"xyz.tempo",name:r??"Tempo Wallet",providerParameters:e,rdns:o??"xyz.tempo",type:"injected"})}function nt(l){return T(p=>{const d=p.chains;let M,r,o,t,e;async function c(){return await b(()=>import("./core-BIHI7g3E.js"),[]).catch(()=>{throw new Error('dependency "accounts" not found')})}async function a(){return M??(M=(async()=>{const n=await c();return n.Provider.create({...l.providerParameters,adapter:l.createAdapter(n),chains:p.chains,transports:p.transports})})()),await M}return{icon:l.icon,id:l.id,name:l.name,rdns:l.rdns,type:l.type,async connect(n={}){const{chainId:i,isReconnecting:s,withCapabilities:u}=n,g="capabilities"in n?n.capabilities:void 0;let w=[],y;s&&(w=await this.getAccounts().then(h=>h.map(I=>({address:I,capabilities:{}}))).catch(()=>[]));try{if(!w.length&&!s&&(w=(await(await a()).request({method:"wallet_connect",params:[{...i?{chainId:i}:{},...g?{capabilities:g}:{}}]})).accounts),y??(y=await this.getChainId()),!y)throw new O;const h=await a();return t&&(h.removeListener("connect",t),t=void 0),r||(r=this.onAccountsChanged.bind(this),h.on("accountsChanged",r)),o||(o=this.onChainChanged.bind(this),h.on("chainChanged",o)),e||(e=this.onDisconnect.bind(this),h.on("disconnect",e)),{accounts:u?w:w.map(I=>I.address),chainId:y}}catch(h){const I=h;throw I.code===f.code?new f(I):I}},async disconnect(){var i;const n=await a();o&&(n.removeListener("chainChanged",o),o=void 0),e&&(n.removeListener("disconnect",e),e=void 0),t||(t=(i=this.onConnect)==null?void 0:i.bind(this),t&&n.on("connect",t)),await n.request({method:"wallet_disconnect"})},async getAccounts(){return await(await a()).request({method:"eth_accounts"})},async getChainId(){const n=await a();return Number(await n.request({method:"eth_chainId"}))},async getClient({chainId:n}={}){const i=await a(),{address:s}=i.getAccount({accessKey:!1});return Object.assign(i.getClient({chainId:n}),{account:F(s)})},async getProvider(){return await a()},async isAuthorized(){try{return!!(await m(()=>this.getAccounts())).length}catch{return!1}},onAccountsChanged(n){p.emitter.emit("change",{accounts:n})},onChainChanged(n){p.emitter.emit("change",{chainId:Number(n)})},async onConnect(n){const i=await this.getAccounts();if(i.length===0)return;const s=Number(n.chainId);p.emitter.emit("connect",{accounts:i,chainId:s});const u=await a();t&&(u.removeListener("connect",t),t=void 0),r||(r=this.onAccountsChanged.bind(this),u.on("accountsChanged",r)),o||(o=this.onChainChanged.bind(this),u.on("chainChanged",o)),e||(e=this.onDisconnect.bind(this),u.on("disconnect",e))},async onDisconnect(n){var s;const i=await a();p.emitter.emit("disconnect"),o&&(i.removeListener("chainChanged",o),o=void 0),e&&(i.removeListener("disconnect",e),e=void 0),t||(t=(s=this.onConnect)==null?void 0:s.bind(this),t&&i.on("connect",t))},async setup(){var n;if(!t){const i=await a();t=(n=this.onConnect)==null?void 0:n.bind(this),t&&i.on("connect",t)}},async switchChain({chainId:n}){const i=d.find(u=>u.id===n);if(!i)throw new L(new O);return await(await a()).request({method:"wallet_switchEthereumChain",params:[{chainId:z(n)}]}),i}}})}function yt(l={}){let p,d,M,r;return T(o=>({id:"baseAccount",name:"Base Account",rdns:"app.base.account",type:"baseAccount",async connect({chainId:t,withCapabilities:e,...c}={}){var a;try{const n=await this.getProvider(),i=t??((a=o.chains[0])==null?void 0:a.id);if(!i)throw new O;let{accounts:s,currentChainId:u}=await(async()=>{if(c.isReconnecting)return{accounts:(await n.request({method:"eth_accounts",params:[]})).map(h=>({address:D(h)})),currentChainId:await this.getChainId()};const g=await n.request({method:"wallet_connect",params:[{capabilities:"capabilities"in c&&c.capabilities?c.capabilities:{},chainIds:[z(i),...o.chains.filter(h=>h.id!==i).map(h=>z(h.id))]}]});return{accounts:(await n.request({method:"eth_accounts"})).map(h=>g.accounts.find(I=>I.address===h)??{address:h}).map(h=>({address:D(h.address),capabilities:h.capabilities??{}})),currentChainId:Number(g.chainIds[0])}})();if(d||(d=this.onAccountsChanged.bind(this),n.on("accountsChanged",d)),M||(M=this.onChainChanged.bind(this),n.on("chainChanged",M)),r||(r=this.onDisconnect.bind(this),n.on("disconnect",r)),t&&u!==t){const g=await this.switchChain({chainId:t}).catch(w=>{if(w.code===f.code)throw w;return{id:u}});u=(g==null?void 0:g.id)??u}return{accounts:e?s:s.map(g=>g.address),chainId:u}}catch(n){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(n.message)?new f(n):n}},async disconnect(){const t=await this.getProvider();d&&(t.removeListener("accountsChanged",d),d=void 0),M&&(t.removeListener("chainChanged",M),M=void 0),r&&(t.removeListener("disconnect",r),r=void 0),t.disconnect()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(e=>D(e))},async getChainId(){const e=await(await this.getProvider()).request({method:"eth_chainId"});return Number(e)},async getProvider(){if(!p){const t=(()=>{var a;return typeof l.preference=="string"?{options:l.preference}:{...l.preference,options:((a=l.preference)==null?void 0:a.options)??"all"}})(),{createBaseAccountSDK:e}=await(()=>{try{return b(()=>import("./index-BaSqmd6J.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]))}catch{throw new Error('dependency "@base-org/account" not found')}})();p=e({...l,appChainIds:o.chains.map(a=>a.id),preference:t}).getProvider()}return p},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:t,chainId:e}){var n,i,s,u;const c=o.chains.find(g=>g.id===e);if(!c)throw new L(new O);const a=await this.getProvider();try{return await a.request({method:"wallet_switchEthereumChain",params:[{chainId:z(c.id)}]}),c}catch(g){if(g.code===4902)try{let w;t!=null&&t.blockExplorerUrls?w=t.blockExplorerUrls:w=(n=c.blockExplorers)!=null&&n.default.url?[(i=c.blockExplorers)==null?void 0:i.default.url]:[];let y;(s=t==null?void 0:t.rpcUrls)!=null&&s.length?y=t.rpcUrls:y=[((u=c.rpcUrls.default)==null?void 0:u.http[0])??""];const h={blockExplorerUrls:w,chainId:z(e),chainName:(t==null?void 0:t.chainName)??c.name,iconUrls:t==null?void 0:t.iconUrls,nativeCurrency:(t==null?void 0:t.nativeCurrency)??c.nativeCurrency,rpcUrls:y};return await a.request({method:"wallet_addEthereumChain",params:[h]}),c}catch(w){throw new f(w)}throw new L(g)}},onAccountsChanged(t){t.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:t.map(e=>D(e))})},onChainChanged(t){const e=Number(t);o.emitter.emit("change",{chainId:e})},async onDisconnect(t){o.emitter.emit("disconnect");const e=await this.getProvider();d&&(e.removeListener("accountsChanged",d),d=void 0),M&&(e.removeListener("chainChanged",M),M=void 0),r&&(e.removeListener("disconnect",r),r=void 0)}}))}q.type="coinbaseWallet";function q(l={}){let p,d,M,r;return T(o=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:q.type,async connect({chainId:t,withCapabilities:e,...c}={}){try{const a=await this.getProvider(),n=(await a.request({method:"eth_requestAccounts",params:"instantOnboarding"in c&&c.instantOnboarding?[{onboarding:"instant"}]:[]})).map(s=>D(s));d||(d=this.onAccountsChanged.bind(this),a.on("accountsChanged",d)),M||(M=this.onChainChanged.bind(this),a.on("chainChanged",M)),r||(r=this.onDisconnect.bind(this),a.on("disconnect",r));let i=await this.getChainId();if(t&&i!==t){const s=await this.switchChain({chainId:t}).catch(u=>{if(u.code===f.code)throw u;return{id:i}});i=(s==null?void 0:s.id)??i}return{accounts:e?n.map(s=>({address:s,capabilities:{}})):n,chainId:i}}catch(a){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(a.message)?new f(a):a}},async disconnect(){var e;const t=await this.getProvider();d&&(t.removeListener("accountsChanged",d),d=void 0),M&&(t.removeListener("chainChanged",M),M=void 0),r&&(t.removeListener("disconnect",r),r=void 0),t.disconnect(),(e=t.close)==null||e.call(t)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(e=>D(e))},async getChainId(){const e=await(await this.getProvider()).request({method:"eth_chainId"});return Number(e)},async getProvider(){if(!p){const{createCoinbaseWalletSDK:t}=await(()=>{try{return b(()=>import("./index-DQx-sY_c.js"),__vite__mapDeps([26,6,4,7,8,1,3,5,18,10,11,19,9,12,13,14,15,16,17,20,21,25]))}catch{throw new Error('dependency "@coinbase/wallet-sdk" not found')}})();p=t({...l,appChainIds:o.chains.map(c=>c.id),preference:{options:"all",...l.preference??{}}}).getProvider()}return p},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:t,chainId:e}){var n,i,s,u;const c=o.chains.find(g=>g.id===e);if(!c)throw new L(new O);const a=await this.getProvider();try{return await a.request({method:"wallet_switchEthereumChain",params:[{chainId:z(c.id)}]}),c}catch(g){if(g.code===4902)try{let w;t!=null&&t.blockExplorerUrls?w=t.blockExplorerUrls:w=(n=c.blockExplorers)!=null&&n.default.url?[(i=c.blockExplorers)==null?void 0:i.default.url]:[];let y;(s=t==null?void 0:t.rpcUrls)!=null&&s.length?y=t.rpcUrls:y=[((u=c.rpcUrls.default)==null?void 0:u.http[0])??""];const h={blockExplorerUrls:w,chainId:z(e),chainName:(t==null?void 0:t.chainName)??c.name,iconUrls:t==null?void 0:t.iconUrls,nativeCurrency:(t==null?void 0:t.nativeCurrency)??c.nativeCurrency,rpcUrls:y};return await a.request({method:"wallet_addEthereumChain",params:[h]}),c}catch(w){throw new f(w)}throw new L(g)}},onAccountsChanged(t){t.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:t.map(e=>D(e))})},onChainChanged(t){const e=Number(t);o.emitter.emit("change",{chainId:e})},async onDisconnect(t){o.emitter.emit("disconnect");const e=await this.getProvider();d&&(e.removeListener("accountsChanged",d),d=void 0),M&&(e.removeListener("chainChanged",M),M=void 0),r&&(e.removeListener("disconnect",r),r=void 0)}}))}R.type="metaMask";function R(l={}){let p,d;return T(M=>({id:"metaMaskSDK",name:"MetaMask",rdns:["io.metamask","io.metamask.mobile"],type:R.type,async connect({chainId:r,isReconnecting:o,withCapabilities:t}={}){const e=await this.getInstance(),c=e.getProvider();let a=[];o&&(a=await this.getAccounts().catch(()=>[]));try{let n,i;if(!(a!=null&&a.length)){const u=M.chains.map(g=>z(g.id));l.connectAndSign||l.connectWith?(l.connectAndSign?n=(await e.connectAndSign({chainIds:u,message:l.connectAndSign})).signature:l.connectWith&&(i=(await e.connectWith({chainIds:u,method:l.connectWith.method,params:l.connectWith.params})).result),a=await this.getAccounts()):a=(await e.connect({chainIds:u})).accounts.map(w=>D(w))}let s=await this.getChainId();if(r&&s!==r){const u=await this.switchChain({chainId:r}).catch(g=>{if(g.code===f.code)throw g;return{id:s}});s=(u==null?void 0:u.id)??s}return n?c.emit("connectAndSign",{accounts:a,chainId:z(s),signResponse:n}):i&&c.emit("connectWith",{accounts:a,chainId:z(s),connectWithResponse:i}),{accounts:t?a.map(u=>({address:u,capabilities:{}})):a,chainId:s}}catch(n){const i=n;throw i.code===f.code?new f(i):i.code===Y.code?new Y(i):i}},async disconnect(){return(await this.getInstance()).disconnect()},async getAccounts(){var e;if(!p&&!d){const c=(e=M.providers[0])==null?void 0:e.provider;if(c)return(await c.request({method:"eth_accounts"})).map(n=>D(n))}const r=await this.getInstance();return r.accounts.length?r.accounts.map(c=>D(c)):(await r.getProvider().request({method:"eth_accounts"})).map(c=>D(c))},async getChainId(){var e;if(!p&&!d){const c=(e=M.providers[0])==null?void 0:e.provider;if(c){const a=await c.request({method:"eth_chainId"});return Number(a)}}const r=await this.getInstance();if(r.getChainId())return Number(r.getChainId());const t=await r.getProvider().request({method:"eth_chainId"});return Number(t)},async getProvider(){var o;if(!p&&!d){const t=(o=M.providers[0])==null?void 0:o.provider;if(t)return t}return(await this.getInstance()).getProvider()},async isAuthorized(){var r;try{if(!p&&!d){const e=(r=M.providers[0])==null?void 0:r.provider;if(e)return(await e.request({method:"eth_accounts"})).length>0}const o=10;return!!(await m(async()=>E(async()=>{const e=await this.getAccounts();if(!e.length)throw new Error("try again");return e},{timeout:o}),{delay:o+1,retryCount:3})).length}catch{return!1}},async switchChain({addEthereumChainParameter:r,chainId:o}){var c,a;const t=M.chains.find(({id:n})=>n===Number(o));if(!t)throw new L(new O);const e=z(o);try{return await(await this.getInstance()).switchChain({chainId:e,chainConfiguration:{blockExplorerUrls:r!=null&&r.blockExplorerUrls?[...r.blockExplorerUrls]:(c=t.blockExplorers)!=null&&c.default.url?[t.blockExplorers.default.url]:void 0,chainId:e,chainName:(r==null?void 0:r.chainName)??t.name,iconUrls:r==null?void 0:r.iconUrls,nativeCurrency:(r==null?void 0:r.nativeCurrency)??t.nativeCurrency,rpcUrls:r!=null&&r.rpcUrls?[...r.rpcUrls]:(a=t.rpcUrls.default)!=null&&a.http?[...t.rpcUrls.default.http]:void 0}}),t}catch(n){const i=n;throw i.code===f.code?new f(i):new L(i)}},async onAccountsChanged(r){M.emitter.emit("change",{accounts:r.map(o=>D(o))})},onChainChanged(r){const o=Number(r);M.emitter.emit("change",{chainId:o})},async onConnect(r){const o=await this.getAccounts();if(o.length===0)return;const t=Number(r.chainId);M.emitter.emit("connect",{accounts:o,chainId:t})},async onDisconnect(r){r&&r.code===1013&&await this.getProvider()&&(await this.getAccounts()).length||M.emitter.emit("disconnect")},onDisplayUri(r){M.emitter.emit("message",{type:"display_uri",data:r})},async getInstance(){var r;if(!p){if(!d){const{createEVMClient:o}=await(async()=>{try{return b(()=>import("./connectors-BkiAkXrA.js"),[])}catch{throw new Error('dependency "@metamask/connect-evm" not found')}})(),t=typeof window>"u"?{name:"wagmi"}:{name:window.location.hostname,url:window.location.href};d=o({...l,skipAutoAnnounce:!0,api:{supportedNetworks:Object.fromEntries(M.chains.map(e=>{var c;return[z(e.id),((c=e.rpcUrls.default)==null?void 0:c.http[0])??""]}))},dapp:l.dapp??{...t,...l.dappMetadata},debug:l.debug??((r=l.logging)==null?void 0:r.sdk),eventHandlers:{accountsChanged:this.onAccountsChanged.bind(this),chainChanged:this.onChainChanged.bind(this),connect:this.onConnect.bind(this),disconnect:this.onDisconnect.bind(this),displayUri:this.onDisplayUri.bind(this)},analytics:{integrationType:"wagmi"},ui:{...l.ui,...l.headless!=null&&{headless:l.headless}},...l.mobile&&{mobile:l.mobile}})}p=await d}return p}}))}function ft(l={}){const p=d=>typeof d.on=="function"&&typeof d.removeListener=="function";return T(d=>{const M=d.chains??l.chains??[],r=d.transports?d.transports:l.transports;let o,t,e,c,a;return{async connect({chainId:n=M[0].id,...i}={}){const s="isReconnecting"in i&&i.isReconnecting||!1,u="withCapabilities"in i&&i.withCapabilities||!1;let g=[],w;if(s&&([g,w]=await Promise.all([this.getAccounts().catch(()=>[]),this.getChainId().catch(()=>{})]),n&&w!==n)){const h=await this.switchChain({chainId:n}).catch(I=>{if(I.code===f.code)throw I;return{id:w}});w=(h==null?void 0:h.id)??w}const y=await this.getProvider();try{if(!(g!=null&&g.length)&&!s){const{RpcSchema:h}=await(()=>{try{return b(()=>import("./connectors-mXb62Iam.js"),[])}catch{throw new Error('dependency "porto" not found')}})(),{z:I}=await(()=>{try{return b(()=>import("./connectors-DAWtxdNk.js"),[])}catch{throw new Error('dependency "porto/internal" not found')}})(),j=await y.request({method:"wallet_connect",params:[{..."capabilities"in i?{capabilities:I.encode(h.wallet_connect.Capabilities,i.capabilities??{})}:{},chainIds:[z(n),...M.filter(A=>A.id!==n).map(A=>z(A.id))]}]});g=j.accounts,w=Number(j.chainIds[0])}if(!w)throw new O;return p(y)&&(c&&(y.removeListener("connect",c),c=void 0),t||(t=this.onAccountsChanged.bind(this),y.on("accountsChanged",t)),e||(e=this.onChainChanged.bind(this),y.on("chainChanged",e)),a||(a=this.onDisconnect.bind(this),y.on("disconnect",a))),{accounts:g.map(h=>typeof h=="object"?u?h:h.address:u?{address:h,capabilities:{}}:h),chainId:w}}catch(h){const I=h;throw I.code===f.code?new f(I):I}},async disconnect(){const n=await this.getProvider();p(n)&&(e&&(n.removeListener("chainChanged",e),e=void 0),a&&(n.removeListener("disconnect",a),a=void 0),c||(c=this.onConnect.bind(this),n.on("connect",c))),await n.request({method:"wallet_disconnect"})},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(s=>D(s))},async getChainId(){const i=await(await this.getProvider()).request({method:"eth_chainId"});return Number(i)},async getPortoInstance(){return o??(o=(async()=>{const{Porto:n}=await(()=>{try{return b(()=>import("./connectors-mXb62Iam.js"),[])}catch{throw new Error('dependency "porto" not found')}})();return n.create({...l,announceProvider:!1,chains:M,transports:r})})()),await o},async getProvider(){return(await this.getPortoInstance()).provider},icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDIyIiBoZWlnaHQ9IjQyMiIgdmlld0JveD0iMCAwIDQyMiA0MjIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSI0MjIiIGhlaWdodD0iNDIyIiBmaWxsPSJibGFjayIvPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfMV8xNSkiPgo8cGF0aCBkPSJNODEgMjg2LjM2NkM4MSAyODAuODkzIDg1LjQ1MDUgMjc2LjQ1NSA5MC45NDA0IDI3Ni40NTVIMzI5LjUxMUMzMzUuMDAxIDI3Ni40NTUgMzM5LjQ1MiAyODAuODkzIDMzOS40NTIgMjg2LjM2NlYzMDYuMTg4QzMzOS40NTIgMzExLjY2MiAzMzUuMDAxIDMxNi4wOTkgMzI5LjUxMSAzMTYuMDk5SDkwLjk0MDRDODUuNDUwNSAzMTYuMDk5IDgxIDMxMS42NjIgODEgMzA2LjE4OFYyODYuMzY2WiIgZmlsbD0id2hpdGUiIGZpbGwtb3BhY2l0eT0iMC41Ii8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTAuOTQwNCAyMzQuODI4Qzg1LjQ1MDUgMjM0LjgyOCA4MSAyMzkuMjY2IDgxIDI0NC43MzlWMjcxLjUzMUM4My44NDMyIDI2OS42MzMgODcuMjYyMiAyNjguNTI2IDkwLjk0MDQgMjY4LjUyNkgzMjkuNTExQzMzMy4xODggMjY4LjUyNiAzMzYuNjA4IDI2OS42MzMgMzM5LjQ1MiAyNzEuNTMxVjI0NC43MzlDMzM5LjQ1MiAyMzkuMjY2IDMzNS4wMDEgMjM0LjgyOCAzMjkuNTExIDIzNC44MjhIOTAuOTQwNFpNMzM5LjQ1MiAyODYuMzY2QzMzOS40NTIgMjgwLjg5MyAzMzUuMDAxIDI3Ni40NTUgMzI5LjUxMSAyNzYuNDU1SDkwLjk0MDRDODUuNDUwNSAyNzYuNDU1IDgxIDI4MC44OTMgODEgMjg2LjM2NlYzMDYuMTlDODEgMzExLjY2NCA4NS40NTA1IDMxNi4xMDEgOTAuOTQwNCAzMTYuMTAxSDMyOS41MTFDMzM1LjAwMSAzMTYuMTAxIDMzOS40NTIgMzExLjY2NCAzMzkuNDUyIDMwNi4xOVYyODYuMzY2WiIgZmlsbD0id2hpdGUiIGZpbGwtb3BhY2l0eT0iMC41Ii8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTAuOTQwNCAxOTMuMjAxQzg1LjQ1MDUgMTkzLjIwMSA4MSAxOTcuNjM4IDgxIDIwMy4xMTJWMjI5LjkwM0M4My44NDMyIDIyOC4wMDYgODcuMjYyMiAyMjYuODk5IDkwLjk0MDQgMjI2Ljg5OUgzMjkuNTExQzMzMy4xODggMjI2Ljg5OSAzMzYuNjA4IDIyOC4wMDYgMzM5LjQ1MiAyMjkuOTAzVjIwMy4xMTJDMzM5LjQ1MiAxOTcuNjM4IDMzNS4wMDEgMTkzLjIwMSAzMjkuNTExIDE5My4yMDFIOTAuOTQwNFpNMzM5LjQ1MiAyNDQuNzM5QzMzOS40NTIgMjM5LjI2NSAzMzUuMDAxIDIzNC44MjggMzI5LjUxMSAyMzQuODI4SDkwLjk0MDRDODUuNDUwNSAyMzQuODI4IDgxIDIzOS4yNjUgODEgMjQ0LjczOVYyNzEuNTNDODEuMjE3NSAyNzEuMzg1IDgxLjQzODMgMjcxLjI0NSA4MS42NjI0IDI3MS4xMDlDODMuODMyNSAyNjkuNzk0IDg2LjMwNTQgMjY4LjkyNyA4OC45NTIzIDI2OC42MzVDODkuNjA1MSAyNjguNTYzIDkwLjI2ODQgMjY4LjUyNiA5MC45NDA0IDI2OC41MjZIMzI5LjUxMUMzMzAuMTgzIDI2OC41MjYgMzMwLjg0NiAyNjguNTYzIDMzMS40OTggMjY4LjYzNUMzMzQuNDE5IDI2OC45NTcgMzM3LjEyOCAyNjkuOTggMzM5LjQ1MiAyNzEuNTNWMjQ0LjczOVpNMzM5LjQ1MiAyODYuMzY2QzMzOS40NTIgMjgxLjAyMSAzMzUuMjA2IDI3Ni42NjMgMzI5Ljg5MyAyNzYuNDYyQzMyOS43NjcgMjc2LjQ1NyAzMjkuNjQgMjc2LjQ1NSAzMjkuNTExIDI3Ni40NTVIOTAuOTQwNEM4NS40NTA1IDI3Ni40NTUgODEgMjgwLjg5MyA4MSAyODYuMzY2VjMwNi4xODhDODEgMzExLjY2MiA4NS40NTA1IDMxNi4xMDEgOTAuOTQwNCAzMTYuMTAxSDMyOS41MTFDMzM1LjAwMSAzMTYuMTAxIDMzOS40NTIgMzExLjY2MiAzMzkuNDUyIDMwNi4xODhWMjg2LjM2NloiIGZpbGw9IndoaXRlIiBmaWxsLW9wYWNpdHk9IjAuNSIvPgo8cGF0aCBvcGFjaXR5PSIwLjMiIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTguMDE0NiAxMDRDODguNjE3NyAxMDQgODEgMTExLjU5NSA4MSAxMjAuOTY1VjE4OC4yNzZDODMuODQzMiAxODYuMzc5IDg3LjI2MjIgMTg1LjI3MiA5MC45NDA0IDE4NS4yNzJIMzI5LjUxMUMzMzMuMTg4IDE4NS4yNzIgMzM2LjYwOCAxODYuMzc5IDMzOS40NTIgMTg4LjI3NlYxMjAuOTY1QzMzOS40NTIgMTExLjU5NSAzMzEuODMzIDEwNCAzMjIuNDM3IDEwNEg5OC4wMTQ2Wk0zMzkuNDUyIDIwMy4xMTJDMzM5LjQ1MiAxOTcuNjM4IDMzNS4wMDEgMTkzLjIwMSAzMjkuNTExIDE5My4yMDFIOTAuOTQwNEM4NS40NTA1IDE5My4yMDEgODEgMTk3LjYzOCA4MSAyMDMuMTEyVjIyOS45MDNDODEuMjE3NSAyMjkuNzU4IDgxLjQzODMgMjI5LjYxOCA4MS42NjI0IDIyOS40ODJDODMuODMyNSAyMjguMTY3IDg2LjMwNTQgMjI3LjMgODguOTUyMyAyMjcuMDA4Qzg5LjYwNTEgMjI2LjkzNiA5MC4yNjg0IDIyNi44OTkgOTAuOTQwNCAyMjYuODk5SDMyOS41MTFDMzMwLjE4MyAyMjYuODk5IDMzMC44NDYgMjI2LjkzNiAzMzEuNDk4IDIyNy4wMDhDMzM0LjQxOSAyMjcuMzMgMzM3LjEyOCAyMjguMzUyIDMzOS40NTIgMjI5LjkwM1YyMDMuMTEyWk0zMzkuNDUyIDI0NC43MzlDMzM5LjQ1MiAyMzkuMzkzIDMzNS4yMDYgMjM1LjAzNiAzMjkuODkzIDIzNC44MzVDMzI5Ljc2NyAyMzQuODMgMzI5LjY0IDIzNC44MjggMzI5LjUxMSAyMzQuODI4SDkwLjk0MDRDODUuNDUwNSAyMzQuODI4IDgxIDIzOS4yNjUgODEgMjQ0LjczOVYyNzEuNTNMODEuMDcwNyAyNzEuNDgzQzgxLjI2NTMgMjcxLjM1NSA4MS40NjI1IDI3MS4yMyA4MS42NjI0IDI3MS4xMDlDODEuOTA4MyAyNzAuOTYgODIuMTU4MSAyNzAuODE3IDgyLjQxMTcgMjcwLjY3OUM4NC4zOTUzIDI2OS42MDUgODYuNjA1NCAyNjguODk0IDg4Ljk1MjMgMjY4LjYzNUM4OS4wMDUyIDI2OC42MjkgODkuMDU4IDI2OC42MjQgODkuMTExIDI2OC42MThDODkuNzEyNSAyNjguNTU3IDkwLjMyMjggMjY4LjUyNiA5MC45NDA0IDI2OC41MjZIMzI5LjUxMUMzMjkuNzM4IDI2OC41MjYgMzI5Ljk2NSAyNjguNTMgMzMwLjE5MiAyNjguNTM5QzMzMC42MzEgMjY4LjU1NSAzMzEuMDY3IDI2OC41ODcgMzMxLjQ5OCAyNjguNjM1QzMzNC40MTkgMjY4Ljk1NyAzMzcuMTI4IDI2OS45OCAzMzkuNDUyIDI3MS41M1YyNDQuNzM5Wk0zMzkuNDUyIDI4Ni4zNjZDMzM5LjQ1MiAyODEuMDIxIDMzNS4yMDYgMjc2LjY2MyAzMjkuODkzIDI3Ni40NjJMMzI5Ljg2NSAyNzYuNDYxQzMyOS43NDggMjc2LjQ1NyAzMjkuNjI5IDI3Ni40NTUgMzI5LjUxMSAyNzYuNDU1SDkwLjk0MDRDODUuNDUwNSAyNzYuNDU1IDgxIDI4MC44OTMgODEgMjg2LjM2NlYzMDYuMTg4QzgxIDMxMS42NjIgODUuNDUwNSAzMTYuMTAxIDkwLjk0MDQgMzE2LjEwMUgzMjkuNTExQzMzNS4wMDEgMzE2LjEwMSAzMzkuNDUyIDMxMS42NjIgMzM5LjQ1MiAzMDYuMTg4VjI4Ni4zNjZaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNMjY5Ljg2OCAxMzEuNzUyQzI2OS44NjggMTI2LjI3OCAyNzQuMzE4IDEyMS44NCAyNzkuODA4IDEyMS44NEgzMTEuNjE4QzMxNy4xMDggMTIxLjg0IDMyMS41NTggMTI2LjI3OCAzMjEuNTU4IDEzMS43NTJWMTYxLjQ4NUMzMjEuNTU4IDE2Ni45NTkgMzE3LjEwOCAxNzEuMzk2IDMxMS42MTggMTcxLjM5NkgyNzkuODA4QzI3NC4zMTggMTcxLjM5NiAyNjkuODY4IDE2Ni45NTkgMjY5Ljg2OCAxNjEuNDg1VjEzMS43NTJaIiBmaWxsPSJ3aGl0ZSIvPgo8L2c+CjxkZWZzPgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzFfMTUiPgo8cmVjdCB3aWR0aD0iMjU5IiBoZWlnaHQ9IjIxMyIgZmlsbD0id2hpdGUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDgxIDEwNCkiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K",id:"xyz.ithaca.porto",async isAuthorized(){try{return!!(await m(()=>this.getAccounts())).length}catch{return!1}},name:"Porto",async onAccountsChanged(n){d.emitter.emit("change",{accounts:n.map(i=>D(i))})},onChainChanged(n){const i=Number(n);d.emitter.emit("change",{chainId:i})},async onConnect(n){const i=await this.getAccounts();if(i.length===0)return;const s=Number(n.chainId);d.emitter.emit("connect",{accounts:i,chainId:s});const u=await this.getProvider();p(u)&&(c&&(u.removeListener("connect",c),c=void 0),t||(t=this.onAccountsChanged.bind(this),u.on("accountsChanged",t)),e||(e=this.onChainChanged.bind(this),u.on("chainChanged",e)),a||(a=this.onDisconnect.bind(this),u.on("disconnect",a)))},async onDisconnect(n){const i=await this.getProvider();d.emitter.emit("disconnect"),p(i)&&(e&&(i.removeListener("chainChanged",e),e=void 0),a&&(i.removeListener("disconnect",a),a=void 0),c||(c=this.onConnect.bind(this),i.on("connect",c)))},async setup(){if(!c){const n=await this.getProvider();if(!p(n))return;c=this.onConnect.bind(this),n.on("connect",c)}},async switchChain({chainId:n}){const i=M.find(u=>u.id===n);if(!i)throw new L(new O);return await(await this.getProvider()).request({method:"wallet_switchEthereumChain",params:[{chainId:z(n)}]}),i},type:"injected"}})}W.type="safe";function W(l={}){const{shimDisconnect:p=!1}=l;let d,M;return T(r=>({id:"safe",name:"Safe",type:W.type,async connect({withCapabilities:o}={}){var a;const t=await this.getProvider();if(!t)throw new k;const e=await this.getAccounts(),c=await this.getChainId();return M||(M=this.onDisconnect.bind(this),t.on("disconnect",M)),p&&await((a=r.storage)==null?void 0:a.removeItem("safe.disconnected")),{accounts:o?e.map(n=>({address:n,capabilities:{}})):e,chainId:c}},async disconnect(){var t;const o=await this.getProvider();if(!o)throw new k;M&&(o.removeListener("disconnect",M),M=void 0),p&&await((t=r.storage)==null?void 0:t.setItem("safe.disconnected",!0))},async getAccounts(){const o=await this.getProvider();if(!o)throw new k;return(await o.request({method:"eth_accounts"})).map(D)},async getProvider(){if(typeof window<"u"&&(window==null?void 0:window.parent)!==window){if(!d){const{default:t}=await(()=>{try{return b(()=>import("./index-Qzch3HJ1.js"),__vite__mapDeps([27,28,10,11,7,4,6,8,20]))}catch{throw new Error('dependency "@safe-global/safe-apps-sdk" not found')}})(),e=new t(l),c=await E(()=>e.safe.getInfo(),{timeout:l.unstable_getInfoTimeout??10});if(!c)throw new Error("Could not load Safe information");const a=await(async()=>{const n=await(()=>{try{return b(()=>import("./index-DOTYPGXa.js").then(i=>i.i),__vite__mapDeps([29,4,28,30,7,15,6,8]))}catch{throw new Error('dependency "@safe-global/safe-apps-provider" not found')}})();return typeof n.SafeAppProvider!="function"&&typeof n.default.SafeAppProvider=="function"?n.default.SafeAppProvider:n.SafeAppProvider})();d=new a(c,e)}return d}},async getChainId(){const o=await this.getProvider();if(!o)throw new k;return Number(o.chainId)},async isAuthorized(){var o;try{return p&&await((o=r.storage)==null?void 0:o.getItem("safe.disconnected"))?!1:!!(await this.getAccounts()).length}catch{return!1}},onAccountsChanged(){},onChainChanged(){},onDisconnect(){r.emitter.emit("disconnect")}}))}const Dt="8.0.20";Z.type="walletConnect";function Z(l){const p=l.isNewChainsStale??!0;let d,M;const r="eip155";let o,t,e,c,a,n;return T(i=>({id:"walletConnect",name:"WalletConnect",type:Z.type,async setup(){const s=await this.getProvider().catch(()=>null);s&&(e||(e=this.onConnect.bind(this),s.on("connect",e)),a||(a=this.onSessionDelete.bind(this),s.on("session_delete",a)))},async connect({chainId:s,withCapabilities:u,...g}={}){var w,y;try{const h=await this.getProvider();if(!h)throw new k;c||(c=this.onDisplayUri,h.on("display_uri",c));let I=s;if(!I){const N=await((w=i.storage)==null?void 0:w.getItem("state"))??{};i.chains.some(S=>S.id===N.chainId)?I=N.chainId:I=(y=i.chains[0])==null?void 0:y.id}if(!I)throw new Error("No chains found on connector.");const j=await this.isChainsStale();if(h.session&&j&&await h.disconnect(),!h.session||j){const N=i.chains.filter(C=>C.id!==I).map(C=>C.id);await h.connect({optionalChains:[I,...N],..."pairingTopic"in g?{pairingTopic:g.pairingTopic}:{}}),this.setRequestedChainsIds(i.chains.map(C=>C.id))}const A=(await h.enable()).map(N=>D(N));let v=await this.getChainId();if(s&&v!==s){const N=await this.switchChain({chainId:s}).catch(C=>{var S;if(C.code===f.code&&((S=C.cause)==null?void 0:S.message)!=="Missing or invalid. request() method: wallet_addEthereumChain")throw C;return{id:v}});v=(N==null?void 0:N.id)??v}return c&&(h.removeListener("display_uri",c),c=void 0),e&&(h.removeListener("connect",e),e=void 0),o||(o=this.onAccountsChanged.bind(this),h.on("accountsChanged",o)),t||(t=this.onChainChanged.bind(this),h.on("chainChanged",t)),n||(n=this.onDisconnect.bind(this),h.on("disconnect",n)),a||(a=this.onSessionDelete.bind(this),h.on("session_delete",a)),{accounts:u?A.map(N=>({address:N,capabilities:{}})):A,chainId:v}}catch(h){throw/(user rejected|connection request reset)/i.test(h==null?void 0:h.message)?new f(h):h}},async disconnect(){const s=await this.getProvider();try{await(s==null?void 0:s.disconnect())}catch(u){if(!/No matching key/i.test(u.message))throw u}finally{t&&(s==null||s.removeListener("chainChanged",t),t=void 0),n&&(s==null||s.removeListener("disconnect",n),n=void 0),e||(e=this.onConnect.bind(this),s==null||s.on("connect",e)),o&&(s==null||s.removeListener("accountsChanged",o),o=void 0),a&&(s==null||s.removeListener("session_delete",a),a=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(u=>D(u))},async getProvider({chainId:s}={}){var g;async function u(){const w=i.chains.map(h=>h.id);if(!w.length)return;const{EthereumProvider:y}=await(()=>{try{return b(()=>import("./index.es-DnMpNe4m.js").then(h=>h.n),__vite__mapDeps([31,6,4,7,8,15,32,14,25,33,34,16]))}catch{throw new Error('dependency "@walletconnect/ethereum-provider" not found')}})();return await y.init({...l,disableProviderPing:!0,optionalChains:w,projectId:l.projectId,rpcMap:Object.fromEntries(i.chains.map(h=>{const[I]=$({chain:h,transports:i.transports});return[h.id,I]})),showQrModal:l.showQrModal??!0})}return d||(M||(M=u()),d=await M,d==null||d.events.setMaxListeners(Number.POSITIVE_INFINITY)),s&&await((g=this.switchChain)==null?void 0:g.call(this,{chainId:s})),d},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[s,u]=await Promise.all([this.getAccounts(),this.getProvider()]);return s.length?await this.isChainsStale()&&u.session?(await u.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:s,chainId:u}){var h,I,j;const g=await this.getProvider();if(!g)throw new k;const w=i.chains.find(A=>A.id===u);if(!w)throw new L(new O);let y=()=>{};try{await Promise.all([new Promise(v=>{y=N=>{N.chainId===u&&(i.emitter.off("change",y),v())},i.emitter.on("change",y)}),g.request({method:"wallet_switchEthereumChain",params:[{chainId:z(u)}]})]);const A=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...A,u]),w}catch(A){i.emitter.off("change",y);const v=A;if(/(user rejected)/i.test(v.message))throw new f(v);try{let N;s!=null&&s.blockExplorerUrls?N=s.blockExplorerUrls:N=(h=w.blockExplorers)!=null&&h.default.url?[(I=w.blockExplorers)==null?void 0:I.default.url]:[];let C;(j=s==null?void 0:s.rpcUrls)!=null&&j.length?C=s.rpcUrls:C=[...w.rpcUrls.default.http];const S={blockExplorerUrls:N,chainId:z(u),chainName:(s==null?void 0:s.chainName)??w.name,iconUrls:s==null?void 0:s.iconUrls,nativeCurrency:(s==null?void 0:s.nativeCurrency)??w.nativeCurrency,rpcUrls:C};await g.request({method:"wallet_addEthereumChain",params:[S]});const V=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...V,u]),w}catch(N){throw new f(N)}}},onAccountsChanged(s){s.length===0?this.onDisconnect():i.emitter.emit("change",{accounts:s.map(u=>D(u))})},onChainChanged(s){const u=Number(s);i.emitter.emit("change",{chainId:u})},async onConnect(s){const u=Number(s.chainId),g=await this.getAccounts();i.emitter.emit("connect",{accounts:g,chainId:u})},async onDisconnect(s){this.setRequestedChainsIds([]),i.emitter.emit("disconnect");const u=await this.getProvider();o&&(u.removeListener("accountsChanged",o),o=void 0),t&&(u.removeListener("chainChanged",t),t=void 0),n&&(u.removeListener("disconnect",n),n=void 0),a&&(u.removeListener("session_delete",a),a=void 0),e||(e=this.onConnect.bind(this),u.on("connect",e))},onDisplayUri(s){i.emitter.emit("message",{type:"display_uri",data:s})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var u,g,w;return d?((w=(g=(u=d.session)==null?void 0:u.namespaces[r])==null?void 0:g.accounts)==null?void 0:w.map(y=>Number.parseInt(y.split(":")[1]||"",10)))??[]:[]},async getRequestedChainsIds(){var s;return await((s=i.storage)==null?void 0:s.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!p)return!1;const s=i.chains.map(w=>w.id),u=this.getNamespaceChainsIds();if(u.length&&!u.some(w=>s.includes(w)))return!1;const g=await this.getRequestedChainsIds();return!s.every(w=>g.includes(w))},async setRequestedChainsIds(s){var u;await((u=i.storage)==null?void 0:u.setItem(this.requestedChainsStorageKey,s))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}}))}export{yt as baseAccount,q as coinbaseWallet,zt as injected,R as metaMask,Q as mock,ft as porto,W as safe,It as tempoWallet,Dt as version,Z as walletConnect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r}from"./parseSignature-h2iJV3NZ.js";import{B as T,E as g,a as b,b as h,F as y,W as f,d as v,e as A,f as S,g as I,p as F,l as R,n as x,p as C,h as B,s as N,z as P}from"./parseSignature-h2iJV3NZ.js";import{I as U,c as w,a as L,p as M,w as H}from"./custom-CLQCvu9h.js";import{h as s}from"./W3MFrameProviderSingleton-HtGM3kiI.js";import{U as z,c as q,f as V,s as O,w as G,a as j}from"./W3MFrameProviderSingleton-HtGM3kiI.js";import{A as K,a as Z,B as J,b as Q,C as X,D as Y,E as _,F as $,c as aa,H as ra,I as oa,d as sa,e as ea,f as ta,g as na,h as ia,i as ca,j as da,k as Ea,l as ua,J as pa,L as la,M as ma,m as Ta,N as ga,n as ba,o as ha,P as ya,p as fa,q as va,R as Aa,r as Sa,s as Ia,t as Fa,u as Ra,S as xa,v as Ca,w as Ba,x as Na,T as Pa,y as Da,z as Ua,G as wa,U as La,K as Ma,O as Ha,Q as ka,V as za,W as qa,X as Va,Y as Oa,Z as Ga,_ as ja,$ as Wa,a0 as Ka,a1 as Za,a2 as Ja,a3 as Qa,a4 as Xa,a5 as Ya,a6 as _a,a7 as $a,a8 as ar,a9 as rr,aa as or,ab as sr,ac as er,ad as tr,ae as nr,af as ir,ag as cr,ah as dr,ai as Er,aj as ur,ak as pr,al as lr,am as mr,an as Tr,ao as gr,ap as br,a1 as hr}from"./NetworkUtil-Ddexw9-U.js";import{A as fr,a as vr,b as Ar,c as Sr,d as Ir,e as Fr,f as Rr,g as xr,h as Cr,i as Br,j as Nr,k as Pr,l as Dr,m as Ur,n as wr,o as Lr,p as Mr,B as Hr,q as kr,r as zr,C as qr,s as Vr,t as Or,u as Gr,v as jr,w as Wr,x as Kr,y as Zr,z as Jr,D as Qr,E as Xr,F as Yr,G as _r,H as $r,I as ao,J as ro,K as oo,L as so,M as eo,N as to,O as no,P as io,Q as co,R as Eo,S as uo,T as po,U as lo,V as mo,W as To,X as go,Y as bo,Z as ho,_ as yo,$ as fo,a0 as vo,a1 as Ao,a2 as So,a3 as Io,a4 as Fo,a5 as Ro,a6 as xo,a7 as Co,a8 as Bo,a9 as No,aa as Po,ab as Do,ac as Uo,ad as wo,ae as Lo,af as Mo,ag as Ho,ah as ko,ai as zo,aj as qo,ak as Vo,al as Oo,am as Go,an as jo,ao as Wo,ap as Ko,aq as Zo,ar as Jo,as as Qo,at as Xo,au as Yo,av as _o,aw as $o,ax as as,ay as rs,az as os,aA as ss,aB as es,aC as ts,aD as ns,aE as is,aF as cs,aG as ds,aH as Es,aI as us,aJ as ps,aK as ls,aL as ms,aM as Ts,aN as gs,aM as bs,aO as hs,aP as ys,aQ as fs,aR as vs,aS as As,aT as Ss,aU as Is,aV as Fs,aW as Rs,aX as xs,aY as Cs,aZ as Bs,a_ as Ns,a$ as Ps,b0 as Ds,b1 as Us,b2 as ws,b3 as Ls,b4 as Ms,aL as Hs,aM as ks,b4 as zs,aN as qs,aM as Vs,b5 as Os,b6 as Gs,aA as js}from"./sendRawTransaction-BqauPPYf.js";import{I as Ks,a as Zs,b as Js,g as Qs,h as Xs,c as Ys,d as _s,e as $s,p as ae,t as re,v as oe}from"./hashTypedData-Er6Ia-O7.js";import{d as ee,e as te,a as ne}from"./localBatchGatewayRequest-ntoba0Xt.js";import{ccipRequest as ce,ccipRequest as de,offchainLookup as Ee,offchainLookupAbiItem as ue,offchainLookupSignature as pe}from"./ccip-DiW7RkRR.js";import{d as t}from"./verifyHash-JbNzrsYR.js";import{e as me,p as Te,a as ge,s as be,s as he}from"./verifyHash-JbNzrsYR.js";import{a as fe,b as ve,c as Ae,s as Se,d as Ie}from"./serializeTransaction-B4qzULZO.js";import"./secp256k1-BQuyxdaC.js";import"./index-Dmfk0azd.js";import"./react-Vu6nbGi5.js";import"./ethers-DHDSyreX.js";import"./index-CdfeQ7YK.js";import"./index-DXfwhNfH.js";import"./browser-ponyfill-rND5WOqr.js";export{fr as AbiConstructorNotFoundError,vr as AbiConstructorParamsNotFoundError,Ar as AbiDecodingDataSizeTooSmallError,Sr as AbiDecodingZeroDataError,Ir as AbiEncodingArrayLengthMismatchError,Fr as AbiEncodingBytesSizeMismatchError,Rr as AbiEncodingLengthMismatchError,xr as AbiErrorInputsNotFoundError,Cr as AbiErrorNotFoundError,Br as AbiErrorSignatureNotFoundError,Nr as AbiEventNotFoundError,Pr as AbiEventSignatureEmptyTopicsError,Dr as AbiEventSignatureNotFoundError,Ur as AbiFunctionNotFoundError,wr as AbiFunctionOutputsNotFoundError,Lr as AbiFunctionSignatureNotFoundError,Mr as AccountStateConflictError,K as AtomicReadyWalletRejectedUpgradeError,Z as AtomicityNotSupportedError,J as BaseError,Hr as BaseFeeScalarError,kr as BlockNotFoundError,T as BundleFailedError,Q as BundleTooLargeError,zr as BytesSizeMismatchError,qr as CallExecutionError,X as ChainDisconnectedError,Vr as ChainDoesNotSupportContract,Or as ChainMismatchError,Gr as ChainNotFoundError,jr as CircularReferenceError,Wr as ClientChainNotConfiguredError,Kr as ContractFunctionExecutionError,Zr as ContractFunctionRevertedError,Jr as ContractFunctionZeroDataError,Qr as CounterfactualDeploymentFailedError,Xr as DecodeLogDataMismatch,Yr as DecodeLogTopicsMismatch,Y as DuplicateIdError,_r as Eip1559FeesNotSupportedError,g as EnsAvatarInvalidNftUriError,b as EnsAvatarUnsupportedNamespaceError,h as EnsAvatarUriResolutionError,$r as EstimateGasExecutionError,_ as ExecutionRevertedError,$ as FeeCapTooHighError,aa as FeeCapTooLowError,y as FilterTypeNotSupportedError,ra as HttpRequestError,oa as InsufficientFundsError,sa as IntegerOutOfRangeError,ea as InternalRpcError,ta as IntrinsicGasTooHighError,na as IntrinsicGasTooLowError,ao as InvalidAbiDecodingTypeError,ro as InvalidAbiEncodingTypeError,oo as InvalidAbiItemError,so as InvalidAbiParametersError,eo as InvalidAbiTypeParameterError,to as InvalidAddressError,no as InvalidArrayError,ia as InvalidBytesBooleanError,io as InvalidChainIdError,U as InvalidDecimalNumberError,co as InvalidDefinitionTypeError,Ks as InvalidDomainError,Eo as InvalidFunctionModifierError,ca as InvalidHexBooleanError,da as InvalidInputRpcError,uo as InvalidLegacyVError,po as InvalidModifierError,lo as InvalidParameterError,Ea as InvalidParamsRpcError,mo as InvalidParenthesisError,Zs as InvalidPrimaryTypeError,ua as InvalidRequestRpcError,To as InvalidSerializableTransactionError,go as InvalidSignatureError,bo as InvalidStorageKeySizeError,ho as InvalidStructSignatureError,Js as InvalidStructTypeError,pa as JsonRpcVersionUnsupportedError,la as LimitExceededRpcError,yo as MaxFeePerGasTooLowError,ma as MethodNotFoundRpcError,Ta as MethodNotSupportedRpcError,ga as NonceMaxValueError,ba as NonceTooHighError,ha as NonceTooLowError,ya as ParseRpcError,fa as ProviderDisconnectedError,va as ProviderRpcError,fo as RawContractError,Aa as ResourceNotFoundRpcError,Sa as ResourceUnavailableRpcError,Ia as ResponseBodyTooLargeError,Fa as RpcError,Ra as RpcRequestError,xa as SizeExceedsPaddingSizeError,Ca as SizeOverflowError,Ba as SliceOffsetOutOfBoundsError,vo as SolidityProtectedKeywordError,Ao as StateAssignmentConflictError,Na as SwitchChainError,Pa as TimeoutError,Da as TipAboveFeeCapError,So as TransactionExecutionError,Io as TransactionNotFoundError,Fo as TransactionReceiptNotFoundError,Ua as TransactionRejectedRpcError,wa as TransactionTypeNotSupportedError,La as UnauthorizedProviderError,Ma as UnknownBundleIdError,Ha as UnknownNodeError,ka as UnknownRpcError,Ro as UnknownSignatureError,xo as UnknownTypeError,za as UnsupportedChainIdError,qa as UnsupportedNonOptionalCapabilityError,Co as UnsupportedPackedAbiType,Va as UnsupportedProviderMethodError,z as UrlRequiredError,Oa as UserRejectedRequestError,f as WaitForCallsStatusTimeoutError,Bo as WaitForTransactionReceiptTimeoutError,No as assertCurrentChain,Po as assertRequest,fe as assertTransactionEIP1559,ve as assertTransactionEIP2930,Ae as assertTransactionLegacy,Do as blobsToCommitments,Uo as blobsToProofs,Ga as boolToBytes,ja as boolToHex,wo as bytesToBigInt,Lo as bytesToBool,Wa as bytesToHex,Mo as bytesToNumber,Ho as bytesToString,ce as ccipFetch,de as ccipRequest,ko as checksumAddress,zo as commitmentToVersionedHash,qo as commitmentsToVersionedHashes,Vo as concat,Oo as concatBytes,Go as concatHex,w as createClient,v as createNonceManager,r as createPublicClient,q as createTransport,L as custom,jo as decodeAbiParameters,Wo as decodeErrorResult,Ko as decodeEventLog,ee as decodeFunctionData,Zo as decodeFunctionResult,Jo as defineBlock,t as defineChain,Qo as defineTransaction,Xo as defineTransactionReceipt,Yo as defineTransactionRequest,_o as deploylessCallViaBytecodeBytecode,$o as deploylessCallViaFactoryBytecode,as as encodeAbiParameters,rs as encodeDeployData,te as encodeErrorResult,A as encodeEventTopics,os as encodeFunctionData,ne as encodeFunctionResult,S as encodePacked,Ka as erc20Abi,Za as erc6492SignatureValidatorAbi,ss as erc6492SignatureValidatorByteCode,I as ethAddress,Ja as etherUnits,me as extendSchema,V as fallback,es as formatBlock,ts as formatEther,Qa as formatGwei,ns as formatLog,is as formatTransaction,cs as formatTransactionReceipt,ds as formatTransactionRequest,Xa as formatUnits,Ya as fromHex,Es as getAbiItem,us as getAddress,ps as getChainContractAddress,ls as getContractError,ms as getEventSelector,Ts as getEventSignature,gs as getFunctionSelector,bs as getFunctionSignature,hs as getTransactionType,Qs as getTypesForEIP712Domain,_a as gweiUnits,Xs as hashDomain,Ys as hashMessage,_s as hashStruct,$s as hashTypedData,$a as hexToBigInt,ar as hexToBool,rr as hexToBytes,or as hexToNumber,F as hexToSignature,sr as hexToString,s as http,ys as isAddress,fs as isAddressEqual,er as isHex,vs as keccak256,R as labelhash,As as maxUint16,Ss as maxUint256,tr as multicall3Abi,x as namehash,nr as numberToBytes,ir as numberToHex,Ee as offchainLookup,ue as offchainLookupAbiItem,pe as offchainLookupSignature,cr as pad,dr as padBytes,Er as padHex,Is as parseAbi,Te as parseAbiItem,ge as parseAbiParameters,Fs as parseEventLogs,C as parseSignature,M as parseUnits,Rs as prepareEncodeFunctionData,ae as presignMessagePrefix,B as publicActions,xs as recoverAddress,Cs as recoverPublicKey,Bs as rpcTransactionType,Se as serializeAccessList,N as serializeErc6492Signature,be as serializeSignature,Ie as serializeTransaction,Ns as sha256,O as shouldThrow,he as signatureToHex,ur as size,Ps as slice,Ds as sliceBytes,Us as sliceHex,pr as stringToBytes,lr as stringToHex,mr as stringify,ws as toBlobSidecars,Ls as toBlobs,Tr as toBytes,Ms as toEventHash,Hs as toEventSelector,ks as toEventSignature,zs as toFunctionHash,qs as toFunctionSelector,Vs as toFunctionSignature,gr as toHex,re as toPrefixedMessage,Os as toRlp,Gs as transactionType,br as trim,hr as universalSignatureValidatorAbi,js as universalSignatureValidatorByteCode,oe as validateTypedData,H as withCache,G as withRetry,j as withTimeout,P as zeroAddress};
|
|
1
|
+
import{c as r}from"./parseSignature-kOoafZEo.js";import{B as T,E as g,a as b,b as h,F as y,W as f,d as v,e as A,f as S,g as I,p as F,l as R,n as x,p as C,h as B,s as N,z as P}from"./parseSignature-kOoafZEo.js";import{I as U,c as w,a as L,p as M,w as H}from"./custom-C6VO1Je_.js";import{h as s}from"./W3MFrameProviderSingleton-D4DCXtQm.js";import{U as z,c as q,f as V,s as O,w as G,a as j}from"./W3MFrameProviderSingleton-D4DCXtQm.js";import{A as K,a as Z,B as J,b as Q,C as X,D as Y,E as _,F as $,c as aa,H as ra,I as oa,d as sa,e as ea,f as ta,g as na,h as ia,i as ca,j as da,k as Ea,l as ua,J as pa,L as la,M as ma,m as Ta,N as ga,n as ba,o as ha,P as ya,p as fa,q as va,R as Aa,r as Sa,s as Ia,t as Fa,u as Ra,S as xa,v as Ca,w as Ba,x as Na,T as Pa,y as Da,z as Ua,G as wa,U as La,K as Ma,O as Ha,Q as ka,V as za,W as qa,X as Va,Y as Oa,Z as Ga,_ as ja,$ as Wa,a0 as Ka,a1 as Za,a2 as Ja,a3 as Qa,a4 as Xa,a5 as Ya,a6 as _a,a7 as $a,a8 as ar,a9 as rr,aa as or,ab as sr,ac as er,ad as tr,ae as nr,af as ir,ag as cr,ah as dr,ai as Er,aj as ur,ak as pr,al as lr,am as mr,an as Tr,ao as gr,ap as br,a1 as hr}from"./NetworkUtil-Ddexw9-U.js";import{A as fr,a as vr,b as Ar,c as Sr,d as Ir,e as Fr,f as Rr,g as xr,h as Cr,i as Br,j as Nr,k as Pr,l as Dr,m as Ur,n as wr,o as Lr,p as Mr,B as Hr,q as kr,r as zr,C as qr,s as Vr,t as Or,u as Gr,v as jr,w as Wr,x as Kr,y as Zr,z as Jr,D as Qr,E as Xr,F as Yr,G as _r,H as $r,I as ao,J as ro,K as oo,L as so,M as eo,N as to,O as no,P as io,Q as co,R as Eo,S as uo,T as po,U as lo,V as mo,W as To,X as go,Y as bo,Z as ho,_ as yo,$ as fo,a0 as vo,a1 as Ao,a2 as So,a3 as Io,a4 as Fo,a5 as Ro,a6 as xo,a7 as Co,a8 as Bo,a9 as No,aa as Po,ab as Do,ac as Uo,ad as wo,ae as Lo,af as Mo,ag as Ho,ah as ko,ai as zo,aj as qo,ak as Vo,al as Oo,am as Go,an as jo,ao as Wo,ap as Ko,aq as Zo,ar as Jo,as as Qo,at as Xo,au as Yo,av as _o,aw as $o,ax as as,ay as rs,az as os,aA as ss,aB as es,aC as ts,aD as ns,aE as is,aF as cs,aG as ds,aH as Es,aI as us,aJ as ps,aK as ls,aL as ms,aM as Ts,aN as gs,aM as bs,aO as hs,aP as ys,aQ as fs,aR as vs,aS as As,aT as Ss,aU as Is,aV as Fs,aW as Rs,aX as xs,aY as Cs,aZ as Bs,a_ as Ns,a$ as Ps,b0 as Ds,b1 as Us,b2 as ws,b3 as Ls,b4 as Ms,aL as Hs,aM as ks,b4 as zs,aN as qs,aM as Vs,b5 as Os,b6 as Gs,aA as js}from"./sendRawTransaction-DT-ObNx8.js";import{I as Ks,a as Zs,b as Js,g as Qs,h as Xs,c as Ys,d as _s,e as $s,p as ae,t as re,v as oe}from"./hashTypedData-BOc0w62Q.js";import{d as ee,e as te,a as ne}from"./localBatchGatewayRequest-BLJAP4fw.js";import{ccipRequest as ce,ccipRequest as de,offchainLookup as Ee,offchainLookupAbiItem as ue,offchainLookupSignature as pe}from"./ccip-ByQiZ_aq.js";import{d as t}from"./verifyHash-BVbpPoSf.js";import{e as me,p as Te,a as ge,s as be,s as he}from"./verifyHash-BVbpPoSf.js";import{a as fe,b as ve,c as Ae,s as Se,d as Ie}from"./serializeTransaction-DawhfTu0.js";import"./secp256k1-DFslM7tB.js";import"./index-C7-iTfFV.js";import"./react-Vu6nbGi5.js";import"./ethers-DHDSyreX.js";import"./index-CdfeQ7YK.js";import"./index-C6FQ8I_Q.js";import"./browser-ponyfill-rND5WOqr.js";export{fr as AbiConstructorNotFoundError,vr as AbiConstructorParamsNotFoundError,Ar as AbiDecodingDataSizeTooSmallError,Sr as AbiDecodingZeroDataError,Ir as AbiEncodingArrayLengthMismatchError,Fr as AbiEncodingBytesSizeMismatchError,Rr as AbiEncodingLengthMismatchError,xr as AbiErrorInputsNotFoundError,Cr as AbiErrorNotFoundError,Br as AbiErrorSignatureNotFoundError,Nr as AbiEventNotFoundError,Pr as AbiEventSignatureEmptyTopicsError,Dr as AbiEventSignatureNotFoundError,Ur as AbiFunctionNotFoundError,wr as AbiFunctionOutputsNotFoundError,Lr as AbiFunctionSignatureNotFoundError,Mr as AccountStateConflictError,K as AtomicReadyWalletRejectedUpgradeError,Z as AtomicityNotSupportedError,J as BaseError,Hr as BaseFeeScalarError,kr as BlockNotFoundError,T as BundleFailedError,Q as BundleTooLargeError,zr as BytesSizeMismatchError,qr as CallExecutionError,X as ChainDisconnectedError,Vr as ChainDoesNotSupportContract,Or as ChainMismatchError,Gr as ChainNotFoundError,jr as CircularReferenceError,Wr as ClientChainNotConfiguredError,Kr as ContractFunctionExecutionError,Zr as ContractFunctionRevertedError,Jr as ContractFunctionZeroDataError,Qr as CounterfactualDeploymentFailedError,Xr as DecodeLogDataMismatch,Yr as DecodeLogTopicsMismatch,Y as DuplicateIdError,_r as Eip1559FeesNotSupportedError,g as EnsAvatarInvalidNftUriError,b as EnsAvatarUnsupportedNamespaceError,h as EnsAvatarUriResolutionError,$r as EstimateGasExecutionError,_ as ExecutionRevertedError,$ as FeeCapTooHighError,aa as FeeCapTooLowError,y as FilterTypeNotSupportedError,ra as HttpRequestError,oa as InsufficientFundsError,sa as IntegerOutOfRangeError,ea as InternalRpcError,ta as IntrinsicGasTooHighError,na as IntrinsicGasTooLowError,ao as InvalidAbiDecodingTypeError,ro as InvalidAbiEncodingTypeError,oo as InvalidAbiItemError,so as InvalidAbiParametersError,eo as InvalidAbiTypeParameterError,to as InvalidAddressError,no as InvalidArrayError,ia as InvalidBytesBooleanError,io as InvalidChainIdError,U as InvalidDecimalNumberError,co as InvalidDefinitionTypeError,Ks as InvalidDomainError,Eo as InvalidFunctionModifierError,ca as InvalidHexBooleanError,da as InvalidInputRpcError,uo as InvalidLegacyVError,po as InvalidModifierError,lo as InvalidParameterError,Ea as InvalidParamsRpcError,mo as InvalidParenthesisError,Zs as InvalidPrimaryTypeError,ua as InvalidRequestRpcError,To as InvalidSerializableTransactionError,go as InvalidSignatureError,bo as InvalidStorageKeySizeError,ho as InvalidStructSignatureError,Js as InvalidStructTypeError,pa as JsonRpcVersionUnsupportedError,la as LimitExceededRpcError,yo as MaxFeePerGasTooLowError,ma as MethodNotFoundRpcError,Ta as MethodNotSupportedRpcError,ga as NonceMaxValueError,ba as NonceTooHighError,ha as NonceTooLowError,ya as ParseRpcError,fa as ProviderDisconnectedError,va as ProviderRpcError,fo as RawContractError,Aa as ResourceNotFoundRpcError,Sa as ResourceUnavailableRpcError,Ia as ResponseBodyTooLargeError,Fa as RpcError,Ra as RpcRequestError,xa as SizeExceedsPaddingSizeError,Ca as SizeOverflowError,Ba as SliceOffsetOutOfBoundsError,vo as SolidityProtectedKeywordError,Ao as StateAssignmentConflictError,Na as SwitchChainError,Pa as TimeoutError,Da as TipAboveFeeCapError,So as TransactionExecutionError,Io as TransactionNotFoundError,Fo as TransactionReceiptNotFoundError,Ua as TransactionRejectedRpcError,wa as TransactionTypeNotSupportedError,La as UnauthorizedProviderError,Ma as UnknownBundleIdError,Ha as UnknownNodeError,ka as UnknownRpcError,Ro as UnknownSignatureError,xo as UnknownTypeError,za as UnsupportedChainIdError,qa as UnsupportedNonOptionalCapabilityError,Co as UnsupportedPackedAbiType,Va as UnsupportedProviderMethodError,z as UrlRequiredError,Oa as UserRejectedRequestError,f as WaitForCallsStatusTimeoutError,Bo as WaitForTransactionReceiptTimeoutError,No as assertCurrentChain,Po as assertRequest,fe as assertTransactionEIP1559,ve as assertTransactionEIP2930,Ae as assertTransactionLegacy,Do as blobsToCommitments,Uo as blobsToProofs,Ga as boolToBytes,ja as boolToHex,wo as bytesToBigInt,Lo as bytesToBool,Wa as bytesToHex,Mo as bytesToNumber,Ho as bytesToString,ce as ccipFetch,de as ccipRequest,ko as checksumAddress,zo as commitmentToVersionedHash,qo as commitmentsToVersionedHashes,Vo as concat,Oo as concatBytes,Go as concatHex,w as createClient,v as createNonceManager,r as createPublicClient,q as createTransport,L as custom,jo as decodeAbiParameters,Wo as decodeErrorResult,Ko as decodeEventLog,ee as decodeFunctionData,Zo as decodeFunctionResult,Jo as defineBlock,t as defineChain,Qo as defineTransaction,Xo as defineTransactionReceipt,Yo as defineTransactionRequest,_o as deploylessCallViaBytecodeBytecode,$o as deploylessCallViaFactoryBytecode,as as encodeAbiParameters,rs as encodeDeployData,te as encodeErrorResult,A as encodeEventTopics,os as encodeFunctionData,ne as encodeFunctionResult,S as encodePacked,Ka as erc20Abi,Za as erc6492SignatureValidatorAbi,ss as erc6492SignatureValidatorByteCode,I as ethAddress,Ja as etherUnits,me as extendSchema,V as fallback,es as formatBlock,ts as formatEther,Qa as formatGwei,ns as formatLog,is as formatTransaction,cs as formatTransactionReceipt,ds as formatTransactionRequest,Xa as formatUnits,Ya as fromHex,Es as getAbiItem,us as getAddress,ps as getChainContractAddress,ls as getContractError,ms as getEventSelector,Ts as getEventSignature,gs as getFunctionSelector,bs as getFunctionSignature,hs as getTransactionType,Qs as getTypesForEIP712Domain,_a as gweiUnits,Xs as hashDomain,Ys as hashMessage,_s as hashStruct,$s as hashTypedData,$a as hexToBigInt,ar as hexToBool,rr as hexToBytes,or as hexToNumber,F as hexToSignature,sr as hexToString,s as http,ys as isAddress,fs as isAddressEqual,er as isHex,vs as keccak256,R as labelhash,As as maxUint16,Ss as maxUint256,tr as multicall3Abi,x as namehash,nr as numberToBytes,ir as numberToHex,Ee as offchainLookup,ue as offchainLookupAbiItem,pe as offchainLookupSignature,cr as pad,dr as padBytes,Er as padHex,Is as parseAbi,Te as parseAbiItem,ge as parseAbiParameters,Fs as parseEventLogs,C as parseSignature,M as parseUnits,Rs as prepareEncodeFunctionData,ae as presignMessagePrefix,B as publicActions,xs as recoverAddress,Cs as recoverPublicKey,Bs as rpcTransactionType,Se as serializeAccessList,N as serializeErc6492Signature,be as serializeSignature,Ie as serializeTransaction,Ns as sha256,O as shouldThrow,he as signatureToHex,ur as size,Ps as slice,Ds as sliceBytes,Us as sliceHex,pr as stringToBytes,lr as stringToHex,mr as stringify,ws as toBlobSidecars,Ls as toBlobs,Tr as toBytes,Ms as toEventHash,Hs as toEventSelector,ks as toEventSignature,zs as toFunctionHash,qs as toFunctionSelector,Vs as toFunctionSignature,gr as toHex,re as toPrefixedMessage,Os as toRlp,Gs as transactionType,br as trim,hr as universalSignatureValidatorAbi,js as universalSignatureValidatorByteCode,oe as validateTypedData,H as withCache,G as withRetry,j as withTimeout,P as zeroAddress};
|