@funkit/connect 5.0.10 → 5.1.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/{chunk-2T4ZDGAO.js → chunk-A7G4HZZY.js} +9 -4
  3. package/dist/{chunk-N7ULOOYE.js → chunk-SPLTPSN6.js} +4 -3
  4. package/dist/{chunk-W45X55GI.js → chunk-ZX3JBDYE.js} +4 -3
  5. package/dist/components/Box/Box.d.ts +29 -29
  6. package/dist/components/Dialog/DialogContent.css.d.ts +1 -0
  7. package/dist/components/Dropdown/BaseActiveDropdownItem.d.ts +3 -2
  8. package/dist/components/Dropdown/BaseDropdown.d.ts +1 -0
  9. package/dist/components/Dropdown/BaseDropdownItem.d.ts +3 -1
  10. package/dist/components/Dropdown/TokenDropdown.d.ts +2 -2
  11. package/dist/components/DydxSwitchModalTab/DydxSwitchModalTab.d.ts +6 -3
  12. package/dist/components/FunAsset/FunAssetBadge.d.ts +2 -2
  13. package/dist/components/FunButton/FunIconButton.d.ts +0 -2
  14. package/dist/components/FunButton/FunRedirectButton.d.ts +6 -0
  15. package/dist/components/FunCheckoutHistory/FunCheckoutHistoryContent.d.ts +1 -2
  16. package/dist/components/FunCheckoutHistory/FunCheckoutHistoryDetail.d.ts +1 -2
  17. package/dist/components/FunCheckoutHistory/FunCheckoutHistoryTransaction.d.ts +7 -1
  18. package/dist/components/FunCheckoutHistory/FunCheckoutStatus.d.ts +2 -0
  19. package/dist/components/FunCheckoutHistory/FunDirectExecutionHistoryDetail.d.ts +7 -0
  20. package/dist/components/FunCheckoutHistory/useCustomStatusAnimationAboveTopbar.d.ts +13 -10
  21. package/dist/components/FunCountdown/FunCountdown.css.d.ts +0 -2
  22. package/dist/components/FunCountdown/FunCountdown.d.ts +6 -2
  23. package/dist/components/FunInfoBanner/EphemeralInfoBanner.d.ts +1 -1
  24. package/dist/components/FunNoResults/FunNoResults.d.ts +6 -2
  25. package/dist/components/FunTransactionSummary/FunTxSummaryComponents.d.ts +1 -2
  26. package/dist/components/FunTransactionSummary/PaymentAmountSummary.d.ts +14 -0
  27. package/dist/components/FunTransactionSummary/PaymentMethodSummary.d.ts +5 -17
  28. package/dist/components/FunTransactionSummary/PaymentRouteSummary.d.ts +12 -0
  29. package/dist/components/Icons/Icons.css.d.ts +1 -0
  30. package/dist/consts/checkout.d.ts +5 -1
  31. package/dist/consts/customers.d.ts +1 -0
  32. package/dist/css/cssObjectFromTheme.d.ts +1 -1
  33. package/dist/css/sprinkles.css.d.ts +38 -33
  34. package/dist/domains/asset.d.ts +2 -3
  35. package/dist/domains/quote.d.ts +8 -0
  36. package/dist/hooks/useCheckoutTransferInit.d.ts +8 -0
  37. package/dist/hooks/useEnabledTokenTransferChainTokens.d.ts +2 -1
  38. package/dist/index.css +2404 -2419
  39. package/dist/index.js +3283 -3038
  40. package/dist/modals/CheckoutModal/ConfirmationStep/useCheckoutConfirmation.d.ts +2 -1
  41. package/dist/modals/CheckoutModal/ConfirmationStep/usePostCheckout.d.ts +0 -1
  42. package/dist/modals/CheckoutModal/useSourceAssetConfirm.d.ts +1 -2
  43. package/dist/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.d.ts +3 -2
  44. package/dist/providers/FunkitCheckoutContext.d.ts +1 -1
  45. package/dist/providers/FunkitHistoryContext.d.ts +2 -1
  46. package/dist/providers/FunkitThemeProvider.d.ts +12 -6
  47. package/dist/themes/baseTheme.js +1 -1
  48. package/dist/themes/darkTheme.js +2 -2
  49. package/dist/themes/lightTheme.js +2 -2
  50. package/dist/utils/checkout.d.ts +9 -1
  51. package/dist/utils/flags/config.d.ts +18 -0
  52. package/dist/utils/signature.d.ts +1 -0
  53. package/dist/wallets/walletConnectors/index.js +28 -28
  54. package/package.json +17 -17
  55. package/dist/hooks/useCheckoutTransferDepositAddress.d.ts +0 -4
