@daimo/pay 0.3.21 → 1.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/build/index.d.ts +132 -301
- package/build/package.json.js +103 -0
- package/build/package.json.js.map +1 -0
- package/build/src/assets/ScanIconWithLogos.js +34 -0
- package/build/src/assets/ScanIconWithLogos.js.map +1 -0
- package/build/src/assets/browsers.js +13 -0
- package/build/src/assets/browsers.js.map +1 -0
- package/build/src/assets/chains.js +152 -0
- package/build/src/assets/chains.js.map +1 -0
- package/build/src/assets/coins.js +6 -0
- package/build/src/assets/coins.js.map +1 -0
- package/build/src/assets/crepe.js +8 -0
- package/build/src/assets/crepe.js.map +1 -0
- package/build/src/assets/icons.js +28 -0
- package/build/src/assets/icons.js.map +1 -0
- package/build/src/assets/logos.js +131 -0
- package/build/src/assets/logos.js.map +1 -0
- package/build/src/assets/wallet.js +8 -0
- package/build/src/assets/wallet.js.map +1 -0
- package/build/src/assets/wave.js +6 -0
- package/build/src/assets/wave.js.map +1 -0
- package/build/src/components/Common/Alert/index.js +10 -0
- package/build/src/components/Common/Alert/index.js.map +1 -0
- package/build/src/components/Common/Alert/styles.js +55 -0
- package/build/src/components/Common/Alert/styles.js.map +1 -0
- package/build/src/components/Common/Avatar/index.js +66 -0
- package/build/src/components/Common/Avatar/index.js.map +1 -0
- package/build/src/components/Common/Avatar/styles.js +59 -0
- package/build/src/components/Common/Avatar/styles.js.map +1 -0
- package/build/src/components/Common/BrowserIcon/index.js +28 -0
- package/build/src/components/Common/BrowserIcon/index.js.map +1 -0
- package/build/src/components/Common/BrowserIcon/styles.js +20 -0
- package/build/src/components/Common/BrowserIcon/styles.js.map +1 -0
- package/build/src/components/Common/Button/index.js +38 -0
- package/build/src/components/Common/Button/index.js.map +1 -0
- package/build/src/components/Common/Button/styles.js +291 -0
- package/build/src/components/Common/Button/styles.js.map +1 -0
- package/build/src/components/Common/Chain/index.js +25 -0
- package/build/src/components/Common/Chain/index.js.map +1 -0
- package/build/src/components/Common/Chain/styles.js +94 -0
- package/build/src/components/Common/Chain/styles.js.map +1 -0
- package/build/src/components/Common/ChainSelectList/index.js +107 -0
- package/build/src/components/Common/ChainSelectList/index.js.map +1 -0
- package/build/src/components/Common/ChainSelectList/styles.js +228 -0
- package/build/src/components/Common/ChainSelectList/styles.js.map +1 -0
- package/build/src/components/Common/ConnectorList/index.js +70 -0
- package/build/src/components/Common/ConnectorList/index.js.map +1 -0
- package/build/src/components/Common/ConnectorList/styles.js +314 -0
- package/build/src/components/Common/ConnectorList/styles.js.map +1 -0
- package/build/src/components/Common/CopyToClipboard/CopyToClipboardIcon.js +71 -0
- package/build/src/components/Common/CopyToClipboard/CopyToClipboardIcon.js.map +1 -0
- package/build/src/components/Common/CopyToClipboard/index.js +51 -0
- package/build/src/components/Common/CopyToClipboard/index.js.map +1 -0
- package/build/src/components/Common/CustomQRCode/QRCode.js +69 -0
- package/build/src/components/Common/CustomQRCode/QRCode.js.map +1 -0
- package/build/src/components/Common/CustomQRCode/index.js +22 -0
- package/build/src/components/Common/CustomQRCode/index.js.map +1 -0
- package/build/src/components/Common/CustomQRCode/styles.js +155 -0
- package/build/src/components/Common/CustomQRCode/styles.js.map +1 -0
- package/build/src/components/Common/FitText/index.js +27 -0
- package/build/src/components/Common/FitText/index.js.map +1 -0
- package/build/src/components/Common/Modal/index.js +297 -0
- package/build/src/components/Common/Modal/index.js.map +1 -0
- package/build/src/components/Common/Modal/styles.js +660 -0
- package/build/src/components/Common/Modal/styles.js.map +1 -0
- package/build/src/components/Common/OptionsList/index.js +106 -0
- package/build/src/components/Common/OptionsList/index.js.map +1 -0
- package/build/src/components/Common/OptionsList/styles.js +165 -0
- package/build/src/components/Common/OptionsList/styles.js.map +1 -0
- package/build/src/components/Common/OrderHeader/index.js +215 -0
- package/build/src/components/Common/OrderHeader/index.js.map +1 -0
- package/build/src/components/Common/Portal/index.js +31 -0
- package/build/src/components/Common/Portal/index.js.map +1 -0
- package/build/src/components/Common/PoweredByFooter/index.js +44 -0
- package/build/src/components/Common/PoweredByFooter/index.js.map +1 -0
- package/build/src/components/Common/ScrollArea/index.js +62 -0
- package/build/src/components/Common/ScrollArea/index.js.map +1 -0
- package/build/src/components/Common/ScrollArea/styles.js +168 -0
- package/build/src/components/Common/ScrollArea/styles.js.map +1 -0
- package/build/src/components/Common/Spinner/index.js +24 -0
- package/build/src/components/Common/Spinner/index.js.map +1 -0
- package/build/src/components/Common/Spinner/styles.js +22 -0
- package/build/src/components/Common/Spinner/styles.js.map +1 -0
- package/build/src/components/Common/ThemedButton/index.js +25 -0
- package/build/src/components/Common/ThemedButton/index.js.map +1 -0
- package/build/src/components/Common/ThemedButton/styles.js +152 -0
- package/build/src/components/Common/ThemedButton/styles.js.map +1 -0
- package/build/src/components/Common/Tooltip/index.js +97 -0
- package/build/src/components/Common/Tooltip/index.js.map +1 -0
- package/build/src/components/Common/Tooltip/styles.js +81 -0
- package/build/src/components/Common/Tooltip/styles.js.map +1 -0
- package/build/src/components/DaimoPay.js +232 -0
- package/build/src/components/DaimoPay.js.map +1 -0
- package/build/src/components/DaimoPayButton/index.js +129 -0
- package/build/src/components/DaimoPayButton/index.js.map +1 -0
- package/build/src/components/DaimoPayButton/styles.js +50 -0
- package/build/src/components/DaimoPayButton/styles.js.map +1 -0
- package/build/src/components/DaimoPayModal/ConnectUsing.js +45 -0
- package/build/src/components/DaimoPayModal/ConnectUsing.js.map +1 -0
- package/build/src/components/DaimoPayModal/ConnectWithInjector/index.js +202 -0
- package/build/src/components/DaimoPayModal/ConnectWithInjector/index.js.map +1 -0
- package/build/src/components/DaimoPayModal/ConnectWithInjector/styles.js +133 -0
- package/build/src/components/DaimoPayModal/ConnectWithInjector/styles.js.map +1 -0
- package/build/src/components/DaimoPayModal/ConnectWithQRCode.js +75 -0
- package/build/src/components/DaimoPayModal/ConnectWithQRCode.js.map +1 -0
- package/build/src/components/DaimoPayModal/index.js +140 -0
- package/build/src/components/DaimoPayModal/index.js.map +1 -0
- package/build/src/components/DaimoPayThemeProvider/DaimoPayThemeProvider.js +21 -0
- package/build/src/components/DaimoPayThemeProvider/DaimoPayThemeProvider.js.map +1 -0
- package/build/src/components/Pages/About/graphics.js +187 -0
- package/build/src/components/Pages/About/graphics.js.map +1 -0
- package/build/src/components/Pages/About/index.js +131 -0
- package/build/src/components/Pages/About/index.js.map +1 -0
- package/build/src/components/Pages/About/styles.js +144 -0
- package/build/src/components/Pages/About/styles.js.map +1 -0
- package/build/src/components/Pages/Confirmation/index.js +105 -0
- package/build/src/components/Pages/Confirmation/index.js.map +1 -0
- package/build/src/components/Pages/Connectors/index.js +20 -0
- package/build/src/components/Pages/Connectors/index.js.map +1 -0
- package/build/src/components/Pages/Connectors/styles.js +267 -0
- package/build/src/components/Pages/Connectors/styles.js.map +1 -0
- package/build/src/components/Pages/DownloadApp/index.js +30 -0
- package/build/src/components/Pages/DownloadApp/index.js.map +1 -0
- package/build/src/components/Pages/MobileConnectors/index.js +73 -0
- package/build/src/components/Pages/MobileConnectors/index.js.map +1 -0
- package/build/src/components/Pages/MobileConnectors/styles.js +65 -0
- package/build/src/components/Pages/MobileConnectors/styles.js.map +1 -0
- package/build/src/components/Pages/Onboarding/index.js +18 -0
- package/build/src/components/Pages/Onboarding/index.js.map +1 -0
- package/build/src/components/Pages/Onboarding/styles.js +229 -0
- package/build/src/components/Pages/Onboarding/styles.js.map +1 -0
- package/build/src/components/Pages/PayWithToken/index.js +204 -0
- package/build/src/components/Pages/PayWithToken/index.js.map +1 -0
- package/build/src/components/Pages/SelectDepositAddressChain/index.js +32 -0
- package/build/src/components/Pages/SelectDepositAddressChain/index.js.map +1 -0
- package/build/src/components/Pages/SelectMethod/index.js +113 -0
- package/build/src/components/Pages/SelectMethod/index.js.map +1 -0
- package/build/src/components/Pages/SelectToken/index.js +62 -0
- package/build/src/components/Pages/SelectToken/index.js.map +1 -0
- package/build/src/components/Pages/Solana/ConnectSolana/index.js +37 -0
- package/build/src/components/Pages/Solana/ConnectSolana/index.js.map +1 -0
- package/build/src/components/Pages/Solana/ConnectorSolana/index.js +45 -0
- package/build/src/components/Pages/Solana/ConnectorSolana/index.js.map +1 -0
- package/build/src/components/Pages/Solana/PayWithSolanaToken/index.js +85 -0
- package/build/src/components/Pages/Solana/PayWithSolanaToken/index.js.map +1 -0
- package/build/src/components/Pages/Solana/SelectSolanaToken/index.js +38 -0
- package/build/src/components/Pages/Solana/SelectSolanaToken/index.js.map +1 -0
- package/build/src/components/Pages/SwitchNetworks/index.js +26 -0
- package/build/src/components/Pages/SwitchNetworks/index.js.map +1 -0
- package/build/src/components/Pages/WaitingDepositAddress/index.js +51 -0
- package/build/src/components/Pages/WaitingDepositAddress/index.js.map +1 -0
- package/build/src/components/Pages/WaitingOther/index.js +91 -0
- package/build/src/components/Pages/WaitingOther/index.js.map +1 -0
- package/build/src/components/Spinners/CircleSpinner/index.js +15 -0
- package/build/src/components/Spinners/CircleSpinner/index.js.map +1 -0
- package/build/src/components/Spinners/CircleSpinner/styles.js +118 -0
- package/build/src/components/Spinners/CircleSpinner/styles.js.map +1 -0
- package/build/src/components/Spinners/SquircleSpinner/index.js +15 -0
- package/build/src/components/Spinners/SquircleSpinner/index.js.map +1 -0
- package/build/src/components/Spinners/SquircleSpinner/styles.js +66 -0
- package/build/src/components/Spinners/SquircleSpinner/styles.js.map +1 -0
- package/build/src/components/contexts/solana/index.js +11 -0
- package/build/src/components/contexts/solana/index.js.map +1 -0
- package/build/src/components/contexts/web3/index.js +46 -0
- package/build/src/components/contexts/web3/index.js.map +1 -0
- package/build/src/constants/chainConfigs.js +306 -0
- package/build/src/constants/chainConfigs.js.map +1 -0
- package/build/src/constants/defaultTheme.js +6 -0
- package/build/src/constants/defaultTheme.js.map +1 -0
- package/build/src/defaultConfig.js +59 -0
- package/build/src/defaultConfig.js.map +1 -0
- package/build/src/defaultConnectors.js +43 -0
- package/build/src/defaultConnectors.js.map +1 -0
- package/build/src/hooks/connectors/useWalletConnectUri.js +93 -0
- package/build/src/hooks/connectors/useWalletConnectUri.js.map +1 -0
- package/build/src/hooks/useChainIsSupported.js +12 -0
- package/build/src/hooks/useChainIsSupported.js.map +1 -0
- package/build/src/hooks/useChains.js +11 -0
- package/build/src/hooks/useChains.js.map +1 -0
- package/build/src/hooks/useConnect.js +45 -0
- package/build/src/hooks/useConnect.js.map +1 -0
- package/build/src/hooks/useConnectCallback.js +18 -0
- package/build/src/hooks/useConnectCallback.js.map +1 -0
- package/build/src/hooks/useConnectors.js +29 -0
- package/build/src/hooks/useConnectors.js.map +1 -0
- package/build/src/hooks/useDaimoPayStatus.js +37 -0
- package/build/src/hooks/useDaimoPayStatus.js.map +1 -0
- package/build/src/hooks/useDepositAddressOptions.js +28 -0
- package/build/src/hooks/useDepositAddressOptions.js.map +1 -0
- package/build/src/hooks/useEnsFallbackConfig.js +16 -0
- package/build/src/hooks/useEnsFallbackConfig.js.map +1 -0
- package/build/src/hooks/useExternalPaymentOptions.js +46 -0
- package/build/src/hooks/useExternalPaymentOptions.js.map +1 -0
- package/build/src/hooks/useFitText.js +148 -0
- package/build/src/hooks/useFitText.js.map +1 -0
- package/build/src/hooks/useFocusTrap.js +60 -0
- package/build/src/hooks/useFocusTrap.js.map +1 -0
- package/build/src/hooks/useGoogleFont.js +45 -0
- package/build/src/hooks/useGoogleFont.js.map +1 -0
- package/build/src/hooks/useIsMobile.js +17 -0
- package/build/src/hooks/useIsMobile.js.map +1 -0
- package/build/src/hooks/useIsMounted.js +12 -0
- package/build/src/hooks/useIsMounted.js.map +1 -0
- package/build/src/hooks/useLastConnector.js +24 -0
- package/build/src/hooks/useLastConnector.js.map +1 -0
- package/build/src/hooks/useLocales.js +67 -0
- package/build/src/hooks/useLocales.js.map +1 -0
- package/build/src/hooks/useLockBodyScroll.js +53 -0
- package/build/src/hooks/useLockBodyScroll.js.map +1 -0
- package/build/src/hooks/useModal.js +35 -0
- package/build/src/hooks/useModal.js.map +1 -0
- package/build/src/hooks/usePayWithSolanaToken.js +50 -0
- package/build/src/hooks/usePayWithSolanaToken.js.map +1 -0
- package/build/src/hooks/usePayWithToken.js +57 -0
- package/build/src/hooks/usePayWithToken.js.map +1 -0
- package/build/src/hooks/usePaymentState.js +243 -0
- package/build/src/hooks/usePaymentState.js.map +1 -0
- package/build/src/hooks/usePrevious.js +14 -0
- package/build/src/hooks/usePrevious.js.map +1 -0
- package/build/src/hooks/useSolanaPaymentOptions.js +37 -0
- package/build/src/hooks/useSolanaPaymentOptions.js.map +1 -0
- package/build/src/hooks/useWalletConnectModal.js +52 -0
- package/build/src/hooks/useWalletConnectModal.js.map +1 -0
- package/build/src/hooks/useWalletPaymentOptions.js +40 -0
- package/build/src/hooks/useWalletPaymentOptions.js.map +1 -0
- package/build/src/hooks/useWindowSize.js +23 -0
- package/build/src/hooks/useWindowSize.js.map +1 -0
- package/build/src/index.js +10 -0
- package/build/src/index.js.map +1 -0
- package/build/src/localizations/index.js +57 -0
- package/build/src/localizations/index.js.map +1 -0
- package/build/src/localizations/locales/ar-AE.js +97 -0
- package/build/src/localizations/locales/ar-AE.js.map +1 -0
- package/build/src/localizations/locales/ca-AD.js +95 -0
- package/build/src/localizations/locales/ca-AD.js.map +1 -0
- package/build/src/localizations/locales/ee-EE.js +95 -0
- package/build/src/localizations/locales/ee-EE.js.map +1 -0
- package/build/src/localizations/locales/en-US.js +95 -0
- package/build/src/localizations/locales/en-US.js.map +1 -0
- package/build/src/localizations/locales/es-ES.js +95 -0
- package/build/src/localizations/locales/es-ES.js.map +1 -0
- package/build/src/localizations/locales/fa-IR.js +95 -0
- package/build/src/localizations/locales/fa-IR.js.map +1 -0
- package/build/src/localizations/locales/fr-FR.js +95 -0
- package/build/src/localizations/locales/fr-FR.js.map +1 -0
- package/build/src/localizations/locales/ja-JP.js +95 -0
- package/build/src/localizations/locales/ja-JP.js.map +1 -0
- package/build/src/localizations/locales/pt-BR.js +95 -0
- package/build/src/localizations/locales/pt-BR.js.map +1 -0
- package/build/src/localizations/locales/ru-RU.js +95 -0
- package/build/src/localizations/locales/ru-RU.js.map +1 -0
- package/build/src/localizations/locales/tr-TR.js +95 -0
- package/build/src/localizations/locales/tr-TR.js.map +1 -0
- package/build/src/localizations/locales/vi-VN.js +95 -0
- package/build/src/localizations/locales/vi-VN.js.map +1 -0
- package/build/src/localizations/locales/zh-CN.js +95 -0
- package/build/src/localizations/locales/zh-CN.js.map +1 -0
- package/build/src/styles/defaultTheme.js +89 -0
- package/build/src/styles/defaultTheme.js.map +1 -0
- package/build/src/styles/index.js +329 -0
- package/build/src/styles/index.js.map +1 -0
- package/build/src/styles/styled/index.js +16 -0
- package/build/src/styles/styled/index.js.map +1 -0
- package/build/src/styles/themes/base.js +141 -0
- package/build/src/styles/themes/base.js.map +1 -0
- package/build/src/styles/themes/index.js +13 -0
- package/build/src/styles/themes/index.js.map +1 -0
- package/build/src/styles/themes/midnight.js +76 -0
- package/build/src/styles/themes/midnight.js.map +1 -0
- package/build/src/styles/themes/minimal.js +96 -0
- package/build/src/styles/themes/minimal.js.map +1 -0
- package/build/src/styles/themes/nouns.js +81 -0
- package/build/src/styles/themes/nouns.js.map +1 -0
- package/build/src/styles/themes/retro.js +106 -0
- package/build/src/styles/themes/retro.js.map +1 -0
- package/build/src/styles/themes/rounded.js +106 -0
- package/build/src/styles/themes/rounded.js.map +1 -0
- package/build/src/styles/themes/soft.js +71 -0
- package/build/src/styles/themes/soft.js.map +1 -0
- package/build/src/styles/themes/web95.js +132 -0
- package/build/src/styles/themes/web95.js.map +1 -0
- package/build/src/utils/exports.js +12 -0
- package/build/src/utils/exports.js.map +1 -0
- package/build/src/utils/index.js +39 -0
- package/build/src/utils/index.js.map +1 -0
- package/build/src/utils/p3.js +16 -0
- package/build/src/utils/p3.js.map +1 -0
- package/build/src/utils/platform.js +13 -0
- package/build/src/utils/platform.js.map +1 -0
- package/build/src/utils/trpc.js +14 -0
- package/build/src/utils/trpc.js.map +1 -0
- package/build/src/utils/wallets.js +14 -0
- package/build/src/utils/wallets.js.map +1 -0
- package/build/src/wallets/index.js +32 -0
- package/build/src/wallets/index.js.map +1 -0
- package/build/src/wallets/useWallets.js +86 -0
- package/build/src/wallets/useWallets.js.map +1 -0
- package/build/src/wallets/walletConfigs.js +362 -0
- package/build/src/wallets/walletConfigs.js.map +1 -0
- package/package.json +5 -5
- package/build/index.es.js +0 -11565
- package/build/index.es.js.map +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useConnect, useDisconnect, useAccount } from 'wagmi';
|
|
3
|
+
import ChainSelectList from '../../Common/ChainSelectList/index.js';
|
|
4
|
+
import { PageContent, ModalContent, ModalBody } from '../../Common/Modal/styles.js';
|
|
5
|
+
import useLocales from '../../../hooks/useLocales.js';
|
|
6
|
+
import { DisconnectIcon } from '../../../assets/icons.js';
|
|
7
|
+
import { useChainIsSupported } from '../../../hooks/useChainIsSupported.js';
|
|
8
|
+
import { isSafeConnector } from '../../../utils/index.js';
|
|
9
|
+
import Button from '../../Common/Button/index.js';
|
|
10
|
+
import { OrDivider } from '../../Common/Modal/index.js';
|
|
11
|
+
|
|
12
|
+
const SwitchNetworks = () => {
|
|
13
|
+
const { reset } = useConnect();
|
|
14
|
+
const { disconnect } = useDisconnect();
|
|
15
|
+
const { connector, chain } = useAccount();
|
|
16
|
+
const isChainSupported = useChainIsSupported(chain?.id);
|
|
17
|
+
const locales = useLocales({});
|
|
18
|
+
const onDisconnect = () => {
|
|
19
|
+
disconnect();
|
|
20
|
+
reset();
|
|
21
|
+
};
|
|
22
|
+
return (jsx(PageContent, { style: { width: 278 }, children: jsxs(ModalContent, { style: { padding: 0, marginTop: -10 }, children: [!isChainSupported && (jsxs(ModalBody, { children: [locales.warnings_chainUnsupported, " ", locales.warnings_chainUnsupportedResolve] })), jsx("div", { style: { padding: "6px 8px" }, children: jsx(ChainSelectList, { variant: "secondary" }) }), !isChainSupported && !isSafeConnector(connector?.id) && (jsxs("div", { style: { paddingTop: 12 }, children: [jsx(OrDivider, {}), jsx(Button, { icon: jsx(DisconnectIcon, {}), variant: "secondary", onClick: onDisconnect, children: locales.disconnect })] }))] }) }));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { SwitchNetworks as default };
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { usePayContext, ROUTES } from '../../DaimoPay.js';
|
|
4
|
+
import { PageContent, ModalContent, ModalH1, ModalBody } from '../../Common/Modal/styles.js';
|
|
5
|
+
import { getAddressContraction } from '@daimo/common';
|
|
6
|
+
import ScanIconWithLogos from '../../../assets/ScanIconWithLogos.js';
|
|
7
|
+
import Button from '../../Common/Button/index.js';
|
|
8
|
+
import CopyToClipboard from '../../Common/CopyToClipboard/index.js';
|
|
9
|
+
import CustomQRCode from '../../Common/CustomQRCode/index.js';
|
|
10
|
+
import { OrDivider } from '../../Common/Modal/index.js';
|
|
11
|
+
|
|
12
|
+
const WaitingDepositAddress = () => {
|
|
13
|
+
const context = usePayContext();
|
|
14
|
+
const { triggerResize, paymentState, setRoute } = context;
|
|
15
|
+
const trpc = context.trpc;
|
|
16
|
+
const { daimoPayOrder, payWithDepositAddress, selectedDepositAddressOption } = paymentState;
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const checkForSourcePayment = async () => {
|
|
19
|
+
if (!daimoPayOrder || !selectedDepositAddressOption)
|
|
20
|
+
return;
|
|
21
|
+
const found = await trpc.findSourcePayment.query({
|
|
22
|
+
orderId: daimoPayOrder.id.toString(),
|
|
23
|
+
});
|
|
24
|
+
if (found) {
|
|
25
|
+
setRoute(ROUTES.CONFIRMATION);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
// Check every 10 seconds, bitcoin takes a while
|
|
29
|
+
const interval = setInterval(checkForSourcePayment, 10000);
|
|
30
|
+
return () => clearInterval(interval);
|
|
31
|
+
}, [daimoPayOrder?.id]);
|
|
32
|
+
const [details, setDetails] = useState();
|
|
33
|
+
const [failed, setFailed] = useState(false);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!selectedDepositAddressOption)
|
|
36
|
+
return;
|
|
37
|
+
payWithDepositAddress(selectedDepositAddressOption.id).then((details) => {
|
|
38
|
+
if (!details)
|
|
39
|
+
setFailed(true);
|
|
40
|
+
else
|
|
41
|
+
setDetails(details);
|
|
42
|
+
});
|
|
43
|
+
}, [selectedDepositAddressOption]);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
triggerResize();
|
|
46
|
+
}, [details]);
|
|
47
|
+
return (jsx(PageContent, { children: failed ? (jsxs(ModalContent, { style: { marginLeft: 24, marginRight: 24 }, children: [jsxs(ModalH1, { children: [selectedDepositAddressOption?.id, " unavailable"] }), jsxs(ModalBody, { children: ["We're unable to process ", selectedDepositAddressOption?.id, " payments at this time. Please select another payment method."] }), jsx(Button, { onClick: () => setRoute(ROUTES.SELECT_METHOD), children: "Select Another Method" })] })) : (jsxs(ModalContent, { children: [jsx(CustomQRCode, { value: details?.uri, image: jsx("img", { src: selectedDepositAddressOption?.logoURI, width: "100%", height: "100%" }), tooltipMessage: jsxs(Fragment, { children: [jsx(ScanIconWithLogos, { logo: jsx("img", { src: selectedDepositAddressOption?.logoURI }) }), jsxs("span", { children: ["Use a ", selectedDepositAddressOption?.id, " wallet to scan"] })] }) }), details && (jsxs(Fragment, { children: [jsx(OrDivider, {}), jsxs(ModalBody, { children: ["Send exactly ", details.amount, " ", details.suffix, " to", " ", getAddressContraction(details.address), " and return to this page. Confirmation should appear in a few minutes."] }), jsx(CopyToClipboard, { variant: "button", string: details.address, children: "Copy Address" }), jsx(CopyToClipboard, { variant: "left", string: details.amount, children: "Copy Amount" })] }))] })) }));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { WaitingDepositAddress as default };
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { usePayContext, ROUTES } from '../../DaimoPay.js';
|
|
4
|
+
import { PageContent, ModalContent, ModalH1, ModalBody } from '../../Common/Modal/styles.js';
|
|
5
|
+
import { motion, AnimatePresence } from 'framer-motion';
|
|
6
|
+
import { css } from 'styled-components';
|
|
7
|
+
import { ExternalLinkIcon } from '../../../assets/icons.js';
|
|
8
|
+
import styled from '../../../styles/styled/index.js';
|
|
9
|
+
import Button from '../../Common/Button/index.js';
|
|
10
|
+
import CircleSpinner from '../../Spinners/CircleSpinner/index.js';
|
|
11
|
+
import SquircleSpinner from '../../Spinners/SquircleSpinner/index.js';
|
|
12
|
+
|
|
13
|
+
const WaitingOther = () => {
|
|
14
|
+
const context = usePayContext();
|
|
15
|
+
const { triggerResize, paymentState, setRoute } = context;
|
|
16
|
+
const trpc = context.trpc;
|
|
17
|
+
const { selectedExternalOption, payWithExternal, paymentWaitingMessage, daimoPayOrder, } = paymentState;
|
|
18
|
+
const [externalURL, setExternalURL] = useState(null);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const checkForSourcePayment = async () => {
|
|
21
|
+
if (!daimoPayOrder)
|
|
22
|
+
return;
|
|
23
|
+
const found = await trpc.findSourcePayment.query({
|
|
24
|
+
orderId: daimoPayOrder.id.toString(),
|
|
25
|
+
});
|
|
26
|
+
if (found) {
|
|
27
|
+
setRoute(ROUTES.CONFIRMATION);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const interval = setInterval(checkForSourcePayment, 1000);
|
|
31
|
+
return () => clearInterval(interval);
|
|
32
|
+
}, [daimoPayOrder?.id]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (!selectedExternalOption)
|
|
35
|
+
return;
|
|
36
|
+
payWithExternal(selectedExternalOption.id).then((url) => {
|
|
37
|
+
setExternalURL(url);
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
window.open(url, "_blank");
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}, [selectedExternalOption]);
|
|
43
|
+
const waitingMessageLength = paymentWaitingMessage?.length;
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
triggerResize();
|
|
46
|
+
}, [waitingMessageLength, externalURL]);
|
|
47
|
+
if (!selectedExternalOption) {
|
|
48
|
+
return jsx(PageContent, {});
|
|
49
|
+
}
|
|
50
|
+
const optionSpinner = (() => {
|
|
51
|
+
if (selectedExternalOption.logoShape === "circle") {
|
|
52
|
+
return (jsx(CircleSpinner, { logo: jsx("img", { src: selectedExternalOption.logoURI }), loading: true, unavailable: false }));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return (jsx(SquircleSpinner, { logo: jsx("img", { src: selectedExternalOption.logoURI }), loading: true }));
|
|
56
|
+
}
|
|
57
|
+
})();
|
|
58
|
+
return (jsxs(PageContent, { children: [jsx(LoadingContainer, { children: jsx(AnimationContainer, { "$circle": selectedExternalOption.logoShape === "circle", children: jsx(AnimatePresence, { children: optionSpinner }) }) }), jsxs(ModalContent, { style: { marginLeft: 24, marginRight: 24 }, children: [jsx(ModalH1, { children: "Waiting for Payment" }), paymentWaitingMessage && (jsx(ModalBody, { style: { marginTop: 12, marginBottom: 12 }, children: paymentWaitingMessage }))] }), jsx(Button, { icon: jsx(ExternalLinkIcon, {}), onClick: () => {
|
|
59
|
+
if (externalURL)
|
|
60
|
+
window.open(externalURL, "_blank");
|
|
61
|
+
}, children: "Open in New Tab" })] }));
|
|
62
|
+
};
|
|
63
|
+
const LoadingContainer = styled(motion.div) `
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
margin: 10px auto 16px;
|
|
68
|
+
height: 120px;
|
|
69
|
+
`;
|
|
70
|
+
const AnimationContainer = styled(motion.div) `
|
|
71
|
+
user-select: none;
|
|
72
|
+
position: relative;
|
|
73
|
+
--spinner-error-opacity: 0;
|
|
74
|
+
&:before {
|
|
75
|
+
content: "";
|
|
76
|
+
position: absolute;
|
|
77
|
+
inset: 1px;
|
|
78
|
+
opacity: 0;
|
|
79
|
+
background: var(--ck-body-color-danger);
|
|
80
|
+
${(props) => props.$circle &&
|
|
81
|
+
css `
|
|
82
|
+
inset: -5px;
|
|
83
|
+
border-radius: 50%;
|
|
84
|
+
background: none;
|
|
85
|
+
box-shadow: inset 0 0 0 3.5px var(--ck-body-color-danger);
|
|
86
|
+
`}
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
|
|
90
|
+
export { LoadingContainer, WaitingOther as default };
|
|
91
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { LogoContainer, Logo, SpinnerContainer, Spinner, ExpiringSpinner } from './styles.js';
|
|
3
|
+
import { AnimatePresence } from 'framer-motion';
|
|
4
|
+
|
|
5
|
+
const CircleSpinner = ({ logo, smallLogo, loading = true, unavailable = false, countdown = false, }) => {
|
|
6
|
+
return (jsxs(LogoContainer, { transition: { duration: 0.5, ease: [0.175, 0.885, 0.32, 0.98] }, children: [jsx(Logo, { "$small": !unavailable && smallLogo, style: unavailable ? { borderRadius: 0 } : undefined, children: logo }), jsx(SpinnerContainer, { children: jsxs(AnimatePresence, { children: [loading && (jsx(Spinner, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: {
|
|
7
|
+
opacity: 0,
|
|
8
|
+
transition: {
|
|
9
|
+
duration: countdown ? 1 : 0,
|
|
10
|
+
},
|
|
11
|
+
}, children: jsxs("svg", { "aria-hidden": "true", width: "102", height: "102", viewBox: "0 0 102 102", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M52 100C24.3858 100 2 77.6142 2 50", stroke: "url(#paint0_linear_1943_4139)", strokeWidth: "3.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("defs", { children: jsxs("linearGradient", { id: "paint0_linear_1943_4139", x1: "2", y1: "48.5", x2: "53", y2: "100", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { stopColor: "var(--ck-spinner-color)" }), jsx("stop", { offset: "1", stopColor: "var(--ck-spinner-color)", stopOpacity: "0" })] }) })] }) })), countdown && (jsxs(ExpiringSpinner, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.25 }, children: [jsx("div", {}), jsx("div", {})] }))] }) })] }));
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { CircleSpinner as default };
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { motion } from 'framer-motion';
|
|
2
|
+
import { css } from 'styled-components';
|
|
3
|
+
import styled from '../../../styles/styled/index.js';
|
|
4
|
+
|
|
5
|
+
const LogoContainer = styled(motion.div) `
|
|
6
|
+
z-index: 4;
|
|
7
|
+
position: relative;
|
|
8
|
+
width: 100px;
|
|
9
|
+
height: 100px;
|
|
10
|
+
svg {
|
|
11
|
+
z-index: 3;
|
|
12
|
+
position: relative;
|
|
13
|
+
display: block;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
const Logo = styled(motion.div) `
|
|
17
|
+
z-index: 2;
|
|
18
|
+
position: absolute;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
inset: 6px;
|
|
21
|
+
border-radius: 50px;
|
|
22
|
+
background: var(--ck-body-background);
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
svg,
|
|
27
|
+
img {
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
display: block;
|
|
30
|
+
margin: 0 auto;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
${(props) => props.$small &&
|
|
34
|
+
css `
|
|
35
|
+
width: 85%;
|
|
36
|
+
height: 85%;
|
|
37
|
+
`}
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
const SpinnerContainer = styled(motion.div) `
|
|
41
|
+
position: absolute;
|
|
42
|
+
inset: -2px;
|
|
43
|
+
`;
|
|
44
|
+
const ExpiringSpinner = styled(motion.div) `
|
|
45
|
+
pointer-events: none;
|
|
46
|
+
user-select: none;
|
|
47
|
+
z-index: 1;
|
|
48
|
+
position: absolute;
|
|
49
|
+
inset: -25%;
|
|
50
|
+
background: var(--ck-body-background);
|
|
51
|
+
div:first-child {
|
|
52
|
+
position: absolute;
|
|
53
|
+
left: 50%;
|
|
54
|
+
right: 0;
|
|
55
|
+
top: 0;
|
|
56
|
+
bottom: 0;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
&:before {
|
|
59
|
+
position: absolute;
|
|
60
|
+
content: "";
|
|
61
|
+
inset: 0;
|
|
62
|
+
background: var(--ck-spinner-color);
|
|
63
|
+
transform-origin: 0% 50%;
|
|
64
|
+
animation: rotateExpiringSpinner 5000ms ease-in both;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
div:last-child {
|
|
68
|
+
position: absolute;
|
|
69
|
+
left: 0;
|
|
70
|
+
right: 50%;
|
|
71
|
+
top: 0;
|
|
72
|
+
bottom: 0;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
&:before {
|
|
75
|
+
position: absolute;
|
|
76
|
+
content: "";
|
|
77
|
+
inset: 0;
|
|
78
|
+
background: var(--ck-spinner-color);
|
|
79
|
+
transform-origin: 100% 50%;
|
|
80
|
+
animation: rotateExpiringSpinner 5000ms ease-out 5000ms both;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
@keyframes rotateExpiringSpinner {
|
|
84
|
+
0% {
|
|
85
|
+
transform: rotate(-180deg);
|
|
86
|
+
}
|
|
87
|
+
100% {
|
|
88
|
+
transform: rotate(0deg);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
`;
|
|
92
|
+
const Spinner = styled(motion.div) `
|
|
93
|
+
pointer-events: none;
|
|
94
|
+
user-select: none;
|
|
95
|
+
z-index: 1;
|
|
96
|
+
position: absolute;
|
|
97
|
+
inset: 0;
|
|
98
|
+
svg {
|
|
99
|
+
display: block;
|
|
100
|
+
position: absolute;
|
|
101
|
+
left: 0;
|
|
102
|
+
top: 0;
|
|
103
|
+
width: 100%;
|
|
104
|
+
height: 100%;
|
|
105
|
+
animation: rotateSpinner 1200ms linear infinite;
|
|
106
|
+
}
|
|
107
|
+
@keyframes rotateSpinner {
|
|
108
|
+
0% {
|
|
109
|
+
transform: rotate(0deg);
|
|
110
|
+
}
|
|
111
|
+
100% {
|
|
112
|
+
transform: rotate(360deg);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
export { ExpiringSpinner, Logo, LogoContainer, Spinner, SpinnerContainer };
|
|
118
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { AnimatePresence } from 'framer-motion';
|
|
3
|
+
import { LogoContainer, Logo, SpinnerContainer, Spinner } from './styles.js';
|
|
4
|
+
|
|
5
|
+
const SquircleSpinner = ({ logo, loading = true, }) => {
|
|
6
|
+
return (jsxs(LogoContainer, { transition: { duration: 0.5, ease: [0.175, 0.885, 0.32, 0.98] }, children: [jsx(Logo, { children: logo }), jsx(SpinnerContainer, { children: jsx(AnimatePresence, { children: loading && (jsx(Spinner, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: {
|
|
7
|
+
opacity: 0,
|
|
8
|
+
transition: {
|
|
9
|
+
duration: 0,
|
|
10
|
+
},
|
|
11
|
+
} })) }) }), jsxs("svg", { "aria-hidden": "true", width: "102", height: "102", viewBox: "0 0 102 102", fill: "none", children: [jsx("rect", { x: "7.57895", y: "7.57895", width: "86.8421", height: "86.8421", rx: "19.2211", stroke: "black", strokeOpacity: "0.02", strokeWidth: "1.15789" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 0H102V102H0V0ZM7 38.284C7 27.5684 7 22.2106 9.01905 18.0892C10.9522 14.1431 14.1431 10.9522 18.0892 9.01905C22.2106 7 27.5684 7 38.284 7H63.716C74.4316 7 79.7894 7 83.9108 9.01905C87.8569 10.9522 91.0478 14.1431 92.9809 18.0892C95 22.2106 95 27.5684 95 38.284V63.716C95 74.4316 95 79.7894 92.9809 83.9108C91.0478 87.8569 87.8569 91.0478 83.9108 92.9809C79.7894 95 74.4316 95 63.716 95H38.284C27.5684 95 22.2106 95 18.0892 92.9809C14.1431 91.0478 10.9522 87.8569 9.01905 83.9108C7 79.7894 7 74.4316 7 63.716V38.284ZM41.5 0.5H41.4325C34.7246 0.499996 29.6023 0.499994 25.5104 0.823325C21.388 1.14906 18.1839 1.80986 15.3416 3.20227C10.0602 5.78959 5.78959 10.0602 3.20227 15.3416C1.80986 18.1839 1.14906 21.388 0.823325 25.5104C0.499994 29.6023 0.499996 34.7246 0.5 41.4325V41.5V55.5938C0.5 55.6808 0.507407 55.766 0.521624 55.849C0.507407 55.9319 0.5 56.0172 0.5 56.1042V60.5V60.5675C0.499996 67.2754 0.499994 72.3977 0.823325 76.4896C1.14906 80.612 1.80986 83.8161 3.20227 86.6584C5.78959 91.9398 10.0602 96.2104 15.3416 98.7977C18.1839 100.19 21.388 100.851 25.5104 101.177C29.6022 101.5 34.7244 101.5 41.432 101.5H41.4324H41.5H43.4227H60.5H60.5675H60.568C67.2756 101.5 72.3977 101.5 76.4896 101.177C80.612 100.851 83.8161 100.19 86.6584 98.7977C91.9398 96.2104 96.2104 91.9398 98.7977 86.6584C100.19 83.8161 100.851 80.612 101.177 76.4896C101.5 72.3978 101.5 67.2756 101.5 60.568V60.5676V60.5V41.5V41.4324V41.432C101.5 34.7244 101.5 29.6022 101.177 25.5104C100.851 21.388 100.19 18.1839 98.7977 15.3416C96.2104 10.0602 91.9398 5.78959 86.6584 3.20227C83.8161 1.80986 80.612 1.14906 76.4896 0.823325C72.3977 0.499994 67.2754 0.499996 60.5675 0.5H60.5H41.5ZM3.5 56.1042C3.5 56.0172 3.49259 55.9319 3.47838 55.849C3.49259 55.766 3.5 55.6808 3.5 55.5938V41.5C3.5 34.7112 3.50109 29.7068 3.814 25.7467C4.1256 21.8032 4.73946 19.0229 5.89635 16.6614C8.19077 11.9779 11.9779 8.19077 16.6614 5.89635C19.0229 4.73946 21.8032 4.1256 25.7467 3.814C29.7068 3.50109 34.7112 3.5 41.5 3.5H60.5C67.2888 3.5 72.2932 3.50109 76.2533 3.814C80.1968 4.1256 82.977 4.73946 85.3386 5.89635C90.022 8.19077 93.8092 11.9779 96.1036 16.6614C97.2605 19.0229 97.8744 21.8032 98.186 25.7467C98.4989 29.7068 98.5 34.7112 98.5 41.5V60.5C98.5 67.2888 98.4989 72.2932 98.186 76.2533C97.8744 80.1968 97.2605 82.9771 96.1036 85.3386C93.8092 90.022 90.022 93.8092 85.3386 96.1036C82.977 97.2605 80.1968 97.8744 76.2533 98.186C72.2932 98.4989 67.2888 98.5 60.5 98.5H43.4227H41.5C34.7112 98.5 29.7068 98.4989 25.7467 98.186C21.8032 97.8744 19.0229 97.2605 16.6614 96.1036C11.9779 93.8092 8.19077 90.022 5.89635 85.3386C4.73946 82.9771 4.1256 80.1968 3.814 76.2533C3.50109 72.2932 3.5 67.2888 3.5 60.5V56.1042Z", fill: "var(--ck-body-background)" })] })] }));
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { SquircleSpinner as default };
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { motion } from 'framer-motion';
|
|
2
|
+
import styled from '../../../styles/styled/index.js';
|
|
3
|
+
|
|
4
|
+
const LogoContainer = styled(motion.div) `
|
|
5
|
+
z-index: 4;
|
|
6
|
+
position: relative;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
svg {
|
|
9
|
+
z-index: 3;
|
|
10
|
+
position: relative;
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
const Logo = styled(motion.div) `
|
|
15
|
+
z-index: 2;
|
|
16
|
+
position: absolute;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
inset: 6px;
|
|
19
|
+
border-radius: 24px;
|
|
20
|
+
background: var(--ck-body-background);
|
|
21
|
+
svg,
|
|
22
|
+
img {
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
display: block;
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
const SpinnerContainer = styled(motion.div) `
|
|
30
|
+
position: absolute;
|
|
31
|
+
inset: 1px;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
`;
|
|
34
|
+
const Spinner = styled(motion.div) `
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
user-select: none;
|
|
37
|
+
z-index: 1;
|
|
38
|
+
position: absolute;
|
|
39
|
+
inset: -25%;
|
|
40
|
+
&:before {
|
|
41
|
+
content: "";
|
|
42
|
+
position: absolute;
|
|
43
|
+
inset: 0;
|
|
44
|
+
background: conic-gradient(
|
|
45
|
+
from -90deg,
|
|
46
|
+
transparent,
|
|
47
|
+
transparent,
|
|
48
|
+
transparent,
|
|
49
|
+
transparent,
|
|
50
|
+
transparent,
|
|
51
|
+
var(--ck-spinner-color)
|
|
52
|
+
);
|
|
53
|
+
animation: rotateSpinner 1200ms linear infinite;
|
|
54
|
+
}
|
|
55
|
+
@keyframes rotateSpinner {
|
|
56
|
+
0% {
|
|
57
|
+
transform: rotate(0deg);
|
|
58
|
+
}
|
|
59
|
+
100% {
|
|
60
|
+
transform: rotate(360deg);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
export { Logo, LogoContainer, Spinner, SpinnerContainer };
|
|
66
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_SOLANA_RPC_URL = "https://nameless-thrilling-spring.solana-mainnet.quiknode.pro/71d5c9acbf54c7cf00584cf6fab7fc37e844415f/";
|
|
5
|
+
const SolanaContextProvider = ({ children, solanaRpcUrl, }) => {
|
|
6
|
+
const endpoint = solanaRpcUrl ?? DEFAULT_SOLANA_RPC_URL;
|
|
7
|
+
return (jsx(ConnectionProvider, { endpoint: endpoint, children: jsx(WalletProvider, { wallets: [], autoConnect: true, children: children }) }));
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { SolanaContextProvider };
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useAccount } from 'wagmi';
|
|
4
|
+
import { useWalletConnectUri } from '../../../hooks/connectors/useWalletConnectUri.js';
|
|
5
|
+
import { useChainIsSupported } from '../../../hooks/useChainIsSupported.js';
|
|
6
|
+
import { useChains } from '../../../hooks/useChains.js';
|
|
7
|
+
|
|
8
|
+
const Web3Context = React.createContext({
|
|
9
|
+
connect: {
|
|
10
|
+
getUri: () => "",
|
|
11
|
+
},
|
|
12
|
+
dapp: {
|
|
13
|
+
chains: [],
|
|
14
|
+
},
|
|
15
|
+
account: undefined,
|
|
16
|
+
});
|
|
17
|
+
const Web3ContextProvider = ({ enabled, children, }) => {
|
|
18
|
+
const { uri: walletConnectUri } = useWalletConnectUri({
|
|
19
|
+
enabled,
|
|
20
|
+
});
|
|
21
|
+
const { address: currentAddress, chain } = useAccount();
|
|
22
|
+
const chainIsSupported = useChainIsSupported(chain?.id);
|
|
23
|
+
const chains = useChains();
|
|
24
|
+
const value = {
|
|
25
|
+
connect: {
|
|
26
|
+
getUri: (id) => {
|
|
27
|
+
return walletConnectUri;
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
dapp: {
|
|
31
|
+
chains,
|
|
32
|
+
},
|
|
33
|
+
account: currentAddress
|
|
34
|
+
? {
|
|
35
|
+
chain,
|
|
36
|
+
chainIsSupported,
|
|
37
|
+
address: currentAddress,
|
|
38
|
+
}
|
|
39
|
+
: undefined,
|
|
40
|
+
};
|
|
41
|
+
return jsx(Web3Context.Provider, { value: value, children: children });
|
|
42
|
+
};
|
|
43
|
+
const useWeb3 = () => React.useContext(Web3Context);
|
|
44
|
+
|
|
45
|
+
export { Web3ContextProvider, useWeb3 };
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|