@funkit/connect 4.1.7 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/dist/{chunk-TKJVOYWW.js → chunk-2T4ZDGAO.js} +22 -5
  3. package/dist/{chunk-C7BDNBKV.js → chunk-A6B6WSM2.js} +5 -1
  4. package/dist/{chunk-QCYFMAKN.js → chunk-HAGQWE2B.js} +5 -1
  5. package/dist/components/Box/Box.d.ts +23 -23
  6. package/dist/components/CopyAddress/CopyInputDisplayedAddress.d.ts +2 -1
  7. package/dist/components/Dialog/Dialog.css.d.ts +6 -0
  8. package/dist/components/Dialog/Dialog.d.ts +1 -1
  9. package/dist/components/Dialog/DialogContent.css.d.ts +2 -0
  10. package/dist/components/Dropdown/BaseDropdown.d.ts +1 -1
  11. package/dist/components/Dropdown/BaseDropdownItem.css.d.ts +2 -0
  12. package/dist/components/Dropdown/BaseDropdownItem.d.ts +2 -1
  13. package/dist/components/Dropdown/ChainDropdown.d.ts +3 -1
  14. package/dist/components/Dropdown/TokenDropdown.d.ts +3 -2
  15. package/dist/components/FunAlert/FunAlert.d.ts +2 -1
  16. package/dist/components/FunAsset/FunAssetBadge.d.ts +8 -1
  17. package/dist/components/FunAsset/FunAssetItem.d.ts +3 -1
  18. package/dist/components/FunButton/FunButton.d.ts +2 -1
  19. package/dist/components/FunTransactionSummary/FunTxSummaryComponents.d.ts +1 -1
  20. package/dist/components/FunTransactionSummary/PaymentMethodSummary.d.ts +3 -3
  21. package/dist/consts/customers.d.ts +1 -0
  22. package/dist/css/sprinkles.css.d.ts +41 -23
  23. package/dist/domains/asset.d.ts +10 -1
  24. package/dist/domains/checkoutState.d.ts +3 -2
  25. package/dist/domains/clientMetadata.d.ts +2 -2
  26. package/dist/domains/wallet.d.ts +10 -0
  27. package/dist/hooks/useCheckoutItemDisplay.d.ts +8 -0
  28. package/dist/index.css +2095 -1852
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.js +1958 -1735
  31. package/dist/modals/CheckoutModal/ConfirmationStep/DisclaimerText.d.ts +5 -1
  32. package/dist/modals/CheckoutModal/ConfirmationStep/usePostCheckout.d.ts +1 -0
  33. package/dist/modals/CheckoutModal/InputAmount/InputAmountLoaded.d.ts +1 -0
  34. package/dist/modals/CheckoutModal/InputAmount/state.d.ts +4 -2
  35. package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +1 -1
  36. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryContent.d.ts +2 -1
  37. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.d.ts +2 -1
  38. package/dist/modals/FunCheckoutHistoryModal/useCustomStatusAnimationAboveTopbar.d.ts +26 -0
  39. package/dist/providers/FunkitCheckoutContext.d.ts +34 -13
  40. package/dist/providers/FunkitConfigContext.d.ts +7 -5
  41. package/dist/providers/FunkitThemeProvider.d.ts +27 -0
  42. package/dist/providers/ModalSizeContext.d.ts +1 -0
  43. package/dist/themes/baseTheme.d.ts +3 -2
  44. package/dist/themes/baseTheme.js +1 -1
  45. package/dist/themes/darkTheme.js +2 -2
  46. package/dist/themes/lightTheme.js +2 -2
  47. package/dist/utils/assets.d.ts +1 -16
  48. package/dist/utils/checkout.d.ts +7 -2
  49. package/dist/utils/consts.d.ts +1 -0
  50. package/dist/utils/flags/config.d.ts +9 -15
  51. package/dist/wallets/walletConnectors/index.js +46 -46
  52. package/package.json +5 -5
  53. package/dist/Arc-VPZRUJGC.js +0 -7
  54. package/dist/Brave-CNIOSZJS.js +0 -7
  55. package/dist/Browser-3D4QDCGS.js +0 -7
  56. package/dist/Chrome-CBNGC2ZN.js +0 -7
  57. package/dist/Edge-6CGHSI4D.js +0 -7
  58. package/dist/Firefox-XTYBPISX.js +0 -7
  59. package/dist/Linux-X65XN6MG.js +0 -7
  60. package/dist/Macos-5QL4JBJE.js +0 -7
  61. package/dist/Opera-PAFQG2LC.js +0 -7
  62. package/dist/Safari-MV3S3IGE.js +0 -7
  63. package/dist/Windows-F4SQNFRR.js +0 -7
