@funkit/connect 3.2.1 → 3.4.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 (140) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +0 -3
  3. package/dist/{chunk-76VEFMWE.js → chunk-77C753LI.js} +6 -2
  4. package/dist/{chunk-HFT6OV3T.js → chunk-BY224HGT.js} +1 -1
  5. package/dist/{chunk-EUSK63OY.js → chunk-XWW5QOD4.js} +6 -2
  6. package/dist/components/Box/Box.d.ts +44 -43
  7. package/dist/components/CopyAddress/CopyAddress.d.ts +7 -1
  8. package/dist/components/Dialog/Dialog.css.d.ts +2 -5
  9. package/dist/components/Dialog/Dialog.d.ts +2 -2
  10. package/dist/components/Dropdown/BaseActiveDropdownItem.d.ts +12 -0
  11. package/dist/components/Dropdown/BaseDropdown.d.ts +23 -0
  12. package/dist/components/Dropdown/BaseDropdownItem.d.ts +13 -0
  13. package/dist/components/Dropdown/ChainDropdown.d.ts +8 -0
  14. package/dist/components/Dropdown/TokenDropdown.d.ts +9 -0
  15. package/dist/components/FunAlert/FunAlert.d.ts +6 -3
  16. package/dist/components/FunBottomBar/FunBottomBar.d.ts +2 -1
  17. package/dist/components/FunButton/FunIconButton.d.ts +4 -1
  18. package/dist/components/FunButton/FunSignInButton.d.ts +8 -0
  19. package/dist/components/FunCheckoutBlocked/FunCheckoutBlocked.d.ts +6 -1
  20. package/dist/components/FunConnectOptions/FunConnectOptions.d.ts +5 -2
  21. package/dist/components/FunConnectOptions/FunConnectResultStep.d.ts +1 -3
  22. package/dist/components/FunConnectOptions/FunSignInStep.d.ts +2 -1
  23. package/dist/components/FunConnectOptions/FunWeb3ConnectingStep.d.ts +1 -1
  24. package/dist/components/FunCountdown/FunCountdown.css.d.ts +2 -0
  25. package/dist/components/FunCountdown/FunCountdown.d.ts +2 -1
  26. package/dist/components/FunDivider/FunDivider.d.ts +2 -2
  27. package/dist/components/FunNotification/FunNotification.d.ts +1 -1
  28. package/dist/components/FunPayments/FunPaymentMethods.d.ts +22 -10
  29. package/dist/components/FunTransactionSummary/FunTxSummaryComponents.d.ts +4 -5
  30. package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +6 -0
  31. package/dist/components/Icons/BrokerageIcon.d.ts +4 -0
  32. package/dist/components/Icons/CopyDoublePaperSheetIcon.d.ts +5 -0
  33. package/dist/components/Icons/CopyDoubleRoundedSquareIcon.d.ts +5 -0
  34. package/dist/components/Icons/CreditCardIcon.d.ts +4 -0
  35. package/dist/components/Icons/EvmWallet.d.ts +3 -1
  36. package/dist/components/Icons/Gas.d.ts +4 -0
  37. package/dist/components/Icons/LightningBoltIcon.d.ts +4 -0
  38. package/dist/components/Icons/SocialMediaIcons.d.ts +12 -4
  39. package/dist/components/QRCode/QRCode.d.ts +8 -1
  40. package/dist/consts/assets.d.ts +1 -0
  41. package/dist/consts/funkit.d.ts +5 -1
  42. package/dist/css/sprinkles.css.d.ts +53 -45
  43. package/dist/domains/checkoutFees.d.ts +40 -0
  44. package/dist/domains/clientMetadata.d.ts +37 -0
  45. package/dist/{consts/payment.d.ts → domains/paymentMethods.d.ts} +5 -8
  46. package/dist/domains/quote.d.ts +16 -0
  47. package/dist/hooks/useCheckoutAccountBalanceTransfer.d.ts +1 -1
  48. package/dist/hooks/useCheckoutQuoteNotification.d.ts +1 -1
  49. package/dist/hooks/useCheckoutStateBooleans.d.ts +5 -1
  50. package/dist/hooks/useCheckoutTransferDepositAddress.d.ts +3 -0
  51. package/dist/hooks/useCheckoutType.d.ts +3 -3
  52. package/dist/hooks/useIsCheckoutRisky.d.ts +2 -0
  53. package/dist/hooks/useMesh.d.ts +4 -4
  54. package/dist/hooks/usePaymentMethodIcon.d.ts +22 -0
  55. package/dist/hooks/useUsableWalletAssetsForCheckout.d.ts +3 -2
  56. package/dist/index.css +2413 -2098
  57. package/dist/index.d.ts +1 -1
  58. package/dist/index.js +12541 -11733
  59. package/dist/modals/CheckoutModal/CheckoutPrimaryInfo.d.ts +1 -12
  60. package/dist/modals/CheckoutModal/ConfirmationStep.d.ts +2 -2
  61. package/dist/modals/CheckoutModal/ConnectExchange.d.ts +1 -1
  62. package/dist/modals/CheckoutModal/FunCheckoutModal.d.ts +1 -2
  63. package/dist/modals/CheckoutModal/InputAmount/InputAmountLayout.d.ts +11 -0
  64. package/dist/modals/CheckoutModal/InputAmount/InputAmountLoaded.d.ts +10 -0
  65. package/dist/modals/CheckoutModal/InputAmount/InputAmountLoading.d.ts +7 -0
  66. package/dist/modals/CheckoutModal/InputAmount/state.d.ts +73 -0
  67. package/dist/modals/CheckoutModal/InputAmount/useAmountInput.d.ts +9 -0
  68. package/dist/modals/CheckoutModal/InputAmount/useCheckoutQuote.d.ts +17 -0
  69. package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +23 -0
  70. package/dist/modals/CheckoutModal/InputAmount.d.ts +2 -2
  71. package/dist/modals/CheckoutModal/LoadingAccount.d.ts +1 -1
  72. package/dist/modals/CheckoutModal/MeshVerification.d.ts +1 -1
  73. package/dist/modals/CheckoutModal/SelectAsset.d.ts +1 -1
  74. package/dist/modals/CheckoutModal/SelectBrokerage.d.ts +2 -2
  75. package/dist/modals/CheckoutModal/SelectPaymentMethod.d.ts +5 -2
  76. package/dist/modals/CheckoutModal/SourceChange.d.ts +1 -1
  77. package/dist/modals/CheckoutModal/TransferToken.d.ts +18 -0
  78. package/dist/modals/CheckoutModal/stepTransition.d.ts +9 -9
  79. package/dist/modals/CheckoutModal/useAccountBalancePostCheckout.d.ts +1 -2
  80. package/dist/modals/CheckoutModal/useAvailableBalanceForCheckout.d.ts +2 -2
  81. package/dist/modals/CheckoutModal/useSourceAssetConfirm.d.ts +2 -7
  82. package/dist/modals/CheckoutModal/useUpdateSourceAssetForCard.d.ts +1 -1
  83. package/dist/modals/ConnectModal/ConnectModal.d.ts +3 -1
  84. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryContent.d.ts +3 -2
  85. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.d.ts +8 -6
  86. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryTransaction.css.d.ts +0 -1
  87. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryTransaction.d.ts +5 -2
  88. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutStatus.css.d.ts +2 -0
  89. package/dist/modals/FunCheckoutHistoryModal/FunCheckoutStatus.d.ts +2 -1
  90. package/dist/providers/FunkitCheckoutContext.d.ts +36 -43
  91. package/dist/providers/FunkitConfigContext.d.ts +13 -0
  92. package/dist/providers/FunkitFlagsProvider.d.ts +2 -2
  93. package/dist/providers/FunkitMoonpayProvider.d.ts +1 -1
  94. package/dist/providers/FunkitThemeProvider.d.ts +20 -4
  95. package/dist/providers/GeneralWalletProvider.d.ts +12 -13
  96. package/dist/providers/ModalContext.d.ts +1 -1
  97. package/dist/providers/useAccountBalancePaymentDefaultInfo.d.ts +4 -0
  98. package/dist/themes/baseTheme.js +1 -1
  99. package/dist/themes/darkTheme.d.ts +5 -1
  100. package/dist/themes/darkTheme.js +2 -2
  101. package/dist/themes/lightTheme.d.ts +5 -1
  102. package/dist/themes/lightTheme.js +2 -2
  103. package/dist/utils/assets.d.ts +1 -1
  104. package/dist/utils/checkout.d.ts +24 -5
  105. package/dist/utils/deposit.d.ts +10 -2
  106. package/dist/utils/flags/config.d.ts +11 -8
  107. package/dist/utils/formatNumber.d.ts +1 -0
  108. package/dist/utils/formatTimestamp.d.ts +8 -8
  109. package/dist/utils/payment.d.ts +1 -1
  110. package/dist/wallets/walletConnectors/index.js +44 -44
  111. package/package.json +4 -4
  112. package/dist/components/FunCallToAction/FunCallToAction.d.ts +0 -10
  113. package/dist/components/FunContainer/FunContainer.d.ts +0 -9
  114. package/dist/components/FunToast/FunShortToast.css.d.ts +0 -10
  115. package/dist/components/FunToast/FunShortToast.d.ts +0 -3
  116. package/dist/components/FunToast/FunToast.d.ts +0 -18
  117. package/dist/components/FunTransactionSummary/FunTransactionSummary.d.ts +0 -14
  118. package/dist/components/Icons/CopyDoubleIcon.d.ts +0 -2
  119. package/dist/components/Icons/PaymentMethodIcons.d.ts +0 -30
  120. package/dist/consts/checkoutFees.d.ts +0 -27
  121. package/dist/modals/CheckoutModal/TransferSetup.d.ts +0 -14
  122. package/dist/providers/FunToastProvider.d.ts +0 -11
  123. package/dist/wallets/walletConnectors/chunk-25VW5TZP.js +0 -92
  124. package/dist/wallets/walletConnectors/chunk-4HKPVECK.js +0 -95
  125. package/dist/wallets/walletConnectors/chunk-4K3EKHXR.js +0 -71
  126. package/dist/wallets/walletConnectors/chunk-57UUMOOZ.js +0 -95
  127. package/dist/wallets/walletConnectors/chunk-5MVCKMZT.js +0 -94
  128. package/dist/wallets/walletConnectors/chunk-5NZLWT3Y.js +0 -73
  129. package/dist/wallets/walletConnectors/chunk-B5D7DYVV.js +0 -101
  130. package/dist/wallets/walletConnectors/chunk-HCKLWBE5.js +0 -98
  131. package/dist/wallets/walletConnectors/chunk-HLH777AC.js +0 -108
  132. package/dist/wallets/walletConnectors/chunk-HMDUVRZP.js +0 -98
  133. package/dist/wallets/walletConnectors/chunk-IR3YKU2N.js +0 -103
  134. package/dist/wallets/walletConnectors/chunk-J2BF4L2V.js +0 -87
  135. package/dist/wallets/walletConnectors/chunk-KDGMYRMC.js +0 -102
  136. package/dist/wallets/walletConnectors/chunk-OKUX4BC4.js +0 -66
  137. package/dist/wallets/walletConnectors/chunk-VU6B3HMD.js +0 -96
  138. package/dist/wallets/walletConnectors/chunk-WAMHUVNP.js +0 -96
  139. package/dist/wallets/walletConnectors/chunk-YRK6XWL6.js +0 -149
  140. package/dist/wallets/walletConnectors/chunk-ZCKNEKQQ.js +0 -110
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { FunkitPrioritizedLoginType, FunkitSocialLoginMethod } from '../consts/funkit';
2
3
  export interface FunkitTextCustomizationsConfig {
3
4
  brokerageOrExchange: string;
@@ -5,11 +6,23 @@ export interface FunkitTextCustomizationsConfig {
5
6
  accountBalance: string;
6
7
  transferCrypto: string;
7
8
  selectAccount: string;
9
+ transferTokens: string;
10
+ confirmationScreen: {
11
+ receiveAmountLabel: string;
12
+ };
13
+ }
14
+ export interface FunkitUiCustomRecipientConfig {
15
+ /** What icon (15x15) to show in the `destination` row - defaults to user wallet icon */
16
+ destinationIcon?: ReactNode;
17
+ /** What text to show in the `destination` row - defaults to formatted destination wallet address */
18
+ destinationText?: string;
8
19
  }
9
20
  export interface FunkitUiCustomizationsConfig {
10
21
  confirmationScreen?: {
11
22
  /** Whether to show the amount of tokens below the USD equivalent - defaults to true */
12
23
  showTokenAmount?: boolean;
24
+ /** Configure UI when `customRecipient` is specified in the config */
25
+ customRecipientConfig?: FunkitUiCustomRecipientConfig;
13
26
  };
14
27
  inputAmountScreen?: {
15
28
  /** Whether to allow entering an amount of tokens, rather than only USD - defaults to true */
@@ -6,7 +6,7 @@ export type FlagValue<K extends FlagKey> = InferFlagType<(typeof offlineConfig)[
6
6
  export type FlagValues = {
7
7
  [K in FlagKey]?: FlagValue<K>;
8
8
  };
9
- export type GetFlagFunction = <K extends FlagKey>(flagKey: K, fallback: FlagValue<K>) => FlagValue<K>;
9
+ export type GetFlagFunction = <K extends FlagKey>(flagKey: K, fallback?: FlagValue<K>) => FlagValue<K>;
10
10
  export interface FunkitFlagsContextValue {
11
11
  /** Error fetching flag config from server */
12
12
  error: Error | null;
@@ -22,4 +22,4 @@ export declare function FunkitFlagsProvider({ children }: {
22
22
  children: ReactNode;
23
23
  }): React.JSX.Element;
24
24
  export declare function useFlags(): FunkitFlagsContextValue;
25
- export declare function useFlag<K extends FlagKey>(flagKey: K, fallback: FlagValue<K>): FlagValue<K>;
25
+ export declare function useFlag<K extends FlagKey>(flagKey: K, fallback?: FlagValue<K>): FlagValue<K>;
@@ -20,6 +20,6 @@ export interface UserIpInfoFromMoonpay {
20
20
  export declare const geoCheckInProgressProps: FunButtonProps;
21
21
  export declare function useFunkitUserIp(): {
22
22
  isLoadingGeoCheck: boolean;
23
- isUserBlockedForCheckout: boolean;
23
+ isUserGeoblocked: boolean;
24
24
  userIpInfo: UserIpInfoFromMoonpay | undefined;
25
25
  };
@@ -11,6 +11,8 @@ export declare const defaultTheme: {
11
11
  connectButtonTextError: string;
12
12
  connectionIndicator: string;
13
13
  error: string;
14
+ errorBackground: string;
15
+ errorBorder: string;
14
16
  generalBorder: string;
15
17
  generalBorderDim: string;
16
18
  menuItemBackground: string;
@@ -28,6 +30,9 @@ export declare const defaultTheme: {
28
30
  offBackground: string;
29
31
  hoverState: string;
30
32
  offBackgroundInverse: string;
33
+ lightStroke: string;
34
+ mediumStroke: string;
35
+ strokeColor: string;
31
36
  dydxSwitchActiveBackground: string;
32
37
  primaryText: string;
33
38
  secondaryText: string;
@@ -56,7 +61,6 @@ export declare const defaultTheme: {
56
61
  buttonBackground: string;
57
62
  buttonBackgroundHover: string;
58
63
  buttonBackgroundDisabled: string;
59
- buttonText: string;
60
64
  buttonStroke: string;
61
65
  buttonTextSecondaryDisabled: string;
62
66
  buttonTextSecondary: string;
@@ -163,6 +167,8 @@ export declare const useActiveTheme: () => {
163
167
  connectButtonTextError: string;
164
168
  connectionIndicator: string;
165
169
  error: string;
170
+ errorBackground: string;
171
+ errorBorder: string;
166
172
  generalBorder: string;
167
173
  generalBorderDim: string;
168
174
  menuItemBackground: string;
@@ -180,6 +186,9 @@ export declare const useActiveTheme: () => {
180
186
  offBackground: string;
181
187
  hoverState: string;
182
188
  offBackgroundInverse: string;
189
+ lightStroke: string;
190
+ mediumStroke: string;
191
+ strokeColor: string;
183
192
  dydxSwitchActiveBackground: string;
184
193
  primaryText: string;
185
194
  secondaryText: string;
@@ -208,7 +217,6 @@ export declare const useActiveTheme: () => {
208
217
  buttonBackground: string;
209
218
  buttonBackgroundHover: string;
210
219
  buttonBackgroundDisabled: string;
211
- buttonText: string;
212
220
  buttonStroke: string;
213
221
  buttonTextSecondaryDisabled: string;
214
222
  buttonTextSecondary: string;
@@ -303,6 +311,8 @@ export declare const useActiveTheme: () => {
303
311
  connectButtonTextError: string;
304
312
  connectionIndicator: string;
305
313
  error: string;
314
+ errorBackground: string;
315
+ errorBorder: string;
306
316
  generalBorder: string;
307
317
  generalBorderDim: string;
308
318
  menuItemBackground: string;
@@ -320,6 +330,9 @@ export declare const useActiveTheme: () => {
320
330
  offBackground: string;
321
331
  hoverState: string;
322
332
  offBackgroundInverse: string;
333
+ lightStroke: string;
334
+ mediumStroke: string;
335
+ strokeColor: string;
323
336
  dydxSwitchActiveBackground: string;
324
337
  primaryText: string;
325
338
  secondaryText: string;
@@ -348,7 +361,6 @@ export declare const useActiveTheme: () => {
348
361
  buttonBackground: string;
349
362
  buttonBackgroundHover: string;
350
363
  buttonBackgroundDisabled: string;
351
- buttonText: string;
352
364
  buttonStroke: string;
353
365
  buttonTextSecondaryDisabled: string;
354
366
  buttonTextSecondary: string;
@@ -442,6 +454,8 @@ export declare const useActiveTheme: () => {
442
454
  connectButtonTextError: string;
443
455
  connectionIndicator: string;
444
456
  error: string;
457
+ errorBackground: string;
458
+ errorBorder: string;
445
459
  generalBorder: string;
446
460
  generalBorderDim: string;
447
461
  menuItemBackground: string;
@@ -459,6 +473,9 @@ export declare const useActiveTheme: () => {
459
473
  offBackground: string;
460
474
  hoverState: string;
461
475
  offBackgroundInverse: string;
476
+ lightStroke: string;
477
+ mediumStroke: string;
478
+ strokeColor: string;
462
479
  dydxSwitchActiveBackground: string;
463
480
  primaryText: string;
464
481
  secondaryText: string;
@@ -487,7 +504,6 @@ export declare const useActiveTheme: () => {
487
504
  buttonBackground: string;
488
505
  buttonBackgroundHover: string;
489
506
  buttonBackgroundDisabled: string;
490
- buttonText: string;
491
507
  buttonStroke: string;
492
508
  buttonTextSecondaryDisabled: string;
493
509
  buttonTextSecondary: string;
@@ -1,15 +1,14 @@
1
1
  import { AssetBalanceInfo } from '@funkit/api-base';
2
2
  import { Auth, FunWallet } from '@funkit/core';
3
3
  import React from 'react';
4
+ import { Address } from 'viem';
4
5
  import { FunkitUserInfo } from '../consts/funkit';
5
- import { PaymentMethodAccountInfo } from '../consts/payment';
6
6
  export interface KnownAssetBalanceInfo extends AssetBalanceInfo {
7
7
  price: number;
8
8
  totalUsdValue: number;
9
9
  }
10
10
  interface GeneralWalletContextProps {
11
- walletAddress: string;
12
- accountBalancePaymentDefaultInfo: PaymentMethodAccountInfo | null;
11
+ walletAddress: Address | '';
13
12
  isUserLoggedIn: boolean;
14
13
  isWeb2Login: boolean;
15
14
  isWeb3Login: boolean;
@@ -25,7 +24,7 @@ export declare const useGeneralWallet: () => GeneralWalletContextProps;
25
24
  * Replacement for wagmi's `useAccount`
26
25
  */
27
26
  export declare const useFunkitAccount: () => {
28
- account: string;
27
+ account: "" | `0x${string}`;
29
28
  isConnected: boolean;
30
29
  isWeb2Login: boolean;
31
30
  isWeb3Login: boolean;
@@ -39,12 +38,12 @@ export declare const useFunkitAccount: () => {
39
38
  isDisconnected: true;
40
39
  status: "disconnected";
41
40
  } | {
42
- account: string;
41
+ account: "" | `0x${string}`;
43
42
  isConnected: boolean;
44
43
  isWeb2Login: boolean;
45
44
  isWeb3Login: boolean;
46
- address: import("viem").Address;
47
- addresses: readonly [import("viem").Address, ...import("viem").Address[]];
45
+ address: Address;
46
+ addresses: readonly [Address, ...Address[]];
48
47
  chain: import("viem").Chain | undefined;
49
48
  chainId: number;
50
49
  connector: import("wagmi").Connector;
@@ -53,12 +52,12 @@ export declare const useFunkitAccount: () => {
53
52
  isReconnecting: false;
54
53
  status: "connected";
55
54
  } | {
56
- account: string;
55
+ account: "" | `0x${string}`;
57
56
  isConnected: boolean;
58
57
  isWeb2Login: boolean;
59
58
  isWeb3Login: boolean;
60
- address: import("viem").Address | undefined;
61
- addresses: readonly import("viem").Address[] | undefined;
59
+ address: Address | undefined;
60
+ addresses: readonly Address[] | undefined;
62
61
  chain: import("viem").Chain | undefined;
63
62
  chainId: number | undefined;
64
63
  connector: import("wagmi").Connector | undefined;
@@ -67,12 +66,12 @@ export declare const useFunkitAccount: () => {
67
66
  isReconnecting: true;
68
67
  status: "reconnecting";
69
68
  } | {
70
- account: string;
69
+ account: "" | `0x${string}`;
71
70
  isConnected: boolean;
72
71
  isWeb2Login: boolean;
73
72
  isWeb3Login: boolean;
74
- address: import("viem").Address | undefined;
75
- addresses: readonly import("viem").Address[] | undefined;
73
+ address: Address | undefined;
74
+ addresses: readonly Address[] | undefined;
76
75
  chain: import("viem").Chain | undefined;
77
76
  chainId: number | undefined;
78
77
  connector: import("wagmi").Connector | undefined;
@@ -23,7 +23,7 @@ export declare function useWalletConnectOpenState(): {
23
23
  };
24
24
  export declare function useConnectModal(): {
25
25
  connectModalOpen: boolean;
26
- openConnectModal: (() => void) | undefined;
26
+ openConnectModal: ((walletsOnly?: boolean) => void) | undefined;
27
27
  };
28
28
  export declare function useFunCheckoutModal(): {
29
29
  funCheckoutModalOpen: boolean;
@@ -0,0 +1,4 @@
1
+ import { PaymentMethodAccountInfo } from '../domains/paymentMethods';
2
+ export declare function useAccountBalancePaymentDefaultInfo(): {
3
+ accountBalancePaymentDefaultInfo: PaymentMethodAccountInfo;
4
+ };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  baseTheme
4
- } from "../chunk-HFT6OV3T.js";
4
+ } from "../chunk-BY224HGT.js";
5
5
  export {
6
6
  baseTheme
7
7
  };
@@ -11,6 +11,8 @@ export declare const darkTheme: {
11
11
  connectButtonTextError: string;
12
12
  connectionIndicator: string;
13
13
  error: string;
14
+ errorBackground: string;
15
+ errorBorder: string;
14
16
  generalBorder: string;
15
17
  generalBorderDim: string;
16
18
  menuItemBackground: string;
@@ -28,6 +30,9 @@ export declare const darkTheme: {
28
30
  offBackground: string;
29
31
  hoverState: string;
30
32
  offBackgroundInverse: string;
33
+ lightStroke: string;
34
+ mediumStroke: string;
35
+ strokeColor: string;
31
36
  dydxSwitchActiveBackground: string;
32
37
  primaryText: string;
33
38
  secondaryText: string;
@@ -56,7 +61,6 @@ export declare const darkTheme: {
56
61
  buttonBackground: string;
57
62
  buttonBackgroundHover: string;
58
63
  buttonBackgroundDisabled: string;
59
- buttonText: string;
60
64
  buttonStroke: string;
61
65
  buttonTextSecondaryDisabled: string;
62
66
  buttonTextSecondary: string;
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  darkTheme
4
- } from "../chunk-EUSK63OY.js";
5
- import "../chunk-HFT6OV3T.js";
4
+ } from "../chunk-XWW5QOD4.js";
5
+ import "../chunk-BY224HGT.js";
6
6
  export {
7
7
  darkTheme
8
8
  };
@@ -11,6 +11,8 @@ export declare const lightTheme: {
11
11
  connectButtonTextError: string;
12
12
  connectionIndicator: string;
13
13
  error: string;
14
+ errorBackground: string;
15
+ errorBorder: string;
14
16
  generalBorder: string;
15
17
  generalBorderDim: string;
16
18
  menuItemBackground: string;
@@ -28,6 +30,9 @@ export declare const lightTheme: {
28
30
  offBackground: string;
29
31
  hoverState: string;
30
32
  offBackgroundInverse: string;
33
+ lightStroke: string;
34
+ mediumStroke: string;
35
+ strokeColor: string;
31
36
  dydxSwitchActiveBackground: string;
32
37
  primaryText: string;
33
38
  secondaryText: string;
@@ -56,7 +61,6 @@ export declare const lightTheme: {
56
61
  buttonBackground: string;
57
62
  buttonBackgroundHover: string;
58
63
  buttonBackgroundDisabled: string;
59
- buttonText: string;
60
64
  buttonStroke: string;
61
65
  buttonTextSecondaryDisabled: string;
62
66
  buttonTextSecondary: string;
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  lightTheme
4
- } from "../chunk-76VEFMWE.js";
5
- import "../chunk-HFT6OV3T.js";
4
+ } from "../chunk-77C753LI.js";
5
+ import "../chunk-BY224HGT.js";
6
6
  export {
7
7
  lightTheme
8
8
  };
@@ -1,4 +1,4 @@
1
- import { PaymentMethod } from '../consts/payment';
1
+ import { PaymentMethod } from '../domains/paymentMethods';
2
2
  import { FunkitActiveCheckoutItem, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
3
3
  import { FlagValues } from '../providers/FunkitFlagsProvider';
4
4
  export declare const getNormalizedTokenBalance: (tokenBalance: bigint | number, decimals: number) => number;
@@ -1,8 +1,8 @@
1
1
  import { CheckoutHistoryItem, CheckoutState } from '@funkit/api-base';
2
2
  import { Address, Hex } from 'viem';
3
3
  import { UseConfigReturnType } from 'wagmi';
4
- import { PaymentMethod } from '../consts/payment';
5
- import { FunkitActiveCheckoutItem, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
4
+ import { PaymentMethod } from '../domains/paymentMethods';
5
+ import { FunkitActiveCheckoutItem, FunkitCheckoutConfig, FunkitCheckoutQuoteResult, HistoricalCheckoutItem, ServerCheckoutConfig } from '../providers/FunkitCheckoutContext';
6
6
  export declare const MOONPAY_TIME_ESTIMATE_MS = 120000;
7
7
  export declare const MESH_TIME_ESTIMATE_MS = 300000;
8
8
  export declare const DUMMY_TRANSFER_PARAMS: {
@@ -18,10 +18,12 @@ export declare function validateCheckoutConfig(config: Partial<FunkitCheckoutCon
18
18
  isValid: boolean;
19
19
  message: string;
20
20
  };
21
- export declare const hasSufficientBalance: (wagmiConfig: UseConfigReturnType, walletAddress: string, tokenAddress: string, tokenChainId: string, tokenAddressAmount: number) => Promise<{
21
+ export declare const hasSufficientBalance: (wagmiConfig: UseConfigReturnType, walletAddress: string, tokenAddress: string, tokenChainId: string, requiredAssetAmount: number) => Promise<{
22
+ balance: number;
22
23
  result: boolean;
23
24
  tokenTicker: string;
24
25
  } | {
26
+ balance: number;
25
27
  result: boolean;
26
28
  tokenTicker: null;
27
29
  }>;
@@ -29,8 +31,13 @@ export declare const hasSufficientBalance: (wagmiConfig: UseConfigReturnType, wa
29
31
  * Checks whether user has sufficient targetAsset + targetAssetAmount in their wallet
30
32
  */
31
33
  export declare const testAutoExecutionDuringCheckout: (config: FunkitCheckoutConfig, walletAddress: string, wagmiConfig: UseConfigReturnType) => Promise<{
34
+ balance: number;
32
35
  result: boolean;
33
36
  tokenTicker: string;
37
+ } | {
38
+ balance: number;
39
+ result: boolean;
40
+ tokenTicker: null;
34
41
  } | {
35
42
  result: boolean;
36
43
  tokenTicker: null;
@@ -109,7 +116,7 @@ export declare function categorizeCheckoutHistories(checkoutHistoryList: Checkou
109
116
  export declare function getCheckoutStateStepNumber(state: CheckoutState): 0 | 1 | 3 | 2;
110
117
  export declare function formatTokenAmountForMoonpay(amount: number, mpCurrencyCode: string): string;
111
118
  export declare function hackTimeEstimationForImportantCustomer(originalTimeEstimation: number, paymentMethod: PaymentMethod, apiKey: string): any;
112
- export declare function getEstimateEndTimeInfo(createdTimeMs: number, checkoutItem: FunkitActiveCheckoutItem, apiKey: string): {
119
+ export declare function getEstimateEndTimeInfo(createdTimeMs: number, checkoutItem: FunkitActiveCheckoutItem | HistoricalCheckoutItem, apiKey: string): {
113
120
  estimatedEndTimeMs: number;
114
121
  estimatedEndTimeFromNowMs: number;
115
122
  isExceededEstimation: boolean;
@@ -121,4 +128,16 @@ export declare function getEstimateEndTimeInfo(createdTimeMs: number, checkoutIt
121
128
  * Basic buy checkouts: Display the targetAssetAmount with the targetAssetTicker.
122
129
  * - e.g. "0.12345 ETH"
123
130
  */
124
- export declare function getCheckoutItemDisplay(checkoutConfig: FunkitCheckoutConfig, hideAmount?: boolean): string;
131
+ export declare function getCheckoutItemDisplay(checkoutConfig: FunkitCheckoutConfig | ServerCheckoutConfig, hideAmount?: boolean): string;
132
+ /**
133
+ * Given the result of a quote, estimate the maximum targetAssetAmount for which the checkout should succeed.
134
+ * The result is then reduced by 1% to further reduce the risk of insufficient funds.
135
+ *
136
+ * NOTE: This assumes fees are (roughly) constant, at least when the target amount does not change much.
137
+ * Only the API could give us a true number here.
138
+ *
139
+ * @param sourceAssetBalance - Total source asset balance
140
+ * @param config - Checkout config
141
+ * @param quoteResult - Failed quote results
142
+ */
143
+ export declare function getMaxTargetAssetAmountEstimate(sourceAssetBalance: number, config: FunkitCheckoutConfig, quoteResult: FunkitCheckoutQuoteResult): number;
@@ -1,4 +1,12 @@
1
1
  export declare const MINIMUM_MOONPAY_DEPOSIT_AMOUNT_USD = 35;
2
2
  export declare const MAXIMUM_MOONPAY_DEPOSIT_AMOUNT_USD = 10000;
3
- export declare function isAmountInvalidForMoonpay(amountUsd: number): boolean;
4
- export declare function generateInsufficientAmountForMoonpayError(isShortened: boolean): string;
3
+ export declare function checkAmountForMoonpay(amountUsd: number): {
4
+ readonly isInvalid: true;
5
+ readonly message: "$35 minimum required for the selected payment method.";
6
+ } | {
7
+ readonly isInvalid: true;
8
+ readonly message: "$10000 maximum exceeded for the selected payment method.";
9
+ } | {
10
+ readonly isInvalid: false;
11
+ readonly message?: undefined;
12
+ };
@@ -1,4 +1,4 @@
1
- import type { BooleanFlagConfig, StringFlagConfig } from './types';
1
+ import { BooleanFlagConfig, StringFlagConfig } from './types';
2
2
  /**
3
3
  * Remember that these values show up in our logs
4
4
  * Make sure the enum values are unique
@@ -7,22 +7,25 @@ import type { BooleanFlagConfig, StringFlagConfig } from './types';
7
7
  export declare enum FlagKey {
8
8
  /** Whether mantle assets can be used as source asset for payment for any checkout */
9
9
  DisableMantleSourceAssets = "disable_mantle_source_assets",
10
- /** Whether zksync assets can be used as source asset for payment in a mantle checkout */
11
- DisableZkSyncSourceAssetsForMantleCheckouts = "disable_zksync_source_assets_for_mantle_checkouts",
12
- /** Whether zksync assets can be used as source asset for payment in a dydx checkout */
13
- DisableZkSyncSourceAssetsForDydxCheckouts = "disable_zksync_source_assets_for_dydx_checkouts",
10
+ /** Whether zksync assets can be used as source asset for payment for any checkout */
11
+ DisableZkSyncSourceAssets = "disable_zksync_source_assets",
14
12
  /** Which exchanges to show in the exchange selection screen */
15
13
  SupportedExchanges = "supported_exchanges",
16
14
  /** Which countries should be blocked for Funkit Checkout. Reference Alpha-2 Code format https://www.iban.com/country-codes. */
17
15
  BlockedCountries = "blocked_countries",
18
16
  /** Whether to show the [Powered by Fun.xyz] tagline at the bottom of the checkout modal. */
19
- ShowPoweredTagline = "show_powered_tagline"
17
+ ShowPoweredTagline = "show_powered_tagline",
18
+ /** Whether to enable Token Transfer as a payment method. */
19
+ EnableTokenTransfer = "enable_token_transfer",
20
+ /** Token Transfer payment method accepted source chain and assets */
21
+ TokenTransferSourceChainsAndAssets = "token_transfer_source_chains_and_assets"
20
22
  }
21
23
  export declare const flagConfig: {
22
24
  [FlagKey.DisableMantleSourceAssets]: BooleanFlagConfig;
23
- [FlagKey.DisableZkSyncSourceAssetsForMantleCheckouts]: BooleanFlagConfig;
24
- [FlagKey.DisableZkSyncSourceAssetsForDydxCheckouts]: BooleanFlagConfig;
25
+ [FlagKey.DisableZkSyncSourceAssets]: BooleanFlagConfig;
25
26
  [FlagKey.SupportedExchanges]: StringFlagConfig;
26
27
  [FlagKey.BlockedCountries]: StringFlagConfig;
27
28
  [FlagKey.ShowPoweredTagline]: BooleanFlagConfig;
29
+ [FlagKey.EnableTokenTransfer]: BooleanFlagConfig;
30
+ [FlagKey.TokenTransferSourceChainsAndAssets]: StringFlagConfig;
28
31
  };
@@ -36,6 +36,7 @@ export declare function formatCurrencyAndStringify(amount: number,
36
36
  options?: FormatNumberOptions,
37
37
  /** Options to pass toLocaleString */
38
38
  numberFormatOptions?: Intl.NumberFormatOptions): string;
39
+ export declare function formatPercent(percent: number, decimalPlaces?: number): string;
39
40
  /**
40
41
  * Formats a cryptocurrency amount as a string for display.
41
42
  *
@@ -11,14 +11,14 @@ interface FormatTimeOption extends FormatDateOption {
11
11
  export declare function formatTimestamp(date: Date, opt?: FormatTimeOption): string;
12
12
  /**
13
13
  * Formats seconds to mins and seconds string
14
- * - seconds = 10, output = '10s'
15
- * - seconds = 20.3, output = '21s'
16
- * - seconds = 20.3, specifyUnderMinute=true, output = '< 1min'
17
- * - seconds = 60, output = '1min'
18
- * - seconds = 61, output = '1min 1s'
19
- * - seconds = 300, output = '5mins'
20
- * - seconds = 320, output = '5mins 20s'
21
- * - seconds = 320, omitSeconds=true, output = '6mins'
14
+ * - seconds = 10, output = '10 s'
15
+ * - seconds = 20.3, output = '21 s'
16
+ * - seconds = 20.3, specifyUnderMinute=true, output = '< 1 min'
17
+ * - seconds = 60, output = '1 min'
18
+ * - seconds = 61, output = '1 min 1 s'
19
+ * - seconds = 300, output = '5 mins'
20
+ * - seconds = 320, output = '5 mins 20 s'
21
+ * - seconds = 320, omitSeconds=true, output = '6 mins'
22
22
  */
23
23
  export declare function formatSecondsToReadableForm(seconds: number, specifyUnderMinute?: boolean, omitSeconds?: boolean): string;
24
24
  export declare function formatSecondsToCountdownForm(seconds: number): string;
@@ -1,4 +1,4 @@
1
- import { PaymentMethodInfo } from '../consts/payment';
1
+ import { PaymentMethodInfo } from '../domains/paymentMethods';
2
2
  /**
3
3
  * Generate a string for backend to indicate the source of a checkout funds
4
4
  */