@funkit/connect 4.1.6 → 5.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/{chunk-TKJVOYWW.js → chunk-2LVAEHB2.js} +19 -5
  3. package/dist/{chunk-QCYFMAKN.js → chunk-7RFJFAFX.js} +5 -1
  4. package/dist/{chunk-C7BDNBKV.js → chunk-ZQ7UHAVV.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/CopyAddress/OldCopyAddressButton.d.ts +5 -0
  8. package/dist/components/Dialog/Dialog.css.d.ts +6 -0
  9. package/dist/components/Dialog/Dialog.d.ts +1 -1
  10. package/dist/components/Dialog/DialogContent.css.d.ts +2 -0
  11. package/dist/components/Dropdown/BaseDropdown.d.ts +1 -1
  12. package/dist/components/Dropdown/BaseDropdownItem.css.d.ts +2 -0
  13. package/dist/components/Dropdown/BaseDropdownItem.d.ts +2 -1
  14. package/dist/components/Dropdown/ChainDropdown.d.ts +3 -1
  15. package/dist/components/Dropdown/TokenDropdown.d.ts +3 -2
  16. package/dist/components/FunAlert/FunAlert.d.ts +2 -1
  17. package/dist/components/FunAsset/FunAssetBadge.d.ts +8 -1
  18. package/dist/components/FunAsset/FunAssetItem.d.ts +3 -1
  19. package/dist/components/FunButton/FunButton.d.ts +2 -1
  20. package/dist/components/FunTransactionSummary/FunTxSummaryComponents.d.ts +1 -1
  21. package/dist/components/FunTransactionSummary/PaymentMethodSummary.d.ts +3 -3
  22. package/dist/consts/customers.d.ts +1 -0
  23. package/dist/css/sprinkles.css.d.ts +41 -23
  24. package/dist/domains/asset.d.ts +10 -1
  25. package/dist/domains/checkoutState.d.ts +3 -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 +1911 -1635
  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/state.d.ts +4 -2
  34. package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +1 -1
  35. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryContent.d.ts +2 -1
  36. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.d.ts +2 -1
  37. package/dist/modals/FunCheckoutHistoryModal/useCustomStatusAnimationAboveTopbar.d.ts +26 -0
  38. package/dist/providers/FunkitCheckoutContext.d.ts +28 -5
  39. package/dist/providers/FunkitConfigContext.d.ts +5 -5
  40. package/dist/providers/FunkitThemeProvider.d.ts +27 -0
  41. package/dist/providers/ModalSizeContext.d.ts +1 -0
  42. package/dist/themes/baseTheme.d.ts +2 -1
  43. package/dist/themes/baseTheme.js +1 -1
  44. package/dist/themes/darkTheme.js +2 -2
  45. package/dist/themes/lightTheme.js +2 -2
  46. package/dist/utils/assets.d.ts +1 -16
  47. package/dist/utils/checkout.d.ts +7 -2
  48. package/dist/utils/consts.d.ts +1 -0
  49. package/dist/utils/flags/config.d.ts +9 -15
  50. package/dist/wallets/walletConnectors/chunk-25VW5TZP.js +92 -0
  51. package/dist/wallets/walletConnectors/chunk-3NC26XLM.js +92 -0
  52. package/dist/wallets/walletConnectors/chunk-3U3BMEH5.js +94 -0
  53. package/dist/wallets/walletConnectors/chunk-4UM4GTKZ.js +103 -0
  54. package/dist/wallets/walletConnectors/chunk-545L7Y4M.js +69 -0
  55. package/dist/wallets/walletConnectors/chunk-6LPM6LUQ.js +110 -0
  56. package/dist/wallets/walletConnectors/chunk-7GSNBOD3.js +99 -0
  57. package/dist/wallets/walletConnectors/chunk-ETTNDQQG.js +100 -0
  58. package/dist/wallets/walletConnectors/chunk-FRGSRLTS.js +93 -0
  59. package/dist/wallets/walletConnectors/chunk-HKV7EMYZ.js +96 -0
  60. package/dist/wallets/walletConnectors/chunk-IPOC2VJX.js +106 -0
  61. package/dist/wallets/walletConnectors/chunk-JXP2QPW7.js +95 -0
  62. package/dist/wallets/walletConnectors/chunk-KFFJPS5R.js +96 -0
  63. package/dist/wallets/walletConnectors/chunk-LEXSM5KI.js +87 -0
  64. package/dist/wallets/walletConnectors/chunk-MOOBCMMB.js +70 -0
  65. package/dist/wallets/walletConnectors/chunk-N2NIIUW6.js +146 -0
  66. package/dist/wallets/walletConnectors/chunk-W5O4YSZN.js +98 -0
  67. package/dist/wallets/walletConnectors/chunk-XYBEMO3C.js +66 -0
  68. package/dist/wallets/walletConnectors/index.js +54 -54
  69. package/package.json +5 -5
  70. package/dist/Arc-VPZRUJGC.js +0 -7
  71. package/dist/Brave-CNIOSZJS.js +0 -7
  72. package/dist/Browser-3D4QDCGS.js +0 -7
  73. package/dist/Chrome-CBNGC2ZN.js +0 -7
  74. package/dist/Edge-6CGHSI4D.js +0 -7
  75. package/dist/Firefox-XTYBPISX.js +0 -7
  76. package/dist/Linux-X65XN6MG.js +0 -7
  77. package/dist/Macos-5QL4JBJE.js +0 -7
  78. package/dist/Opera-PAFQG2LC.js +0 -7
  79. package/dist/Safari-MV3S3IGE.js +0 -7
  80. 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 {};
@@ -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): 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
+ };
@@ -11,9 +11,20 @@ export interface FunkitCheckoutActionParams {
11
11
  functionArgs: unknown[];
12
12
  value?: bigint;
13
13
  }