@@ -1,7 +1,11 @@
1
1
  import React from 'react';
2
+ import type { FunkitActiveCheckoutItem } from '~/providers/FunkitCheckoutContext';
2
3
  interface DisclaimerTextProps {
3
4
  showDydxDisclaimer: boolean;
5
+ checkoutItem: FunkitActiveCheckoutItem | null;
4
6
  continueText: string;
7
+ isCardPayment?: boolean;
8
+ finalConvertedAssetName?: string;
5
9
  }
6
- export declare const DisclaimerText: ({ showDydxDisclaimer, continueText, }: DisclaimerTextProps) => React.JSX.Element;
10
+ export declare const DisclaimerText: ({ showDydxDisclaimer, continueText, isCardPayment, finalConvertedAssetName, checkoutItem, }: DisclaimerTextProps) => React.JSX.Element;
7
11
  export {};
@@ -24,5 +24,6 @@ interface UsePostCheckoutResult {
24
24
  postCheckoutError: PostCheckoutError | null;
25
25
  postCheckoutStepMessage: string | null;
26
26
  }
27
+ export declare function isUserRejectedError(error: unknown): boolean;
27
28
  export declare function usePostCheckout({ onSuccess, }: UsePostCheckoutOptions): UsePostCheckoutResult;
28
29
  export {};
@@ -5,6 +5,7 @@ import type { FunCheckoutStep, ModalStepComponentProps } from '../stepTransition
5
5
  interface InputAmountLoadedProps extends ModalStepComponentProps<FunCheckoutStep.INPUT_AMOUNT> {
6
6
  sourceHolding: AssetHoldingsItem | null;
7
7
  checkoutConfig: FunkitCheckoutConfig;
8
+ /** unit price of target asset */
8
9
  unitPrice: number;
9
10
  isCardCheckout: boolean;
10
11
  }
@@ -1,5 +1,5 @@
1
1
  import type { PaymentMethod } from '~/domains/paymentMethods';
2
- import { type AssetHoldingsItem } from '~/utils/assets';
2
+ import type { AssetHoldingsItem } from '~/utils/assets';
3
3
  import type { FunkitCheckoutConfig } from '../../../providers/FunkitCheckoutContext';
