@dcl/shop 1.13.1-35227702430.commit-7f36a79 → 1.13.1-35585926635.commit-02c8d2e
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-CHNYJKpW.js → Activity-DoatD7MW.js} +4 -4
- package/_assets/{AnimatedBackground-CDDW5yOE.js → AnimatedBackground-dVEk0PGp.js} +6 -6
- package/_assets/Assets-CN1LU5Xt.js +980 -0
- package/_assets/Cart-Bwf6I0xV.js +748 -0
- package/_assets/{Collection-0mDLFGqi.js → Collection-CPZhq7CU.js} +5 -5
- package/_assets/CollectionCarousel-CrMGuIJ3.js +322 -0
- package/_assets/Confetti-Bd901H1c.js +18 -0
- package/_assets/{ConstantsUtil-yxsFW7Qn.js → ConstantsUtil-Bk0e9ERj.js} +2 -2
- package/_assets/{ContentClient-BkbChoni.js → ContentClient-CWtagBtE.js} +2 -2
- package/_assets/{Creator-CX-NPM3l.js → Creator-pBuqm0Cj.js} +2 -2
- package/_assets/CreditPackPicker-COb2KClL.js +564 -0
- package/_assets/{DeploymentBuilder-CVNQmpLh.js → DeploymentBuilder-Dg-EXfAY.js} +3 -3
- package/_assets/{EmotePlaybackBar-B0eDc_Xz.js → EmotePlaybackBar-DyYs6qdM.js} +5 -5
- package/_assets/{ErrorNotice-aYlVfBxT.js → ErrorNotice-Cm0KaFyV.js} +2 -2
- package/_assets/Event-C9d1J0Kb.js +72 -0
- package/_assets/{ExchangeController-CBVAZKeX.js → ExchangeController-BzBrR3ZT.js} +2 -2
- package/_assets/{Faq-DyFyFEfN.js → Faq-D2noxWN_.js} +2 -2
- package/_assets/{Filters-DXBU1kNJ.js → Filters-Dw8HD8Ma.js} +2 -2
- package/_assets/{GetCredits-nIVyH51y.js → GetCredits-BmFWdIGx.js} +70 -70
- package/_assets/{Grow-B392ksj_.js → Grow-BiGjBqEo.js} +2 -2
- package/_assets/{HelpersUtil-DGFcsVXD.js → HelpersUtil-DQga4Ywl.js} +4 -4
- package/_assets/ItemDetail-BSwm3WSx.js +3779 -0
- package/_assets/{LoadMore-B_oODLp1.js → LoadMore-i7_riiE5.js} +2 -2
- package/_assets/{ManaPricingBanner.styles-NLm-zu5S.js → ManaPricingBanner.styles-Dyx_YmBW.js} +2 -2
- package/_assets/{MyAssets-BbctXf9T.js → MyAssets-Bs1a3OD9.js} +2 -2
- package/_assets/{MyFavorites-CDyauJmh.js → MyFavorites-C03JcdtN.js} +3 -3
- package/_assets/{MyStore-DorOcI1q.js → MyStore-ryCuwvDl.js} +2 -2
- package/_assets/{NetworkUtil-xj9XdA6U.js → NetworkUtil-BbMBxyRo.js} +2 -2
- package/_assets/{NotFound-Ds8v76Ff.js → NotFound-DOO8Ql2w.js} +2 -2
- package/_assets/{NotificationsBell-D3XWdEXZ.js → NotificationsBell-VR9lnc9P.js} +13 -13
- package/_assets/{OutfitDetail-DNYnAFNy.js → OutfitDetail-Co1A4WCO.js} +2 -2
- package/_assets/OutfitPreview-Ceha9IWa.js +7 -0
- package/_assets/{OutfitStudio-HDNrNgQb.js → OutfitStudio-DGibRraW.js} +2 -2
- package/_assets/{PhArrowCircleDown-oZRgIV6I.js → PhArrowCircleDown-BgP2jbf5.js} +3 -3
- package/_assets/{PhArrowClockwise-D6H6uB8s.js → PhArrowClockwise-CuNU0iSl.js} +2 -2
- package/_assets/{PhArrowDown-CRBvhObC.js → PhArrowDown-BrLks3Uz.js} +4 -4
- package/_assets/{PhArrowLeft-iC7ALVz_.js → PhArrowLeft-BbZGSN_s.js} +5 -5
- package/_assets/{PhArrowRight-BMhSphsR.js → PhArrowRight-DqLi6_uj.js} +4 -4
- package/_assets/{PhArrowSquareOut-BGOFtcYV.js → PhArrowSquareOut-CX0ZRgNC.js} +4 -4
- package/_assets/{PhArrowUp-DaOakyLF.js → PhArrowUp-D9ugstgK.js} +3 -3
- package/_assets/{PhArrowUpRight-Dv-X4w2R.js → PhArrowUpRight-Bpfn12eW.js} +4 -4
- package/_assets/{PhArrowsClockwise-DnI7mFlV.js → PhArrowsClockwise-CRZyQVpN.js} +4 -4
- package/_assets/{PhArrowsDownUp-BT1rp80C.js → PhArrowsDownUp-CV1NqVLb.js} +4 -4
- package/_assets/{PhArrowsLeftRight-3JEyJt0N.js → PhArrowsLeftRight-DvGI6Nto.js} +5 -5
- package/_assets/{PhBank-DlTySila.js → PhBank-BRxdKSKq.js} +5 -5
- package/_assets/{PhBrowser-CxUZLRbi.js → PhBrowser-C_wNKcTe.js} +5 -5
- package/_assets/PhCaretDown-DBNFm85V.js +15 -0
- package/_assets/{PhCaretLeft-ScH02zvv.js → PhCaretLeft-Cad__LUx.js} +3 -3
- package/_assets/{PhCaretRight-CG-ZCjvT.js → PhCaretRight-CuRYBcM2.js} +3 -3
- package/_assets/PhCaretUp-DE2FiuTS.js +15 -0
- package/_assets/{PhCheck-DETGkRRi.js → PhCheck-y4MOxgof.js} +5 -5
- package/_assets/{PhCircleHalf-BN36Nweh.js → PhCircleHalf-xlPKmtS7.js} +4 -4
- package/_assets/{PhClock-DPd3K2DL.js → PhClock-BBNMhMKw.js} +4 -4
- package/_assets/{PhCompass-F0g-SfuH.js → PhCompass-DpAl_LfZ.js} +5 -5
- package/_assets/{PhCopy-CzpD7rrG.js → PhCopy-D4HwCqa2.js} +5 -5
- package/_assets/{PhCreditCard-NnI7YcNP.js → PhCreditCard-CD12JEEL.js} +3 -3
- package/_assets/{PhCurrencyDollar-Bst29vzW.js → PhCurrencyDollar-DPFX6nyR.js} +2 -2
- package/_assets/{PhDesktop-CFSSNEkS.js → PhDesktop-CNhh70Hf.js} +3 -3
- package/_assets/{PhDeviceMobile-Dd2ijltg.js → PhDeviceMobile-DQgHhtB0.js} +5 -5
- package/_assets/{PhDotsThree-CI5y9TIg.js → PhDotsThree-B1gOaArE.js} +4 -4
- package/_assets/{PhEnvelope-DrQ5vbHf.js → PhEnvelope-CGnM9AiA.js} +4 -4
- package/_assets/{PhFunnelSimple-CI4FOzkp.js → PhFunnelSimple-D8YZwX53.js} +4 -4
- package/_assets/{PhGlobe-DR2SpSWA.js → PhGlobe-CXtg_GcB.js} +4 -4
- package/_assets/{PhIdentificationCard-5YfSRHO7.js → PhIdentificationCard-oMtubY4C.js} +3 -3
- package/_assets/{PhImage-D7dVXxCI.js → PhImage-DKp6-EHn.js} +2 -2
- package/_assets/{PhInfo-DNTh1xhU.js → PhInfo-CPd-HNhu.js} +5 -5
- package/_assets/{PhLightbulb-BfCndXXI.js → PhLightbulb-C47afrxR.js} +5 -5
- package/_assets/{PhMagnifyingGlass-DB41rFTM.js → PhMagnifyingGlass-DBaqb5ff.js} +2 -2
- package/_assets/{PhPaperPlaneRight-D6oxeO8G.js → PhPaperPlaneRight-FQGhQUrW.js} +4 -4
- package/_assets/{PhPlus-B90Q_jSC.js → PhPlus-B_CxFvZS.js} +4 -4
- package/_assets/{PhPower-B3OeVFPP.js → PhPower-DRTSLLeY.js} +4 -4
- package/_assets/{PhPuzzlePiece-DMvneE8o.js → PhPuzzlePiece-zlHiPdqx.js} +4 -4
- package/_assets/{PhQrCode-B1ogONq9.js → PhQrCode-riEgpq80.js} +4 -4
- package/_assets/{PhQuestion-BGPtjzO3.js → PhQuestion-DHYK7o0G.js} +3 -3
- package/_assets/{PhQuestionMark-Bx5KlE6e.js → PhQuestionMark-ZgOsaVvK.js} +4 -4
- package/_assets/{PhSealCheck-kDiKrn8v.js → PhSealCheck-B5VE_9Jt.js} +3 -3
- package/_assets/{PhSignOut-C40w8abk.js → PhSignOut-DKQOfDHS.js} +4 -4
- package/_assets/{PhSpinner-BnCR7oBU.js → PhSpinner-B3k7aAJt.js} +4 -4
- package/_assets/{PhTrash-Dx6EnoNj.js → PhTrash-CD2fhMLB.js} +3 -3
- package/_assets/{PhUser-BMrVwUFx.js → PhUser-BeKUoVY6.js} +2 -2
- package/_assets/{PhVault-CJhJgRMl.js → PhVault-DC9QjU0-.js} +5 -5
- package/_assets/{PhWallet-DUAwnObx.js → PhWallet-djswo-CG.js} +3 -3
- package/_assets/{PhWarning-DQNslokT.js → PhWarning-B4g8NvcF.js} +4 -4
- package/_assets/{PhWarningCircle-p1EFi5p4.js → PhWarningCircle-xLZ7sbu0.js} +5 -5
- package/_assets/{PhX-cY2Ff_Gl.js → PhX-BVzMqBjL.js} +5 -5
- package/_assets/{SaleCountdown-cQM4C16V.js → SaleCountdown-NdYuBnTu.js} +2 -2
- package/_assets/{Spinner-L6nFyl-2.js → Spinner-B5rI43ql.js} +2 -2
- package/_assets/{StoreSettings-DumRGIpw.js → StoreSettings-C2dwtV13.js} +2 -2
- package/_assets/{Success-kXDhdODF.js → Success-B6gpri2D.js} +2 -2
- package/_assets/{SwapController-2wOUxm-O.js → SwapController-Di8HGSG3.js} +2 -2
- package/_assets/{Tooltip-C2bcEiWV.js → Tooltip-Bj-rfWuS.js} +2 -2
- package/_assets/{TradeService-CJAyWLOz.js → TradeService-D2dJeuos.js} +2 -2
- package/_assets/{W3MFrameProviderSingleton-CTS4_jWN.js → W3MFrameProviderSingleton-DwbyBYX9.js} +4 -4
- package/_assets/{WebCryptoP256-BBF_1GY3.js → WebCryptoP256-CZzgSMZW.js} +2 -2
- package/_assets/{add-WhTS4Lmx.js → add-C46RTTNX.js} +3 -3
- package/_assets/{all-wallets-BjG4VftA.js → all-wallets-byTNDEq1.js} +2 -2
- package/_assets/{app-store-BU7T42Cx.js → app-store-CaKIhI-8.js} +2 -2
- package/_assets/{apple-CawmhmSa.js → apple-DAMB_3Lk.js} +3 -3
- package/_assets/{arrow-bottom-CnNmrvB7.js → arrow-bottom-Cx66u8_t.js} +2 -2
- package/_assets/{arrow-bottom-circle-4Fk8ZSin.js → arrow-bottom-circle-Bv2eZVEF.js} +2 -2
- package/_assets/{arrow-left-CfMYQlcz.js → arrow-left-D0I0JXz4.js} +3 -3
- package/_assets/arrow-right-BHc70exa.js +9 -0
- package/_assets/{arrow-top-B19eH9mc.js → arrow-top-uM_hNW8Z.js} +3 -3
- package/_assets/{async-directive-BTrBVINo.js → async-directive-CeCQAQEH.js} +4 -4
- package/_assets/{bank-CvCwnNxT.js → bank-CQUOEuRq.js} +2 -2
- package/_assets/{basic-Dy20qb1a.js → basic-C0ccxPdk.js} +2 -2
- package/_assets/{biconomy-BnEG5Zy-.js → biconomy-DGsEEV8A.js} +2 -2
- package/_assets/{browseLayout.styles-CfCn9o-L.js → browseLayout.styles-Dg021Y7v.js} +2 -2
- package/_assets/{browser-D_6XKzYg.js → browser-Bh67F6hL.js} +3 -3
- package/_assets/{browser-CRh8u5ch.js → browser-D3mkrR6N.js} +2 -2
- package/_assets/{browser-Cdq7DNqX.js → browser-DfAY1k2K.js} +2 -2
- package/_assets/{browser-ponyfill-BKmwPYRv.js → browser-ponyfill-C5RB02M7.js} +2 -2
- package/_assets/buy-Da1E8jgj.js +2 -0
- package/_assets/{buy-gasless-CxdA3e9m.js → buy-gasless-CaUM9sxG.js} +2 -2
- package/_assets/{card-Bs7vF3ws.js → card-DcQ1wkCr.js} +2 -2
- package/_assets/cart-checkout-uu8usx3x.js +2 -0
- package/_assets/{categories-DFosgubm.js → categories-DeCaTWZU.js} +2 -2
- package/_assets/{ccip-kZ3R7VLn.js → ccip-CIKPg0_h.js} +2 -2
- package/_assets/{ccip-CFqr1zAP.js → ccip-CIPTk6YK.js} +2 -2
- package/_assets/{chains-DeJWzaQr.js → chains-CWGwszpJ.js} +2 -2
- package/_assets/{checkmark-e3BzxNSm.js → checkmark-GDL9YfL4.js} +2 -2
- package/_assets/{checkmark-bold-CwL3zpGi.js → checkmark-bold-B-Sg0XJy.js} +3 -3
- package/_assets/chevron-bottom-CLuKI9LQ.js +9 -0
- package/_assets/chevron-left-B_RU4s1F.js +9 -0
- package/_assets/chevron-right-C6ckznAo.js +9 -0
- package/_assets/chevron-top-CJOmtrv2.js +9 -0
- package/_assets/{chrome-store-B9E5S_r1.js → chrome-store-s39Q_LJM.js} +3 -3
- package/_assets/{class-map-BaReYv7k.js → class-map-BxMzgOIb.js} +5 -5
- package/_assets/{clock-98t-BkG5.js → clock-DmJj-grN.js} +2 -2
- package/_assets/close-D4d1U5NV.js +9 -0
- package/_assets/{coinPlaceholder-rH-MsidA.js → coinPlaceholder-VDdmV3rm.js} +2 -2
- package/_assets/collectionPage.styles-DOzyhn9M.js +41 -0
- package/_assets/common-DamPx7zD.js +2 -0
- package/_assets/{compass-C4iPyfoB.js → compass-O2jaVbub.js} +3 -3
- package/_assets/{controller-k48YB2Sn.js → controller-J7h5zgkf.js} +3 -3
- package/_assets/{copy-Db_EXK-k.js → copy-D2eE3KCY.js} +3 -3
- package/_assets/{core-CKZ_MmrP.js → core-BILweyMC.js} +5 -5
- package/_assets/{createSvgIcon-B4YJe4s8.js → createSvgIcon-BOJMqAuj.js} +4 -4
- package/_assets/{crumbs.styles-C5msDC2H.js → crumbs.styles-6TXvIB5e.js} +2 -2
- package/_assets/{cursor-BLyA32Y6.js → cursor-DSrN7SuI.js} +3 -3
- package/_assets/{cursor-transparent-is8_6H5o.js → cursor-transparent-DxuBEx9O.js} +2 -2
- package/_assets/{custom-BXWLdbja.js → custom-CtbaVsvz.js} +2 -2
- package/_assets/{data-capture-uHnihewB.js → data-capture-D_Yc-lFk.js} +2 -2
- package/_assets/{dcl-schemas-B-U9a1k0.js → dcl-schemas-Do6ePE9M.js} +2 -2
- package/_assets/decimals-CPcEXrkP.js +2 -0
- package/_assets/decimals-fY1-YeOV.js +2 -0
- package/_assets/{desktop-w7YXG_JM.js → desktop-DwZtv9fm.js} +2 -2
- package/_assets/detectExtension-BzGhSQVN.js +2 -0
- package/_assets/{disconnect-BoVeWInH.js → disconnect-BbwiqFJ2.js} +3 -3
- package/_assets/{discord-CmXuPXeB.js → discord-qWAUKbRO.js} +3 -3
- package/_assets/{disposePreview-VJjydgsa.js → disposePreview-BhRqNFqz.js} +2 -2
- package/_assets/{email-KFGlGhOy.js → email-CDJff6Le.js} +7 -7
- package/_assets/{embedded-wallet-C0hnCLpE.js → embedded-wallet-OlJuY5Lb.js} +2 -2
- package/_assets/{emotion-styled.browser.esm-CvLTks_d.js → emotion-styled.browser.esm-dqXx08M6.js} +2 -2
- package/_assets/{engine-BRjaV2JM.js → engine-Cqgf8_-e.js} +2 -2
- package/_assets/{errors-7T5zBx70.js → errors-COVZQXFS.js} +2 -2
- package/_assets/estimate-l1-fee-cwAe5Vqz.js +2 -0
- package/_assets/eth_estimateGas-Bi2jA3d6.js +2 -0
- package/_assets/eth_getStorageAt-Drv0-oaq.js +2 -0
- package/_assets/eth_getTransactionCount-u8vibbIm.js +2 -0
- package/_assets/ethereum-Mtg8xwT8.js +2 -0
- package/_assets/{ethers-DSJYCqoj.js → ethers-DVrorjJ1.js} +2 -2
- package/_assets/{etherscan-C6oDVSRT.js → etherscan-TUQ32gbU.js} +2 -2
- package/_assets/{events-BjA1SxTa.js → events-CcYNTdVN.js} +2 -2
- package/_assets/{exclamation-triangle-DeoEkpAd.js → exclamation-triangle-ETkxexlo.js} +2 -2
- package/_assets/{execute-BplnQIQO.js → execute-CoAxXj0W.js} +3 -3
- package/_assets/{extension-BC4u9PFt.js → extension-DoOVmXmT.js} +3 -3
- package/_assets/external-link-BEPN-Y2j.js +9 -0
- package/_assets/{extractIPFS-BYNmHd2k.js → extractIPFS-DlbP2Osb.js} +2 -2
- package/_assets/{facebook-BfvFcXpk.js → facebook-BmPLPVaB.js} +3 -3
- package/_assets/{farcaster-DBSK9Oxt.js → farcaster-BLIAglQl.js} +2 -2
- package/_assets/{features-Cdv7L-RV.js → features-DNE6dOZ4.js} +2 -2
- package/_assets/{fetchTokenMetadata-DhtaTk-H.js → fetchTokenMetadata-CiNffAhl.js} +3 -3
- package/_assets/{field.styles-6T_AbtbU.js → field.styles-Dsz8I5YB.js} +2 -2
- package/_assets/{filters-Bx7yqePJ.js → filters-DWaFeZ95.js} +3 -3
- package/_assets/{fortmatic-DXNz83vb.js → fortmatic-B2QacKOL.js} +2 -2
- package/_assets/{get-bytecode-CFhNP8WB.js → get-bytecode-DCxZ_TJS.js} +2 -2
- package/_assets/get-ecosystem-wallet-info-Dpf1xtjk.js +2 -0
- package/_assets/{getBalance-LoJ5orGb.js → getBalance-DacQHsEf.js} +3 -3
- package/_assets/{getInstalledModules-Dg137aWw.js → getInstalledModules-_KOhu2kj.js} +2 -2
- package/_assets/getNFT-DLLMJ-N8.js +2 -0
- package/_assets/{getNFT-CpYYuTRe.js → getNFT-TgQU4sPn.js} +3 -3
- package/_assets/{github-Bir9JlcK.js → github-BiA5cQMJ.js} +3 -3
- package/_assets/{google-BlkSyDA4.js → google-CsF9xgle.js} +3 -3
- package/_assets/{grid.styles-DDLEbnSw.js → grid.styles-zbj0YrVx.js} +2 -2
- package/_assets/{hashTypedData-Bt7HN3si.js → hashTypedData-C4V4k80v.js} +2 -2
- package/_assets/{hashTypedData-DgB1HOfC.js → hashTypedData-CxzAx589.js} +2 -2
- package/_assets/{help-circle-DA-n1pkO.js → help-circle-Bwgxn3Vn.js} +3 -3
- package/_assets/{id-UrGKP3rm.js → id-O5raZ1NS.js} +2 -2
- package/_assets/{image-D3PTNca-.js → image-CbhOQpP5.js} +2 -2
- package/_assets/{import-B6kpcRFm.js → import-p1kr6qLz.js} +2 -2
- package/_assets/{in-app-Dg3YlbFQ.js → in-app-niBzraeI.js} +2 -2
- package/_assets/{in-app-wallet-calls-D5geh72I.js → in-app-wallet-calls-Dyorin4y.js} +2 -2
- package/_assets/{index-CDLnPH_R.js → index-B1-eV0Yy.js} +2 -2
- package/_assets/{index-CESlHrvT.js → index-B1DNuJsS.js} +2 -2
- package/_assets/{index-LzjiU4KK.js → index-B39be1Q8.js} +4 -4
- package/_assets/{index-CY1CneD5.js → index-B6iPDUS8.js} +2 -2
- package/_assets/{index-D9YHcXvR.js → index-BC9VPSaU.js} +4 -4
- package/_assets/{index-BMRZuivV.js → index-BEbVm5wA.js} +4 -4
- package/_assets/{index-DC99FOt3.js → index-BW2_mJUZ.js} +3 -3
- package/_assets/{index-BaSG_NUp.js → index-BaeSw32D.js} +3 -3
- package/_assets/{index-wMS45T6v.js → index-BdTU9iVQ.js} +4 -4
- package/_assets/{index-CUCItwHM.js → index-BdhRH7ae.js} +4 -4
- package/_assets/{index-Df82pzI7.js → index-BgrkbkKX.js} +3 -3
- package/_assets/{index-DqOzMcNF.js → index-BhPBG2XL.js} +2 -2
- package/_assets/{index-DPbzKM5D.css → index-BhSgZf6d.css} +1 -1
- package/_assets/{index-B3abSZ-Z.js → index-Bpbs2w1c.js} +2 -2
- package/_assets/{index-CZnmZn0O.js → index-BrTe5eTC.js} +7 -7
- package/_assets/{index-D9YcmLMJ.js → index-BzKWq7pb.js} +2 -2
- package/_assets/{index-BAXoG69v.js → index-C-cdcYSu.js} +5 -5
- package/_assets/{index-Cdhs4ZSZ.js → index-C9RSadCu.js} +2 -2
- package/_assets/{index-C8xt-Dq0.js → index-CD44EXbq.js} +2 -2
- package/_assets/{index-RelB0M4N.js → index-CEVRFChv.js} +2 -2
- package/_assets/{index-B4ztxoOX.js → index-CEbyUU5H.js} +2 -2
- package/_assets/index-CKb-Chs7.js +2 -0
- package/_assets/{index-CA8tyOAF.js → index-CRlpbq5e.js} +2 -2
- package/_assets/{index-CF8QOK2h.js → index-CWE_Bdvd.js} +7 -7
- package/_assets/{index-Q5TwwtLn.js → index-CWJFyp1v.js} +2 -2
- package/_assets/{index-z74SKtAP.js → index-CWc56QrX.js} +2 -2
- package/_assets/{index-CkMr9c7F.js → index-CZEd2SGy.js} +3 -3
- package/_assets/{index-A3upiasd.js → index-CZmSHbVE.js} +3 -3
- package/_assets/{index-nA74BJD3.js → index-CcTOkZrG.js} +2 -2
- package/_assets/{index-U3U2nzy5.js → index-Ccey0v_W.js} +4 -4
- package/_assets/{index-D8-2D48n.js → index-CfGsvFRR.js} +4 -4
- package/_assets/{index-Dmc5rFnV.js → index-ChhJ84F9.js} +2 -2
- package/_assets/{index-BVH6E6OD.js → index-Cn-ULh1k.js} +2 -2
- package/_assets/{index-BYzs0el7.js → index-CpfmSBK0.js} +2 -2
- package/_assets/{index-Dkzg1nZE.js → index-Cq-Etsdf.js} +2 -2
- package/_assets/{index-jUx-Pp_A.js → index-Csp5LciJ.js} +6 -6
- package/_assets/{index-Cs3-E5cT.js → index-CwA52DzI.js} +2 -2
- package/_assets/{index-BjKr7EJa.js → index-CwoMLrsB.js} +3 -3
- package/_assets/{index-DxULOM0p.js → index-CxNh07aM.js} +3 -3
- package/_assets/{index-SqJBKUwJ.js → index-CxOzFLm7.js} +2 -2
- package/_assets/{index-Bc9bdmof.js → index-D05bb_h6.js} +2 -2
- package/_assets/{index-D6jqchs0.js → index-D8M-5R_3.js} +2 -2
- package/_assets/{index-CFtn0XDp.js → index-D8olnnil.js} +2 -2
- package/_assets/index-DDb_ETfE.js +2 -0
- package/_assets/{index-D9TJEt55.js → index-DLcPHJzx.js} +4 -4
- package/_assets/{index-BFiGQV0S.js → index-DUaZ1t6t.js} +2 -2
- package/_assets/{index-DxqlsaIJ.js → index-DXmPq_Kc.js} +2 -2
- package/_assets/{index-l3KtsjUu.js → index-D_SCQhiC.js} +2 -2
- package/_assets/{index-XK9EepTf.js → index-Ddqdlsoi.js} +2 -2
- package/_assets/{index-D2GK2huD.js → index-DeaVX3Ga.js} +3 -3
- package/_assets/{index-BQvjbaBw.js → index-DjQWTjO5.js} +2 -2
- package/_assets/{index-CiXHnYhZ.js → index-DpJ4zJ7r.js} +3 -3
- package/_assets/{index-CkyVxKTR.js → index-Dpu-M2gs.js} +2 -2
- package/_assets/{index-BPVjQIY8.js → index-DrGWXFkr.js} +3 -3
- package/_assets/{index-weSxFZGO.js → index-Dyy6WQp0.js} +5 -5
- package/_assets/{index-CRYukxlf.js → index-DzWgqsYH.js} +2 -2
- package/_assets/{index-I1p6yQ0k.js → index-I_W87dfE.js} +4 -4
- package/_assets/{index-txYiH5Ob.js → index-MqPRfHS_.js} +4 -4
- package/_assets/{index-CSQsSI9S.js → index-PmcUrVFZ.js} +2 -2
- package/_assets/{index-BdLDRc-I.js → index-U6lik-J8.js} +2 -2
- package/_assets/{index-BALC2Wgg.js → index-WiX7N7NB.js} +2 -2
- package/_assets/{index-IVhnoiOa.js → index-_AZXosO6.js} +2 -2
- package/_assets/{index-CaofpCDX.js → index-gg05iP5j.js} +4 -4
- package/_assets/{index-DYNz2qcD.js → index-iRDDuzQN.js} +3 -3
- package/_assets/{index-DuUTwu_9.js → index-pibLOLKX.js} +2 -2
- package/_assets/{index-4qAYVf42.js → index-rsyTCpy-.js} +6 -6
- package/_assets/{index-C7ZsJ1wS.js → index-sTnDYGsF.js} +4 -4
- package/_assets/{index-KErMJCvL.js → index-y9tZLe7Z.js} +18 -18
- package/_assets/{index.es-DECbrw_U.js → index.es-BZZFX7UO.js} +2 -2
- package/_assets/{index.es-axr79-mu.js → index.es-CPftFMVM.js} +2 -2
- package/_assets/{index.es-DaYBb4qv.js → index.es-CWkiohwA.js} +2 -2
- package/_assets/{index.es-Bcu1bp5V.js → index.es-p9GOzpcM.js} +5 -5
- package/_assets/{info-Dsmi8VWW.js → info-B91xCNqh.js} +3 -3
- package/_assets/info-circle-DtEY-DDD.js +13 -0
- package/_assets/{items-empty-BQHUprjO.js → items-empty-D3SdcrUb.js} +2 -2
- package/_assets/jsxRuntime.module-BUzu5v1_.js +2 -0
- package/_assets/{jump-CqDVhlE9.js → jump-BLEV_WoY.js} +2 -2
- package/_assets/{lightbulb-B2s8QgKQ.js → lightbulb-ByedgZqO.js} +3 -3
- package/_assets/{linkAccount-DxdV9HS8.js → linkAccount-DAFP48le.js} +2 -2
- package/_assets/{localBatchGatewayRequest-dCTRrlIJ.js → localBatchGatewayRequest-dB8Wq4kD.js} +2 -2
- package/_assets/{mail-CZ9ghbH-.js → mail-B2wBPliw.js} +2 -2
- package/_assets/{mobile-D7KL87qI.js → mobile-COGIkuHo.js} +2 -2
- package/_assets/{modal.styles-DVzEuE4i.js → modal.styles-C5SxmNLg.js} +2 -2
- package/_assets/{more-C1vsI2Vu.js → more-zcriamqw.js} +2 -2
- package/_assets/{native-Bma50gO8.js → native-CBQhq49N.js} +2 -2
- package/_assets/{network-placeholder-C6sglFRh.js → network-placeholder-Cm-6akxX.js} +2 -2
- package/_assets/{networks-p14N8Rze.js → networks-8H1PRpMW.js} +2 -2
- package/_assets/{nftPlaceholder-ByX0V9oA.js → nftPlaceholder-vZdYCYRL.js} +2 -2
- package/_assets/off-CLF8R11w.js +9 -0
- package/_assets/{onramp-_W_skd45.js → onramp-J5H4ebWV.js} +2 -2
- package/_assets/openzeppelin-D4p4dWkw.js +2 -0
- package/_assets/ownerOf-6NPphff8.js +2 -0
- package/_assets/parseNft-CNeONFsP.js +3 -0
- package/_assets/{parseSignature-DPNUOnqO.js → parseSignature-CRChMV-U.js} +2 -2
- package/_assets/{parseSignature-K29ZIdYJ.js → parseSignature-RdZmR6vg.js} +4 -4
- package/_assets/{passkeys-Bxplb0vS.js → passkeys-asZ3JuTk.js} +2 -2
- package/_assets/{pay-with-exchange-6DWMo0rX.js → pay-with-exchange-Cv_5xsJB.js} +2 -2
- package/_assets/{play-store-BBusJ15a.js → play-store-CAbJYmXD.js} +2 -2
- package/_assets/{plus-QdPNUgRE.js → plus-DWQF9t2p.js} +3 -3
- package/_assets/{prepare-contract-call-Cj0eDfjm.js → prepare-contract-call-Bgba2npe.js} +2 -2
- package/_assets/{qr-code-SdYLFk2z.js → qr-code-Br4VphwV.js} +2 -2
- package/_assets/{qr-overlay-BjI4mudc.js → qr-overlay-DkizM6BP.js} +6 -6
- package/_assets/{react-DhG5dcPN.js → react-ZT2P9-hV.js} +2 -2
- package/_assets/{receive-CeFGmTcc.js → receive-CawQ-n3T.js} +9 -9
- package/_assets/{recycle-horizontal-SCXYOpJq.js → recycle-horizontal-DdAImjTL.js} +3 -3
- package/_assets/{ref-DRxYb1N1.js → ref-D90CCjlU.js} +2 -2
- package/_assets/{refresh-eticwJ3S.js → refresh-S-H2nzPq.js} +2 -2
- package/_assets/{reown-logo-C2dHPSrm.js → reown-logo-D5L2QY4i.js} +3 -3
- package/_assets/{resolveImplementation-774OZZ1E.js → resolveImplementation-BVnQ0KdI.js} +2 -2
- package/_assets/{resume-buy-BEdLbR_n.js → resume-buy-VqFhR9e8.js} +2 -2
- package/_assets/resume-name-CTz059A2.js +2 -0
- package/_assets/{rpc-DmcKeb2b.js → rpc-BJ7rd6au.js} +2 -2
- package/_assets/{sales-empty-D8qJCHeq.js → sales-empty-l9JLZ5D0.js} +2 -2
- package/_assets/{search-empty-DH4IcPd4.js → search-empty-CkXuQVln.js} +2 -2
- package/_assets/{search-CeQ1H1CU.js → search-f6j421fJ.js} +3 -3
- package/_assets/{secp256k1-DwMDsrWo.js → secp256k1-BGQ_Uqpo.js} +2 -2
- package/_assets/{secp256k1-1jHjSX_0.js → secp256k1-BaU6Nn5x.js} +2 -2
- package/_assets/{secp256k1-C5XurJ6V.js → secp256k1-Bu5sn1ZV.js} +2 -2
- package/_assets/{send-Bo03Ql2I.js → send-BAUrBF6z.js} +3 -3
- package/_assets/{send-Bpuo5hJ1.js → send-DONjIfwF.js} +2 -2
- package/_assets/send-batch-transaction-C_JYVBkw.js +2 -0
- package/_assets/{send-eip712-transaction-XSTFaz0B.js → send-eip712-transaction-Clelg5Q-.js} +3 -3
- package/_assets/send-gasless-transaction-DNc4O0S0.js +3 -0
- package/_assets/send-transaction-pFbo31gg.js +3 -0
- package/_assets/{sendMetaTransaction-DsMG8gV0.js → sendMetaTransaction-BcKatlZr.js} +2 -2
- package/_assets/{sendRawTransaction-BU2bb2hv.js → sendRawTransaction-BM57FQWh.js} +4 -4
- package/_assets/{sentry-C-ZN4hdJ.js → sentry-qVQnooqM.js} +3 -3
- package/_assets/{serializeTransaction-BAiVmvI3.js → serializeTransaction-FdLqYQ-w.js} +2 -2
- package/_assets/{session-proposal-C0VIGGjd.js → session-proposal-CAm5TVJB.js} +2 -2
- package/_assets/{session-request-Dw2Dj2ik.js → session-request-C8xtyN3L.js} +3 -3
- package/_assets/{sha256-DrAuxfaX.js → sha256-CcM85_-b.js} +2 -2
- package/_assets/{sha3-D7-SM6M6.js → sha3-FAYNGyBi.js} +2 -2
- package/_assets/signin-empty-UN_rVDWL.js +2 -0
- package/_assets/{signing-OF1etnMz.js → signing-FPVJ2eSa.js} +4 -4
- package/_assets/{skeleton.styles-BDOcFuFh.js → skeleton.styles-DTLcQB9A.js} +2 -2
- package/_assets/{socials-BN_G7rnm.js → socials-BHL-s99I.js} +2 -2
- package/_assets/{styled-B_VfpbCV.js → styled-BOKv7XKm.js} +3 -3
- package/_assets/{swapHorizontal-C6GakaRf.js → swapHorizontal-BXjIGAcZ.js} +2 -2
- package/_assets/{swapHorizontalBold-oeP-_O-R.js → swapHorizontalBold-BzueHopN.js} +2 -2
- package/_assets/{swapHorizontalMedium-C64EXSWD.js → swapHorizontalMedium-DLFo4hRx.js} +2 -2
- package/_assets/{swapHorizontalRoundedBold-CHgP6XK-.js → swapHorizontalRoundedBold-BddBy7OL.js} +2 -2
- package/_assets/{swapVertical-8SLU7RpO.js → swapVertical-DYkySTmy.js} +3 -3
- package/_assets/{swaps-CPevyB8C.js → swaps-DDuyuFV1.js} +2 -2
- package/_assets/{telegram-CF91ES6s.js → telegram-D8ymSABf.js} +2 -2
- package/_assets/{thirdweb-BbVCwUAu.js → thirdweb-N4oYmhTQ.js} +4 -4
- package/_assets/{three-dots-BsCoLPC9.js → three-dots-CiS9iH0H.js} +2 -2
- package/_assets/{to-serializable-transaction-lRDSqYXw.js → to-serializable-transaction-DZXV0RS9.js} +3 -3
- package/_assets/totalSupply-DnoXRYZk.js +2 -0
- package/_assets/{trade-encoding-J0WDcE9D.js → trade-encoding-JnGsRcov.js} +2 -2
- package/_assets/{transaction-XzNewIjy.js → transaction-D82LqpKn.js} +2 -2
- package/_assets/transactionReceipt-DEqK-l-5.js +2 -0
- package/_assets/transactions-1TYNoevC.js +17 -0
- package/_assets/{twitch-BranWKeM.js → twitch-BJQCmiGz.js} +2 -2
- package/_assets/{twitterIcon-BfIWT5DS.js → twitterIcon-B78o99Zv.js} +2 -2
- package/_assets/{useCreatorSales-Dpv72LCx.js → useCreatorSales-oruupPPN.js} +2 -2
- package/_assets/{useInfiniteGrid-C2bFEKpr.js → useInfiniteGrid-56c_34kP.js} +2 -2
- package/_assets/{useStore-BCxGyG1z.js → useStore-CGFjD1j7.js} +3 -3
- package/_assets/{useTheme-WQQFpB7n.js → useTheme-J18Pg7gw.js} +2 -2
- package/_assets/{utils-VSYSpTVV.js → utils-BE7z1_FY.js} +2 -2
- package/_assets/{verify-DcO5QuX7.js → verify-CrYE2kna.js} +3 -3
- package/_assets/{verify-filled-CKp8XQqI.js → verify-filled-CwwnY5h6.js} +3 -3
- package/_assets/{verifyHash-ghN9T3Ve.js → verifyHash-Buuby46g.js} +2 -2
- package/_assets/{w3m-modal-E9Z1SfqC.js → w3m-modal-BU-cBw0Z.js} +2 -2
- package/_assets/{w3m-modal-Ev1ebfj3.js → w3m-modal-DhWirtG8.js} +2 -2
- package/_assets/wait-for-tx-receipt-CG08f_bj.js +2 -0
- package/_assets/{wallet-BHCiGpYx.js → wallet-EosqBoq7.js} +3 -3
- package/_assets/{wallet-placeholder-BVguMNEt.js → wallet-placeholder-DL8kIY2O.js} +3 -3
- package/_assets/{walletconnect-9t1WJh4k.js → walletconnect-CauX9cVK.js} +4 -4
- package/_assets/{wallets-D8WdqQYN.js → wallets-CMB2i32E.js} +6 -6
- package/_assets/{warning-circle-II7Vcaxs.js → warning-circle-BrcBx24p.js} +3 -3
- package/_assets/{web-connector-DWmfoiFW.js → web-connector-BPh_N46m.js} +4 -4
- package/_assets/{writeContract-DfDwHewQ.js → writeContract-BcpztdZJ.js} +2 -2
- package/_assets/x-CwtQDczS.js +13 -0
- package/_assets/{zora-sepolia-B6qZJNOp.js → zora-sepolia-arxykf8i.js} +2 -2
- package/_assets/{zoraTestnet-B0U9riHP.js → zoraTestnet-DL2ClkoW.js} +2 -2
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Assets-CSRETZwJ.js +0 -939
- package/_assets/Cart-WtUxECX0.js +0 -748
- package/_assets/CollectionCarousel-aWbnRslF.js +0 -851
- package/_assets/Confetti-qSvOdilZ.js +0 -18
- package/_assets/Event-BG0dNUM_.js +0 -72
- package/_assets/ItemDetail-4K0xq5qa.js +0 -3779
- package/_assets/OutfitPreview-ZeTJyukp.js +0 -7
- package/_assets/PhCaretDown-Co8viBJv.js +0 -15
- package/_assets/PhCaretUp-SXVNZaJo.js +0 -15
- package/_assets/arrow-right-QKHuTr9a.js +0 -9
- package/_assets/buy-BZCpQvc4.js +0 -2
- package/_assets/chevron-bottom-DVpGPQvJ.js +0 -9
- package/_assets/chevron-left-CSISn9Tl.js +0 -9
- package/_assets/chevron-right-D0n7Onzs.js +0 -9
- package/_assets/chevron-top-BSRcfV5m.js +0 -9
- package/_assets/close-BnCucYZG.js +0 -9
- package/_assets/collectionPage.styles-DsCcUUFW.js +0 -41
- package/_assets/common-A3Bfnk62.js +0 -2
- package/_assets/decimals-C5B_cOCF.js +0 -2
- package/_assets/decimals-Du6yJMK-.js +0 -2
- package/_assets/detectExtension-C6w72a1b.js +0 -2
- package/_assets/estimate-l1-fee-BYl55n8M.js +0 -2
- package/_assets/eth_estimateGas-DLGqCGsG.js +0 -2
- package/_assets/eth_getStorageAt-BLy0F-NT.js +0 -2
- package/_assets/eth_getTransactionCount-CZ9P1SH4.js +0 -2
- package/_assets/ethereum-B3EozZME.js +0 -2
- package/_assets/external-link-D1_8iC7n.js +0 -9
- package/_assets/get-ecosystem-wallet-info-Cl9itAW0.js +0 -2
- package/_assets/getNFT-BEEmfYnn.js +0 -2
- package/_assets/index-Bymzh-gN.js +0 -2
- package/_assets/index-CYgnSTnA.js +0 -2
- package/_assets/info-circle-CppZa7vK.js +0 -13
- package/_assets/jsxRuntime.module-Q9HBaTr-.js +0 -2
- package/_assets/off-B5vm0egN.js +0 -9
- package/_assets/openzeppelin-TED9i7Yw.js +0 -2
- package/_assets/ownerOf-Bf98thEc.js +0 -2
- package/_assets/parseNft-BkGQncZj.js +0 -3
- package/_assets/send-batch-transaction-DYAjmvxh.js +0 -2
- package/_assets/send-gasless-transaction--CKQXCYJ.js +0 -3
- package/_assets/send-transaction-yz6MCfwK.js +0 -3
- package/_assets/signin-empty-BDPhINhk.js +0 -2
- package/_assets/totalSupply-C7xvhD2t.js +0 -2
- package/_assets/transactionReceipt-DzFEhFbW.js +0 -2
- package/_assets/transactions-DksFynEn.js +0 -17
- package/_assets/useCreditPacks-CplX_QCK.js +0 -2
- package/_assets/wait-for-tx-receipt-CSeTQKAi.js +0 -2
- package/_assets/x-D0s8LW19.js +0 -13
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{N as T,j as G,R as I,S as f,k as B,E as M,l as F,W as _,C as m,B as N,b as L,m as E,A as O,n as z,d as W,g as R,o as H,e as V,i as q,p as $}from"./W3MFrameProviderSingleton-CTS4_jWN.js";import{au as b}from"./NetworkUtil-xj9XdA6U.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new n.Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="d5bf39f8-0096-4633-a71d-e79393a73741",n._sentryDebugIdIdentifier="sentry-dbid-d5bf39f8-0096-4633-a71d-e79393a73741")}catch{}})();const C={getGasPriceInEther(n,o){const t=o*n;return Number(t)/1e18},getGasPriceInUSD(n,o,t){const s=C.getGasPriceInEther(o,t);return T.bigNumber(n).times(s).toNumber()},getPriceImpact({sourceTokenAmount:n,sourceTokenPriceInUSD:o,toTokenPriceInUSD:t,toTokenAmount:s}){const c=T.bigNumber(n).times(o),r=T.bigNumber(s).times(t);return c.minus(r).div(c).times(100).toNumber()},getMaxSlippage(n,o){const t=T.bigNumber(n).div(100);return T.multiply(o,t).toNumber()},getProviderFee(n,o=.0085){return T.bigNumber(n).times(o).toString()},isInsufficientNetworkTokenForGas(n,o){const t=o||"0";return T.bigNumber(n).eq(0)?!0:T.bigNumber(T.bigNumber(t)).gt(n)},isInsufficientSourceTokenForSwap(n,o,t){var r,d;const s=(d=(r=t==null?void 0:t.find(l=>l.address===o))==null?void 0:r.quantity)==null?void 0:d.numeric;return T.bigNumber(s||"0").lt(n)}},x=15e4,Q=6,g={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,switchingTokens:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:W.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},e=$({...g}),D={state:e,subscribe(n){return q(e,()=>n(e))},subscribeKey(n,o){return V(e,n,o)},getParams(){var i,u,p,w,y,h,A,S,P;const n=m.state.activeChain,o=((i=m.getAccountData(n))==null?void 0:i.caipAddress)??m.state.activeCaipAddress,t=L.getPlainAddress(o),s=R(),c=H.getConnectorId(m.state.activeChain);if(!t)throw new Error("No address found to swap the tokens from.");const r=!((u=e.toToken)!=null&&u.address)||!((p=e.toToken)!=null&&p.decimals),d=!((w=e.sourceToken)!=null&&w.address)||!((y=e.sourceToken)!=null&&y.decimals)||!T.bigNumber(e.sourceTokenAmount).gt(0),l=!e.sourceTokenAmount;return{networkAddress:s,fromAddress:t,fromCaipAddress:o,sourceTokenAddress:(h=e.sourceToken)==null?void 0:h.address,toTokenAddress:(A=e.toToken)==null?void 0:A.address,toTokenAmount:e.toTokenAmount,toTokenDecimals:(S=e.toToken)==null?void 0:S.decimals,sourceTokenAmount:e.sourceTokenAmount,sourceTokenDecimals:(P=e.sourceToken)==null?void 0:P.decimals,invalidToToken:r,invalidSourceToken:d,invalidSourceTokenAmount:l,availableToSwap:o&&!r&&!d&&!l,isAuthConnector:c===b.CONNECTOR_ID.AUTH}},async setSourceToken(n){if(!n){e.sourceToken=n,e.sourceTokenAmount="",e.sourceTokenPriceInUSD=0;return}e.sourceToken=n,await a.setTokenPrice(n.address,"sourceToken")},setSourceTokenAmount(n){e.sourceTokenAmount=n},async setToToken(n){if(!n){e.toToken=n,e.toTokenAmount="",e.toTokenPriceInUSD=0;return}e.toToken=n,await a.setTokenPrice(n.address,"toToken")},setToTokenAmount(n){e.toTokenAmount=n?T.toFixed(n,Q):""},async setTokenPrice(n,o){let t=e.tokensPriceMap[n]||0;t||(e.loadingPrices=!0,t=await a.getAddressPrice(n)),o==="sourceToken"?e.sourceTokenPriceInUSD=t:o==="toToken"&&(e.toTokenPriceInUSD=t),e.loadingPrices&&(e.loadingPrices=!1),a.getParams().availableToSwap&&!e.switchingTokens&&a.swapTokens()},async switchTokens(){if(!(e.initializing||!e.initialized||e.switchingTokens)){e.switchingTokens=!0;try{const n=e.toToken?{...e.toToken}:void 0,o=e.sourceToken?{...e.sourceToken}:void 0,t=n&&e.toTokenAmount===""?"1":e.toTokenAmount;a.setSourceTokenAmount(t),a.setToTokenAmount(""),await a.setSourceToken(n),await a.setToToken(o),e.switchingTokens=!1,a.swapTokens()}catch(n){throw e.switchingTokens=!1,n}}},resetState(){e.myTokensWithBalance=g.myTokensWithBalance,e.tokensPriceMap=g.tokensPriceMap,e.initialized=g.initialized,e.initializing=g.initializing,e.switchingTokens=g.switchingTokens,e.sourceToken=g.sourceToken,e.sourceTokenAmount=g.sourceTokenAmount,e.sourceTokenPriceInUSD=g.sourceTokenPriceInUSD,e.toToken=g.toToken,e.toTokenAmount=g.toTokenAmount,e.toTokenPriceInUSD=g.toTokenPriceInUSD,e.networkPrice=g.networkPrice,e.networkTokenSymbol=g.networkTokenSymbol,e.networkBalanceInUSD=g.networkBalanceInUSD,e.inputError=g.inputError},resetValues(){var t;const{networkAddress:n}=a.getParams(),o=(t=e.tokens)==null?void 0:t.find(s=>s.address===n);a.setSourceToken(o),a.setToToken(void 0)},getApprovalLoadingState(){return e.loadingApprovalTransaction},clearError(){e.transactionError=void 0},async initializeState(){if(!e.initializing){if(e.initializing=!0,!e.initialized)try{await a.fetchTokens(),e.initialized=!0}catch{e.initialized=!1,f.showError("Failed to initialize swap"),I.goBack()}e.initializing=!1}},async fetchTokens(){var t;const{networkAddress:n}=a.getParams();await a.getNetworkTokenPrice(),await a.getMyTokensWithBalance();const o=(t=e.myTokensWithBalance)==null?void 0:t.find(s=>s.address===n);o&&(e.networkTokenSymbol=o.symbol,a.setSourceToken(o),a.setSourceTokenAmount("0"))},async getTokenList(){var o,t;const n=(o=m.state.activeCaipNetwork)==null?void 0:o.caipNetworkId;if(!(e.caipNetworkId===n&&e.tokens))try{e.tokensLoading=!0;const s=await E.getTokenList(n);e.tokens=s,e.caipNetworkId=n,e.popularTokens=s.sort((i,u)=>i.symbol<u.symbol?-1:i.symbol>u.symbol?1:0);const r=(n&&((t=W.SUGGESTED_TOKENS_BY_CHAIN)==null?void 0:t[n])||[]).map(i=>s.find(u=>u.symbol===i)).filter(i=>!!i),l=(W.SWAP_SUGGESTED_TOKENS||[]).map(i=>s.find(u=>u.symbol===i)).filter(i=>!!i).filter(i=>!r.some(u=>u.address===i.address));e.suggestedTokens=[...r,...l]}catch{e.tokens=[],e.popularTokens=[],e.suggestedTokens=[]}finally{e.tokensLoading=!1}},async getAddressPrice(n){var i,u;const o=e.tokensPriceMap[n];if(o)return o;const t=await N.fetchTokenPrice({addresses:[n]}),s=(t==null?void 0:t.fungibles)||[],c=[...e.tokens||[],...e.myTokensWithBalance||[]],r=(i=c==null?void 0:c.find(p=>p.address===n))==null?void 0:i.symbol,d=((u=s.find(p=>p.symbol.toLowerCase()===(r==null?void 0:r.toLowerCase())))==null?void 0:u.price)||0,l=parseFloat(d.toString());return e.tokensPriceMap[n]=l,l},async getNetworkTokenPrice(){var c;const{networkAddress:n}=a.getParams(),t=(c=(await N.fetchTokenPrice({addresses:[n]}).catch(()=>(f.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles)==null?void 0:c[0],s=(t==null?void 0:t.price.toString())||"0";e.tokensPriceMap[n]=parseFloat(s),e.networkTokenSymbol=(t==null?void 0:t.symbol)||"",e.networkPrice=s},async getMyTokensWithBalance(n){var s;const o=await z.getMyTokensWithBalance({forceUpdate:n,caipNetwork:m.state.activeCaipNetwork,address:(s=m.getAccountData())==null?void 0:s.address}),t=E.mapBalancesToSwapTokens(o);t&&(await a.getInitialGasPrice(),a.setBalances(t))},setBalances(n){const{networkAddress:o}=a.getParams(),t=m.state.activeCaipNetwork;if(!t)return;const s=n.find(c=>c.address===o);n.forEach(c=>{e.tokensPriceMap[c.address]=c.price||0}),e.myTokensWithBalance=n.filter(c=>c.address.startsWith(t.caipNetworkId)),e.networkBalanceInUSD=s?T.multiply(s.quantity.numeric,s.price).toString():"0"},async getInitialGasPrice(){var o,t;const n=await E.fetchGasPrice();if(!n)return{gasPrice:null,gasPriceInUSD:null};switch((t=(o=m.state)==null?void 0:o.activeCaipNetwork)==null?void 0:t.chainNamespace){case b.CHAIN.SOLANA:return e.gasFee=n.standard??"0",e.gasPriceInUSD=T.multiply(n.standard,e.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(e.gasFee),gasPriceInUSD:Number(e.gasPriceInUSD)};case b.CHAIN.EVM:default:const s=n.standard??"0",c=BigInt(s),r=BigInt(x),d=C.getGasPriceInUSD(e.networkPrice,r,c);return e.gasFee=s,e.gasPriceInUSD=d,{gasPrice:c,gasPriceInUSD:d}}},async swapTokens(){var r,d,l;const n=(r=m.getAccountData())==null?void 0:r.address,o=e.sourceToken,t=e.toToken,s=T.bigNumber(e.sourceTokenAmount).gt(0);if(s||a.setToTokenAmount(""),!t||!o||e.loadingPrices||!s||!n)return;e.loadingQuote=!0;const c=T.bigNumber(e.sourceTokenAmount).times(10**o.decimals).round(0).toFixed(0);try{const i=await N.fetchSwapQuote({userAddress:n,from:o.address,to:t.address,gasPrice:e.gasFee,amount:c.toString()});e.loadingQuote=!1;const u=(l=(d=i==null?void 0:i.quotes)==null?void 0:d[0])==null?void 0:l.toAmount;if(!u){O.open({displayMessage:"Incorrect amount",debugMessage:"Please enter a valid amount"},"error");return}const p=T.bigNumber(u).div(10**t.decimals).toString();a.setToTokenAmount(p),a.hasInsufficientToken(e.sourceTokenAmount,o.address)?e.inputError="Insufficient balance":(e.inputError=void 0,a.setTransactionDetails())}catch(i){const u=await E.handleSwapError(i);e.loadingQuote=!1,e.inputError=u||"Insufficient balance"}},async getTransaction(){const{fromCaipAddress:n,availableToSwap:o}=a.getParams(),t=e.sourceToken,s=e.toToken;if(!(!n||!o||!t||!s||e.loadingQuote))try{e.loadingBuildTransaction=!0;const c=await E.fetchSwapAllowance({userAddress:n,tokenAddress:t.address,sourceTokenAmount:e.sourceTokenAmount,sourceTokenDecimals:t.decimals});let r;return c?r=await a.createSwapTransaction():r=await a.createAllowanceTransaction(),e.loadingBuildTransaction=!1,e.fetchError=!1,r}catch{I.goBack(),f.showError("Failed to check allowance"),e.loadingBuildTransaction=!1,e.approvalTransaction=void 0,e.swapTransaction=void 0,e.fetchError=!0;return}},async createAllowanceTransaction(){const{fromCaipAddress:n,sourceTokenAddress:o,toTokenAddress:t}=a.getParams();if(!(!n||!t)){if(!o)throw new Error("createAllowanceTransaction - No source token address found.");try{const s=await N.generateApproveCalldata({from:o,to:t,userAddress:n}),c=L.getPlainAddress(s.tx.from);if(!c)throw new Error("SwapController:createAllowanceTransaction - address is required");const r={data:s.tx.data,to:c,gasPrice:BigInt(s.tx.eip155.gasPrice),value:BigInt(s.tx.value),toAmount:e.toTokenAmount};return e.swapTransaction=void 0,e.approvalTransaction={data:r.data,to:r.to,gasPrice:r.gasPrice,value:r.value,toAmount:r.toAmount},{data:r.data,to:r.to,gasPrice:r.gasPrice,value:r.value,toAmount:r.toAmount}}catch{I.goBack(),f.showError("Failed to create approval transaction"),e.approvalTransaction=void 0,e.swapTransaction=void 0,e.fetchError=!0;return}}},async createSwapTransaction(){var d,l;const{networkAddress:n,fromCaipAddress:o,sourceTokenAmount:t}=a.getParams(),s=e.sourceToken,c=e.toToken;if(!o||!t||!s||!c)return;let r=(d=B.parseUnits(t,s.decimals))==null?void 0:d.toString();try{const i=s.address===n;let u=await N.generateSwapCalldata({userAddress:o,from:s.address,to:c.address,amount:r,disableEstimate:!0}),p=BigInt(u.tx.eip155.gas),w=BigInt(u.tx.eip155.gasPrice);if(i&&r){const A=(l=e.myTokensWithBalance)==null?void 0:l.find(S=>S.address===n);if(A){const S=parseInt(A.quantity.decimals,10),P=B.parseUnits(A.quantity.numeric,S)??0n,v=p*w;if(BigInt(r)+v>P){const k=P>v?P-v:0n;k>0n&&(u=await N.generateSwapCalldata({userAddress:o,from:s.address,to:c.address,amount:k.toString(),disableEstimate:!0}),r=k.toString(),p=BigInt(u.tx.eip155.gas),w=BigInt(u.tx.eip155.gasPrice))}}}const y=L.getPlainAddress(u.tx.to);if(!y)throw new Error("SwapController:createSwapTransaction - address is required");const h={data:u.tx.data,to:y,gas:p,gasPrice:w,value:BigInt(i?r??"0":"0"),toAmount:e.toTokenAmount};return e.gasPriceInUSD=C.getGasPriceInUSD(e.networkPrice,p,w),e.approvalTransaction=void 0,e.swapTransaction=h,h}catch{I.goBack(),f.showError("Failed to create transaction"),e.approvalTransaction=void 0,e.swapTransaction=void 0,e.fetchError=!0;return}},onEmbeddedWalletApprovalSuccess(){f.showLoading("Approve limit increase in your wallet"),I.replace("SwapPreview")},async sendTransactionForApproval(n){var c,r,d;const{fromAddress:o,isAuthConnector:t}=a.getParams();e.loadingApprovalTransaction=!0,t?I.pushTransactionStack({onSuccess:a.onEmbeddedWalletApprovalSuccess}):f.showLoading("Approve limit increase in your wallet");try{await B.sendTransaction({address:o,to:n.to,data:n.data,value:n.value,chainNamespace:b.CHAIN.EVM}),await a.swapTokens(),await a.getTransaction(),e.approvalTransaction=void 0,e.loadingApprovalTransaction=!1}catch(l){const i=l;e.transactionError=i==null?void 0:i.displayMessage,e.loadingApprovalTransaction=!1,f.showError((i==null?void 0:i.displayMessage)||"Transaction error"),M.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:(i==null?void 0:i.displayMessage)||(i==null?void 0:i.message)||"Unknown",network:((c=m.state.activeCaipNetwork)==null?void 0:c.caipNetworkId)||"",swapFromToken:((r=a.state.sourceToken)==null?void 0:r.symbol)||"",swapToToken:((d=a.state.toToken)==null?void 0:d.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:F(b.CHAIN.EVM)===_.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(n){var d,l,i,u,p,w,y,h,A,S,P,v;if(!n)return;const{fromAddress:o,toTokenAmount:t,isAuthConnector:s}=a.getParams();e.loadingTransaction=!0;const c=`Swapping ${(d=e.sourceToken)==null?void 0:d.symbol} to ${T.formatNumberToLocalString(t,3)} ${(l=e.toToken)==null?void 0:l.symbol}`,r=`Swapped ${(i=e.sourceToken)==null?void 0:i.symbol} to ${T.formatNumberToLocalString(t,3)} ${(u=e.toToken)==null?void 0:u.symbol}`;s?I.pushTransactionStack({onSuccess(){I.replace("Account"),f.showLoading(c),D.resetState()}}):f.showLoading("Confirm transaction in your wallet");try{const U=[(p=e.sourceToken)==null?void 0:p.address,(w=e.toToken)==null?void 0:w.address].join(","),k=await B.sendTransaction({address:o,to:n.to,data:n.data,value:n.value,chainNamespace:b.CHAIN.EVM});return e.loadingTransaction=!1,f.showSuccess(r),M.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((y=m.state.activeCaipNetwork)==null?void 0:y.caipNetworkId)||"",swapFromToken:((h=a.state.sourceToken)==null?void 0:h.symbol)||"",swapToToken:((A=a.state.toToken)==null?void 0:A.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:F(b.CHAIN.EVM)===_.ACCOUNT_TYPES.SMART_ACCOUNT}}),D.resetState(),s||I.replace("Account"),D.getMyTokensWithBalance(U),k}catch(U){const k=U;e.transactionError=k==null?void 0:k.displayMessage,e.loadingTransaction=!1,f.showError((k==null?void 0:k.displayMessage)||"Transaction error"),M.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:(k==null?void 0:k.displayMessage)||(k==null?void 0:k.message)||"Unknown",network:((S=m.state.activeCaipNetwork)==null?void 0:S.caipNetworkId)||"",swapFromToken:((P=a.state.sourceToken)==null?void 0:P.symbol)||"",swapToToken:((v=a.state.toToken)==null?void 0:v.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:F(b.CHAIN.EVM)===_.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(n,o){return C.isInsufficientSourceTokenForSwap(n,o,e.myTokensWithBalance)},setTransactionDetails(){const{toTokenAddress:n,toTokenDecimals:o}=a.getParams();!n||!o||(e.gasPriceInUSD=C.getGasPriceInUSD(e.networkPrice,BigInt(e.gasFee),BigInt(x)),e.priceImpact=C.getPriceImpact({sourceTokenAmount:e.sourceTokenAmount,sourceTokenPriceInUSD:e.sourceTokenPriceInUSD,toTokenPriceInUSD:e.toTokenPriceInUSD,toTokenAmount:e.toTokenAmount}),e.maxSlippage=C.getMaxSlippage(e.slippage,e.toTokenAmount),e.providerFee=C.getProviderFee(e.sourceTokenAmount))}},a=G(D);export{a as S};
|
|
2
|
-
//# sourceMappingURL=SwapController-
|
|
1
|
+
import{N as T,j as G,R as I,S as f,k as B,E as M,l as F,W as _,C as m,B as N,b as L,m as E,A as O,n as z,d as W,g as R,o as H,e as V,i as q,p as $}from"./W3MFrameProviderSingleton-DwbyBYX9.js";import{au as b}from"./NetworkUtil-BbMBxyRo.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new n.Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="d5bf39f8-0096-4633-a71d-e79393a73741",n._sentryDebugIdIdentifier="sentry-dbid-d5bf39f8-0096-4633-a71d-e79393a73741")}catch{}})();const C={getGasPriceInEther(n,o){const t=o*n;return Number(t)/1e18},getGasPriceInUSD(n,o,t){const s=C.getGasPriceInEther(o,t);return T.bigNumber(n).times(s).toNumber()},getPriceImpact({sourceTokenAmount:n,sourceTokenPriceInUSD:o,toTokenPriceInUSD:t,toTokenAmount:s}){const c=T.bigNumber(n).times(o),r=T.bigNumber(s).times(t);return c.minus(r).div(c).times(100).toNumber()},getMaxSlippage(n,o){const t=T.bigNumber(n).div(100);return T.multiply(o,t).toNumber()},getProviderFee(n,o=.0085){return T.bigNumber(n).times(o).toString()},isInsufficientNetworkTokenForGas(n,o){const t=o||"0";return T.bigNumber(n).eq(0)?!0:T.bigNumber(T.bigNumber(t)).gt(n)},isInsufficientSourceTokenForSwap(n,o,t){var r,d;const s=(d=(r=t==null?void 0:t.find(l=>l.address===o))==null?void 0:r.quantity)==null?void 0:d.numeric;return T.bigNumber(s||"0").lt(n)}},x=15e4,Q=6,g={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,switchingTokens:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:W.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},e=$({...g}),D={state:e,subscribe(n){return q(e,()=>n(e))},subscribeKey(n,o){return V(e,n,o)},getParams(){var i,u,p,w,y,h,A,S,P;const n=m.state.activeChain,o=((i=m.getAccountData(n))==null?void 0:i.caipAddress)??m.state.activeCaipAddress,t=L.getPlainAddress(o),s=R(),c=H.getConnectorId(m.state.activeChain);if(!t)throw new Error("No address found to swap the tokens from.");const r=!((u=e.toToken)!=null&&u.address)||!((p=e.toToken)!=null&&p.decimals),d=!((w=e.sourceToken)!=null&&w.address)||!((y=e.sourceToken)!=null&&y.decimals)||!T.bigNumber(e.sourceTokenAmount).gt(0),l=!e.sourceTokenAmount;return{networkAddress:s,fromAddress:t,fromCaipAddress:o,sourceTokenAddress:(h=e.sourceToken)==null?void 0:h.address,toTokenAddress:(A=e.toToken)==null?void 0:A.address,toTokenAmount:e.toTokenAmount,toTokenDecimals:(S=e.toToken)==null?void 0:S.decimals,sourceTokenAmount:e.sourceTokenAmount,sourceTokenDecimals:(P=e.sourceToken)==null?void 0:P.decimals,invalidToToken:r,invalidSourceToken:d,invalidSourceTokenAmount:l,availableToSwap:o&&!r&&!d&&!l,isAuthConnector:c===b.CONNECTOR_ID.AUTH}},async setSourceToken(n){if(!n){e.sourceToken=n,e.sourceTokenAmount="",e.sourceTokenPriceInUSD=0;return}e.sourceToken=n,await a.setTokenPrice(n.address,"sourceToken")},setSourceTokenAmount(n){e.sourceTokenAmount=n},async setToToken(n){if(!n){e.toToken=n,e.toTokenAmount="",e.toTokenPriceInUSD=0;return}e.toToken=n,await a.setTokenPrice(n.address,"toToken")},setToTokenAmount(n){e.toTokenAmount=n?T.toFixed(n,Q):""},async setTokenPrice(n,o){let t=e.tokensPriceMap[n]||0;t||(e.loadingPrices=!0,t=await a.getAddressPrice(n)),o==="sourceToken"?e.sourceTokenPriceInUSD=t:o==="toToken"&&(e.toTokenPriceInUSD=t),e.loadingPrices&&(e.loadingPrices=!1),a.getParams().availableToSwap&&!e.switchingTokens&&a.swapTokens()},async switchTokens(){if(!(e.initializing||!e.initialized||e.switchingTokens)){e.switchingTokens=!0;try{const n=e.toToken?{...e.toToken}:void 0,o=e.sourceToken?{...e.sourceToken}:void 0,t=n&&e.toTokenAmount===""?"1":e.toTokenAmount;a.setSourceTokenAmount(t),a.setToTokenAmount(""),await a.setSourceToken(n),await a.setToToken(o),e.switchingTokens=!1,a.swapTokens()}catch(n){throw e.switchingTokens=!1,n}}},resetState(){e.myTokensWithBalance=g.myTokensWithBalance,e.tokensPriceMap=g.tokensPriceMap,e.initialized=g.initialized,e.initializing=g.initializing,e.switchingTokens=g.switchingTokens,e.sourceToken=g.sourceToken,e.sourceTokenAmount=g.sourceTokenAmount,e.sourceTokenPriceInUSD=g.sourceTokenPriceInUSD,e.toToken=g.toToken,e.toTokenAmount=g.toTokenAmount,e.toTokenPriceInUSD=g.toTokenPriceInUSD,e.networkPrice=g.networkPrice,e.networkTokenSymbol=g.networkTokenSymbol,e.networkBalanceInUSD=g.networkBalanceInUSD,e.inputError=g.inputError},resetValues(){var t;const{networkAddress:n}=a.getParams(),o=(t=e.tokens)==null?void 0:t.find(s=>s.address===n);a.setSourceToken(o),a.setToToken(void 0)},getApprovalLoadingState(){return e.loadingApprovalTransaction},clearError(){e.transactionError=void 0},async initializeState(){if(!e.initializing){if(e.initializing=!0,!e.initialized)try{await a.fetchTokens(),e.initialized=!0}catch{e.initialized=!1,f.showError("Failed to initialize swap"),I.goBack()}e.initializing=!1}},async fetchTokens(){var t;const{networkAddress:n}=a.getParams();await a.getNetworkTokenPrice(),await a.getMyTokensWithBalance();const o=(t=e.myTokensWithBalance)==null?void 0:t.find(s=>s.address===n);o&&(e.networkTokenSymbol=o.symbol,a.setSourceToken(o),a.setSourceTokenAmount("0"))},async getTokenList(){var o,t;const n=(o=m.state.activeCaipNetwork)==null?void 0:o.caipNetworkId;if(!(e.caipNetworkId===n&&e.tokens))try{e.tokensLoading=!0;const s=await E.getTokenList(n);e.tokens=s,e.caipNetworkId=n,e.popularTokens=s.sort((i,u)=>i.symbol<u.symbol?-1:i.symbol>u.symbol?1:0);const r=(n&&((t=W.SUGGESTED_TOKENS_BY_CHAIN)==null?void 0:t[n])||[]).map(i=>s.find(u=>u.symbol===i)).filter(i=>!!i),l=(W.SWAP_SUGGESTED_TOKENS||[]).map(i=>s.find(u=>u.symbol===i)).filter(i=>!!i).filter(i=>!r.some(u=>u.address===i.address));e.suggestedTokens=[...r,...l]}catch{e.tokens=[],e.popularTokens=[],e.suggestedTokens=[]}finally{e.tokensLoading=!1}},async getAddressPrice(n){var i,u;const o=e.tokensPriceMap[n];if(o)return o;const t=await N.fetchTokenPrice({addresses:[n]}),s=(t==null?void 0:t.fungibles)||[],c=[...e.tokens||[],...e.myTokensWithBalance||[]],r=(i=c==null?void 0:c.find(p=>p.address===n))==null?void 0:i.symbol,d=((u=s.find(p=>p.symbol.toLowerCase()===(r==null?void 0:r.toLowerCase())))==null?void 0:u.price)||0,l=parseFloat(d.toString());return e.tokensPriceMap[n]=l,l},async getNetworkTokenPrice(){var c;const{networkAddress:n}=a.getParams(),t=(c=(await N.fetchTokenPrice({addresses:[n]}).catch(()=>(f.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles)==null?void 0:c[0],s=(t==null?void 0:t.price.toString())||"0";e.tokensPriceMap[n]=parseFloat(s),e.networkTokenSymbol=(t==null?void 0:t.symbol)||"",e.networkPrice=s},async getMyTokensWithBalance(n){var s;const o=await z.getMyTokensWithBalance({forceUpdate:n,caipNetwork:m.state.activeCaipNetwork,address:(s=m.getAccountData())==null?void 0:s.address}),t=E.mapBalancesToSwapTokens(o);t&&(await a.getInitialGasPrice(),a.setBalances(t))},setBalances(n){const{networkAddress:o}=a.getParams(),t=m.state.activeCaipNetwork;if(!t)return;const s=n.find(c=>c.address===o);n.forEach(c=>{e.tokensPriceMap[c.address]=c.price||0}),e.myTokensWithBalance=n.filter(c=>c.address.startsWith(t.caipNetworkId)),e.networkBalanceInUSD=s?T.multiply(s.quantity.numeric,s.price).toString():"0"},async getInitialGasPrice(){var o,t;const n=await E.fetchGasPrice();if(!n)return{gasPrice:null,gasPriceInUSD:null};switch((t=(o=m.state)==null?void 0:o.activeCaipNetwork)==null?void 0:t.chainNamespace){case b.CHAIN.SOLANA:return e.gasFee=n.standard??"0",e.gasPriceInUSD=T.multiply(n.standard,e.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(e.gasFee),gasPriceInUSD:Number(e.gasPriceInUSD)};case b.CHAIN.EVM:default:const s=n.standard??"0",c=BigInt(s),r=BigInt(x),d=C.getGasPriceInUSD(e.networkPrice,r,c);return e.gasFee=s,e.gasPriceInUSD=d,{gasPrice:c,gasPriceInUSD:d}}},async swapTokens(){var r,d,l;const n=(r=m.getAccountData())==null?void 0:r.address,o=e.sourceToken,t=e.toToken,s=T.bigNumber(e.sourceTokenAmount).gt(0);if(s||a.setToTokenAmount(""),!t||!o||e.loadingPrices||!s||!n)return;e.loadingQuote=!0;const c=T.bigNumber(e.sourceTokenAmount).times(10**o.decimals).round(0).toFixed(0);try{const i=await N.fetchSwapQuote({userAddress:n,from:o.address,to:t.address,gasPrice:e.gasFee,amount:c.toString()});e.loadingQuote=!1;const u=(l=(d=i==null?void 0:i.quotes)==null?void 0:d[0])==null?void 0:l.toAmount;if(!u){O.open({displayMessage:"Incorrect amount",debugMessage:"Please enter a valid amount"},"error");return}const p=T.bigNumber(u).div(10**t.decimals).toString();a.setToTokenAmount(p),a.hasInsufficientToken(e.sourceTokenAmount,o.address)?e.inputError="Insufficient balance":(e.inputError=void 0,a.setTransactionDetails())}catch(i){const u=await E.handleSwapError(i);e.loadingQuote=!1,e.inputError=u||"Insufficient balance"}},async getTransaction(){const{fromCaipAddress:n,availableToSwap:o}=a.getParams(),t=e.sourceToken,s=e.toToken;if(!(!n||!o||!t||!s||e.loadingQuote))try{e.loadingBuildTransaction=!0;const c=await E.fetchSwapAllowance({userAddress:n,tokenAddress:t.address,sourceTokenAmount:e.sourceTokenAmount,sourceTokenDecimals:t.decimals});let r;return c?r=await a.createSwapTransaction():r=await a.createAllowanceTransaction(),e.loadingBuildTransaction=!1,e.fetchError=!1,r}catch{I.goBack(),f.showError("Failed to check allowance"),e.loadingBuildTransaction=!1,e.approvalTransaction=void 0,e.swapTransaction=void 0,e.fetchError=!0;return}},async createAllowanceTransaction(){const{fromCaipAddress:n,sourceTokenAddress:o,toTokenAddress:t}=a.getParams();if(!(!n||!t)){if(!o)throw new Error("createAllowanceTransaction - No source token address found.");try{const s=await N.generateApproveCalldata({from:o,to:t,userAddress:n}),c=L.getPlainAddress(s.tx.from);if(!c)throw new Error("SwapController:createAllowanceTransaction - address is required");const r={data:s.tx.data,to:c,gasPrice:BigInt(s.tx.eip155.gasPrice),value:BigInt(s.tx.value),toAmount:e.toTokenAmount};return e.swapTransaction=void 0,e.approvalTransaction={data:r.data,to:r.to,gasPrice:r.gasPrice,value:r.value,toAmount:r.toAmount},{data:r.data,to:r.to,gasPrice:r.gasPrice,value:r.value,toAmount:r.toAmount}}catch{I.goBack(),f.showError("Failed to create approval transaction"),e.approvalTransaction=void 0,e.swapTransaction=void 0,e.fetchError=!0;return}}},async createSwapTransaction(){var d,l;const{networkAddress:n,fromCaipAddress:o,sourceTokenAmount:t}=a.getParams(),s=e.sourceToken,c=e.toToken;if(!o||!t||!s||!c)return;let r=(d=B.parseUnits(t,s.decimals))==null?void 0:d.toString();try{const i=s.address===n;let u=await N.generateSwapCalldata({userAddress:o,from:s.address,to:c.address,amount:r,disableEstimate:!0}),p=BigInt(u.tx.eip155.gas),w=BigInt(u.tx.eip155.gasPrice);if(i&&r){const A=(l=e.myTokensWithBalance)==null?void 0:l.find(S=>S.address===n);if(A){const S=parseInt(A.quantity.decimals,10),P=B.parseUnits(A.quantity.numeric,S)??0n,v=p*w;if(BigInt(r)+v>P){const k=P>v?P-v:0n;k>0n&&(u=await N.generateSwapCalldata({userAddress:o,from:s.address,to:c.address,amount:k.toString(),disableEstimate:!0}),r=k.toString(),p=BigInt(u.tx.eip155.gas),w=BigInt(u.tx.eip155.gasPrice))}}}const y=L.getPlainAddress(u.tx.to);if(!y)throw new Error("SwapController:createSwapTransaction - address is required");const h={data:u.tx.data,to:y,gas:p,gasPrice:w,value:BigInt(i?r??"0":"0"),toAmount:e.toTokenAmount};return e.gasPriceInUSD=C.getGasPriceInUSD(e.networkPrice,p,w),e.approvalTransaction=void 0,e.swapTransaction=h,h}catch{I.goBack(),f.showError("Failed to create transaction"),e.approvalTransaction=void 0,e.swapTransaction=void 0,e.fetchError=!0;return}},onEmbeddedWalletApprovalSuccess(){f.showLoading("Approve limit increase in your wallet"),I.replace("SwapPreview")},async sendTransactionForApproval(n){var c,r,d;const{fromAddress:o,isAuthConnector:t}=a.getParams();e.loadingApprovalTransaction=!0,t?I.pushTransactionStack({onSuccess:a.onEmbeddedWalletApprovalSuccess}):f.showLoading("Approve limit increase in your wallet");try{await B.sendTransaction({address:o,to:n.to,data:n.data,value:n.value,chainNamespace:b.CHAIN.EVM}),await a.swapTokens(),await a.getTransaction(),e.approvalTransaction=void 0,e.loadingApprovalTransaction=!1}catch(l){const i=l;e.transactionError=i==null?void 0:i.displayMessage,e.loadingApprovalTransaction=!1,f.showError((i==null?void 0:i.displayMessage)||"Transaction error"),M.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:(i==null?void 0:i.displayMessage)||(i==null?void 0:i.message)||"Unknown",network:((c=m.state.activeCaipNetwork)==null?void 0:c.caipNetworkId)||"",swapFromToken:((r=a.state.sourceToken)==null?void 0:r.symbol)||"",swapToToken:((d=a.state.toToken)==null?void 0:d.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:F(b.CHAIN.EVM)===_.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(n){var d,l,i,u,p,w,y,h,A,S,P,v;if(!n)return;const{fromAddress:o,toTokenAmount:t,isAuthConnector:s}=a.getParams();e.loadingTransaction=!0;const c=`Swapping ${(d=e.sourceToken)==null?void 0:d.symbol} to ${T.formatNumberToLocalString(t,3)} ${(l=e.toToken)==null?void 0:l.symbol}`,r=`Swapped ${(i=e.sourceToken)==null?void 0:i.symbol} to ${T.formatNumberToLocalString(t,3)} ${(u=e.toToken)==null?void 0:u.symbol}`;s?I.pushTransactionStack({onSuccess(){I.replace("Account"),f.showLoading(c),D.resetState()}}):f.showLoading("Confirm transaction in your wallet");try{const U=[(p=e.sourceToken)==null?void 0:p.address,(w=e.toToken)==null?void 0:w.address].join(","),k=await B.sendTransaction({address:o,to:n.to,data:n.data,value:n.value,chainNamespace:b.CHAIN.EVM});return e.loadingTransaction=!1,f.showSuccess(r),M.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((y=m.state.activeCaipNetwork)==null?void 0:y.caipNetworkId)||"",swapFromToken:((h=a.state.sourceToken)==null?void 0:h.symbol)||"",swapToToken:((A=a.state.toToken)==null?void 0:A.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:F(b.CHAIN.EVM)===_.ACCOUNT_TYPES.SMART_ACCOUNT}}),D.resetState(),s||I.replace("Account"),D.getMyTokensWithBalance(U),k}catch(U){const k=U;e.transactionError=k==null?void 0:k.displayMessage,e.loadingTransaction=!1,f.showError((k==null?void 0:k.displayMessage)||"Transaction error"),M.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:(k==null?void 0:k.displayMessage)||(k==null?void 0:k.message)||"Unknown",network:((S=m.state.activeCaipNetwork)==null?void 0:S.caipNetworkId)||"",swapFromToken:((P=a.state.sourceToken)==null?void 0:P.symbol)||"",swapToToken:((v=a.state.toToken)==null?void 0:v.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:F(b.CHAIN.EVM)===_.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(n,o){return C.isInsufficientSourceTokenForSwap(n,o,e.myTokensWithBalance)},setTransactionDetails(){const{toTokenAddress:n,toTokenDecimals:o}=a.getParams();!n||!o||(e.gasPriceInUSD=C.getGasPriceInUSD(e.networkPrice,BigInt(e.gasFee),BigInt(x)),e.priceImpact=C.getPriceImpact({sourceTokenAmount:e.sourceTokenAmount,sourceTokenPriceInUSD:e.sourceTokenPriceInUSD,toTokenPriceInUSD:e.toTokenPriceInUSD,toTokenAmount:e.toTokenAmount}),e.maxSlippage=C.getMaxSlippage(e.slippage,e.toTokenAmount),e.providerFee=C.getProviderFee(e.sourceTokenAmount))}},a=G(D);export{a as S};
|
|
2
|
+
//# sourceMappingURL=SwapController-Di8HGSG3.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o,j as z,d as W}from"./react-
|
|
1
|
+
import{r as o,j as z,d as W}from"./react-ZT2P9-hV.js";import{s as j,a as c}from"./index-y9tZLe7Z.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="63ca1e8c-66cb-4d82-a30f-d0c39c211a41",t._sentryDebugIdIdentifier="sentry-dbid-63ca1e8c-66cb-4d82-a30f-d0c39c211a41")}catch{}})();const C=(...t)=>({shouldForwardProp:a=>!t.includes(a)}),G=j("span",C("block"))`
|
|
2
2
|
display: ${({block:t})=>t?"flex":"inline-flex"};
|
|
3
3
|
${({block:t})=>t?"width: 100%;":""}
|
|
4
4
|
`,T=j("span",C("placement"))`
|
|
@@ -43,4 +43,4 @@ import{r as o,j as z,d as W}from"./react-DhG5dcPN.js";import{s as j,a as c}from"
|
|
|
43
43
|
transition: none;
|
|
44
44
|
}
|
|
45
45
|
`,l=8,f=8;function X({content:t,children:a,placement:n="top",block:P,onShow:d,className:_}){const[r,x]=o.useState(!1),[e,B]=o.useState(null),w=o.useId(),h=o.useRef(!1),g=o.useRef(null),y=o.useRef(null),E=o.useCallback(()=>{x(!0),h.current||(h.current=!0,d==null||d())},[d]),v=o.useCallback(()=>x(!1),[]),s=o.useCallback(()=>{const $=g.current,M=y.current;if(!$||!M)return;const i=$.getBoundingClientRect(),{offsetWidth:F,offsetHeight:p}=M,L=F/2,u=L+f,R=i.left+i.width/2,k=Math.min(Math.max(R,u),Math.max(u,window.innerWidth-u)),b={top:i.top-l,bottom:window.innerHeight-i.bottom-l},m=b[n]>=p||b[n]>=b[n==="top"?"bottom":"top"]?n:n==="top"?"bottom":"top",D=m==="top"?i.top-l:i.bottom+l,H=m==="top"?Math.max(D,p+f):Math.min(D,Math.max(f,window.innerHeight-p-f)),I=Math.max(0,L-13);B({left:k,top:H,arrow:Math.min(Math.max(R-k,-I),I),placement:m})},[n]);return o.useLayoutEffect(()=>{r&&s()},[t,r,s]),o.useEffect(()=>{if(r)return window.addEventListener("scroll",s,!0),window.addEventListener("resize",s),()=>{window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s)}},[r,s]),z.jsxs(G,{ref:g,className:_,block:P,onMouseEnter:E,onMouseLeave:v,onFocus:E,onBlur:v,children:[o.cloneElement(a,{"aria-describedby":r?w:void 0}),W.createPortal(z.jsx(T,{ref:y,role:"tooltip",id:w,placement:(e==null?void 0:e.placement)??n,"aria-hidden":!r,style:{left:(e==null?void 0:e.left)??0,top:(e==null?void 0:e.top)??0,"--tooltip-arrow":`${(e==null?void 0:e.arrow)??0}px`},...r&&e?{"data-open":""}:{},children:t}),document.body)]})}export{X as T,C as n};
|
|
46
|
-
//# sourceMappingURL=Tooltip-
|
|
46
|
+
//# sourceMappingURL=Tooltip-Bj-rfWuS.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var Oe=Object.defineProperty;var Ue=(t,r,e)=>r in t?Oe(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e;var m=(t,r,e)=>Ue(t,typeof r!="symbol"?r+"":r,e);import{W as Ie,a as ie,C as De,B as Le,f as ce}from"./ethers-DSJYCqoj.js";import{a as Me,d as V}from"./dcl-schemas-B-U9a1k0.js";import{c as ue}from"./react-DhG5dcPN.js";import{cY as je,L as de,h as le}from"./index-KErMJCvL.js";import{c as z,e as qe}from"./index-CkMr9c7F.js";import{s as He}from"./sendMetaTransaction-DsMG8gV0.js";import"./sentry-C-ZN4hdJ.js";import"./intl-AKLEHPeO.js";import"./events-BjA1SxTa.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="fe156f8f-63eb-45ac-a7cf-78496f21144b",t._sentryDebugIdIdentifier="sentry-dbid-fe156f8f-63eb-45ac-a7cf-78496f21144b")}catch{}})();async function Ne(t){const r=await Re();if(r){const e=await new Ie(r).getSigner().getChainId();if(t===e)return r}return z.createProvider(Me.ProviderType.NETWORK,t)}async function Re(){try{return await z.getProvider()}catch{try{const{provider:t}=await z.tryPreviousConnection();return t}catch{return null}}}function fe(t){return Math.floor(t/1e3)}function he(t){switch(t.assetType){case V.TradeAssetType.ERC721:return t.tokenId;case V.TradeAssetType.COLLECTION_ITEM:return t.itemId;case V.TradeAssetType.ERC20:return t.amount;case V.TradeAssetType.USD_PEGGED_MANA:return t.amount;default:return console.error("Invalid asset type:",t),""}}function ke(t){var r;return{checks:{uses:t.checks.uses,expiration:fe(t.checks.expiration),effective:fe(t.checks.effective),salt:ie(t.checks.salt,32),contractSignatureIndex:t.checks.contractSignatureIndex,signerSignatureIndex:t.checks.signerSignatureIndex,allowedRoot:ie(t.checks.allowedRoot,32),externalChecks:(r=t.checks.externalChecks)==null?void 0:r.map(e=>({contractAddress:e.contractAddress,selector:e.selector,value:e.value?e.value:"0x",required:e.required}))},sent:t.sent.map(e=>({assetType:e.assetType,contractAddress:e.contractAddress,value:he(e),extra:e.extra?e.extra:"0x"})),received:t.received.map(e=>({assetType:e.assetType,contractAddress:e.contractAddress,value:he(e),extra:e.extra?e.extra:"0x",beneficiary:e.beneficiary}))}}function pe(t,r){const e=ke(t);return{signer:t.signer,signature:t.signature,...e,checks:{...e.checks,allowedProof:[]},sent:e.sent.map(o=>({...o,beneficiary:r}))}}async function Ge(t){const r=await t.request({method:"eth_chainId",params:[]});let e;return typeof r=="string"?e=parseInt(r,16):e=r,e}async function Be(t){const r=await Ne(t);return new Ie(r)}const D=new qe.EventEmitter;var P;(function(t){t.ERROR="error",t.SUCCESS="success",t.PROMPT="prompt",t.ACCEPT="accept",t.REJECT="reject"})(P||(P={}));let $e="https://transactions-api.decentraland.org/v1";const Je=()=>$e,Ve=()=>new Promise((t,r)=>{const e=()=>{D.removeAllListeners(P.REJECT),t(!0)},o=()=>{D.removeAllListeners(P.ACCEPT),r(new Error("User rejected transaction"))};D.addListener(P.ACCEPT,e),D.addListener(P.REJECT,o)});async function ye(...t){const[r,e,...o]=t;try{const a=await Re();if(!a)throw new Error("Provider not connected");const i=await Ge(a),f=await Be(r.chainId),l=new De(r.address,r.abi,f),u=await(typeof e=="function"?e(l.populateTransaction):l.populateTransaction[e](...o));if(i===r.chainId){const h=f.getSigner();if(a.isMagic||a.isThirdweb){let p=Le.from(0);try{const I=await h.getGasPrice(),b=await h.estimateGas(u);p=I.mul(b)}catch{}if(!p.isZero()){const I=Ve(),b=await h.getBalance();D.emit(P.PROMPT,{transactionGasPrice:ce(p),userBalance:ce(b),chainId:r.chainId}),await I}}const d=await h.sendTransaction(u);return D.emit(P.SUCCESS,{txHash:d.hash}),d.hash}else{const h=await He(a,f,u.data,r,{serverURL:Je()});return D.emit(P.SUCCESS,{txHash:h}),h}}catch(a){const i={type:P.ERROR,error:a};throw D.emit(P.ERROR,i),a}}var B={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var Ye=B.exports,ge;function We(){return ge||(ge=1,(function(t,r){(function(e){var o=r&&!r.nodeType&&r,a=t&&!t.nodeType&&t,i=typeof ue=="object"&&ue;(i.global===i||i.window===i||i.self===i)&&(e=i);var f,l=2147483647,u=36,h=1,d=26,p=38,I=700,b=72,A=128,L="-",q=/^xn--/,$=/[^\x20-\x7E]/,H=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Z=u-h,C=Math.floor,G=String.fromCharCode,J;function M(n){throw new RangeError(k[n])}function Q(n,s){for(var c=n.length,y=[];c--;)y[c]=s(n[c]);return y}function ee(n,s){var c=n.split("@"),y="";c.length>1&&(y=c[0]+"@",n=c[1]),n=n.replace(H,".");var g=n.split("."),w=Q(g,s).join(".");return y+w}function te(n){for(var s=[],c=0,y=n.length,g,w;c<y;)g=n.charCodeAt(c++),g>=55296&&g<=56319&&c<y?(w=n.charCodeAt(c++),(w&64512)==56320?s.push(((g&1023)<<10)+(w&1023)+65536):(s.push(g),c--)):s.push(g);return s}function re(n){return Q(n,function(s){var c="";return s>65535&&(s-=65536,c+=G(s>>>10&1023|55296),s=56320|s&1023),c+=G(s),c}).join("")}function Fe(n){return n-48<10?n-22:n-65<26?n-65:n-97<26?n-97:u}function ne(n,s){return n+22+75*(n<26)-((s!=0)<<5)}function ae(n,s,c){var y=0;for(n=c?C(n/I):n>>1,n+=C(n/s);n>Z*d>>1;y+=u)n=C(n/Z);return C(y+(Z+1)*n/(n+p))}function se(n){var s=[],c=n.length,y,g=0,w=A,v=b,_,R,F,S,T,E,x,U,j;for(_=n.lastIndexOf(L),_<0&&(_=0),R=0;R<_;++R)n.charCodeAt(R)>=128&&M("not-basic"),s.push(n.charCodeAt(R));for(F=_>0?_+1:0;F<c;){for(S=g,T=1,E=u;F>=c&&M("invalid-input"),x=Fe(n.charCodeAt(F++)),(x>=u||x>C((l-g)/T))&&M("overflow"),g+=x*T,U=E<=v?h:E>=v+d?d:E-v,!(x<U);E+=u)j=u-U,T>C(l/j)&&M("overflow"),T*=j;y=s.length+1,v=ae(g-S,y,S==0),C(g/y)>l-w&&M("overflow"),w+=C(g/y),g%=y,s.splice(g++,0,w)}return re(s)}function oe(n){var s,c,y,g,w,v,_,R,F,S,T,E=[],x,U,j,K;for(n=te(n),x=n.length,s=A,c=0,w=b,v=0;v<x;++v)T=n[v],T<128&&E.push(G(T));for(y=g=E.length,g&&E.push(L);y<x;){for(_=l,v=0;v<x;++v)T=n[v],T>=s&&T<_&&(_=T);for(U=y+1,_-s>C((l-c)/U)&&M("overflow"),c+=(_-s)*U,s=_,v=0;v<x;++v)if(T=n[v],T<s&&++c>l&&M("overflow"),T==s){for(R=c,F=u;S=F<=w?h:F>=w+d?d:F-w,!(R<S);F+=u)K=R-S,j=u-S,E.push(G(ne(S+K%j,0))),R=C(K/j);E.push(G(ne(R,0))),w=ae(c,U,y==g),c=0,++y}++c,++s}return E.join("")}function Ae(n){return ee(n,function(s){return q.test(s)?se(s.slice(4).toLowerCase()):s})}function Se(n){return ee(n,function(s){return $.test(s)?"xn--"+oe(s):s})}if(f={version:"1.4.1",ucs2:{decode:te,encode:re},decode:se,encode:oe,toASCII:Se,toUnicode:Ae},o&&a)if(t.exports==o)a.exports=f;else for(J in f)f.hasOwnProperty(J)&&(o[J]=f[J]);else e.punycode=f})(Ye)})(B,B.exports)),B.exports}We();var xe=(function(t){function r(){var o=this||self;return delete t.prototype.__magic__,o}if(typeof globalThis=="object")return globalThis;if(this)return r();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:r});var e=__magic__;return e})(Object),Ze=xe.URL;xe.URLSearchParams;var Ke={URL:Ze},O={},N={},Y={},W={},ve;function Pe(){if(ve)return W;ve=1,Object.defineProperty(W,"__esModule",{value:!0}),W.getImplementation=t;function t(r,e){const o=r[e]??globalThis[e];if(!o)throw new ReferenceError(`"${String(e)}" is not defined`);return o}return W}var Te;function Ce(){if(Te)return Y;Te=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.default=e;const t=je(),r=Pe();function e(o={}){const a=(0,r.getImplementation)(o,"Headers");return function(f,l,u,h,d){const p=new a(d),I=String(Date.now()),b=JSON.stringify(h),A=[l.toLowerCase(),u.toLowerCase(),I,b].join(":");let L=0;const q=t.Authenticator.signPayload(f,A);for(const $ of q)p.set(t.AUTH_CHAIN_HEADER_PREFIX+L,JSON.stringify($)),L++;return p.set(t.AUTH_TIMESTAMP_HEADER,I),p.set(t.AUTH_METADATA_HEADER,b),p}}return Y}var me;function we(){if(me)return N;me=1;var t=N&&N.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(N,"__esModule",{value:!0}),N.default=o;const r=t(Ce()),e=Pe();function o(a={}){const i=(0,r.default)(a),f=(0,e.getImplementation)(a,"URL"),l=(0,e.getImplementation)(a,"Request"),u=(0,e.getImplementation)(a,"fetch");return function(d,p){if(p&&p.identity){const{identity:I,metadata:b,...A}=p;if(typeof d=="string"||d instanceof f||globalThis.URL&&d instanceof globalThis.URL){const H=typeof d=="string"?new f(d):d,k=new l(H.toString(),{...A,headers:i(I,p.method||"GET",H.pathname,b||{},A==null?void 0:A.headers)});return u(k)}const L=new f(d.url),q=new l(d);return i(I,d.method||"GET",L.pathname,b||{}).forEach((H,k)=>{q.headers.set(k,H)}),u(q)}return u(d,p)}}return N}var X={},_e;function Xe(){return _e||(_e=1,Object.defineProperty(X,"__esModule",{value:!0})),X}var be;function ze(){return be||(be=1,(function(t){var r=O&&O.__createBinding||(Object.create?(function(l,u,h,d){d===void 0&&(d=h);var p=Object.getOwnPropertyDescriptor(u,h);(!p||("get"in p?!u.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return u[h]}}),Object.defineProperty(l,d,p)}):(function(l,u,h,d){d===void 0&&(d=h),l[d]=u[h]})),e=O&&O.__exportStar||function(l,u){for(var h in l)h!=="default"&&!Object.prototype.hasOwnProperty.call(u,h)&&r(u,l,h)},o=O&&O.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(t,"__esModule",{value:!0}),t.signedHeaderFactory=t.signedFetchFactory=void 0;const a=o(we());e(Xe(),t);var i=we();Object.defineProperty(t,"signedFetchFactory",{enumerable:!0,get:function(){return o(i).default}});var f=Ce();Object.defineProperty(t,"signedHeaderFactory",{enumerable:!0,get:function(){return o(f).default}}),t.default=(0,a.default)()})(O)),O}var Qe=ze();class Ee extends Error{constructor(e,o,a){super(e);m(this,"status");m(this,"data");this.status=o,this.data=a}}const et=3,tt=1e3,rt=[400,401,403,404,409,422],nt=(globalThis==null?void 0:globalThis.URL)??Ke.URL;class at{constructor(r,e){m(this,"baseUrl");m(this,"retries");m(this,"retryDelay");m(this,"nonRetryableStatuses");m(this,"identity");m(this,"sleep",r=>new Promise(e=>{setTimeout(e,r)}));m(this,"getIdentity",()=>this.identity instanceof Function?this.identity():this.identity);m(this,"rawFetch",(r,e)=>{const o=new nt(r,this.baseUrl),a=(e==null?void 0:e.identity)??this.getIdentity();return Qe.signedFetchFactory()(o.toString(),{...e,identity:a})});m(this,"fetch",async(r,e)=>{for(let o=0;o<=this.retries;o++)try{let a,i;try{a=await this.rawFetch(r,e);const f=await a.text();f.length===0?i={ok:!0,data:null}:i=JSON.parse(f)}catch(f){throw new Ee(f.message,void 0,null)}if(!a.ok||i.ok===!1){const f=i.message??i.error;throw new Ee(f??`Request failed with status code ${a.status}`,a.status,i.data)}return i.ok===!0?i.data:i}catch(a){if(console.error(`[API] HTTP request failed: ${a.message||""}`,a),this.retries===o||a.status&&this.nonRetryableStatuses.includes(a.status))throw a;await this.sleep(this.retryDelay)}throw new Error("Unreachable code")});this.baseUrl=r,this.identity=e==null?void 0:e.identity,this.retries=(e==null?void 0:e.retries)??et,this.retryDelay=(e==null?void 0:e.retryDelay)??tt,this.nonRetryableStatuses=(e==null?void 0:e.nonRetryableStatuses)??rt}}class st extends at{constructor(e,o,a){super(o,a);m(this,"signer");m(this,"addTrade",async e=>this.fetch("/v1/trades",{method:"POST",body:JSON.stringify(e),metadata:{signer:this.signer,intent:"dcl:create-trade"},headers:{"Content-Type":"application/json"}}));m(this,"fetchTrade",async e=>this.fetch(`/v1/trades/${e}`,{method:"GET"}));this.signer=e}}class gt{constructor(r,e,o){m(this,"tradesAPI");this.tradesAPI=new st(r,e,{identity:o,retries:0})}async addTrade(r){return this.tradesAPI.addTrade(r)}async fetchTrade(r){return this.tradesAPI.fetchTrade(r)}async accept(r,e){const o=de(r.contract),a=le(o,r.chainId),i=pe(r,e);return ye(a,"accept",[i])}async cancel(r,e){const o=de(r.contract),a=le(o,r.chainId),i=pe(r,e);return ye(a,"cancelSignature",[i])}}export{gt as TradeService};
|
|
2
|
-
//# sourceMappingURL=TradeService-
|
|
1
|
+
var Oe=Object.defineProperty;var Ue=(t,r,e)=>r in t?Oe(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e;var m=(t,r,e)=>Ue(t,typeof r!="symbol"?r+"":r,e);import{W as Ie,a as ie,C as De,B as Le,f as ce}from"./ethers-DVrorjJ1.js";import{a as Me,d as V}from"./dcl-schemas-Do6ePE9M.js";import{c as ue}from"./react-ZT2P9-hV.js";import{cZ as je,L as de,h as le}from"./index-y9tZLe7Z.js";import{c as z,e as qe}from"./index-CZEd2SGy.js";import{s as He}from"./sendMetaTransaction-BcKatlZr.js";import"./sentry-qVQnooqM.js";import"./intl-AKLEHPeO.js";import"./events-CcYNTdVN.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="4e8f0dee-57df-4dbe-9f3f-1b09772d0818",t._sentryDebugIdIdentifier="sentry-dbid-4e8f0dee-57df-4dbe-9f3f-1b09772d0818")}catch{}})();async function Ne(t){const r=await Re();if(r){const e=await new Ie(r).getSigner().getChainId();if(t===e)return r}return z.createProvider(Me.ProviderType.NETWORK,t)}async function Re(){try{return await z.getProvider()}catch{try{const{provider:t}=await z.tryPreviousConnection();return t}catch{return null}}}function fe(t){return Math.floor(t/1e3)}function he(t){switch(t.assetType){case V.TradeAssetType.ERC721:return t.tokenId;case V.TradeAssetType.COLLECTION_ITEM:return t.itemId;case V.TradeAssetType.ERC20:return t.amount;case V.TradeAssetType.USD_PEGGED_MANA:return t.amount;default:return console.error("Invalid asset type:",t),""}}function ke(t){var r;return{checks:{uses:t.checks.uses,expiration:fe(t.checks.expiration),effective:fe(t.checks.effective),salt:ie(t.checks.salt,32),contractSignatureIndex:t.checks.contractSignatureIndex,signerSignatureIndex:t.checks.signerSignatureIndex,allowedRoot:ie(t.checks.allowedRoot,32),externalChecks:(r=t.checks.externalChecks)==null?void 0:r.map(e=>({contractAddress:e.contractAddress,selector:e.selector,value:e.value?e.value:"0x",required:e.required}))},sent:t.sent.map(e=>({assetType:e.assetType,contractAddress:e.contractAddress,value:he(e),extra:e.extra?e.extra:"0x"})),received:t.received.map(e=>({assetType:e.assetType,contractAddress:e.contractAddress,value:he(e),extra:e.extra?e.extra:"0x",beneficiary:e.beneficiary}))}}function pe(t,r){const e=ke(t);return{signer:t.signer,signature:t.signature,...e,checks:{...e.checks,allowedProof:[]},sent:e.sent.map(o=>({...o,beneficiary:r}))}}async function Ge(t){const r=await t.request({method:"eth_chainId",params:[]});let e;return typeof r=="string"?e=parseInt(r,16):e=r,e}async function Be(t){const r=await Ne(t);return new Ie(r)}const D=new qe.EventEmitter;var P;(function(t){t.ERROR="error",t.SUCCESS="success",t.PROMPT="prompt",t.ACCEPT="accept",t.REJECT="reject"})(P||(P={}));let $e="https://transactions-api.decentraland.org/v1";const Je=()=>$e,Ve=()=>new Promise((t,r)=>{const e=()=>{D.removeAllListeners(P.REJECT),t(!0)},o=()=>{D.removeAllListeners(P.ACCEPT),r(new Error("User rejected transaction"))};D.addListener(P.ACCEPT,e),D.addListener(P.REJECT,o)});async function ye(...t){const[r,e,...o]=t;try{const a=await Re();if(!a)throw new Error("Provider not connected");const i=await Ge(a),f=await Be(r.chainId),l=new De(r.address,r.abi,f),u=await(typeof e=="function"?e(l.populateTransaction):l.populateTransaction[e](...o));if(i===r.chainId){const h=f.getSigner();if(a.isMagic||a.isThirdweb){let p=Le.from(0);try{const I=await h.getGasPrice(),b=await h.estimateGas(u);p=I.mul(b)}catch{}if(!p.isZero()){const I=Ve(),b=await h.getBalance();D.emit(P.PROMPT,{transactionGasPrice:ce(p),userBalance:ce(b),chainId:r.chainId}),await I}}const d=await h.sendTransaction(u);return D.emit(P.SUCCESS,{txHash:d.hash}),d.hash}else{const h=await He(a,f,u.data,r,{serverURL:Je()});return D.emit(P.SUCCESS,{txHash:h}),h}}catch(a){const i={type:P.ERROR,error:a};throw D.emit(P.ERROR,i),a}}var B={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var We=B.exports,ge;function Ye(){return ge||(ge=1,(function(t,r){(function(e){var o=r&&!r.nodeType&&r,a=t&&!t.nodeType&&t,i=typeof ue=="object"&&ue;(i.global===i||i.window===i||i.self===i)&&(e=i);var f,l=2147483647,u=36,h=1,d=26,p=38,I=700,b=72,A=128,L="-",q=/^xn--/,$=/[^\x20-\x7E]/,H=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Z=u-h,C=Math.floor,G=String.fromCharCode,J;function M(n){throw new RangeError(k[n])}function Q(n,s){for(var c=n.length,y=[];c--;)y[c]=s(n[c]);return y}function ee(n,s){var c=n.split("@"),y="";c.length>1&&(y=c[0]+"@",n=c[1]),n=n.replace(H,".");var g=n.split("."),w=Q(g,s).join(".");return y+w}function te(n){for(var s=[],c=0,y=n.length,g,w;c<y;)g=n.charCodeAt(c++),g>=55296&&g<=56319&&c<y?(w=n.charCodeAt(c++),(w&64512)==56320?s.push(((g&1023)<<10)+(w&1023)+65536):(s.push(g),c--)):s.push(g);return s}function re(n){return Q(n,function(s){var c="";return s>65535&&(s-=65536,c+=G(s>>>10&1023|55296),s=56320|s&1023),c+=G(s),c}).join("")}function Fe(n){return n-48<10?n-22:n-65<26?n-65:n-97<26?n-97:u}function ne(n,s){return n+22+75*(n<26)-((s!=0)<<5)}function ae(n,s,c){var y=0;for(n=c?C(n/I):n>>1,n+=C(n/s);n>Z*d>>1;y+=u)n=C(n/Z);return C(y+(Z+1)*n/(n+p))}function se(n){var s=[],c=n.length,y,g=0,w=A,v=b,_,R,F,S,T,E,x,U,j;for(_=n.lastIndexOf(L),_<0&&(_=0),R=0;R<_;++R)n.charCodeAt(R)>=128&&M("not-basic"),s.push(n.charCodeAt(R));for(F=_>0?_+1:0;F<c;){for(S=g,T=1,E=u;F>=c&&M("invalid-input"),x=Fe(n.charCodeAt(F++)),(x>=u||x>C((l-g)/T))&&M("overflow"),g+=x*T,U=E<=v?h:E>=v+d?d:E-v,!(x<U);E+=u)j=u-U,T>C(l/j)&&M("overflow"),T*=j;y=s.length+1,v=ae(g-S,y,S==0),C(g/y)>l-w&&M("overflow"),w+=C(g/y),g%=y,s.splice(g++,0,w)}return re(s)}function oe(n){var s,c,y,g,w,v,_,R,F,S,T,E=[],x,U,j,K;for(n=te(n),x=n.length,s=A,c=0,w=b,v=0;v<x;++v)T=n[v],T<128&&E.push(G(T));for(y=g=E.length,g&&E.push(L);y<x;){for(_=l,v=0;v<x;++v)T=n[v],T>=s&&T<_&&(_=T);for(U=y+1,_-s>C((l-c)/U)&&M("overflow"),c+=(_-s)*U,s=_,v=0;v<x;++v)if(T=n[v],T<s&&++c>l&&M("overflow"),T==s){for(R=c,F=u;S=F<=w?h:F>=w+d?d:F-w,!(R<S);F+=u)K=R-S,j=u-S,E.push(G(ne(S+K%j,0))),R=C(K/j);E.push(G(ne(R,0))),w=ae(c,U,y==g),c=0,++y}++c,++s}return E.join("")}function Ae(n){return ee(n,function(s){return q.test(s)?se(s.slice(4).toLowerCase()):s})}function Se(n){return ee(n,function(s){return $.test(s)?"xn--"+oe(s):s})}if(f={version:"1.4.1",ucs2:{decode:te,encode:re},decode:se,encode:oe,toASCII:Se,toUnicode:Ae},o&&a)if(t.exports==o)a.exports=f;else for(J in f)f.hasOwnProperty(J)&&(o[J]=f[J]);else e.punycode=f})(We)})(B,B.exports)),B.exports}Ye();var xe=(function(t){function r(){var o=this||self;return delete t.prototype.__magic__,o}if(typeof globalThis=="object")return globalThis;if(this)return r();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:r});var e=__magic__;return e})(Object),Ze=xe.URL;xe.URLSearchParams;var Ke={URL:Ze},O={},N={},W={},Y={},ve;function Pe(){if(ve)return Y;ve=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.getImplementation=t;function t(r,e){const o=r[e]??globalThis[e];if(!o)throw new ReferenceError(`"${String(e)}" is not defined`);return o}return Y}var Te;function Ce(){if(Te)return W;Te=1,Object.defineProperty(W,"__esModule",{value:!0}),W.default=e;const t=je(),r=Pe();function e(o={}){const a=(0,r.getImplementation)(o,"Headers");return function(f,l,u,h,d){const p=new a(d),I=String(Date.now()),b=JSON.stringify(h),A=[l.toLowerCase(),u.toLowerCase(),I,b].join(":");let L=0;const q=t.Authenticator.signPayload(f,A);for(const $ of q)p.set(t.AUTH_CHAIN_HEADER_PREFIX+L,JSON.stringify($)),L++;return p.set(t.AUTH_TIMESTAMP_HEADER,I),p.set(t.AUTH_METADATA_HEADER,b),p}}return W}var me;function we(){if(me)return N;me=1;var t=N&&N.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(N,"__esModule",{value:!0}),N.default=o;const r=t(Ce()),e=Pe();function o(a={}){const i=(0,r.default)(a),f=(0,e.getImplementation)(a,"URL"),l=(0,e.getImplementation)(a,"Request"),u=(0,e.getImplementation)(a,"fetch");return function(d,p){if(p&&p.identity){const{identity:I,metadata:b,...A}=p;if(typeof d=="string"||d instanceof f||globalThis.URL&&d instanceof globalThis.URL){const H=typeof d=="string"?new f(d):d,k=new l(H.toString(),{...A,headers:i(I,p.method||"GET",H.pathname,b||{},A==null?void 0:A.headers)});return u(k)}const L=new f(d.url),q=new l(d);return i(I,d.method||"GET",L.pathname,b||{}).forEach((H,k)=>{q.headers.set(k,H)}),u(q)}return u(d,p)}}return N}var X={},_e;function Xe(){return _e||(_e=1,Object.defineProperty(X,"__esModule",{value:!0})),X}var be;function ze(){return be||(be=1,(function(t){var r=O&&O.__createBinding||(Object.create?(function(l,u,h,d){d===void 0&&(d=h);var p=Object.getOwnPropertyDescriptor(u,h);(!p||("get"in p?!u.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return u[h]}}),Object.defineProperty(l,d,p)}):(function(l,u,h,d){d===void 0&&(d=h),l[d]=u[h]})),e=O&&O.__exportStar||function(l,u){for(var h in l)h!=="default"&&!Object.prototype.hasOwnProperty.call(u,h)&&r(u,l,h)},o=O&&O.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(t,"__esModule",{value:!0}),t.signedHeaderFactory=t.signedFetchFactory=void 0;const a=o(we());e(Xe(),t);var i=we();Object.defineProperty(t,"signedFetchFactory",{enumerable:!0,get:function(){return o(i).default}});var f=Ce();Object.defineProperty(t,"signedHeaderFactory",{enumerable:!0,get:function(){return o(f).default}}),t.default=(0,a.default)()})(O)),O}var Qe=ze();class Ee extends Error{constructor(e,o,a){super(e);m(this,"status");m(this,"data");this.status=o,this.data=a}}const et=3,tt=1e3,rt=[400,401,403,404,409,422],nt=(globalThis==null?void 0:globalThis.URL)??Ke.URL;class at{constructor(r,e){m(this,"baseUrl");m(this,"retries");m(this,"retryDelay");m(this,"nonRetryableStatuses");m(this,"identity");m(this,"sleep",r=>new Promise(e=>{setTimeout(e,r)}));m(this,"getIdentity",()=>this.identity instanceof Function?this.identity():this.identity);m(this,"rawFetch",(r,e)=>{const o=new nt(r,this.baseUrl),a=(e==null?void 0:e.identity)??this.getIdentity();return Qe.signedFetchFactory()(o.toString(),{...e,identity:a})});m(this,"fetch",async(r,e)=>{for(let o=0;o<=this.retries;o++)try{let a,i;try{a=await this.rawFetch(r,e);const f=await a.text();f.length===0?i={ok:!0,data:null}:i=JSON.parse(f)}catch(f){throw new Ee(f.message,void 0,null)}if(!a.ok||i.ok===!1){const f=i.message??i.error;throw new Ee(f??`Request failed with status code ${a.status}`,a.status,i.data)}return i.ok===!0?i.data:i}catch(a){if(console.error(`[API] HTTP request failed: ${a.message||""}`,a),this.retries===o||a.status&&this.nonRetryableStatuses.includes(a.status))throw a;await this.sleep(this.retryDelay)}throw new Error("Unreachable code")});this.baseUrl=r,this.identity=e==null?void 0:e.identity,this.retries=(e==null?void 0:e.retries)??et,this.retryDelay=(e==null?void 0:e.retryDelay)??tt,this.nonRetryableStatuses=(e==null?void 0:e.nonRetryableStatuses)??rt}}class st extends at{constructor(e,o,a){super(o,a);m(this,"signer");m(this,"addTrade",async e=>this.fetch("/v1/trades",{method:"POST",body:JSON.stringify(e),metadata:{signer:this.signer,intent:"dcl:create-trade"},headers:{"Content-Type":"application/json"}}));m(this,"fetchTrade",async e=>this.fetch(`/v1/trades/${e}`,{method:"GET"}));this.signer=e}}class gt{constructor(r,e,o){m(this,"tradesAPI");this.tradesAPI=new st(r,e,{identity:o,retries:0})}async addTrade(r){return this.tradesAPI.addTrade(r)}async fetchTrade(r){return this.tradesAPI.fetchTrade(r)}async accept(r,e){const o=de(r.contract),a=le(o,r.chainId),i=pe(r,e);return ye(a,"accept",[i])}async cancel(r,e){const o=de(r.contract),a=le(o,r.chainId),i=pe(r,e);return ye(a,"cancelSignature",[i])}}export{gt as TradeService};
|
|
2
|
+
//# sourceMappingURL=TradeService-D2dJeuos.js.map
|