14
- export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'generateActionsParams' | 'customRecipient' | 'modalTitle' | 'iconSrc' | 'modalTitleMeta' | 'checkoutItemAmount' | 'externalCheckoutUserId'> {
14
+ export interface DynamicTargetAssetCandidate {
15
+ tokenAddress: Address;
16
+ tokenChainId: string;
17
+ iconSrc: string;
18
+ tokenSymbol: string;
19
+ isDefault?: boolean;
20
+ badgeText?: string;
21
+ }
22
+ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'generateActionsParams' | 'customRecipient' | 'modalTitle' | 'iconSrc' | 'modalTitleMeta' | 'externalCheckoutUserId'> {
15
23
  /** List of contract action params **/
16
- generateActionsParams?: (targetAssetAmount: number) => FunkitCheckoutActionParams[];
24
+ generateActionsParams?: (targetAssetAmount: number, config?: {
25
+ targetAsset: Address;
26
+ targetChain: string;
27
+ }) => FunkitCheckoutActionParams[];
17
28
  /** 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
29
  customRecipient?: FunAddress;
19
30
  /** ****************************************
@@ -27,13 +38,15 @@ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'gen
27
38
  iconSrc?: null | string;
28
39
  /** Title of the item being checked out. e.g. Staked Ether, XYZ Option, Solar Bond ABC **/
29
40
  checkoutItemTitle: string;
30
- /** The quantity of the item being checked out. If not specified (0, null, undefined), it will default to blank. **/
41
+ /** @deprecated use targetAssetAmount **/
31
42
  checkoutItemAmount?: number;
32
43
  /** *****************************
33
44
  * Miscellaneous configurations *
34
45
  ********************************/
35
46
  /** User identification within customer's app for logging and customer dashboard purposes (future). **/
36
47
  externalCheckoutUserId?: string;
48
+ /** a list of candidate assets to be chosen dynamically */
49
+ dynamicTargetAssetCandidates?: DynamicTargetAssetCandidate[];
37
50
  }
38
51
  interface FunkitCheckoutValidationResult {
39
52
  isValid: boolean;
@@ -93,6 +106,12 @@ interface FunkitCheckoutContextInterface {
93
106
  initNewCheckout(initSettings: UseFunkitCheckoutPropsWithFullConfig): string;
94
107
  updateSourceAsset(selectedSource: Omit<AssetHoldingsItem, 'amount' | 'usdAmount' | 'chainSymbolKey'>): void;
95
108
  updateTargetAssetAmount(newTargetAssetAmount: number): void;
109
+ updateTargetAsset(asset: {
110
+ targetAsset: Address;
111
+ targetChain: string;
112
+ targetAssetTicker: string;
113
+ iconSrc: string | undefined;
114
+ }): void;
96
115
  updateSelectedPaymentMethodInfo(newPaymentMethodInfo: PaymentMethodInfo): void;
97
116
  confirmCheckout(shouldBatchOpBypassInit: boolean, quote: FunkitCheckoutQuoteResult, stepMessageSetter: (m: string) => void): Promise<Address>;
98
117
  cancelCheckout(depositAddress: Address): Promise<boolean>;
@@ -108,9 +127,13 @@ export declare function useCheckoutContext(): FunkitCheckoutContextInterface;
108
127
  * External hook for user to kickstart a checkout in their app
109
128
  */
110
129
  export declare function useFunkitCheckout(props: UseFunkitCheckoutPropsWithFullConfig): {
111
- beginCheckout: (config?: Partial<FunkitCheckoutConfig>) => Promise<void>;
130
+ beginCheckout: (config?: Partial<FunkitCheckoutConfig>) => Promise<{
131
+ isActivated: boolean;
132
+ }>;
112
133
  };
113
134
  export declare function useFunkitCheckout(props: UseFunkitCheckoutProps): {
114
- beginCheckout: (config: FunkitCheckoutConfig) => Promise<void>;
135
+ beginCheckout: (config: FunkitCheckoutConfig) => Promise<{
136
+ isActivated: boolean;
137
+ }>;
115
138
  };
116
139
  export {};
@@ -11,11 +11,11 @@ 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
19
  }
20
20
  export interface FunkitUiCustomizationsConfig {
21
21
  confirmationScreen?: {
@@ -23,8 +23,8 @@ export interface FunkitUiCustomizationsConfig {
23
23
  showTokenAmount?: boolean;
24
24
  /** Whether to show the total payment amount in USD below the token amount equivalent. Defaults to false */
25
25
  showPaymentAmountUsd?: boolean;
26
- /** Configure UI when `customRecipient` is specified in the config */
27
- customRecipientConfig?: FunkitUiCustomRecipientConfig;
26
+ /** Custom destination icon and text used in checkout summary */
27
+ destinationConfig?: FunkitUiDestinationConfig;
28
28
  };
29
29
  inputAmountScreen?: {
30
30
  /** 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>;
@@ -14,12 +14,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-2LVAEHB2.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-ZQ7UHAVV.js";
5
+ import "../chunk-2LVAEHB2.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-7RFJFAFX.js";
5
+ import "../chunk-2LVAEHB2.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
  };
@@ -0,0 +1,92 @@
1
+ "use client";
2
+ import {
3
+ getInjectedConnector,
4
+ hasInjectedProvider
5
+ } from "./chunk-WRA2DVJ7.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-23WIEY36.js";
9
+
10
+ // src/wallets/walletConnectors/roninWallet/roninWallet.ts
11
+ var roninWallet = ({
12
+ projectId,
13
+ walletConnectParameters
14
+ }) => {
15
+ const isRoninInjected = hasInjectedProvider({
16
+ namespace: "ronin.provider"
17
+ });
18
+ return {
19
+ id: "ronin",
20
+ name: "Ronin Wallet",
21
+ iconUrl: async () => (await import("./roninWallet-SAB5ESVK.js")).default,
22
+ iconBackground: "#ffffff",
23
+ rdns: "com.roninchain.wallet",
24
+ installed: isRoninInjected || void 0,
25
+ downloadUrls: {
26
+ android: "https://play.google.com/store/apps/details?id=com.skymavis.genesis",
27
+ ios: "https://apps.apple.com/us/app/ronin-wallet/id1592675001",
28
+ mobile: "https://wallet.roninchain.com",
29
+ chrome: "https://chrome.google.com/webstore/detail/ronin-wallet/fnjhmkhhmkbjkkabndcnnogagogbneec",
30
+ edge: "https://microsoftedge.microsoft.com/addons/detail/ronin-wallet/kjmoohlgokccodicjjfebfomlbljgfhk",
31
+ firefox: "https://addons.mozilla.org/firefox/addon/ronin-wallet",
32
+ browserExtension: "https://wallet.roninchain.com/",
33
+ qrCode: "https://wallet.roninchain.com/"
34
+ },
35
+ mobile: {
36
+ getUri: (uri) => `roninwallet://wc?uri=${encodeURIComponent(uri)}`
37
+ },
38
+ qrCode: {
39
+ getUri: (uri) => uri,
40
+ instructions: {
41
+ learnMoreUrl: "https://wallet.roninchain.com/",
42
+ steps: [
43
+ {
44
+ description: "wallet_connectors.ronin.qr_code.step1.description",
45
+ step: "install",
46
+ title: "wallet_connectors.ronin.qr_code.step1.title"
47
+ },
48
+ {
49
+ description: "wallet_connectors.ronin.qr_code.step2.description",
50
+ step: "create",
51
+ title: "wallet_connectors.ronin.qr_code.step2.title"
52
+ },
53
+ {
54
+ description: "wallet_connectors.ronin.qr_code.step3.description",
55
+ step: "scan",
56
+ title: "wallet_connectors.ronin.qr_code.step3.title"
57
+ }
58
+ ]
59
+ }
60
+ },
61
+ extension: {
62
+ instructions: {
63
+ learnMoreUrl: "https://wallet.roninchain.com/",
64
+ steps: [
65
+ {
66
+ description: "wallet_connectors.ronin.extension.step1.description",
67
+ step: "install",
68
+ title: "wallet_connectors.ronin.extension.step1.title"
69
+ },
70
+ {
71
+ description: "wallet_connectors.ronin.extension.step2.description",
72
+ step: "create",
73
+ title: "wallet_connectors.ronin.extension.step2.title"
74
+ },
75
+ {
76
+ description: "wallet_connectors.ronin.extension.step3.description",
77
+ step: "refresh",
78
+ title: "wallet_connectors.ronin.extension.step3.title"
79
+ }
80
+ ]
81
+ }
82
+ },
83
+ createConnector: isRoninInjected ? getInjectedConnector({ namespace: "ronin.provider" }) : getWalletConnectConnector({
84
+ projectId,
85
+ walletConnectParameters
86
+ })
87
+ };
88
+ };
89
+
90
+ export {
91
+ roninWallet
92
+ };
@@ -0,0 +1,92 @@
1
+ "use client";
2
+ import {
3
+ getInjectedConnector,
4
+ hasInjectedProvider
5
+ } from "./chunk-WRA2DVJ7.js";
6
+ import {
7
+ getWalletConnectConnector
8
+ } from "./chunk-23WIEY36.js";
9
+
10
+ // src/wallets/walletConnectors/gateWallet/gateWallet.ts
11
+ import { isAndroid } from "@funkit/utils";
12
+ var gateWallet = ({
13
+ projectId,
14
+ walletConnectParameters
15
+ }) => {
16
+ const isGateInjected = hasInjectedProvider({ namespace: "gatewallet" });
17
+ const shouldUseWalletConnect = !isGateInjected;
18
+ return {
19
+ id: "gate",
20
+ name: "Gate Wallet",
21
+ rdns: "io.gate.wallet",
22
+ iconUrl: async () => (await import("./gateWallet-CJNGQQCV.js")).default,
23
+ iconAccent: "#fff",
24
+ iconBackground: "#fff",
25
+ downloadUrls: {
26
+ android: "https://play.google.com/store/apps/details?id=com.gateio.gateio",
27
+ ios: "https://apps.apple.com/us/app/gate-io-buy-bitcoin-crypto/id1294998195",
28
+ mobile: "https://www.gate.io/mobileapp",
29
+ qrCode: "https://www.gate.io/web3",
30
+ chrome: "https://chromewebstore.google.com/detail/gate-wallet/cpmkedoipcpimgecpmgpldfpohjplkpp",
31
+ browserExtension: "https://www.gate.io/web3"
32
+ },
33
+ mobile: {
34
+ getUri: shouldUseWalletConnect ? (uri) => {
35
+ return isAndroid() ? uri : `gtweb3wallet://wc?uri=${encodeURIComponent(uri)}`;
36
+ } : void 0
37
+ },
38
+ qrCode: shouldUseWalletConnect ? {
39
+ getUri: (uri) => uri,
40
+ instructions: {
41
+ learnMoreUrl: "https://www.gate.io/learn",
42
+ steps: [
43
+ {
44
+ description: "wallet_connectors.gate.qr_code.step1.description",
45
+ step: "install",
46
+ title: "wallet_connectors.gate.qr_code.step1.title"
47
+ },
48
+ {
49
+ description: "wallet_connectors.gate.qr_code.step2.description",
50
+ step: "create",
51
+ title: "wallet_connectors.gate.qr_code.step2.title"
52
+ },
53
+ {
54
+ description: "wallet_connectors.gate.qr_code.step3.description",
55
+ step: "scan",
56
+ title: "wallet_connectors.gate.qr_code.step3.title"
57
+ }
58
+ ]
59
+ }
60
+ } : void 0,
61
+ extension: {
62
+ instructions: {
63
+ learnMoreUrl: "https://www.gate.io/learn",
64
+ steps: [
65
+ {
66
+ description: "wallet_connectors.gate.extension.step1.description",
67
+ step: "install",
68
+ title: "wallet_connectors.gate.extension.step1.title"
69
+ },
70
+ {
71
+ description: "wallet_connectors.gate.extension.step2.description",
72
+ step: "create",
73
+ title: "wallet_connectors.gate.extension.step2.title"
74
+ },
75
+ {
76
+ description: "wallet_connectors.gate.extension.step3.description",
77
+ step: "refresh",
78
+ title: "wallet_connectors.gate.extension.step3.title"
79
+ }
80
+ ]
81
+ }
82
+ },
83
+ createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
84
+ projectId,
85
+ walletConnectParameters
86
+ }) : getInjectedConnector({ namespace: "gatewallet" })
87
+ };
88
+ };
89
+
90
+ export {
91
+ gateWallet
92
+ };