@dcl/shop 0.1.0-28849951791.commit-e0fa315 → 0.1.0-28866858903.commit-27edcd7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/assets/{Assets-uXzVK3Qk.js → Assets-CT28s3tn.js} +1 -1
  2. package/assets/{Cart-B_feHFWP.js → Cart-DM50ezI4.js} +1 -1
  3. package/assets/{CircularProgress-MlGhFCHM.js → CircularProgress-DG2FpN0J.js} +1 -1
  4. package/assets/{Collection-HISXJvQ9.js → Collection-C1Lg8iud.js} +1 -1
  5. package/assets/{Creator-DckKaL-1.js → Creator-DEfpeOuR.js} +1 -1
  6. package/assets/{ExchangeController-Baa0YVeA.js → ExchangeController-CgeVuXaK.js} +1 -1
  7. package/assets/{GetCredits-DqKwryal.js → GetCredits-D2PhJWRd.js} +2 -2
  8. package/assets/{HelpersUtil-BVXkvMyH.js → HelpersUtil-BMvoH0KX.js} +1 -1
  9. package/assets/{ImportListings-3PSkCxI9.js → ImportListings-BW6Whd2Z.js} +1 -1
  10. package/assets/{ItemDetail-Ck5cudTI.js → ItemDetail-Cm6-wcV1.js} +1 -1
  11. package/assets/{Market-r9wggpqR.js → Market-ByTd4_V6.js} +1 -1
  12. package/assets/{MenuItem-CTKZTFhj.js → MenuItem-fSoZrIOB.js} +1 -1
  13. package/assets/{MyAssets-DbjlwVgI.js → MyAssets-DrK5wf4w.js} +1 -1
  14. package/assets/{MyFavorites-CUJsTl4U.js → MyFavorites-BYYLAkSE.js} +1 -1
  15. package/assets/{MyPurchases-D231IumZ.js → MyPurchases-uiVXvPAV.js} +1 -1
  16. package/assets/{NotFound-MYCYhimC.js → NotFound-DBcHTJ9Q.js} +1 -1
  17. package/assets/{RealCheckout-_Z3g7ZbH.js → RealCheckout-BH-IXEKW.js} +1 -1
  18. package/assets/{ShopFooterInner-gDzKrctg.js → ShopFooterInner-BecaIUMc.js} +2 -2
  19. package/assets/{Success-vyQPaFjH.js → Success-XVaAYlbU.js} +1 -1
  20. package/assets/{SvgIcon-DHNKm7fg.js → SvgIcon-_uqtXVDj.js} +1 -1
  21. package/assets/{SwapController-C28NtHea.js → SwapController-Dt7v7c5Z.js} +1 -1
  22. package/assets/{TradeService-CV6tm-S-.js → TradeService-BtTy0G3e.js} +1 -1
  23. package/assets/{W3MFrameProviderSingleton-CPW2Gx43.js → W3MFrameProviderSingleton-BGrWzqsE.js} +3 -3
  24. package/assets/{WebCryptoP256-CJ8gEFrP.js → WebCryptoP256-Ddd92cBG.js} +1 -1
  25. package/assets/{basic-Cp5xCH29.js → basic-Cs_uWRSy.js} +1 -1
  26. package/assets/{biconomy-DE6VN2MK.js → biconomy-C-red-Y4.js} +1 -1
  27. package/assets/{buy-gasless-C0vjtz9e.js → buy-gasless-k9AJLehR.js} +1 -1
  28. package/assets/{buy-DW_YPH6-.js → buy-ywa6QYOz.js} +1 -1
  29. package/assets/{ccip-Dw1-xWm0.js → ccip-C-81g62f.js} +1 -1
  30. package/assets/{ccip-CO-J9tPJ.js → ccip-DZmtf0-e.js} +1 -1
  31. package/assets/{collection-gU9snfSG.js → collection-BgiwV3T2.js} +1 -1
  32. package/assets/{controller-Dp-L0bGU.js → controller-Ujfw8iYY.js} +2 -2
  33. package/assets/{core-DOKNMejd.js → core-BBXU740E.js} +4 -4
  34. package/assets/{custom-DrZvVkR4.js → custom-DdewCaHO.js} +1 -1
  35. package/assets/{data-capture-CWmntLCH.js → data-capture-CAQuoq2H.js} +1 -1
  36. package/assets/decimals-Bf_Oizd2.js +1 -0
  37. package/assets/{decimals-BpJkRsKM.js → decimals-DbV6JWsZ.js} +1 -1
  38. package/assets/{detectExtension-BOrmaly3.js → detectExtension-BsnimyTc.js} +1 -1
  39. package/assets/{email-DTaLpEKv.js → email-D-Gg6ktV.js} +1 -1
  40. package/assets/{embedded-wallet-DVickMII.js → embedded-wallet-BygK-cU5.js} +1 -1
  41. package/assets/{engine-Cyf0wDMH.js → engine-CqQgekFY.js} +1 -1
  42. package/assets/{estimate-l1-fee-Ci_3qNsd.js → estimate-l1-fee-CON30Z4C.js} +1 -1
  43. package/assets/{eth_estimateGas-Bu7KbsjJ.js → eth_estimateGas-CDpfukc1.js} +1 -1
  44. package/assets/{eth_getStorageAt-gEhkd3Dl.js → eth_getStorageAt-B88Q9upn.js} +1 -1
  45. package/assets/{eth_getTransactionCount-CZrmDIpa.js → eth_getTransactionCount-C4d33r-r.js} +1 -1
  46. package/assets/{extractIPFS-HSGbtFdH.js → extractIPFS-SF68IVsy.js} +1 -1
  47. package/assets/{features-CjtSZKbI.js → features-CCBnPBuN.js} +1 -1
  48. package/assets/{fetchTokenMetadata-DcoAGAFy.js → fetchTokenMetadata-D8XVhXk_.js} +2 -2
  49. package/assets/{generateUtilityClasses-DMMGtITh.js → generateUtilityClasses-CKIya6ur.js} +1 -1
  50. package/assets/{get-ecosystem-wallet-info-GpWofI03.js → get-ecosystem-wallet-info-CyYDgfFp.js} +1 -1
  51. package/assets/{getBalance-IAhn1Sx7.js → getBalance-BfAqIBxL.js} +1 -1
  52. package/assets/{getInstalledModules-Clea_yJr.js → getInstalledModules-mqQipjK8.js} +1 -1
  53. package/assets/{getNFT-CbT_NWLy.js → getNFT-BtODCVGa.js} +2 -2
  54. package/assets/{getNFT-BkaCCDU5.js → getNFT-DErJLjpR.js} +1 -1
  55. package/assets/{hashTypedData-DAd66wY6.js → hashTypedData-BYNlhvPL.js} +1 -1
  56. package/assets/{hashTypedData-PYLB7hJl.js → hashTypedData-CW0ZlbZA.js} +1 -1
  57. package/assets/{import-dVEuzimB.js → import-Bw-yAc9q.js} +1 -1
  58. package/assets/{in-app-wallet-calls-l67EA4DZ.js → in-app-wallet-calls-NeNIVGtZ.js} +1 -1
  59. package/assets/{index-D1gEge8-.js → index-0GXqquxu.js} +3 -3
  60. package/assets/{index-B_NuPdf0.js → index-B0XE7Qzl.js} +1 -1
  61. package/assets/{index-B6lLVyUf.js → index-BB2MAbAB.js} +1 -1
  62. package/assets/{index-DnQG3NAn.js → index-BFHCiXWB.js} +1 -1
  63. package/assets/{index-B1ZF46Ko.js → index-BKh4fLim.js} +1 -1
  64. package/assets/{index-BWbKKFVK.js → index-B_F6pJEu.js} +1 -1
  65. package/assets/{index-DVcL7J_t.js → index-B_TejJ9A.js} +1 -1
  66. package/assets/{index-Bd4x7TMP.js → index-Be3GyXzC.js} +1 -1
  67. package/assets/{index-B94ghhpu.js → index-Bpm2At5Q.js} +1 -1
  68. package/assets/{index-BcZPRgUv.js → index-C0cx32sg.js} +1 -1
  69. package/assets/{index-BeUILvqM.js → index-C4D-6CtP.js} +1 -1
  70. package/assets/{index-a4k6LaYK.js → index-C6e6OYT7.js} +1 -1
  71. package/assets/{index-BjptEpaJ.js → index-C8d0rRhd.js} +1 -1
  72. package/assets/{index-CqnsV9lR.js → index-CAsWPx_4.js} +1 -1
  73. package/assets/{index-zbujtMDB.js → index-CI9qvWc6.js} +1 -1
  74. package/assets/{index-D5JjqjjU.js → index-CMgbQJrl.js} +1 -1
  75. package/assets/{index-CENUxZfv.js → index-CMnbAjSo.js} +1 -1
  76. package/assets/{index-rk-RtPGh.js → index-CORGgUhI.js} +1 -1
  77. package/assets/{index-BuedKT8D.js → index-CWKaW9cZ.js} +2 -2
  78. package/assets/{index-jCrNn234.js → index-CYiwoWgV.js} +1 -1
  79. package/assets/{index-CcsWoBJK.js → index-CZG-YTaJ.js} +1 -1
  80. package/assets/{index-DURh1PEo.js → index-C_jnF2T8.js} +1 -1
  81. package/assets/{index-CsVrdKM8.js → index-CqovlPfY.js} +1 -1
  82. package/assets/{index-CdO-kfoS.js → index-Cv6gBdhQ.js} +1 -1
  83. package/assets/{index-zVvLDKBh.js → index-CxlLn_V3.js} +2 -2
  84. package/assets/{index-7rWaFD7f.js → index-Cxu2kNxx.js} +1 -1
  85. package/assets/{index-o3xLbiUm.js → index-D2F7BUhb.js} +1 -1
  86. package/assets/{index-CuBAn4iR.js → index-D5Bpra19.js} +1 -1
  87. package/assets/{index-u77btqjQ.js → index-D6o05Q0p.js} +1 -1
  88. package/assets/{index-Bv11rzVa.js → index-D9OsLyrU.js} +1 -1
  89. package/assets/{index-o2j-czuk.js → index-DKI889w4.js} +1 -1
  90. package/assets/{index-u8nH4Rw0.js → index-DNkn2UX9.js} +1 -1
  91. package/assets/{index-Df6GKZpc.js → index-DUjm2IcF.js} +2 -2
  92. package/assets/{index-BVcNzXap.js → index-DaF3Vnaw.js} +1 -1
  93. package/assets/{index-CbyAJw4-.js → index-DauDncRr.js} +1 -1
  94. package/assets/{index-CAXOAo7E.js → index-De3Z7JXD.js} +1 -1
  95. package/assets/{index-C7St4Q5o.js → index-DeRdsl6L.js} +1 -1
  96. package/assets/{index-D9XZpwfV.js → index-Dh_23qfs.js} +5 -5
  97. package/assets/{index-CcUfpaSP.js → index-Dq_E0wOW.js} +1 -1
  98. package/assets/{index-DxWP3gak.js → index-DtsePI_i.js} +1 -1
  99. package/assets/{index-DOLdge0g.js → index-DuUdctHy.js} +1 -1
  100. package/assets/{index-BrR0WZ0Y.js → index-KR_pcYvC.js} +1 -1
  101. package/assets/{index-Dv41StGm.js → index-PX_c3Qb_.js} +1 -1
  102. package/assets/{index-B3P6BPci.js → index-QmaSqjcW.js} +1 -1
  103. package/assets/{index-uzc4dT8s.js → index-RYxtgu1n.js} +1 -1
  104. package/assets/{index-Bl9N3aWR.js → index-RbaKVJaM.js} +1 -1
  105. package/assets/{index-BKA2Kk9C.js → index-TS-e7Dqh.js} +1 -1
  106. package/assets/{index-BYg62rD6.js → index-ZkliCE3r.js} +1 -1
  107. package/assets/{index-C6uhDE9h.js → index-_K2YCvAG.js} +1 -1
  108. package/assets/{index-B0--HMVL.js → index-sV0xAzf6.js} +3 -3
  109. package/assets/{index-DqnX5uAR.js → index-uDlFzubM.js} +1 -1
  110. package/assets/{index.es-CYMyZCD-.js → index.es-CCdB6eaE.js} +1 -1
  111. package/assets/{index.es-DJUkBdGr.js → index.es-CQ0R_jWA.js} +1 -1
  112. package/assets/{index.es-UvEfkSna.js → index.es-d5kuURHY.js} +4 -4
  113. package/assets/{localBatchGatewayRequest-C9D88kZr.js → localBatchGatewayRequest-BexY9Mde.js} +1 -1
  114. package/assets/{mana-rate-Dx_lqKWQ.js → mana-rate-embrvpxV.js} +1 -1
  115. package/assets/network-mdKz8jdP.js +1 -0
  116. package/assets/{networks-KbQXXD7P.js → networks-ATqZYe-g.js} +1 -1
  117. package/assets/{onramp-iekcmGjJ.js → onramp-CC_Mk4Gm.js} +1 -1
  118. package/assets/{openzeppelin-41206uN_.js → openzeppelin-bDyc7per.js} +1 -1
  119. package/assets/{ownerOf-DH7SAQYs.js → ownerOf-B3YC-1gG.js} +1 -1
  120. package/assets/{parseNft-Dy8OsAtf.js → parseNft-Bp_loQO2.js} +2 -2
  121. package/assets/{parseSignature-BiaWpR8i.js → parseSignature-G8Ir60N1.js} +1 -1
  122. package/assets/{parseSignature-D9IuPuaA.js → parseSignature-k_e-4JPE.js} +3 -3
  123. package/assets/{pay-with-exchange-D0U4VJXZ.js → pay-with-exchange-C9Y_CGg6.js} +1 -1
  124. package/assets/{qr-overlay-35KmnL99.js → qr-overlay-KvaIp7-h.js} +1 -1
  125. package/assets/{receive-D80uh9Rj.js → receive-8erCTY1F.js} +1 -1
  126. package/assets/{resolveImplementation-BuxyNBBw.js → resolveImplementation-D0m-RM9g.js} +1 -1
  127. package/assets/{rpc-CV4XQPwJ.js → rpc-Db5G0SW1.js} +1 -1
  128. package/assets/{secp256k1-CZj9lLpY.js → secp256k1-CqOSmkL9.js} +1 -1
  129. package/assets/{secp256k1-lf00rTSa.js → secp256k1-d1PVlyhU.js} +1 -1
  130. package/assets/{secp256k1-Bz9G1VTq.js → secp256k1-hr2xO75Q.js} +1 -1
  131. package/assets/{send-batch-transaction-uDBYU3an.js → send-batch-transaction-DLM-_LrZ.js} +1 -1
  132. package/assets/{send-eip712-transaction-DR18L-sh.js → send-eip712-transaction-DP17AWWu.js} +2 -2
  133. package/assets/{send-gasless-transaction-BfuwoIYy.js → send-gasless-transaction-BFbMbtLp.js} +2 -2
  134. package/assets/{send-CZjs1yZc.js → send-oFAx02yK.js} +1 -1
  135. package/assets/{sendRawTransaction-BUgSPkVd.js → sendRawTransaction-B-N14GCq.js} +3 -3
  136. package/assets/{serializeTransaction-Dmi33xSK.js → serializeTransaction-BLc8aQzS.js} +1 -1
  137. package/assets/{session-proposal-BOa4yxBl.js → session-proposal-M_2My__Q.js} +1 -1
  138. package/assets/{session-request-Bcaq75nd.js → session-request-DBYaO4q5.js} +2 -2
  139. package/assets/{sha256-zMI7s0-F.js → sha256-Cx7Ij8et.js} +1 -1
  140. package/assets/{signing-Cvv8O8BI.js → signing-DbptdEFO.js} +4 -4
  141. package/assets/{socials-C_Nw_-aT.js → socials-DAwqYnxC.js} +1 -1
  142. package/assets/{swaps-DrEprVp5.js → swaps-D7FObwMZ.js} +1 -1
  143. package/assets/{thirdweb-D3908hZR.js → thirdweb-CI-IL5Al.js} +3 -3
  144. package/assets/{totalSupply-CpI009r1.js → totalSupply-CnFxFHEm.js} +1 -1
  145. package/assets/{transactionReceipt-CRiBJ28i.js → transactionReceipt-BZFMW0kN.js} +1 -1
  146. package/assets/{transactions-63jnvtFL.js → transactions-40IT23nK.js} +1 -1
  147. package/assets/{useInfiniteGrid-xOdKaR3H.js → useInfiniteGrid-CjjuujTH.js} +1 -1
  148. package/assets/{verifyHash-BR9R1RG0.js → verifyHash-ClHnvqLw.js} +1 -1
  149. package/assets/{w3m-modal-lZE_ZuOa.js → w3m-modal-CNI9aYj6.js} +1 -1
  150. package/assets/{w3m-modal-BlMrqGaw.js → w3m-modal-cIgLRAbD.js} +1 -1
  151. package/assets/{wait-for-tx-receipt-Do82Sucy.js → wait-for-tx-receipt-RA8zh0o7.js} +1 -1
  152. package/assets/{wallet-kind-WAQetlRX.js → wallet-kind-DspYSL12.js} +1 -1
  153. package/assets/{wallets-CoP2jTeJ.js → wallets-CdAU3xHZ.js} +6 -6
  154. package/assets/{web-connector-uOzuTTW_.js → web-connector-BVaGSh3Y.js} +3 -3
  155. package/assets/{writeContract-D-hfmcKA.js → writeContract-DCf0vGST.js} +1 -1
  156. package/assets/{zoraTestnet-BMgpy9AE.js → zoraTestnet-DeE2yd9D.js} +1 -1
  157. package/index.html +8 -8
  158. package/package.json +2 -2
  159. package/assets/decimals-D1rmvFNT.js +0 -1
  160. package/assets/network-CCTP_tzM.js +0 -1
