@daimo/pay 0.3.21 → 1.0.0
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 +133 -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
package/build/index.d.ts
CHANGED
|
@@ -1,41 +1,22 @@
|
|
|
1
|
+
import React$1, { ReactNode } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
3
|
import { CreateConfigParameters } from '@wagmi/core';
|
|
2
4
|
import { CoinbaseWalletParameters } from 'wagmi/connectors';
|
|
3
|
-
import
|
|
5
|
+
import { PaymentStartedEvent, PaymentCompletedEvent, PaymentBouncedEvent } from '@daimo/common';
|
|
6
|
+
import { Address, Hex } from 'viem';
|
|
4
7
|
import { CreateConnectorFn } from 'wagmi';
|
|
5
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
-
import * as _daimo_common from '@daimo/common';
|
|
7
|
-
import { DepositAddressPaymentOptionMetadata, PlatformType, ExternalPaymentOptionMetadata, DaimoPayOrder, DaimoPayTokenAmount, ExternalPaymentOptions, DepositAddressPaymentOptions, DepositAddressPaymentOptionData, SolanaPublicKey } from '@daimo/common';
|
|
8
|
-
import { AppRouter } from '@daimo/pay-api';
|
|
9
|
-
import { CreateTRPCClient } from '@trpc/client';
|
|
10
|
-
import * as abitype from 'abitype';
|
|
11
|
-
import { WalletName } from '@solana/wallet-adapter-base';
|
|
12
|
-
import { Chain as Chain$1 } from 'viem';
|
|
13
8
|
|
|
14
|
-
type
|
|
15
|
-
appName: string;
|
|
16
|
-
appIcon?: string;
|
|
17
|
-
appDescription?: string;
|
|
18
|
-
appUrl?: string;
|
|
19
|
-
/**
|
|
20
|
-
* WC 2.0 Project ID (get one here: https://cloud.walletconnect.com/sign-in),
|
|
21
|
-
* it doesn't do much besides tracking. If not provided, use Daimo's
|
|
22
|
-
* WalletConnect project ID by default. */
|
|
23
|
-
walletConnectProjectId?: string;
|
|
24
|
-
coinbaseWalletPreference?: CoinbaseWalletParameters<"4">["preference"];
|
|
25
|
-
} & Partial<CreateConfigParameters>;
|
|
26
|
-
/** A utility for use with wagmi's createConfig(). */
|
|
27
|
-
declare const defaultConfig: ({ appName, appIcon, appDescription, appUrl, walletConnectProjectId, coinbaseWalletPreference, chains, client, ...props }: DefaultConfigProps) => CreateConfigParameters;
|
|
28
|
-
|
|
29
|
-
type Hash$1 = `0x${string}`;
|
|
9
|
+
type Hash = `0x${string}`;
|
|
30
10
|
type CustomAvatarProps = {
|
|
31
|
-
address?: Hash
|
|
11
|
+
address?: Hash | undefined;
|
|
32
12
|
ensName?: string | undefined;
|
|
33
13
|
ensImage?: string;
|
|
34
14
|
size: number;
|
|
35
15
|
radius: number;
|
|
36
16
|
};
|
|
17
|
+
/** Icon for an Ethereum address. Supports ENS names and avatars. */
|
|
37
18
|
declare const Avatar: React$1.FC<{
|
|
38
|
-
address?: Hash
|
|
19
|
+
address?: Hash | undefined;
|
|
39
20
|
name?: string | undefined;
|
|
40
21
|
size?: number;
|
|
41
22
|
radius?: number;
|
|
@@ -86,6 +67,8 @@ type DaimoPayModalOptions = {
|
|
|
86
67
|
};
|
|
87
68
|
/** Payment status. See webhooks and React useDaimoPayStatus() hook. */
|
|
88
69
|
type PaymentStatus = "payment_pending" | "payment_started" | "payment_completed" | "payment_bounced";
|
|
70
|
+
/** Additional payment options. Onchain payments are always enabled. */
|
|
71
|
+
type PaymentOption = "Daimo" | "Coinbase" | "Binance" | "RampNetwork";
|
|
89
72
|
|
|
90
73
|
type types_d_All = All;
|
|
91
74
|
type types_d_CustomAvatarProps = CustomAvatarProps;
|
|
@@ -94,16 +77,13 @@ type types_d_DaimoPayContextOptions = DaimoPayContextOptions;
|
|
|
94
77
|
type types_d_DaimoPayModalOptions = DaimoPayModalOptions;
|
|
95
78
|
type types_d_Languages = Languages;
|
|
96
79
|
type types_d_Mode = Mode;
|
|
80
|
+
type types_d_PaymentOption = PaymentOption;
|
|
97
81
|
type types_d_PaymentStatus = PaymentStatus;
|
|
98
82
|
type types_d_Theme = Theme;
|
|
99
83
|
declare namespace types_d {
|
|
100
|
-
export type { types_d_All as All, types_d_CustomAvatarProps as CustomAvatarProps, types_d_CustomTheme as CustomTheme, types_d_DaimoPayContextOptions as DaimoPayContextOptions, types_d_DaimoPayModalOptions as DaimoPayModalOptions, types_d_Languages as Languages, types_d_Mode as Mode, types_d_PaymentStatus as PaymentStatus, types_d_Theme as Theme };
|
|
84
|
+
export type { types_d_All as All, types_d_CustomAvatarProps as CustomAvatarProps, types_d_CustomTheme as CustomTheme, types_d_DaimoPayContextOptions as DaimoPayContextOptions, types_d_DaimoPayModalOptions as DaimoPayModalOptions, types_d_Languages as Languages, types_d_Mode as Mode, types_d_PaymentOption as PaymentOption, types_d_PaymentStatus as PaymentStatus, types_d_Theme as Theme };
|
|
101
85
|
}
|
|
102
86
|
|
|
103
|
-
declare const wallets: {
|
|
104
|
-
[key: string]: CreateConnectorFn;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
87
|
type useConnectCallbackProps = {
|
|
108
88
|
onConnect?: ({ address, connectorId, }: {
|
|
109
89
|
address?: string;
|
|
@@ -112,217 +92,6 @@ type useConnectCallbackProps = {
|
|
|
112
92
|
onDisconnect?: () => void;
|
|
113
93
|
};
|
|
114
94
|
|
|
115
|
-
type TrpcClient = CreateTRPCClient<AppRouter>;
|
|
116
|
-
|
|
117
|
-
declare function useDepositAddressOptions({ trpc, usdRequired, }: {
|
|
118
|
-
trpc: TrpcClient;
|
|
119
|
-
usdRequired: number;
|
|
120
|
-
}): {
|
|
121
|
-
options: DepositAddressPaymentOptionMetadata[];
|
|
122
|
-
loading: boolean;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
declare function useExternalPaymentOptions({ trpc, filterIds, usdRequired, platform, }: {
|
|
126
|
-
trpc: TrpcClient;
|
|
127
|
-
filterIds: string[] | undefined;
|
|
128
|
-
usdRequired: number | undefined;
|
|
129
|
-
platform: PlatformType | undefined;
|
|
130
|
-
}): {
|
|
131
|
-
options: ExternalPaymentOptionMetadata[];
|
|
132
|
-
loading: boolean;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
type SolanaPaymentOption = Awaited<ReturnType<TrpcClient["getSolanaPaymentOptions"]["query"]>>[0];
|
|
136
|
-
declare function useSolanaPaymentOptions({ trpc, address, usdRequired, }: {
|
|
137
|
-
trpc: TrpcClient;
|
|
138
|
-
address: string | undefined;
|
|
139
|
-
usdRequired: number | undefined;
|
|
140
|
-
}): {
|
|
141
|
-
options: {
|
|
142
|
-
required: {
|
|
143
|
-
amount: _daimo_common.BigIntStr;
|
|
144
|
-
token: {
|
|
145
|
-
symbol: string;
|
|
146
|
-
chainId: number;
|
|
147
|
-
token: abitype.Address | _daimo_common.SolanaPublicKey;
|
|
148
|
-
usd: number;
|
|
149
|
-
displayDecimals: number;
|
|
150
|
-
decimals: number;
|
|
151
|
-
name?: string;
|
|
152
|
-
fiatSymbol?: string;
|
|
153
|
-
logoURI?: string;
|
|
154
|
-
};
|
|
155
|
-
usd: number;
|
|
156
|
-
};
|
|
157
|
-
balance: {
|
|
158
|
-
amount: _daimo_common.BigIntStr;
|
|
159
|
-
token: {
|
|
160
|
-
symbol: string;
|
|
161
|
-
chainId: number;
|
|
162
|
-
token: abitype.Address | _daimo_common.SolanaPublicKey;
|
|
163
|
-
usd: number;
|
|
164
|
-
displayDecimals: number;
|
|
165
|
-
decimals: number;
|
|
166
|
-
name?: string;
|
|
167
|
-
fiatSymbol?: string;
|
|
168
|
-
logoURI?: string;
|
|
169
|
-
};
|
|
170
|
-
usd: number;
|
|
171
|
-
};
|
|
172
|
-
}[] | null;
|
|
173
|
-
isLoading: boolean;
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
/** Wallet payment options. User picks one. */
|
|
177
|
-
type WalletPaymentOption = Awaited<ReturnType<TrpcClient["getWalletPaymentOptions"]["query"]>>[0];
|
|
178
|
-
declare function useWalletPaymentOptions({ trpc, address, usdRequired, destChainId, }: {
|
|
179
|
-
trpc: TrpcClient;
|
|
180
|
-
address: string | undefined;
|
|
181
|
-
usdRequired: number | undefined;
|
|
182
|
-
destChainId: number | undefined;
|
|
183
|
-
}): {
|
|
184
|
-
options: {
|
|
185
|
-
fees: {
|
|
186
|
-
amount: _daimo_common.BigIntStr;
|
|
187
|
-
token: {
|
|
188
|
-
symbol: string;
|
|
189
|
-
chainId: number;
|
|
190
|
-
token: abitype.Address | _daimo_common.SolanaPublicKey;
|
|
191
|
-
usd: number;
|
|
192
|
-
displayDecimals: number;
|
|
193
|
-
decimals: number;
|
|
194
|
-
name?: string;
|
|
195
|
-
fiatSymbol?: string;
|
|
196
|
-
logoURI?: string;
|
|
197
|
-
};
|
|
198
|
-
usd: number;
|
|
199
|
-
};
|
|
200
|
-
required: {
|
|
201
|
-
amount: _daimo_common.BigIntStr;
|
|
202
|
-
token: {
|
|
203
|
-
symbol: string;
|
|
204
|
-
chainId: number;
|
|
205
|
-
token: abitype.Address | _daimo_common.SolanaPublicKey;
|
|
206
|
-
usd: number;
|
|
207
|
-
displayDecimals: number;
|
|
208
|
-
decimals: number;
|
|
209
|
-
name?: string;
|
|
210
|
-
fiatSymbol?: string;
|
|
211
|
-
logoURI?: string;
|
|
212
|
-
};
|
|
213
|
-
usd: number;
|
|
214
|
-
};
|
|
215
|
-
balance: {
|
|
216
|
-
amount: _daimo_common.BigIntStr;
|
|
217
|
-
token: {
|
|
218
|
-
symbol: string;
|
|
219
|
-
chainId: number;
|
|
220
|
-
token: abitype.Address | _daimo_common.SolanaPublicKey;
|
|
221
|
-
usd: number;
|
|
222
|
-
displayDecimals: number;
|
|
223
|
-
decimals: number;
|
|
224
|
-
name?: string;
|
|
225
|
-
fiatSymbol?: string;
|
|
226
|
-
logoURI?: string;
|
|
227
|
-
};
|
|
228
|
-
usd: number;
|
|
229
|
-
};
|
|
230
|
-
}[] | null;
|
|
231
|
-
isLoading: boolean;
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
/** Loads a DaimoPayOrder + manages the corresponding modal. */
|
|
235
|
-
interface PaymentInfo {
|
|
236
|
-
setPayId: (id: string | null) => Promise<void>;
|
|
237
|
-
daimoPayOrder: DaimoPayOrder | undefined;
|
|
238
|
-
modalOptions: DaimoPayModalOptions;
|
|
239
|
-
setModalOptions: (modalOptions: DaimoPayModalOptions) => void;
|
|
240
|
-
paymentWaitingMessage: string | undefined;
|
|
241
|
-
externalPaymentOptions: ReturnType<typeof useExternalPaymentOptions>;
|
|
242
|
-
walletPaymentOptions: ReturnType<typeof useWalletPaymentOptions>;
|
|
243
|
-
solanaPaymentOptions: ReturnType<typeof useSolanaPaymentOptions>;
|
|
244
|
-
depositAddressOptions: ReturnType<typeof useDepositAddressOptions>;
|
|
245
|
-
selectedExternalOption: ExternalPaymentOptionMetadata | undefined;
|
|
246
|
-
selectedTokenOption: WalletPaymentOption | undefined;
|
|
247
|
-
selectedSolanaTokenOption: SolanaPaymentOption | undefined;
|
|
248
|
-
selectedDepositAddressOption: DepositAddressPaymentOptionMetadata | undefined;
|
|
249
|
-
setSelectedDepositAddressOption: (option: DepositAddressPaymentOptionMetadata | undefined) => void;
|
|
250
|
-
setSelectedExternalOption: (option: ExternalPaymentOptionMetadata | undefined) => void;
|
|
251
|
-
setSelectedTokenOption: (option: WalletPaymentOption | undefined) => void;
|
|
252
|
-
setSelectedSolanaTokenOption: (option: SolanaPaymentOption | undefined) => void;
|
|
253
|
-
setChosenUsd: (amount: number) => void;
|
|
254
|
-
payWithToken: (tokenAmount: DaimoPayTokenAmount) => Promise<void>;
|
|
255
|
-
payWithExternal: (option: ExternalPaymentOptions) => Promise<string>;
|
|
256
|
-
payWithDepositAddress: (option: DepositAddressPaymentOptions) => Promise<DepositAddressPaymentOptionData | null>;
|
|
257
|
-
payWithSolanaToken: (inputToken: SolanaPublicKey) => Promise<string | undefined>;
|
|
258
|
-
refreshOrder: () => Promise<void>;
|
|
259
|
-
onSuccess: (args: {
|
|
260
|
-
txHash: string;
|
|
261
|
-
txURL?: string;
|
|
262
|
-
}) => void;
|
|
263
|
-
senderEnsName: string | undefined;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
type SolanaWalletName = WalletName<string>;
|
|
267
|
-
|
|
268
|
-
declare enum ROUTES {
|
|
269
|
-
SELECT_METHOD = "daimoPaySelectMethod",
|
|
270
|
-
SELECT_TOKEN = "daimoPaySelectToken",
|
|
271
|
-
WAITING_OTHER = "daimoPayWaitingOther",
|
|
272
|
-
SELECT_DEPOSIT_ADDRESS_CHAIN = "daimoPaySelectDepositAddressChain",
|
|
273
|
-
WAITING_DEPOSIT_ADDRESS = "daimoPayWaitingDepositAddress",
|
|
274
|
-
PAY_WITH_TOKEN = "daimoPayPayWithToken",
|
|
275
|
-
CONFIRMATION = "daimoPayConfirmation",
|
|
276
|
-
SOLANA_CONNECT = "daimoPaySolanaConnect",
|
|
277
|
-
SOLANA_CONNECTOR = "daimoPaySolanaConnector",
|
|
278
|
-
SOLANA_SELECT_TOKEN = "daimoPaySolanaSelectToken",
|
|
279
|
-
SOLANA_PAY_WITH_TOKEN = "daimoPaySolanaPayWithToken",
|
|
280
|
-
ONBOARDING = "onboarding",
|
|
281
|
-
ABOUT = "about",
|
|
282
|
-
CONNECTORS = "connectors",
|
|
283
|
-
MOBILECONNECTORS = "mobileConnectors",
|
|
284
|
-
CONNECT = "connect",
|
|
285
|
-
DOWNLOAD = "download",
|
|
286
|
-
SWITCHNETWORKS = "switchNetworks"
|
|
287
|
-
}
|
|
288
|
-
type Connector = {
|
|
289
|
-
id: string;
|
|
290
|
-
};
|
|
291
|
-
type Error = string | React$1.ReactNode | null;
|
|
292
|
-
type ContextValue = {
|
|
293
|
-
theme: Theme;
|
|
294
|
-
setTheme: React$1.Dispatch<React$1.SetStateAction<Theme>>;
|
|
295
|
-
mode: Mode;
|
|
296
|
-
setMode: React$1.Dispatch<React$1.SetStateAction<Mode>>;
|
|
297
|
-
customTheme: CustomTheme | undefined;
|
|
298
|
-
setCustomTheme: React$1.Dispatch<React$1.SetStateAction<CustomTheme | undefined>>;
|
|
299
|
-
lang: Languages;
|
|
300
|
-
setLang: React$1.Dispatch<React$1.SetStateAction<Languages>>;
|
|
301
|
-
open: boolean;
|
|
302
|
-
setOpen: React$1.Dispatch<React$1.SetStateAction<boolean>>;
|
|
303
|
-
route: string;
|
|
304
|
-
setRoute: React$1.Dispatch<React$1.SetStateAction<ROUTES>>;
|
|
305
|
-
connector: Connector;
|
|
306
|
-
setConnector: React$1.Dispatch<React$1.SetStateAction<Connector>>;
|
|
307
|
-
solanaConnector: SolanaWalletName | undefined;
|
|
308
|
-
setSolanaConnector: React$1.Dispatch<React$1.SetStateAction<SolanaWalletName | undefined>>;
|
|
309
|
-
errorMessage: Error;
|
|
310
|
-
debugMode?: boolean;
|
|
311
|
-
log: (...props: any) => void;
|
|
312
|
-
displayError: (message: string | React$1.ReactNode | null, code?: any) => void;
|
|
313
|
-
resize: number;
|
|
314
|
-
triggerResize: () => void;
|
|
315
|
-
/** Global options, across all pay buttons and payments. */
|
|
316
|
-
options?: DaimoPayContextOptions;
|
|
317
|
-
/** Loads a payment, then shows the modal to complete payment. */
|
|
318
|
-
loadAndShowPayment: (payId: string, modalOptions: DaimoPayModalOptions) => Promise<void>;
|
|
319
|
-
/** Payment status & callbacks. */
|
|
320
|
-
paymentInfo: PaymentInfo;
|
|
321
|
-
/** TRPC API client. Internal use only. */
|
|
322
|
-
trpc: any;
|
|
323
|
-
} & useConnectCallbackProps;
|
|
324
|
-
/** Meant for internal use. This will be non-exported in a future SDK version. */
|
|
325
|
-
declare const Context: React$1.Context<ContextValue | null>;
|
|
326
95
|
type DaimoPayProviderProps = {
|
|
327
96
|
children?: React$1.ReactNode;
|
|
328
97
|
theme?: Theme;
|
|
@@ -339,38 +108,88 @@ type DaimoPayProviderProps = {
|
|
|
339
108
|
/** Custom Pay API, useful for test and staging. */
|
|
340
109
|
payApiUrl?: string;
|
|
341
110
|
} & useConnectCallbackProps;
|
|
342
|
-
/**
|
|
343
|
-
*
|
|
111
|
+
/**
|
|
112
|
+
* Provides context for DaimoPayButton and hooks. Place in app root or layout.
|
|
344
113
|
*/
|
|
345
114
|
declare const DaimoPayProvider: (props: DaimoPayProviderProps) => react_jsx_runtime.JSX.Element;
|
|
346
|
-
/** Meant for internal use. This will be non-exported in a future SDK version. */
|
|
347
|
-
declare const usePayContext: () => ContextValue;
|
|
348
115
|
|
|
349
|
-
type
|
|
350
|
-
|
|
351
|
-
|
|
116
|
+
type DefaultConfigProps = {
|
|
117
|
+
appName: string;
|
|
118
|
+
appIcon?: string;
|
|
119
|
+
appDescription?: string;
|
|
120
|
+
appUrl?: string;
|
|
121
|
+
/**
|
|
122
|
+
* WC 2.0 Project ID (get one here: https://cloud.walletconnect.com/sign-in),
|
|
123
|
+
* it doesn't do much besides tracking. If not provided, use Daimo's
|
|
124
|
+
* WalletConnect project ID by default. */
|
|
125
|
+
walletConnectProjectId?: string;
|
|
126
|
+
coinbaseWalletPreference?: CoinbaseWalletParameters<"4">["preference"];
|
|
127
|
+
} & Partial<CreateConfigParameters>;
|
|
128
|
+
/** Daimo Pay recommended config, for use with wagmi's createConfig(). */
|
|
129
|
+
declare const defaultConfig: ({ appName, appIcon, appDescription, appUrl, walletConnectProjectId, coinbaseWalletPreference, chains, client, ...props }: DefaultConfigProps) => CreateConfigParameters;
|
|
130
|
+
|
|
131
|
+
type PayButtonPaymentProps = {
|
|
132
|
+
/**
|
|
133
|
+
* Your public app ID. Specify either (payId) or (appId + parameters).
|
|
134
|
+
*/
|
|
135
|
+
appId: string;
|
|
136
|
+
/**
|
|
137
|
+
* Destination chain ID.
|
|
138
|
+
*/
|
|
139
|
+
toChain: number;
|
|
140
|
+
/**
|
|
141
|
+
* The destination token to send, completing payment. Must be an ERC-20
|
|
142
|
+
* token or the zero address, indicating the native token / ETH.
|
|
143
|
+
*/
|
|
144
|
+
toToken: Address;
|
|
145
|
+
/**
|
|
146
|
+
* The amount of destination token to send (transfer or approve).
|
|
147
|
+
*/
|
|
148
|
+
toUnits: string;
|
|
149
|
+
/**
|
|
150
|
+
* Let the user edit the amount to send.
|
|
151
|
+
*/
|
|
152
|
+
amountEditable?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* The destination address to transfer to, or contract to call.
|
|
155
|
+
*/
|
|
156
|
+
toAddress: Address;
|
|
157
|
+
/**
|
|
158
|
+
* Optional calldata to call an arbitrary function on `toAddress`.
|
|
159
|
+
*/
|
|
160
|
+
toCallData?: Hex;
|
|
161
|
+
/**
|
|
162
|
+
* The intent verb, such as "Pay", "Deposit", or "Purchase".
|
|
163
|
+
*/
|
|
164
|
+
intent?: string;
|
|
165
|
+
/**
|
|
166
|
+
* Payment options. By default, all are enabled.
|
|
167
|
+
*/
|
|
168
|
+
paymentOptions?: PaymentOption[];
|
|
169
|
+
/**
|
|
170
|
+
* Preferred chain IDs. Assets on these chains will appear first.
|
|
171
|
+
*/
|
|
172
|
+
preferredChains?: number[];
|
|
173
|
+
/**
|
|
174
|
+
* Preferred tokens. These appear first in the token list.
|
|
175
|
+
*/
|
|
176
|
+
preferredTokens?: {
|
|
177
|
+
chain: number;
|
|
178
|
+
address: Address;
|
|
179
|
+
}[];
|
|
180
|
+
} | {
|
|
181
|
+
/** The payment ID, generated via the Daimo Pay API. Replaces params above. */
|
|
352
182
|
payId: string;
|
|
353
|
-
/** Automatically close the modal after a successful payment. */
|
|
354
|
-
closeOnSuccess?: boolean;
|
|
355
|
-
/** Custom renderer */
|
|
356
|
-
children?: (renderProps: {
|
|
357
|
-
show?: () => void;
|
|
358
|
-
hide?: () => void;
|
|
359
|
-
chain?: Chain$1 & {
|
|
360
|
-
unsupported?: boolean;
|
|
361
|
-
};
|
|
362
|
-
unsupported: boolean;
|
|
363
|
-
isConnected: boolean;
|
|
364
|
-
isConnecting: boolean;
|
|
365
|
-
address?: Hash;
|
|
366
|
-
truncatedAddress?: string;
|
|
367
|
-
ensName?: string;
|
|
368
|
-
payId?: string;
|
|
369
|
-
}) => React$1.ReactNode;
|
|
370
183
|
};
|
|
371
|
-
type
|
|
372
|
-
/**
|
|
373
|
-
|
|
184
|
+
type PayButtonCommonProps = PayButtonPaymentProps & {
|
|
185
|
+
/** Called when user sends payment and transaction is seen on chain */
|
|
186
|
+
onPaymentStarted?: (event: PaymentStartedEvent) => void;
|
|
187
|
+
/** Called when destination transfer or call completes successfully */
|
|
188
|
+
onPaymentCompleted?: (event: PaymentCompletedEvent) => void;
|
|
189
|
+
/** Called when destination call reverts and funds are refunded */
|
|
190
|
+
onPaymentBounced?: (event: PaymentBouncedEvent) => void;
|
|
191
|
+
};
|
|
192
|
+
type DaimoPayButtonProps = PayButtonCommonProps & {
|
|
374
193
|
/** Light mode, dark mode, or auto. */
|
|
375
194
|
mode?: Mode;
|
|
376
195
|
/** Named theme. See docs for options. */
|
|
@@ -379,38 +198,31 @@ type DaimoPayButtonProps = {
|
|
|
379
198
|
customTheme?: CustomTheme;
|
|
380
199
|
/** Automatically close the modal after a successful payment. */
|
|
381
200
|
closeOnSuccess?: boolean;
|
|
382
|
-
/**
|
|
383
|
-
|
|
201
|
+
/** Disable interaction. */
|
|
202
|
+
disabled?: boolean;
|
|
384
203
|
};
|
|
385
|
-
|
|
204
|
+
type DaimoPayButtonCustomProps = PayButtonCommonProps & {
|
|
205
|
+
/** Automatically close the modal after a successful payment. */
|
|
206
|
+
closeOnSuccess?: boolean;
|
|
207
|
+
/** Custom renderer */
|
|
208
|
+
children: (renderProps: {
|
|
209
|
+
show: () => void;
|
|
210
|
+
hide: () => void;
|
|
211
|
+
}) => React$1.ReactNode;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* A button that shows the Daimo Pay checkout. Replaces the traditional
|
|
386
215
|
* Connect Wallet » approve » execute sequence with a single action.
|
|
387
216
|
*/
|
|
388
|
-
declare function DaimoPayButton(
|
|
217
|
+
declare function DaimoPayButton(props: DaimoPayButtonProps): react_jsx_runtime.JSX.Element;
|
|
389
218
|
declare namespace DaimoPayButton {
|
|
390
|
-
var Custom:
|
|
219
|
+
var Custom: typeof DaimoPayButtonCustom;
|
|
220
|
+
}
|
|
221
|
+
/** Like DaimoPayButton, but with custom styling. */
|
|
222
|
+
declare function DaimoPayButtonCustom(props: DaimoPayButtonCustomProps): react_jsx_runtime.JSX.Element | null;
|
|
223
|
+
declare namespace DaimoPayButtonCustom {
|
|
224
|
+
var displayName: string;
|
|
391
225
|
}
|
|
392
|
-
|
|
393
|
-
type UseModalProps = {} & useConnectCallbackProps;
|
|
394
|
-
declare const useModal: ({ onConnect, onDisconnect }?: UseModalProps) => {
|
|
395
|
-
open: boolean;
|
|
396
|
-
setOpen: (show: boolean) => void;
|
|
397
|
-
openAbout: () => void;
|
|
398
|
-
openOnboarding: () => void;
|
|
399
|
-
openSwitchNetworks: () => void;
|
|
400
|
-
};
|
|
401
|
-
|
|
402
|
-
declare const Chain: React$1.FC<{
|
|
403
|
-
id?: number;
|
|
404
|
-
unsupported?: boolean;
|
|
405
|
-
radius?: number | string;
|
|
406
|
-
size?: number | string;
|
|
407
|
-
}>;
|
|
408
|
-
|
|
409
|
-
/** Determines whether the current wagmi configuration supports a given chain. */
|
|
410
|
-
declare function useChainIsSupported(chainId?: number): boolean | null;
|
|
411
|
-
|
|
412
|
-
/** Returns currently configured wagmi chains. */
|
|
413
|
-
declare function useChains(): Chain$1[];
|
|
414
226
|
|
|
415
227
|
/** Returns the current payment, or undefined if there is none.
|
|
416
228
|
*
|
|
@@ -427,8 +239,27 @@ declare function useDaimoPayStatus(): {
|
|
|
427
239
|
status: PaymentStatus;
|
|
428
240
|
} | undefined;
|
|
429
241
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
declare
|
|
242
|
+
type UseModalProps = {} & useConnectCallbackProps;
|
|
243
|
+
/** Opens and closes the payment modal. */
|
|
244
|
+
declare const useModal: ({ onConnect, onDisconnect }?: UseModalProps) => {
|
|
245
|
+
open: boolean;
|
|
246
|
+
setOpen: (show: boolean) => void;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
/** Icon for an EVM chain, given chain ID. No ID shows a loading spinner. */
|
|
250
|
+
declare const Chain: React$1.FC<{
|
|
251
|
+
id?: number;
|
|
252
|
+
unsupported?: boolean;
|
|
253
|
+
radius?: number | string;
|
|
254
|
+
size?: number | string;
|
|
255
|
+
}>;
|
|
256
|
+
|
|
257
|
+
/** Ethereum wallets, by name. */
|
|
258
|
+
declare const wallets: {
|
|
259
|
+
[key: string]: CreateConnectorFn;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/** Generates a globally-unique payId. */
|
|
263
|
+
declare function generatePayId(): string;
|
|
433
264
|
|
|
434
|
-
export { Avatar, Chain as ChainIcon,
|
|
265
|
+
export { Avatar, Chain as ChainIcon, DaimoPayButton, DaimoPayProvider, types_d as Types, generatePayId, defaultConfig as getDefaultConfig, useModal as useDaimoPayModal, useDaimoPayStatus, wallets };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
var name = "@daimo/pay";
|
|
2
|
+
var version = "1.0.0";
|
|
3
|
+
var author = "Daimo";
|
|
4
|
+
var homepage = "https://pay.daimo.com";
|
|
5
|
+
var license = "BSD-2-Clause license";
|
|
6
|
+
var description = "Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.";
|
|
7
|
+
var main = "./src/index.ts";
|
|
8
|
+
var type = "module";
|
|
9
|
+
var exports = {
|
|
10
|
+
"import": "./build/src/index.js",
|
|
11
|
+
types: "./build/index.d.ts"
|
|
12
|
+
};
|
|
13
|
+
var types = "./build/index.d.ts";
|
|
14
|
+
var engines = {
|
|
15
|
+
node: ">=12.4"
|
|
16
|
+
};
|
|
17
|
+
var files = [
|
|
18
|
+
"build",
|
|
19
|
+
"README.md"
|
|
20
|
+
];
|
|
21
|
+
var scripts = {
|
|
22
|
+
start: "rollup --config rollup.config.js -w",
|
|
23
|
+
dev: "rollup --config rollup.config.js -w",
|
|
24
|
+
build: "rollup --config rollup.config.js && rm -rf build/packages",
|
|
25
|
+
lint: "eslint --max-warnings=0"
|
|
26
|
+
};
|
|
27
|
+
var keywords = [
|
|
28
|
+
"ens",
|
|
29
|
+
"react-hook",
|
|
30
|
+
"blockchain",
|
|
31
|
+
"hooks",
|
|
32
|
+
"family",
|
|
33
|
+
"ethereum",
|
|
34
|
+
"react",
|
|
35
|
+
"daimo",
|
|
36
|
+
"pay",
|
|
37
|
+
"payment",
|
|
38
|
+
"crypto"
|
|
39
|
+
];
|
|
40
|
+
var dependencies = {
|
|
41
|
+
"@daimo/common": "0.3.15",
|
|
42
|
+
"@daimo/contract": "0.3.15",
|
|
43
|
+
"@solana/wallet-adapter-base": "^0.9.23",
|
|
44
|
+
"@solana/wallet-adapter-react": "^0.15.35",
|
|
45
|
+
"@solana/web3.js": "^1.95.4",
|
|
46
|
+
"@trpc/client": "^11.0.0-next-beta.318",
|
|
47
|
+
"@trpc/server": "^11.0.0-next-beta.318",
|
|
48
|
+
buffer: "^6.0.3",
|
|
49
|
+
"detect-browser": "^5.3.0",
|
|
50
|
+
encoding: "^0.1.13",
|
|
51
|
+
"framer-motion": "^11.11.4",
|
|
52
|
+
"pino-pretty": "^13.0.0",
|
|
53
|
+
qrcode: "^1.5.0",
|
|
54
|
+
"react-transition-state": "^1.1.4",
|
|
55
|
+
"react-use-measure": "^2.1.1",
|
|
56
|
+
"resize-observer-polyfill": "^1.5.1",
|
|
57
|
+
"styled-components": "^5.3.5"
|
|
58
|
+
};
|
|
59
|
+
var peerDependencies = {
|
|
60
|
+
"@tanstack/react-query": ">=5.0.0",
|
|
61
|
+
react: "17.x || 18.x",
|
|
62
|
+
"react-dom": "17.x || 18.x",
|
|
63
|
+
viem: "2.x",
|
|
64
|
+
wagmi: "2.x"
|
|
65
|
+
};
|
|
66
|
+
var devDependencies = {
|
|
67
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
68
|
+
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
69
|
+
"@types/node": "^20.14.12",
|
|
70
|
+
"@types/qrcode": "^1.4.2",
|
|
71
|
+
"@types/react": "^18.2.47",
|
|
72
|
+
"@types/react-dom": "^18.2.18",
|
|
73
|
+
"@types/styled-components": "^5.1.25",
|
|
74
|
+
rollup: "^3.29.5",
|
|
75
|
+
"rollup-plugin-dts": "^6.1.1",
|
|
76
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
77
|
+
"rollup-plugin-typescript2": "^0.34.0",
|
|
78
|
+
"rollup-plugin-visualizer": "^5.5.4",
|
|
79
|
+
"typescript-plugin-styled-components": "^3.0.0"
|
|
80
|
+
};
|
|
81
|
+
var packageJson = {
|
|
82
|
+
name: name,
|
|
83
|
+
"private": false,
|
|
84
|
+
version: version,
|
|
85
|
+
author: author,
|
|
86
|
+
homepage: homepage,
|
|
87
|
+
license: license,
|
|
88
|
+
description: description,
|
|
89
|
+
main: main,
|
|
90
|
+
type: type,
|
|
91
|
+
exports: exports,
|
|
92
|
+
types: types,
|
|
93
|
+
engines: engines,
|
|
94
|
+
files: files,
|
|
95
|
+
scripts: scripts,
|
|
96
|
+
keywords: keywords,
|
|
97
|
+
dependencies: dependencies,
|
|
98
|
+
peerDependencies: peerDependencies,
|
|
99
|
+
devDependencies: devDependencies
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export { author, packageJson as default, dependencies, description, devDependencies, engines, exports, files, homepage, keywords, license, main, name, peerDependencies, scripts, type, types, version };
|
|
103
|
+
//# sourceMappingURL=package.json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { motion } from 'framer-motion';
|
|
3
|
+
import styled from '../styles/styled/index.js';
|
|
4
|
+
import Logos from './logos.js';
|
|
5
|
+
|
|
6
|
+
const IconContainer = styled(motion.div) `
|
|
7
|
+
position: relative;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
width: 47px;
|
|
12
|
+
height: 52px;
|
|
13
|
+
min-width: 47px;
|
|
14
|
+
min-height: 52px;
|
|
15
|
+
svg {
|
|
16
|
+
display: block;
|
|
17
|
+
max-width: 100%;
|
|
18
|
+
height: auto;
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
21
|
+
const ScanIconWithLogos = ({ logo }) => {
|
|
22
|
+
const logoList = [
|
|
23
|
+
jsx(Logos.MetaMask, { background: true }),
|
|
24
|
+
jsx(Logos.Coinbase, { background: true }),
|
|
25
|
+
jsx(Logos.Crypto, {}),
|
|
26
|
+
jsx(Logos.ImToken, {}),
|
|
27
|
+
jsx(Logos.Argent, {}),
|
|
28
|
+
jsx(Logos.Trust, {}),
|
|
29
|
+
];
|
|
30
|
+
return (jsx(IconContainer, { children: jsxs("svg", { "aria-hidden": "true", width: "47", height: "52", viewBox: "0 0 47 52", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxs("g", { mask: "url(#gradient-mask)", children: [jsx("path", { d: "M7 14.5C7 11.4624 9.46243 9 12.5 9H31.5C34.5376 9 37 11.4624 37 14.5V47H7V14.5Z", fill: "var(--ck-graphic-scaniconwithlogos-04)" }), logo ? (jsx("foreignObject", { x: "13", y: "21", width: "18", height: "18", rx: "5", children: jsx("div", { style: { overflow: 'hidden', borderRadius: 5 }, children: logo }) })) : (jsxs(Fragment, { children: [jsx("foreignObject", { x: "12", y: "15", width: "9", height: "9", rx: "2.5", children: jsx("div", { style: { overflow: 'hidden', borderRadius: 2.5 }, children: logoList[0] }) }), jsx("foreignObject", { x: "23", y: "15", width: "9", height: "9", rx: "2.5", children: jsx("div", { style: { overflow: 'hidden', borderRadius: 2.5 }, children: logoList[1] }) }), jsx("foreignObject", { x: "12", y: "26", width: "9", height: "9", rx: "2.5", children: jsx("div", { style: { overflow: 'hidden', borderRadius: 2.5 }, children: jsx("div", { style: { overflow: 'hidden', borderRadius: 2.5 }, children: logoList[2] }) }) }), jsx("foreignObject", { x: "23", y: "26", width: "9", height: "9", rx: "2.5", children: jsx("div", { style: { overflow: 'hidden', borderRadius: 2.5 }, children: logoList[3] }) }), jsx("foreignObject", { x: "12", y: "37", width: "9", height: "9", rx: "2.5", children: jsx("div", { style: { overflow: 'hidden', borderRadius: 2.5 }, children: logoList[4] }) }), jsx("foreignObject", { x: "23", y: "37", width: "9", height: "9", rx: "2.5", children: jsx("div", { style: { overflow: 'hidden', borderRadius: 2.5 }, children: logoList[5] }) })] })), jsx("path", { d: "M36 47V13.7143C36 11.1107 33.8893 9 31.2857 9H12.7143C10.1107 9 8 11.1107 8 13.7143V47", stroke: "url(#paint0_linear_924_12568)", strokeWidth: "2" }), jsx("path", { d: "M15 10H29C29 11.1046 28.1046 12 27 12H17C15.8954 12 15 11.1046 15 10Z", fill: "var(--ck-graphic-scaniconwithlogos-01)" }), jsx("rect", { x: "1", y: "47", width: "43", height: "5", fill: "var(--ck-tooltip-background)" }), jsx("rect", { x: "22", y: "1", width: "24", height: "24", rx: "12", fill: "var(--ck-graphic-scaniconwithlogos-03)", stroke: "var(--ck-tooltip-background)", strokeWidth: "2" }), jsx("rect", { x: "34.5", y: "10", width: "2.5", height: "2.5", rx: "0.75", fill: "#373737" }), jsx("rect", { x: "31", y: "10", width: "2.5", height: "2.5", rx: "0.75", fill: "#373737" }), jsx("rect", { x: "31", y: "13.5", width: "2.5", height: "2.5", rx: "0.75", fill: "#373737" }), jsx("rect", { x: "34.5", y: "13.5", width: "2.5", height: "2.5", rx: "0.75", fill: "#373737" }), jsx("path", { d: "M28.5 10.5V9C28.5 8.17157 29.1716 7.5 30 7.5H31.5", stroke: "#373737", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M36.5 7.5L38 7.5C38.8284 7.5 39.5 8.17157 39.5 9L39.5 10.5", stroke: "#373737", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M39.5 15.5L39.5 17C39.5 17.8284 38.8284 18.5 38 18.5L36.5 18.5", stroke: "#373737", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M31.5 18.5L30 18.5C29.1716 18.5 28.5 17.8284 28.5 17L28.5 15.5", stroke: "#373737", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }), jsxs("defs", { children: [jsxs("linearGradient", { id: "paint0_linear_924_12568", x1: "22", y1: "8.2549", x2: "22", y2: "47", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { stopColor: "var(--ck-graphic-scaniconwithlogos-01)" }), jsx("stop", { offset: "1", stopColor: "var(--ck-graphic-scaniconwithlogos-02)" })] }), jsxs("linearGradient", { id: "linear-gradient-mask", x1: "47", y1: "42", x2: "47", y2: "47", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { stopColor: "white" }), jsx("stop", { offset: "1", stopColor: "black", stopOpacity: "0" })] }), jsx("mask", { id: "gradient-mask", children: jsx("rect", { x: "0", y: "0", width: "47", height: "52", fill: "url(#linear-gradient-mask)" }) })] })] }) }));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { ScanIconWithLogos as default };
|
|
34
|
+
//# sourceMappingURL=ScanIconWithLogos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScanIconWithLogos.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|