@dcl/shop 1.14.1-35731809173.commit-aacaccc → 1.14.1-35732774937.commit-d3acaab
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-BfwfgGnZ.js → Activity-BZTNf3ED.js} +7 -7
- package/_assets/{AnimatedBackground-DyESN2EF.js → AnimatedBackground-DNRoFPGp.js} +6 -6
- package/_assets/{Assets-CCqVPM9r.js → Assets-DtiZKwuT.js} +13 -13
- package/_assets/{Cart-CUaOl7By.js → Cart-l6NqHo0s.js} +2 -2
- package/_assets/{Collection-BxtI6x1r.js → Collection-Bt6A0KQ6.js} +6 -6
- package/_assets/{CollectionCarousel-B6ArqOAS.js → CollectionCarousel-D77ErPU2.js} +7 -7
- package/_assets/Confetti-RxABTwh2.js +18 -0
- package/_assets/{ConstantsUtil-DExs3a1x.js → ConstantsUtil-BE1palmA.js} +2 -2
- package/_assets/{ContentClient-BMmckfUm.js → ContentClient-B-9RcYaE.js} +2 -2
- package/_assets/{Creator-2EgxZy08.js → Creator-CereCprD.js} +9 -9
- package/_assets/{CreditPackPicker-CeZveWAG.js → CreditPackPicker-0WOrhrpS.js} +2 -2
- package/_assets/{DeploymentBuilder-B2obmhxl.js → DeploymentBuilder-Ce32CCQF.js} +3 -3
- package/_assets/{EmotePlaybackBar-SSBx53aR.js → EmotePlaybackBar-0NCN1NCU.js} +19 -19
- package/_assets/{ErrorNotice-DesrOehz.js → ErrorNotice-Cy86Y-Xz.js} +2 -2
- package/_assets/{Event-DAbN9OIZ.js → Event-BneJnOKG.js} +7 -7
- package/_assets/{ExchangeController-CY68JvcO.js → ExchangeController-C0AZT23t.js} +2 -2
- package/_assets/{Faq-B02SfIQG.js → Faq-DepI4S0n.js} +2 -2
- package/_assets/Filters-D5CUPglE.js +823 -0
- package/_assets/{GetCredits-Ct32lqFb.js → GetCredits-4uW6NXh_.js} +2 -2
- package/_assets/{Grow-DBgNwlTm.js → Grow-BF6Dfobl.js} +2 -2
- package/_assets/{HelpersUtil-D-BCuO3u.js → HelpersUtil-Cm_oBcwa.js} +4 -4
- package/_assets/{ItemDetail-BY5OJrUh.js → ItemDetail-Co-8bNBU.js} +15 -15
- package/_assets/{LoadMore-CuRa22jR.js → LoadMore-B1h9Iiw8.js} +2 -2
- package/_assets/{ManaPricingBanner.styles-CyIPwTGY.js → ManaPricingBanner.styles-BIM5H81_.js} +2 -2
- package/_assets/{MyAssets-BeFh58qL.js → MyAssets-Ausqi6ZK.js} +8 -8
- package/_assets/{MyFavorites-Do9g3YfI.js → MyFavorites-mo7wjv-d.js} +3 -3
- package/_assets/{MyStore-CgKB15fb.js → MyStore-CmWYy0qd.js} +2 -2
- package/_assets/{NetworkUtil-BcliLUUF.js → NetworkUtil--zruk36r.js} +2 -2
- package/_assets/{NotFound-Ch1p876j.js → NotFound-xsSZvF06.js} +2 -2
- package/_assets/{NotificationsBell-eGhl5PiH.js → NotificationsBell-Br1kFnCO.js} +2 -2
- package/_assets/{OutfitDetail-BdiYEIG1.js → OutfitDetail-tsulPy0c.js} +2 -2
- package/_assets/OutfitPreview-BXtUfdS-.js +7 -0
- package/_assets/{OutfitStudio-B_21DHCU.js → OutfitStudio-Dec9gxoZ.js} +2 -2
- package/_assets/{PaymentMethodStep-B4zFfOAs.js → PaymentMethodStep-ClTG31Bm.js} +5 -5
- package/_assets/{PhArrowCircleDown-BgP2jbf5.js → PhArrowCircleDown-oZRgIV6I.js} +3 -3
- package/_assets/{PhArrowClockwise-CuNU0iSl.js → PhArrowClockwise-D6H6uB8s.js} +2 -2
- package/_assets/{PhArrowDown-BrLks3Uz.js → PhArrowDown-CRBvhObC.js} +4 -4
- package/_assets/{PhArrowLeft-BbZGSN_s.js → PhArrowLeft-iC7ALVz_.js} +5 -5
- package/_assets/{PhArrowRight-DqLi6_uj.js → PhArrowRight-BMhSphsR.js} +4 -4
- package/_assets/{PhArrowSquareOut-CX0ZRgNC.js → PhArrowSquareOut-BGOFtcYV.js} +4 -4
- package/_assets/{PhArrowUp-D9ugstgK.js → PhArrowUp-DaOakyLF.js} +3 -3
- package/_assets/{PhArrowUpRight-Bpfn12eW.js → PhArrowUpRight-Dv-X4w2R.js} +4 -4
- package/_assets/{PhArrowsClockwise-CRZyQVpN.js → PhArrowsClockwise-DnI7mFlV.js} +4 -4
- package/_assets/{PhArrowsDownUp-CV1NqVLb.js → PhArrowsDownUp-BT1rp80C.js} +4 -4
- package/_assets/{PhArrowsLeftRight-DvGI6Nto.js → PhArrowsLeftRight-3JEyJt0N.js} +5 -5
- package/_assets/{PhBank-BRxdKSKq.js → PhBank-DlTySila.js} +5 -5
- package/_assets/{PhBrowser-C_wNKcTe.js → PhBrowser-CxUZLRbi.js} +5 -5
- package/_assets/PhCaretDown-Co8viBJv.js +15 -0
- package/_assets/{PhCaretLeft-Cad__LUx.js → PhCaretLeft-ScH02zvv.js} +3 -3
- package/_assets/{PhCaretRight-CuRYBcM2.js → PhCaretRight-CG-ZCjvT.js} +3 -3
- package/_assets/PhCaretUp-SXVNZaJo.js +15 -0
- package/_assets/{PhCheck-y4MOxgof.js → PhCheck-DETGkRRi.js} +5 -5
- package/_assets/{PhCircleHalf-xlPKmtS7.js → PhCircleHalf-BN36Nweh.js} +4 -4
- package/_assets/{PhClock-BBNMhMKw.js → PhClock-DPd3K2DL.js} +4 -4
- package/_assets/{PhCompass-DpAl_LfZ.js → PhCompass-F0g-SfuH.js} +5 -5
- package/_assets/{PhCopy-D4HwCqa2.js → PhCopy-CzpD7rrG.js} +5 -5
- package/_assets/{PhCreditCard-CD12JEEL.js → PhCreditCard-NnI7YcNP.js} +3 -3
- package/_assets/{PhCurrencyDollar-DPFX6nyR.js → PhCurrencyDollar-Bst29vzW.js} +2 -2
- package/_assets/{PhDesktop-CNhh70Hf.js → PhDesktop-CFSSNEkS.js} +3 -3
- package/_assets/{PhDeviceMobile-DQgHhtB0.js → PhDeviceMobile-Dd2ijltg.js} +5 -5
- package/_assets/{PhDotsThree-B1gOaArE.js → PhDotsThree-CI5y9TIg.js} +4 -4
- package/_assets/{PhEnvelope-CGnM9AiA.js → PhEnvelope-DrQ5vbHf.js} +4 -4
- package/_assets/{PhFunnelSimple-D8YZwX53.js → PhFunnelSimple-CI4FOzkp.js} +4 -4
- package/_assets/{PhGlobe-CXtg_GcB.js → PhGlobe-DR2SpSWA.js} +4 -4
- package/_assets/{PhIdentificationCard-oMtubY4C.js → PhIdentificationCard-5YfSRHO7.js} +3 -3
- package/_assets/{PhImage-DKp6-EHn.js → PhImage-D7dVXxCI.js} +2 -2
- package/_assets/{PhInfo-CPd-HNhu.js → PhInfo-DNTh1xhU.js} +5 -5
- package/_assets/{PhLightbulb-C47afrxR.js → PhLightbulb-BfCndXXI.js} +5 -5
- package/_assets/{PhMagnifyingGlass-DBaqb5ff.js → PhMagnifyingGlass-DB41rFTM.js} +2 -2
- package/_assets/{PhPaperPlaneRight-FQGhQUrW.js → PhPaperPlaneRight-D6oxeO8G.js} +4 -4
- package/_assets/{PhPlus-B_CxFvZS.js → PhPlus-B90Q_jSC.js} +4 -4
- package/_assets/{PhPower-DRTSLLeY.js → PhPower-B3OeVFPP.js} +4 -4
- package/_assets/{PhPuzzlePiece-zlHiPdqx.js → PhPuzzlePiece-DMvneE8o.js} +4 -4
- package/_assets/{PhQrCode-riEgpq80.js → PhQrCode-B1ogONq9.js} +4 -4
- package/_assets/{PhQuestion-DHYK7o0G.js → PhQuestion-BGPtjzO3.js} +3 -3
- package/_assets/{PhQuestionMark-ZgOsaVvK.js → PhQuestionMark-Bx5KlE6e.js} +4 -4
- package/_assets/{PhSealCheck-B5VE_9Jt.js → PhSealCheck-kDiKrn8v.js} +3 -3
- package/_assets/{PhSignOut-DKQOfDHS.js → PhSignOut-C40w8abk.js} +4 -4
- package/_assets/{PhSpinner-B3k7aAJt.js → PhSpinner-BnCR7oBU.js} +4 -4
- package/_assets/{PhTrash-CD2fhMLB.js → PhTrash-Dx6EnoNj.js} +3 -3
- package/_assets/{PhUser-BeKUoVY6.js → PhUser-BMrVwUFx.js} +2 -2
- package/_assets/{PhVault-DC9QjU0-.js → PhVault-CJhJgRMl.js} +5 -5
- package/_assets/{PhWallet-djswo-CG.js → PhWallet-DUAwnObx.js} +3 -3
- package/_assets/{PhWarning-B4g8NvcF.js → PhWarning-DQNslokT.js} +4 -4
- package/_assets/{PhWarningCircle-xLZ7sbu0.js → PhWarningCircle-p1EFi5p4.js} +5 -5
- package/_assets/{PhX-BVzMqBjL.js → PhX-cY2Ff_Gl.js} +5 -5
- package/_assets/{SaleCountdown-BhwRjP1h.js → SaleCountdown-UAlrMSbY.js} +2 -2
- package/_assets/{Spinner-BZ4nkWND.js → Spinner-BFANB0CL.js} +2 -2
- package/_assets/{StoreSettings-CfBQz8QV.js → StoreSettings-B8w_IYAP.js} +2 -2
- package/_assets/{Success-Cm7UIruT.js → Success-Om4EVqe8.js} +2 -2
- package/_assets/{SwapController-Cj2caX_A.js → SwapController-ZTw9N09i.js} +2 -2
- package/_assets/{Tooltip-CAbr028E.js → Tooltip-3YnG1Umc.js} +2 -2
- package/_assets/{TradeService-BFd6IthP.js → TradeService-DsJF_Ykz.js} +2 -2
- package/_assets/{W3MFrameProviderSingleton-BJ4K_qd6.js → W3MFrameProviderSingleton-C9yMX-9L.js} +4 -4
- package/_assets/{WebCryptoP256-udCoUFid.js → WebCryptoP256-DyFevMsm.js} +2 -2
- package/_assets/{add-C46RTTNX.js → add-WhTS4Lmx.js} +3 -3
- package/_assets/{all-wallets-byTNDEq1.js → all-wallets-BjG4VftA.js} +2 -2
- package/_assets/{app-store-CaKIhI-8.js → app-store-BU7T42Cx.js} +2 -2
- package/_assets/{apple-DAMB_3Lk.js → apple-CawmhmSa.js} +3 -3
- package/_assets/{arrow-bottom-Cx66u8_t.js → arrow-bottom-CnNmrvB7.js} +2 -2
- package/_assets/{arrow-bottom-circle-Bv2eZVEF.js → arrow-bottom-circle-4Fk8ZSin.js} +2 -2
- package/_assets/{arrow-left-D0I0JXz4.js → arrow-left-CfMYQlcz.js} +3 -3
- package/_assets/arrow-right-QKHuTr9a.js +9 -0
- package/_assets/{arrow-top-uM_hNW8Z.js → arrow-top-B19eH9mc.js} +3 -3
- package/_assets/{async-directive-CeCQAQEH.js → async-directive-BTrBVINo.js} +4 -4
- package/_assets/{bank-CQUOEuRq.js → bank-CvCwnNxT.js} +2 -2
- package/_assets/{basic-B6XNAYD-.js → basic-QP6P-QFr.js} +2 -2
- package/_assets/{biconomy-MypCEtqM.js → biconomy-Cl4k6pus.js} +2 -2
- package/_assets/{browseLayout.styles-Dphi8OG5.js → browseLayout.styles-CtEXdyi5.js} +2 -2
- package/_assets/{browser-DHokOE3q.js → browser-C3Fk6SGT.js} +2 -2
- package/_assets/{browser-Bh67F6hL.js → browser-D_6XKzYg.js} +3 -3
- package/_assets/{browser-ByH7jhVr.js → browser-DgDyU9Dd.js} +2 -2
- package/_assets/{browser-ponyfill-D-42_L0r.js → browser-ponyfill-BoW4KA9T.js} +2 -2
- package/_assets/buy-BWL_MsWZ.js +2 -0
- package/_assets/{buy-gasless-j60oO94R.js → buy-gasless-B_R3acE2.js} +2 -2
- package/_assets/{card-DcQ1wkCr.js → card-Bs7vF3ws.js} +2 -2
- package/_assets/{cart-checkout-DkfOoncV.js → cart-checkout-BVJkagSM.js} +2 -2
- package/_assets/{ccip-BoU8UHEb.js → ccip-CEBv1Njx.js} +2 -2
- package/_assets/{ccip-CoDzUnzp.js → ccip-CGRe8tZG.js} +2 -2
- package/_assets/{chains-Bez_lzzX.js → chains-C63N96dR.js} +2 -2
- package/_assets/{checkmark-bold-B-Sg0XJy.js → checkmark-bold-CwL3zpGi.js} +3 -3
- package/_assets/{checkmark-GDL9YfL4.js → checkmark-e3BzxNSm.js} +2 -2
- package/_assets/chevron-bottom-DVpGPQvJ.js +9 -0
- package/_assets/chevron-left-CSISn9Tl.js +9 -0
- package/_assets/chevron-right-D0n7Onzs.js +9 -0
- package/_assets/chevron-top-BSRcfV5m.js +9 -0
- package/_assets/{chrome-store-s39Q_LJM.js → chrome-store-B9E5S_r1.js} +3 -3
- package/_assets/{class-map-BxMzgOIb.js → class-map-BaReYv7k.js} +5 -5
- package/_assets/{clock-DmJj-grN.js → clock-98t-BkG5.js} +2 -2
- package/_assets/close-BnCucYZG.js +9 -0
- package/_assets/{coinPlaceholder-VDdmV3rm.js → coinPlaceholder-rH-MsidA.js} +2 -2
- package/_assets/collectionPage.styles-CJfCc8Bm.js +41 -0
- package/_assets/common-BHGUItcH.js +2 -0
- package/_assets/{compass-O2jaVbub.js → compass-C4iPyfoB.js} +3 -3
- package/_assets/{controller-kSBOJbso.js → controller-dcPPx0Ve.js} +3 -3
- package/_assets/{copy-D2eE3KCY.js → copy-Db_EXK-k.js} +3 -3
- package/_assets/{core-Blrzs_6J.js → core-2kgw2Lk6.js} +5 -5
- package/_assets/{createSvgIcon-DF-M8wxO.js → createSvgIcon-e9fnpKTy.js} +4 -4
- package/_assets/{crumbs.styles-GdG1_iLJ.js → crumbs.styles-FoTSTGkC.js} +2 -2
- package/_assets/{cursor-DSrN7SuI.js → cursor-BLyA32Y6.js} +3 -3
- package/_assets/{cursor-transparent-DxuBEx9O.js → cursor-transparent-is8_6H5o.js} +2 -2
- package/_assets/{custom-xAOpfUeg.js → custom-CEirqsrc.js} +2 -2
- package/_assets/{data-capture-DCIbfyfD.js → data-capture-Bp0k2Qg7.js} +2 -2
- package/_assets/{dcl-schemas-C-x6e7cM.js → dcl-schemas-BrVwEqiU.js} +2 -2
- package/_assets/decimals-Ds-cKzq0.js +2 -0
- package/_assets/decimals-UDFlnnNN.js +2 -0
- package/_assets/{desktop-DwZtv9fm.js → desktop-w7YXG_JM.js} +2 -2
- package/_assets/detectExtension-CPLy90w2.js +2 -0
- package/_assets/{disconnect-BbwiqFJ2.js → disconnect-BoVeWInH.js} +3 -3
- package/_assets/{discord-qWAUKbRO.js → discord-CmXuPXeB.js} +3 -3
- package/_assets/{disposePreview-PaXb_9Av.js → disposePreview-TOHrr3Cv.js} +2 -2
- package/_assets/{email-BkQgEiQT.js → email-C8BApZt1.js} +4 -4
- package/_assets/{embedded-wallet-RCPBf8aK.js → embedded-wallet-D6ovY2Wr.js} +2 -2
- package/_assets/{emotion-styled.browser.esm-FOc3Pbci.js → emotion-styled.browser.esm-23GGtyp0.js} +2 -2
- package/_assets/{engine-DRvawz3n.js → engine-C_hk_rjg.js} +2 -2
- package/_assets/{errors-DRLtkokf.js → errors-DLcrG7wZ.js} +2 -2
- package/_assets/estimate-l1-fee-8JBCStoR.js +2 -0
- package/_assets/eth_estimateGas-D5LOgdsb.js +2 -0
- package/_assets/eth_getStorageAt-Cgm8eZeC.js +2 -0
- package/_assets/eth_getTransactionCount-DT1wQUYG.js +2 -0
- package/_assets/ethereum-B6_NCD8u.js +2 -0
- package/_assets/{ethers-BCdPj9kp.js → ethers-DCYs0L1t.js} +2 -2
- package/_assets/{etherscan-TUQ32gbU.js → etherscan-C6oDVSRT.js} +2 -2
- package/_assets/{events-BW5Jz76D.js → events-Ch5mkuEv.js} +2 -2
- package/_assets/{exclamation-triangle-ETkxexlo.js → exclamation-triangle-DeoEkpAd.js} +2 -2
- package/_assets/{execute-yCOq6Ata.js → execute-DaSSKs0J.js} +3 -3
- package/_assets/{extension-DoOVmXmT.js → extension-BC4u9PFt.js} +3 -3
- package/_assets/external-link-D1_8iC7n.js +9 -0
- package/_assets/{extractIPFS-CbHGXyvP.js → extractIPFS-D_yHf9NQ.js} +2 -2
- package/_assets/{facebook-BmPLPVaB.js → facebook-BfvFcXpk.js} +3 -3
- package/_assets/{farcaster-BLIAglQl.js → farcaster-DBSK9Oxt.js} +2 -2
- package/_assets/{features-T8-LWfbN.js → features-Ct4xvFci.js} +2 -2
- package/_assets/{fetchTokenMetadata-AjC8OtFM.js → fetchTokenMetadata-C5CN7SwU.js} +3 -3
- package/_assets/{field.styles-D44TP7jS.js → field.styles-D3oougzk.js} +2 -2
- package/_assets/{filters-DWaFeZ95.js → filters-Bx7yqePJ.js} +3 -3
- package/_assets/{fortmatic-CuiQPJMC.js → fortmatic-CErSY4Uv.js} +2 -2
- package/_assets/{get-bytecode-CJfB4Pzr.js → get-bytecode-OECsahsT.js} +2 -2
- package/_assets/get-ecosystem-wallet-info-CqmMi93Y.js +2 -0
- package/_assets/{getBalance-DzGXIMnz.js → getBalance-Dk_y5JwY.js} +3 -3
- package/_assets/{getInstalledModules-DtRANZuN.js → getInstalledModules-BylSc8z2.js} +2 -2
- package/_assets/getNFT-CuRxwrU7.js +2 -0
- package/_assets/{getNFT-NWLH5sUg.js → getNFT-Dp_tiNuN.js} +3 -3
- package/_assets/{github-BiA5cQMJ.js → github-Bir9JlcK.js} +3 -3
- package/_assets/{google-CsF9xgle.js → google-BlkSyDA4.js} +3 -3
- package/_assets/{grid.styles-B_SYfKbL.js → grid.styles-B48spjFg.js} +2 -2
- package/_assets/{hashTypedData-BhIEfUI7.js → hashTypedData-dqSfQDie.js} +2 -2
- package/_assets/{hashTypedData-rczDkChp.js → hashTypedData-lGvaI2cA.js} +2 -2
- package/_assets/{help-circle-Bwgxn3Vn.js → help-circle-DA-n1pkO.js} +3 -3
- package/_assets/{id-O5raZ1NS.js → id-UrGKP3rm.js} +2 -2
- package/_assets/{image-CbhOQpP5.js → image-D3PTNca-.js} +2 -2
- package/_assets/{import-DxM1FBAo.js → import-D_YdksPc.js} +2 -2
- package/_assets/{in-app-C05LybrX.js → in-app-DU1izobx.js} +2 -2
- package/_assets/{in-app-wallet-calls-bMCEqdh8.js → in-app-wallet-calls-DiaCxPlO.js} +2 -2
- package/_assets/{index-Bvltq2nA.js → index-321qoCaJ.js} +3 -3
- package/_assets/{index-C0x3zH9F.js → index-8oCEOyw8.js} +4 -4
- package/_assets/{index-XGfjQWLd.js → index-9tO9OUL8.js} +4 -4
- package/_assets/{index-vtfDF7Ts.js → index-B-uF7wnK.js} +4 -4
- package/_assets/{index-bSR15ZuH.js → index-B1Lhr0k2.js} +4 -4
- package/_assets/{index-haBkL6Jh.js → index-B74ZvCCg.js} +2 -2
- package/_assets/{index-Bh-VtU9r.js → index-B7d2X751.js} +2 -2
- package/_assets/{index-C6wJcQNp.js → index-BFDlm927.js} +6 -6
- package/_assets/{index-BjYDAZbE.js → index-BFEMM3r4.js} +2 -2
- package/_assets/{index-Cef-wgOf.js → index-BK_57ve_.js} +7 -7
- package/_assets/{index-DIsgwwY8.js → index-BLD4vnX6.js} +3 -3
- package/_assets/{index-OmDH9Dts.js → index-BLdvJib1.js} +4 -4
- package/_assets/{index-CvY4gY5a.js → index-BNpv0X7m.js} +2 -2
- package/_assets/{index-BtB2k6Sc.js → index-BSWBAMJf.js} +4 -4
- package/_assets/{index-Cklgk0Q_.js → index-BU6ORwL6.js} +2 -2
- package/_assets/{index-DNTfnlfv.js → index-B_ay8jUy.js} +2 -2
- package/_assets/{index-BdFqn3Yn.js → index-Bgm4jxY7.js} +2 -2
- package/_assets/index-BjCx26RW.js +2 -0
- package/_assets/{index-BSBKG4BK.js → index-BjR4exTy.js} +2 -2
- package/_assets/{index-DVBgBIet.js → index-BkdttjkH.js} +3 -3
- package/_assets/{index-CnpBhsd4.js → index-Bm5Ji_b0.js} +2 -2
- package/_assets/index-Bwnkxm_G.js +2 -0
- package/_assets/{index-DspOR9s6.css → index-C7QbaZbm.css} +1 -1
- package/_assets/{index-CL5nbX5c.js → index-CBinTZ0C.js} +4 -4
- package/_assets/{index-IPbQf9uE.js → index-CDILsv8-.js} +2 -2
- package/_assets/{index-D-BFaWfQ.js → index-CDLP4B0L.js} +2 -2
- package/_assets/{index-C3LqEUSB.js → index-CHdO5uMl.js} +2 -2
- package/_assets/{index-BOAQ-AOx.js → index-CI34Z_Me.js} +4 -4
- package/_assets/{index-B75sAX61.js → index-CISfbcGB.js} +2 -2
- package/_assets/{index-CTIQcWvi.js → index-CKqGOSZn.js} +2 -2
- package/_assets/{index-CKlbOc6k.js → index-CNpOtENF.js} +2 -2
- package/_assets/{index-XW-WjpVU.js → index-CR-T5X-D.js} +2 -2
- package/_assets/{index-Dt3IB23c.js → index-CWqd1Q-2.js} +4 -4
- package/_assets/{index-i3P0mRh0.js → index-ChMvb_7n.js} +3 -3
- package/_assets/{index-Dj3u_bYz.js → index-ChWki13j.js} +3 -3
- package/_assets/{index-DcxUlEAC.js → index-CoDvZdaf.js} +2 -2
- package/_assets/{index-xq9CDVcw.js → index-CoWn_g-I.js} +2 -2
- package/_assets/{index-Dfxis0Cp.js → index-CyqRAr8s.js} +3 -3
- package/_assets/{index-CJrZiV6S.js → index-D-Xi6X4E.js} +2 -2
- package/_assets/{index-CXZXpnbw.js → index-D4oDLJRO.js} +2 -2
- package/_assets/{index-DpDO-WIV.js → index-D5Dn5XcC.js} +2 -2
- package/_assets/{index-DoJLnq5q.js → index-DPROz7TD.js} +5 -5
- package/_assets/index-DRRXfH5T.js +4427 -0
- package/_assets/{index-9DzhsG7M.js → index-DSOAGIi2.js} +2 -2
- package/_assets/{index-CnCQLaFO.js → index-DTL7FTYv.js} +3 -3
- package/_assets/{index-CpaD9gAl.js → index-Dc_G5PEm.js} +4 -4
- package/_assets/{index-BZxPU8KF.js → index-Dilxq7oL.js} +2 -2
- package/_assets/{index-4Qt6beZq.js → index-DkxhLfIJ.js} +2 -2
- package/_assets/{index-BM_pyFwk.js → index-DviRrMz0.js} +3 -3
- package/_assets/{index-DkUIro3E.js → index-Ftq_Qf7i.js} +4 -4
- package/_assets/{index-BNfBKfYg.js → index-HyKwngHl.js} +2 -2
- package/_assets/{index-DHNyauFt.js → index-Iw0YFMKl.js} +3 -3
- package/_assets/{index-CA8Fetyr.js → index-PkbXbgtC.js} +2 -2
- package/_assets/{index-CCxkv-Xn.js → index-Q-4A0N-Q.js} +2 -2
- package/_assets/{index-B1mRJj2N.js → index-QqOA5noN.js} +3 -3
- package/_assets/{index-CtyYd7Um.js → index-TZtT5-BX.js} +4 -4
- package/_assets/{index-BSS0zxeU.js → index-X7xVeMYf.js} +2 -2
- package/_assets/{index-DFk23JOU.js → index-XHl9TuTe.js} +3 -3
- package/_assets/{index-axxJtz4m.js → index-g7FUnJSt.js} +2 -2
- package/_assets/{index-CTA3vGDF.js → index-i_5nPW9n.js} +3 -3
- package/_assets/{index-CcbkD4de.js → index-ivtc1-Fk.js} +6 -6
- package/_assets/{index-BGx4_qmh.js → index-k1I1IsHl.js} +2 -2
- package/_assets/{index-BIzT-wv6.js → index-mrYOkuEY.js} +2 -2
- package/_assets/{index-CZX2hdSu.js → index-pgYwCuWG.js} +4 -4
- package/_assets/{index-Wd8TOb4J.js → index-qDty1LWz.js} +7 -7
- package/_assets/{index-BSr5uLjJ.js → index-xbkHs3zO.js} +6 -6
- package/_assets/{index-CiYRBiPA.js → index-y6pnI6yF.js} +2 -2
- package/_assets/{index-B5TeKkvi.js → index-z3v0I-ct.js} +2 -2
- package/_assets/{index.es-E4aqsh4a.js → index.es-CYcra466.js} +2 -2
- package/_assets/{index.es-DuewOYzm.js → index.es-Cd9yo4Tm.js} +5 -5
- package/_assets/{index.es-UW_qEtkd.js → index.es-CnHlKMhK.js} +2 -2
- package/_assets/{index.es-B5TTyCeq.js → index.es-ywQflMXQ.js} +2 -2
- package/_assets/{info-B91xCNqh.js → info-Dsmi8VWW.js} +3 -3
- package/_assets/info-circle-CppZa7vK.js +13 -0
- package/_assets/{items-empty-CiUgWrW2.js → items-empty-BBmu43Y2.js} +2 -2
- package/_assets/jsxRuntime.module-Q9HBaTr-.js +2 -0
- package/_assets/{jump-Bbjw5Lcv.js → jump-B8xqzDZo.js} +2 -2
- package/_assets/{lightbulb-ByedgZqO.js → lightbulb-B2s8QgKQ.js} +3 -3
- package/_assets/{linkAccount-DRoKpQ9o.js → linkAccount-BykZ_J6_.js} +2 -2
- package/_assets/{localBatchGatewayRequest-Wcu6xC6M.js → localBatchGatewayRequest-BMZWtkh-.js} +2 -2
- package/_assets/{mail-B2wBPliw.js → mail-CZ9ghbH-.js} +2 -2
- package/_assets/{mobile-COGIkuHo.js → mobile-D7KL87qI.js} +2 -2
- package/_assets/{modal.styles-DD97ixMS.js → modal.styles-Ah3BFwcL.js} +2 -2
- package/_assets/{more-zcriamqw.js → more-C1vsI2Vu.js} +2 -2
- package/_assets/{native-DfHseqH2.js → native-Dp-2t67a.js} +2 -2
- package/_assets/{network-placeholder-Cm-6akxX.js → network-placeholder-C6sglFRh.js} +2 -2
- package/_assets/{networks-CyyUaA0n.js → networks-9u6DsbLw.js} +2 -2
- package/_assets/{nftPlaceholder-vZdYCYRL.js → nftPlaceholder-ByX0V9oA.js} +2 -2
- package/_assets/off-B5vm0egN.js +9 -0
- package/_assets/{onramp-DJvJnLIF.js → onramp-DbbdvE9l.js} +2 -2
- package/_assets/openzeppelin-D69GD3Fm.js +2 -0
- package/_assets/ownerOf-B2KKjyzm.js +2 -0
- package/_assets/parseNft-B4me14YE.js +3 -0
- package/_assets/{parseSignature-y_E043E5.js → parseSignature-CxQObnnK.js} +4 -4
- package/_assets/{parseSignature-BMymJPfi.js → parseSignature-cCpQ1EW_.js} +2 -2
- package/_assets/{passkeys-Bm5mQQf5.js → passkeys-xdBGznn1.js} +2 -2
- package/_assets/{pay-with-exchange-D7LRHkOW.js → pay-with-exchange-BDhbjftO.js} +2 -2
- package/_assets/{play-store-CAbJYmXD.js → play-store-BBusJ15a.js} +2 -2
- package/_assets/{plus-DWQF9t2p.js → plus-QdPNUgRE.js} +3 -3
- package/_assets/{prepare-contract-call-BGUyrJWh.js → prepare-contract-call-CITzhkar.js} +2 -2
- package/_assets/{qr-code-Br4VphwV.js → qr-code-SdYLFk2z.js} +2 -2
- package/_assets/{qr-overlay-xvc2Siyo.js → qr-overlay-BZbZx8jf.js} +6 -6
- package/_assets/{react-EC0gZ8rD.js → react-ChceODIJ.js} +2 -2
- package/_assets/{receive-BKmPKIld.js → receive-DhIBZE4X.js} +2 -2
- package/_assets/{recycle-horizontal-DdAImjTL.js → recycle-horizontal-SCXYOpJq.js} +3 -3
- package/_assets/{ref-D90CCjlU.js → ref-DRxYb1N1.js} +2 -2
- package/_assets/{refresh-S-H2nzPq.js → refresh-eticwJ3S.js} +2 -2
- package/_assets/{reown-logo-D5L2QY4i.js → reown-logo-C2dHPSrm.js} +3 -3
- package/_assets/{resolveImplementation-B5jGshNo.js → resolveImplementation-C1gKzDiQ.js} +2 -2
- package/_assets/{resume-buy-C9f4_CsR.js → resume-buy-C5UXHP38.js} +2 -2
- package/_assets/{resume-name-WleboE2d.js → resume-name-DQBwW7EF.js} +2 -2
- package/_assets/{rpc-BgsGkh8A.js → rpc-DNG3H7ru.js} +2 -2
- package/_assets/{sales-empty-Dml0vN-8.js → sales-empty-CgfqOXUC.js} +2 -2
- package/_assets/{search-f6j421fJ.js → search-CeQ1H1CU.js} +3 -3
- package/_assets/{search-empty-D5DLeEKI.js → search-empty-CfGYFUfS.js} +2 -2
- package/_assets/{secp256k1-3rzIZApQ.js → secp256k1-AJ3c8h0I.js} +2 -2
- package/_assets/{secp256k1-Cb_GjQmJ.js → secp256k1-B9h6m4IX.js} +2 -2
- package/_assets/{secp256k1-BkBwlPf4.js → secp256k1-CXECCrXG.js} +2 -2
- package/_assets/{send-BAUrBF6z.js → send-Bo03Ql2I.js} +3 -3
- package/_assets/send-batch-transaction-BXWSdFaa.js +2 -0
- package/_assets/{send-eip712-transaction-CG-h2X9a.js → send-eip712-transaction-BQGBgvcc.js} +3 -3
- package/_assets/send-gasless-transaction-BeHePqFn.js +3 -0
- package/_assets/{send-DJYzWVMk.js → send-rDZTy53I.js} +2 -2
- package/_assets/send-transaction-Bhl38AZl.js +3 -0
- package/_assets/{sendMetaTransaction-C6Nhv1ek.js → sendMetaTransaction-du2nxyMF.js} +2 -2
- package/_assets/{sendRawTransaction-mjINd6AT.js → sendRawTransaction--ZySriEz.js} +4 -4
- package/_assets/{sentry-Cb74VndH.js → sentry-DoDOB8I2.js} +3 -3
- package/_assets/{serializeTransaction-JhftRTwj.js → serializeTransaction-BlKQ-BiD.js} +2 -2
- package/_assets/{session-proposal-CjaKL53H.js → session-proposal-tk_yO7ie.js} +2 -2
- package/_assets/{session-request-CHKBqS1N.js → session-request-UyTvi1pP.js} +3 -3
- package/_assets/{sha256-CHhtlSrf.js → sha256-D8fGQSFL.js} +2 -2
- package/_assets/{sha3-DSPBiO5H.js → sha3-Q9wbGaop.js} +2 -2
- package/_assets/signin-empty-DpDwh-SV.js +2 -0
- package/_assets/{signing-17T07uJ_.js → signing-D1A3ZrfL.js} +4 -4
- package/_assets/{skeleton.styles-Df0jIOwp.js → skeleton.styles-DFjpg3_l.js} +2 -2
- package/_assets/{socials-Bi0NQvE0.js → socials-5DQ9SrVR.js} +2 -2
- package/_assets/{styled-4Ia3cH-v.js → styled-CjIb5Zdy.js} +3 -3
- package/_assets/{swapHorizontal-BXjIGAcZ.js → swapHorizontal-C6GakaRf.js} +2 -2
- package/_assets/{swapHorizontalBold-BzueHopN.js → swapHorizontalBold-oeP-_O-R.js} +2 -2
- package/_assets/{swapHorizontalMedium-DLFo4hRx.js → swapHorizontalMedium-C64EXSWD.js} +2 -2
- package/_assets/{swapHorizontalRoundedBold-BddBy7OL.js → swapHorizontalRoundedBold-CHgP6XK-.js} +2 -2
- package/_assets/{swapVertical-DYkySTmy.js → swapVertical-8SLU7RpO.js} +3 -3
- package/_assets/{swaps-DCtzhgv-.js → swaps-Bztb-KRF.js} +8 -8
- package/_assets/{telegram-D8ymSABf.js → telegram-CF91ES6s.js} +2 -2
- package/_assets/{thirdweb-DyxjDgvW.js → thirdweb-CZL68BtG.js} +4 -4
- package/_assets/{three-dots-CiS9iH0H.js → three-dots-BsCoLPC9.js} +2 -2
- package/_assets/{to-serializable-transaction-CDYrTMn4.js → to-serializable-transaction-Cax3D0Ed.js} +3 -3
- package/_assets/totalSupply-Bfu1b9j-.js +2 -0
- package/_assets/{trade-encoding-BKjm4pbk.js → trade-encoding-7vKZ_RAW.js} +2 -2
- package/_assets/{transaction-DcgOiSBk.js → transaction-DT055YfQ.js} +2 -2
- package/_assets/transactionReceipt-DUUD2Qe3.js +2 -0
- package/_assets/transactions-BAaPWgMx.js +17 -0
- package/_assets/{twitch-BJQCmiGz.js → twitch-BranWKeM.js} +2 -2
- package/_assets/{twitterIcon-B78o99Zv.js → twitterIcon-BfIWT5DS.js} +2 -2
- package/_assets/{useCreatorSales-Cb4A658a.js → useCreatorSales-Buish4Uu.js} +2 -2
- package/_assets/{useInfiniteGrid-DheMz6c1.js → useInfiniteGrid-CkEaLdl7.js} +2 -2
- package/_assets/{useStore-xMX0SCw6.js → useStore-BIMM-6gW.js} +3 -3
- package/_assets/{useTheme-BupTcwye.js → useTheme-CseBhYMJ.js} +2 -2
- package/_assets/{utils-8YzhWhI4.js → utils-Cn2V-3Ut.js} +2 -2
- package/_assets/{verify-CrYE2kna.js → verify-DcO5QuX7.js} +3 -3
- package/_assets/{verify-filled-CwwnY5h6.js → verify-filled-CKp8XQqI.js} +3 -3
- package/_assets/{verifyHash-DPUQC_yg.js → verifyHash-yrhfOghy.js} +2 -2
- package/_assets/{w3m-modal-B497G8Tj.js → w3m-modal-DA-0hW7m.js} +2 -2
- package/_assets/{w3m-modal-DLtR8WjU.js → w3m-modal-zmzVtMYW.js} +2 -2
- package/_assets/wait-for-tx-receipt-DLebyGh2.js +2 -0
- package/_assets/{wallet-EosqBoq7.js → wallet-BHCiGpYx.js} +3 -3
- package/_assets/{wallet-placeholder-DL8kIY2O.js → wallet-placeholder-BVguMNEt.js} +3 -3
- package/_assets/{walletconnect-CauX9cVK.js → walletconnect-9t1WJh4k.js} +4 -4
- package/_assets/{wallets-Dnwy6cWk.js → wallets-Dtvi0tKv.js} +6 -6
- package/_assets/{warning-circle-BrcBx24p.js → warning-circle-II7Vcaxs.js} +3 -3
- package/_assets/{web-connector-DsSDJS-4.js → web-connector-CvqIuRHL.js} +4 -4
- package/_assets/{writeContract-BLy6M4-l.js → writeContract-C_pXtfiq.js} +2 -2
- package/_assets/x-D0s8LW19.js +13 -0
- package/_assets/{zora-sepolia-CUCxS5yu.js → zora-sepolia-BYPjA30G.js} +2 -2
- package/_assets/{zoraTestnet-MZjEzcsS.js → zoraTestnet-CTpQFpZ6.js} +2 -2
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Confetti-Cq7xlf_X.js +0 -18
- package/_assets/Filters-BipHXxnJ.js +0 -823
- package/_assets/OutfitPreview-DhrknwF7.js +0 -7
- package/_assets/PhCaretDown-DBNFm85V.js +0 -15
- package/_assets/PhCaretUp-DE2FiuTS.js +0 -15
- package/_assets/arrow-right-BHc70exa.js +0 -9
- package/_assets/buy-C81jyIOD.js +0 -2
- package/_assets/categories-DgBMiYtZ.js +0 -2
- package/_assets/chevron-bottom-CLuKI9LQ.js +0 -9
- package/_assets/chevron-left-B_RU4s1F.js +0 -9
- package/_assets/chevron-right-C6ckznAo.js +0 -9
- package/_assets/chevron-top-CJOmtrv2.js +0 -9
- package/_assets/close-D4d1U5NV.js +0 -9
- package/_assets/collectionPage.styles-B7rtIk6J.js +0 -41
- package/_assets/common-CCoQZA5E.js +0 -2
- package/_assets/decimals-BvDI7b0k.js +0 -2
- package/_assets/decimals-DDCxC5c9.js +0 -2
- package/_assets/detectExtension-DKvdIAc4.js +0 -2
- package/_assets/estimate-l1-fee-S5b3zNLC.js +0 -2
- package/_assets/eth_estimateGas-DWeTQSR3.js +0 -2
- package/_assets/eth_getStorageAt-DZCdNLkY.js +0 -2
- package/_assets/eth_getTransactionCount-DvIglEHk.js +0 -2
- package/_assets/ethereum-CIkPKMxG.js +0 -2
- package/_assets/external-link-BEPN-Y2j.js +0 -9
- package/_assets/get-ecosystem-wallet-info-QF10ZErA.js +0 -2
- package/_assets/getNFT-B5QRqaiw.js +0 -2
- package/_assets/index-C53Cx_Kg.js +0 -2
- package/_assets/index-CUIg8HdV.js +0 -4422
- package/_assets/index-zN0D7p14.js +0 -2
- package/_assets/info-circle-DtEY-DDD.js +0 -13
- package/_assets/jsxRuntime.module-BUzu5v1_.js +0 -2
- package/_assets/off-CLF8R11w.js +0 -9
- package/_assets/openzeppelin-B65USuL7.js +0 -2
- package/_assets/ownerOf-BpFsZCP3.js +0 -2
- package/_assets/parseNft-DyMNYtvp.js +0 -3
- package/_assets/send-batch-transaction-CQlrVyL6.js +0 -2
- package/_assets/send-gasless-transaction-CLF9j93P.js +0 -3
- package/_assets/send-transaction-BGnLy_CJ.js +0 -3
- package/_assets/signin-empty-D1LO9Xts.js +0 -2
- package/_assets/totalSupply-BFDsc9M1.js +0 -2
- package/_assets/transactionReceipt-yxtcKZnQ.js +0 -2
- package/_assets/transactions-BLBNqZ1l.js +0 -17
- package/_assets/wait-for-tx-receipt-Cv5SjIHT.js +0 -2
- package/_assets/x-CwtQDczS.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-BJ4K_qd6.js";import{au as b}from"./NetworkUtil-BcliLUUF.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-C9yMX-9L.js";import{au as b}from"./NetworkUtil--zruk36r.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-ZTw9N09i.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-ChceODIJ.js";import{s as j,a as c}from"./index-DRRXfH5T.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-EC0gZ8rD.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-3YnG1Umc.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-BCdPj9kp.js";import{a as Me,d as V}from"./dcl-schemas-C-x6e7cM.js";import{c as ue}from"./react-EC0gZ8rD.js";import{c$ as je,L as de,h as le}from"./index-CUIg8HdV.js";import{c as z,e as qe}from"./index-Dfxis0Cp.js";import{s as He}from"./sendMetaTransaction-C6Nhv1ek.js";import"./sentry-Cb74VndH.js";import"./intl-AKLEHPeO.js";import"./events-BW5Jz76D.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]="5a96ee27-44e6-4c41-a440-e8eae5668511",t._sentryDebugIdIdentifier="sentry-dbid-5a96ee27-44e6-4c41-a440-e8eae5668511")}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-
|
|
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-DCYs0L1t.js";import{a as Me,d as V}from"./dcl-schemas-BrVwEqiU.js";import{c as ue}from"./react-ChceODIJ.js";import{d2 as je,L as de,h as le}from"./index-DRRXfH5T.js";import{c as z,e as qe}from"./index-CyqRAr8s.js";import{s as He}from"./sendMetaTransaction-du2nxyMF.js";import"./sentry-DoDOB8I2.js";import"./intl-AKLEHPeO.js";import"./events-Ch5mkuEv.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]="86b4d1b8-2098-4204-9ade-59112c578caf",t._sentryDebugIdIdentifier="sentry-dbid-86b4d1b8-2098-4204-9ade-59112c578caf")}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-DsJF_Ykz.js.map
|