@dcl/shop 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_assets/{Activity-CysvRMDH.js → Activity-CSDWiFkq.js} +1 -1
- package/_assets/{AnimatedBackground-1KvWirPP.js → AnimatedBackground-vKrEOHA5.js} +1 -1
- package/_assets/{Assets-CmA7g8ft.js → Assets-Cogahyqe.js} +3 -3
- package/_assets/{Assets.styles-BwMj4485.js → Assets.styles-B2EWL6JB.js} +1 -1
- package/_assets/{Authorizations-CfvVeEJl.js → Authorizations-BrKYlkZG.js} +1 -1
- package/_assets/{Cart-CYHKPPD-.js → Cart-W8w3sCuV.js} +5 -5
- package/_assets/{CircularProgress-oGg4qqHc.js → CircularProgress--GC-6I6k.js} +1 -1
- package/_assets/{Collection-Dmap3sR_.js → Collection-D16pjJSe.js} +1 -1
- package/_assets/{CollectionCarousel-DiADjTg-.js → CollectionCarousel-BeuBL17J.js} +77 -77
- package/_assets/{Creator-DB4BIeTa.js → Creator-BLsHzXRL.js} +1 -1
- package/_assets/{ErrorNotice-CBx78pQu.js → ErrorNotice-Cvc0nTjw.js} +1 -1
- package/_assets/{ExchangeController-DOvKzvyb.js → ExchangeController-DoFEzXko.js} +1 -1
- package/_assets/{GetCredits-Ch_OO41P.js → GetCredits-bxJh6m8F.js} +94 -130
- package/_assets/{HelpersUtil-CFCkU-g3.js → HelpersUtil-BFgierZ-.js} +1 -1
- package/_assets/{ImportListings-BGmtSIDb.js → ImportListings-BwORJ3CC.js} +13 -13
- package/_assets/{ItemDetail-ramYOGDR.js → ItemDetail-PoeIzOPp.js} +194 -194
- package/_assets/{ItemPreview.styles-D8aGYVBK.js → ItemPreview.styles-DtAUND9N.js} +1 -1
- package/_assets/{LoadMore-BSE8BKwI.js → LoadMore-DsWSQHxD.js} +1 -1
- package/_assets/ManaPricingBanner.styles-CF0iOeeS.js +74 -0
- package/_assets/{MenuList-qnDzTtfz.js → MenuList-DNOqfxHx.js} +1 -1
- package/_assets/{MyAssets-CgneL-KA.js → MyAssets-2XwaE-SE.js} +4 -4
- package/_assets/{MyFavorites-DrPT--am.js → MyFavorites-DIi3ztNe.js} +1 -1
- package/_assets/{NotFound-4IJj-QH6.js → NotFound-jHtQUp44.js} +1 -1
- package/_assets/{NotificationsBell-BOg2j5-7.js → NotificationsBell-By0uu4SI.js} +1 -1
- package/_assets/{OutfitDetail-DAfw3jDe.js → OutfitDetail-BQr6vhnT.js} +1 -1
- package/_assets/{OutfitPreview-DMQpfBpS.js → OutfitPreview-D6Z7-XEK.js} +1 -1
- package/_assets/{OutfitStudio-qASOqFO4.js → OutfitStudio-BFWU775v.js} +1 -1
- package/_assets/{StoreSettings-CjbyuHVf.js → StoreSettings-BJTpsKoX.js} +1 -1
- package/_assets/{Success-Ba2GyRY_.js → Success-CIQKaiOo.js} +1 -1
- package/_assets/{SwapController-B823Ep4J.js → SwapController-XcLKHFDT.js} +1 -1
- package/_assets/{Tooltip-2XcUkoOj.js → Tooltip-fS4VCxQs.js} +1 -1
- package/_assets/{TradeService-lYuRlk4v.js → TradeService-BgfeT0JQ.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-B8ZAc5Tp.js → W3MFrameProviderSingleton-BJE-tnmd.js} +3 -3
- package/_assets/{WebCryptoP256-CrjjL3U7.js → WebCryptoP256-P_MkVOZf.js} +1 -1
- package/_assets/authorizations-Bm65kFBw.js +1 -0
- package/_assets/{basic-3OIT7lDP.js → basic-BzdDurZu.js} +1 -1
- package/_assets/{biconomy-CLvfOfCg.js → biconomy-BHLIxKXm.js} +1 -1
- package/_assets/{browseLayout.styles-DCwE16ZG.js → browseLayout.styles-D_JQHeMK.js} +4 -4
- package/_assets/{builder-CoZ9B86k.js → builder-CPpn-LV6.js} +1 -1
- package/_assets/buy-CfVy6xwA.js +1 -0
- package/_assets/{buy-gasless-uIQiLsX8.js → buy-gasless-DmFIjDH7.js} +1 -1
- package/_assets/categories-D2JgaepG.js +448 -0
- package/_assets/{ccip-C8TW-3ey.js → ccip-BGuL2CTW.js} +1 -1
- package/_assets/{ccip-C4f9EXfY.js → ccip-japHsC-d.js} +1 -1
- package/_assets/{clsx-BsYHeX03.js → clsx-DY37pDvc.js} +1 -1
- package/_assets/{controller-ASkKeRkX.js → controller-CEuTNpMI.js} +2 -2
- package/_assets/{core-X_wu6_Dy.js → core-DFTtNj6Y.js} +4 -4
- package/_assets/{createSvgIcon-D4cpIqvx.js → createSvgIcon-BFo-10ds.js} +3 -3
- package/_assets/{custom-BVAi4D5H.js → custom-DyS8vC8K.js} +1 -1
- package/_assets/{data-capture-C23iRBhs.js → data-capture-CpqP5gpO.js} +1 -1
- package/_assets/{email-CB03fcCQ.js → email-DOkwtMrW.js} +1 -1
- package/_assets/{embedded-wallet-CnMDk9db.js → embedded-wallet-BI0I-FyI.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-CNluusdx.js → emotion-styled.browser.esm-nmKSs9QV.js} +1 -1
- package/_assets/{engine-DaJGLPH7.js → engine-BsCDGGhp.js} +1 -1
- package/_assets/{errors-CJ4NHTPm.js → errors-CVWX9epA.js} +1 -1
- package/_assets/{estimate-l1-fee-DC2eYWPQ.js → estimate-l1-fee-BwVQYvPZ.js} +1 -1
- package/_assets/{execute-vh_I47EG.js → execute-DCjeHtk2.js} +2 -2
- package/_assets/{features-i2gsSk7q.js → features-DmQF08Nd.js} +1 -1
- package/_assets/{fetchTokenMetadata-DpicXKCe.js → fetchTokenMetadata-DtvlyEpN.js} +2 -2
- package/_assets/{field.styles-DPC95Ntd.js → field.styles-ZqzDOrCY.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-B8_se1pi.js → get-ecosystem-wallet-info-glXHSBBX.js} +1 -1
- package/_assets/{getBalance-Cee2d5fc.js → getBalance-D4uOuyXp.js} +1 -1
- package/_assets/{getNFT-CUD-atXT.js → getNFT-D9u1poHS.js} +1 -1
- package/_assets/{getNFT-BjnrEAq8.js → getNFT-VYQvQv4K.js} +1 -1
- package/_assets/{getThemeProps-B71MHgCC.js → getThemeProps-BOJ8W9dy.js} +1 -1
- package/_assets/{grid.styles-q_RkLJKv.js → grid.styles-C92STzz7.js} +1 -1
- package/_assets/{hashTypedData-Bclxfb96.js → hashTypedData-CU4XEihs.js} +1 -1
- package/_assets/{hashTypedData-CiuZE5MB.js → hashTypedData-Cmk_4l7W.js} +1 -1
- package/_assets/hero-credits-outfits-DeMMQYZj.webp +0 -0
- package/_assets/{in-app-DoTVgkA7.js → in-app-n2C_GYjN.js} +1 -1
- package/_assets/{in-app-wallet-calls-aTpQmtYp.js → in-app-wallet-calls-BH4EHvoE.js} +1 -1
- package/_assets/{index-DJ0Ox_g6.js → index-1DlQc04C.js} +1 -1
- package/_assets/{index-oYINO7Gh.js → index-1E3TZOEp.js} +3 -3
- package/_assets/{index-ZtNObKUx.js → index-3G1ZZRHy.js} +1 -1
- package/_assets/{index-C_quGuYS.js → index-5ZQ75r5A.js} +2 -2
- package/_assets/{index-BOqO3K08.js → index-5oJAYQpS.js} +1 -1
- package/_assets/{index-DnUnGNK1.js → index-8ahFN9pV.js} +1 -1
- package/_assets/{index-BLIOngWK.js → index-9ZSFZyk5.js} +1 -1
- package/_assets/{index-CkdrAVd7.js → index-B-0owZIE.js} +1 -1
- package/_assets/{index-KhxRGpab.js → index-B-2A_xJK.js} +1 -1
- package/_assets/index-B0wrSWVL.js +3467 -0
- package/_assets/{index-DxbeSgwP.js → index-B33pX4sx.js} +1 -1
- package/_assets/{index-CnAxZm7a.js → index-B6HLteu2.js} +1 -1
- package/_assets/{index-C-ZPerkC.js → index-B95j5ECm.js} +1 -1
- package/_assets/{index-D2Hh-irJ.js → index-BAGHoKjd.js} +1 -1
- package/_assets/{index-BdZJNMhf.js → index-BAKuuHpY.js} +1 -1
- package/_assets/{index-Br-QxSL4.js → index-BBLwTza9.js} +1 -1
- package/_assets/{index-CLm5_lcW.js → index-BFbvmloZ.js} +1 -1
- package/_assets/{index-DREmVGyP.js → index-BKB9eVo_.js} +1 -1
- package/_assets/{index-CShk5nTD.js → index-Bdk6ierZ.js} +1 -1
- package/_assets/{index-pDIZRYxP.js → index-BmtMJnoP.js} +2 -2
- package/_assets/{index-DzoYWAIJ.js → index-Bnnl1_Pn.js} +1 -1
- package/_assets/{index-CHLJVbwu.js → index-BpfebiBi.js} +1 -1
- package/_assets/{index-Dqt4TaYh.js → index-BvzZi8lQ.js} +1 -1
- package/_assets/{index-BnVjsoyV.js → index-C1Zza7kR.js} +3 -3
- package/_assets/{index-LbRdNAf3.js → index-C75VmoUV.js} +1 -1
- package/_assets/{index-CiqC5vqm.js → index-CCQWBULG.js} +1 -1
- package/_assets/{index-DAKpmmlR.js → index-CDzrsoju.js} +1 -1
- package/_assets/{index-DpAZRpHS.js → index-CFJ4759x.js} +1 -1
- package/_assets/{index-DmmqNlbI.js → index-CMiDANew.js} +1 -1
- package/_assets/{index-6U0_groo.js → index-CNek90qs.js} +1 -1
- package/_assets/{index-BIMSqj0E.js → index-CS26D5br.js} +1 -1
- package/_assets/index-D-NhBWWr.css +1 -0
- package/_assets/{index-Da9c_8XH.js → index-DCJFwzag.js} +1 -1
- package/_assets/{index-B8WxnCSZ.js → index-DCkPd79h.js} +1 -1
- package/_assets/{index-AvMVq3p5.js → index-DO-41U6s.js} +1 -1
- package/_assets/{index-Zni41xRh.js → index-DU7iVDBh.js} +3 -3
- package/_assets/{index-X-5FVXow.js → index-DUOePrjP.js} +1 -1
- package/_assets/{index-BmR9lQvd.js → index-DWyeO73d.js} +1 -1
- package/_assets/{index-CqqbmEIM.js → index-Das01MWO.js} +2 -2
- package/_assets/{index-CKgjOb17.js → index-DcW0aOo_.js} +1 -1
- package/_assets/{index-D2cHV9P4.js → index-Dg3cba8i.js} +1 -1
- package/_assets/{index-umhEn8if.js → index-DgIUvj1u.js} +1 -1
- package/_assets/{index-B-yk4_og.js → index-Drzr7GIe.js} +1 -1
- package/_assets/{index-DhW6Eiq4.js → index-DuYquyJk.js} +1 -1
- package/_assets/{index-grey-Hql.js → index-Dyb9tM0L.js} +1 -1
- package/_assets/{index-CQd88f4P.js → index-S5ytn1G_.js} +1 -1
- package/_assets/{index-pkIYUyEs.js → index-X1g5-mc1.js} +2 -2
- package/_assets/{index-Bm4qVnUT.js → index-YlEZ0MB-.js} +1 -1
- package/_assets/{index-Dk_Ivei2.js → index-gO1p5U4e.js} +1 -1
- package/_assets/{index-BMHjpFTY.js → index-iVhRHvGC.js} +1 -1
- package/_assets/{index-5tjsFjOD.js → index-lc1BgLRJ.js} +1 -1
- package/_assets/{index-tvenjK5z.js → index-x_f1XpFN.js} +1 -1
- package/_assets/{index.es-C5-qOo53.js → index.es-CYrm9JiK.js} +4 -4
- package/_assets/{index.es-C4q67lvL.js → index.es-D-Hj-yaE.js} +1 -1
- package/_assets/{index.es-gI39JHkd.js → index.es-DlCKcYQh.js} +1 -1
- package/_assets/{localBatchGatewayRequest-CYWicxBl.js → localBatchGatewayRequest-D-M3uJjn.js} +1 -1
- package/_assets/{mana-convert-C239nuRR.js → mana-convert-XtWFaGCt.js} +1 -1
- package/_assets/{mana-rate-CWXyJ6Qt.js → mana-rate-CLS7fjKR.js} +1 -1
- package/_assets/{networks-CdC9lKkb.js → networks-DLkt_HOu.js} +1 -1
- package/_assets/{onramp-B6zv6owZ.js → onramp-B9C9zg8X.js} +1 -1
- package/_assets/{openzeppelin-fBZEbwFp.js → openzeppelin-Czmq9Q8z.js} +1 -1
- package/_assets/{parseNft-Dn6QDQHN.js → parseNft-Df0bG2_u.js} +2 -2
- package/_assets/{parseSignature-DecBV3iH.js → parseSignature-Cu3sQgfL.js} +1 -1
- package/_assets/{parseSignature-DAHrPk4v.js → parseSignature-nbJG9PDg.js} +3 -3
- package/_assets/{passkeys-KiBei2LX.js → passkeys-UkbavCkH.js} +1 -1
- package/_assets/{pay-with-exchange-D9SNWmjx.js → pay-with-exchange-BZkWaWxT.js} +1 -1
- package/_assets/{qr-overlay-2zAa6fld.js → qr-overlay-BE8jnAiO.js} +1 -1
- package/_assets/{receive-ChxNL97S.js → receive-B2e1QRi3.js} +1 -1
- package/_assets/{resolveImplementation-BNaLKkof.js → resolveImplementation-BBe0akeh.js} +1 -1
- package/_assets/{rpc-DBHsoP5N.js → rpc-iEVF2nz4.js} +1 -1
- package/_assets/{secp256k1-C8JTXBnF.js → secp256k1-Ba2kPpNf.js} +1 -1
- package/_assets/{secp256k1-C2pLUi5w.js → secp256k1-ClQ_G_RL.js} +1 -1
- package/_assets/{secp256k1-xOB6yMRi.js → secp256k1-e7mCjC3J.js} +1 -1
- package/_assets/{send-BLmLJ3eA.js → send-BOmHA5ER.js} +1 -1
- package/_assets/{send-batch-transaction-120lF45D.js → send-batch-transaction-C1STwRsa.js} +1 -1
- package/_assets/{send-eip712-transaction-B2w1ZAOY.js → send-eip712-transaction-Dy9FgG1n.js} +2 -2
- package/_assets/{send-gasless-transaction-oH9WEYVY.js → send-gasless-transaction-C66wRlKz.js} +2 -2
- package/_assets/{send-transaction-CLaO8DmY.js → send-transaction-CLuOLZ7t.js} +2 -2
- package/_assets/{sendMetaTransaction-OKd_ifNL.js → sendMetaTransaction-DvDr2bCi.js} +1 -1
- package/_assets/{sendRawTransaction-BP5hNXP6.js → sendRawTransaction-DqkFhazS.js} +3 -3
- package/_assets/{serializeTransaction--Dr7RtAU.js → serializeTransaction-BEOUomEz.js} +1 -1
- package/_assets/{session-proposal-CiYz-jZC.js → session-proposal-UXG0f185.js} +1 -1
- package/_assets/{session-request-Clv9A0oy.js → session-request-DIqK3WRK.js} +2 -2
- package/_assets/{signing-CJ5kWk7o.js → signing-DReJZKDs.js} +3 -3
- package/_assets/{socials-CeLfiCF9.js → socials-CdGrw0ok.js} +1 -1
- package/_assets/{swaps-DkDPQf9R.js → swaps-CycOd3sO.js} +1 -1
- package/_assets/{thirdweb-BcTKOQfU.js → thirdweb-D5w8-dkS.js} +3 -3
- package/_assets/{to-serializable-transaction-CVgEJJoF.js → to-serializable-transaction-C1TwC6Ti.js} +2 -2
- package/_assets/{trade-encoding-COAHYjJi.js → trade-encoding-Mw7kNWLf.js} +1 -1
- package/_assets/{transactionReceipt-dayojTpn.js → transactionReceipt-DyOMk-YN.js} +1 -1
- package/_assets/{transactions-BqxmWzZz.js → transactions-VmU1Fomk.js} +1 -1
- package/_assets/{useCreditPacks-CHpQ4LEN.js → useCreditPacks-D1yz9_D9.js} +1 -1
- package/_assets/{useInfiniteGrid-sc2vmuxU.js → useInfiniteGrid-C-7TbIWI.js} +1 -1
- package/_assets/useManaRate-6JYRR5Sm.js +1 -0
- package/_assets/{useSecondarySales-C8BuUV_s.js → useSecondarySales-BhfHOcZl.js} +1 -1
- package/_assets/{useStore-D3ONm_sP.js → useStore-DCWOq5iS.js} +1 -1
- package/_assets/{useTheme-D8ClSCiJ.js → useTheme-DoVQgCCM.js} +1 -1
- package/_assets/{verifyHash-tNHFcENz.js → verifyHash-B-nszbU3.js} +1 -1
- package/_assets/{w3m-modal-D0qE5VS7.js → w3m-modal-C9EOWDq3.js} +1 -1
- package/_assets/{w3m-modal-BYIDrkH-.js → w3m-modal-y9ZrKukQ.js} +1 -1
- package/_assets/{wait-for-tx-receipt-C3lxZWQH.js → wait-for-tx-receipt-DL1snjgl.js} +1 -1
- package/_assets/{wallets-BlFrUv2a.js → wallets-CExmmU6y.js} +5 -5
- package/_assets/{web-connector-DzEBomI8.js → web-connector-vE0RE6CB.js} +3 -3
- package/_assets/{writeContract-CaaID3Lc.js → writeContract-B0sDSczf.js} +1 -1
- package/_assets/{zoraTestnet-Da9dTQUp.js → zoraTestnet-B_NFi9S-.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/ManaPricingBanner.styles-bQxgJp4R.js +0 -74
- package/_assets/authorizations-BeJcD0Ty.js +0 -1
- package/_assets/buy-5BIPC7Eq.js +0 -1
- package/_assets/categories-CmiNaFHh.js +0 -427
- package/_assets/hero-fashion-week-B9LOzkde.png +0 -0
- package/_assets/index-9_8O7Lhc.js +0 -3488
- package/_assets/index-BMzstP-8.css +0 -1
- package/_assets/promo-best-rated-emotes-C6kNvB-a.png +0 -0
- package/_assets/promo-week-selected-outfits-BBmkZYZx.png +0 -0
- package/_assets/useManaRate-Ceh_R3VR.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as c,i as s,b as f}from"./lit-element-B3y9oplH.js";import"./index-
|
|
1
|
+
import{a as c,i as s,b as f}from"./lit-element-B3y9oplH.js";import"./index-DU7iVDBh.js";import{c as a}from"./index-C75VmoUV.js";import"./index-Drzr7GIe.js";import"./index-B0wrSWVL.js";import"./react-DehiWSvs.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./W3MFrameProviderSingleton-BJE-tnmd.js";import"./index-DI-3MKLG.js";import"./index-Das01MWO.js";import"./events-DQ172AOg.js";import"./browser-ponyfill-I5CKtKME.js";import"./NetworkUtil-EoWQDMpU.js";import"./index-gO1p5U4e.js";import"./index-nibyPLVP.js";import"./index-Bdk6ierZ.js";import"./index.es-D-Hj-yaE.js";import"./class-map-CxwNmq0D.js";import"./index-BKB9eVo_.js";import"./index-B95j5ECm.js";import"./index-DCJFwzag.js";import"./index-8ahFN9pV.js";const d=c`
|
|
2
2
|
:host > wui-flex:first-child {
|
|
3
3
|
height: 500px;
|
|
4
4
|
overflow-y: auto;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as w}from"./dcl-schemas-Dr9BTjb7.js";import{aj as v,ak as R,al as A,d as k,c as d,am as $,u as I}from"./index-
|
|
1
|
+
import{d as w}from"./dcl-schemas-Dr9BTjb7.js";import{aj as v,ak as R,al as A,d as k,c as d,am as $,u as I}from"./index-B0wrSWVL.js";import{m as E}from"./mana-convert-XtWFaGCt.js";const H="dcl_shop_resume_cart";function y(t){return A(t)}function U(t,r){const e=t.received[0];return e?e.assetType===Number(w.TradeAssetType.USD_PEGGED_MANA)?v(e.amount):e.assetType===Number(w.TradeAssetType.ERC20)?!r||!e.amount?0:E(e.amount,r):0:0}async function V(t,r,e,s,o){const n=[],i=[],c=[];for(const a of t)try{const u=a.tokenId?1:Math.max(1,Math.floor(a.quantity??1));if((a.acquisition??"trade")==="store"){const m=o?await o(a):null;if(!m||!s){i.push(a);continue}if(m.available<u){i.push(a);continue}const p=E(m.priceWei,s);if(!Number.isFinite(p)||p<=0){i.push(a);continue}n.push({item:a,acquisition:"store",priceWei:m.priceWei,usdCents:p,priceCredits:y(p),quantity:u});continue}const l=await e(a);if(!l){i.push(a);continue}if(R(l,r)){c.push(a);continue}const f=U(l,s);if(!Number.isFinite(f)||f<=0){i.push(a);continue}n.push({item:a,acquisition:"trade",trade:l,usdCents:f,priceCredits:y(f),quantity:u})}catch{i.push(a)}const P=n.reduce((a,u)=>a+u.priceCredits*u.quantity,0),S=i.length>0||c.length>0||n.some(a=>a.priceCredits!==a.item.priceCredits);return{buyable:n,unavailable:i,own:c,liveTotalCredits:P,orderChanged:S}}function X(t){const{reservations:r,spent:e,settled:s}=t,o=r.filter(i=>!e.has(i.salt)).map(i=>i.salt),n=[...new Set(r.filter(i=>s.has(i.salt)).map(i=>i.itemId))];return{toRelease:o,boughtItemIds:n}}function _(){return d.creditsServerUrl}async function D(t,r){const e=await k(`${_()}/credits/checkout`,{method:"POST",identity:r,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify({packId:t})});if(!e.ok)throw new Error(`checkout ${e.status}: ${await e.text()}`);const{orderId:s,url:o}=await e.json();return{orderId:s,url:o,mock:!1}}async function O(t,r,e={}){const{intervalMs:s=1500,timeoutMs:o=6e4,signal:n}=e,i=Date.now()+o;for(;;){if(n!=null&&n.aborted)throw new DOMException("Aborted","AbortError");const c=await q(t,r,n);if(c.status!=="processing")return c;if(Date.now()>i)return{status:"pending"};await K(s,n)}}async function q(t,r,e){const s=await k(`${_()}/credits/orders/${t}`,{method:"GET",identity:r,metadata:{},signal:e});if(s.status===404)return{status:"processing"};if(!s.ok)throw new Error(`order status ${s.status}`);return s.json()}function K(t,r){return new Promise((e,s)=>{const o=setTimeout(e,t);r==null||r.addEventListener("abort",()=>{clearTimeout(o),s(new DOMException("Aborted","AbortError"))})})}const L=.1,b=[{id:"pack_5",usd:5.99,credits:40},{id:"pack_10",usd:11.99,credits:100,bestValue:!0},{id:"pack_25",usd:29.99,credits:260},{id:"pack_50",usd:59.99,credits:540}];function Y(t,r){const e=r.reduce((n,i)=>i.usd<n.usd?i:n,r[0]);if(!e||e.id===t.id||!(e.usd>0))return null;const s=Math.floor(e.credits/e.usd*t.usd),o=t.credits-s;return o>0?{baseline:s,bonus:o}:null}const z=4;function C(t){return t.imageUrlWebp||t.imageUrl||void 0}async function N(){const t=await fetch(`${d.creditsServerUrl}/credits/packs`);if(!t.ok)throw new Error(`credit packs ${t.status}`);const{packs:r}=await t.json();return r.slice().sort((e,s)=>(e.order??0)-(s.order??0)).map(e=>({id:e.id,usd:e.usd,credits:e.credits,...e.recommended?{bestValue:!0}:{},...C(e)?{artUrl:C(e)}:{}}))}function T(t){return b.find(r=>r.id===t)}const h="mock_cs_",W=new Set([80002,11155111,1337,31337]);function g(){const t=!d.stripePublishableKey;if(t&&!W.has(d.chainId))throw new Error(`Stripe publishable key is missing on chainId=${d.chainId}, which is not a recognized test network. Refusing to fall back to mock payments in a real-money environment — configure STRIPE_PUBLISHABLE_KEY.`);return t}async function J(t,r){const e=T(t);if(!e)throw new Error("Unknown pack");if(g())return F(e);if(!(r!=null&&r.identity))throw new Error("Sign in to get credits.");return D(t,r.identity)}async function Q(t,r={}){const{intervalMs:e,timeoutMs:s,signal:o,identity:n}=r;if(g()||t.startsWith(h))return G(t,r);if(!n)throw new Error("Sign in to get credits.");return O(t,n,{intervalMs:e,timeoutMs:s,signal:o})}function F(t){const r=`${h}${t.id}_${Date.now()}`;return M(400).then(()=>({orderId:r,clientSecret:`${h}${t.id}`,mock:!0}))}async function G(t,r={}){await M(r.intervalMs??900);const e=t.replace(h,"").replace(/_\d+$/,""),s=T(e),o=(s==null?void 0:s.credits)??0;if(r.address&&s)try{const n=await $(r.address,Math.round(s.credits*L*100));return{status:"credited",creditsGranted:o,newBalance:n.credits}}catch(n){return{status:"failed",error:n.message}}return{status:"credited",creditsGranted:o,newBalance:o}}function M(t,r){return new Promise((e,s)=>{setTimeout(e,t)})}function Z(){const{data:t,isLoading:r}=I({queryKey:["credit-packs"],queryFn:N,staleTime:3e5,retry:!1});return{packs:t??b,isLoading:r&&t===void 0}}export{z as M,H as R,Q as a,Y as b,J as c,g as i,U as l,X as p,V as r,Z as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ae as x,af as N,ag as p,ah as v,ai as m}from"./index-
|
|
1
|
+
import{ae as x,af as N,ag as p,ah as v,ai as m}from"./index-B0wrSWVL.js";var b=class extends x{constructor(e,a){super(e,a)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,a){var d,l;const{state:i}=e,t=super.createResult(e,a),{isFetching:o,isRefetching:P,isError:c,isRefetchError:h}=t,s=(l=(d=i.fetchMeta)==null?void 0:d.fetchMore)==null?void 0:l.direction,r=c&&s==="forward",g=o&&s==="forward",n=c&&s==="backward",u=o&&s==="backward";return{...t,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:p(a,i.data),hasPreviousPage:N(a,i.data),isFetchNextPageError:r,isFetchingNextPage:g,isFetchPreviousPageError:n,isFetchingPreviousPage:u,isRefetchError:h&&!r&&!n,isRefetching:P&&!g&&!u}}};function F(e,a){return v(e,b)}function R(e,a,i={}){var c,h,s;const t=F({queryKey:e,enabled:i.enabled,queryFn:({pageParam:r})=>a(r),initialPageParam:0,getNextPageParam:(r,g)=>{if(r.items.length===0)return;const n=g.reduce((u,f)=>u+f.items.length,0);return n<r.total?n:void 0},placeholderData:m}),o=(((c=t.data)==null?void 0:c.pages)??[]).flatMap(r=>r.items),P=((s=(h=t.data)==null?void 0:h.pages[0])==null?void 0:s.total)??0;return{items:o,total:P,isLoading:t.isLoading,isPlaceholderData:t.isPlaceholderData,isError:t.isError,error:t.error,hasNextPage:t.hasNextPage,isFetchingNextPage:t.isFetchingNextPage,isFetchNextPageError:t.isFetchNextPageError,fetchNextPage:t.fetchNextPage}}export{R as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as r,c as e}from"./index-B0wrSWVL.js";import{r as t}from"./mana-rate-CLS7fjKR.js";function s(a=!0){return r({queryKey:["mana-rate",e.chainId],queryFn:()=>t(e.chainId),enabled:a,staleTime:6e4,refetchInterval:6e4,retry:1})}export{s as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as r,g as a}from"./index-
|
|
1
|
+
import{u as r,g as a}from"./index-B0wrSWVL.js";function t(){const{data:e}=r({queryKey:["feature-flag","shop-secondary-sales"],queryFn:a,staleTime:6e4,refetchOnWindowFocus:!0,retry:1});return e===!0}export{t as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-CNepofQh.js","_assets/index-kUOBQ2KK.js","_assets/react-DehiWSvs.js","_assets/sentry-973sfbO9.js","_assets/index-DG6oakSS.js","_assets/index-l92NuJVf.js","_assets/index-CTpdUOYC.js","_assets/ethers-CtNGBird.js","_assets/events-DQ172AOg.js","_assets/dcl-schemas-Dr9BTjb7.js","_assets/DeploymentBuilder-DbR23a3M.js","_assets/ContentClient-Bv-dXg1a.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as m,j as _,c as v,l as b,u as k}from"./index-
|
|
2
|
+
import{_ as m,j as _,c as v,l as b,u as k}from"./index-B0wrSWVL.js";import{d as E}from"./dcl-schemas-Dr9BTjb7.js";const w=()=>({cover:"",coverHash:"",description:"",links:{website:"",twitter:"",discord:"",facebook:""}}),d=t=>`urn:decentraland:off-chain:marketplace-stores:${t.toLowerCase()}`;function f(t,e){var r;const o=((r=t==null?void 0:t.find(n=>n.name===e))==null?void 0:r.url)??"";return o.startsWith("https://")?o:""}async function S(t){var e,o,r;try{const n=await fetch(`${v.peerUrl}/content/entities/active`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pointers:[d(t)]})});if(!n.ok)return w();const i=await n.json(),s=i==null?void 0:i[0];if(!(s!=null&&s.metadata))return w();const{metadata:c,content:l}=s,u=(o=(e=c.images)==null?void 0:e.find(p=>p.name==="cover"))==null?void 0:o.file,h=u?(r=l==null?void 0:l.find(p=>p.file===u))==null?void 0:r.hash:void 0;return{cover:h?`${v.peerUrl}/content/contents/${h}`:"",coverHash:h??"",description:(c.description??"").trim(),links:{website:f(c.links,"website"),twitter:f(c.links,"twitter"),discord:f(c.links,"discord"),facebook:f(c.links,"facebook")}}}catch{return w()}}const g=["website","twitter","discord","facebook"],C={website:"https://",twitter:"https://www.twitter.com/",discord:"https://discord.gg/",facebook:"https://www.facebook.com/"};function I(t){return{cover:t.cover,coverName:t.cover?L(t.cover):"",coverHash:t.coverHash,description:t.description,links:{...t.links}}}const y=new Map;function H(t){let e=y.get(t);return e||(e=(async()=>{const{hashV1:o}=await m(async()=>{const{hashV1:n}=await import("./index-CNepofQh.js").then(i=>i.i);return{hashV1:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),r=new Uint8Array(await(await fetch(t)).arrayBuffer());return o(r)})(),y.set(t,e)),e}function L(t){return`cover/${decodeURIComponent(t.split("?")[0].split("/").pop()||"")||"cover.jpeg"}`}function $(t,e){return e===""||e.startsWith(C[t])}function T(t,e){const o=t.toLowerCase(),r=g.filter(i=>e.links[i]).map(i=>({name:i,url:e.links[i]})),n=e.cover&&e.coverName?[{name:"cover",file:e.coverName}]:[];return{id:d(o),owner:o,description:e.description,images:n,links:r,version:1}}async function N(t){const e=new Map;if(t.cover&&t.coverName){const o=await fetch(t.cover);e.set(t.coverName,new Uint8Array(await o.arrayBuffer()))}return e}async function A(t,e,o){try{const[{buildEntity:r},{createContentClient:n}]=await Promise.all([m(()=>import("./DeploymentBuilder-DbR23a3M.js").then(a=>a.D),__vite__mapDeps([10,2,1,3,4,5,6,7,8,9])),m(()=>import("./ContentClient-Bv-dXg1a.js").then(a=>a.C),__vite__mapDeps([11,2,1,3,4,5,6,7,8,9]))]),i=T(t,e),s=await N(e),c=await r({type:E.EntityType.STORE,pointers:[d(t)],files:s,metadata:i,timestamp:Date.now()}),l=_.Authenticator.signPayload(o,c.entityId),u={fetch:(a,p)=>globalThis.fetch(a,p)};await n({url:`${v.peerUrl}/content`,fetcher:u}).deploy({...c,authChain:l})}catch(r){b(r,{flow:"saveStore"});const n=new Error("save-failed");throw n.cause=r,n}}function F(t){return k({queryKey:["store",t==null?void 0:t.toLowerCase()],enabled:!!t,staleTime:5*6e4,queryFn:()=>S(t)})}export{g as L,C as a,I as d,$ as i,A as s,H as t,F as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./react-DehiWSvs.js";import{h as t,T as m,i as s}from"./index-
|
|
1
|
+
import"./react-DehiWSvs.js";import{h as t,T as m,i as s}from"./index-B0wrSWVL.js";function u(){const e=t(s);return e[m]||e}export{u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{bV as rt,bW as wt,bX as xt,K as Wt,bY as nt,bZ as st,b_ as it,L as Ht,b$ as Ft,c0 as Pt,c1 as x,c2 as Yt,c3 as H,c4 as w,c5 as l,c6 as b,c7 as p,c8 as vt,c9 as qt,ca as It,cb as m,cc as $t,cd as Gt,ce as ot,cf as g,cg as Zt,ch as Xt,ci as Jt,cj as Qt,ck as Kt,cl as B,cm as At,cn as te,co as S,cp as F,cq as O,cr as ee,cs as V,bU as re,ct as ne,aQ as k,b8 as se,aI as U,az as Y,b9 as R,bi as Et,aq as ie,aK as oe,aX as at,am as ae,cu as ce,ay as ue,aA as fe,C as de,x as le}from"./sendRawTransaction-BP5hNXP6.js";import{a7 as ct,a9 as he,ac as ye,$ as pe,af as ut,ad as me,ay as Bt,a1 as ft,a8 as be}from"./NetworkUtil-EoWQDMpU.js";import{s as ge}from"./secp256k1-C2pLUi5w.js";function Vr(t){const e={formatters:void 0,fees:void 0,serializers:void 0,...t};function n(r){return s=>{const i=typeof s=="function"?s(r):s,o={...r,...i};return Object.assign(o,{extend:n(o)})}}return Object.assign(e,{extend:n(e)})}function kr(){return{}}function dt(t){let e;if(typeof t=="string")e=rt(t);else{const n=wt(t),r=t.length;for(let s=0;s<r;s++){const i=t[s];if(!xt(i)){e=rt(i,n);break}}}if(!e)throw new Wt({signature:t});return e}function lt(t){const e=[];if(typeof t=="string"){const n=nt(t),r=n.length;for(let s=0;s<r;s++)e.push(st(n[s],{modifiers:it}))}else{const n=wt(t),r=t.length;for(let s=0;s<r;s++){const i=t[s];if(xt(i))continue;const o=nt(i),a=o.length;for(let u=0;u<a;u++)e.push(st(o[u],{modifiers:it,structs:n}))}}if(e.length===0)throw new Ht({params:t});return e}function q(t,e={}){const{as:n=typeof t=="string"?"Hex":"Bytes"}=e,r=Ft(Pt(t));return n==="Bytes"?r:x(r)}function Ur(t,e={}){const{as:n=typeof t=="string"?"Hex":"Bytes"}=e,r=Yt(Pt(t));return n==="Bytes"?r:x(r)}function Tr(t){return H(t)&&w(t)===32}const we={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new ve({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new Pe({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new ht({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new ht({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const n=e??this.position;return this.assertPosition(n+t-1),this.bytes.subarray(n,n+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const n=this.inspectBytes(t);return this.position+=e??t,n},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function xe(t,{recursiveReadLimit:e=8192}={}){const n=Object.create(we);return n.bytes=t,n.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=e,n}class ht extends l{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class Pe extends l{constructor({length:e,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class ve extends l{constructor({count:e,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}class Ie extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const $e={checksum:new Ie(8192)},N=$e.checksum;function St(t,e={}){const{compressed:n}=e,{prefix:r,x:s,y:i}=t;if(n===!1||typeof s=="bigint"&&typeof i=="bigint"){if(r!==4)throw new yt({prefix:r,cause:new Se});return}if(n===!0||typeof s=="bigint"&&typeof i>"u"){if(r!==3&&r!==2)throw new yt({prefix:r,cause:new Be});return}throw new Ee({publicKey:t})}function _r(t){const e=(()=>{if(H(t))return zt(t);if(qt(t))return Ae(t);const{prefix:n,x:r,y:s}=t;return typeof r=="bigint"&&typeof s=="bigint"?{prefix:n??4,x:r,y:s}:{prefix:n,x:r}})();return St(e),e}function Ae(t){return zt(x(t))}function zt(t){if(t.length!==132&&t.length!==130&&t.length!==68)throw new ze({publicKey:t});if(t.length===130){const r=BigInt(m(t,0,32)),s=BigInt(m(t,32,64));return{prefix:4,x:r,y:s}}if(t.length===132){const r=Number(m(t,0,1)),s=BigInt(m(t,1,33)),i=BigInt(m(t,33,65));return{prefix:r,x:s,y:i}}const e=Number(m(t,0,1)),n=BigInt(m(t,1,33));return{prefix:e,x:n}}function Mr(t,e={}){return vt(Ct(t,e))}function Ct(t,e={}){St(t);const{prefix:n,x:r,y:s}=t,{includePrefix:i=!0}=e;return b(i?p(n,{size:1}):"0x",p(r,{size:32}),typeof s=="bigint"?p(s,{size:32}):"0x")}class Ee extends l{constructor({publicKey:e}){super(`Value \`${It(e)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class yt extends l{constructor({prefix:e,cause:n}){super(`Prefix "${e}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class Be extends l{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class Se extends l{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let ze=class extends l{constructor({publicKey:e}){super(`Value \`${e}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${w($t(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const Ce=/^0x[a-fA-F0-9]{40}$/;function v(t,e={}){const{strict:n=!0}=e;if(!Ce.test(t))throw new pt({address:t,cause:new Re});if(n){if(t.toLowerCase()===t)return;if(G(t)!==t)throw new pt({address:t,cause:new Le})}}function G(t){if(N.has(t))return N.get(t);v(t,{strict:!1});const e=t.substring(2).toLowerCase(),n=q(Gt(e),{as:"Bytes"}),r=e.split("");for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&r[i]&&(r[i]=r[i].toUpperCase()),(n[i>>1]&15)>=8&&r[i+1]&&(r[i+1]=r[i+1].toUpperCase());const s=`0x${r.join("")}`;return N.set(t,s),s}function Oe(t,e={}){const{checksum:n=!1}=e;return v(t),n?G(t):t}function Wr(t,e={}){const n=q(`0x${Ct(t).slice(4)}`).substring(26);return Oe(`0x${n}`,e)}function Hr(t,e){return v(t,{strict:!1}),v(e,{strict:!1}),t.toLowerCase()===e.toLowerCase()}function T(t,e={}){const{strict:n=!0}=e??{};try{return v(t,{strict:n}),!0}catch{return!1}}class pt extends l{constructor({address:e,cause:n}){super(`Address "${e}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class Re extends l{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class Le extends l{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const Ne=/^(.*)\[([0-9]*)\]$/,je=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ot=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,mt=2n**256n-1n;function Z(t,e={}){const{recovered:n}=e;if(typeof t.r>"u")throw new j({signature:t});if(typeof t.s>"u")throw new j({signature:t});if(n&&typeof t.yParity>"u")throw new j({signature:t});if(t.r<0n||t.r>mt)throw new We({value:t.r});if(t.s<0n||t.s>mt)throw new He({value:t.s});if(typeof t.yParity=="number"&&t.yParity!==0&&t.yParity!==1)throw new L({value:t.yParity})}function Ve(t){return Rt(x(t))}function Rt(t){if(t.length!==130&&t.length!==132)throw new De({signature:t});const e=BigInt(m(t,0,32)),n=BigInt(m(t,32,64)),r=(()=>{const s=+`0x${t.slice(130)}`;if(!Number.isNaN(s))try{return X(s)}catch{throw new L({value:s})}})();return typeof r>"u"?{r:e,s:n}:{r:e,s:n,yParity:r}}function ke(t){if(!(typeof t.r>"u")&&!(typeof t.s>"u"))return Lt(t)}function Lt(t){const e=typeof t=="string"?Rt(t):t instanceof Uint8Array?Ve(t):typeof t.r=="string"?Te(t):t.v?Ue(t):{r:t.r,s:t.s,...typeof t.yParity<"u"?{yParity:t.yParity}:{}};return Z(e),e}function Ue(t){return{r:t.r,s:t.s,yParity:X(t.v)}}function Te(t){const e=(()=>{const n=t.v?Number(t.v):void 0;let r=t.yParity?Number(t.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=X(n)),typeof r!="number")throw new L({value:t.yParity});return r})();return{r:BigInt(t.r),s:BigInt(t.s),yParity:e}}function Fr(t){const[e,n,r]=t;return Lt({r:n==="0x"?0n:BigInt(n),s:r==="0x"?0n:BigInt(r),yParity:e==="0x"?0:Number(e)})}function Yr(t){Z(t);const e=t.r,n=t.s;return b(p(e,{size:32}),p(n,{size:32}),typeof t.yParity=="number"?p(Me(t.yParity),{size:1}):"0x")}function _e(t){const{r:e,s:n,yParity:r}=t;return{r:p(e,{size:32}),s:p(n,{size:32}),yParity:r===0?"0x0":"0x1"}}function qr(t){const{r:e,s:n,yParity:r}=t;return[r?"0x01":"0x",e===0n?"0x":ot(p(e)),n===0n?"0x":ot(p(n))]}function X(t){if(t===0||t===27)return 0;if(t===1||t===28)return 1;if(t>=35)return t%2===0?1:0;throw new Fe({value:t})}function Me(t){if(t===0)return 27;if(t===1)return 28;throw new L({value:t})}class De extends l{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${w($t(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class j extends l{constructor({signature:e}){super(`Signature \`${It(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class We extends l{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class He extends l{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class L extends l{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class Fe extends l{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function E(t,e,n){const{checksumAddress:r,staticPosition:s}=n,i=K(e.type);if(i){const[o,a]=i;return qe(t,{...e,type:a},{checksumAddress:r,length:o,staticPosition:s})}if(e.type==="tuple")return Je(t,e,{checksumAddress:r,staticPosition:s});if(e.type==="address")return Ye(t,{checksum:r});if(e.type==="bool")return Ge(t);if(e.type.startsWith("bytes"))return Ze(t,e,{staticPosition:s});if(e.type.startsWith("uint")||e.type.startsWith("int"))return Xe(t,e);if(e.type==="string")return Qe(t,{staticPosition:s});throw new tt(e.type)}const bt=32,_=32;function Ye(t,e={}){const{checksum:n=!1}=e,r=t.readBytes(32);return[(i=>n?G(i):i)(x(Zt(r,-20))),32]}function qe(t,e,n){const{checksumAddress:r,length:s,staticPosition:i}=n;if(!s){const u=g(t.readBytes(_)),c=i+u,f=c+bt;t.setPosition(c);const d=g(t.readBytes(bt)),y=z(e);let h=0;const $=[];for(let P=0;P<d;++P){t.setPosition(f+(y?P*32:h));const[C,Dt]=E(t,e,{checksumAddress:r,staticPosition:f});h+=Dt,$.push(C)}return t.setPosition(i+32),[$,32]}if(z(e)){const u=g(t.readBytes(_)),c=i+u,f=[];for(let d=0;d<s;++d){t.setPosition(c+d*32);const[y]=E(t,e,{checksumAddress:r,staticPosition:c});f.push(y)}return t.setPosition(i+32),[f,32]}let o=0;const a=[];for(let u=0;u<s;++u){const[c,f]=E(t,e,{checksumAddress:r,staticPosition:i+o});o+=f,a.push(c)}return[a,o]}function Ge(t){return[Xt(t.readBytes(32),{size:32}),32]}function Ze(t,e,{staticPosition:n}){const[r,s]=e.type.split("bytes");if(!s){const o=g(t.readBytes(32));t.setPosition(n+o);const a=g(t.readBytes(32));if(a===0)return t.setPosition(n+32),["0x",32];const u=t.readBytes(a);return t.setPosition(n+32),[x(u),32]}return[x(t.readBytes(Number.parseInt(s,10),32)),32]}function Xe(t,e){const n=e.type.startsWith("int"),r=Number.parseInt(e.type.split("int")[1]||"256",10),s=t.readBytes(32);return[r>48?Jt(s,{signed:n}):g(s,{signed:n}),32]}function Je(t,e,n){const{checksumAddress:r,staticPosition:s}=n,i=e.components.length===0||e.components.some(({name:u})=>!u),o=i?[]:{};let a=0;if(z(e)){const u=g(t.readBytes(_)),c=s+u;for(let f=0;f<e.components.length;++f){const d=e.components[f];t.setPosition(c+a);const[y,h]=E(t,d,{checksumAddress:r,staticPosition:c});a+=h,o[i?f:d==null?void 0:d.name]=y}return t.setPosition(s+32),[o,32]}for(let u=0;u<e.components.length;++u){const c=e.components[u],[f,d]=E(t,c,{checksumAddress:r,staticPosition:s});o[i?u:c==null?void 0:c.name]=f,a+=d}return[o,a]}function Qe(t,{staticPosition:e}){const n=g(t.readBytes(32)),r=e+n;t.setPosition(r);const s=g(t.readBytes(32));if(s===0)return t.setPosition(e+32),["",32];const i=t.readBytes(s,32),o=Qt(Kt(i));return t.setPosition(e+32),[o,32]}function Ke({checksumAddress:t,parameters:e,values:n}){const r=[];for(let s=0;s<e.length;s++)r.push(J({checksumAddress:t,parameter:e[s],value:n[s]}));return r}function J({checksumAddress:t=!1,parameter:e,value:n}){const r=e,s=K(r.type);if(s){const[i,o]=s;return er(n,{checksumAddress:t,length:i,parameter:{...r,type:o}})}if(r.type==="tuple")return or(n,{checksumAddress:t,parameter:r});if(r.type==="address")return tr(n,{checksum:t});if(r.type==="bool")return nr(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const i=r.type.startsWith("int"),[,,o="256"]=Ot.exec(r.type)??[];return sr(n,{signed:i,size:Number(o)})}if(r.type.startsWith("bytes"))return rr(n,{type:r.type});if(r.type==="string")return ir(n);throw new tt(r.type)}function Q(t){let e=0;for(let i=0;i<t.length;i++){const{dynamic:o,encoded:a}=t[i];o?e+=32:e+=w(a)}const n=[],r=[];let s=0;for(let i=0;i<t.length;i++){const{dynamic:o,encoded:a}=t[i];o?(n.push(p(e+s,{size:32})),r.push(a),s+=w(a)):n.push(a)}return b(...n,...r)}function tr(t,e){const{checksum:n=!1}=e;return v(t,{strict:n}),{dynamic:!1,encoded:B(t.toLowerCase())}}function er(t,e){const{checksumAddress:n,length:r,parameter:s}=e,i=r===null;if(!Array.isArray(t))throw new lr(t);if(!i&&t.length!==r)throw new dr({expectedLength:r,givenLength:t.length,type:`${s.type}[${r}]`});let o=!1;const a=[];for(let u=0;u<t.length;u++){const c=J({checksumAddress:n,parameter:s,value:t[u]});c.dynamic&&(o=!0),a.push(c)}if(i||o){const u=Q(a);if(i){const c=p(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?b(c,u):c}}if(o)return{dynamic:!0,encoded:u}}return{dynamic:!1,encoded:b(...a.map(({encoded:u})=>u))}}function rr(t,{type:e}){const[,n]=e.split("bytes"),r=w(t);if(!n){let s=t;return r%32!==0&&(s=S(s,Math.ceil((t.length-2)/2/32)*32)),{dynamic:!0,encoded:b(B(p(r,{size:32})),s)}}if(r!==Number.parseInt(n,10))throw new jt({expectedSize:Number.parseInt(n,10),value:t});return{dynamic:!1,encoded:S(t)}}function nr(t){if(typeof t!="boolean")throw new l(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:B(At(t))}}function sr(t,{signed:e,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(e?1n:0n))-1n,s=e?-r-1n:0n;if(t>r||t<s)throw new te({max:r.toString(),min:s.toString(),signed:e,size:n/8,value:t.toString()})}return{dynamic:!1,encoded:p(t,{size:32,signed:e})}}function ir(t){const e=F(t),n=Math.ceil(w(e)/32),r=[];for(let s=0;s<n;s++)r.push(S(m(e,s*32,(s+1)*32)));return{dynamic:!0,encoded:b(S(p(w(e),{size:32})),...r)}}function or(t,e){const{checksumAddress:n,parameter:r}=e;let s=!1;const i=[];for(let o=0;o<r.components.length;o++){const a=r.components[o],u=Array.isArray(t)?o:a.name,c=J({checksumAddress:n,parameter:a,value:t[u]});i.push(c),c.dynamic&&(s=!0)}return{dynamic:s,encoded:s?Q(i):b(...i.map(({encoded:o})=>o))}}function K(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function z(t){var r;const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return(r=t.components)==null?void 0:r.some(z);const n=K(t.type);return!!(n&&z({...t,type:n[1]}))}function ar(t,e,n={}){const{as:r="Array",checksumAddress:s=!1}=n,i=typeof e=="string"?vt(e):e,o=xe(i);if(O(i)===0&&t.length>0)throw new fr;if(O(i)&&O(i)<32)throw new ur({data:typeof e=="string"?e:x(e),parameters:t,size:O(i)});let a=0;const u=r==="Array"?[]:{};for(let c=0;c<t.length;++c){const f=t[c];o.setPosition(a);const[d,y]=E(o,f,{checksumAddress:s,staticPosition:0});a+=y,r==="Array"?u.push(d):u[f.name??c]=d}return u}function cr(t,e,n){const{checksumAddress:r=!1}={};if(t.length!==e.length)throw new Vt({expectedLength:t.length,givenLength:e.length});const s=Ke({checksumAddress:r,parameters:t,values:e}),i=Q(s);return i.length===0?"0x":i}function M(t,e){if(t.length!==e.length)throw new Vt({expectedLength:t.length,givenLength:e.length});const n=[];for(let r=0;r<t.length;r++){const s=t[r],i=e[r];n.push(M.encode(s,i))}return b(...n)}(function(t){function e(n,r,s=!1){if(n==="address"){const u=r;return v(u),B(u.toLowerCase(),s?32:0)}if(n==="string")return F(r);if(n==="bytes")return r;if(n==="bool")return B(At(r),s?32:1);const i=n.match(Ot);if(i){const[u,c,f="256"]=i,d=Number.parseInt(f,10)/8;return p(r,{size:s?32:d,signed:c==="int"})}const o=n.match(je);if(o){const[u,c]=o;if(Number.parseInt(c,10)!==(r.length-2)/2)throw new jt({expectedSize:Number.parseInt(c,10),value:r});return S(r,s?32:0)}const a=n.match(Ne);if(a&&Array.isArray(r)){const[u,c]=a,f=[];for(let d=0;d<r.length;d++)f.push(e(c,r[d],!0));return f.length===0?"0x":b(...f)}throw new tt(n)}t.encode=e})(M||(M={}));function Nt(t){return Array.isArray(t)&&typeof t[0]=="string"||typeof t=="string"?lt(t):t}class ur extends l{constructor({data:e,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${ee(n)})`,`Data: ${e} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class fr extends l{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class dr extends l{constructor({expectedLength:e,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${e}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class jt extends l{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${w(n)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class Vt extends l{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${e}`,`Given length (values): ${n}`].join(`
|
|
1
|
+
import{bV as rt,bW as wt,bX as xt,K as Wt,bY as nt,bZ as st,b_ as it,L as Ht,b$ as Ft,c0 as Pt,c1 as x,c2 as Yt,c3 as H,c4 as w,c5 as l,c6 as b,c7 as p,c8 as vt,c9 as qt,ca as It,cb as m,cc as $t,cd as Gt,ce as ot,cf as g,cg as Zt,ch as Xt,ci as Jt,cj as Qt,ck as Kt,cl as B,cm as At,cn as te,co as S,cp as F,cq as O,cr as ee,cs as V,bU as re,ct as ne,aQ as k,b8 as se,aI as U,az as Y,b9 as R,bi as Et,aq as ie,aK as oe,aX as at,am as ae,cu as ce,ay as ue,aA as fe,C as de,x as le}from"./sendRawTransaction-DqkFhazS.js";import{a7 as ct,a9 as he,ac as ye,$ as pe,af as ut,ad as me,ay as Bt,a1 as ft,a8 as be}from"./NetworkUtil-EoWQDMpU.js";import{s as ge}from"./secp256k1-ClQ_G_RL.js";function Vr(t){const e={formatters:void 0,fees:void 0,serializers:void 0,...t};function n(r){return s=>{const i=typeof s=="function"?s(r):s,o={...r,...i};return Object.assign(o,{extend:n(o)})}}return Object.assign(e,{extend:n(e)})}function kr(){return{}}function dt(t){let e;if(typeof t=="string")e=rt(t);else{const n=wt(t),r=t.length;for(let s=0;s<r;s++){const i=t[s];if(!xt(i)){e=rt(i,n);break}}}if(!e)throw new Wt({signature:t});return e}function lt(t){const e=[];if(typeof t=="string"){const n=nt(t),r=n.length;for(let s=0;s<r;s++)e.push(st(n[s],{modifiers:it}))}else{const n=wt(t),r=t.length;for(let s=0;s<r;s++){const i=t[s];if(xt(i))continue;const o=nt(i),a=o.length;for(let u=0;u<a;u++)e.push(st(o[u],{modifiers:it,structs:n}))}}if(e.length===0)throw new Ht({params:t});return e}function q(t,e={}){const{as:n=typeof t=="string"?"Hex":"Bytes"}=e,r=Ft(Pt(t));return n==="Bytes"?r:x(r)}function Ur(t,e={}){const{as:n=typeof t=="string"?"Hex":"Bytes"}=e,r=Yt(Pt(t));return n==="Bytes"?r:x(r)}function Tr(t){return H(t)&&w(t)===32}const we={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new ve({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new Pe({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new ht({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new ht({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const n=e??this.position;return this.assertPosition(n+t-1),this.bytes.subarray(n,n+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const n=this.inspectBytes(t);return this.position+=e??t,n},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function xe(t,{recursiveReadLimit:e=8192}={}){const n=Object.create(we);return n.bytes=t,n.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=e,n}class ht extends l{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class Pe extends l{constructor({length:e,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class ve extends l{constructor({count:e,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}class Ie extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const $e={checksum:new Ie(8192)},N=$e.checksum;function St(t,e={}){const{compressed:n}=e,{prefix:r,x:s,y:i}=t;if(n===!1||typeof s=="bigint"&&typeof i=="bigint"){if(r!==4)throw new yt({prefix:r,cause:new Se});return}if(n===!0||typeof s=="bigint"&&typeof i>"u"){if(r!==3&&r!==2)throw new yt({prefix:r,cause:new Be});return}throw new Ee({publicKey:t})}function _r(t){const e=(()=>{if(H(t))return zt(t);if(qt(t))return Ae(t);const{prefix:n,x:r,y:s}=t;return typeof r=="bigint"&&typeof s=="bigint"?{prefix:n??4,x:r,y:s}:{prefix:n,x:r}})();return St(e),e}function Ae(t){return zt(x(t))}function zt(t){if(t.length!==132&&t.length!==130&&t.length!==68)throw new ze({publicKey:t});if(t.length===130){const r=BigInt(m(t,0,32)),s=BigInt(m(t,32,64));return{prefix:4,x:r,y:s}}if(t.length===132){const r=Number(m(t,0,1)),s=BigInt(m(t,1,33)),i=BigInt(m(t,33,65));return{prefix:r,x:s,y:i}}const e=Number(m(t,0,1)),n=BigInt(m(t,1,33));return{prefix:e,x:n}}function Mr(t,e={}){return vt(Ct(t,e))}function Ct(t,e={}){St(t);const{prefix:n,x:r,y:s}=t,{includePrefix:i=!0}=e;return b(i?p(n,{size:1}):"0x",p(r,{size:32}),typeof s=="bigint"?p(s,{size:32}):"0x")}class Ee extends l{constructor({publicKey:e}){super(`Value \`${It(e)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class yt extends l{constructor({prefix:e,cause:n}){super(`Prefix "${e}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class Be extends l{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class Se extends l{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let ze=class extends l{constructor({publicKey:e}){super(`Value \`${e}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${w($t(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const Ce=/^0x[a-fA-F0-9]{40}$/;function v(t,e={}){const{strict:n=!0}=e;if(!Ce.test(t))throw new pt({address:t,cause:new Re});if(n){if(t.toLowerCase()===t)return;if(G(t)!==t)throw new pt({address:t,cause:new Le})}}function G(t){if(N.has(t))return N.get(t);v(t,{strict:!1});const e=t.substring(2).toLowerCase(),n=q(Gt(e),{as:"Bytes"}),r=e.split("");for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&r[i]&&(r[i]=r[i].toUpperCase()),(n[i>>1]&15)>=8&&r[i+1]&&(r[i+1]=r[i+1].toUpperCase());const s=`0x${r.join("")}`;return N.set(t,s),s}function Oe(t,e={}){const{checksum:n=!1}=e;return v(t),n?G(t):t}function Wr(t,e={}){const n=q(`0x${Ct(t).slice(4)}`).substring(26);return Oe(`0x${n}`,e)}function Hr(t,e){return v(t,{strict:!1}),v(e,{strict:!1}),t.toLowerCase()===e.toLowerCase()}function T(t,e={}){const{strict:n=!0}=e??{};try{return v(t,{strict:n}),!0}catch{return!1}}class pt extends l{constructor({address:e,cause:n}){super(`Address "${e}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class Re extends l{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class Le extends l{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const Ne=/^(.*)\[([0-9]*)\]$/,je=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ot=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,mt=2n**256n-1n;function Z(t,e={}){const{recovered:n}=e;if(typeof t.r>"u")throw new j({signature:t});if(typeof t.s>"u")throw new j({signature:t});if(n&&typeof t.yParity>"u")throw new j({signature:t});if(t.r<0n||t.r>mt)throw new We({value:t.r});if(t.s<0n||t.s>mt)throw new He({value:t.s});if(typeof t.yParity=="number"&&t.yParity!==0&&t.yParity!==1)throw new L({value:t.yParity})}function Ve(t){return Rt(x(t))}function Rt(t){if(t.length!==130&&t.length!==132)throw new De({signature:t});const e=BigInt(m(t,0,32)),n=BigInt(m(t,32,64)),r=(()=>{const s=+`0x${t.slice(130)}`;if(!Number.isNaN(s))try{return X(s)}catch{throw new L({value:s})}})();return typeof r>"u"?{r:e,s:n}:{r:e,s:n,yParity:r}}function ke(t){if(!(typeof t.r>"u")&&!(typeof t.s>"u"))return Lt(t)}function Lt(t){const e=typeof t=="string"?Rt(t):t instanceof Uint8Array?Ve(t):typeof t.r=="string"?Te(t):t.v?Ue(t):{r:t.r,s:t.s,...typeof t.yParity<"u"?{yParity:t.yParity}:{}};return Z(e),e}function Ue(t){return{r:t.r,s:t.s,yParity:X(t.v)}}function Te(t){const e=(()=>{const n=t.v?Number(t.v):void 0;let r=t.yParity?Number(t.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=X(n)),typeof r!="number")throw new L({value:t.yParity});return r})();return{r:BigInt(t.r),s:BigInt(t.s),yParity:e}}function Fr(t){const[e,n,r]=t;return Lt({r:n==="0x"?0n:BigInt(n),s:r==="0x"?0n:BigInt(r),yParity:e==="0x"?0:Number(e)})}function Yr(t){Z(t);const e=t.r,n=t.s;return b(p(e,{size:32}),p(n,{size:32}),typeof t.yParity=="number"?p(Me(t.yParity),{size:1}):"0x")}function _e(t){const{r:e,s:n,yParity:r}=t;return{r:p(e,{size:32}),s:p(n,{size:32}),yParity:r===0?"0x0":"0x1"}}function qr(t){const{r:e,s:n,yParity:r}=t;return[r?"0x01":"0x",e===0n?"0x":ot(p(e)),n===0n?"0x":ot(p(n))]}function X(t){if(t===0||t===27)return 0;if(t===1||t===28)return 1;if(t>=35)return t%2===0?1:0;throw new Fe({value:t})}function Me(t){if(t===0)return 27;if(t===1)return 28;throw new L({value:t})}class De extends l{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${w($t(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class j extends l{constructor({signature:e}){super(`Signature \`${It(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class We extends l{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class He extends l{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class L extends l{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class Fe extends l{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function E(t,e,n){const{checksumAddress:r,staticPosition:s}=n,i=K(e.type);if(i){const[o,a]=i;return qe(t,{...e,type:a},{checksumAddress:r,length:o,staticPosition:s})}if(e.type==="tuple")return Je(t,e,{checksumAddress:r,staticPosition:s});if(e.type==="address")return Ye(t,{checksum:r});if(e.type==="bool")return Ge(t);if(e.type.startsWith("bytes"))return Ze(t,e,{staticPosition:s});if(e.type.startsWith("uint")||e.type.startsWith("int"))return Xe(t,e);if(e.type==="string")return Qe(t,{staticPosition:s});throw new tt(e.type)}const bt=32,_=32;function Ye(t,e={}){const{checksum:n=!1}=e,r=t.readBytes(32);return[(i=>n?G(i):i)(x(Zt(r,-20))),32]}function qe(t,e,n){const{checksumAddress:r,length:s,staticPosition:i}=n;if(!s){const u=g(t.readBytes(_)),c=i+u,f=c+bt;t.setPosition(c);const d=g(t.readBytes(bt)),y=z(e);let h=0;const $=[];for(let P=0;P<d;++P){t.setPosition(f+(y?P*32:h));const[C,Dt]=E(t,e,{checksumAddress:r,staticPosition:f});h+=Dt,$.push(C)}return t.setPosition(i+32),[$,32]}if(z(e)){const u=g(t.readBytes(_)),c=i+u,f=[];for(let d=0;d<s;++d){t.setPosition(c+d*32);const[y]=E(t,e,{checksumAddress:r,staticPosition:c});f.push(y)}return t.setPosition(i+32),[f,32]}let o=0;const a=[];for(let u=0;u<s;++u){const[c,f]=E(t,e,{checksumAddress:r,staticPosition:i+o});o+=f,a.push(c)}return[a,o]}function Ge(t){return[Xt(t.readBytes(32),{size:32}),32]}function Ze(t,e,{staticPosition:n}){const[r,s]=e.type.split("bytes");if(!s){const o=g(t.readBytes(32));t.setPosition(n+o);const a=g(t.readBytes(32));if(a===0)return t.setPosition(n+32),["0x",32];const u=t.readBytes(a);return t.setPosition(n+32),[x(u),32]}return[x(t.readBytes(Number.parseInt(s,10),32)),32]}function Xe(t,e){const n=e.type.startsWith("int"),r=Number.parseInt(e.type.split("int")[1]||"256",10),s=t.readBytes(32);return[r>48?Jt(s,{signed:n}):g(s,{signed:n}),32]}function Je(t,e,n){const{checksumAddress:r,staticPosition:s}=n,i=e.components.length===0||e.components.some(({name:u})=>!u),o=i?[]:{};let a=0;if(z(e)){const u=g(t.readBytes(_)),c=s+u;for(let f=0;f<e.components.length;++f){const d=e.components[f];t.setPosition(c+a);const[y,h]=E(t,d,{checksumAddress:r,staticPosition:c});a+=h,o[i?f:d==null?void 0:d.name]=y}return t.setPosition(s+32),[o,32]}for(let u=0;u<e.components.length;++u){const c=e.components[u],[f,d]=E(t,c,{checksumAddress:r,staticPosition:s});o[i?u:c==null?void 0:c.name]=f,a+=d}return[o,a]}function Qe(t,{staticPosition:e}){const n=g(t.readBytes(32)),r=e+n;t.setPosition(r);const s=g(t.readBytes(32));if(s===0)return t.setPosition(e+32),["",32];const i=t.readBytes(s,32),o=Qt(Kt(i));return t.setPosition(e+32),[o,32]}function Ke({checksumAddress:t,parameters:e,values:n}){const r=[];for(let s=0;s<e.length;s++)r.push(J({checksumAddress:t,parameter:e[s],value:n[s]}));return r}function J({checksumAddress:t=!1,parameter:e,value:n}){const r=e,s=K(r.type);if(s){const[i,o]=s;return er(n,{checksumAddress:t,length:i,parameter:{...r,type:o}})}if(r.type==="tuple")return or(n,{checksumAddress:t,parameter:r});if(r.type==="address")return tr(n,{checksum:t});if(r.type==="bool")return nr(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const i=r.type.startsWith("int"),[,,o="256"]=Ot.exec(r.type)??[];return sr(n,{signed:i,size:Number(o)})}if(r.type.startsWith("bytes"))return rr(n,{type:r.type});if(r.type==="string")return ir(n);throw new tt(r.type)}function Q(t){let e=0;for(let i=0;i<t.length;i++){const{dynamic:o,encoded:a}=t[i];o?e+=32:e+=w(a)}const n=[],r=[];let s=0;for(let i=0;i<t.length;i++){const{dynamic:o,encoded:a}=t[i];o?(n.push(p(e+s,{size:32})),r.push(a),s+=w(a)):n.push(a)}return b(...n,...r)}function tr(t,e){const{checksum:n=!1}=e;return v(t,{strict:n}),{dynamic:!1,encoded:B(t.toLowerCase())}}function er(t,e){const{checksumAddress:n,length:r,parameter:s}=e,i=r===null;if(!Array.isArray(t))throw new lr(t);if(!i&&t.length!==r)throw new dr({expectedLength:r,givenLength:t.length,type:`${s.type}[${r}]`});let o=!1;const a=[];for(let u=0;u<t.length;u++){const c=J({checksumAddress:n,parameter:s,value:t[u]});c.dynamic&&(o=!0),a.push(c)}if(i||o){const u=Q(a);if(i){const c=p(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?b(c,u):c}}if(o)return{dynamic:!0,encoded:u}}return{dynamic:!1,encoded:b(...a.map(({encoded:u})=>u))}}function rr(t,{type:e}){const[,n]=e.split("bytes"),r=w(t);if(!n){let s=t;return r%32!==0&&(s=S(s,Math.ceil((t.length-2)/2/32)*32)),{dynamic:!0,encoded:b(B(p(r,{size:32})),s)}}if(r!==Number.parseInt(n,10))throw new jt({expectedSize:Number.parseInt(n,10),value:t});return{dynamic:!1,encoded:S(t)}}function nr(t){if(typeof t!="boolean")throw new l(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:B(At(t))}}function sr(t,{signed:e,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(e?1n:0n))-1n,s=e?-r-1n:0n;if(t>r||t<s)throw new te({max:r.toString(),min:s.toString(),signed:e,size:n/8,value:t.toString()})}return{dynamic:!1,encoded:p(t,{size:32,signed:e})}}function ir(t){const e=F(t),n=Math.ceil(w(e)/32),r=[];for(let s=0;s<n;s++)r.push(S(m(e,s*32,(s+1)*32)));return{dynamic:!0,encoded:b(S(p(w(e),{size:32})),...r)}}function or(t,e){const{checksumAddress:n,parameter:r}=e;let s=!1;const i=[];for(let o=0;o<r.components.length;o++){const a=r.components[o],u=Array.isArray(t)?o:a.name,c=J({checksumAddress:n,parameter:a,value:t[u]});i.push(c),c.dynamic&&(s=!0)}return{dynamic:s,encoded:s?Q(i):b(...i.map(({encoded:o})=>o))}}function K(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function z(t){var r;const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return(r=t.components)==null?void 0:r.some(z);const n=K(t.type);return!!(n&&z({...t,type:n[1]}))}function ar(t,e,n={}){const{as:r="Array",checksumAddress:s=!1}=n,i=typeof e=="string"?vt(e):e,o=xe(i);if(O(i)===0&&t.length>0)throw new fr;if(O(i)&&O(i)<32)throw new ur({data:typeof e=="string"?e:x(e),parameters:t,size:O(i)});let a=0;const u=r==="Array"?[]:{};for(let c=0;c<t.length;++c){const f=t[c];o.setPosition(a);const[d,y]=E(o,f,{checksumAddress:s,staticPosition:0});a+=y,r==="Array"?u.push(d):u[f.name??c]=d}return u}function cr(t,e,n){const{checksumAddress:r=!1}={};if(t.length!==e.length)throw new Vt({expectedLength:t.length,givenLength:e.length});const s=Ke({checksumAddress:r,parameters:t,values:e}),i=Q(s);return i.length===0?"0x":i}function M(t,e){if(t.length!==e.length)throw new Vt({expectedLength:t.length,givenLength:e.length});const n=[];for(let r=0;r<t.length;r++){const s=t[r],i=e[r];n.push(M.encode(s,i))}return b(...n)}(function(t){function e(n,r,s=!1){if(n==="address"){const u=r;return v(u),B(u.toLowerCase(),s?32:0)}if(n==="string")return F(r);if(n==="bytes")return r;if(n==="bool")return B(At(r),s?32:1);const i=n.match(Ot);if(i){const[u,c,f="256"]=i,d=Number.parseInt(f,10)/8;return p(r,{size:s?32:d,signed:c==="int"})}const o=n.match(je);if(o){const[u,c]=o;if(Number.parseInt(c,10)!==(r.length-2)/2)throw new jt({expectedSize:Number.parseInt(c,10),value:r});return S(r,s?32:0)}const a=n.match(Ne);if(a&&Array.isArray(r)){const[u,c]=a,f=[];for(let d=0;d<r.length;d++)f.push(e(c,r[d],!0));return f.length===0?"0x":b(...f)}throw new tt(n)}t.encode=e})(M||(M={}));function Nt(t){return Array.isArray(t)&&typeof t[0]=="string"||typeof t=="string"?lt(t):t}class ur extends l{constructor({data:e,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${ee(n)})`,`Data: ${e} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class fr extends l{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class dr extends l{constructor({expectedLength:e,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${e}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class jt extends l{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${w(n)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class Vt extends l{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${e}`,`Given length (values): ${n}`].join(`
|
|
2
2
|
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class lr extends l{constructor(e){super(`Value \`${e}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class tt extends l{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function D(t){let e=!0,n="",r=0,s="",i=!1;for(let o=0;o<t.length;o++){const a=t[o];if(["(",")",","].includes(a)&&(e=!0),a==="("&&r++,a===")"&&r--,!!e){if(r===0){if(a===" "&&["event","function","error",""].includes(s))s="";else if(s+=a,a===")"){i=!0;break}continue}if(a===" "){t[o-1]!==","&&n!==","&&n!==",("&&(n="",e=!1);continue}s+=a,n+=a}}if(!i)throw new l("Unable to normalize signature.");return s}function W(t,e){const n=typeof t,r=e.type;switch(r){case"address":return T(t,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in e?Object.values(e.components).every((s,i)=>W(Object.values(t)[i],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(t)&&t.every(s=>W(s,{...e,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function kt(t,e,n){for(const r in t){const s=t[r],i=e[r];if(s.type==="tuple"&&i.type==="tuple"&&"components"in s&&"components"in i)return kt(s.components,i.components,n[r]);const o=[s.type,i.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?T(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?T(n[r],{strict:!1}):!1)return o}}function Gr(t,e={}){const{prepare:n=!0}=e,r=Array.isArray(t)||typeof t=="string"?dt(t):t;return{...r,...n?{hash:A(r)}:{}}}function et(t,e,n){const{args:r=[],prepare:s=!0}=n??{},i=H(e,{strict:!1}),o=t.filter(c=>i?c.type==="function"||c.type==="error"?hr(c)===m(e,0,4):c.type==="event"?A(c)===e:!1:"name"in c&&c.name===e);if(o.length===0)throw new gt({name:e});if(o.length===1)return{...o[0],...s?{hash:A(o[0])}:{}};let a;for(const c of o){if(!("inputs"in c))continue;if(!r||r.length===0){if(!c.inputs||c.inputs.length===0)return{...c,...s?{hash:A(c)}:{}};continue}if(!c.inputs||c.inputs.length===0||c.inputs.length!==r.length)continue;if(r.every((d,y)=>{const h="inputs"in c&&c.inputs[y];return h?W(d,h):!1})){if(a&&"inputs"in a&&a.inputs){const d=kt(c.inputs,a.inputs,r);if(d)throw new pr({abiItem:c,type:d[0]},{abiItem:a,type:d[1]})}a=c}}const u=(()=>{if(a)return a;const[c,...f]=o;return{...c,overloads:f}})();if(!u)throw new gt({name:e});return{...u,...s?{hash:A(u)}:{}}}function hr(...t){const e=(()=>{if(Array.isArray(t[0])){const[n,r]=t;return et(n,r)}return t[0]})();return m(A(e),0,4)}function yr(...t){const e=(()=>{if(Array.isArray(t[0])){const[r,s]=t;return et(r,s)}return t[0]})(),n=typeof e=="string"?e:V(e);return D(n)}function A(...t){const e=(()=>{if(Array.isArray(t[0])){const[n,r]=t;return et(n,r)}return t[0]})();return typeof e!="string"&&"hash"in e&&e.hash?e.hash:q(F(yr(e)))}class pr extends l{constructor(e,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${D(V(e.abiItem))}\`, and`,`\`${n.type}\` in \`${D(V(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class gt extends l{constructor({name:e,data:n,type:r="item"}){const s=e?` with name "${e}"`:n?` with data "${n}"`:"";super(`ABI ${r}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function mr(t,e={}){return typeof t.chainId=="string"?Ut(t):{...t,...e.signature}}function Ut(t){const{address:e,chainId:n,nonce:r}=t,s=ke(t);return{address:e,chainId:Number(n),nonce:BigInt(r),...s}}function Zr(t){return t.map(Ut)}function br(t){const{address:e,chainId:n,nonce:r,...s}=t;return{address:e,chainId:p(n),nonce:p(r),..._e(s)}}function Xr(t){return t.map(br)}async function gr(t,{address:e,blockHash:n,blockNumber:r,blockTag:s="latest",requireCanonical:i}){const o=re({blockHash:n,blockNumber:r,blockTag:s,requireCanonical:i}),a=await t.request({method:"eth_getCode",params:[e,o]},{dedupe:typeof r=="bigint"||n!==void 0});if(a!=="0x")return a}const Tt="0x6492649264926492649264926492649264926492649264926492649264926492";function wr(t){if(m(t,-32)!==Tt)throw new vr(t)}function xr(t){const{data:e,signature:n,to:r}=t;return b(cr(Nt("address, bytes, bytes"),[r,e,n]),Tt)}function Pr(t){try{return wr(t),!0}catch{return!1}}let vr=class extends l{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}};const Ir="0x8010801080108010801080108010801080108010801080108010801080108010",$r=Nt("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function _t(t){if(typeof t=="string"){if(m(t,-32)!==Ir)throw new Br(t)}else Z(t.authorization)}function Ar(t){_t(t);const e=ne(m(t,-64,-32)),n=m(t,-e-64,-64),r=m(t,0,-e-64),[s,i,o]=ar($r,n);return{authorization:mr({address:s.delegation,chainId:Number(s.chainId),nonce:s.nonce,yParity:s.yParity,r:s.r,s:s.s}),signature:r,...o&&o!=="0x"?{data:o,to:i}:{}}}function Er(t){try{return _t(t),!0}catch{return!1}}class Br extends l{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}async function Sr({address:t,authorization:e,signature:n}){return k(U(t),await se({authorization:e,signature:n}))}function zr({r:t,s:e,to:n="hex",v:r,yParity:s}){const i=(()=>{if(s===0||s===1)return s;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),o=`0x${new ge.Signature(ct(t),ct(e)).toCompactHex()}${i===0?"1b":"1c"}`;return n==="hex"?o:he(o)}async function Mt(t,e){const{abi:n,address:r,args:s,functionName:i,...o}=e,a=Y({abi:n,args:s,functionName:i});try{const{data:u}=await R(t,Et,"call")({...o,data:a,to:r});return ie({abi:n,args:s,functionName:i,data:u||"0x"})}catch(u){throw oe(u,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:i})}}async function Qr(t,e){var c,f,d,y;const{address:n,chain:r=t.chain,hash:s,erc6492VerifierAddress:i=e.universalSignatureVerifierAddress??((f=(c=r==null?void 0:r.contracts)==null?void 0:c.erc6492Verifier)==null?void 0:f.address),multicallAddress:o=e.multicallAddress??((y=(d=r==null?void 0:r.contracts)==null?void 0:d.multicall3)==null?void 0:y.address),mode:a="auto"}=e;if(r!=null&&r.verifyHash)return await r.verifyHash(t,e);const u=(()=>{const h=e.signature;return ye(h)?h:typeof h=="object"&&"r"in h&&"s"in h?zr(h):pe(h)})();try{if(a==="eoa")try{if(k(U(n),await at({hash:s,signature:u})))return!0}catch{}return Er(u)?await Cr(t,{...e,multicallAddress:o,signature:u}):await Or(t,{...e,verifierAddress:i,signature:u})}catch(h){if(a!=="eoa")try{if(k(U(n),await at({hash:s,signature:u})))return!0}catch{}if(h instanceof I)return!1;throw h}}async function Cr(t,e){var C;const{address:n,blockNumber:r,blockTag:s,hash:i,multicallAddress:o}=e,{authorization:a,data:u,signature:c,to:f}=Ar(e.signature);if(await gr(t,{address:n,blockNumber:r,blockTag:s})===ae(["0xef0100",a.address]))return await Rr(t,{address:n,blockNumber:r,blockTag:s,hash:i,signature:c});const y={address:a.address,chainId:Number(a.chainId),nonce:Number(a.nonce),r:ut(a.r,{size:32}),s:ut(a.s,{size:32}),yParity:a.yParity};if(!await Sr({address:n,authorization:y}))throw new I;const $=await R(t,Mt,"readContract")({...o?{address:o}:{code:ce},authorizationList:[y],abi:me,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...u?[{allowFailure:!0,target:f??n,callData:u}]:[],{allowFailure:!0,target:n,callData:Y({abi:Bt,functionName:"isValidSignature",args:[i,c]})}]]}),P=(C=$[$.length-1])==null?void 0:C.returnData;if(P!=null&&P.startsWith("0x1626ba7e"))return!0;throw new I}async function Or(t,e){const{address:n,factory:r,factoryData:s,hash:i,signature:o,verifierAddress:a,...u}=e,c=await(async()=>!r&&!s||Pr(o)?o:xr({data:s,signature:o,to:r}))(),f=a?{to:a,data:Y({abi:ft,functionName:"isValidSig",args:[n,i,c]}),...u}:{data:ue({abi:ft,args:[n,i,c],bytecode:fe}),...u},{data:d}=await R(t,Et,"call")(f).catch(y=>{throw y instanceof de?new I:y});if(be(d??"0x0"))return!0;throw new I}async function Rr(t,e){const{address:n,blockNumber:r,blockTag:s,hash:i,signature:o}=e;if((await R(t,Mt,"readContract")({address:n,abi:Bt,args:[i,o],blockNumber:r,blockTag:s,functionName:"isValidSignature"}).catch(u=>{throw u instanceof le?new I:u})).startsWith("0x1626ba7e"))return!0;throw new I}class I extends Error{}export{_e as A,G as B,v as C,ke as D,Zr as E,Me as F,Xr as G,Tr as H,Lt as I,qr as J,Fr as K,zt as L,gt as N,lt as a,cr as b,et as c,Vr as d,kr as e,Gr as f,gr as g,hr as h,xe as i,Hr as j,Mr as k,_r as l,Wr as m,Ur as n,q as o,dt as p,Oe as q,Mt as r,zr as s,Ct as t,T as u,Qr as v,Rt as w,Z as x,Te as y,Yr as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as v,i as f,b as a}from"./lit-element-B3y9oplH.js";import{n as w,r as d,o as q}from"./class-map-CxwNmq0D.js";import{w as ve,s as fe,a as ge,p as be,M as g,S as se,R as l,r as P,A as K,e as ce,c as le,C as m,b as Y,d as ye,f as S,E as ie,O as E,g as F,h as oe,i as T,j as H,T as xe,k as Ce,l as ke,m as Se}from"./core-
|
|
1
|
+
import{a as v,i as f,b as a}from"./lit-element-B3y9oplH.js";import{n as w,r as d,o as q}from"./class-map-CxwNmq0D.js";import{w as ve,s as fe,a as ge,p as be,M as g,S as se,R as l,r as P,A as K,e as ce,c as le,C as m,b as Y,d as ye,f as S,E as ie,O as E,g as F,h as oe,i as T,j as H,T as xe,k as Ce,l as ke,m as Se}from"./core-DFTtNj6Y.js";import{c as u,U as We}from"./index-CFJ4759x.js";import"./index-B0wrSWVL.js";import"./react-DehiWSvs.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./index-Das01MWO.js";import"./events-DQ172AOg.js";import"./index-gO1p5U4e.js";import"./index-DI-3MKLG.js";import"./index.es-CYrm9JiK.js";import"./index-nibyPLVP.js";import"./index-CJdot1dH.js";import"./index.es-D-Hj-yaE.js";import"./browser-ponyfill-I5CKtKME.js";import"./NetworkUtil-EoWQDMpU.js";import"./W3MFrameProviderSingleton-BJE-tnmd.js";import"./async-directive-BRxn_Py3.js";const p=be({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),Re={state:p,subscribe(r){return ge(p,()=>r(p))},subscribeKey(r,e){return fe(p,r,e)},showTooltip({message:r,triggerRect:e,variant:t}){p.open=!0,p.message=r,p.triggerRect=e,p.variant=t},hide(){p.open=!1,p.message="",p.triggerRect={width:0,height:0,top:0,left:0}}},O=ve(Re),de={isUnsupportedChainView(){return l.state.view==="UnsupportedChain"||l.state.view==="SwitchNetwork"&&l.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){g.shake();return}if(await se.isSIWXCloseDisabled()){g.shake();return}g.close()}},$e=v`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
border-radius: clamp(0px, var(--wui-border-radius-l), 44px);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as g,b as d,a as he}from"./lit-element-B3y9oplH.js";import{n as l,o as $,r as u}from"./class-map-CxwNmq0D.js";import{d as v,r as V,e as me,v as B,i as fe}from"./index-
|
|
1
|
+
import{i as g,b as d,a as he}from"./lit-element-B3y9oplH.js";import{n as l,o as $,r as u}from"./class-map-CxwNmq0D.js";import{d as v,r as V,e as me,v as B,i as fe}from"./index-DU7iVDBh.js";import{c as f,U as le}from"./index-C75VmoUV.js";import{M as k,Z as ce,R as c,k as we,A as H,C as w,q as U,L as be,E as K,O as A,o as M,S as E,z,T as ge,_ as ye}from"./W3MFrameProviderSingleton-BJE-tnmd.js";import{P as D}from"./index-DgIUvj1u.js";import"./index-DCJFwzag.js";import{H as oe}from"./HelpersUtil-BFgierZ-.js";import{C as F}from"./ConstantsUtil-Di3dRDAF.js";import"./index-CMiDANew.js";import"./index-BKB9eVo_.js";import"./index-CDzrsoju.js";import"./index-Dyb9tM0L.js";import{S as ve}from"./SwapController-XcLKHFDT.js";import"./index-9ZSFZyk5.js";import"./index-B0wrSWVL.js";import"./react-DehiWSvs.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./index-Das01MWO.js";import"./events-DQ172AOg.js";import"./index-gO1p5U4e.js";import"./index-DI-3MKLG.js";import"./index-nibyPLVP.js";import"./index-Bdk6ierZ.js";import"./index.es-D-Hj-yaE.js";import"./browser-ponyfill-I5CKtKME.js";import"./NetworkUtil-EoWQDMpU.js";import"./index-DO-41U6s.js";import"./index-BBLwTza9.js";import"./index-BpfebiBi.js";import"./index-CCQWBULG.js";import"./index-8ahFN9pV.js";import"./MathUtil-BGCe3rZ3.js";import"./index-BAGHoKjd.js";import"./index-B95j5ECm.js";const de={isUnsupportedChainView(){return c.state.view==="UnsupportedChain"||c.state.view==="SwitchNetwork"&&c.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){k.shake();return}if(await ce.isSIWXCloseDisabled()){k.shake();return}(c.state.view==="DataCapture"||c.state.view==="DataCaptureOtpConfirm")&&we.disconnect(),k.close()}},xe=v`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
border-radius: clamp(0px, ${({borderRadius:e})=>e[8]}, 44px);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as B}from"./transactionReceipt-
|
|
1
|
+
import{f as B}from"./transactionReceipt-DyOMk-YN.js";import{h as g,c as N}from"./prepare-contract-call-BnXbUbQT.js";import{s as A}from"./sleep-mAKpSMLY.js";async function I(t){const e=await t({method:"eth_blockNumber"});return g(e)}async function E(t,e){const n=await t({method:"eth_getTransactionReceipt",params:[e.hash]});if(!n)throw new Error("Transaction receipt not found.");return B(n)}const x=5e3,y=1e3,k=500,D=2,T=10;function M(t){for(;t.length<T;)t.unshift(y);return t.reduce((n,i)=>n+i,0)/t.length}function R(t,e,n,i){let l=[],c=[],a=!1,o,r;const b=N({chain:e,client:t});async function p(){if(!a)return;try{const s=await I(b);if(!o||s>o){let m=[];if(o)for(let f=o+1n;f<=s;f++)m.push(BigInt(f));else m=[s];o=s;const w=Date.now();if(r){const f=(w-r)/m.length;c.push(f),c=c.slice(-T)}r=w;for(const f of m)for(const L of l)L(f)}}catch(s){i?i(s):console.error(`[watchBlockNumber]: Failed to poll for latest block number: ${s}`)}const h=M(c),u=Math.max(k,Math.min(x,Math.max(k,h)));await A(u/(n??D)),p()}return function(u,s){return l.push(u),a||(o=s,a=!0,p()),function(){l=l.filter(w=>w!==u),l.length===0&&(o=void 0,r=void 0,a=!1)}}}const _=new Map;function O(t){const{client:e,chain:n,onNewBlockNumber:i,overPollRatio:l,latestBlockNumber:c,onError:a}=t,o=n.id;let r=_.get(o);return r||(r=R(e,n,l,a),_.set(o,r)),r(i,c)}const P=100,d=new Map;function S(t){const{transactionHash:e,chain:n,client:i}=t,c=`${n.id}:tx_${e}`,a=t.maxBlocksWaitTime??P;if(d.has(c))return d.get(c);const o=new Promise((r,b)=>{e||b(new Error("Transaction has no transactionHash to wait for, did you execute it?"));const p=N({chain:n,client:i});let h=-1;const u=O({chain:n,client:i,onNewBlockNumber:async()=>{if(h++,h>=a){u(),b(new Error(`Transaction receipt for ${e} not found after ${a} blocks`));return}try{const s=await E(p,{hash:e});u(),r(s)}catch{}}})}).finally(()=>{d.delete(c)});return d.set(c,o),o}export{I as a,O as b,E as e,S as w};
|