@@ -1 +1 @@
1
- import{j as s,d as _,a as x,N as j}from"./react-4iaCnQ6n.js";import{a as v,J as N,W as h,D as i,h as t}from"./index-D9XZpwfV.js";import{s as g}from"./wallet-kind-WAQetlRX.js";import"./ethers-CU3Ctw5k.js";function k(){return s.jsxs("div",{className:"success-anim",role:"img","aria-label":"Purchase successful",children:[s.jsxs("svg",{className:"success-anim__svg",viewBox:"0 0 120 120",children:[s.jsx("circle",{className:"success-anim__ring",cx:"60",cy:"60",r:"54"}),s.jsx("path",{className:"success-anim__check",d:"M37 61 l16 16 l30 -34"})]}),s.jsx("span",{className:"success-anim__spark success-anim__spark--1","aria-hidden":!0,children:"✦"}),s.jsx("span",{className:"success-anim__spark success-anim__spark--2","aria-hidden":!0,children:"✦"}),s.jsx("span",{className:"success-anim__spark success-anim__spark--3","aria-hidden":!0,children:"◈"}),s.jsx("span",{className:"success-anim__spark success-anim__spark--4","aria-hidden":!0,children:"✦"})]})}const b=t.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump",f=t.chainId===80002?"https://amoy.polygonscan.com/tx/":"https://polygonscan.com/tx/";function E(){const{state:a}=_(),o=x(),{session:c}=v(),r=(a==null?void 0:a.items)??[];if(r.length===0)return s.jsx(j,{to:"/assets",replace:!0});const e=r[0],d=(c==null?void 0:c.address)??"default",l=e.category==="emote",m=l?[]:r.map(N).filter(n=>!!n),u=a==null?void 0:a.txHash,p=!!u&&g(c==null?void 0:c.providerType);return s.jsxs("div",{className:"success",children:[s.jsx("div",{className:"success__preview",children:m.length>0?s.jsx(h,{profile:d,urns:m,type:i.PreviewType.AVATAR,emote:i.PreviewEmote.FASHION,background:"ecebed",dev:t.chainId===80002},e.id):s.jsx(h,{contractAddress:e.contractAddress,tokenId:e.tokenId??void 0,itemId:e.tokenId?void 0:e.itemId??void 0,profile:d,type:l?void 0:i.PreviewType.AVATAR,emote:l?void 0:i.PreviewEmote.FASHION,background:"ecebed",dev:t.chainId===80002},e.id)}),s.jsxs("div",{className:"success__panel",children:[s.jsx(k,{}),s.jsx("h1",{className:"success__title",children:"It’s yours!"}),r.length===1?s.jsxs("p",{className:"success__sub",children:[s.jsx("strong",{children:e.name})," is now in your wardrobe."]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"success__sub",children:[r.length," items are now in your wardrobe."]}),s.jsx("ul",{className:"success__list",children:r.map(n=>s.jsx("li",{children:n.name},n.id))})]}),s.jsxs("div",{className:"success__links",children:[s.jsx("button",{className:"success__receipt",onClick:()=>o("/my-purchases"),children:"View order"}),p?s.jsx("a",{className:"success__receipt",href:`${f}${u}`,target:"_blank",rel:"noreferrer",children:"View transaction ↗"}):null]}),s.jsxs("div",{className:"success__actions",children:[s.jsx("a",{className:"btn btn--purple",href:b,target:"_blank",rel:"noreferrer",children:"Use it in-world"}),s.jsx("button",{className:"btn btn--ghost",onClick:()=>o("/assets"),children:"Keep shopping"})]})]})]})}export{E as Success,E as default};
1
+ import{j as s,d as _,a as x,N as j}from"./react-4iaCnQ6n.js";import{a as v,J as N,W as h,D as i,h as t}from"./index-Dh_23qfs.js";import{s as g}from"./wallet-kind-DspYSL12.js";import"./ethers-CU3Ctw5k.js";function k(){return s.jsxs("div",{className:"success-anim",role:"img","aria-label":"Purchase successful",children:[s.jsxs("svg",{className:"success-anim__svg",viewBox:"0 0 120 120",children:[s.jsx("circle",{className:"success-anim__ring",cx:"60",cy:"60",r:"54"}),s.jsx("path",{className:"success-anim__check",d:"M37 61 l16 16 l30 -34"})]}),s.jsx("span",{className:"success-anim__spark success-anim__spark--1","aria-hidden":!0,children:"✦"}),s.jsx("span",{className:"success-anim__spark success-anim__spark--2","aria-hidden":!0,children:"✦"}),s.jsx("span",{className:"success-anim__spark success-anim__spark--3","aria-hidden":!0,children:"◈"}),s.jsx("span",{className:"success-anim__spark success-anim__spark--4","aria-hidden":!0,children:"✦"})]})}const b=t.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump",f=t.chainId===80002?"https://amoy.polygonscan.com/tx/":"https://polygonscan.com/tx/";function E(){const{state:a}=_(),o=x(),{session:c}=v(),r=(a==null?void 0:a.items)??[];if(r.length===0)return s.jsx(j,{to:"/assets",replace:!0});const e=r[0],d=(c==null?void 0:c.address)??"default",l=e.category==="emote",m=l?[]:r.map(N).filter(n=>!!n),u=a==null?void 0:a.txHash,p=!!u&&g(c==null?void 0:c.providerType);return s.jsxs("div",{className:"success",children:[s.jsx("div",{className:"success__preview",children:m.length>0?s.jsx(h,{profile:d,urns:m,type:i.PreviewType.AVATAR,emote:i.PreviewEmote.FASHION,background:"ecebed",dev:t.chainId===80002},e.id):s.jsx(h,{contractAddress:e.contractAddress,tokenId:e.tokenId??void 0,itemId:e.tokenId?void 0:e.itemId??void 0,profile:d,type:l?void 0:i.PreviewType.AVATAR,emote:l?void 0:i.PreviewEmote.FASHION,background:"ecebed",dev:t.chainId===80002},e.id)}),s.jsxs("div",{className:"success__panel",children:[s.jsx(k,{}),s.jsx("h1",{className:"success__title",children:"It’s yours!"}),r.length===1?s.jsxs("p",{className:"success__sub",children:[s.jsx("strong",{children:e.name})," is now in your wardrobe."]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"success__sub",children:[r.length," items are now in your wardrobe."]}),s.jsx("ul",{className:"success__list",children:r.map(n=>s.jsx("li",{children:n.name},n.id))})]}),s.jsxs("div",{className:"success__links",children:[s.jsx("button",{className:"success__receipt",onClick:()=>o("/my-purchases"),children:"View order"}),p?s.jsx("a",{className:"success__receipt",href:`${f}${u}`,target:"_blank",rel:"noreferrer",children:"View transaction ↗"}):null]}),s.jsxs("div",{className:"success__actions",children:[s.jsx("a",{className:"btn btn--purple",href:b,target:"_blank",rel:"noreferrer",children:"Use it in-world"}),s.jsx("button",{className:"btn btn--ghost",onClick:()=>o("/assets"),children:"Keep shopping"})]})]})]})}export{E as Success,E as default};
@@ -1 +1 @@
1
- import{a3 as M,a4 as I}from"./index-D9XZpwfV.js";import{b as u,i as V,w as F,T as G,h as z,j as w,r as K,l as Y,m as k,g as x,a as W,u as H,_ as j,c as Q,d as g,e as q,s as J}from"./generateUtilityClasses-DMMGtITh.js";import{r as O,j as f}from"./react-4iaCnQ6n.js";const X="https://wearable-preview.decentraland.zone",Z="https://decentraland.zone/account",tt="https://decentraland.zone/profile",et="https://decentraland.zone/marketplace",nt="https://decentraland.zone/builder",ot="https://decentraland.zone/dao",at="https://decentraland.zone/governance",st="https://decentraland.zone/events",rt="https://decentraland.zone/places",ct="https://decentraland.org/create/",dt="https://docs.decentraland.org/player/",_t="https://decentraland.zone/download/creator-hub/",lt="https://decentraland.zone/download/",Rt="https://decentraland.zone/download_success/",Lt="ea2ybdmmn1kv",Et="master",Ut="18g1DzIyBxvu0steSwKyQr",it="https://cms.decentraland.org",pt="https://decentraland.zone/marketplace/names/claim",St="https://decentraland.zone/marketplace/lands",Ot="https://decentraland.zone/marketplace/account",At="https://decentraland.zone/create/",Tt="https://studios.decentraland.zone/",ht="https://decentraland.zone/builder/collections",Nt="https://decentraland.zone/builder/names",Ct="https://decentraland.zone/builder/worlds?tab=dcl",gt="https://decentraland.zone/builder/land",mt="https://decentraland.zone/events/me/",It="https://decentraland.zone/places/favorites/",ut="https://docs.decentraland.org/player/",Dt="https://docs.decentraland.org/creator/",$t="https://decentraland.zone/blog/",Pt="https://docs.decentraland.org/contributor/",ft="https://decentraland.zone/governance/transparency/",vt="https://decentraland.zone/governance/proposals/",yt="https://decentraland.zone/dao/grants/",Bt="https://decentraland.zone/governance/projects/",bt="https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",Mt="https://decentraland.zone/marketplace/settings",Vt="https://dcl.gg/discord",Ft="https://reddit.com/r/decentraland",Gt="https://github.com/decentraland",zt="https://x.com/decentraland",wt="https://instagram.com/decentraland_foundation/",Kt="https://youtube.com/@decentraland_foundation",Yt="https://tiktok.com/@decentraland_fdn",kt="https://linkedin.com/company/decentralandorg",xt="https://decentraland.zone/privacy",Wt="https://decentraland.zone/terms",Ht="https://decentraland.zone/content",jt="https://decentraland.zone/ethics",Qt="https://decentraland.org/help",qt="mailto:hello@decentraland.org",Jt="https://docs.decentraland.org/faqs/decentraland-101",Xt="https://docs.decentraland.org",Zt="https://embeds.beehiiv.com/ff89783d-748b-4ba3-8700-4759f6f62831?slim=true",te="https://download-gateway.decentraland.zone",ee="https://decentraland.zone/top-scenes",ne="https://testflight.apple.com/join/KF4r3jlU",oe="https://play.google.com/store/apps/details?id=org.decentraland.godotexplorer",ae={WEARABLE_PREVIEW_URL:X,ACCOUNT_URL:Z,PROFILE_URL:tt,MARKETPLACE_URL:et,BUILDER_URL:nt,DAO_URL:ot,GOVERNANCE_URL:at,EVENTS_URL:st,PLACES_URL:rt,CREATE_URL:ct,LEARN_URL:dt,CREATOR_HUB_URL:_t,DOWNLOAD_URL:lt,DOWNLOAD_SUCCESS_URL:Rt,CONTENTFUL_SPACE_ID:Lt,CONTENTFUL_ENV:Et,CONTENTFUL_NAVBAR_ENTRY_ID:Ut,CONTENTFUL_CONTENTFUL_CDN_URL:it,MARKETPLACE_NAMES_URL:pt,MARKETPLACE_LANDS_URL:St,MARKETPLACE_MY_ASSETS_URL:Ot,LANDING_CREATORS_URL:At,STUDIOS_URL:Tt,BUILDER_WEARABLE_EMOTES_URL:ht,BUILDER_NAMES_URL:Nt,BUILDER_WORLDS_URL:Ct,BUILDER_LAND_URL:gt,EVENTS_MY_EVENTS:mt,PLACES_MY_FAVORITE_URL:It,DOCS_ABOUT_URL:ut,DOCS_CREATORS_URL:Dt,BLOG_URL:$t,DOCS_CONTRIBUTOR_URL:Pt,GOVERNANCE_TRANSPARENCY_URL:ft,GOVERNANCE_PROPOSALS_URL:vt,DAO_GRANTS_URL:yt,GOVERNANCE_PROJECTS_URL:Bt,DOCS_DAO_URL:bt,MARKETPLACE_SETTINGS_URL:Mt,DISCORD_URL:Vt,REDDIT_URL:Ft,GITHUB_URL:Gt,X_URL:zt,INSTAGRAM_URL:wt,YOUTUBE_URL:Kt,TIKTOK_URL:Yt,LINKEDIN_URL:kt,PRIVACY_POLICY_URL:xt,TERMS_OF_USE_URL:Wt,CONTENT_POLICY_URL:Ht,CODE_OF_ETHICS_URL:jt,SUPPORT_URL:Qt,EMAIL_HELLO_URL:qt,FAQ_URL:Jt,DOCS_URL:Xt,BEEHIV_SUBSCRIPTION_URL:Zt,AUTO_SIGNING_BASE_URL:te,TOP_SCENES_URL:ee,IOS_STORE_URL:ne,ANDROID_STORE_URL:oe},se="https://wearable-preview.decentraland.org",re="https://decentraland.org/account",ce="https://decentraland.org/profile",de="https://decentraland.org/marketplace",_e="https://decentraland.org/builder",le="https://decentraland.org/dao",Re="https://decentraland.org/governance",Le="https://decentraland.org/events",Ee="https://decentraland.org/places",Ue="https://decentraland.org/create/",ie="https://docs.decentraland.org/player/",pe="https://decentraland.org/download/creator-hub/",Se="https://decentraland.org/download/",Oe="https://decentraland.org/download_success/",Ae="ea2ybdmmn1kv",Te="master",he="18g1DzIyBxvu0steSwKyQr",Ne="https://cms.decentraland.org",Ce="https://decentraland.org/marketplace/names/claim",ge="https://decentraland.org/marketplace/lands",me="https://decentraland.org/marketplace/account",Ie="https://decentraland.org/create/",ue="https://studios.decentraland.org/",De="https://decentraland.org/builder/collections",$e="https://decentraland.org/builder/names",Pe="https://decentraland.org/builder/worlds?tab=dcl",fe="https://decentraland.org/builder/land",ve="https://decentraland.org/events/me/",ye="https://decentraland.org/places/favorites/",Be="https://docs.decentraland.org/player/",be="https://docs.decentraland.org/creator/",Me="https://decentraland.org/blog/",Ve="https://docs.decentraland.org/contributor/",Fe="https://decentraland.org/governance/transparency/",Ge="https://decentraland.org/governance/proposals/",ze="https://decentraland.org/dao/grants/",we="https://decentraland.org/governance/projects/",Ke="https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",Ye="https://decentraland.org/marketplace/settings",ke="https://dcl.gg/discord",xe="https://reddit.com/r/decentraland",We="https://github.com/decentraland",He="https://x.com/decentraland",je="https://instagram.com/decentraland_foundation/",Qe="https://youtube.com/@decentraland_foundation",qe="https://tiktok.com/@decentraland_fdn",Je="https://linkedin.com/company/decentralandorg",Xe="https://decentraland.org/privacy",Ze="https://decentraland.org/terms",tn="https://decentraland.org/content",en="https://decentraland.org/ethics",nn="https://decentraland.org/help",on="mailto:hello@decentraland.org",an="https://docs.decentraland.org/faqs/decentraland-101",sn="https://docs.decentraland.org",rn="https://embeds.beehiiv.com/ff89783d-748b-4ba3-8700-4759f6f62831?slim=true",cn="https://download-gateway.decentraland.org",dn="https://decentraland.org/top-scenes",_n="https://testflight.apple.com/join/KF4r3jlU",ln="https://play.google.com/store/apps/details?id=org.decentraland.godotexplorer",Rn={WEARABLE_PREVIEW_URL:se,ACCOUNT_URL:re,PROFILE_URL:ce,MARKETPLACE_URL:de,BUILDER_URL:_e,DAO_URL:le,GOVERNANCE_URL:Re,EVENTS_URL:Le,PLACES_URL:Ee,CREATE_URL:Ue,LEARN_URL:ie,CREATOR_HUB_URL:pe,DOWNLOAD_URL:Se,DOWNLOAD_SUCCESS_URL:Oe,CONTENTFUL_SPACE_ID:Ae,CONTENTFUL_ENV:Te,CONTENTFUL_NAVBAR_ENTRY_ID:he,CONTENTFUL_CONTENTFUL_CDN_URL:Ne,MARKETPLACE_NAMES_URL:Ce,MARKETPLACE_LANDS_URL:ge,MARKETPLACE_MY_ASSETS_URL:me,LANDING_CREATORS_URL:Ie,STUDIOS_URL:ue,BUILDER_WEARABLE_EMOTES_URL:De,BUILDER_NAMES_URL:$e,BUILDER_WORLDS_URL:Pe,BUILDER_LAND_URL:fe,EVENTS_MY_EVENTS:ve,PLACES_MY_FAVORITE_URL:ye,DOCS_ABOUT_URL:Be,DOCS_CREATORS_URL:be,BLOG_URL:Me,DOCS_CONTRIBUTOR_URL:Ve,GOVERNANCE_TRANSPARENCY_URL:Fe,GOVERNANCE_PROPOSALS_URL:Ge,DAO_GRANTS_URL:ze,GOVERNANCE_PROJECTS_URL:we,DOCS_DAO_URL:Ke,MARKETPLACE_SETTINGS_URL:Ye,DISCORD_URL:ke,REDDIT_URL:xe,GITHUB_URL:We,X_URL:He,INSTAGRAM_URL:je,YOUTUBE_URL:Qe,TIKTOK_URL:qe,LINKEDIN_URL:Je,PRIVACY_POLICY_URL:Xe,TERMS_OF_USE_URL:Ze,CONTENT_POLICY_URL:tn,CODE_OF_ETHICS_URL:en,SUPPORT_URL:nn,EMAIL_HELLO_URL:on,FAQ_URL:an,DOCS_URL:sn,BEEHIV_SUBSCRIPTION_URL:rn,AUTO_SIGNING_BASE_URL:cn,TOP_SCENES_URL:dn,IOS_STORE_URL:_n,ANDROID_STORE_URL:ln},Ln="https://wearable-preview.decentraland.today",En="https://decentraland.today/account",Un="https://decentraland.today/profile",pn="https://decentraland.today/marketplace",Sn="https://decentraland.today/builder",On="https://decentraland.today/dao",An="https://decentraland.today/governance",Tn="https://decentraland.zone/events",hn="https://decentraland.zone/places",Nn="https://decentraland.today/create/",Cn="https://docs.decentraland.org/player/",gn="https://decentraland.today/download/creator-hub/",mn="https://decentraland.today/download/",In="https://decentraland.today/download_success/",un="ea2ybdmmn1kv",Dn="master",$n="18g1DzIyBxvu0steSwKyQr",Pn="https://cms.decentraland.org",fn="https://decentraland.today/marketplace/names/claim",vn="https://decentraland.today/marketplace/lands",yn="https://decentraland.today/marketplace/account",Bn="https://decentraland.today/create/",bn="https://studios.decentraland.today/",Mn="https://decentraland.today/builder/collections",Vn="https://decentraland.today/builder/names",Fn="https://decentraland.today/builder/worlds?tab=dcl",Gn="https://decentraland.today/builder/land",zn="https://decentraland.today/events/me/",wn="https://decentraland.today/places/favorites/",Kn="https://docs.decentraland.org/player/",Yn="https://docs.decentraland.org/creator/",kn="https://decentraland.today/blog/",xn="https://docs.decentraland.org/contributor/",Wn="https://decentraland.today/governance/transparency/",Hn="https://decentraland.today/governance/proposals/",jn="https://decentraland.today/dao/grants/",Qn="https://decentraland.today/governance/projects/",qn="https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",Jn="https://decentraland.today/marketplace/settings",Xn="https://dcl.gg/discord",Zn="https://reddit.com/r/decentraland",to="https://github.com/decentraland",eo="https://x.com/decentraland",no="https://instagram.com/decentraland_foundation/",oo="https://youtube.com/@decentraland_foundation",ao="https://tiktok.com/@decentraland_fdn",so="https://linkedin.com/company/decentralandorg",ro="https://decentraland.org/privacy",co="https://decentraland.org/terms",_o="https://decentraland.org/content",lo="https://decentraland.org/ethics",Ro="https://decentraland.org/help",Lo="mailto:hello@decentraland.org",Eo="https://docs.decentraland.org/faqs/decentraland-101",Uo="https://docs.decentraland.org",io="https://embeds.beehiiv.com/ff89783d-748b-4ba3-8700-4759f6f62831?slim=true",po="https://download-gateway.decentraland.zone",So="https://decentraland.zone/top-scenes",Oo="https://testflight.apple.com/join/KF4r3jlU",Ao="https://play.google.com/store/apps/details?id=org.decentraland.godotexplorer",To={WEARABLE_PREVIEW_URL:Ln,ACCOUNT_URL:En,PROFILE_URL:Un,MARKETPLACE_URL:pn,BUILDER_URL:Sn,DAO_URL:On,GOVERNANCE_URL:An,EVENTS_URL:Tn,PLACES_URL:hn,CREATE_URL:Nn,LEARN_URL:Cn,CREATOR_HUB_URL:gn,DOWNLOAD_URL:mn,DOWNLOAD_SUCCESS_URL:In,CONTENTFUL_SPACE_ID:un,CONTENTFUL_ENV:Dn,CONTENTFUL_NAVBAR_ENTRY_ID:$n,CONTENTFUL_CONTENTFUL_CDN_URL:Pn,MARKETPLACE_NAMES_URL:fn,MARKETPLACE_LANDS_URL:vn,MARKETPLACE_MY_ASSETS_URL:yn,LANDING_CREATORS_URL:Bn,STUDIOS_URL:bn,BUILDER_WEARABLE_EMOTES_URL:Mn,BUILDER_NAMES_URL:Vn,BUILDER_WORLDS_URL:Fn,BUILDER_LAND_URL:Gn,EVENTS_MY_EVENTS:zn,PLACES_MY_FAVORITE_URL:wn,DOCS_ABOUT_URL:Kn,DOCS_CREATORS_URL:Yn,BLOG_URL:kn,DOCS_CONTRIBUTOR_URL:xn,GOVERNANCE_TRANSPARENCY_URL:Wn,GOVERNANCE_PROPOSALS_URL:Hn,DAO_GRANTS_URL:jn,GOVERNANCE_PROJECTS_URL:Qn,DOCS_DAO_URL:qn,MARKETPLACE_SETTINGS_URL:Jn,DISCORD_URL:Xn,REDDIT_URL:Zn,GITHUB_URL:to,X_URL:eo,INSTAGRAM_URL:no,YOUTUBE_URL:oo,TIKTOK_URL:ao,LINKEDIN_URL:so,PRIVACY_POLICY_URL:ro,TERMS_OF_USE_URL:co,CONTENT_POLICY_URL:_o,CODE_OF_ETHICS_URL:lo,SUPPORT_URL:Ro,EMAIL_HELLO_URL:Lo,FAQ_URL:Eo,DOCS_URL:Uo,BEEHIV_SUBSCRIPTION_URL:io,AUTO_SIGNING_BASE_URL:po,TOP_SCENES_URL:So,IOS_STORE_URL:Oo,ANDROID_STORE_URL:Ao},Bo=M({[I.DEVELOPMENT]:ae,[I.STAGING]:To,[I.PRODUCTION]:Rn});var ho=V,No=function(t){return t!=="theme"},v=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?ho:No},y=function(t,o,a){var e;if(o){var c=o.shouldForwardProp;e=t.__emotion_forwardProp&&c?function(l){return t.__emotion_forwardProp(l)&&c(l)}:c}return typeof e!="function"&&a&&(e=t.__emotion_forwardProp),e},Co=function(t){var o=t.cache,a=t.serialized,e=t.isStringTag;return K(o,a,e),Y(function(){return k(o,a,e)}),null},go=function n(t,o){var a=t.__emotion_real===t,e=a&&t.__emotion_base||t,c,l;o!==void 0&&(c=o.label,l=o.target);var L=y(t,o,a),S=L||v(e),U=!S("as");return function(){var R=arguments,r=a&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(c!==void 0&&r.push("label:"+c+";"),R[0]==null||R[0].raw===void 0)r.push.apply(r,R);else{var E=R[0];r.push(E[0]);for(var p=R.length,_=1;_<p;_++)r.push(R[_],E[_])}var d=F(function(s,i,T){var m=U&&s.as||e,A="",D=[],h=s;if(s.theme==null){h={};for(var $ in s)h[$]=s[$];h.theme=O.useContext(G)}typeof s.className=="string"?A=z(i.registered,D,s.className):s.className!=null&&(A=s.className+" ");var P=w(r.concat(D),i.registered,h);A+=i.key+"-"+P.name,l!==void 0&&(A+=" "+l);var b=U&&L===void 0?v(m):S,N={};for(var C in s)U&&C==="as"||b(C)&&(N[C]=s[C]);return N.className=A,T&&(N.ref=T),O.createElement(O.Fragment,null,O.createElement(Co,{cache:i,serialized:P,isStringTag:typeof m=="string"}),O.createElement(m,N))});return d.displayName=c!==void 0?c:"Styled("+(typeof e=="string"?e:e.displayName||e.name||"Component")+")",d.defaultProps=t.defaultProps,d.__emotion_real=d,d.__emotion_base=e,d.__emotion_styles=r,d.__emotion_forwardProp=L,Object.defineProperty(d,"toString",{value:function(){return"."+l}}),d.withComponent=function(s,i){var T=n(s,u({},o,i,{shouldForwardProp:y(d,i,!0)}));return T.apply(void 0,r)},d}},mo=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],B=go.bind(null);mo.forEach(function(n){B[n]=B(n)});function Io(n){return x("MuiSvgIcon",n)}W("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const uo=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Do=n=>{const{color:t,fontSize:o,classes:a}=n,e={root:["root",t!=="inherit"&&`color${g(t)}`,`fontSize${g(o)}`]};return q(e,Io,a)},$o=J("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(n,t)=>{const{ownerState:o}=n;return[t.root,o.color!=="inherit"&&t[`color${g(o.color)}`],t[`fontSize${g(o.fontSize)}`]]}})(({theme:n,ownerState:t})=>{var o,a,e,c,l,L,S,U,R,r,E,p,_;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(o=n.transitions)==null||(a=o.create)==null?void 0:a.call(o,"fill",{duration:(e=n.transitions)==null||(e=e.duration)==null?void 0:e.shorter}),fontSize:{inherit:"inherit",small:((c=n.typography)==null||(l=c.pxToRem)==null?void 0:l.call(c,20))||"1.25rem",medium:((L=n.typography)==null||(S=L.pxToRem)==null?void 0:S.call(L,24))||"1.5rem",large:((U=n.typography)==null||(R=U.pxToRem)==null?void 0:R.call(U,35))||"2.1875rem"}[t.fontSize],color:(r=(E=(n.vars||n).palette)==null||(E=E[t.color])==null?void 0:E.main)!=null?r:{action:(p=(n.vars||n).palette)==null||(p=p.action)==null?void 0:p.active,disabled:(_=(n.vars||n).palette)==null||(_=_.action)==null?void 0:_.disabled,inherit:void 0}[t.color]}}),Po=O.forwardRef(function(t,o){const a=H({props:t,name:"MuiSvgIcon"}),{children:e,className:c,color:l="inherit",component:L="svg",fontSize:S="medium",htmlColor:U,inheritViewBox:R=!1,titleAccess:r,viewBox:E="0 0 24 24"}=a,p=j(a,uo),_=O.isValidElement(e)&&e.type==="svg",d=u({},a,{color:l,component:L,fontSize:S,instanceFontSize:t.fontSize,inheritViewBox:R,viewBox:E,hasSvgAsChild:_}),s={};R||(s.viewBox=E);const i=Do(d);return f.jsxs($o,u({as:L,className:Q(i.root,c),focusable:"false",color:U,"aria-hidden":r?void 0:!0,role:r?"img":void 0,ref:o},s,p,_&&e.props,{ownerState:d,children:[_?e.props.children:e,r?f.jsx("title",{children:r}):null]}))});Po.muiName="SvgIcon";export{Po as S,Bo as c,B as n};
1
+ import{a3 as M,a4 as I}from"./index-Dh_23qfs.js";import{b as u,i as V,w as F,T as G,h as z,j as w,r as K,l as Y,m as k,g as x,a as W,u as H,_ as j,c as Q,d as g,e as q,s as J}from"./generateUtilityClasses-CKIya6ur.js";import{r as O,j as f}from"./react-4iaCnQ6n.js";const X="https://wearable-preview.decentraland.zone",Z="https://decentraland.zone/account",tt="https://decentraland.zone/profile",et="https://decentraland.zone/marketplace",nt="https://decentraland.zone/builder",ot="https://decentraland.zone/dao",at="https://decentraland.zone/governance",st="https://decentraland.zone/events",rt="https://decentraland.zone/places",ct="https://decentraland.org/create/",dt="https://docs.decentraland.org/player/",_t="https://decentraland.zone/download/creator-hub/",lt="https://decentraland.zone/download/",Rt="https://decentraland.zone/download_success/",Lt="ea2ybdmmn1kv",Et="master",Ut="18g1DzIyBxvu0steSwKyQr",it="https://cms.decentraland.org",pt="https://decentraland.zone/marketplace/names/claim",St="https://decentraland.zone/marketplace/lands",Ot="https://decentraland.zone/marketplace/account",At="https://decentraland.zone/create/",Tt="https://studios.decentraland.zone/",ht="https://decentraland.zone/builder/collections",Nt="https://decentraland.zone/builder/names",Ct="https://decentraland.zone/builder/worlds?tab=dcl",gt="https://decentraland.zone/builder/land",mt="https://decentraland.zone/events/me/",It="https://decentraland.zone/places/favorites/",ut="https://docs.decentraland.org/player/",Dt="https://docs.decentraland.org/creator/",$t="https://decentraland.zone/blog/",Pt="https://docs.decentraland.org/contributor/",ft="https://decentraland.zone/governance/transparency/",vt="https://decentraland.zone/governance/proposals/",yt="https://decentraland.zone/dao/grants/",Bt="https://decentraland.zone/governance/projects/",bt="https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",Mt="https://decentraland.zone/marketplace/settings",Vt="https://dcl.gg/discord",Ft="https://reddit.com/r/decentraland",Gt="https://github.com/decentraland",zt="https://x.com/decentraland",wt="https://instagram.com/decentraland_foundation/",Kt="https://youtube.com/@decentraland_foundation",Yt="https://tiktok.com/@decentraland_fdn",kt="https://linkedin.com/company/decentralandorg",xt="https://decentraland.zone/privacy",Wt="https://decentraland.zone/terms",Ht="https://decentraland.zone/content",jt="https://decentraland.zone/ethics",Qt="https://decentraland.org/help",qt="mailto:hello@decentraland.org",Jt="https://docs.decentraland.org/faqs/decentraland-101",Xt="https://docs.decentraland.org",Zt="https://embeds.beehiiv.com/ff89783d-748b-4ba3-8700-4759f6f62831?slim=true",te="https://download-gateway.decentraland.zone",ee="https://decentraland.zone/top-scenes",ne="https://testflight.apple.com/join/KF4r3jlU",oe="https://play.google.com/store/apps/details?id=org.decentraland.godotexplorer",ae={WEARABLE_PREVIEW_URL:X,ACCOUNT_URL:Z,PROFILE_URL:tt,MARKETPLACE_URL:et,BUILDER_URL:nt,DAO_URL:ot,GOVERNANCE_URL:at,EVENTS_URL:st,PLACES_URL:rt,CREATE_URL:ct,LEARN_URL:dt,CREATOR_HUB_URL:_t,DOWNLOAD_URL:lt,DOWNLOAD_SUCCESS_URL:Rt,CONTENTFUL_SPACE_ID:Lt,CONTENTFUL_ENV:Et,CONTENTFUL_NAVBAR_ENTRY_ID:Ut,CONTENTFUL_CONTENTFUL_CDN_URL:it,MARKETPLACE_NAMES_URL:pt,MARKETPLACE_LANDS_URL:St,MARKETPLACE_MY_ASSETS_URL:Ot,LANDING_CREATORS_URL:At,STUDIOS_URL:Tt,BUILDER_WEARABLE_EMOTES_URL:ht,BUILDER_NAMES_URL:Nt,BUILDER_WORLDS_URL:Ct,BUILDER_LAND_URL:gt,EVENTS_MY_EVENTS:mt,PLACES_MY_FAVORITE_URL:It,DOCS_ABOUT_URL:ut,DOCS_CREATORS_URL:Dt,BLOG_URL:$t,DOCS_CONTRIBUTOR_URL:Pt,GOVERNANCE_TRANSPARENCY_URL:ft,GOVERNANCE_PROPOSALS_URL:vt,DAO_GRANTS_URL:yt,GOVERNANCE_PROJECTS_URL:Bt,DOCS_DAO_URL:bt,MARKETPLACE_SETTINGS_URL:Mt,DISCORD_URL:Vt,REDDIT_URL:Ft,GITHUB_URL:Gt,X_URL:zt,INSTAGRAM_URL:wt,YOUTUBE_URL:Kt,TIKTOK_URL:Yt,LINKEDIN_URL:kt,PRIVACY_POLICY_URL:xt,TERMS_OF_USE_URL:Wt,CONTENT_POLICY_URL:Ht,CODE_OF_ETHICS_URL:jt,SUPPORT_URL:Qt,EMAIL_HELLO_URL:qt,FAQ_URL:Jt,DOCS_URL:Xt,BEEHIV_SUBSCRIPTION_URL:Zt,AUTO_SIGNING_BASE_URL:te,TOP_SCENES_URL:ee,IOS_STORE_URL:ne,ANDROID_STORE_URL:oe},se="https://wearable-preview.decentraland.org",re="https://decentraland.org/account",ce="https://decentraland.org/profile",de="https://decentraland.org/marketplace",_e="https://decentraland.org/builder",le="https://decentraland.org/dao",Re="https://decentraland.org/governance",Le="https://decentraland.org/events",Ee="https://decentraland.org/places",Ue="https://decentraland.org/create/",ie="https://docs.decentraland.org/player/",pe="https://decentraland.org/download/creator-hub/",Se="https://decentraland.org/download/",Oe="https://decentraland.org/download_success/",Ae="ea2ybdmmn1kv",Te="master",he="18g1DzIyBxvu0steSwKyQr",Ne="https://cms.decentraland.org",Ce="https://decentraland.org/marketplace/names/claim",ge="https://decentraland.org/marketplace/lands",me="https://decentraland.org/marketplace/account",Ie="https://decentraland.org/create/",ue="https://studios.decentraland.org/",De="https://decentraland.org/builder/collections",$e="https://decentraland.org/builder/names",Pe="https://decentraland.org/builder/worlds?tab=dcl",fe="https://decentraland.org/builder/land",ve="https://decentraland.org/events/me/",ye="https://decentraland.org/places/favorites/",Be="https://docs.decentraland.org/player/",be="https://docs.decentraland.org/creator/",Me="https://decentraland.org/blog/",Ve="https://docs.decentraland.org/contributor/",Fe="https://decentraland.org/governance/transparency/",Ge="https://decentraland.org/governance/proposals/",ze="https://decentraland.org/dao/grants/",we="https://decentraland.org/governance/projects/",Ke="https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",Ye="https://decentraland.org/marketplace/settings",ke="https://dcl.gg/discord",xe="https://reddit.com/r/decentraland",We="https://github.com/decentraland",He="https://x.com/decentraland",je="https://instagram.com/decentraland_foundation/",Qe="https://youtube.com/@decentraland_foundation",qe="https://tiktok.com/@decentraland_fdn",Je="https://linkedin.com/company/decentralandorg",Xe="https://decentraland.org/privacy",Ze="https://decentraland.org/terms",tn="https://decentraland.org/content",en="https://decentraland.org/ethics",nn="https://decentraland.org/help",on="mailto:hello@decentraland.org",an="https://docs.decentraland.org/faqs/decentraland-101",sn="https://docs.decentraland.org",rn="https://embeds.beehiiv.com/ff89783d-748b-4ba3-8700-4759f6f62831?slim=true",cn="https://download-gateway.decentraland.org",dn="https://decentraland.org/top-scenes",_n="https://testflight.apple.com/join/KF4r3jlU",ln="https://play.google.com/store/apps/details?id=org.decentraland.godotexplorer",Rn={WEARABLE_PREVIEW_URL:se,ACCOUNT_URL:re,PROFILE_URL:ce,MARKETPLACE_URL:de,BUILDER_URL:_e,DAO_URL:le,GOVERNANCE_URL:Re,EVENTS_URL:Le,PLACES_URL:Ee,CREATE_URL:Ue,LEARN_URL:ie,CREATOR_HUB_URL:pe,DOWNLOAD_URL:Se,DOWNLOAD_SUCCESS_URL:Oe,CONTENTFUL_SPACE_ID:Ae,CONTENTFUL_ENV:Te,CONTENTFUL_NAVBAR_ENTRY_ID:he,CONTENTFUL_CONTENTFUL_CDN_URL:Ne,MARKETPLACE_NAMES_URL:Ce,MARKETPLACE_LANDS_URL:ge,MARKETPLACE_MY_ASSETS_URL:me,LANDING_CREATORS_URL:Ie,STUDIOS_URL:ue,BUILDER_WEARABLE_EMOTES_URL:De,BUILDER_NAMES_URL:$e,BUILDER_WORLDS_URL:Pe,BUILDER_LAND_URL:fe,EVENTS_MY_EVENTS:ve,PLACES_MY_FAVORITE_URL:ye,DOCS_ABOUT_URL:Be,DOCS_CREATORS_URL:be,BLOG_URL:Me,DOCS_CONTRIBUTOR_URL:Ve,GOVERNANCE_TRANSPARENCY_URL:Fe,GOVERNANCE_PROPOSALS_URL:Ge,DAO_GRANTS_URL:ze,GOVERNANCE_PROJECTS_URL:we,DOCS_DAO_URL:Ke,MARKETPLACE_SETTINGS_URL:Ye,DISCORD_URL:ke,REDDIT_URL:xe,GITHUB_URL:We,X_URL:He,INSTAGRAM_URL:je,YOUTUBE_URL:Qe,TIKTOK_URL:qe,LINKEDIN_URL:Je,PRIVACY_POLICY_URL:Xe,TERMS_OF_USE_URL:Ze,CONTENT_POLICY_URL:tn,CODE_OF_ETHICS_URL:en,SUPPORT_URL:nn,EMAIL_HELLO_URL:on,FAQ_URL:an,DOCS_URL:sn,BEEHIV_SUBSCRIPTION_URL:rn,AUTO_SIGNING_BASE_URL:cn,TOP_SCENES_URL:dn,IOS_STORE_URL:_n,ANDROID_STORE_URL:ln},Ln="https://wearable-preview.decentraland.today",En="https://decentraland.today/account",Un="https://decentraland.today/profile",pn="https://decentraland.today/marketplace",Sn="https://decentraland.today/builder",On="https://decentraland.today/dao",An="https://decentraland.today/governance",Tn="https://decentraland.zone/events",hn="https://decentraland.zone/places",Nn="https://decentraland.today/create/",Cn="https://docs.decentraland.org/player/",gn="https://decentraland.today/download/creator-hub/",mn="https://decentraland.today/download/",In="https://decentraland.today/download_success/",un="ea2ybdmmn1kv",Dn="master",$n="18g1DzIyBxvu0steSwKyQr",Pn="https://cms.decentraland.org",fn="https://decentraland.today/marketplace/names/claim",vn="https://decentraland.today/marketplace/lands",yn="https://decentraland.today/marketplace/account",Bn="https://decentraland.today/create/",bn="https://studios.decentraland.today/",Mn="https://decentraland.today/builder/collections",Vn="https://decentraland.today/builder/names",Fn="https://decentraland.today/builder/worlds?tab=dcl",Gn="https://decentraland.today/builder/land",zn="https://decentraland.today/events/me/",wn="https://decentraland.today/places/favorites/",Kn="https://docs.decentraland.org/player/",Yn="https://docs.decentraland.org/creator/",kn="https://decentraland.today/blog/",xn="https://docs.decentraland.org/contributor/",Wn="https://decentraland.today/governance/transparency/",Hn="https://decentraland.today/governance/proposals/",jn="https://decentraland.today/dao/grants/",Qn="https://decentraland.today/governance/projects/",qn="https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",Jn="https://decentraland.today/marketplace/settings",Xn="https://dcl.gg/discord",Zn="https://reddit.com/r/decentraland",to="https://github.com/decentraland",eo="https://x.com/decentraland",no="https://instagram.com/decentraland_foundation/",oo="https://youtube.com/@decentraland_foundation",ao="https://tiktok.com/@decentraland_fdn",so="https://linkedin.com/company/decentralandorg",ro="https://decentraland.org/privacy",co="https://decentraland.org/terms",_o="https://decentraland.org/content",lo="https://decentraland.org/ethics",Ro="https://decentraland.org/help",Lo="mailto:hello@decentraland.org",Eo="https://docs.decentraland.org/faqs/decentraland-101",Uo="https://docs.decentraland.org",io="https://embeds.beehiiv.com/ff89783d-748b-4ba3-8700-4759f6f62831?slim=true",po="https://download-gateway.decentraland.zone",So="https://decentraland.zone/top-scenes",Oo="https://testflight.apple.com/join/KF4r3jlU",Ao="https://play.google.com/store/apps/details?id=org.decentraland.godotexplorer",To={WEARABLE_PREVIEW_URL:Ln,ACCOUNT_URL:En,PROFILE_URL:Un,MARKETPLACE_URL:pn,BUILDER_URL:Sn,DAO_URL:On,GOVERNANCE_URL:An,EVENTS_URL:Tn,PLACES_URL:hn,CREATE_URL:Nn,LEARN_URL:Cn,CREATOR_HUB_URL:gn,DOWNLOAD_URL:mn,DOWNLOAD_SUCCESS_URL:In,CONTENTFUL_SPACE_ID:un,CONTENTFUL_ENV:Dn,CONTENTFUL_NAVBAR_ENTRY_ID:$n,CONTENTFUL_CONTENTFUL_CDN_URL:Pn,MARKETPLACE_NAMES_URL:fn,MARKETPLACE_LANDS_URL:vn,MARKETPLACE_MY_ASSETS_URL:yn,LANDING_CREATORS_URL:Bn,STUDIOS_URL:bn,BUILDER_WEARABLE_EMOTES_URL:Mn,BUILDER_NAMES_URL:Vn,BUILDER_WORLDS_URL:Fn,BUILDER_LAND_URL:Gn,EVENTS_MY_EVENTS:zn,PLACES_MY_FAVORITE_URL:wn,DOCS_ABOUT_URL:Kn,DOCS_CREATORS_URL:Yn,BLOG_URL:kn,DOCS_CONTRIBUTOR_URL:xn,GOVERNANCE_TRANSPARENCY_URL:Wn,GOVERNANCE_PROPOSALS_URL:Hn,DAO_GRANTS_URL:jn,GOVERNANCE_PROJECTS_URL:Qn,DOCS_DAO_URL:qn,MARKETPLACE_SETTINGS_URL:Jn,DISCORD_URL:Xn,REDDIT_URL:Zn,GITHUB_URL:to,X_URL:eo,INSTAGRAM_URL:no,YOUTUBE_URL:oo,TIKTOK_URL:ao,LINKEDIN_URL:so,PRIVACY_POLICY_URL:ro,TERMS_OF_USE_URL:co,CONTENT_POLICY_URL:_o,CODE_OF_ETHICS_URL:lo,SUPPORT_URL:Ro,EMAIL_HELLO_URL:Lo,FAQ_URL:Eo,DOCS_URL:Uo,BEEHIV_SUBSCRIPTION_URL:io,AUTO_SIGNING_BASE_URL:po,TOP_SCENES_URL:So,IOS_STORE_URL:Oo,ANDROID_STORE_URL:Ao},Bo=M({[I.DEVELOPMENT]:ae,[I.STAGING]:To,[I.PRODUCTION]:Rn});var ho=V,No=function(t){return t!=="theme"},v=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?ho:No},y=function(t,o,a){var e;if(o){var c=o.shouldForwardProp;e=t.__emotion_forwardProp&&c?function(l){return t.__emotion_forwardProp(l)&&c(l)}:c}return typeof e!="function"&&a&&(e=t.__emotion_forwardProp),e},Co=function(t){var o=t.cache,a=t.serialized,e=t.isStringTag;return K(o,a,e),Y(function(){return k(o,a,e)}),null},go=function n(t,o){var a=t.__emotion_real===t,e=a&&t.__emotion_base||t,c,l;o!==void 0&&(c=o.label,l=o.target);var L=y(t,o,a),S=L||v(e),U=!S("as");return function(){var R=arguments,r=a&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(c!==void 0&&r.push("label:"+c+";"),R[0]==null||R[0].raw===void 0)r.push.apply(r,R);else{var E=R[0];r.push(E[0]);for(var p=R.length,_=1;_<p;_++)r.push(R[_],E[_])}var d=F(function(s,i,T){var m=U&&s.as||e,A="",D=[],h=s;if(s.theme==null){h={};for(var $ in s)h[$]=s[$];h.theme=O.useContext(G)}typeof s.className=="string"?A=z(i.registered,D,s.className):s.className!=null&&(A=s.className+" ");var P=w(r.concat(D),i.registered,h);A+=i.key+"-"+P.name,l!==void 0&&(A+=" "+l);var b=U&&L===void 0?v(m):S,N={};for(var C in s)U&&C==="as"||b(C)&&(N[C]=s[C]);return N.className=A,T&&(N.ref=T),O.createElement(O.Fragment,null,O.createElement(Co,{cache:i,serialized:P,isStringTag:typeof m=="string"}),O.createElement(m,N))});return d.displayName=c!==void 0?c:"Styled("+(typeof e=="string"?e:e.displayName||e.name||"Component")+")",d.defaultProps=t.defaultProps,d.__emotion_real=d,d.__emotion_base=e,d.__emotion_styles=r,d.__emotion_forwardProp=L,Object.defineProperty(d,"toString",{value:function(){return"."+l}}),d.withComponent=function(s,i){var T=n(s,u({},o,i,{shouldForwardProp:y(d,i,!0)}));return T.apply(void 0,r)},d}},mo=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],B=go.bind(null);mo.forEach(function(n){B[n]=B(n)});function Io(n){return x("MuiSvgIcon",n)}W("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const uo=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Do=n=>{const{color:t,fontSize:o,classes:a}=n,e={root:["root",t!=="inherit"&&`color${g(t)}`,`fontSize${g(o)}`]};return q(e,Io,a)},$o=J("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(n,t)=>{const{ownerState:o}=n;return[t.root,o.color!=="inherit"&&t[`color${g(o.color)}`],t[`fontSize${g(o.fontSize)}`]]}})(({theme:n,ownerState:t})=>{var o,a,e,c,l,L,S,U,R,r,E,p,_;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(o=n.transitions)==null||(a=o.create)==null?void 0:a.call(o,"fill",{duration:(e=n.transitions)==null||(e=e.duration)==null?void 0:e.shorter}),fontSize:{inherit:"inherit",small:((c=n.typography)==null||(l=c.pxToRem)==null?void 0:l.call(c,20))||"1.25rem",medium:((L=n.typography)==null||(S=L.pxToRem)==null?void 0:S.call(L,24))||"1.5rem",large:((U=n.typography)==null||(R=U.pxToRem)==null?void 0:R.call(U,35))||"2.1875rem"}[t.fontSize],color:(r=(E=(n.vars||n).palette)==null||(E=E[t.color])==null?void 0:E.main)!=null?r:{action:(p=(n.vars||n).palette)==null||(p=p.action)==null?void 0:p.active,disabled:(_=(n.vars||n).palette)==null||(_=_.action)==null?void 0:_.disabled,inherit:void 0}[t.color]}}),Po=O.forwardRef(function(t,o){const a=H({props:t,name:"MuiSvgIcon"}),{children:e,className:c,color:l="inherit",component:L="svg",fontSize:S="medium",htmlColor:U,inheritViewBox:R=!1,titleAccess:r,viewBox:E="0 0 24 24"}=a,p=j(a,uo),_=O.isValidElement(e)&&e.type==="svg",d=u({},a,{color:l,component:L,fontSize:S,instanceFontSize:t.fontSize,inheritViewBox:R,viewBox:E,hasSvgAsChild:_}),s={};R||(s.viewBox=E);const i=Do(d);return f.jsxs($o,u({as:L,className:Q(i.root,c),focusable:"false",color:U,"aria-hidden":r?void 0:!0,role:r?"img":void 0,ref:o},s,p,_&&e.props,{ownerState:d,children:[_?e.props.children:e,r?f.jsx("title",{children:r}):null]}))});Po.muiName="SvgIcon";export{Po as S,Bo as c,B as n};
@@ -1 +1 @@
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 L,C as g,B as N,b as W,m as E,A as O,n as z,d as _,g as R,o as H,e as V,i as q,p as $}from"./W3MFrameProviderSingleton-CPW2Gx43.js";import{au as C}from"./NetworkUtil-aE1iGnVj.js";const b={getGasPriceInEther(n,o){const t=o*n;return Number(t)/1e18},getGasPriceInUSD(n,o,t){const s=b.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,m={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:_.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=$({...m}),D={state:e,subscribe(n){return q(e,()=>n(e))},subscribeKey(n,o){return V(e,n,o)},getParams(){var i,u,p,w,h,y,A,S,P;const n=g.state.activeChain,o=((i=g.getAccountData(n))==null?void 0:i.caipAddress)??g.state.activeCaipAddress,t=W.getPlainAddress(o),s=R(),c=H.getConnectorId(g.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)||!((h=e.sourceToken)!=null&&h.decimals)||!T.bigNumber(e.sourceTokenAmount).gt(0),l=!e.sourceTokenAmount;return{networkAddress:s,fromAddress:t,fromCaipAddress:o,sourceTokenAddress:(y=e.sourceToken)==null?void 0:y.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===C.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=m.myTokensWithBalance,e.tokensPriceMap=m.tokensPriceMap,e.initialized=m.initialized,e.initializing=m.initializing,e.switchingTokens=m.switchingTokens,e.sourceToken=m.sourceToken,e.sourceTokenAmount=m.sourceTokenAmount,e.sourceTokenPriceInUSD=m.sourceTokenPriceInUSD,e.toToken=m.toToken,e.toTokenAmount=m.toTokenAmount,e.toTokenPriceInUSD=m.toTokenPriceInUSD,e.networkPrice=m.networkPrice,e.networkTokenSymbol=m.networkTokenSymbol,e.networkBalanceInUSD=m.networkBalanceInUSD,e.inputError=m.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=g.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=_.SUGGESTED_TOKENS_BY_CHAIN)==null?void 0:t[n])||[]).map(i=>s.find(u=>u.symbol===i)).filter(i=>!!i),l=(_.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:g.state.activeCaipNetwork,address:(s=g.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=g.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=g.state)==null?void 0:o.activeCaipNetwork)==null?void 0:t.chainNamespace){case C.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 C.CHAIN.EVM:default:const s=n.standard??"0",c=BigInt(s),r=BigInt(x),d=b.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=g.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=W.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 h=W.getPlainAddress(u.tx.to);if(!h)throw new Error("SwapController:createSwapTransaction - address is required");const y={data:u.tx.data,to:h,gas:p,gasPrice:w,value:BigInt(i?r??"0":"0"),toAmount:e.toTokenAmount};return e.gasPriceInUSD=b.getGasPriceInUSD(e.networkPrice,p,w),e.approvalTransaction=void 0,e.swapTransaction=y,y}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:C.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=g.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(C.CHAIN.EVM)===L.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(n){var d,l,i,u,p,w,h,y,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:C.CHAIN.EVM});return e.loadingTransaction=!1,f.showSuccess(r),M.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((h=g.state.activeCaipNetwork)==null?void 0:h.caipNetworkId)||"",swapFromToken:((y=a.state.sourceToken)==null?void 0:y.symbol)||"",swapToToken:((A=a.state.toToken)==null?void 0:A.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:F(C.CHAIN.EVM)===L.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=g.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(C.CHAIN.EVM)===L.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(n,o){return b.isInsufficientSourceTokenForSwap(n,o,e.myTokensWithBalance)},setTransactionDetails(){const{toTokenAddress:n,toTokenDecimals:o}=a.getParams();!n||!o||(e.gasPriceInUSD=b.getGasPriceInUSD(e.networkPrice,BigInt(e.gasFee),BigInt(x)),e.priceImpact=b.getPriceImpact({sourceTokenAmount:e.sourceTokenAmount,sourceTokenPriceInUSD:e.sourceTokenPriceInUSD,toTokenPriceInUSD:e.toTokenPriceInUSD,toTokenAmount:e.toTokenAmount}),e.maxSlippage=b.getMaxSlippage(e.slippage,e.toTokenAmount),e.providerFee=b.getProviderFee(e.sourceTokenAmount))}},a=G(D);export{a as S};
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 L,C as g,B as N,b as W,m as E,A as O,n as z,d as _,g as R,o as H,e as V,i as q,p as $}from"./W3MFrameProviderSingleton-BGrWzqsE.js";import{au as C}from"./NetworkUtil-aE1iGnVj.js";const b={getGasPriceInEther(n,o){const t=o*n;return Number(t)/1e18},getGasPriceInUSD(n,o,t){const s=b.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,m={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:_.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=$({...m}),D={state:e,subscribe(n){return q(e,()=>n(e))},subscribeKey(n,o){return V(e,n,o)},getParams(){var i,u,p,w,h,y,A,S,P;const n=g.state.activeChain,o=((i=g.getAccountData(n))==null?void 0:i.caipAddress)??g.state.activeCaipAddress,t=W.getPlainAddress(o),s=R(),c=H.getConnectorId(g.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)||!((h=e.sourceToken)!=null&&h.decimals)||!T.bigNumber(e.sourceTokenAmount).gt(0),l=!e.sourceTokenAmount;return{networkAddress:s,fromAddress:t,fromCaipAddress:o,sourceTokenAddress:(y=e.sourceToken)==null?void 0:y.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===C.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=m.myTokensWithBalance,e.tokensPriceMap=m.tokensPriceMap,e.initialized=m.initialized,e.initializing=m.initializing,e.switchingTokens=m.switchingTokens,e.sourceToken=m.sourceToken,e.sourceTokenAmount=m.sourceTokenAmount,e.sourceTokenPriceInUSD=m.sourceTokenPriceInUSD,e.toToken=m.toToken,e.toTokenAmount=m.toTokenAmount,e.toTokenPriceInUSD=m.toTokenPriceInUSD,e.networkPrice=m.networkPrice,e.networkTokenSymbol=m.networkTokenSymbol,e.networkBalanceInUSD=m.networkBalanceInUSD,e.inputError=m.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=g.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=_.SUGGESTED_TOKENS_BY_CHAIN)==null?void 0:t[n])||[]).map(i=>s.find(u=>u.symbol===i)).filter(i=>!!i),l=(_.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:g.state.activeCaipNetwork,address:(s=g.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=g.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=g.state)==null?void 0:o.activeCaipNetwork)==null?void 0:t.chainNamespace){case C.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 C.CHAIN.EVM:default:const s=n.standard??"0",c=BigInt(s),r=BigInt(x),d=b.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=g.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=W.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 h=W.getPlainAddress(u.tx.to);if(!h)throw new Error("SwapController:createSwapTransaction - address is required");const y={data:u.tx.data,to:h,gas:p,gasPrice:w,value:BigInt(i?r??"0":"0"),toAmount:e.toTokenAmount};return e.gasPriceInUSD=b.getGasPriceInUSD(e.networkPrice,p,w),e.approvalTransaction=void 0,e.swapTransaction=y,y}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:C.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=g.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(C.CHAIN.EVM)===L.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(n){var d,l,i,u,p,w,h,y,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:C.CHAIN.EVM});return e.loadingTransaction=!1,f.showSuccess(r),M.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((h=g.state.activeCaipNetwork)==null?void 0:h.caipNetworkId)||"",swapFromToken:((y=a.state.sourceToken)==null?void 0:y.symbol)||"",swapToToken:((A=a.state.toToken)==null?void 0:A.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:F(C.CHAIN.EVM)===L.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=g.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(C.CHAIN.EVM)===L.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(n,o){return b.isInsufficientSourceTokenForSwap(n,o,e.myTokensWithBalance)},setTransactionDetails(){const{toTokenAddress:n,toTokenDecimals:o}=a.getParams();!n||!o||(e.gasPriceInUSD=b.getGasPriceInUSD(e.networkPrice,BigInt(e.gasFee),BigInt(x)),e.priceImpact=b.getPriceImpact({sourceTokenAmount:e.sourceTokenAmount,sourceTokenPriceInUSD:e.sourceTokenPriceInUSD,toTokenPriceInUSD:e.toTokenPriceInUSD,toTokenAmount:e.toTokenAmount}),e.maxSlippage=b.getMaxSlippage(e.slippage,e.toTokenAmount),e.providerFee=b.getProviderFee(e.sourceTokenAmount))}},a=G(D);export{a as S};
@@ -1 +1 @@
1
- var xe=Object.defineProperty;var Ie=(e,t,n)=>t in e?xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var T=(e,t,n)=>Ie(e,typeof t!="symbol"?t+"":t,n);import{W as we,b as oe,C as ve,B as Se,f as ie}from"./ethers-CU3Ctw5k.js";import{a5 as Re,a6 as Ne,D as X,a7 as Oe}from"./index-D9XZpwfV.js";import{c as ce}from"./react-4iaCnQ6n.js";import{O as Pe,M as be,D as De,a as ue,g as de}from"./index-B94ghhpu.js";import"./network-CCTP_tzM.js";import{c as K,e as Le}from"./index-zVvLDKBh.js";const Ue="2d0335ab",Fe="0c53c51c",Me="d8ed1acc",ke=ye("0x");let je=0;async function $e(e){let t=[];try{t=await H(e,"eth_requestAccounts",[])}catch{t=await H(e,"eth_accounts",[])}if(t.length===0)throw new Error("Could not find a valid connected account");return t[0]}async function qe(e,t,n){return H(e,"eth_signTypedData_v4",[t,n])}function He(e,t,n){const r=t.replace("0x",""),s=r.substring(0,64),i=r.substring(64,128),u=Be(r.substring(128,130)),d=n.replace("0x",""),f=(d.length/2).toString(16),w=Math.ceil(d.length/64);return["0x",Fe,_(e),_("a0"),s,i,_(u),_(f),d.padEnd(64*w,"0")].join("")}function Ge(e,t,n){const r=n.replace("0x",""),s=t.replace("0x",""),u=96+32+r.length/2,d=Math.ceil(s.length/64);return["0x",Me,_(e),_("60"),_(u.toString(16)),_((r.length/2).toString(16)),r,_((s.length/2).toString(16)),s.padEnd(64*d,"0")].join("")}function Be(e){let t=parseInt(e,16);if(t<27&&(t+=27),t!==27&&t!==28)throw Error(`Invalid signature version "${e}" (parsed: ${t})`);return t.toString(16)}async function Ve(e,t,n){const r=_(t),s=await H(e,"eth_call",[{data:`0x${Ue}${r}`,to:n},"latest"]);return _(s)}function Je(e){return typeof e=="number"?`0x${_(e.toString(16))}`:`0x${_(e)}`}function We(e,t){return H(e,"eth_getCode",[t.toLowerCase(),"latest"])}const Ye="0xef01";async function Ze(e,t){const n=await We(e,t);return n.toLowerCase().startsWith(Ye)?!1:!Xe(n)}function ye(e){if(!/^0x[0-9a-f]*$/gi.test(e))throw new Error(`Not a valid hex string "${e}"`);let t=e.slice(2);for(;t.length<40;)t="0"+t;return"0x"+t}function Xe(e){return ye(e.toLowerCase())===ke}function _(e){return e.toString().replace("0x","").padStart(64,"0")}async function H(e,t,n){let r,s={jsonrpc:"2.0",id:++je,method:t,params:n};if(e.request!==void 0?r=await e.request(s):e.sendAsync!==void 0?r=await e.sendAsync(s):e.send!==void 0&&(r=await e.send(t,n)),r)return r.result||r;throw new Error(`Could not send the transaction correcty. Either the provider does not support the method "${t}" or is missing a proper send/request.`)}function Ke(){return{serverURL:"https://transactions-api.decentraland.io/v1"}}var k;(function(e){e.UNKNOWN="unknown",e.DAPP_LIMIT_REACHED="dapp_limit_reached",e.USER_LIMIT_REACHED="user_limit_reached",e.API_LIMIT_REACHED="api_limit_reached",e.GAS_LIMIT_REACHED="gas_limit_reached",e.EXPECTATION_FAILED="expectation_failed",e.INVALID_TRANSACTION="invalid_transaction",e.INVALID_SCHEMA="invalid_schema",e.INVALID_CONTRACT_ADDRESS="invalid_contract_address",e.INVALID_ADDRESS="invalid_address",e.SALE_PRICE_TOO_LOW="sale_price_too_low",e.QUOTA_REACHED="quota_reached",e.CONTRACT_ACCOUNT="contract_account",e.HIGH_CONGESTION="high_congestion",e.USER_DENIED="user_denied"})(k||(k={}));class P extends Error{constructor(n,r){super(n);T(this,"code");this.code=r,Object.setPrototypeOf(this,P.prototype)}}async function ze(e,t,n,r,s={}){const i={...Ke(),...s};if(!r.address.trim())throw new P(`The contract address for ${r.name} is empty. You're probably trying to get a proxy contract. Try adding an address to the result of getContract`,k.INVALID_ADDRESS);try{const u=await $e(e);if(await Ze(e,u))throw new P("Contract accounts are not supported",k.CONTRACT_ACCOUNT);const d=r.abi.some(B=>{var V;return B.name==="executeMetaTransaction"&&((V=B.inputs)==null?void 0:V.some(W=>W.name==="_functionData"))}),f=await Ve(t,u,r.address),w=Je(r.chainId),I=et(w,r),D=Qe(u,f,n,I,d),L=await qe(e,u,JSON.stringify(D)),G=(d?Ge:He)(u,L,n),j=await fetch(`${i.serverURL}/transactions`,{headers:{"Content-Type":"application/json"},body:JSON.stringify({transactionData:{from:u,params:[r.address,G]}}),method:"POST"}),N=await j.json();if(N.ok===!1)throw N.message&&N.code?new P(N.message,N.code):new Error(`HTTP Error. Status: ${j.status}.`);return N.txHash}catch(u){const d=u;throw d instanceof P?d:d.message.indexOf("User denied message signature")!==-1?new P(d.message,k.USER_DENIED):(console.warn("An error occurred trying to send the meta transaction. Error:",d.message),new P(d.message,k.UNKNOWN))}}function Qe(e,t,n,r,s=!1){return{types:{EIP712Domain:De,MetaTransaction:s?Pe:be},domain:r,primaryType:"MetaTransaction",message:{nonce:parseInt(t,16),from:e,...s?{functionData:n}:{functionSignature:n}}}}function et(e,t){return{name:t.name,version:t.version,verifyingContract:t.address,salt:e}}Re();var tt=Ne();async function nt(e){const t=await Ee();if(t){const n=await new we(t).getSigner().getChainId();if(e===n)return t}return K.createProvider(tt.ProviderType.NETWORK,e)}async function Ee(){try{return await K.getProvider()}catch{try{const{provider:e}=await K.tryPreviousConnection();return e}catch{return null}}}function le(e){return Math.floor(e/1e3)}function he(e){switch(e.assetType){case X.TradeAssetType.ERC721:return e.tokenId;case X.TradeAssetType.COLLECTION_ITEM:return e.itemId;case X.TradeAssetType.ERC20:return e.amount;default:return console.error("Invalid asset type:",e),""}}function rt(e){var t;return{checks:{uses:e.checks.uses,expiration:le(e.checks.expiration),effective:le(e.checks.effective),salt:oe(e.checks.salt,32),contractSignatureIndex:e.checks.contractSignatureIndex,signerSignatureIndex:e.checks.signerSignatureIndex,allowedRoot:oe(e.checks.allowedRoot,32),externalChecks:(t=e.checks.externalChecks)==null?void 0:t.map(n=>({contractAddress:n.contractAddress,selector:n.selector,value:n.value?n.value:"0x",required:n.required}))},sent:e.sent.map(n=>({assetType:n.assetType,contractAddress:n.contractAddress,value:he(n),extra:n.extra?n.extra:"0x"})),received:e.received.map(n=>({assetType:n.assetType,contractAddress:n.contractAddress,value:he(n),extra:n.extra?n.extra:"0x",beneficiary:n.beneficiary}))}}function fe(e,t){const n=rt(e);return{signer:e.signer,signature:e.signature,...n,checks:{...n.checks,allowedProof:[]},sent:n.sent.map(r=>({...r,beneficiary:t}))}}async function at(e){const t=await e.request({method:"eth_chainId",params:[]});let n;return typeof t=="string"?n=parseInt(t,16):n=t,n}async function st(e){const t=await nt(e);return new we(t)}const b=new Le.EventEmitter;var x;(function(e){e.ERROR="error",e.SUCCESS="success",e.PROMPT="prompt",e.ACCEPT="accept",e.REJECT="reject"})(x||(x={}));let ot="https://transactions-api.decentraland.org/v1";const it=()=>ot,ct=()=>new Promise((e,t)=>{const n=()=>{b.removeAllListeners(x.REJECT),e(!0)},r=()=>{b.removeAllListeners(x.ACCEPT),t(new Error("User rejected transaction"))};b.addListener(x.ACCEPT,n),b.addListener(x.REJECT,r)});async function pe(...e){const[t,n,...r]=e;try{const s=await Ee();if(!s)throw new Error("Provider not connected");const i=await at(s),u=await st(t.chainId),d=new ve(t.address,t.abi,u),f=await(typeof n=="function"?n(d.populateTransaction):d.populateTransaction[n](...r));if(i===t.chainId){const w=u.getSigner();if(s.isMagic||s.isThirdweb){let D=Se.from(0);try{const L=await w.getGasPrice(),U=await w.estimateGas(f);D=L.mul(U)}catch{}if(!D.isZero()){const L=ct(),U=await w.getBalance();b.emit(x.PROMPT,{transactionGasPrice:ie(D),userBalance:ie(U),chainId:t.chainId}),await L}}const I=await w.sendTransaction(f);return b.emit(x.SUCCESS,{txHash:I.hash}),I.hash}else{const w=await ze(s,u,f.data,t,{serverURL:it()});return b.emit(x.SUCCESS,{txHash:w}),w}}catch(s){const i={type:x.ERROR,error:s};throw b.emit(x.ERROR,i),s}}var q={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var ut=q.exports,Te;function dt(){return Te||(Te=1,(function(e,t){(function(n){var r=t&&!t.nodeType&&t,s=e&&!e.nodeType&&e,i=typeof ce=="object"&&ce;(i.global===i||i.window===i||i.self===i)&&(n=i);var u,d=2147483647,f=36,w=1,I=26,D=38,L=700,U=72,G=128,j="-",N=/^xn--/,B=/[^\x20-\x7E]/,V=/[\x2E\u3002\uFF0E\uFF61]/g,W={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Y=f-w,v=Math.floor,$=String.fromCharCode,J;function F(a){throw new RangeError(W[a])}function z(a,o){for(var c=a.length,l=[];c--;)l[c]=o(a[c]);return l}function Q(a,o){var c=a.split("@"),l="";c.length>1&&(l=c[0]+"@",a=c[1]),a=a.replace(V,".");var h=a.split("."),y=z(h,o).join(".");return l+y}function ee(a){for(var o=[],c=0,l=a.length,h,y;c<l;)h=a.charCodeAt(c++),h>=55296&&h<=56319&&c<l?(y=a.charCodeAt(c++),(y&64512)==56320?o.push(((h&1023)<<10)+(y&1023)+65536):(o.push(h),c--)):o.push(h);return o}function te(a){return z(a,function(o){var c="";return o>65535&&(o-=65536,c+=$(o>>>10&1023|55296),o=56320|o&1023),c+=$(o),c}).join("")}function me(a){return a-48<10?a-22:a-65<26?a-65:a-97<26?a-97:f}function ne(a,o){return a+22+75*(a<26)-((o!=0)<<5)}function re(a,o,c){var l=0;for(a=c?v(a/L):a>>1,a+=v(a/o);a>Y*I>>1;l+=f)a=v(a/Y);return v(l+(Y+1)*a/(a+D))}function ae(a){var o=[],c=a.length,l,h=0,y=G,p=U,E,A,S,R,g,m,C,O,M;for(E=a.lastIndexOf(j),E<0&&(E=0),A=0;A<E;++A)a.charCodeAt(A)>=128&&F("not-basic"),o.push(a.charCodeAt(A));for(S=E>0?E+1:0;S<c;){for(R=h,g=1,m=f;S>=c&&F("invalid-input"),C=me(a.charCodeAt(S++)),(C>=f||C>v((d-h)/g))&&F("overflow"),h+=C*g,O=m<=p?w:m>=p+I?I:m-p,!(C<O);m+=f)M=f-O,g>v(d/M)&&F("overflow"),g*=M;l=o.length+1,p=re(h-R,l,R==0),v(h/l)>d-y&&F("overflow"),y+=v(h/l),h%=l,o.splice(h++,0,y)}return te(o)}function se(a){var o,c,l,h,y,p,E,A,S,R,g,m=[],C,O,M,Z;for(a=ee(a),C=a.length,o=G,c=0,y=U,p=0;p<C;++p)g=a[p],g<128&&m.push($(g));for(l=h=m.length,h&&m.push(j);l<C;){for(E=d,p=0;p<C;++p)g=a[p],g>=o&&g<E&&(E=g);for(O=l+1,E-o>v((d-c)/O)&&F("overflow"),c+=(E-o)*O,o=E,p=0;p<C;++p)if(g=a[p],g<o&&++c>d&&F("overflow"),g==o){for(A=c,S=f;R=S<=y?w:S>=y+I?I:S-y,!(A<R);S+=f)Z=A-R,M=f-R,m.push($(ne(R+Z%M,0))),A=v(Z/M);m.push($(ne(A,0))),y=re(c,O,l==h),c=0,++l}++c,++o}return m.join("")}function Ae(a){return Q(a,function(o){return N.test(o)?ae(o.slice(4).toLowerCase()):o})}function Ce(a){return Q(a,function(o){return B.test(o)?"xn--"+se(o):o})}if(u={version:"1.4.1",ucs2:{decode:ee,encode:te},decode:ae,encode:se,toASCII:Ce,toUnicode:Ae},r&&s)if(e.exports==r)s.exports=u;else for(J in u)u.hasOwnProperty(J)&&(r[J]=u[J]);else n.punycode=u})(ut)})(q,q.exports)),q.exports}dt();var _e=(function(e){function t(){var r=this||self;return delete e.prototype.__magic__,r}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var n=__magic__;return n})(Object),lt=_e.URL;_e.URLSearchParams;var ht={URL:lt};class ge extends Error{constructor(n,r,s){super(n);T(this,"status");T(this,"data");this.status=r,this.data=s}}const ft=3,pt=1e3,Tt=[400,401,403,404,409,422],gt=(globalThis==null?void 0:globalThis.URL)??ht.URL;class wt{constructor(t,n){T(this,"baseUrl");T(this,"retries");T(this,"retryDelay");T(this,"nonRetryableStatuses");T(this,"identity");T(this,"sleep",t=>new Promise(n=>{setTimeout(n,t)}));T(this,"getIdentity",()=>this.identity instanceof Function?this.identity():this.identity);T(this,"rawFetch",(t,n)=>{const r=new gt(t,this.baseUrl),s=(n==null?void 0:n.identity)??this.getIdentity();return Oe.signedFetchFactory()(r.toString(),{...n,identity:s})});T(this,"fetch",async(t,n)=>{for(let r=0;r<=this.retries;r++)try{let s,i;try{s=await this.rawFetch(t,n);const u=await s.text();u.length===0?i={ok:!0,data:null}:i=JSON.parse(u)}catch(u){throw new ge(u.message,void 0,null)}if(!s.ok||i.ok===!1){const u=i.message??i.error;throw new ge(u??`Request failed with status code ${s.status}`,s.status,i.data)}return i.ok===!0?i.data:i}catch(s){if(console.error(`[API] HTTP request failed: ${s.message||""}`,s),this.retries===r||s.status&&this.nonRetryableStatuses.includes(s.status))throw s;await this.sleep(this.retryDelay)}throw new Error("Unreachable code")});this.baseUrl=t,this.identity=n==null?void 0:n.identity,this.retries=(n==null?void 0:n.retries)??ft,this.retryDelay=(n==null?void 0:n.retryDelay)??pt,this.nonRetryableStatuses=(n==null?void 0:n.nonRetryableStatuses)??Tt}}class yt extends wt{constructor(n,r,s){super(r,s);T(this,"signer");T(this,"addTrade",async n=>this.fetch("/v1/trades",{method:"POST",body:JSON.stringify(n),metadata:{signer:this.signer,intent:"dcl:create-trade"},headers:{"Content-Type":"application/json"}}));T(this,"fetchTrade",async n=>this.fetch(`/v1/trades/${n}`,{method:"GET"}));this.signer=n}}class vt{constructor(t,n,r){T(this,"tradesAPI");this.tradesAPI=new yt(t,n,{identity:r,retries:0})}async addTrade(t){return this.tradesAPI.addTrade(t)}async fetchTrade(t){return this.tradesAPI.fetchTrade(t)}async accept(t,n){const r=ue(t.contract),s=de(r,t.chainId),i=fe(t,n);return pe(s,"accept",[i])}async cancel(t,n){const r=ue(t.contract),s=de(r,t.chainId),i=fe(t,n);return pe(s,"cancelSignature",[i])}}export{vt as TradeService};
1
+ var xe=Object.defineProperty;var Ie=(e,t,n)=>t in e?xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var T=(e,t,n)=>Ie(e,typeof t!="symbol"?t+"":t,n);import{W as we,b as oe,C as ve,B as Se,f as ie}from"./ethers-CU3Ctw5k.js";import{a5 as Re,a6 as Ne,D as X,a7 as Oe}from"./index-Dh_23qfs.js";import{c as ce}from"./react-4iaCnQ6n.js";import{O as Pe,M as be,D as De,a as ue,g as de}from"./index-Bpm2At5Q.js";import"./network-mdKz8jdP.js";import{c as K,e as Le}from"./index-CxlLn_V3.js";const Ue="2d0335ab",Fe="0c53c51c",Me="d8ed1acc",ke=ye("0x");let je=0;async function $e(e){let t=[];try{t=await H(e,"eth_requestAccounts",[])}catch{t=await H(e,"eth_accounts",[])}if(t.length===0)throw new Error("Could not find a valid connected account");return t[0]}async function qe(e,t,n){return H(e,"eth_signTypedData_v4",[t,n])}function He(e,t,n){const r=t.replace("0x",""),s=r.substring(0,64),i=r.substring(64,128),u=Be(r.substring(128,130)),d=n.replace("0x",""),f=(d.length/2).toString(16),w=Math.ceil(d.length/64);return["0x",Fe,_(e),_("a0"),s,i,_(u),_(f),d.padEnd(64*w,"0")].join("")}function Ge(e,t,n){const r=n.replace("0x",""),s=t.replace("0x",""),u=96+32+r.length/2,d=Math.ceil(s.length/64);return["0x",Me,_(e),_("60"),_(u.toString(16)),_((r.length/2).toString(16)),r,_((s.length/2).toString(16)),s.padEnd(64*d,"0")].join("")}function Be(e){let t=parseInt(e,16);if(t<27&&(t+=27),t!==27&&t!==28)throw Error(`Invalid signature version "${e}" (parsed: ${t})`);return t.toString(16)}async function Ve(e,t,n){const r=_(t),s=await H(e,"eth_call",[{data:`0x${Ue}${r}`,to:n},"latest"]);return _(s)}function Je(e){return typeof e=="number"?`0x${_(e.toString(16))}`:`0x${_(e)}`}function We(e,t){return H(e,"eth_getCode",[t.toLowerCase(),"latest"])}const Ye="0xef01";async function Ze(e,t){const n=await We(e,t);return n.toLowerCase().startsWith(Ye)?!1:!Xe(n)}function ye(e){if(!/^0x[0-9a-f]*$/gi.test(e))throw new Error(`Not a valid hex string "${e}"`);let t=e.slice(2);for(;t.length<40;)t="0"+t;return"0x"+t}function Xe(e){return ye(e.toLowerCase())===ke}function _(e){return e.toString().replace("0x","").padStart(64,"0")}async function H(e,t,n){let r,s={jsonrpc:"2.0",id:++je,method:t,params:n};if(e.request!==void 0?r=await e.request(s):e.sendAsync!==void 0?r=await e.sendAsync(s):e.send!==void 0&&(r=await e.send(t,n)),r)return r.result||r;throw new Error(`Could not send the transaction correcty. Either the provider does not support the method "${t}" or is missing a proper send/request.`)}function Ke(){return{serverURL:"https://transactions-api.decentraland.io/v1"}}var k;(function(e){e.UNKNOWN="unknown",e.DAPP_LIMIT_REACHED="dapp_limit_reached",e.USER_LIMIT_REACHED="user_limit_reached",e.API_LIMIT_REACHED="api_limit_reached",e.GAS_LIMIT_REACHED="gas_limit_reached",e.EXPECTATION_FAILED="expectation_failed",e.INVALID_TRANSACTION="invalid_transaction",e.INVALID_SCHEMA="invalid_schema",e.INVALID_CONTRACT_ADDRESS="invalid_contract_address",e.INVALID_ADDRESS="invalid_address",e.SALE_PRICE_TOO_LOW="sale_price_too_low",e.QUOTA_REACHED="quota_reached",e.CONTRACT_ACCOUNT="contract_account",e.HIGH_CONGESTION="high_congestion",e.USER_DENIED="user_denied"})(k||(k={}));class P extends Error{constructor(n,r){super(n);T(this,"code");this.code=r,Object.setPrototypeOf(this,P.prototype)}}async function ze(e,t,n,r,s={}){const i={...Ke(),...s};if(!r.address.trim())throw new P(`The contract address for ${r.name} is empty. You're probably trying to get a proxy contract. Try adding an address to the result of getContract`,k.INVALID_ADDRESS);try{const u=await $e(e);if(await Ze(e,u))throw new P("Contract accounts are not supported",k.CONTRACT_ACCOUNT);const d=r.abi.some(B=>{var V;return B.name==="executeMetaTransaction"&&((V=B.inputs)==null?void 0:V.some(W=>W.name==="_functionData"))}),f=await Ve(t,u,r.address),w=Je(r.chainId),I=et(w,r),D=Qe(u,f,n,I,d),L=await qe(e,u,JSON.stringify(D)),G=(d?Ge:He)(u,L,n),j=await fetch(`${i.serverURL}/transactions`,{headers:{"Content-Type":"application/json"},body:JSON.stringify({transactionData:{from:u,params:[r.address,G]}}),method:"POST"}),N=await j.json();if(N.ok===!1)throw N.message&&N.code?new P(N.message,N.code):new Error(`HTTP Error. Status: ${j.status}.`);return N.txHash}catch(u){const d=u;throw d instanceof P?d:d.message.indexOf("User denied message signature")!==-1?new P(d.message,k.USER_DENIED):(console.warn("An error occurred trying to send the meta transaction. Error:",d.message),new P(d.message,k.UNKNOWN))}}function Qe(e,t,n,r,s=!1){return{types:{EIP712Domain:De,MetaTransaction:s?Pe:be},domain:r,primaryType:"MetaTransaction",message:{nonce:parseInt(t,16),from:e,...s?{functionData:n}:{functionSignature:n}}}}function et(e,t){return{name:t.name,version:t.version,verifyingContract:t.address,salt:e}}Re();var tt=Ne();async function nt(e){const t=await Ee();if(t){const n=await new we(t).getSigner().getChainId();if(e===n)return t}return K.createProvider(tt.ProviderType.NETWORK,e)}async function Ee(){try{return await K.getProvider()}catch{try{const{provider:e}=await K.tryPreviousConnection();return e}catch{return null}}}function le(e){return Math.floor(e/1e3)}function he(e){switch(e.assetType){case X.TradeAssetType.ERC721:return e.tokenId;case X.TradeAssetType.COLLECTION_ITEM:return e.itemId;case X.TradeAssetType.ERC20:return e.amount;default:return console.error("Invalid asset type:",e),""}}function rt(e){var t;return{checks:{uses:e.checks.uses,expiration:le(e.checks.expiration),effective:le(e.checks.effective),salt:oe(e.checks.salt,32),contractSignatureIndex:e.checks.contractSignatureIndex,signerSignatureIndex:e.checks.signerSignatureIndex,allowedRoot:oe(e.checks.allowedRoot,32),externalChecks:(t=e.checks.externalChecks)==null?void 0:t.map(n=>({contractAddress:n.contractAddress,selector:n.selector,value:n.value?n.value:"0x",required:n.required}))},sent:e.sent.map(n=>({assetType:n.assetType,contractAddress:n.contractAddress,value:he(n),extra:n.extra?n.extra:"0x"})),received:e.received.map(n=>({assetType:n.assetType,contractAddress:n.contractAddress,value:he(n),extra:n.extra?n.extra:"0x",beneficiary:n.beneficiary}))}}function fe(e,t){const n=rt(e);return{signer:e.signer,signature:e.signature,...n,checks:{...n.checks,allowedProof:[]},sent:n.sent.map(r=>({...r,beneficiary:t}))}}async function at(e){const t=await e.request({method:"eth_chainId",params:[]});let n;return typeof t=="string"?n=parseInt(t,16):n=t,n}async function st(e){const t=await nt(e);return new we(t)}const b=new Le.EventEmitter;var x;(function(e){e.ERROR="error",e.SUCCESS="success",e.PROMPT="prompt",e.ACCEPT="accept",e.REJECT="reject"})(x||(x={}));let ot="https://transactions-api.decentraland.org/v1";const it=()=>ot,ct=()=>new Promise((e,t)=>{const n=()=>{b.removeAllListeners(x.REJECT),e(!0)},r=()=>{b.removeAllListeners(x.ACCEPT),t(new Error("User rejected transaction"))};b.addListener(x.ACCEPT,n),b.addListener(x.REJECT,r)});async function pe(...e){const[t,n,...r]=e;try{const s=await Ee();if(!s)throw new Error("Provider not connected");const i=await at(s),u=await st(t.chainId),d=new ve(t.address,t.abi,u),f=await(typeof n=="function"?n(d.populateTransaction):d.populateTransaction[n](...r));if(i===t.chainId){const w=u.getSigner();if(s.isMagic||s.isThirdweb){let D=Se.from(0);try{const L=await w.getGasPrice(),U=await w.estimateGas(f);D=L.mul(U)}catch{}if(!D.isZero()){const L=ct(),U=await w.getBalance();b.emit(x.PROMPT,{transactionGasPrice:ie(D),userBalance:ie(U),chainId:t.chainId}),await L}}const I=await w.sendTransaction(f);return b.emit(x.SUCCESS,{txHash:I.hash}),I.hash}else{const w=await ze(s,u,f.data,t,{serverURL:it()});return b.emit(x.SUCCESS,{txHash:w}),w}}catch(s){const i={type:x.ERROR,error:s};throw b.emit(x.ERROR,i),s}}var q={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var ut=q.exports,Te;function dt(){return Te||(Te=1,(function(e,t){(function(n){var r=t&&!t.nodeType&&t,s=e&&!e.nodeType&&e,i=typeof ce=="object"&&ce;(i.global===i||i.window===i||i.self===i)&&(n=i);var u,d=2147483647,f=36,w=1,I=26,D=38,L=700,U=72,G=128,j="-",N=/^xn--/,B=/[^\x20-\x7E]/,V=/[\x2E\u3002\uFF0E\uFF61]/g,W={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Y=f-w,v=Math.floor,$=String.fromCharCode,J;function F(a){throw new RangeError(W[a])}function z(a,o){for(var c=a.length,l=[];c--;)l[c]=o(a[c]);return l}function Q(a,o){var c=a.split("@"),l="";c.length>1&&(l=c[0]+"@",a=c[1]),a=a.replace(V,".");var h=a.split("."),y=z(h,o).join(".");return l+y}function ee(a){for(var o=[],c=0,l=a.length,h,y;c<l;)h=a.charCodeAt(c++),h>=55296&&h<=56319&&c<l?(y=a.charCodeAt(c++),(y&64512)==56320?o.push(((h&1023)<<10)+(y&1023)+65536):(o.push(h),c--)):o.push(h);return o}function te(a){return z(a,function(o){var c="";return o>65535&&(o-=65536,c+=$(o>>>10&1023|55296),o=56320|o&1023),c+=$(o),c}).join("")}function me(a){return a-48<10?a-22:a-65<26?a-65:a-97<26?a-97:f}function ne(a,o){return a+22+75*(a<26)-((o!=0)<<5)}function re(a,o,c){var l=0;for(a=c?v(a/L):a>>1,a+=v(a/o);a>Y*I>>1;l+=f)a=v(a/Y);return v(l+(Y+1)*a/(a+D))}function ae(a){var o=[],c=a.length,l,h=0,y=G,p=U,E,A,S,R,g,m,C,O,M;for(E=a.lastIndexOf(j),E<0&&(E=0),A=0;A<E;++A)a.charCodeAt(A)>=128&&F("not-basic"),o.push(a.charCodeAt(A));for(S=E>0?E+1:0;S<c;){for(R=h,g=1,m=f;S>=c&&F("invalid-input"),C=me(a.charCodeAt(S++)),(C>=f||C>v((d-h)/g))&&F("overflow"),h+=C*g,O=m<=p?w:m>=p+I?I:m-p,!(C<O);m+=f)M=f-O,g>v(d/M)&&F("overflow"),g*=M;l=o.length+1,p=re(h-R,l,R==0),v(h/l)>d-y&&F("overflow"),y+=v(h/l),h%=l,o.splice(h++,0,y)}return te(o)}function se(a){var o,c,l,h,y,p,E,A,S,R,g,m=[],C,O,M,Z;for(a=ee(a),C=a.length,o=G,c=0,y=U,p=0;p<C;++p)g=a[p],g<128&&m.push($(g));for(l=h=m.length,h&&m.push(j);l<C;){for(E=d,p=0;p<C;++p)g=a[p],g>=o&&g<E&&(E=g);for(O=l+1,E-o>v((d-c)/O)&&F("overflow"),c+=(E-o)*O,o=E,p=0;p<C;++p)if(g=a[p],g<o&&++c>d&&F("overflow"),g==o){for(A=c,S=f;R=S<=y?w:S>=y+I?I:S-y,!(A<R);S+=f)Z=A-R,M=f-R,m.push($(ne(R+Z%M,0))),A=v(Z/M);m.push($(ne(A,0))),y=re(c,O,l==h),c=0,++l}++c,++o}return m.join("")}function Ae(a){return Q(a,function(o){return N.test(o)?ae(o.slice(4).toLowerCase()):o})}function Ce(a){return Q(a,function(o){return B.test(o)?"xn--"+se(o):o})}if(u={version:"1.4.1",ucs2:{decode:ee,encode:te},decode:ae,encode:se,toASCII:Ce,toUnicode:Ae},r&&s)if(e.exports==r)s.exports=u;else for(J in u)u.hasOwnProperty(J)&&(r[J]=u[J]);else n.punycode=u})(ut)})(q,q.exports)),q.exports}dt();var _e=(function(e){function t(){var r=this||self;return delete e.prototype.__magic__,r}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var n=__magic__;return n})(Object),lt=_e.URL;_e.URLSearchParams;var ht={URL:lt};class ge extends Error{constructor(n,r,s){super(n);T(this,"status");T(this,"data");this.status=r,this.data=s}}const ft=3,pt=1e3,Tt=[400,401,403,404,409,422],gt=(globalThis==null?void 0:globalThis.URL)??ht.URL;class wt{constructor(t,n){T(this,"baseUrl");T(this,"retries");T(this,"retryDelay");T(this,"nonRetryableStatuses");T(this,"identity");T(this,"sleep",t=>new Promise(n=>{setTimeout(n,t)}));T(this,"getIdentity",()=>this.identity instanceof Function?this.identity():this.identity);T(this,"rawFetch",(t,n)=>{const r=new gt(t,this.baseUrl),s=(n==null?void 0:n.identity)??this.getIdentity();return Oe.signedFetchFactory()(r.toString(),{...n,identity:s})});T(this,"fetch",async(t,n)=>{for(let r=0;r<=this.retries;r++)try{let s,i;try{s=await this.rawFetch(t,n);const u=await s.text();u.length===0?i={ok:!0,data:null}:i=JSON.parse(u)}catch(u){throw new ge(u.message,void 0,null)}if(!s.ok||i.ok===!1){const u=i.message??i.error;throw new ge(u??`Request failed with status code ${s.status}`,s.status,i.data)}return i.ok===!0?i.data:i}catch(s){if(console.error(`[API] HTTP request failed: ${s.message||""}`,s),this.retries===r||s.status&&this.nonRetryableStatuses.includes(s.status))throw s;await this.sleep(this.retryDelay)}throw new Error("Unreachable code")});this.baseUrl=t,this.identity=n==null?void 0:n.identity,this.retries=(n==null?void 0:n.retries)??ft,this.retryDelay=(n==null?void 0:n.retryDelay)??pt,this.nonRetryableStatuses=(n==null?void 0:n.nonRetryableStatuses)??Tt}}class yt extends wt{constructor(n,r,s){super(r,s);T(this,"signer");T(this,"addTrade",async n=>this.fetch("/v1/trades",{method:"POST",body:JSON.stringify(n),metadata:{signer:this.signer,intent:"dcl:create-trade"},headers:{"Content-Type":"application/json"}}));T(this,"fetchTrade",async n=>this.fetch(`/v1/trades/${n}`,{method:"GET"}));this.signer=n}}class vt{constructor(t,n,r){T(this,"tradesAPI");this.tradesAPI=new yt(t,n,{identity:r,retries:0})}async addTrade(t){return this.tradesAPI.addTrade(t)}async fetchTrade(t){return this.tradesAPI.fetchTrade(t)}async accept(t,n){const r=ue(t.contract),s=de(r,t.chainId),i=fe(t,n);return pe(s,"accept",[i])}async cancel(t,n){const r=ue(t.contract),s=de(r,t.chainId),i=fe(t,n);return pe(s,"cancelSignature",[i])}}export{vt as TradeService};