4
4
  export interface AmountInputInitOptions {
5
5
  checkoutConfig: FunkitCheckoutConfig;
@@ -9,6 +9,8 @@ export interface AmountInputInitOptions {
9
9
  unitPrice: number;
10
10
  /** Maximum checkout amount, in USD */
11
11
  maxUsd: number;
12
+ /** Minimum checkout amount, in USD */
13
+ minUsd?: number;
12
14
  }
13
15
  export interface AmountInputState {
14
16
  /** Current amount, in target asset */
@@ -69,6 +71,6 @@ export type AmountInputError = {
69
71
  /** Input is empty */
70
72
  type: 'noInput';
71
73
  };
72
- export declare function initializeState(init: AmountInputInitOptions): AmountInputState;
74
+ export declare function initializeState({ checkoutConfig, maxUsd, minUsd, paymentMethod, sourceHolding, unitPrice, }: AmountInputInitOptions): AmountInputState;
73
75
  export declare function reduceState(state: AmountInputState, action: AmountInputAction): AmountInputState;
74
76
  export declare function getDerivedState(state: AmountInputState): AmountInputDerivedState;
@@ -4,4 +4,4 @@ export declare const USD_DECIMALS = 2;
4
4
  export declare const USD_INITIAL_AMOUNT = 100;
5
5
  export declare const USD_PREFIX = "$";
6
6
  export declare function getUsdMaxAmount(paymentMethod: PaymentMethod, maxUsd: number): number | null;
7
- export declare function getUsdMinAmount(paymentMethod: PaymentMethod): number;
7
+ export declare function getUsdMinAmount(paymentMethod: PaymentMethod, minUsd?: number | undefined): number;
@@ -3,11 +3,12 @@ import { HistoryContentPages } from '../../utils/checkoutHistory';
3
3
  interface FunCheckoutHistoryContentProps {
4
4
  depositAddress: `0x${string}`;
5
5
  currentPage: HistoryContentPages;
6
+ hideStatus?: boolean;
6
7
  onHelp: () => void;
7
8
  onBackFromHelpPage: () => void;
8
9
  onClose: () => void;
9
10
  }
10
11
  export declare const HISTORY_BOTTOM_BAR_ID = "history-bottom-section";
11
12
  export declare const DEFAULT_CHECKOUT_HISTORY_DETAIL_TITLE = "Your Purchase";
12
- export declare function FunCheckoutHistoryContent({ depositAddress, currentPage, onHelp, onBackFromHelpPage, onClose, }: FunCheckoutHistoryContentProps): React.JSX.Element;
13
+ export declare function FunCheckoutHistoryContent({ depositAddress, currentPage, hideStatus, onHelp, onBackFromHelpPage, onClose, }: FunCheckoutHistoryContentProps): React.JSX.Element;
13
14
  export {};
@@ -2,11 +2,12 @@ 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;
5
6
  onHelp: () => void;
6
7
  onClose: () => void;
7
8
  }
8
9
  /**
9
10
  * Processing info about a checkout history item (already created in backend)
10
11
  */
11
- export declare function FunCheckoutHistoryDetail({ checkoutHistoryInfo, onHelp, onClose, }: FunCheckoutHistoryDetailProps): React.JSX.Element;
12
+ export declare function FunCheckoutHistoryDetail({ checkoutHistoryInfo, hideStatus, onHelp, onClose, }: FunCheckoutHistoryDetailProps): React.JSX.Element;
12
13
  export {};
@@ -0,0 +1,26 @@
1
+ import React, { type ReactNode, type RefCallback } from 'react';
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, }: {
8
+ depositAddress: Address | undefined;
9
+ /** Whether status icon is currently shown */
10
+ isCheckoutDetailView: boolean;
11
+ /** Top padding of the scrolling container (required to set the correct position) */
12
+ paddingTop: number;
13
+ /** Modal topbar */
14
+ topbar: ReactNode;
15
+ /** Whether to show the topbar divider when _not_ in checkout detail view */
16
+ withTopDivider: 'always' | 'never' | 'scroll' | undefined;
17
+ }): {
18
+ /** To be passed to scrolling container, to sync the scroll position */
19
+ onScroll: React.UIEventHandler<HTMLElement>;
20
+ /** To be passed to scrolling container, to initialize the scroll position */
21
+ ref: RefCallback<HTMLElement>;
22
+ /** Modal topbar, to which a modulated-opacity background was added */
23
+ topbar: ReactNode;
24
+ /** Whether to show the topbar divider */
25
+ withTopDivider: 'always' | 'never' | 'scroll' | undefined;
26
+ };
@@ -1,19 +1,25 @@
1
- import { type ApiCheckoutClientMetadata, type ApiFunkitCheckoutConfig, type FunAddress } from '@funkit/api-base';
1
+ import { type ApiCheckoutClientMetadata, type ApiFunkitCheckoutActionParams, type ApiFunkitCheckoutConfig, type FunAddress } from '@funkit/api-base';
2
2
  import React, { type ReactNode } from 'react';
3
- import { type Abi, type Address } from 'viem';
3
+ import { type Address } from 'viem';
4
4
  import type { AssetHoldingsItem } from '~/utils/assets';
5
5
  import type { PaymentMethodInfo } from '../domains/paymentMethods';
6
6
  import { type FunkitCheckoutQuoteResult } from './FunkitHistoryContext';