@@ -5,4 +5,10 @@ interface FunRedirectButtonProps extends Omit<FunIconButtonProps, 'icon'> {
5
5
  to: string;
6
6
  }
7
7
  export declare const FunRedirectButton: ({ to, size, paddingX, paddingY, icon, ...buttonProps }: FunRedirectButtonProps) => React.JSX.Element;
8
+ interface AddressRedirectButtonProps {
9
+ chainId: string;
10
+ address: string;
11
+ customRedirectUrl?: string;
12
+ }
13
+ export declare const AddressRedirectButton: ({ chainId, address, customRedirectUrl, }: AddressRedirectButtonProps) => React.JSX.Element;
8
14
  export {};
@@ -3,7 +3,6 @@ import { HistoryContentPages } from '../../utils/checkoutHistory';
3
3
  interface FunCheckoutHistoryContentProps {
4
4
  depositAddress: `0x${string}`;
5
5
  currentPage: HistoryContentPages;
6
- hideStatus?: boolean;
7
6
  onHelp: () => void;
8
7
  onBackFromHelpPage: () => void;
9
8
  onClose: () => void;
@@ -12,5 +11,5 @@ interface FunCheckoutHistoryContentProps {
12
11
  includeGenerateActionsParams?: boolean;
13
12
  }
14
13
  export declare const DEFAULT_CHECKOUT_HISTORY_DETAIL_TITLE = "Your Purchase";
15
- export declare function FunCheckoutHistoryContent({ depositAddress, currentPage, hideStatus, bottomBarId, onHelp, onBackFromHelpPage, onClose, includeGenerateActionsParams, }: FunCheckoutHistoryContentProps): React.JSX.Element;
14
+ export declare function FunCheckoutHistoryContent({ depositAddress, currentPage, bottomBarId, onHelp, onBackFromHelpPage, onClose, includeGenerateActionsParams, }: FunCheckoutHistoryContentProps): React.JSX.Element;
16
15
  export {};
@@ -2,7 +2,6 @@ import type { CheckoutHistoryItem } from '@funkit/api-base';
2
2
  import React from 'react';
3
3
  interface FunCheckoutHistoryDetailProps {
4
4
  checkoutHistoryInfo: CheckoutHistoryItem | undefined;
5
- hideStatus?: boolean;
6
5
  onHelp: () => void;
7
6
  onClose: () => void;
8
7
  /** Element ID to be used to mount the CTA action bar */
@@ -12,5 +11,5 @@ interface FunCheckoutHistoryDetailProps {
12
11
  /**
13
12
  * Processing info about a checkout history item (already created in backend)
14
13
  */
15
- export declare function FunCheckoutHistoryDetail({ checkoutHistoryInfo, hideStatus, onHelp, onClose, bottomBarId, includeGenerateActionsParams, }: FunCheckoutHistoryDetailProps): React.JSX.Element;
14
+ export declare function FunCheckoutHistoryDetail({ checkoutHistoryInfo, onHelp, onClose, bottomBarId, includeGenerateActionsParams, }: FunCheckoutHistoryDetailProps): React.JSX.Element;
16
15
  export {};
@@ -1,5 +1,11 @@
1
- import type { CheckoutHistoryItem } from '@funkit/api-base';
1
+ import type { CheckoutHistoryItem, CheckoutState } from '@funkit/api-base';
2
2
  import React from 'react';
3
+ interface StatusTagProps {
4
+ state: CheckoutState;
5
+ refundState: CheckoutHistoryItem['refundState'];
6
+ isDelayed: boolean;
7
+ }
8
+ export declare function StatusTag({ state, refundState, isDelayed }: StatusTagProps): React.JSX.Element;
3
9
  interface FunTxSummaryHistoryProps {
4
10
  checkoutHistoryItem: CheckoutHistoryItem | undefined;
5
11
  isDelayed?: boolean;
@@ -5,4 +5,6 @@ interface FunCheckoutStatusProps {
5
5
  onOrderDelayed?: () => void;
6
6
  }
7
7
  export declare function FunCheckoutStatus({ checkoutHistoryItem, onOrderDelayed, }: FunCheckoutStatusProps): React.JSX.Element | null;
8
+ /** Special status component for checkout Direct Execution flow (only success state is displayable to user) */
9
+ export declare const DirectExecutionStatus: () => React.JSX.Element;
8
10
  export {};
@@ -0,0 +1,7 @@
1
+ import { type DirectExecution } from '@funkit/api-base';
2
+ import React from 'react';
3
+ export declare function FunDirectExecutionHistoryDetail({ directExecution, bottomBarId, onClose, }: {
4
+ directExecution: DirectExecution;
5
+ bottomBarId: string;
6
+ onClose: () => void;
7
+ }): React.JSX.Element;
@@ -1,10 +1,6 @@
1
- import React, { type ReactNode, type RefCallback } from 'react';
1
+ import React, { type ReactNode } from 'react';
2
2
  import type { Address } from 'viem';
3
- /**
4
- * Hook for sharing the logic for the custom status icon animation in checkout details. This is very
5
- * much _not_ generic or intended to be reused anywhere, but the component itself is duplicated.
6
- */
7
- export declare function useCustomStatusAnimationAboveTopbar({ depositAddress, isCheckoutDetailView, paddingTop, topbar, withTopDivider, }: {
3
+ interface CustomStatusAnimationParams {
8
4
  depositAddress: Address | undefined;
9
5
  /** Whether status icon is currently shown */
10
6
  isCheckoutDetailView: boolean;
@@ -14,13 +10,20 @@ export declare function useCustomStatusAnimationAboveTopbar({ depositAddress, is
14
10
  topbar: ReactNode;
15
11
  /** Whether to show the topbar divider when _not_ in checkout detail view */
16
12
  withTopDivider: 'always' | 'never' | 'scroll' | undefined;
17
- }): {
13
+ /** ID of the element to scroll (main dialog content) when scrolling over the overflowed title */
14
+ scrollableContent: string;
15
+ }
16
+ interface CustomStatusAnimationReturn {
18
17
  /** To be passed to scrolling container, to sync the scroll position */
19
18
  onScroll: React.UIEventHandler<HTMLElement>;
20
- /** To be passed to scrolling container, to initialize the scroll position */
21
- ref: RefCallback<HTMLElement>;
22
19
  /** Modal topbar, to which a modulated-opacity background was added */
23
20
  topbar: ReactNode;
24
21
  /** Whether to show the topbar divider */
25
22
  withTopDivider: 'always' | 'never' | 'scroll' | undefined;
26
- };
23
+ }
24
+ /**
25
+ * Hook for sharing the logic for the custom status icon animation in checkout details. This is very
26
+ * much _not_ generic or intended to be reused anywhere, but the component itself is duplicated.
27
+ */
28
+ export declare function useCustomStatusAnimationAboveTopbar({ depositAddress, isCheckoutDetailView, paddingTop, topbar, withTopDivider, scrollableContent, }: CustomStatusAnimationParams): CustomStatusAnimationReturn;
29
+ export {};
@@ -1,4 +1,2 @@
1
1
  export declare const backgroundRing: string;
2
2
  export declare const counterRing: string;
3
- export declare const pendingBackgroundRing: string;
4
- export declare const pendingRing: string;
@@ -1,3 +1,4 @@
1
+ import { type AnimationProps } from 'motion/react';
1
2
  import React, { type ReactNode } from 'react';
2
3
  export interface FunCountdownProps {
3
4
  countdownSeconds: number;
@@ -11,6 +12,9 @@ export interface FunCountdownProps {
11
12
  children?: ReactNode | ((remainingSeconds: number) => ReactNode);
12
13
  isHidden?: boolean;
13
14
  isPaused?: boolean;
14
- showPending?: boolean;
15
+ /** Optional component to be used instead of the countdown after it ends */
16
+ delayedComponent?: ReactNode;
17
+ /** Animation props to controll how the coundown is replaced with the delayedComponent */
18
+ motionProps?: AnimationProps;
15
19
  }
16
- export declare const FunCountdown: ({ countdownSeconds, initialRemainingSeconds, counterSize, onCountdownEnded, onBeforeCountdownEnds, onBeforeCountdownEndsSeconds, onCountdownLastSecond, strokeWidth, isHidden, isPaused, children, showPending, }: FunCountdownProps) => React.JSX.Element | null;
20
+ export declare const FunCountdown: ({ countdownSeconds, initialRemainingSeconds, counterSize, onCountdownEnded, onBeforeCountdownEnds, onBeforeCountdownEndsSeconds, onCountdownLastSecond, strokeWidth, isHidden, isPaused, children, delayedComponent, motionProps, }: FunCountdownProps) => React.JSX.Element | null;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { type InfoBannerProps } from './InfoBanner';
3
- /** InfoBanner that dissapears at a certain point in time */
3
+ /** InfoBanner that disappears at a certain point in time */
4
4
  export declare const EphemeralInfoBanner: ({ expireAtMs, ...props }: InfoBannerProps & {
5
5
  expireAtMs: number;
6
6
  }) => React.JSX.Element | null;
@@ -1,2 +1,6 @@
1
- import React, { type PropsWithChildren } from 'react';
2
- export declare const FunNoResults: ({ children }: PropsWithChildren) => React.JSX.Element;
1
+ import React from 'react';
2
+ interface FunNoResultsProps {
3
+ text: string;
4
+ }
5
+ export declare const FunNoResults: ({ text }: FunNoResultsProps) => React.JSX.Element;
6
+ export {};
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import { type BoxProps } from '../Box/Box';
3
- export declare function FunTxSummaryBox({ children, borderRadius, ...otherProps }: BoxProps): React.JSX.Element;
3
+ export declare function FunTxSummaryBox({ children, ...otherProps }: BoxProps): React.JSX.Element;
4
4
  export declare function FunTxSummaryLineItem({ children, ...otherProps }: BoxProps): React.JSX.Element;
5
5
  export declare function FunTxSummaryLineItemKeyText({ text }: {
6
6
  text: string;
7
7
  }): React.JSX.Element;
8
- export declare function FunTxSummaryDivider(): React.JSX.Element;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
3
+ import type { FunkitActiveCheckoutItem } from '~/providers/FunkitCheckoutContext';
4
+ import { type FunkitTextCustomizationsConfig, type FunkitUiCustomizationsConfig } from '~/providers/FunkitConfigContext';
5
+ interface PaymentAmountSummaryProps {
6
+ isLoading: boolean;
7
+ targetChainId: string;
8
+ checkoutItem: FunkitActiveCheckoutItem | null;
9
+ quote: FunkitCheckoutQuoteResult | null;
10
+ textCustomizations: FunkitTextCustomizationsConfig['confirmationScreen'];
11
+ uiCustomizations: FunkitUiCustomizationsConfig['confirmationScreen'];
12
+ }
13
+ export declare function PaymentAmountSummary({ isLoading, targetChainId, quote, checkoutItem, textCustomizations, uiCustomizations, }: PaymentAmountSummaryProps): React.JSX.Element;
14
+ export {};
@@ -1,24 +1,12 @@
1
+ import type { FunAddress } from '@funkit/api-base';
1
2
  import React from 'react';
2
- import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
3
- import { type PaymentMethodInfo } from '../../domains/paymentMethods';
4
- import type { FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
5
- import { type FunkitTextCustomizationsConfig, type FunkitUiCustomizationsConfig, type FunkitUiDestinationConfig } from '../../providers/FunkitConfigContext';
3
+ import type { PaymentMethodInfo } from '~/domains/paymentMethods';
6
4
  interface PaymentMethodSummaryProps {
7
5
  paymentMethodInfo: PaymentMethodInfo;
8
- walletAddress: string | undefined;
9
- customRecipient: string | undefined;
6
+ customRecipient: FunAddress | undefined;
10
7
  isLoading: boolean;
11
8
  estimatedTime: number;
12
- customDestinationConfig?: FunkitUiDestinationConfig;
9
+ showTimeEstimate?: boolean;
13
10
  }
14
- export declare function PaymentMethodSummary({ paymentMethodInfo, walletAddress, customRecipient, estimatedTime, isLoading, customDestinationConfig, }: PaymentMethodSummaryProps): React.JSX.Element;
15
- interface PaymentAmountSummaryProps {
16
- isLoading: boolean;
17
- targetChainId: string;
18
- checkoutItem: FunkitActiveCheckoutItem | null;
19
- quote: FunkitCheckoutQuoteResult | null;
20
- textCustomizations: FunkitTextCustomizationsConfig['confirmationScreen'];
21
- uiCustomizations: FunkitUiCustomizationsConfig['confirmationScreen'];
22
- }
23
- export declare function PaymentAmountSummary({ isLoading, targetChainId, quote, checkoutItem, textCustomizations, uiCustomizations, }: PaymentAmountSummaryProps): React.JSX.Element;
11
+ export declare function PaymentMethodSummary({ paymentMethodInfo, customRecipient, estimatedTime, isLoading, showTimeEstimate, }: PaymentMethodSummaryProps): React.JSX.Element;
24
12
  export {};
@@ -0,0 +1,12 @@
1
+ import type { FunAddress } from '@funkit/api-base';
2
+ import React, { type ReactNode } from 'react';
3
+ import { type PaymentMethodInfo } from '~/domains/paymentMethods';
4
+ type PaymentRouteSummaryProps = {
5
+ paymentMethodInfo: PaymentMethodInfo | null;
6
+ customRecipient: FunAddress | undefined;
7
+ sourceRedirect?: ReactNode;
8
+ destinationRedirect?: ReactNode;
9
+ };
10
+ export declare const PaymentRouteSummary: ({ paymentMethodInfo, customRecipient, sourceRedirect, destinationRedirect, }: PaymentRouteSummaryProps) => React.JSX.Element;
11
+ export declare const PaymentRouteSummarySkeletonLoader: () => React.JSX.Element;
12
+ export {};
@@ -1,4 +1,5 @@
1
1
  export declare const SpinnerIconClassName: string;
2
+ export declare const SlowRotation: string;
2
3
  export declare const SpinnerIconWithBackgroundOuterClassName: string;
3
4
  export declare const SpinnerIconWithBackgroundInnerClassName: string;
4
5
  export declare const SpinnerIconPathClassName: string;
@@ -1,10 +1,14 @@
1
1
  export declare enum CheckoutInitStepMessage {
2
2
  CONFIRMING = 0,
3
- PREPARING_DATA = 1
3
+ PREPARING_DATA = 1,
4
+ WAITING_FOR_SIGNATURE = 2,
5
+ WAITING_FOR_CONFIRMATION = 3
4
6
  }
5
7
  export declare const CHECKOUT_STEP_MESSAGE: {
6
8
  1: string;
7
9
  0: string;
10
+ 2: string;
11
+ 3: string;
8
12
  };
9
13
  export declare enum Web3AccountBalanceMessage {
10
14
  SIGN_TX = 0,
@@ -1,3 +1,4 @@
1
1
  export declare function isDydxCustomer(apiKey: string): apiKey is "NJq0CGrsE19xBbP1vHyBOp8xJvzYo9kayJHqDFP5";
2
2
  export declare function isPolymarketCustomer(apiKey: string): apiKey is "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6";
3
3
  export declare function isVertexCustomer(apiKey: string): apiKey is "OQXhzzkLHE2vHAK8nZBS76el5utuw3527RmnYn26";
4
+ export declare function isOstiumCustomer(apiKey: string): apiKey is "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN";
@@ -2,5 +2,5 @@ import { type ThemeVars } from './sprinkles.css';
2
2
  export declare function cssObjectFromTheme(theme: ThemeVars | (() => ThemeVars), { extends: baseTheme }?: {
3
3
  extends?: ThemeVars | (() => ThemeVars);
4
4
  }): {
5
- [x: string]: string;
5
+ [cssVarName: string]: string;
6
6
  };