@daimo/pay 1.16.1 → 1.16.3
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 +7 -5
- package/build/package.json.js +2 -2
- package/build/src/components/Common/OrderHeader/index.js +8 -9
- package/build/src/components/Common/OrderHeader/index.js.map +1 -1
- package/build/src/components/Common/SelectAnotherMethodButton/index.js +15 -3
- package/build/src/components/Common/SelectAnotherMethodButton/index.js.map +1 -1
- package/build/src/components/DaimoPayButton/index.js +2 -1
- package/build/src/components/DaimoPayButton/index.js.map +1 -1
- package/build/src/components/DaimoPayModal/index.js +13 -3
- package/build/src/components/DaimoPayModal/index.js.map +1 -1
- package/build/src/components/Pages/SelectDepositAddressChain/index.js +1 -1
- package/build/src/components/Pages/SelectDepositAddressChain/index.js.map +1 -1
- package/build/src/components/Pages/SelectExchange/index.js +2 -2
- package/build/src/components/Pages/SelectExchange/index.js.map +1 -1
- package/build/src/components/Pages/SelectMethod/index.js +0 -1
- package/build/src/components/Pages/SelectMethod/index.js.map +1 -1
- package/build/src/components/Pages/SelectToken/index.js +2 -2
- package/build/src/components/Pages/SelectToken/index.js.map +1 -1
- package/build/src/components/Pages/SelectZKP/index.js +2 -2
- package/build/src/components/Pages/SelectZKP/index.js.map +1 -1
- package/build/src/hooks/usePaymentState.js.map +1 -1
- package/build/src/hooks/useTokenOptions.js +2 -2
- package/build/src/hooks/useTokenOptions.js.map +1 -1
- package/build/src/payment/paymentFsm.js.map +1 -1
- package/build/src/world-mini-app/WorldPayButton.js +7 -2
- package/build/src/world-mini-app/WorldPayButton.js.map +1 -1
- package/build/world.d.ts +3 -0
- package/package.json +3 -3
- package/build/assets/MobileWithLogos.d.ts +0 -2
- package/build/assets/ScanIconWithLogos.d.ts +0 -6
- package/build/assets/browsers.d.ts +0 -10
- package/build/assets/chains.d.ts +0 -28
- package/build/assets/coins.d.ts +0 -2
- package/build/assets/crepe.d.ts +0 -3
- package/build/assets/icons.d.ts +0 -35
- package/build/assets/logos.d.ts +0 -207
- package/build/assets/wallet.d.ts +0 -3
- package/build/assets/wave.d.ts +0 -2
- package/build/components/Common/Alert/index.d.ts +0 -6
- package/build/components/Common/Alert/styles.d.ts +0 -2
- package/build/components/Common/Alert/types.d.ts +0 -5
- package/build/components/Common/AmountInput/AmountInputField.d.ts +0 -8
- package/build/components/Common/AmountInput/index.d.ts +0 -9
- package/build/components/Common/Avatar/index.d.ts +0 -17
- package/build/components/Common/Avatar/styles.d.ts +0 -2
- package/build/components/Common/BrowserIcon/index.d.ts +0 -4
- package/build/components/Common/BrowserIcon/styles.d.ts +0 -1
- package/build/components/Common/BrowserIcon/types.d.ts +0 -3
- package/build/components/Common/Button/index.d.ts +0 -4
- package/build/components/Common/Button/styles.d.ts +0 -10
- package/build/components/Common/Button/types.d.ts +0 -15
- package/build/components/Common/Chain/index.d.ts +0 -9
- package/build/components/Common/Chain/styles.d.ts +0 -4
- package/build/components/Common/ChainSelectList/index.d.ts +0 -4
- package/build/components/Common/ChainSelectList/styles.d.ts +0 -9
- package/build/components/Common/CircleTimer.d.ts +0 -17
- package/build/components/Common/ConnectorList/index.d.ts +0 -2
- package/build/components/Common/ConnectorList/styles.d.ts +0 -8
- package/build/components/Common/CopyToClipboard/CopyToClipboardIcon.d.ts +0 -6
- package/build/components/Common/CopyToClipboard/index.d.ts +0 -7
- package/build/components/Common/CustomQRCode/QRCode.d.ts +0 -12
- package/build/components/Common/CustomQRCode/index.d.ts +0 -6
- package/build/components/Common/CustomQRCode/styles.d.ts +0 -6
- package/build/components/Common/CustomQRCode/types.d.ts +0 -11
- package/build/components/Common/DynamicContainer/index.d.ts +0 -7
- package/build/components/Common/FitText/index.d.ts +0 -8
- package/build/components/Common/LazyImage/index.d.ts +0 -8
- package/build/components/Common/Logo/index.d.ts +0 -8
- package/build/components/Common/Logo/styles.d.ts +0 -3
- package/build/components/Common/Modal/index.d.ts +0 -25
- package/build/components/Common/Modal/styles.d.ts +0 -25
- package/build/components/Common/OptionsList/index.d.ts +0 -17
- package/build/components/Common/OptionsList/styles.d.ts +0 -5
- package/build/components/Common/OrderHeader/index.d.ts +0 -5
- package/build/components/Common/PaymentBreakdown/index.d.ts +0 -6
- package/build/components/Common/Portal/index.d.ts +0 -2
- package/build/components/Common/PoweredByFooter/index.d.ts +0 -5
- package/build/components/Common/ScrollArea/index.d.ts +0 -9
- package/build/components/Common/ScrollArea/styles.d.ts +0 -3
- package/build/components/Common/SelectAnotherMethodButton/index.d.ts +0 -1
- package/build/components/Common/Spinner/index.d.ts +0 -1
- package/build/components/Common/Spinner/styles.d.ts +0 -1
- package/build/components/Common/SquareTimer.d.ts +0 -19
- package/build/components/Common/SwitchButton/index.d.ts +0 -6
- package/build/components/Common/ThemedButton/index.d.ts +0 -15
- package/build/components/Common/ThemedButton/styles.d.ts +0 -2
- package/build/components/Common/TokenChainLogo/index.d.ts +0 -7
- package/build/components/Common/Tooltip/index.d.ts +0 -4
- package/build/components/Common/Tooltip/styles.d.ts +0 -3
- package/build/components/Common/Tooltip/types.d.ts +0 -9
- package/build/components/Common/WalletChainLogo/index.d.ts +0 -6
- package/build/components/DaimoPayButton/index.d.ts +0 -149
- package/build/components/DaimoPayButton/styles.d.ts +0 -4
- package/build/components/DaimoPayModal/ConnectUsing.d.ts +0 -2
- package/build/components/DaimoPayModal/ConnectWithInjector/index.d.ts +0 -15
- package/build/components/DaimoPayModal/ConnectWithInjector/styles.d.ts +0 -6
- package/build/components/DaimoPayModal/ConnectWithQRCode.d.ts +0 -12
- package/build/components/DaimoPayModal/index.d.ts +0 -8
- package/build/components/DaimoPayThemeProvider/DaimoPayThemeProvider.d.ts +0 -16
- package/build/components/Pages/About/graphics.d.ts +0 -11
- package/build/components/Pages/About/index.d.ts +0 -3
- package/build/components/Pages/About/styles.d.ts +0 -8
- package/build/components/Pages/Confirmation/index.d.ts +0 -3
- package/build/components/Pages/Connectors/index.d.ts +0 -3
- package/build/components/Pages/Connectors/styles.d.ts +0 -9
- package/build/components/Pages/DownloadApp/index.d.ts +0 -2
- package/build/components/Pages/Error/index.d.ts +0 -1
- package/build/components/Pages/MobileConnectors/index.d.ts +0 -3
- package/build/components/Pages/MobileConnectors/styles.d.ts +0 -5
- package/build/components/Pages/Onboarding/index.d.ts +0 -3
- package/build/components/Pages/Onboarding/styles.d.ts +0 -9
- package/build/components/Pages/PayWithToken/index.d.ts +0 -3
- package/build/components/Pages/SelectAmount/index.d.ts +0 -3
- package/build/components/Pages/SelectDepositAddressAmount/index.d.ts +0 -3
- package/build/components/Pages/SelectDepositAddressChain/index.d.ts +0 -3
- package/build/components/Pages/SelectExchange/index.d.ts +0 -3
- package/build/components/Pages/SelectExternalAmount/index.d.ts +0 -3
- package/build/components/Pages/SelectMethod/index.d.ts +0 -1
- package/build/components/Pages/SelectMethod/styles.d.ts +0 -9
- package/build/components/Pages/SelectToken/index.d.ts +0 -1
- package/build/components/Pages/SelectWalletAmount/index.d.ts +0 -3
- package/build/components/Pages/SelectWalletChain/index.d.ts +0 -3
- package/build/components/Pages/SelectZKP/index.d.ts +0 -3
- package/build/components/Pages/Solana/ConnectorSolana/index.d.ts +0 -4
- package/build/components/Pages/Solana/PayWithSolanaToken/index.d.ts +0 -3
- package/build/components/Pages/Solana/SelectSolanaAmount/index.d.ts +0 -3
- package/build/components/Pages/SwitchNetworks/index.d.ts +0 -3
- package/build/components/Pages/WaitingDepositAddress/index.d.ts +0 -1
- package/build/components/Pages/WaitingExternal/index.d.ts +0 -3
- package/build/components/Pages/WaitingWallet/index.d.ts +0 -3
- package/build/components/Spinners/CircleSpinner/index.d.ts +0 -9
- package/build/components/Spinners/CircleSpinner/styles.d.ts +0 -5
- package/build/components/Spinners/ExternalPaymentSpinner/index.d.ts +0 -5
- package/build/components/Spinners/SquircleSpinner/index.d.ts +0 -5
- package/build/components/Spinners/SquircleSpinner/styles.d.ts +0 -4
- package/build/components/Spinners/TokenLogoSpinner/index.d.ts +0 -5
- package/build/components/Spinners/TokenLogoSpinner/styles.d.ts +0 -1
- package/build/components/Spinners/WalletPaymentSpinner/index.d.ts +0 -5
- package/build/components/Spinners/styles.d.ts +0 -2
- package/build/constants/defaultTheme.d.ts +0 -4
- package/build/constants/routes.d.ts +0 -28
- package/build/defaultConfig.d.ts +0 -17
- package/build/defaultConnectors.d.ts +0 -14
- package/build/hooks/useChainIsSupported.d.ts +0 -2
- package/build/hooks/useChains.d.ts +0 -3
- package/build/hooks/useConnect.d.ts +0 -110
- package/build/hooks/useConnectCallback.d.ts +0 -8
- package/build/hooks/useConnectors.d.ts +0 -3
- package/build/hooks/useDaimoPay.d.ts +0 -94
- package/build/hooks/useDaimoPayStatus.d.ts +0 -15
- package/build/hooks/useDaimoPayUI.d.ts +0 -6
- package/build/hooks/useDepositAddressOptions.d.ts +0 -10
- package/build/hooks/useEnsFallbackConfig.d.ts +0 -2
- package/build/hooks/useExternalPaymentOptions.d.ts +0 -12
- package/build/hooks/useFitText.d.ts +0 -14
- package/build/hooks/useFocusTrap.d.ts +0 -1
- package/build/hooks/useGoogleFont.d.ts +0 -3
- package/build/hooks/useIsMobile.d.ts +0 -5
- package/build/hooks/useIsMounted.d.ts +0 -3
- package/build/hooks/useLastConnector.d.ts +0 -4
- package/build/hooks/useLocalStorage.d.ts +0 -7
- package/build/hooks/useLocales.d.ts +0 -2
- package/build/hooks/useLockBodyScroll.d.ts +0 -1
- package/build/hooks/useModal.d.ts +0 -8
- package/build/hooks/useOrderUsdLimits.d.ts +0 -7
- package/build/hooks/usePayContext.d.ts +0 -2
- package/build/hooks/usePaymentState.d.ts +0 -67
- package/build/hooks/usePrevious.d.ts +0 -1
- package/build/hooks/useSolanaPaymentOptions.d.ts +0 -13
- package/build/hooks/useTokenOptions.d.ts +0 -5
- package/build/hooks/useUntronAvailability.d.ts +0 -14
- package/build/hooks/useWalletPaymentOptions.d.ts +0 -31
- package/build/hooks/useWindowSize.d.ts +0 -4
- package/build/localizations/index.d.ts +0 -2
- package/build/localizations/locales/ar-AE.d.ts +0 -3
- package/build/localizations/locales/ca-AD.d.ts +0 -3
- package/build/localizations/locales/ee-EE.d.ts +0 -3
- package/build/localizations/locales/en-US.d.ts +0 -128
- package/build/localizations/locales/es-ES.d.ts +0 -3
- package/build/localizations/locales/fa-IR.d.ts +0 -3
- package/build/localizations/locales/fr-FR.d.ts +0 -3
- package/build/localizations/locales/index.d.ts +0 -3
- package/build/localizations/locales/ja-JP.d.ts +0 -91
- package/build/localizations/locales/pt-BR.d.ts +0 -3
- package/build/localizations/locales/ru-RU.d.ts +0 -3
- package/build/localizations/locales/tr-TR.d.ts +0 -3
- package/build/localizations/locales/vi-VN.d.ts +0 -3
- package/build/localizations/locales/zh-CN.d.ts +0 -3
- package/build/payment/paymentEffects.d.ts +0 -12
- package/build/payment/paymentFsm.d.ts +0 -131
- package/build/payment/paymentStore.d.ts +0 -14
- package/build/payment/paymentUtils.d.ts +0 -6
- package/build/provider/DaimoPayProvider.d.ts +0 -24
- package/build/provider/PayContext.d.ts +0 -66
- package/build/provider/PaymentProvider.d.ts +0 -8
- package/build/provider/SolanaContextProvider.d.ts +0 -6
- package/build/provider/Web3ContextProvider.d.ts +0 -24
- package/build/stateStore.d.ts +0 -66
- package/build/styles/defaultTheme.d.ts +0 -3
- package/build/styles/index.d.ts +0 -1
- package/build/styles/styled/index.d.ts +0 -12
- package/build/styles/themes/base.d.ts +0 -129
- package/build/styles/themes/index.d.ts +0 -673
- package/build/styles/themes/midnight.d.ts +0 -74
- package/build/styles/themes/minimal.d.ts +0 -94
- package/build/styles/themes/nouns.d.ts +0 -79
- package/build/styles/themes/retro.d.ts +0 -89
- package/build/styles/themes/rounded.d.ts +0 -86
- package/build/styles/themes/soft.d.ts +0 -69
- package/build/styles/themes/web95.d.ts +0 -91
- package/build/styles/types.d.ts +0 -80
- package/build/types.d.ts +0 -46
- package/build/utils/exports.d.ts +0 -1
- package/build/utils/format.d.ts +0 -49
- package/build/utils/index.d.ts +0 -17
- package/build/utils/localstorage.d.ts +0 -9
- package/build/utils/p3.d.ts +0 -2
- package/build/utils/platform.d.ts +0 -2
- package/build/utils/polling.d.ts +0 -13
- package/build/utils/supportUrl.d.ts +0 -2
- package/build/utils/trpc.d.ts +0 -4
- package/build/utils/validateInput.d.ts +0 -16
- package/build/utils/wallets.d.ts +0 -24
- package/build/wallets/index.d.ts +0 -5
- package/build/wallets/useWallets.d.ts +0 -16
- package/build/wallets/walletConfigs.d.ts +0 -29
- package/build/world-mini-app/WorldPayButton.d.ts +0 -84
- package/build/world-mini-app/promptWorldPayment.d.ts +0 -9
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function SelectMethod(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const InfoBox: any;
|
|
2
|
-
export declare const InfoBoxButtons: any;
|
|
3
|
-
export declare const LearnMoreContainer: any;
|
|
4
|
-
export declare const LearnMoreButton: any;
|
|
5
|
-
export declare const ConnectorsContainer: any;
|
|
6
|
-
export declare const ConnectorButton: any;
|
|
7
|
-
export declare const ConnectorRecentlyUsed: any;
|
|
8
|
-
export declare const ConnectorLabel: any;
|
|
9
|
-
export declare const ConnectorIcon: any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function SelectToken(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function WaitingDepositAddress(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
declare const CircleSpinner: ({ logo, smallLogo, loading, unavailable, countdown, }: {
|
|
3
|
-
logo?: React.ReactNode;
|
|
4
|
-
smallLogo?: boolean;
|
|
5
|
-
loading?: boolean;
|
|
6
|
-
unavailable?: boolean;
|
|
7
|
-
countdown?: boolean;
|
|
8
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default CircleSpinner;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ChainLogoContainer: any;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export declare enum ROUTES {
|
|
2
|
-
SELECT_METHOD = "daimoPaySelectMethod",
|
|
3
|
-
SELECT_TOKEN = "daimoPaySelectToken",
|
|
4
|
-
SELECT_AMOUNT = "daimoPaySelectAmount",
|
|
5
|
-
SELECT_EXTERNAL_AMOUNT = "daimoPaySelectExternalAmount",
|
|
6
|
-
SELECT_EXCHANGE = "daimoPaySelectExchange",
|
|
7
|
-
SELECT_DEPOSIT_ADDRESS_AMOUNT = "daimoPaySelectDepositAddressAmount",
|
|
8
|
-
SELECT_WALLET_AMOUNT = "daimoPaySelectWalletAmount",
|
|
9
|
-
SELECT_WALLET_CHAIN = "daimoPaySelectWalletChain",
|
|
10
|
-
SELECT_ZKP2P = "daimoPaySelectZKP2P",
|
|
11
|
-
WAITING_EXTERNAL = "daimoPayWaitingExternal",
|
|
12
|
-
WAITING_WALLET = "daimoPayWaitingWallet",
|
|
13
|
-
SELECT_DEPOSIT_ADDRESS_CHAIN = "daimoPaySelectDepositAddressChain",
|
|
14
|
-
WAITING_DEPOSIT_ADDRESS = "daimoPayWaitingDepositAddress",
|
|
15
|
-
PAY_WITH_TOKEN = "daimoPayPayWithToken",
|
|
16
|
-
CONFIRMATION = "daimoPayConfirmation",
|
|
17
|
-
SOLANA_CONNECTOR = "daimoPaySolanaConnector",
|
|
18
|
-
SOLANA_SELECT_AMOUNT = "daimoPaySolanaSelectAmount",
|
|
19
|
-
SOLANA_PAY_WITH_TOKEN = "daimoPaySolanaPayWithToken",
|
|
20
|
-
ERROR = "daimoPayError",
|
|
21
|
-
ONBOARDING = "onboarding",
|
|
22
|
-
ABOUT = "about",
|
|
23
|
-
CONNECTORS = "connectors",
|
|
24
|
-
MOBILECONNECTORS = "mobileConnectors",
|
|
25
|
-
CONNECT = "connect",
|
|
26
|
-
DOWNLOAD = "download",
|
|
27
|
-
SWITCHNETWORKS = "switchNetworks"
|
|
28
|
-
}
|
package/build/defaultConfig.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type CreateConfigParameters } from "@wagmi/core";
|
|
2
|
-
import { CreateConnectorFn } from "wagmi";
|
|
3
|
-
import { CoinbaseWalletParameters } from "wagmi/connectors";
|
|
4
|
-
export declare const getAppName: () => string;
|
|
5
|
-
export declare const getAppIcon: () => string;
|
|
6
|
-
type DefaultConfigProps = {
|
|
7
|
-
appName: string;
|
|
8
|
-
appIcon?: string;
|
|
9
|
-
appDescription?: string;
|
|
10
|
-
appUrl?: string;
|
|
11
|
-
coinbaseWalletPreference?: CoinbaseWalletParameters<"4">["preference"];
|
|
12
|
-
additionalConnectors?: CreateConnectorFn[];
|
|
13
|
-
} & Partial<CreateConfigParameters>;
|
|
14
|
-
export declare const REQUIRED_CHAINS: CreateConfigParameters["chains"];
|
|
15
|
-
/** Daimo Pay recommended config, for use with wagmi's createConfig(). */
|
|
16
|
-
declare const defaultConfig: ({ appName, appIcon, appDescription, appUrl, coinbaseWalletPreference, additionalConnectors, chains, client, ...props }: DefaultConfigProps) => CreateConfigParameters;
|
|
17
|
-
export default defaultConfig;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CoinbaseWalletParameters } from "@wagmi/connectors";
|
|
2
|
-
import { CreateConnectorFn } from "wagmi";
|
|
3
|
-
type DefaultConnectorsProps = {
|
|
4
|
-
app: {
|
|
5
|
-
name: string;
|
|
6
|
-
icon?: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
url?: string;
|
|
9
|
-
};
|
|
10
|
-
coinbaseWalletPreference?: CoinbaseWalletParameters<"4">["preference"];
|
|
11
|
-
additionalConnectors?: CreateConnectorFn[];
|
|
12
|
-
};
|
|
13
|
-
declare const defaultConnectors: ({ app, coinbaseWalletPreference, additionalConnectors, }: DefaultConnectorsProps) => CreateConnectorFn[];
|
|
14
|
-
export default defaultConnectors;
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is a wrapper around wagmi's useConnect hook that adds some
|
|
3
|
-
* additional functionality.
|
|
4
|
-
*/
|
|
5
|
-
import { Connector, CreateConnectorFn, type UseConnectParameters } from "wagmi";
|
|
6
|
-
export declare function useConnect({ ...props }?: UseConnectParameters): {
|
|
7
|
-
data: undefined;
|
|
8
|
-
error: null;
|
|
9
|
-
context: unknown;
|
|
10
|
-
reset: () => void;
|
|
11
|
-
status: "idle";
|
|
12
|
-
isError: false;
|
|
13
|
-
isPending: false;
|
|
14
|
-
isSuccess: false;
|
|
15
|
-
failureCount: number;
|
|
16
|
-
failureReason: import("@wagmi/core").ConnectErrorType | null;
|
|
17
|
-
isPaused: boolean;
|
|
18
|
-
variables: undefined;
|
|
19
|
-
isIdle: true;
|
|
20
|
-
submittedAt: number;
|
|
21
|
-
connect: ({ connector, chainId, mutation, }: {
|
|
22
|
-
connector: CreateConnectorFn | Connector;
|
|
23
|
-
chainId?: number;
|
|
24
|
-
mutation?: UseConnectParameters["mutation"];
|
|
25
|
-
}) => void;
|
|
26
|
-
connectAsync: ({ connector, chainId, mutation, }: {
|
|
27
|
-
connector: CreateConnectorFn | Connector;
|
|
28
|
-
chainId?: number;
|
|
29
|
-
mutation?: UseConnectParameters["mutation"];
|
|
30
|
-
}) => Promise<import("wagmi/query").ConnectData<import("wagmi").Config>>;
|
|
31
|
-
connectors: readonly Connector<CreateConnectorFn>[];
|
|
32
|
-
} | {
|
|
33
|
-
data: undefined;
|
|
34
|
-
error: null;
|
|
35
|
-
context: unknown;
|
|
36
|
-
reset: () => void;
|
|
37
|
-
status: "pending";
|
|
38
|
-
isError: false;
|
|
39
|
-
isPending: true;
|
|
40
|
-
isSuccess: false;
|
|
41
|
-
failureCount: number;
|
|
42
|
-
failureReason: import("@wagmi/core").ConnectErrorType | null;
|
|
43
|
-
isPaused: boolean;
|
|
44
|
-
variables: import("wagmi/query").ConnectVariables<import("wagmi").Config, Connector<CreateConnectorFn>>;
|
|
45
|
-
isIdle: false;
|
|
46
|
-
submittedAt: number;
|
|
47
|
-
connect: ({ connector, chainId, mutation, }: {
|
|
48
|
-
connector: CreateConnectorFn | Connector;
|
|
49
|
-
chainId?: number;
|
|
50
|
-
mutation?: UseConnectParameters["mutation"];
|
|
51
|
-
}) => void;
|
|
52
|
-
connectAsync: ({ connector, chainId, mutation, }: {
|
|
53
|
-
connector: CreateConnectorFn | Connector;
|
|
54
|
-
chainId?: number;
|
|
55
|
-
mutation?: UseConnectParameters["mutation"];
|
|
56
|
-
}) => Promise<import("wagmi/query").ConnectData<import("wagmi").Config>>;
|
|
57
|
-
connectors: readonly Connector<CreateConnectorFn>[];
|
|
58
|
-
} | {
|
|
59
|
-
data: undefined;
|
|
60
|
-
error: import("@wagmi/core").ConnectErrorType;
|
|
61
|
-
context: unknown;
|
|
62
|
-
reset: () => void;
|
|
63
|
-
status: "error";
|
|
64
|
-
isError: true;
|
|
65
|
-
isPending: false;
|
|
66
|
-
isSuccess: false;
|
|
67
|
-
failureCount: number;
|
|
68
|
-
failureReason: import("@wagmi/core").ConnectErrorType | null;
|
|
69
|
-
isPaused: boolean;
|
|
70
|
-
variables: import("wagmi/query").ConnectVariables<import("wagmi").Config, Connector<CreateConnectorFn>>;
|
|
71
|
-
isIdle: false;
|
|
72
|
-
submittedAt: number;
|
|
73
|
-
connect: ({ connector, chainId, mutation, }: {
|
|
74
|
-
connector: CreateConnectorFn | Connector;
|
|
75
|
-
chainId?: number;
|
|
76
|
-
mutation?: UseConnectParameters["mutation"];
|
|
77
|
-
}) => void;
|
|
78
|
-
connectAsync: ({ connector, chainId, mutation, }: {
|
|
79
|
-
connector: CreateConnectorFn | Connector;
|
|
80
|
-
chainId?: number;
|
|
81
|
-
mutation?: UseConnectParameters["mutation"];
|
|
82
|
-
}) => Promise<import("wagmi/query").ConnectData<import("wagmi").Config>>;
|
|
83
|
-
connectors: readonly Connector<CreateConnectorFn>[];
|
|
84
|
-
} | {
|
|
85
|
-
data: import("wagmi/query").ConnectData<import("wagmi").Config>;
|
|
86
|
-
error: null;
|
|
87
|
-
context: unknown;
|
|
88
|
-
reset: () => void;
|
|
89
|
-
status: "success";
|
|
90
|
-
isError: false;
|
|
91
|
-
isPending: false;
|
|
92
|
-
isSuccess: true;
|
|
93
|
-
failureCount: number;
|
|
94
|
-
failureReason: import("@wagmi/core").ConnectErrorType | null;
|
|
95
|
-
isPaused: boolean;
|
|
96
|
-
variables: import("wagmi/query").ConnectVariables<import("wagmi").Config, Connector<CreateConnectorFn>>;
|
|
97
|
-
isIdle: false;
|
|
98
|
-
submittedAt: number;
|
|
99
|
-
connect: ({ connector, chainId, mutation, }: {
|
|
100
|
-
connector: CreateConnectorFn | Connector;
|
|
101
|
-
chainId?: number;
|
|
102
|
-
mutation?: UseConnectParameters["mutation"];
|
|
103
|
-
}) => void;
|
|
104
|
-
connectAsync: ({ connector, chainId, mutation, }: {
|
|
105
|
-
connector: CreateConnectorFn | Connector;
|
|
106
|
-
chainId?: number;
|
|
107
|
-
mutation?: UseConnectParameters["mutation"];
|
|
108
|
-
}) => Promise<import("wagmi/query").ConnectData<import("wagmi").Config>>;
|
|
109
|
-
connectors: readonly Connector<CreateConnectorFn>[];
|
|
110
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type useConnectCallbackProps = {
|
|
2
|
-
onConnect?: ({ address, connectorId, }: {
|
|
3
|
-
address?: string;
|
|
4
|
-
connectorId?: string;
|
|
5
|
-
}) => void;
|
|
6
|
-
onDisconnect?: () => void;
|
|
7
|
-
};
|
|
8
|
-
export declare const useConnectCallback: ({ onConnect, onDisconnect, }: useConnectCallbackProps) => void;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { DaimoPayOrderID, SolanaPublicKey } from "@daimo/pay-common";
|
|
2
|
-
import { Address, Hex } from "viem";
|
|
3
|
-
import { PaymentState, PayParams } from "../payment/paymentFsm";
|
|
4
|
-
type DaimoPayFunctions = {
|
|
5
|
-
/**
|
|
6
|
-
* Create a new Daimo Pay order preview with the given parameters.
|
|
7
|
-
* Call this to start a new payment flow.
|
|
8
|
-
*
|
|
9
|
-
* @param params - Parameters describing the payment to be created.
|
|
10
|
-
*/
|
|
11
|
-
createPreviewOrder: (params: PayParams) => Promise<Extract<PaymentState, {
|
|
12
|
-
type: "preview";
|
|
13
|
-
}>>;
|
|
14
|
-
/**
|
|
15
|
-
* Set the order ID to fetch and manage an existing Daimo Pay order.
|
|
16
|
-
* Useful for resuming or referencing a previously created order.
|
|
17
|
-
*
|
|
18
|
-
* @param id - The Daimo Pay order ID to set.
|
|
19
|
-
*/
|
|
20
|
-
setPayId: (id: DaimoPayOrderID) => Promise<Extract<PaymentState, {
|
|
21
|
-
type: "unhydrated" | "payment_unpaid" | "payment_started" | "payment_completed" | "payment_bounced";
|
|
22
|
-
}>>;
|
|
23
|
-
/**
|
|
24
|
-
* Hydrate the current order, locking in the payment intent details and
|
|
25
|
-
* token swap prices.
|
|
26
|
-
*/
|
|
27
|
-
hydrateOrder: (refundAddress?: Address) => Promise<Extract<PaymentState, {
|
|
28
|
-
type: "payment_unpaid";
|
|
29
|
-
}>>;
|
|
30
|
-
/** Trigger search for payment on the current order. */
|
|
31
|
-
paySource: () => void;
|
|
32
|
-
/**
|
|
33
|
-
* Register an Ethereum payment source for the current order.
|
|
34
|
-
* Call this after the user has submitted an Ethereum payment transaction.
|
|
35
|
-
*
|
|
36
|
-
* @param args - Details about the Ethereum payment transaction.
|
|
37
|
-
*/
|
|
38
|
-
payEthSource: (args: {
|
|
39
|
-
paymentTxHash: Hex;
|
|
40
|
-
sourceChainId: number;
|
|
41
|
-
payerAddress: Address;
|
|
42
|
-
sourceToken: Address;
|
|
43
|
-
sourceAmount: bigint;
|
|
44
|
-
}) => Promise<Extract<PaymentState, {
|
|
45
|
-
type: "payment_started" | "payment_completed" | "payment_bounced";
|
|
46
|
-
}>>;
|
|
47
|
-
/**
|
|
48
|
-
* Register a Solana payment source for the current order.
|
|
49
|
-
* Call this after the user has submitted a Solana payment transaction.
|
|
50
|
-
*
|
|
51
|
-
* @param args - Details about the Solana payment transaction.
|
|
52
|
-
*/
|
|
53
|
-
paySolanaSource: (args: {
|
|
54
|
-
paymentTxHash: string;
|
|
55
|
-
sourceToken: SolanaPublicKey;
|
|
56
|
-
}) => Promise<Extract<PaymentState, {
|
|
57
|
-
type: "payment_started" | "payment_completed" | "payment_bounced";
|
|
58
|
-
}>>;
|
|
59
|
-
/**
|
|
60
|
-
* Reset the current payment state and clear the active order.
|
|
61
|
-
* Call this to start a new payment flow.
|
|
62
|
-
*/
|
|
63
|
-
reset: () => void;
|
|
64
|
-
/**
|
|
65
|
-
* Update the user's chosen amount in USD. Applies only to deposit flow.
|
|
66
|
-
*
|
|
67
|
-
* @deprecated
|
|
68
|
-
*/
|
|
69
|
-
setChosenUsd: (usd: number) => void;
|
|
70
|
-
};
|
|
71
|
-
type DaimoPayState = {
|
|
72
|
-
[S in PaymentState as S["type"]]: {
|
|
73
|
-
paymentState: S["type"];
|
|
74
|
-
order: S extends {
|
|
75
|
-
order: infer O;
|
|
76
|
-
} ? O : null;
|
|
77
|
-
paymentErrorMessage: S extends {
|
|
78
|
-
message: infer M;
|
|
79
|
-
} ? M : null;
|
|
80
|
-
};
|
|
81
|
-
}[PaymentState["type"]];
|
|
82
|
-
export type UseDaimoPay = DaimoPayFunctions & DaimoPayState;
|
|
83
|
-
/**
|
|
84
|
-
* React hook for interacting with Daimo Pay orders and payments. Use this hook
|
|
85
|
-
* to manage the lifecycle of a Daimo Pay payment in your application.
|
|
86
|
-
*
|
|
87
|
-
* This hook provides a simple interface to create, hydrate, pay, and reset
|
|
88
|
-
* Daimo Pay orders.
|
|
89
|
-
*
|
|
90
|
-
* @returns {UseDaimoPay} An object with current payment state and methods to
|
|
91
|
-
* manage Daimo Pay orders and payments.
|
|
92
|
-
*/
|
|
93
|
-
export declare function useDaimoPay(): UseDaimoPay;
|
|
94
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DaimoPayIntentStatus } from "@daimo/pay-common";
|
|
2
|
-
/** Returns the current payment, or undefined if there is none.
|
|
3
|
-
*
|
|
4
|
-
* Status values:
|
|
5
|
-
* - `payment_unpaid` - the user has not paid yet
|
|
6
|
-
* - `payment_started` - the user has paid & payment is in progress. This status
|
|
7
|
-
* typically lasts a few seconds.
|
|
8
|
-
* - `payment_completed` - the final call or transfer succeeded
|
|
9
|
-
* - `payment_bounced` - the final call or transfer reverted. Funds were sent
|
|
10
|
-
* to the payment's configured refund address on the destination chain.
|
|
11
|
-
*/
|
|
12
|
-
export declare function useDaimoPayStatus(): {
|
|
13
|
-
paymentId: string;
|
|
14
|
-
status: DaimoPayIntentStatus;
|
|
15
|
-
} | undefined;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DaimoPayOrderMode, DepositAddressPaymentOptionMetadata } from "@daimo/pay-common";
|
|
2
|
-
import { TrpcClient } from "../utils/trpc";
|
|
3
|
-
export declare function useDepositAddressOptions({ trpc, usdRequired, mode, }: {
|
|
4
|
-
trpc: TrpcClient;
|
|
5
|
-
usdRequired: number | undefined;
|
|
6
|
-
mode: DaimoPayOrderMode | undefined;
|
|
7
|
-
}): {
|
|
8
|
-
options: DepositAddressPaymentOptionMetadata[];
|
|
9
|
-
loading: boolean;
|
|
10
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DaimoPayOrderMode, ExternalPaymentOptionMetadata, PlatformType } from "@daimo/pay-common";
|
|
2
|
-
import { TrpcClient } from "../utils/trpc";
|
|
3
|
-
export declare function useExternalPaymentOptions({ trpc, filterIds, platform, usdRequired, mode, }: {
|
|
4
|
-
trpc: TrpcClient;
|
|
5
|
-
filterIds: string[] | undefined;
|
|
6
|
-
platform: PlatformType | undefined;
|
|
7
|
-
usdRequired: number | undefined;
|
|
8
|
-
mode: DaimoPayOrderMode | undefined;
|
|
9
|
-
}): {
|
|
10
|
-
options: Map<"external" | "zkp2p" | "exchange", ExternalPaymentOptionMetadata[]>;
|
|
11
|
-
loading: boolean;
|
|
12
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type TLogLevel = "debug" | "info" | "warn" | "error" | "none";
|
|
2
|
-
export type TOptions = {
|
|
3
|
-
logLevel?: TLogLevel;
|
|
4
|
-
maxFontSize?: number;
|
|
5
|
-
minFontSize?: number;
|
|
6
|
-
onFinish?: (fontSize: number) => void;
|
|
7
|
-
onStart?: () => void;
|
|
8
|
-
resolution?: number;
|
|
9
|
-
};
|
|
10
|
-
declare const useFitText: ({ logLevel: logLevelOption, maxFontSize, minFontSize, onFinish, onStart, resolution, }?: TOptions) => {
|
|
11
|
-
fontSize: number;
|
|
12
|
-
ref: import("react").RefObject<HTMLDivElement>;
|
|
13
|
-
};
|
|
14
|
-
export default useFitText;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function FocusTrap(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function useLockBodyScroll(initialLocked: boolean): (boolean | import("react").Dispatch<import("react").SetStateAction<boolean>>)[];
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { useConnectCallbackProps } from "./useConnectCallback";
|
|
2
|
-
type UseModalProps = {} & useConnectCallbackProps;
|
|
3
|
-
/** Opens and closes the payment modal. */
|
|
4
|
-
export declare const useModal: ({ onConnect, onDisconnect }?: UseModalProps) => {
|
|
5
|
-
open: boolean;
|
|
6
|
-
setOpen: (show: boolean) => void;
|
|
7
|
-
};
|
|
8
|
-
export {};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { DepositAddressPaymentOptionData, DepositAddressPaymentOptionMetadata, DepositAddressPaymentOptions, ExternalPaymentOptionMetadata, ExternalPaymentOptions, SolanaPublicKey, WalletPaymentOption } from "@daimo/pay-common";
|
|
2
|
-
import { Hex } from "viem";
|
|
3
|
-
import { PayButtonPaymentProps } from "../components/DaimoPayButton";
|
|
4
|
-
import { ROUTES } from "../constants/routes";
|
|
5
|
-
import { PayParams } from "../payment/paymentFsm";
|
|
6
|
-
import { TrpcClient } from "../utils/trpc";
|
|
7
|
-
import { WalletConfigProps } from "../wallets/walletConfigs";
|
|
8
|
-
import { useDepositAddressOptions } from "./useDepositAddressOptions";
|
|
9
|
-
import { useExternalPaymentOptions } from "./useExternalPaymentOptions";
|
|
10
|
-
import { useSolanaPaymentOptions } from "./useSolanaPaymentOptions";
|
|
11
|
-
import { useWalletPaymentOptions } from "./useWalletPaymentOptions";
|
|
12
|
-
/** Wallet payment details, sent to processSourcePayment after submitting tx. */
|
|
13
|
-
export type SourcePayment = Parameters<TrpcClient["processSourcePayment"]["mutate"]>[0];
|
|
14
|
-
/** Creates (or loads) a payment and manages the corresponding modal. */
|
|
15
|
-
export interface PaymentState {
|
|
16
|
-
generatePreviewOrder: () => void;
|
|
17
|
-
resetOrder: (payParams?: Partial<PayParams>) => Promise<void>;
|
|
18
|
-
buttonProps: PayButtonPaymentProps | undefined;
|
|
19
|
-
setButtonProps: (props: PayButtonPaymentProps | undefined) => void;
|
|
20
|
-
setPayId: (id: string | undefined) => void;
|
|
21
|
-
setPayParams: (payParams: PayParams | undefined) => Promise<void>;
|
|
22
|
-
isDepositFlow: boolean;
|
|
23
|
-
paymentWaitingMessage: string | undefined;
|
|
24
|
-
externalPaymentOptions: ReturnType<typeof useExternalPaymentOptions>;
|
|
25
|
-
selectedWallet: WalletConfigProps | undefined;
|
|
26
|
-
selectedWalletDeepLink: string | undefined;
|
|
27
|
-
showSolanaPaymentMethod: boolean;
|
|
28
|
-
walletPaymentOptions: ReturnType<typeof useWalletPaymentOptions>;
|
|
29
|
-
solanaPaymentOptions: ReturnType<typeof useSolanaPaymentOptions>;
|
|
30
|
-
depositAddressOptions: ReturnType<typeof useDepositAddressOptions>;
|
|
31
|
-
/** Whether Untron receivers are currently available. `null` when unknown. */
|
|
32
|
-
untronAvailable: boolean | null;
|
|
33
|
-
selectedExternalOption: ExternalPaymentOptionMetadata | undefined;
|
|
34
|
-
selectedTokenOption: WalletPaymentOption | undefined;
|
|
35
|
-
selectedSolanaTokenOption: WalletPaymentOption | undefined;
|
|
36
|
-
selectedDepositAddressOption: DepositAddressPaymentOptionMetadata | undefined;
|
|
37
|
-
getOrderUsdLimit: () => number;
|
|
38
|
-
setPaymentWaitingMessage: (message: string | undefined) => void;
|
|
39
|
-
tokenMode: "evm" | "solana" | "all";
|
|
40
|
-
setTokenMode: (mode: "evm" | "solana" | "all") => void;
|
|
41
|
-
setSelectedWallet: (wallet: WalletConfigProps | undefined) => void;
|
|
42
|
-
setSelectedWalletDeepLink: (deepLink: string | undefined) => void;
|
|
43
|
-
setSelectedExternalOption: (option: ExternalPaymentOptionMetadata | undefined) => void;
|
|
44
|
-
setSelectedTokenOption: (option: WalletPaymentOption | undefined) => void;
|
|
45
|
-
setSelectedSolanaTokenOption: (option: WalletPaymentOption | undefined) => void;
|
|
46
|
-
setSelectedDepositAddressOption: (option: DepositAddressPaymentOptionMetadata | undefined) => void;
|
|
47
|
-
setChosenUsd: (usd: number) => void;
|
|
48
|
-
payWithToken: (walletOption: WalletPaymentOption) => Promise<{
|
|
49
|
-
txHash?: Hex;
|
|
50
|
-
success: boolean;
|
|
51
|
-
}>;
|
|
52
|
-
payWithExternal: (option: ExternalPaymentOptions) => Promise<string>;
|
|
53
|
-
payWithDepositAddress: (option: DepositAddressPaymentOptions) => Promise<DepositAddressPaymentOptionData | null>;
|
|
54
|
-
payWithSolanaToken: (inputToken: SolanaPublicKey) => Promise<{
|
|
55
|
-
txHash: string;
|
|
56
|
-
success: boolean;
|
|
57
|
-
}>;
|
|
58
|
-
openInWalletBrowser: (wallet: WalletConfigProps, amountUsd?: number) => void;
|
|
59
|
-
senderEnsName: string | undefined;
|
|
60
|
-
}
|
|
61
|
-
export declare function usePaymentState({ trpc, lockPayParams, setRoute, log, redirectReturnUrl, }: {
|
|
62
|
-
trpc: TrpcClient;
|
|
63
|
-
lockPayParams: boolean;
|
|
64
|
-
setRoute: (route: ROUTES, data?: Record<string, any>) => void;
|
|
65
|
-
log: (...args: any[]) => void;
|
|
66
|
-
redirectReturnUrl?: string;
|
|
67
|
-
}): PaymentState;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function usePrevious(value: any, initial?: any): any;
|