@m0-foundation/swap-component 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/m0-swap-component/ConstantsUtil-btJ3XIXu.js +28 -0
- package/dist/m0-swap-component/ConstantsUtil-btJ3XIXu.js.map +1 -0
- package/dist/m0-swap-component/HelpersUtil-5wkO4kIW.js +142 -0
- package/dist/m0-swap-component/HelpersUtil-5wkO4kIW.js.map +1 -0
- package/dist/m0-swap-component/PhArrowCircleDown-BiDIiYXi.js +76 -0
- package/dist/m0-swap-component/PhArrowCircleDown-BiDIiYXi.js.map +1 -0
- package/dist/m0-swap-component/PhArrowClockwise-BRnlxNUR.js +76 -0
- package/dist/m0-swap-component/PhArrowClockwise-BRnlxNUR.js.map +1 -0
- package/dist/m0-swap-component/PhArrowDown-Co2hyXIs.js +76 -0
- package/dist/m0-swap-component/PhArrowDown-Co2hyXIs.js.map +1 -0
- package/dist/m0-swap-component/PhArrowLeft-Cb8ijwK6.js +76 -0
- package/dist/m0-swap-component/PhArrowLeft-Cb8ijwK6.js.map +1 -0
- package/dist/m0-swap-component/PhArrowRight-B9t--Gmh.js +76 -0
- package/dist/m0-swap-component/PhArrowRight-B9t--Gmh.js.map +1 -0
- package/dist/m0-swap-component/PhArrowSquareOut-eGBMEr5T.js +76 -0
- package/dist/m0-swap-component/PhArrowSquareOut-eGBMEr5T.js.map +1 -0
- package/dist/m0-swap-component/PhArrowUp-CjSpT-xh.js +76 -0
- package/dist/m0-swap-component/PhArrowUp-CjSpT-xh.js.map +1 -0
- package/dist/m0-swap-component/PhArrowUpRight-B8u6wk-A.js +76 -0
- package/dist/m0-swap-component/PhArrowUpRight-B8u6wk-A.js.map +1 -0
- package/dist/m0-swap-component/PhArrowsClockwise-CBcfV6j6.js +76 -0
- package/dist/m0-swap-component/PhArrowsClockwise-CBcfV6j6.js.map +1 -0
- package/dist/m0-swap-component/PhArrowsDownUp-CMVR84b1.js +76 -0
- package/dist/m0-swap-component/PhArrowsDownUp-CMVR84b1.js.map +1 -0
- package/dist/m0-swap-component/PhArrowsLeftRight-CmXk8rs2.js +76 -0
- package/dist/m0-swap-component/PhArrowsLeftRight-CmXk8rs2.js.map +1 -0
- package/dist/m0-swap-component/PhBank-BigtjnS8.js +76 -0
- package/dist/m0-swap-component/PhBank-BigtjnS8.js.map +1 -0
- package/dist/m0-swap-component/PhBrowser-BOulLD8D.js +76 -0
- package/dist/m0-swap-component/PhBrowser-BOulLD8D.js.map +1 -0
- package/dist/m0-swap-component/PhCaretDown-BvvZ65ad.js +76 -0
- package/dist/m0-swap-component/PhCaretDown-BvvZ65ad.js.map +1 -0
- package/dist/m0-swap-component/PhCaretLeft-DtwjZbZ7.js +76 -0
- package/dist/m0-swap-component/PhCaretLeft-DtwjZbZ7.js.map +1 -0
- package/dist/m0-swap-component/PhCaretRight-C8LuSZkO.js +76 -0
- package/dist/m0-swap-component/PhCaretRight-C8LuSZkO.js.map +1 -0
- package/dist/m0-swap-component/PhCaretUp-B2lAObip.js +76 -0
- package/dist/m0-swap-component/PhCaretUp-B2lAObip.js.map +1 -0
- package/dist/m0-swap-component/PhCheck-DQtuVrQf.js +76 -0
- package/dist/m0-swap-component/PhCheck-DQtuVrQf.js.map +1 -0
- package/dist/m0-swap-component/PhCircleHalf-CXfZ0QZv.js +76 -0
- package/dist/m0-swap-component/PhCircleHalf-CXfZ0QZv.js.map +1 -0
- package/dist/m0-swap-component/PhClock-CXsmuc_a.js +76 -0
- package/dist/m0-swap-component/PhClock-CXsmuc_a.js.map +1 -0
- package/dist/m0-swap-component/PhCompass-Cg-qnMon.js +76 -0
- package/dist/m0-swap-component/PhCompass-Cg-qnMon.js.map +1 -0
- package/dist/m0-swap-component/PhCopy-kGRKcvb4.js +76 -0
- package/dist/m0-swap-component/PhCopy-kGRKcvb4.js.map +1 -0
- package/dist/m0-swap-component/PhCreditCard-jYFausLO.js +76 -0
- package/dist/m0-swap-component/PhCreditCard-jYFausLO.js.map +1 -0
- package/dist/m0-swap-component/PhCurrencyDollar-C8vSY3fy.js +76 -0
- package/dist/m0-swap-component/PhCurrencyDollar-C8vSY3fy.js.map +1 -0
- package/dist/m0-swap-component/PhDesktop-AczlBCho.js +76 -0
- package/dist/m0-swap-component/PhDesktop-AczlBCho.js.map +1 -0
- package/dist/m0-swap-component/PhDeviceMobile-3rFbdWLA.js +76 -0
- package/dist/m0-swap-component/PhDeviceMobile-3rFbdWLA.js.map +1 -0
- package/dist/m0-swap-component/PhDotsThree-cJsXXsvY.js +76 -0
- package/dist/m0-swap-component/PhDotsThree-cJsXXsvY.js.map +1 -0
- package/dist/m0-swap-component/PhEnvelope-C1bxHVXw.js +76 -0
- package/dist/m0-swap-component/PhEnvelope-C1bxHVXw.js.map +1 -0
- package/dist/m0-swap-component/PhFunnelSimple-DhqB9fsu.js +76 -0
- package/dist/m0-swap-component/PhFunnelSimple-DhqB9fsu.js.map +1 -0
- package/dist/m0-swap-component/PhGlobe-BFp6kx95.js +76 -0
- package/dist/m0-swap-component/PhGlobe-BFp6kx95.js.map +1 -0
- package/dist/m0-swap-component/PhIdentificationCard-BdYxckWB.js +76 -0
- package/dist/m0-swap-component/PhIdentificationCard-BdYxckWB.js.map +1 -0
- package/dist/m0-swap-component/PhImage-CXxX5oq3.js +76 -0
- package/dist/m0-swap-component/PhImage-CXxX5oq3.js.map +1 -0
- package/dist/m0-swap-component/PhInfo-BcuP36hY.js +76 -0
- package/dist/m0-swap-component/PhInfo-BcuP36hY.js.map +1 -0
- package/dist/m0-swap-component/PhLightbulb-DkWwRl94.js +76 -0
- package/dist/m0-swap-component/PhLightbulb-DkWwRl94.js.map +1 -0
- package/dist/m0-swap-component/PhMagnifyingGlass-B_fFjslY.js +76 -0
- package/dist/m0-swap-component/PhMagnifyingGlass-B_fFjslY.js.map +1 -0
- package/dist/m0-swap-component/PhPaperPlaneRight-BIzGG3QW.js +76 -0
- package/dist/m0-swap-component/PhPaperPlaneRight-BIzGG3QW.js.map +1 -0
- package/dist/m0-swap-component/PhPlus-BGosT2zu.js +76 -0
- package/dist/m0-swap-component/PhPlus-BGosT2zu.js.map +1 -0
- package/dist/m0-swap-component/PhPower-BMqDnP1n.js +76 -0
- package/dist/m0-swap-component/PhPower-BMqDnP1n.js.map +1 -0
- package/dist/m0-swap-component/PhPuzzlePiece-DNMpiJNU.js +76 -0
- package/dist/m0-swap-component/PhPuzzlePiece-DNMpiJNU.js.map +1 -0
- package/dist/m0-swap-component/PhQrCode-DrHkqrU4.js +76 -0
- package/dist/m0-swap-component/PhQrCode-DrHkqrU4.js.map +1 -0
- package/dist/m0-swap-component/PhQuestion-zTfvwqNz.js +76 -0
- package/dist/m0-swap-component/PhQuestion-zTfvwqNz.js.map +1 -0
- package/dist/m0-swap-component/PhQuestionMark-h3Nk1Yf1.js +76 -0
- package/dist/m0-swap-component/PhQuestionMark-h3Nk1Yf1.js.map +1 -0
- package/dist/m0-swap-component/PhSealCheck-DPPqSt6G.js +76 -0
- package/dist/m0-swap-component/PhSealCheck-DPPqSt6G.js.map +1 -0
- package/dist/m0-swap-component/PhSignOut-CJgnrE_v.js +76 -0
- package/dist/m0-swap-component/PhSignOut-CJgnrE_v.js.map +1 -0
- package/dist/m0-swap-component/PhSpinner-CMTEIWbw.js +76 -0
- package/dist/m0-swap-component/PhSpinner-CMTEIWbw.js.map +1 -0
- package/dist/m0-swap-component/PhTrash-CeDVW4am.js +76 -0
- package/dist/m0-swap-component/PhTrash-CeDVW4am.js.map +1 -0
- package/dist/m0-swap-component/PhUser-lQ9WUtAV.js +76 -0
- package/dist/m0-swap-component/PhUser-lQ9WUtAV.js.map +1 -0
- package/dist/m0-swap-component/PhVault-EnLnS_IQ.js +76 -0
- package/dist/m0-swap-component/PhVault-EnLnS_IQ.js.map +1 -0
- package/dist/m0-swap-component/PhWallet-CUeDZydd.js +76 -0
- package/dist/m0-swap-component/PhWallet-CUeDZydd.js.map +1 -0
- package/dist/m0-swap-component/PhWarning-CokeGZs2.js +76 -0
- package/dist/m0-swap-component/PhWarning-CokeGZs2.js.map +1 -0
- package/dist/m0-swap-component/PhWarningCircle-vWtA7S0R.js +76 -0
- package/dist/m0-swap-component/PhWarningCircle-vWtA7S0R.js.map +1 -0
- package/dist/m0-swap-component/PhX-DwCRIvoc.js +76 -0
- package/dist/m0-swap-component/PhX-DwCRIvoc.js.map +1 -0
- package/dist/m0-swap-component/data-capture-BmovBbKV.js +573 -0
- package/dist/m0-swap-component/data-capture-BmovBbKV.js.map +1 -0
- package/dist/m0-swap-component/email-B4niz3Ms.js +445 -0
- package/dist/m0-swap-component/email-B4niz3Ms.js.map +1 -0
- package/dist/m0-swap-component/embedded-wallet-D6bzjX_K.js +988 -0
- package/dist/m0-swap-component/embedded-wallet-D6bzjX_K.js.map +1 -0
- package/dist/m0-swap-component/features-EhJNVE-M.js +355 -0
- package/dist/m0-swap-component/features-EhJNVE-M.js.map +1 -0
- package/dist/m0-swap-component/if-defined-2CMpVr2R.js +12 -0
- package/dist/m0-swap-component/if-defined-2CMpVr2R.js.map +1 -0
- package/dist/m0-swap-component/index-B4xuj7uR.js +965 -0
- package/dist/m0-swap-component/index-B4xuj7uR.js.map +1 -0
- package/dist/m0-swap-component/index-BVZ66GYf.js +206 -0
- package/dist/m0-swap-component/index-BVZ66GYf.js.map +1 -0
- package/dist/m0-swap-component/index-BZXyMieH.js +150 -0
- package/dist/m0-swap-component/index-BZXyMieH.js.map +1 -0
- package/dist/m0-swap-component/index-Bj5sA_Ri.js +252 -0
- package/dist/m0-swap-component/index-Bj5sA_Ri.js.map +1 -0
- package/dist/m0-swap-component/index-Bs-pPJYj.js +129 -0
- package/dist/m0-swap-component/index-Bs-pPJYj.js.map +1 -0
- package/dist/m0-swap-component/index-CMS76VPf.js +474 -0
- package/dist/m0-swap-component/index-CMS76VPf.js.map +1 -0
- package/dist/m0-swap-component/index-CoMTkqee.js +95 -0
- package/dist/m0-swap-component/index-CoMTkqee.js.map +1 -0
- package/dist/m0-swap-component/index-DE0OtbL2.js +3566 -0
- package/dist/m0-swap-component/index-DE0OtbL2.js.map +1 -0
- package/dist/m0-swap-component/index-DEG-YczD.js +231 -0
- package/dist/m0-swap-component/index-DEG-YczD.js.map +1 -0
- package/dist/m0-swap-component/index-DY_Ijq_4.js +4345 -0
- package/dist/m0-swap-component/index-DY_Ijq_4.js.map +1 -0
- package/dist/m0-swap-component/index-IRpGhIhy.js +9394 -0
- package/dist/m0-swap-component/index-IRpGhIhy.js.map +1 -0
- package/dist/m0-swap-component/index-Z70nBYWG.js +113 -0
- package/dist/m0-swap-component/index-Z70nBYWG.js.map +1 -0
- package/dist/m0-swap-component/index-iNFotRMa.js +73 -0
- package/dist/m0-swap-component/index-iNFotRMa.js.map +1 -0
- package/dist/m0-swap-component/index-n1fooC-v.js +37757 -0
- package/dist/m0-swap-component/index-n1fooC-v.js.map +1 -0
- package/dist/m0-swap-component/index.esm.js +2 -0
- package/dist/m0-swap-component/index.esm.js.map +1 -0
- package/dist/m0-swap-component/loader.esm.js.map +1 -0
- package/dist/m0-swap-component/m0-swap-component.esm.js +48 -0
- package/dist/m0-swap-component/m0-swap-component.esm.js.map +1 -0
- package/dist/m0-swap-component/native-CPtqJIn7.js +18 -0
- package/dist/m0-swap-component/native-CPtqJIn7.js.map +1 -0
- package/dist/m0-swap-component/onramp-BppY2eDR.js +1003 -0
- package/dist/m0-swap-component/onramp-BppY2eDR.js.map +1 -0
- package/dist/m0-swap-component/pay-with-exchange-BJYQgTMB.js +639 -0
- package/dist/m0-swap-component/pay-with-exchange-BJYQgTMB.js.map +1 -0
- package/dist/m0-swap-component/property-BN-VaT99.js +625 -0
- package/dist/m0-swap-component/property-BN-VaT99.js.map +1 -0
- package/dist/m0-swap-component/receive-BptRM_5_.js +281 -0
- package/dist/m0-swap-component/receive-BptRM_5_.js.map +1 -0
- package/dist/m0-swap-component/ref-3xALOvo5.js +25 -0
- package/dist/m0-swap-component/ref-3xALOvo5.js.map +1 -0
- package/dist/m0-swap-component/send-BCyHM4Zr.js +1408 -0
- package/dist/m0-swap-component/send-BCyHM4Zr.js.map +1 -0
- package/dist/m0-swap-component/socials-BbajCSWV.js +824 -0
- package/dist/m0-swap-component/socials-BbajCSWV.js.map +1 -0
- package/dist/m0-swap-component/swap-module-5ZLM-vAV.js +140887 -0
- package/dist/m0-swap-component/swap-module-5ZLM-vAV.js.map +1 -0
- package/dist/m0-swap-component/swap-module.entry.esm.js.map +1 -0
- package/dist/m0-swap-component/swap-module.entry.js +15 -0
- package/dist/m0-swap-component/swaps-DyGe65DR.js +2121 -0
- package/dist/m0-swap-component/swaps-DyGe65DR.js.map +1 -0
- package/dist/m0-swap-component/transactions-BZ9l4zt5.js +60 -0
- package/dist/m0-swap-component/transactions-BZ9l4zt5.js.map +1 -0
- package/dist/m0-swap-component/utils-RCeZbvdb.js +95 -0
- package/dist/m0-swap-component/utils-RCeZbvdb.js.map +1 -0
- package/dist/m0-swap-component/w3m-modal-D0HWVPsj.js +2097 -0
- package/dist/m0-swap-component/w3m-modal-D0HWVPsj.js.map +1 -0
- package/dist/m0-swap-component/wui-button-BeTWD3Va.js +223 -0
- package/dist/m0-swap-component/wui-button-BeTWD3Va.js.map +1 -0
- package/dist/m0-swap-component/wui-email-input-CgnfUH0c.js +65 -0
- package/dist/m0-swap-component/wui-email-input-CgnfUH0c.js.map +1 -0
- package/dist/m0-swap-component/wui-icon-B0uTDhW-.js +4 -0
- package/dist/m0-swap-component/wui-icon-B0uTDhW-.js.map +1 -0
- package/dist/m0-swap-component/wui-icon-box-s87lODBB.js +4 -0
- package/dist/m0-swap-component/wui-icon-box-s87lODBB.js.map +1 -0
- package/dist/m0-swap-component/wui-icon-link-BFpV9kPE.js +127 -0
- package/dist/m0-swap-component/wui-icon-link-BFpV9kPE.js.map +1 -0
- package/dist/m0-swap-component/wui-image-BvjxoR51.js +4 -0
- package/dist/m0-swap-component/wui-image-BvjxoR51.js.map +1 -0
- package/dist/m0-swap-component/wui-input-amount-CWQfP3RO.js +182 -0
- package/dist/m0-swap-component/wui-input-amount-CWQfP3RO.js.map +1 -0
- package/dist/m0-swap-component/wui-input-text-g0sN4B2y.js +4 -0
- package/dist/m0-swap-component/wui-input-text-g0sN4B2y.js.map +1 -0
- package/dist/m0-swap-component/wui-link-VqM3wLny.js +123 -0
- package/dist/m0-swap-component/wui-link-VqM3wLny.js.map +1 -0
- package/dist/m0-swap-component/wui-list-item-BIijofqN.js +170 -0
- package/dist/m0-swap-component/wui-list-item-BIijofqN.js.map +1 -0
- package/dist/m0-swap-component/wui-list-social-C7GhkRc8.js +119 -0
- package/dist/m0-swap-component/wui-list-social-C7GhkRc8.js.map +1 -0
- package/dist/m0-swap-component/wui-list-token-C94lmAbT.js +134 -0
- package/dist/m0-swap-component/wui-list-token-C94lmAbT.js.map +1 -0
- package/dist/m0-swap-component/wui-list-wallet-C7fnQvCW.js +622 -0
- package/dist/m0-swap-component/wui-list-wallet-C7fnQvCW.js.map +1 -0
- package/dist/m0-swap-component/wui-loading-spinner-CW2_5SKA.js +4 -0
- package/dist/m0-swap-component/wui-loading-spinner-CW2_5SKA.js.map +1 -0
- package/dist/m0-swap-component/wui-loading-thumbnail-y3sGkT5j.js +337 -0
- package/dist/m0-swap-component/wui-loading-thumbnail-y3sGkT5j.js.map +1 -0
- package/dist/m0-swap-component/wui-qr-code-DekJTDGf.js +3412 -0
- package/dist/m0-swap-component/wui-qr-code-DekJTDGf.js.map +1 -0
- package/dist/m0-swap-component/wui-separator-DMZIL_Av.js +67 -0
- package/dist/m0-swap-component/wui-separator-DMZIL_Av.js.map +1 -0
- package/dist/m0-swap-component/wui-shimmer-CVFC8fMx.js +4 -0
- package/dist/m0-swap-component/wui-shimmer-CVFC8fMx.js.map +1 -0
- package/dist/m0-swap-component/wui-text-BS_lZKY4.js +1127 -0
- package/dist/m0-swap-component/wui-text-BS_lZKY4.js.map +1 -0
- package/dist/m0-swap-component/wui-token-button-CsOFoNJG.js +214 -0
- package/dist/m0-swap-component/wui-token-button-CsOFoNJG.js.map +1 -0
- package/dist/m0-swap-component/wui-visual-hU2Mkyrv.js +565 -0
- package/dist/m0-swap-component/wui-visual-hU2Mkyrv.js.map +1 -0
- package/dist/m0-swap-component/wui-wallet-switch-CWbdtfbN.js +459 -0
- package/dist/m0-swap-component/wui-wallet-switch-CWbdtfbN.js.map +1 -0
- package/dist/types/components/swap-module/balances.d.ts +16 -0
- package/dist/types/components/swap-module/chains.d.ts +16 -0
- package/dist/types/components/swap-module/store.d.ts +34 -0
- package/dist/types/components/swap-module/swap-module.d.ts +113 -0
- package/dist/types/components/swap-module/utils/constants.d.ts +7 -0
- package/dist/types/components/swap-module/utils/formatters.d.ts +23 -0
- package/dist/types/components/swap-module/utils/reown.d.ts +59 -0
- package/dist/types/components/swap-module/utils/wallet.d.ts +83 -0
- package/dist/types/components.d.ts +165 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1732 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +60 -0
|
@@ -0,0 +1,639 @@
|
|
|
1
|
+
import { d as css, a as i, b, r as resetStyles, e as elementStyles, c as customElement, h as ChainController, K as ExchangeController, R as RouterController, D as AssetUtil, p as SnackController, m as ConnectionController, n as CoreHelperUtil } from './swap-module-5ZLM-vAV.js';
|
|
2
|
+
import { n, r } from './wui-text-BS_lZKY4.js';
|
|
3
|
+
import { o } from './if-defined-2CMpVr2R.js';
|
|
4
|
+
import './index-BZXyMieH.js';
|
|
5
|
+
import './wui-icon-link-BFpV9kPE.js';
|
|
6
|
+
import './wui-image-BvjxoR51.js';
|
|
7
|
+
import './wui-list-item-BIijofqN.js';
|
|
8
|
+
import './wui-shimmer-CVFC8fMx.js';
|
|
9
|
+
import './wui-button-BeTWD3Va.js';
|
|
10
|
+
import './wui-input-amount-CWQfP3RO.js';
|
|
11
|
+
import './wui-link-VqM3wLny.js';
|
|
12
|
+
import './wui-icon-B0uTDhW-.js';
|
|
13
|
+
import './wui-icon-box-s87lODBB.js';
|
|
14
|
+
import './wui-input-text-g0sN4B2y.js';
|
|
15
|
+
import './wui-list-token-C94lmAbT.js';
|
|
16
|
+
import './wui-separator-DMZIL_Av.js';
|
|
17
|
+
import './index-DY_Ijq_4.js';
|
|
18
|
+
import 'buffer';
|
|
19
|
+
import 'ox/BlockOverrides';
|
|
20
|
+
import 'ox/erc8010';
|
|
21
|
+
import 'ox/AbiConstructor';
|
|
22
|
+
import 'ox/AbiFunction';
|
|
23
|
+
import 'ox/erc6492';
|
|
24
|
+
import 'events';
|
|
25
|
+
import 'ox';
|
|
26
|
+
import 'ox/tempo';
|
|
27
|
+
import 'ox/Hex';
|
|
28
|
+
import 'ox/Secp256k1';
|
|
29
|
+
import 'ox/Signature';
|
|
30
|
+
import './index-CoMTkqee.js';
|
|
31
|
+
import './index-iNFotRMa.js';
|
|
32
|
+
import './ref-3xALOvo5.js';
|
|
33
|
+
import './index-Bs-pPJYj.js';
|
|
34
|
+
import './index-Bj5sA_Ri.js';
|
|
35
|
+
|
|
36
|
+
var styles$2 = css `
|
|
37
|
+
button {
|
|
38
|
+
border: none;
|
|
39
|
+
border-radius: ${({ borderRadius }) => borderRadius['20']};
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: row;
|
|
42
|
+
align-items: center;
|
|
43
|
+
padding: ${({ spacing }) => spacing[1]};
|
|
44
|
+
transition:
|
|
45
|
+
background-color ${({ durations }) => durations['lg']}
|
|
46
|
+
${({ easings }) => easings['ease-out-power-2']},
|
|
47
|
+
box-shadow ${({ durations }) => durations['lg']}
|
|
48
|
+
${({ easings }) => easings['ease-out-power-2']};
|
|
49
|
+
will-change: background-color, box-shadow;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* -- Variants --------------------------------------------------------------- */
|
|
53
|
+
button[data-type='accent'] {
|
|
54
|
+
background-color: ${({ tokens }) => tokens.core.backgroundAccentPrimary};
|
|
55
|
+
color: ${({ tokens }) => tokens.theme.textPrimary};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
button[data-type='neutral'] {
|
|
59
|
+
background-color: ${({ tokens }) => tokens.theme.foregroundSecondary};
|
|
60
|
+
color: ${({ tokens }) => tokens.theme.textPrimary};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* -- Sizes --------------------------------------------------------------- */
|
|
64
|
+
button[data-size='sm'] {
|
|
65
|
+
height: 24px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
button[data-size='md'] {
|
|
69
|
+
height: 28px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
button[data-size='lg'] {
|
|
73
|
+
height: 32px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
button[data-size='sm'] > wui-image,
|
|
77
|
+
button[data-size='sm'] > wui-icon {
|
|
78
|
+
width: 16px;
|
|
79
|
+
height: 16px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
button[data-size='md'] > wui-image,
|
|
83
|
+
button[data-size='md'] > wui-icon {
|
|
84
|
+
width: 20px;
|
|
85
|
+
height: 20px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
button[data-size='lg'] > wui-image,
|
|
89
|
+
button[data-size='lg'] > wui-icon {
|
|
90
|
+
width: 24px;
|
|
91
|
+
height: 24px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
wui-text {
|
|
95
|
+
padding-left: ${({ spacing }) => spacing[1]};
|
|
96
|
+
padding-right: ${({ spacing }) => spacing[1]};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
wui-image {
|
|
100
|
+
border-radius: ${({ borderRadius }) => borderRadius[3]};
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
user-drag: none;
|
|
103
|
+
user-select: none;
|
|
104
|
+
-moz-user-select: none;
|
|
105
|
+
-webkit-user-drag: none;
|
|
106
|
+
-webkit-user-select: none;
|
|
107
|
+
-ms-user-select: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* -- States --------------------------------------------------------------- */
|
|
111
|
+
@media (hover: hover) and (pointer: fine) {
|
|
112
|
+
button[data-type='accent']:not(:disabled):hover {
|
|
113
|
+
background-color: ${({ tokens }) => tokens.core.foregroundAccent060};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
button[data-type='neutral']:not(:disabled):hover {
|
|
117
|
+
background-color: ${({ tokens }) => tokens.theme.foregroundTertiary};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
button[data-type='accent']:not(:disabled):focus-visible,
|
|
122
|
+
button[data-type='accent']:not(:disabled):active {
|
|
123
|
+
box-shadow: 0 0 0 4px ${({ tokens }) => tokens.core.foregroundAccent020};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
button[data-type='neutral']:not(:disabled):focus-visible,
|
|
127
|
+
button[data-type='neutral']:not(:disabled):active {
|
|
128
|
+
box-shadow: 0 0 0 4px ${({ tokens }) => tokens.core.foregroundAccent020};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
button:disabled {
|
|
132
|
+
opacity: 0.5;
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
|
|
136
|
+
var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
137
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
138
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
139
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
140
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
141
|
+
};
|
|
142
|
+
const FONT_BY_SIZE = {
|
|
143
|
+
sm: 'sm-regular',
|
|
144
|
+
md: 'md-regular',
|
|
145
|
+
lg: 'lg-regular'
|
|
146
|
+
};
|
|
147
|
+
let WuiChipButton = class WuiChipButton extends i {
|
|
148
|
+
constructor() {
|
|
149
|
+
super(...arguments);
|
|
150
|
+
this.type = 'accent';
|
|
151
|
+
this.size = 'md';
|
|
152
|
+
this.imageSrc = '';
|
|
153
|
+
this.disabled = false;
|
|
154
|
+
this.leftIcon = undefined;
|
|
155
|
+
this.rightIcon = undefined;
|
|
156
|
+
this.text = '';
|
|
157
|
+
}
|
|
158
|
+
render() {
|
|
159
|
+
return b `
|
|
160
|
+
<button ?disabled=${this.disabled} data-type=${this.type} data-size=${this.size}>
|
|
161
|
+
${this.imageSrc ? b `<wui-image src=${this.imageSrc}></wui-image>` : null}
|
|
162
|
+
${this.leftIcon
|
|
163
|
+
? b `<wui-icon name=${this.leftIcon} color="inherit" size="inherit"></wui-icon>`
|
|
164
|
+
: null}
|
|
165
|
+
<wui-text variant=${FONT_BY_SIZE[this.size]} color="inherit">${this.text}</wui-text>
|
|
166
|
+
${this.rightIcon
|
|
167
|
+
? b `<wui-icon name=${this.rightIcon} color="inherit" size="inherit"></wui-icon>`
|
|
168
|
+
: null}
|
|
169
|
+
</button>
|
|
170
|
+
`;
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
WuiChipButton.styles = [resetStyles, elementStyles, styles$2];
|
|
174
|
+
__decorate$3([
|
|
175
|
+
n()
|
|
176
|
+
], WuiChipButton.prototype, "type", void 0);
|
|
177
|
+
__decorate$3([
|
|
178
|
+
n()
|
|
179
|
+
], WuiChipButton.prototype, "size", void 0);
|
|
180
|
+
__decorate$3([
|
|
181
|
+
n()
|
|
182
|
+
], WuiChipButton.prototype, "imageSrc", void 0);
|
|
183
|
+
__decorate$3([
|
|
184
|
+
n({ type: Boolean })
|
|
185
|
+
], WuiChipButton.prototype, "disabled", void 0);
|
|
186
|
+
__decorate$3([
|
|
187
|
+
n()
|
|
188
|
+
], WuiChipButton.prototype, "leftIcon", void 0);
|
|
189
|
+
__decorate$3([
|
|
190
|
+
n()
|
|
191
|
+
], WuiChipButton.prototype, "rightIcon", void 0);
|
|
192
|
+
__decorate$3([
|
|
193
|
+
n()
|
|
194
|
+
], WuiChipButton.prototype, "text", void 0);
|
|
195
|
+
WuiChipButton = __decorate$3([
|
|
196
|
+
customElement('wui-chip-button')
|
|
197
|
+
], WuiChipButton);
|
|
198
|
+
|
|
199
|
+
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
200
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
201
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
202
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
203
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
204
|
+
};
|
|
205
|
+
let W3mFundInput = class W3mFundInput extends i {
|
|
206
|
+
constructor() {
|
|
207
|
+
super(...arguments);
|
|
208
|
+
this.maxDecimals = undefined;
|
|
209
|
+
this.maxIntegers = undefined;
|
|
210
|
+
}
|
|
211
|
+
render() {
|
|
212
|
+
return b `
|
|
213
|
+
<wui-flex alignItems="center" gap="1">
|
|
214
|
+
<wui-input-amount
|
|
215
|
+
widthVariant="fit"
|
|
216
|
+
fontSize="h2"
|
|
217
|
+
.maxDecimals=${o(this.maxDecimals)}
|
|
218
|
+
.maxIntegers=${o(this.maxIntegers)}
|
|
219
|
+
.value=${this.amount ? String(this.amount) : ''}
|
|
220
|
+
></wui-input-amount>
|
|
221
|
+
<wui-text variant="md-regular" color="secondary">USD</wui-text>
|
|
222
|
+
</wui-flex>
|
|
223
|
+
`;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
__decorate$2([
|
|
227
|
+
n({ type: Number })
|
|
228
|
+
], W3mFundInput.prototype, "amount", void 0);
|
|
229
|
+
__decorate$2([
|
|
230
|
+
n({ type: Number })
|
|
231
|
+
], W3mFundInput.prototype, "maxDecimals", void 0);
|
|
232
|
+
__decorate$2([
|
|
233
|
+
n({ type: Number })
|
|
234
|
+
], W3mFundInput.prototype, "maxIntegers", void 0);
|
|
235
|
+
W3mFundInput = __decorate$2([
|
|
236
|
+
customElement('w3m-fund-input')
|
|
237
|
+
], W3mFundInput);
|
|
238
|
+
|
|
239
|
+
var styles$1 = css `
|
|
240
|
+
.amount-input-container {
|
|
241
|
+
border-radius: ${({ borderRadius }) => borderRadius['6']};
|
|
242
|
+
border-top-right-radius: 0;
|
|
243
|
+
border-top-left-radius: 0;
|
|
244
|
+
background-color: ${({ tokens }) => tokens.theme.foregroundPrimary};
|
|
245
|
+
padding: ${({ spacing }) => spacing[1]};
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.container {
|
|
249
|
+
border-radius: 30px;
|
|
250
|
+
}
|
|
251
|
+
`;
|
|
252
|
+
|
|
253
|
+
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
254
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
255
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
256
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
257
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
258
|
+
};
|
|
259
|
+
const PRESET_AMOUNTS = [10, 50, 100];
|
|
260
|
+
const MAX_DECIMALS = 6;
|
|
261
|
+
const MAX_INTEGERS = 10;
|
|
262
|
+
let W3mDepositFromExchangeView = class W3mDepositFromExchangeView extends i {
|
|
263
|
+
constructor() {
|
|
264
|
+
super();
|
|
265
|
+
this.unsubscribe = [];
|
|
266
|
+
this.network = ChainController.state.activeCaipNetwork;
|
|
267
|
+
this.exchanges = ExchangeController.state.exchanges;
|
|
268
|
+
this.isLoading = ExchangeController.state.isLoading;
|
|
269
|
+
this.amount = ExchangeController.state.amount;
|
|
270
|
+
this.tokenAmount = ExchangeController.state.tokenAmount;
|
|
271
|
+
this.priceLoading = ExchangeController.state.priceLoading;
|
|
272
|
+
this.isPaymentInProgress = ExchangeController.state.isPaymentInProgress;
|
|
273
|
+
this.currentPayment = ExchangeController.state.currentPayment;
|
|
274
|
+
this.paymentId = ExchangeController.state.paymentId;
|
|
275
|
+
this.paymentAsset = ExchangeController.state.paymentAsset;
|
|
276
|
+
this.unsubscribe.push(ChainController.subscribeKey('activeCaipNetwork', val => {
|
|
277
|
+
this.network = val;
|
|
278
|
+
this.setDefaultPaymentAsset();
|
|
279
|
+
}), ExchangeController.subscribe(exchangeState => {
|
|
280
|
+
this.exchanges = exchangeState.exchanges;
|
|
281
|
+
this.isLoading = exchangeState.isLoading;
|
|
282
|
+
this.amount = exchangeState.amount;
|
|
283
|
+
this.tokenAmount = exchangeState.tokenAmount;
|
|
284
|
+
this.priceLoading = exchangeState.priceLoading;
|
|
285
|
+
this.paymentId = exchangeState.paymentId;
|
|
286
|
+
this.isPaymentInProgress = exchangeState.isPaymentInProgress;
|
|
287
|
+
this.currentPayment = exchangeState.currentPayment;
|
|
288
|
+
this.paymentAsset = exchangeState.paymentAsset;
|
|
289
|
+
const shouldHandlePaymentInProgress = exchangeState.isPaymentInProgress &&
|
|
290
|
+
exchangeState.currentPayment?.exchangeId &&
|
|
291
|
+
exchangeState.currentPayment?.sessionId &&
|
|
292
|
+
exchangeState.paymentId;
|
|
293
|
+
if (shouldHandlePaymentInProgress) {
|
|
294
|
+
this.handlePaymentInProgress();
|
|
295
|
+
}
|
|
296
|
+
}));
|
|
297
|
+
}
|
|
298
|
+
disconnectedCallback() {
|
|
299
|
+
this.unsubscribe.forEach(unsubscribe => unsubscribe());
|
|
300
|
+
const isInProgress = ExchangeController.state.isPaymentInProgress;
|
|
301
|
+
if (!isInProgress) {
|
|
302
|
+
ExchangeController.reset();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
async firstUpdated() {
|
|
306
|
+
await this.getPaymentAssets();
|
|
307
|
+
if (!this.paymentAsset) {
|
|
308
|
+
await this.setDefaultPaymentAsset();
|
|
309
|
+
}
|
|
310
|
+
ExchangeController.setAmount(PRESET_AMOUNTS[0]);
|
|
311
|
+
await ExchangeController.fetchExchanges();
|
|
312
|
+
}
|
|
313
|
+
render() {
|
|
314
|
+
return b `
|
|
315
|
+
<wui-flex flexDirection="column" class="container">
|
|
316
|
+
${this.amountInputTemplate()} ${this.exchangesTemplate()}
|
|
317
|
+
</wui-flex>
|
|
318
|
+
`;
|
|
319
|
+
}
|
|
320
|
+
exchangesLoadingTemplate() {
|
|
321
|
+
return Array.from({ length: 2 }).map(() => b `<wui-shimmer width="100%" height="65px" borderRadius="xxs"></wui-shimmer>`);
|
|
322
|
+
}
|
|
323
|
+
_exchangesTemplate() {
|
|
324
|
+
return this.exchanges.length > 0
|
|
325
|
+
? this.exchanges.map(exchange => b `<wui-list-item
|
|
326
|
+
@click=${() => this.onExchangeClick(exchange)}
|
|
327
|
+
chevron
|
|
328
|
+
variant="image"
|
|
329
|
+
imageSrc=${exchange.imageUrl}
|
|
330
|
+
?loading=${this.isLoading}
|
|
331
|
+
>
|
|
332
|
+
<wui-text variant="md-regular" color="primary">
|
|
333
|
+
Deposit from ${exchange.name}
|
|
334
|
+
</wui-text>
|
|
335
|
+
</wui-list-item>`)
|
|
336
|
+
: b `<wui-flex flexDirection="column" alignItems="center" gap="4" padding="4">
|
|
337
|
+
<wui-text variant="lg-medium" align="center" color="primary">
|
|
338
|
+
No exchanges support this asset on this network
|
|
339
|
+
</wui-text>
|
|
340
|
+
</wui-flex>`;
|
|
341
|
+
}
|
|
342
|
+
exchangesTemplate() {
|
|
343
|
+
return b `<wui-flex
|
|
344
|
+
flexDirection="column"
|
|
345
|
+
gap="2"
|
|
346
|
+
.padding=${['3', '3', '3', '3']}
|
|
347
|
+
class="exchanges-container"
|
|
348
|
+
>
|
|
349
|
+
${this.isLoading ? this.exchangesLoadingTemplate() : this._exchangesTemplate()}
|
|
350
|
+
</wui-flex>`;
|
|
351
|
+
}
|
|
352
|
+
amountInputTemplate() {
|
|
353
|
+
return b `
|
|
354
|
+
<wui-flex
|
|
355
|
+
flexDirection="column"
|
|
356
|
+
.padding=${['0', '3', '3', '3']}
|
|
357
|
+
class="amount-input-container"
|
|
358
|
+
>
|
|
359
|
+
<wui-flex
|
|
360
|
+
justifyContent="space-between"
|
|
361
|
+
alignItems="center"
|
|
362
|
+
.margin=${['0', '0', '6', '0']}
|
|
363
|
+
>
|
|
364
|
+
<wui-text variant="md-medium" color="secondary">Asset</wui-text>
|
|
365
|
+
<wui-token-button
|
|
366
|
+
data-testid="deposit-from-exchange-asset-button"
|
|
367
|
+
flexDirection="row-reverse"
|
|
368
|
+
text=${this.paymentAsset?.metadata.symbol || ''}
|
|
369
|
+
imageSrc=${this.paymentAsset?.metadata.iconUrl || ''}
|
|
370
|
+
@click=${() => RouterController.push('PayWithExchangeSelectAsset')}
|
|
371
|
+
size="lg"
|
|
372
|
+
.chainImageSrc=${o(AssetUtil.getNetworkImage(this.network))}
|
|
373
|
+
>
|
|
374
|
+
</wui-token-button>
|
|
375
|
+
</wui-flex>
|
|
376
|
+
<wui-flex
|
|
377
|
+
flexDirection="column"
|
|
378
|
+
alignItems="center"
|
|
379
|
+
justifyContent="center"
|
|
380
|
+
.margin=${['0', '0', '4', '0']}
|
|
381
|
+
>
|
|
382
|
+
<w3m-fund-input
|
|
383
|
+
@inputChange=${this.onAmountChange.bind(this)}
|
|
384
|
+
.amount=${this.amount}
|
|
385
|
+
.maxDecimals=${MAX_DECIMALS}
|
|
386
|
+
.maxIntegers=${MAX_INTEGERS}
|
|
387
|
+
>
|
|
388
|
+
</w3m-fund-input>
|
|
389
|
+
${this.tokenAmountTemplate()}
|
|
390
|
+
</wui-flex>
|
|
391
|
+
<wui-flex justifyContent="center" gap="2">
|
|
392
|
+
${PRESET_AMOUNTS.map(amount => b `<wui-chip-button
|
|
393
|
+
@click=${() => ExchangeController.setAmount(amount)}
|
|
394
|
+
type="neutral"
|
|
395
|
+
size="lg"
|
|
396
|
+
text=${`$${amount}`}
|
|
397
|
+
></wui-chip-button>`)}
|
|
398
|
+
</wui-flex>
|
|
399
|
+
</wui-flex>
|
|
400
|
+
`;
|
|
401
|
+
}
|
|
402
|
+
tokenAmountTemplate() {
|
|
403
|
+
if (this.priceLoading) {
|
|
404
|
+
return b `<wui-shimmer
|
|
405
|
+
width="65px"
|
|
406
|
+
height="20px"
|
|
407
|
+
borderRadius="xxs"
|
|
408
|
+
variant="light"
|
|
409
|
+
></wui-shimmer>`;
|
|
410
|
+
}
|
|
411
|
+
return b `
|
|
412
|
+
<wui-text variant="md-regular" color="secondary">
|
|
413
|
+
${this.tokenAmount.toFixed(4)} ${this.paymentAsset?.metadata.symbol}
|
|
414
|
+
</wui-text>
|
|
415
|
+
`;
|
|
416
|
+
}
|
|
417
|
+
async onExchangeClick(exchange) {
|
|
418
|
+
if (!this.amount) {
|
|
419
|
+
SnackController.showError('Please enter an amount');
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
await ExchangeController.handlePayWithExchange(exchange.id);
|
|
423
|
+
}
|
|
424
|
+
handlePaymentInProgress() {
|
|
425
|
+
const namespace = ChainController.state.activeChain;
|
|
426
|
+
const { redirectView = 'Account' } = RouterController.state.data ?? {};
|
|
427
|
+
if (this.isPaymentInProgress &&
|
|
428
|
+
this.currentPayment?.exchangeId &&
|
|
429
|
+
this.currentPayment?.sessionId &&
|
|
430
|
+
this.paymentId) {
|
|
431
|
+
ExchangeController.waitUntilComplete({
|
|
432
|
+
exchangeId: this.currentPayment.exchangeId,
|
|
433
|
+
sessionId: this.currentPayment.sessionId,
|
|
434
|
+
paymentId: this.paymentId
|
|
435
|
+
}).then(status => {
|
|
436
|
+
if (status.status === 'SUCCESS') {
|
|
437
|
+
SnackController.showSuccess('Deposit completed');
|
|
438
|
+
ExchangeController.reset();
|
|
439
|
+
if (namespace) {
|
|
440
|
+
ChainController.fetchTokenBalance();
|
|
441
|
+
ConnectionController.updateBalance(namespace);
|
|
442
|
+
}
|
|
443
|
+
RouterController.replace('Transactions');
|
|
444
|
+
}
|
|
445
|
+
else if (status.status === 'FAILED') {
|
|
446
|
+
SnackController.showError('Deposit failed');
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
SnackController.showLoading('Deposit in progress...');
|
|
450
|
+
RouterController.replace(redirectView);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
onAmountChange({ detail }) {
|
|
454
|
+
ExchangeController.setAmount(detail ? Number(detail) : null);
|
|
455
|
+
}
|
|
456
|
+
async getPaymentAssets() {
|
|
457
|
+
if (this.network) {
|
|
458
|
+
await ExchangeController.getAssetsForNetwork(this.network.caipNetworkId);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
async setDefaultPaymentAsset() {
|
|
462
|
+
if (this.network) {
|
|
463
|
+
const paymentAssets = await ExchangeController.getAssetsForNetwork(this.network.caipNetworkId);
|
|
464
|
+
if (paymentAssets[0]) {
|
|
465
|
+
ExchangeController.setPaymentAsset(paymentAssets[0]);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
W3mDepositFromExchangeView.styles = styles$1;
|
|
471
|
+
__decorate$1([
|
|
472
|
+
r()
|
|
473
|
+
], W3mDepositFromExchangeView.prototype, "network", void 0);
|
|
474
|
+
__decorate$1([
|
|
475
|
+
r()
|
|
476
|
+
], W3mDepositFromExchangeView.prototype, "exchanges", void 0);
|
|
477
|
+
__decorate$1([
|
|
478
|
+
r()
|
|
479
|
+
], W3mDepositFromExchangeView.prototype, "isLoading", void 0);
|
|
480
|
+
__decorate$1([
|
|
481
|
+
r()
|
|
482
|
+
], W3mDepositFromExchangeView.prototype, "amount", void 0);
|
|
483
|
+
__decorate$1([
|
|
484
|
+
r()
|
|
485
|
+
], W3mDepositFromExchangeView.prototype, "tokenAmount", void 0);
|
|
486
|
+
__decorate$1([
|
|
487
|
+
r()
|
|
488
|
+
], W3mDepositFromExchangeView.prototype, "priceLoading", void 0);
|
|
489
|
+
__decorate$1([
|
|
490
|
+
r()
|
|
491
|
+
], W3mDepositFromExchangeView.prototype, "isPaymentInProgress", void 0);
|
|
492
|
+
__decorate$1([
|
|
493
|
+
r()
|
|
494
|
+
], W3mDepositFromExchangeView.prototype, "currentPayment", void 0);
|
|
495
|
+
__decorate$1([
|
|
496
|
+
r()
|
|
497
|
+
], W3mDepositFromExchangeView.prototype, "paymentId", void 0);
|
|
498
|
+
__decorate$1([
|
|
499
|
+
r()
|
|
500
|
+
], W3mDepositFromExchangeView.prototype, "paymentAsset", void 0);
|
|
501
|
+
W3mDepositFromExchangeView = __decorate$1([
|
|
502
|
+
customElement('w3m-deposit-from-exchange-view')
|
|
503
|
+
], W3mDepositFromExchangeView);
|
|
504
|
+
|
|
505
|
+
var styles = css `
|
|
506
|
+
.contentContainer {
|
|
507
|
+
height: 440px;
|
|
508
|
+
overflow: scroll;
|
|
509
|
+
scrollbar-width: none;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.contentContainer::-webkit-scrollbar {
|
|
513
|
+
display: none;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
wui-icon-box {
|
|
517
|
+
width: 40px;
|
|
518
|
+
height: 40px;
|
|
519
|
+
border-radius: ${({ borderRadius }) => borderRadius['3']};
|
|
520
|
+
}
|
|
521
|
+
`;
|
|
522
|
+
|
|
523
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
524
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
525
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
526
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
527
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
528
|
+
};
|
|
529
|
+
let W3mDepositFromExchangeSelectAssetView = class W3mDepositFromExchangeSelectAssetView extends i {
|
|
530
|
+
constructor() {
|
|
531
|
+
super();
|
|
532
|
+
this.unsubscribe = [];
|
|
533
|
+
this.assets = ExchangeController.state.assets;
|
|
534
|
+
this.search = '';
|
|
535
|
+
this.onDebouncedSearch = CoreHelperUtil.debounce((value) => {
|
|
536
|
+
this.search = value;
|
|
537
|
+
});
|
|
538
|
+
this.unsubscribe.push(...[
|
|
539
|
+
ExchangeController.subscribe(val => {
|
|
540
|
+
this.assets = val.assets;
|
|
541
|
+
})
|
|
542
|
+
]);
|
|
543
|
+
}
|
|
544
|
+
disconnectedCallback() {
|
|
545
|
+
this.unsubscribe.forEach(unsubscribe => unsubscribe());
|
|
546
|
+
}
|
|
547
|
+
render() {
|
|
548
|
+
return b `
|
|
549
|
+
<wui-flex flexDirection="column">
|
|
550
|
+
${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
|
|
551
|
+
</wui-flex>
|
|
552
|
+
`;
|
|
553
|
+
}
|
|
554
|
+
templateSearchInput() {
|
|
555
|
+
return b `
|
|
556
|
+
<wui-flex gap="2" padding="3">
|
|
557
|
+
<wui-input-text
|
|
558
|
+
@inputChange=${this.onInputChange.bind(this)}
|
|
559
|
+
class="network-search-input"
|
|
560
|
+
size="sm"
|
|
561
|
+
placeholder="Search token"
|
|
562
|
+
icon="search"
|
|
563
|
+
></wui-input-text>
|
|
564
|
+
</wui-flex>
|
|
565
|
+
`;
|
|
566
|
+
}
|
|
567
|
+
templateTokens() {
|
|
568
|
+
const filteredAssets = this.assets.filter(asset => asset.metadata.name.toLowerCase().includes(this.search.toLowerCase()));
|
|
569
|
+
const hasAssets = filteredAssets.length > 0;
|
|
570
|
+
return b `
|
|
571
|
+
<wui-flex
|
|
572
|
+
class="contentContainer"
|
|
573
|
+
flexDirection="column"
|
|
574
|
+
.padding=${['0', '3', '0', '3']}
|
|
575
|
+
>
|
|
576
|
+
<wui-flex justifyContent="flex-start" .padding=${['4', '3', '3', '3']}>
|
|
577
|
+
<wui-text variant="md-medium" color="secondary">Available tokens</wui-text>
|
|
578
|
+
</wui-flex>
|
|
579
|
+
<wui-flex flexDirection="column" gap="2">
|
|
580
|
+
${hasAssets
|
|
581
|
+
? filteredAssets.map(asset => b `<wui-list-item
|
|
582
|
+
.imageSrc=${asset.metadata.iconUrl}
|
|
583
|
+
?clickable=${true}
|
|
584
|
+
@click=${this.handleTokenClick.bind(this, asset)}
|
|
585
|
+
>
|
|
586
|
+
<wui-text variant="md-medium" color="primary">${asset.metadata.name}</wui-text>
|
|
587
|
+
<wui-text variant="md-regular" color="secondary"
|
|
588
|
+
>${asset.metadata.symbol}</wui-text
|
|
589
|
+
>
|
|
590
|
+
</wui-list-item>`)
|
|
591
|
+
: b `<wui-flex
|
|
592
|
+
.padding=${['20', '0', '0', '0']}
|
|
593
|
+
alignItems="center"
|
|
594
|
+
flexDirection="column"
|
|
595
|
+
gap="4"
|
|
596
|
+
>
|
|
597
|
+
<wui-icon-box icon="coinPlaceholder" color="default" size="lg"></wui-icon-box>
|
|
598
|
+
<wui-flex
|
|
599
|
+
class="textContent"
|
|
600
|
+
gap="2"
|
|
601
|
+
flexDirection="column"
|
|
602
|
+
justifyContent="center"
|
|
603
|
+
>
|
|
604
|
+
<wui-text variant="lg-medium" align="center" color="primary">
|
|
605
|
+
No tokens found
|
|
606
|
+
</wui-text>
|
|
607
|
+
</wui-flex>
|
|
608
|
+
<wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>
|
|
609
|
+
</wui-flex>`}
|
|
610
|
+
</wui-flex>
|
|
611
|
+
</wui-flex>
|
|
612
|
+
`;
|
|
613
|
+
}
|
|
614
|
+
onBuyClick() {
|
|
615
|
+
RouterController.push('OnRampProviders');
|
|
616
|
+
}
|
|
617
|
+
onInputChange(event) {
|
|
618
|
+
this.onDebouncedSearch(event.detail);
|
|
619
|
+
}
|
|
620
|
+
handleTokenClick(asset) {
|
|
621
|
+
ExchangeController.setPaymentAsset(asset);
|
|
622
|
+
RouterController.goBack();
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
W3mDepositFromExchangeSelectAssetView.styles = styles;
|
|
626
|
+
__decorate([
|
|
627
|
+
r()
|
|
628
|
+
], W3mDepositFromExchangeSelectAssetView.prototype, "assets", void 0);
|
|
629
|
+
__decorate([
|
|
630
|
+
r()
|
|
631
|
+
], W3mDepositFromExchangeSelectAssetView.prototype, "search", void 0);
|
|
632
|
+
W3mDepositFromExchangeSelectAssetView = __decorate([
|
|
633
|
+
customElement('w3m-deposit-from-exchange-select-asset-view')
|
|
634
|
+
], W3mDepositFromExchangeSelectAssetView);
|
|
635
|
+
|
|
636
|
+
export { W3mDepositFromExchangeSelectAssetView, W3mDepositFromExchangeView };
|
|
637
|
+
//# sourceMappingURL=pay-with-exchange-BJYQgTMB.js.map
|
|
638
|
+
|
|
639
|
+
//# sourceMappingURL=pay-with-exchange-BJYQgTMB.js.map
|