7
- export interface FunkitCheckoutActionParams {
8
- contractAbi: Abi;
9
- contractAddress: Address;
10
- functionName: string;
11
- functionArgs: unknown[];
12
- value?: bigint;
7
+ export type FunkitCheckoutActionParams = ApiFunkitCheckoutActionParams;
8
+ export interface DynamicTargetAssetCandidate {
9
+ tokenAddress: Address;
10
+ tokenChainId: string;
11
+ iconSrc: string;
12
+ tokenSymbol: string;
13
+ isDefault?: boolean;
14
+ badgeText?: string;
15
+ targetAssetMinAmount?: number;
13
16
  }
14
- export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'generateActionsParams' | 'customRecipient' | 'modalTitle' | 'iconSrc' | 'modalTitleMeta' | 'checkoutItemAmount' | 'externalCheckoutUserId'> {
17
+ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'generateActionsParams' | 'customRecipient' | 'modalTitle' | 'iconSrc' | 'modalTitleMeta' | 'externalCheckoutUserId'> {
15
18
  /** List of contract action params **/
16
- generateActionsParams?: (targetAssetAmount: number) => FunkitCheckoutActionParams[];
19
+ generateActionsParams?: (targetAssetAmount: number, config?: {
20
+ targetAsset: Address;
21
+ targetChain: string;
22
+ }) => FunkitCheckoutActionParams[];
17
23
  /** Custom recipient address of the checkout. If specified, a different checkout flow will be executed. It is not recommended to set this unless the Fun.xyz team advises it. **/
18
24
  customRecipient?: FunAddress;
19
25
  /** ****************************************
@@ -27,13 +33,17 @@ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'gen
27
33
  iconSrc?: null | string;
28
34
  /** Title of the item being checked out. e.g. Staked Ether, XYZ Option, Solar Bond ABC **/
29
35
  checkoutItemTitle: string;
30
- /** The quantity of the item being checked out. If not specified (0, null, undefined), it will default to blank. **/
36
+ /** @deprecated use targetAssetAmount **/
31
37
  checkoutItemAmount?: number;
32
38
  /** *****************************
33
39
  * Miscellaneous configurations *
34
40
  ********************************/
35
41
  /** User identification within customer's app for logging and customer dashboard purposes (future). **/
36
42
  externalCheckoutUserId?: string;
43
+ /** a list of candidate assets to be chosen dynamically */
44
+ dynamicTargetAssetCandidates?: DynamicTargetAssetCandidate[];
45
+ /** minimal toAmount needed to proceed checkout. Checked after quote */
46
+ targetAssetMinAmount?: number;
37
47
  }
38
48
  interface FunkitCheckoutValidationResult {
39
49
  isValid: boolean;
@@ -93,6 +103,13 @@ interface FunkitCheckoutContextInterface {
93
103
  initNewCheckout(initSettings: UseFunkitCheckoutPropsWithFullConfig): string;
94
104
  updateSourceAsset(selectedSource: Omit<AssetHoldingsItem, 'amount' | 'usdAmount' | 'chainSymbolKey'>): void;
95
105
  updateTargetAssetAmount(newTargetAssetAmount: number): void;
106
+ updateTargetAsset(asset: {
107
+ targetAsset: Address;
108
+ targetChain: string;
109
+ targetAssetTicker: string;
110
+ targetAssetMinAmount: number | undefined;
111
+ iconSrc: string | undefined;
112
+ }): void;
96
113
  updateSelectedPaymentMethodInfo(newPaymentMethodInfo: PaymentMethodInfo): void;
97
114
  confirmCheckout(shouldBatchOpBypassInit: boolean, quote: FunkitCheckoutQuoteResult, stepMessageSetter: (m: string) => void): Promise<Address>;
98
115
  cancelCheckout(depositAddress: Address): Promise<boolean>;
@@ -108,9 +125,13 @@ export declare function useCheckoutContext(): FunkitCheckoutContextInterface;
108
125
  * External hook for user to kickstart a checkout in their app
109
126
  */
110
127
  export declare function useFunkitCheckout(props: UseFunkitCheckoutPropsWithFullConfig): {
111
- beginCheckout: (config?: Partial<FunkitCheckoutConfig>) => Promise<void>;
128
+ beginCheckout: (config?: Partial<FunkitCheckoutConfig>) => Promise<{
129
+ isActivated: boolean;
130
+ }>;
112
131
  };
113
132
  export declare function useFunkitCheckout(props: UseFunkitCheckoutProps): {
114
- beginCheckout: (config: FunkitCheckoutConfig) => Promise<void>;
133
+ beginCheckout: (config: FunkitCheckoutConfig) => Promise<{
134
+ isActivated: boolean;
135
+ }>;
115
136
  };
116
137
  export {};
@@ -11,11 +11,13 @@ export interface FunkitTextCustomizationsConfig {
11
11
  receiveAmountLabel: string;
12
12
  };
13
13
  }
14
- export interface FunkitUiCustomRecipientConfig {
14
+ export interface FunkitUiDestinationConfig {
15
15
  /** What icon (15x15) to show in the `destination` row - defaults to user wallet icon */
16
- destinationIcon?: ReactNode;
16
+ icon?: ReactNode;
17
17
  /** What text to show in the `destination` row - defaults to formatted destination wallet address */
18
- destinationText?: string;
18
+ text?: string;
19
+ /** Which url to redirect to. If not specified, defaults to the block explorer of the recipientAddr of the checkout*/
20
+ url?: string;
19
21
  }
20
22
  export interface FunkitUiCustomizationsConfig {
21
23
  confirmationScreen?: {
@@ -23,8 +25,8 @@ export interface FunkitUiCustomizationsConfig {
23
25
  showTokenAmount?: boolean;
24
26
  /** Whether to show the total payment amount in USD below the token amount equivalent. Defaults to false */
25
27
  showPaymentAmountUsd?: boolean;
26
- /** Configure UI when `customRecipient` is specified in the config */
27
- customRecipientConfig?: FunkitUiCustomRecipientConfig;
28
+ /** Custom destination icon and text used in checkout summary */
29
+ destinationConfig?: FunkitUiDestinationConfig;
28
30
  };
29
31
  inputAmountScreen?: {
30
32
  /** Whether to allow entering an amount of tokens, rather than only USD - defaults to true */
@@ -83,6 +83,9 @@ export declare const useActiveTheme: () => {
83
83
  buttonIconBackgroundHover: string;
84
84
  buttonIconBackgroundPressed: string;
85
85
  buttonIconStroke: string;
86
+ badgeBackgroundSuccess: string;
87
+ badgeBorderSuccess: string;
88
+ badgeTextSuccess: string;
86
89
  };
87
90
  fonts: {
88
91
  body: string;
@@ -123,6 +126,10 @@ export declare const useActiveTheme: () => {
123
126
  fontSize: string;
124
127
  lineHeight: string;
125
128
  };
129
+ '21': {
130
+ fontSize: string;
131
+ lineHeight: string;
132
+ };
126
133
  '40': {
127
134
  fontSize: string;
128
135
  lineHeight: string;
@@ -138,6 +145,8 @@ export declare const useActiveTheme: () => {
138
145
  menuButton: string;
139
146
  modal: string;
140
147
  modalMobile: string;
148
+ modalActionButton: string;
149
+ modalActionButtonMobile: string;
141
150
  };
142
151
  shadows: {
143
152
  connectButton: string;
@@ -216,6 +225,9 @@ export declare const useActiveTheme: () => {
216
225
  buttonIconBackgroundHover: string;
217
226
  buttonIconBackgroundPressed: string;
218
227
  buttonIconStroke: string;
228
+ badgeBackgroundSuccess: string;
229
+ badgeBorderSuccess: string;
230
+ badgeTextSuccess: string;
219
231
  };
220
232
  fonts: {
221
233
  body: string;
@@ -256,6 +268,10 @@ export declare const useActiveTheme: () => {
256
268
  fontSize: string;
257
269
  lineHeight: string;
258
270
  };
271
+ '21': {
272
+ fontSize: string;
273
+ lineHeight: string;
274
+ };
259
275
  '40': {
260
276
  fontSize: string;
261
277
  lineHeight: string;
@@ -271,6 +287,8 @@ export declare const useActiveTheme: () => {
271
287
  menuButton: string;
272
288
  modal: string;
273
289
  modalMobile: string;
290
+ modalActionButton: string;
291
+ modalActionButtonMobile: string;
274
292
  };
275
293
  shadows: {
276
294
  connectButton: string;
@@ -347,6 +365,9 @@ export declare const useActiveTheme: () => {
347
365
  buttonIconBackgroundHover: string;
348
366
  buttonIconBackgroundPressed: string;
349
367
  buttonIconStroke: string;
368
+ badgeBackgroundSuccess: string;
369
+ badgeBorderSuccess: string;
370
+ badgeTextSuccess: string;
350
371
  };
351
372
  fonts: {
352
373
  body: string;
@@ -387,6 +408,10 @@ export declare const useActiveTheme: () => {
387
408
  fontSize: string;
388
409
  lineHeight: string;
389
410
  };
411
+ '21': {
412
+ fontSize: string;
413
+ lineHeight: string;
414
+ };
390
415
  '40': {
391
416
  fontSize: string;
392
417
  lineHeight: string;
@@ -402,6 +427,8 @@ export declare const useActiveTheme: () => {
402
427
  menuButton: string;
403
428
  modal: string;
404
429
  modalMobile: string;
430
+ modalActionButton: string;
431
+ modalActionButtonMobile: string;
405
432
  };
406
433
  shadows: {
407
434
  connectButton: string;
@@ -2,6 +2,7 @@ import React, { type ReactNode } from 'react';
2
2
  export declare const ModalSizeOptions: {
3
3
  readonly COMPACT: "compact";
4
4
  readonly WIDE: "wide";
5
+ readonly MEDIUM: "medium";
5
6
  };
6
7
  export type ModalSizes = (typeof ModalSizeOptions)[keyof typeof ModalSizeOptions];
7
8
  export declare const ModalSizeContext: React.Context<ModalSizes>;
@@ -8,18 +8,19 @@ declare const fontStacks: {
8
8
  };
9
9
  type FontStack = keyof typeof fontStacks;
10
10
  type RadiusScale = 'large' | 'medium' | 'small' | 'none';
11
- type Blurs = 'small' | 'large' | 'none';
11
+ type Blurs = 'tiny' | 'small' | 'large' | 'none';
12
12
  type FontSizeType = 'regular' | 'small';
13
13
  interface BaseThemeOptions {
14
14
  customFontWeights?: Partial<ThemeVars['fontWeight']>;
15
15
  customFontFamily?: string;
16
16
  customFontSizings?: Partial<ThemeVars['fontSize']>;
17
+ customBorderRadiuses?: Partial<ThemeVars['radii']>;
17
18
  fontSizing?: FontSizeType;
18
19
  borderRadius?: RadiusScale;
19
20
  fontStack?: FontStack;
20
21
  overlayBlur?: Blurs;
21
22
  }
22
- export declare const baseTheme: ({ borderRadius, fontStack, fontSizing, customFontFamily, customFontWeights, customFontSizings, overlayBlur, }: BaseThemeOptions) => Pick<ThemeVars, "radii" | "fonts" | "fontWeight" | "fontSize" | "blurs">;
23
+ export declare const baseTheme: ({ borderRadius, fontStack, fontSizing, customFontFamily, customFontWeights, customFontSizings, customBorderRadiuses, overlayBlur, }: BaseThemeOptions) => Pick<ThemeVars, "radii" | "fonts" | "fontWeight" | "fontSize" | "blurs">;
23
24
  export interface AccentColor {
24
25
  accentColor: string;
25
26
  accentColorForeground: string;
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  baseTheme,
4
4
  systemFontStack
5
- } from "../chunk-TKJVOYWW.js";
5
+ } from "../chunk-2T4ZDGAO.js";
6
6
  export {
7
7
  baseTheme,
8
8
  systemFontStack
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  darkTheme
4
- } from "../chunk-C7BDNBKV.js";
5
- import "../chunk-TKJVOYWW.js";
4
+ } from "../chunk-A6B6WSM2.js";
5
+ import "../chunk-2T4ZDGAO.js";
6
6
  export {
7
7
  darkTheme
8
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  lightTheme
4
- } from "../chunk-QCYFMAKN.js";
5
- import "../chunk-TKJVOYWW.js";
4
+ } from "../chunk-HAGQWE2B.js";
5
+ import "../chunk-2T4ZDGAO.js";
6
6
  export {
7
7
  lightTheme
8
8
  };
@@ -1,22 +1,7 @@
1
- import type { KnownAssetHoldingsItem } from '~/domains/wallet';
2
- import { LoginType } from '~/providers/GeneralWalletProvider';
3
- import { PaymentMethod } from '../domains/paymentMethods';
4
- import type { FunkitActiveCheckoutItem, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
5
- import type { FlagValues } from '../providers/FunkitFlagsProvider';
1
+ import type { FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
6
2
  export type { AssetHoldingsItem, AssetHoldingsMap, KnownAssetHoldingsItem, } from '~/domains/wallet';
7
3
  export declare const ASSETS_LOW_VALUE_THRESHOLD = 0.1;
8
4
  export declare const getNormalizedTokenBalance: (tokenBalance: bigint | number | string, decimals: number) => number;
9
- export declare function getUsdAvailableAmount(targetChainId: string, assetChainId: string | undefined, assetUsdAmount: number | null | undefined, paymentMethod: PaymentMethod | undefined): number | null;
10
- export declare const isAssetUsableToPayForCheckout: (flags: FlagValues, checkoutItem: FunkitActiveCheckoutItem, paymentMethod: PaymentMethod, assetChainId: string, assetTokenAddress: string, assetUsdAmount: number | null, loginType: LoginType, isAllowedForCheckout: boolean) => {
11
- isUsable: boolean;
12
- reason: string;
13
- };
14
- export declare const L2_COST_MARGIN_MULTIPLIER = 1.2;
15
- type RecommendedAsset = {
16
- chainSymbolKey: string;
17
- label: string | null;
18
- };
19
- export declare const getRecommendedAsset: (checkoutItem: FunkitActiveCheckoutItem, accountHoldings: KnownAssetHoldingsItem[]) => RecommendedAsset | null;
20
5
  /**
21
6
  *
22
7
  * @param {FunkitCheckoutConfig} checkoutConfig
@@ -87,12 +87,17 @@ export declare function formatTokenAmountForMoonpay(amount: number, mpCurrencyCo
87
87
  export declare function getTimeFromNowSeconds(startTimeMs: number, durationMs: number): number;
88
88
  /**
89
89
  * Given a checkout config, returns the display string for the checkout item.
90
- * Arbitary action checkouts: Display the checkoutItemAmount if it is greater than 0, otherwise display the checkoutItemTitle.
90
+ * Arbitrary action checkouts: Display the targetAssetAmount
91
+ * - not 100% accurate since userOp will consume some tokens, but FINE now.
91
92
  * - e.g. "2.1234 aArbUSDCn" or "Staked VRTX"
92
93
  * Basic buy checkouts: Display the targetAssetAmount with the targetAssetTicker.
93
94
  * - e.g. "0.12345 ETH"
95
+ * Ideally, should be used via the hook `useCheckoutItemDisplay` to handle the customer cutomization check.
94
96
  */
95
- export declare function getCheckoutItemDisplay(checkoutConfig: FunkitCheckoutConfig | ServerCheckoutConfig, hideAmount?: boolean): string;
97
+ export declare function getCheckoutItemDisplay({ checkoutConfig, hideAmount, }: {
98
+ checkoutConfig: FunkitCheckoutConfig | ServerCheckoutConfig;
99
+ hideAmount?: boolean;
100
+ }): string;
96
101
  /**
97
102
  * Given the result of a quote, estimate the maximum targetAssetAmount for which the checkout should succeed.
98
103
  * The result is then reduced by 1% to further reduce the risk of insufficient funds.
@@ -0,0 +1 @@
1
+ export declare const MIN_CHECKOUT_AMOUNT_USD = 1;
@@ -61,21 +61,7 @@ export declare const flagConfig: {
61
61
  };
62
62
  enable_token_transfer_universal_deposit_address: {
63
63
  type: "boolean";
64
- default_value: false;
65
- overrides: {
66
- if_any: ({
67
- key: "userId";
68
- pct: number;
69
- type: "pctRollout";
70
- values?: undefined;
71
- } | {
72
- key: "userId";
73
- type: "isAnyOf";
74
- values: string[];
75
- pct?: undefined;
76
- })[];
77
- value: true;
78
- }[];
64
+ default_value: true;
79
65
  };
80
66
  max_checkout_usd: {
81
67
  type: "string";
@@ -112,4 +98,12 @@ export declare const flagConfig: {
112
98
  value: string;
113
99
  }[];
114
100
  };
101
+ token_transfer_default_chain_id: {
102
+ type: "string";
103
+ default_value: string;
104
+ };
105
+ is_checkout_activated: {
106
+ type: "boolean";
107
+ default_value: true;
108
+ };
115
109
  };
@@ -1,49 +1,43 @@
1
1
  "use client";
2
- import {
3
- zerionWallet
4
- } from "./chunk-AXWP3GD4.js";
5
2
  import {
6
3
  zealWallet
7
4
  } from "./chunk-JROWU5BP.js";
8
5
  import {
9
- xdefiWallet
10
- } from "./chunk-NO7XMBB5.js";
6
+ uniswapWallet
7
+ } from "./chunk-LH7BMNFZ.js";
11
8
  import {
12
- tahoWallet
13
- } from "./chunk-6P2EMPZI.js";
9
+ zerionWallet
10
+ } from "./chunk-AXWP3GD4.js";
11
+ import {
12
+ safeheronWallet
13
+ } from "./chunk-R6RWZRFF.js";
14
14
  import {
15
15
  talismanWallet
16
16
  } from "./chunk-ABFSXBE6.js";
17
- import {
18
- tokenaryWallet
19
- } from "./chunk-SLOIIJGP.js";
20
17
  import {
21
18
  tokenPocketWallet
22
19
  } from "./chunk-IDKVN5CF.js";
23
20
  import {
24
- safepalWallet
25
- } from "./chunk-MSFKSQBY.js";
21
+ tokenaryWallet
22
+ } from "./chunk-SLOIIJGP.js";
26
23
  import {
27
24
  trustWallet
28
25
  } from "./chunk-ISIBREBO.js";
29
26
  import {
30
- uniswapWallet
31
- } from "./chunk-LH7BMNFZ.js";
27
+ rabbyWallet
28
+ } from "./chunk-BVX4XGNP.js";
32
29
  import {
33
30
  walletConnectWallet
34
31
  } from "./chunk-NP5QGWNL.js";
35
32
  import {
36
- phantomWallet
37
- } from "./chunk-ZSVTX6EK.js";
33
+ xdefiWallet
34
+ } from "./chunk-NO7XMBB5.js";
38
35
  import {
39
- rabbyWallet
40
- } from "./chunk-BVX4XGNP.js";
36
+ rainbowWallet
37
+ } from "./chunk-2UCNRD7H.js";
41
38
  import {
42
39
  ramperWallet
43
40
  } from "./chunk-PIUNLQJG.js";
44
- import {
45
- okxWallet
46
- } from "./chunk-4WEHDI4Y.js";
47
41
  import {
48
42
  roninWallet
49
43
  } from "./chunk-63YLN6R5.js";
@@ -51,17 +45,17 @@ import {
51
45
  safeWallet
52
46
  } from "./chunk-BQQQL6UD.js";
53
47
  import {
54
- safeheronWallet
55
- } from "./chunk-R6RWZRFF.js";
48
+ phantomWallet
49
+ } from "./chunk-ZSVTX6EK.js";
50
+ import {
51
+ safepalWallet
52
+ } from "./chunk-MSFKSQBY.js";
56
53
  import {
57
54
  subWallet
58
55
  } from "./chunk-AD2KIJB6.js";
59
56
  import {
60
- metaMaskWallet
61
- } from "./chunk-G73C6P5P.js";
62
- import {
63
- imTokenWallet
64
- } from "./chunk-COZ7MIQS.js";
57
+ tahoWallet
58
+ } from "./chunk-6P2EMPZI.js";
65
59
  import {
66
60
  mewWallet
67
61
  } from "./chunk-V57WLZEE.js";
@@ -69,50 +63,56 @@ import {
69
63
  oktoWallet
70
64
  } from "./chunk-ADIXAKUL.js";
71
65
  import {
72
- oneInchWallet
73
- } from "./chunk-OESTDX6I.js";
66
+ okxWallet
67
+ } from "./chunk-4WEHDI4Y.js";
74
68
  import {
75
69
  omniWallet
76
70
  } from "./chunk-7CUY5G6R.js";
71
+ import {
72
+ coin98Wallet
73
+ } from "./chunk-DTRYS3MO.js";
74
+ import {
75
+ metaMaskWallet
76
+ } from "./chunk-G73C6P5P.js";
77
77
  import {
78
78
  oneKeyWallet
79
79
  } from "./chunk-4AD7VI2P.js";
80
80
  import {
81
- rainbowWallet
82
- } from "./chunk-2UCNRD7H.js";
83
- import {
84
- frontierWallet
85
- } from "./chunk-3S2U24BJ.js";
81
+ oneInchWallet
82
+ } from "./chunk-OESTDX6I.js";
86
83
  import {
87
84
  frameWallet
88
85
  } from "./chunk-ZMYVTWDF.js";
86
+ import {
87
+ frontierWallet
88
+ } from "./chunk-3S2U24BJ.js";
89
89
  import {
90
90
  gateWallet
91
91
  } from "./chunk-GSOYKKIS.js";
92
+ import {
93
+ imTokenWallet
94
+ } from "./chunk-COZ7MIQS.js";
92
95
  import {
93
96
  injectedWallet
94
97
  } from "./chunk-VCVVV2K7.js";
95
- import {
96
- ledgerWallet
97
- } from "./chunk-BRBKM4PW.js";
98
98
  import {
99
99
  kresusWallet
100
100
  } from "./chunk-MJXPRJZT.js";
101
101
  import {
102
- coreWallet
103
- } from "./chunk-HBA36GW3.js";
102
+ ledgerWallet
103
+ } from "./chunk-BRBKM4PW.js";
104
104
  import {
105
105
  bybitWallet
106
106
  } from "./chunk-6ONTSPEY.js";
107
107
  import {
108
108
  clvWallet
109
109
  } from "./chunk-KR6JBW5E.js";
110
- import {
111
- coin98Wallet
112
- } from "./chunk-DTRYS3MO.js";
113
110
  import {
114
111
  coinbaseWallet
115
112
  } from "./chunk-H4IRCEZN.js";
113
+ import {
114
+ coreWallet
115
+ } from "./chunk-HBA36GW3.js";
116
116
  import {
117
117
  dawnWallet
118
118
  } from "./chunk-LN7OD5EC.js";
@@ -131,12 +131,12 @@ import {
131
131
  import {
132
132
  bifrostWallet
133
133
  } from "./chunk-W6N74MS3.js";
134
- import {
135
- bitgetWallet
136
- } from "./chunk-A5APNTGL.js";
137
134
  import {
138
135
  bitskiWallet
139
136
  } from "./chunk-P74YPRF6.js";
137
+ import {
138
+ bitgetWallet
139
+ } from "./chunk-A5APNTGL.js";
140
140
  import {
141
141
  bitverseWallet
142
142
  } from "./chunk-3HZRRP4Y.js";