@funkit/connect 4.1.1 → 4.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/{chunk-2QK6Y7FR.js → chunk-C7BDNBKV.js} +1 -0
  3. package/dist/{chunk-JFHTYZ23.js → chunk-QCYFMAKN.js} +1 -0
  4. package/dist/components/Avatar/Avatar.d.ts +2 -1
  5. package/dist/components/Box/Box.d.ts +7 -7
  6. package/dist/components/CopyAddress/CopyAddressButton.d.ts +5 -0
  7. package/dist/components/CopyAddress/CopyDisplayedAddress.d.ts +5 -0
  8. package/dist/components/CopyAddress/CopyInputDisplayedAddress.d.ts +5 -0
  9. package/dist/components/CopyAddress/LabelledCopyAddressButton.d.ts +6 -0
  10. package/dist/components/Dropdown/BaseDropdown.css.d.ts +5 -0
  11. package/dist/components/Dropdown/BaseDropdown.d.ts +7 -1
  12. package/dist/components/FunButton/FunButton.css.d.ts +3 -3
  13. package/dist/components/FunButton/FunLinkButton.d.ts +9 -4
  14. package/dist/components/FunInput/FunInput.css.d.ts +1 -0
  15. package/dist/components/FunInput/FunInput.d.ts +0 -1
  16. package/dist/components/FunNotification/FunNotification.css.d.ts +2 -0
  17. package/dist/components/FunNotification/FunNotification.d.ts +0 -1
  18. package/dist/components/FunPaymentMethodItem/FunPaymentMethodItem.css.d.ts +1 -0
  19. package/dist/components/FunPaymentMethodItem/FunPaymentMethodItem.d.ts +6 -2
  20. package/dist/components/FunPayments/FunPaymentMethods.d.ts +2 -3
  21. package/dist/components/FunTooltip/FunTooltip.css.d.ts +4 -0
  22. package/dist/components/FunTooltip/FunTooltip.d.ts +4 -1
  23. package/dist/components/FunTransactionSummary/FunTxSummaryComponents.css.d.ts +2 -0
  24. package/dist/components/FunTransactionSummary/FunTxSummaryComponents.d.ts +0 -1
  25. package/dist/components/FunTransactionSummary/PaymentFeesSummary.css.d.ts +2 -0
  26. package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +1 -1
  27. package/dist/components/FunTransactionSummary/PaymentMethodSummary.d.ts +3 -1
  28. package/dist/config/getDefaultConfig.d.ts +33 -33
  29. package/dist/consts/customers.d.ts +0 -4
  30. package/dist/consts/layout.d.ts +5 -0
  31. package/dist/css/sprinkles.css.d.ts +9 -7
  32. package/dist/domains/clientMetadata.d.ts +5 -3
  33. package/dist/domains/feeEstimate.d.ts +10 -0
  34. package/dist/domains/paymentMethods.d.ts +1 -0
  35. package/dist/domains/quote.d.ts +5 -0
  36. package/dist/domains/wallet.d.ts +2 -1
  37. package/dist/hooks/useCheckoutQuoteNotification.d.ts +2 -2
  38. package/dist/hooks/useCheckoutTimeEstimate.d.ts +7 -0
  39. package/dist/hooks/useCopyToClipboard.d.ts +4 -0
  40. package/dist/hooks/usePaymentSources.d.ts +6 -0
  41. package/dist/index.css +524 -459
  42. package/dist/index.d.ts +1 -1
  43. package/dist/index.js +5516 -5698
  44. package/dist/locales/index.d.ts +0 -3
  45. package/dist/modals/CheckoutModal/ConfirmationStep/CheckoutPrimaryInfo.d.ts +5 -3
  46. package/dist/modals/CheckoutModal/ConfirmationStep/useCheckoutQuote.d.ts +1 -1
  47. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +1 -3
  48. package/dist/modals/CheckoutModal/useNewCheckoutQuote.d.ts +7 -0
  49. package/dist/modals/CheckoutModal/useSourceAssetConfirm.d.ts +4 -2
  50. package/dist/modals/CheckoutModal/useWalletAssetHoldings.d.ts +6 -2
  51. package/dist/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.d.ts +0 -1
  52. package/dist/modals/ProfileDetails/FunProfileViews/Home/HomeTokenDisplayRow.d.ts +0 -1
  53. package/dist/modals/ProfileDetails/FunProfileViews/Home/ProfileTitleSection.d.ts +2 -1
  54. package/dist/modals/ProfileDetails/FunProfileViews/Home/index.d.ts +1 -1
  55. package/dist/modals/ProfileDetails/ProfileDetails.d.ts +0 -1
  56. package/dist/providers/FunkitCheckoutContext.d.ts +7 -34
  57. package/dist/providers/FunkitFlagsProvider.d.ts +2 -2
  58. package/dist/providers/FunkitProvider.d.ts +2 -1
  59. package/dist/providers/FunkitQuoteContext.d.ts +45 -0
  60. package/dist/providers/FunkitThemeProvider.d.ts +3 -0
  61. package/dist/providers/GeneralWalletProvider.d.ts +8 -8
  62. package/dist/providers/provideFunkitConnectChains.d.ts +1 -1
  63. package/dist/themes/darkTheme.js +1 -1
  64. package/dist/themes/lightTheme.js +1 -1
  65. package/dist/utils/address.d.ts +6 -0
  66. package/dist/utils/assets.d.ts +1 -10
  67. package/dist/utils/checkout.d.ts +4 -13
  68. package/dist/utils/checkoutHistory.d.ts +1 -1
  69. package/dist/utils/flags/config.d.ts +19 -46
  70. package/dist/utils/funLogger.d.ts +3 -1
  71. package/dist/utils/moonpay.d.ts +12 -0
  72. package/dist/wallets/walletConnectors/funkitConnectWallet/funkitConnectWallet.js +1 -1
  73. package/dist/wallets/walletConnectors/index.js +61 -61
  74. package/package.json +7 -8
  75. package/dist/ar_AR-26YWBMAY.js +0 -7
  76. package/dist/arbitrum-EUTVMZS6.js +0 -7
  77. package/dist/avalanche-6CKETBV4.js +0 -7
  78. package/dist/base-FG2B7H5W.js +0 -7
  79. package/dist/blast-VGAGZQAP.js +0 -7
  80. package/dist/bsc-BUTATTVT.js +0 -7
  81. package/dist/chunk-FRCBBARC.js +0 -1184
  82. package/dist/components/CopyAddress/CopyAddress.d.ts +0 -12
  83. package/dist/cronos-DEE5V35Y.js +0 -7
  84. package/dist/dydx-CLPISBCB.js +0 -7
  85. package/dist/en_US-45SPICME.js +0 -7
  86. package/dist/es_419-ZOOWMI2O.js +0 -7
  87. package/dist/ethereum-4YOWVRNC.js +0 -7
  88. package/dist/fr_FR-FC4AERJX.js +0 -1057
  89. package/dist/hardhat-WRPL5WKN.js +0 -7
  90. package/dist/hi_IN-VKOWQKED.js +0 -7
  91. package/dist/id_ID-JEPISG6J.js +0 -7
  92. package/dist/ja_JP-GJBWIN4W.js +0 -7
  93. package/dist/klaytn-NEGYZJPB.js +0 -7
  94. package/dist/ko_KR-G6COLOAZ.js +0 -7
  95. package/dist/locales/I18n.d.ts +0 -25
  96. package/dist/manta-G75LJIRI.js +0 -7
  97. package/dist/mantle-LQ3XH3KY.js +0 -7
  98. package/dist/optimism-TIC2YA7E.js +0 -7
  99. package/dist/polygon-NDHYUKMH.js +0 -7
  100. package/dist/providers/I18nContext.d.ts +0 -11
  101. package/dist/pt_BR-52CJXY6T.js +0 -7
  102. package/dist/ronin-O6KMJHPZ.js +0 -7
  103. package/dist/ru_RU-AEJUH3PG.js +0 -1057
  104. package/dist/scroll-G3S4ZVYZ.js +0 -7
  105. package/dist/th_TH-4TFH5TB7.js +0 -1057
  106. package/dist/tr_TR-WG4WEQOS.js +0 -1057
  107. package/dist/uk_UA-2JYNNASB.js +0 -1057
  108. package/dist/utils/deposit.d.ts +0 -12
  109. package/dist/utils/isDydxAddress.d.ts +0 -6
  110. package/dist/xdc-E3X4E3NM.js +0 -7
  111. package/dist/zetachain-2J22B4NG.js +0 -7
  112. package/dist/zh_CN-HFGZOTOB.js +0 -7
  113. package/dist/zkSync-76EOKZ5Y.js +0 -7
  114. package/dist/zora-73DYEWFN.js +0 -7
@@ -1,4 +1 @@
1
- import { I18n } from './I18n';
2
1
  export type Locale = 'ar' | 'ar-AR' | 'en' | 'en-US' | 'es' | 'es-419' | 'fr' | 'fr-FR' | 'hi' | 'hi-IN' | 'id' | 'id-ID' | 'ja' | 'ja-JP' | 'ko' | 'ko-KR' | 'pt' | 'pt-BR' | 'ru' | 'ru-RU' | 'th' | 'th-TH' | 'tr' | 'tr-TR' | 'ua' | 'uk-UA' | 'zh' | 'zh-CN';
3
- export declare const i18n: I18n;
4
- export declare function setLocale(locale: Locale): Promise<void>;
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
- import type { FunkitActiveCheckoutItem } from '~/providers/FunkitCheckoutContext';
2
+ import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
3
+ import type { FunkitCheckoutConfig } from '~/providers/FunkitCheckoutContext';
3
4
  interface CheckoutPrimaryInfoProps {
4
5
  showTokenAmount?: boolean;
5
- checkoutItem: FunkitActiveCheckoutItem;
6
+ config: FunkitCheckoutConfig;
7
+ quote: FunkitCheckoutQuoteResult | null;
6
8
  isLoading?: boolean;
7
9
  }
8
- export declare function CheckoutPrimaryInfo({ showTokenAmount, checkoutItem, isLoading, }: CheckoutPrimaryInfoProps): React.JSX.Element;
10
+ export declare function CheckoutPrimaryInfo({ showTokenAmount, quote, config, isLoading, }: CheckoutPrimaryInfoProps): React.JSX.Element;
9
11
  export {};
@@ -1,4 +1,4 @@
1
- import { type CheckoutQuoteError } from '../../../providers/FunkitCheckoutContext';
1
+ import type { CheckoutQuoteError } from '~/providers/FunkitQuoteContext';
2
2
  interface TriggerNewQuoteOptions {
3
3
  maxRetries: number;
4
4
  }
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import { PaymentMethod, type PaymentMethodAccountInfo, type PaymentMethodBrokerageInfo, type PaymentMethodCardInfo } from '~/domains/paymentMethods';
2
+ import { type ConnectablePaymentMethodInfo, PaymentMethod, type PaymentMethodCardInfo } from '~/domains/paymentMethods';
3
3
  import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
4
- type ConnectablePaymentMethodInfo = PaymentMethodAccountInfo | PaymentMethodBrokerageInfo;
5
4
  export type SourceChangeState = CheckoutModalCommonState & {
6
5
  paymentMethodInfo: ConnectablePaymentMethodInfo | null;
7
6
  };
@@ -24,4 +23,3 @@ export type SourceChangeNext = {
24
23
  };
25
24
  export declare const SourceChangeInfo: ModalStepInfo<FunCheckoutStep.SOURCE_CHANGE>;
26
25
  export declare function SourceChange({ modalState, onNext, onClose, }: ModalStepComponentProps<FunCheckoutStep.SOURCE_CHANGE>): React.JSX.Element;
27
- export {};
@@ -0,0 +1,7 @@
1
+ import { type DeepPartial } from '@funkit/utils';
2
+ import { type FunkitActiveCheckoutItem } from '~/providers/FunkitCheckoutContext';
3
+ export declare function useNewCheckoutQuote(): (overridingCheckoutItem?: DeepPartial<FunkitActiveCheckoutItem>) => Promise<{
4
+ baseQuote: import("@funkit/api-base").CheckoutQuoteResponse;
5
+ finalEstimation: import("~/domains/quote").FunkitCheckoutQuoteResult;
6
+ availableAssetAmount: number | undefined;
7
+ }>;
@@ -1,6 +1,8 @@
1
1
  import type { Operation } from '@funkit/core';
2
+ import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
3
+ import { type CheckoutQuoteResult } from '~/providers/FunkitQuoteContext';
2
4
  import { type PaymentMethodInfo } from '../../domains/paymentMethods';
3
- import { type CheckoutQuoteResult, type FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
5
+ import { type FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
4
6
  import { LoginType } from '../../providers/GeneralWalletProvider';
5
7
  export interface SourceAssetConfirmed {
6
8
  isQuoteSuccess: boolean;
@@ -24,7 +26,7 @@ export declare function fetchSponsorInitialTransferGasLimit(checkoutItem: Funkit
24
26
  *
25
27
  * USE THIS WITH CAUTION
26
28
  **/
27
- export declare function useTriggerQuoteAndOtherStuffsWithExtremeCaution(onResult: (result: CheckoutQuoteResult) => void, setPreloadedQuoteData?: (quoteData: FunkitActiveCheckoutItem) => void): {
29
+ export declare function useTriggerQuoteAndOtherStuffsWithExtremeCaution(onResult: (result: CheckoutQuoteResult) => void, setPreloadedQuoteData?: (quoteData: FunkitCheckoutQuoteResult) => void): {
28
30
  isSourceAssetConfirming: boolean;
29
31
  triggerAssetConfirm: () => void;
30
32
  onSourceAssetConfirmed: (preloadQuoteData?: boolean) => Promise<CheckoutQuoteResult>;
@@ -1,5 +1,9 @@
1
1
  import { type AssetHoldingsMap } from '../../utils/assets';
2
- export declare function useWalletAssetHoldings(targetChain: string): {
2
+ interface UseWalletAssetHoldingsResponse {
3
3
  data: AssetHoldingsMap | undefined;
4
4
  isLoading: boolean;
5
- };
5
+ totalBalance: number;
6
+ hasUsableBalance: boolean;
7
+ }
8
+ export declare function useWalletAssetHoldings(targetChain: string): UseWalletAssetHoldingsResponse;
9
+ export {};
@@ -1,7 +1,6 @@
1
1
  import type { CheckoutHistoryItem } from '@funkit/api-base';
2
2
  import React from 'react';
3
3
  import { HistoryContentPages } from '../../../../utils/checkoutHistory';
4
- export declare const HOME_CHECKOUT_DISPLAY_ROW_HEIGHT = 52;
5
4
  export declare const HomeCheckoutDisplayRow: ({ checkoutHistoryItem, onSelect, }: {
6
5
  checkoutHistoryItem: CheckoutHistoryItem;
7
6
  onSelect: (depositAddress: `0x${string}`, initialPage: HistoryContentPages) => void;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import type { KnownAssetBalanceInfo } from '~/providers/GeneralWalletProvider';
3
- export declare const HOME_TOKEN_BALANCE_DISPLAY_ROW_HEIGHT = 52;
4
3
  export declare const HomeTokenBalanceDisplayRow: ({ asset, }: {
5
4
  asset: KnownAssetBalanceInfo;
6
5
  }) => React.JSX.Element;
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
+ import type { Config, UseAccountReturnType } from 'wagmi';
2
3
  import type { FunkitUserInfo } from '~/consts/funkit';
3
4
  import { FunProfileView } from '../../ProfileDetails';
4
5
  export declare const ProfileTitleSection: ({ animateOut, account, userInfo, onChangeView, onLogout, onClose, }: {
5
6
  animateOut?: boolean;
6
- account: any;
7
+ account: UseAccountReturnType<Config>;
7
8
  userInfo: FunkitUserInfo;
8
9
  onChangeView: (newView: FunProfileView) => void;
9
10
  onLogout: () => void;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { type AnimationState } from '~/hooks/useAnimatedNavigation';
3
3
  import { type BaseActivitySelection } from '../../ActivityTraversalContext';
4
- import { type FunProfileView } from '../../ProfileDetails';
4
+ import type { FunProfileView } from '../../ProfileDetails';
5
5
  export declare enum SelectedHomeTab {
6
6
  ASSETS = "assets",
7
7
  CHECKOUTS = "checkouts"
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { SelectedHomeTab } from './FunProfileViews/Home';
3
- export declare const PROFILE_SIDE_PADDING = "18";
4
3
  export declare enum FunProfileView {
5
4
  HOME = 0,
6
5
  SETTINGS = 1,
@@ -2,26 +2,8 @@ import { type ApiCheckoutClientMetadata, type ApiFunkitCheckoutConfig, type FunA
2
2
  import React, { type ReactNode } from 'react';
3
3
  import { type Abi, type Address } from 'viem';
4
4
  import type { AssetHoldingsItem } from '~/utils/assets';
5
- import { type PaymentMethodInfo } from '../domains/paymentMethods';
6
- import type { FunkitCheckoutQuoteResult } from '../domains/quote';
7
- export type { HistoricalCheckoutItem, ServerCheckoutConfig, } from '~/domains/clientMetadata';
8
- export type { FunkitCheckoutQuoteResult } from '~/domains/quote';
9
- export type CheckoutQuoteError = {
10
- maxTargetAssetAmount: number;
11
- reason: 'insufficientBalance';
12
- } | {
13
- minTargetUsdAmount?: number;
14
- reason: 'insufficientAmount';
15
- } | {
16
- originalError: Error;
17
- reason: 'internal';
18
- };
19
- export type CheckoutQuoteResult = {
20
- success: true;
21
- } | {
22
- error: CheckoutQuoteError;
23
- success: false;
24
- };
5
+ import type { PaymentMethodInfo } from '../domains/paymentMethods';
6
+ import { type FunkitCheckoutQuoteResult } from './FunkitHistoryContext';
25
7
  export interface FunkitCheckoutActionParams {
26
8
  contractAbi: Abi;
27
9
  contractAddress: Address;
@@ -82,6 +64,7 @@ interface UseFunkitCheckoutProps {
82
64
  /** @optional fires if the checkout requires an active wallet connection. If not specified, defaults to funkit wallet connection. */
83
65
  onLoginRequired?: () => void;
84
66
  }
67
+ /** Ensures that config is defined */
85
68
  interface UseFunkitCheckoutPropsWithFullConfig extends UseFunkitCheckoutProps {
86
69
  config: FunkitCheckoutConfig;
87
70
  }
@@ -89,14 +72,6 @@ interface UseFunkitCheckoutPropsWithFullConfig extends UseFunkitCheckoutProps {
89
72
  * Checkout Item for frontend use
90
73
  */
91
74
  export interface FunkitActiveCheckoutItem extends Omit<ApiCheckoutClientMetadata, 'selectedPaymentMethodInfo' | 'initSettings'> {
92
- /** Whether the checkout quote is being fetched **/
93
- isQuoting: boolean;
94
- /** Latest checkout estimated fees and time **/
95
- latestQuote: null | FunkitCheckoutQuoteResult;
96
- /** The quotation step message **/
97
- quoteStepMessage: string;
98
- /** Error messages associated with checkout quote **/
99
- quoteErrorMessage: string;
100
75
  /** The deposit address provided by server after the checkout is confirmed. If `null`, it is not confirmed yet. **/
101
76
  depositAddress: null | Address;
102
77
  /** Final settings the checkout was init-ed with **/
@@ -119,13 +94,10 @@ interface FunkitCheckoutContextInterface {
119
94
  updateSourceAsset(selectedSource: Omit<AssetHoldingsItem, 'amount' | 'usdAmount' | 'chainSymbolKey'>): void;
120
95
  updateTargetAssetAmount(newTargetAssetAmount: number): void;
121
96
  updateSelectedPaymentMethodInfo(newPaymentMethodInfo: PaymentMethodInfo): void;
122
- confirmCheckout(shouldBatchOpBypassInit: boolean, stepMessageSetter: (m: string) => void): Promise<Address>;
97
+ confirmCheckout(shouldBatchOpBypassInit: boolean, quote: FunkitCheckoutQuoteResult, stepMessageSetter: (m: string) => void): Promise<Address>;
123
98
  cancelCheckout(depositAddress: Address): Promise<boolean>;
124
- clearCheckoutQuoteMessages(): void;
125
- getCheckoutQuote(sponsorInitialTransferGasLimit: number, newPaymentMethodInfo: PaymentMethodInfo, disableInformationStreaming?: boolean): Promise<CheckoutQuoteResult & {
126
- shellCheckoutItemWithNextQuote: FunkitActiveCheckoutItem;
127
- }>;
128
- setCheckoutQuote(quote: FunkitActiveCheckoutItem): void;
99
+ /** @deprecated to be removed after quote migration is finished (historically named setCheckoutQuote) */
100
+ setCheckout: (checkout: FunkitActiveCheckoutItem) => void;
129
101
  setCompletedTimestamp(timestampMs: number): void;
130
102
  }
131
103
  export declare function FunkitCheckoutProvider({ children }: {
@@ -141,3 +113,4 @@ export declare function useFunkitCheckout(props: UseFunkitCheckoutPropsWithFullC
141
113
  export declare function useFunkitCheckout(props: UseFunkitCheckoutProps): {
142
114
  beginCheckout: (config: FunkitCheckoutConfig) => Promise<void>;
143
115
  };
116
+ export {};
@@ -1,7 +1,7 @@
1
1
  import React, { type ReactNode } from 'react';
2
- import { type FlagKey, flagConfig as offlineConfig } from '../utils/flags/config';
2
+ import type { FlagKey } from '@funkit/utils';
3
+ import { flagConfig as offlineConfig } from '../utils/flags/config';
3
4
  import type { InferFlagType } from '../utils/flags/types';
4
- export { FlagKey } from '../utils/flags/config';
5
5
  export type FlagValue<K extends FlagKey> = InferFlagType<(typeof offlineConfig)[K]>;
6
6
  export type FlagValues = {
7
7
  [K in FlagKey]?: FlagValue<K>;
@@ -1,8 +1,8 @@
1
1
  import { type QueryClient } from '@tanstack/react-query';
2
2
  import React, { type ReactNode } from 'react';
3
3
  import type { Chain } from 'wagmi/chains';
4
+ import type { Locale } from '~/locales';
4
5
  import { type CreateFunkitWagmiConfigParameters } from '../config/getDefaultConfig';
5
- import type { Locale } from '../locales';
6
6
  import { type DisclaimerComponent } from './AppContext';
7
7
  import { type AvatarComponent } from './AvatarContext';
8
8
  import { type FunkitConfig } from './FunkitConfigContext';
@@ -22,6 +22,7 @@ interface FunkitProviderInnerProps {
22
22
  disclaimer?: DisclaimerComponent;
23
23
  };
24
24
  avatar?: AvatarComponent;
25
+ /** @deprecated This currently has no effect, localization is not yet supported */
25
26
  locale?: Locale;
26
27
  funkitConfig: FunkitConfig;
27
28
  debug?: boolean | undefined;
@@ -0,0 +1,45 @@
1
+ import React, { type Dispatch, type ReactNode } from 'react';
2
+ import { type PaymentMethodInfo } from '../domains/paymentMethods';
3
+ import type { FunkitCheckoutQuoteResult } from '../domains/quote';
4
+ import { type FunkitActiveCheckoutItem } from './FunkitCheckoutContext';
5
+ export type CheckoutQuoteError = {
6
+ maxTargetAssetAmount: number;
7
+ reason: 'insufficientBalance';
8
+ } | {
9
+ minTargetUsdAmount?: number;
10
+ reason: 'insufficientAmount';
11
+ } | {
12
+ originalError: Error;
13
+ reason: 'internal';
14
+ };
15
+ export type CheckoutQuoteResult = {
16
+ success: true;
17
+ } | {
18
+ error: CheckoutQuoteError;
19
+ success: false;
20
+ };
21
+ type GetCheckoutQuoteResponse = CheckoutQuoteResult & {
22
+ shellCheckoutItemWithNextQuote: FunkitActiveCheckoutItem;
23
+ quoteState: CheckoutQuoteState;
24
+ };
25
+ interface CheckoutQuoteState {
26
+ /** Whether the checkout quote is being fetched **/
27
+ isQuoting: boolean;
28
+ /** Latest checkout estimated fees and time **/
29
+ latestQuote: null | FunkitCheckoutQuoteResult;
30
+ /** The quotation step message **/
31
+ quoteStepMessage: string;
32
+ /** Error messages associated with checkout quote **/
33
+ quoteErrorMessage: string;
34
+ }
35
+ interface FunkitQuoteContextInterface extends CheckoutQuoteState {
36
+ clearCheckoutQuoteMessages: () => void;
37
+ getCheckoutQuote: (sponsorInitialTransferGasLimit: number, newPaymentMethodInfo: PaymentMethodInfo, disableInformationStreaming?: boolean) => Promise<GetCheckoutQuoteResponse>;
38
+ setCheckoutQuote: Dispatch<React.SetStateAction<FunkitCheckoutQuoteResult | null>>;
39
+ setQuoteProgress: (state: Omit<CheckoutQuoteState, 'latestQuote'>) => void;
40
+ }
41
+ export declare function FunkitQuoteProvider({ children }: {
42
+ children: ReactNode;
43
+ }): React.JSX.Element;
44
+ export declare function useQuoteContext(): FunkitQuoteContextInterface;
45
+ export {};
@@ -144,6 +144,7 @@ export declare const useActiveTheme: () => {
144
144
  dialog: string;
145
145
  selectedOption: string;
146
146
  selectedWallet: string;
147
+ dropdown: string;
147
148
  };
148
149
  blurs: {
149
150
  modalOverlay: string;
@@ -276,6 +277,7 @@ export declare const useActiveTheme: () => {
276
277
  dialog: string;
277
278
  selectedOption: string;
278
279
  selectedWallet: string;
280
+ dropdown: string;
279
281
  };
280
282
  blurs: {
281
283
  modalOverlay: string;
@@ -406,6 +408,7 @@ export declare const useActiveTheme: () => {
406
408
  dialog: string;
407
409
  selectedOption: string;
408
410
  selectedWallet: string;
411
+ dropdown: string;
409
412
  };
410
413
  blurs: {
411
414
  modalOverlay: string;
@@ -96,15 +96,15 @@ export declare const useFunkitDisconnect: () => {
96
96
  error: null;
97
97
  data: undefined;
98
98
  status: "idle";
99
+ isPaused: boolean;
100
+ context: unknown;
99
101
  isError: false;
100
102
  isPending: false;
101
103
  isSuccess: false;
102
104
  failureCount: number;
103
105
  failureReason: import("@wagmi/core").DisconnectErrorType | null;
104
- isPaused: boolean;
105
106
  variables: undefined;
106
107
  isIdle: true;
107
- context: unknown;
108
108
  submittedAt: number;
109
109
  connectors: readonly import("wagmi").Connector[];
110
110
  } | {
@@ -114,15 +114,15 @@ export declare const useFunkitDisconnect: () => {
114
114
  error: null;
115
115
  data: undefined;
116
116
  status: "pending";
117
+ isPaused: boolean;
118
+ context: unknown;
117
119
  isError: false;
118
120
  isPending: true;
119
121
  isSuccess: false;
120
122
  failureCount: number;
121
123
  failureReason: import("@wagmi/core").DisconnectErrorType | null;
122
- isPaused: boolean;
123
124
  variables: import("wagmi/query").DisconnectVariables;
124
125
  isIdle: false;
125
- context: unknown;
126
126
  submittedAt: number;
127
127
  connectors: readonly import("wagmi").Connector[];
128
128
  } | {
@@ -132,15 +132,15 @@ export declare const useFunkitDisconnect: () => {
132
132
  error: import("@wagmi/core").DisconnectErrorType;
133
133
  data: undefined;
134
134
  status: "error";
135
+ isPaused: boolean;
136
+ context: unknown;
135
137
  isError: true;
136
138
  isPending: false;
137
139
  isSuccess: false;
138
140
  failureCount: number;
139
141
  failureReason: import("@wagmi/core").DisconnectErrorType | null;
140
- isPaused: boolean;
141
142
  variables: import("wagmi/query").DisconnectVariables;
142
143
  isIdle: false;
143
- context: unknown;
144
144
  submittedAt: number;
145
145
  connectors: readonly import("wagmi").Connector[];
146
146
  } | {
@@ -150,15 +150,15 @@ export declare const useFunkitDisconnect: () => {
150
150
  error: null;
151
151
  data: void;
152
152
  status: "success";
153
+ isPaused: boolean;
154
+ context: unknown;
153
155
  isError: false;
154
156
  isPending: false;
155
157
  isSuccess: true;
156
158
  failureCount: number;
157
159
  failureReason: import("@wagmi/core").DisconnectErrorType | null;
158
- isPaused: boolean;
159
160
  variables: import("wagmi/query").DisconnectVariables;
160
161
  isIdle: false;
161
- context: unknown;
162
162
  submittedAt: number;
163
163
  connectors: readonly import("wagmi").Connector[];
164
164
  };
@@ -2,7 +2,7 @@ import type { FunkitConnectChain } from './FunkitConnectChainContext';
2
2
  export declare const chainMetadataById: {
3
3
  [k: string]: {
4
4
  name?: string;
5
- iconUrl: () => Promise<string>;
5
+ iconUrl: string;
6
6
  iconBackground: string;
7
7
  };
8
8
  };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  darkTheme
4
- } from "../chunk-2QK6Y7FR.js";
4
+ } from "../chunk-C7BDNBKV.js";
5
5
  import "../chunk-TKJVOYWW.js";
6
6
  export {
7
7
  darkTheme
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  lightTheme
4
- } from "../chunk-JFHTYZ23.js";
4
+ } from "../chunk-QCYFMAKN.js";
5
5
  import "../chunk-TKJVOYWW.js";
6
6
  export {
7
7
  lightTheme
@@ -1,2 +1,8 @@
1
1
  import type { FunkitTextCustomizationsConfig } from '../providers/FunkitConfigContext';
2
2
  export declare const getWalletLabel: (textCustomizations: FunkitTextCustomizationsConfig, walletAddress?: string) => string;
3
+ /**
4
+ * Replicated from @dydxprotocol/v4-client-js https://github.com/dydxprotocol/v4-clients/blob/main/v4-client-js/src/lib/validation.ts#L145C1-L158
5
+ * Not importing the sdk in the interest of space.
6
+ */
7
+ export declare function verifyIsBech32(address: string): Error | undefined;
8
+ export declare function isDydxAddress(address: string): boolean;
@@ -2,7 +2,7 @@ import type { KnownAssetHoldingsItem } from '~/domains/wallet';
2
2
  import { LoginType } from '~/providers/GeneralWalletProvider';
3
3
  import { PaymentMethod } from '../domains/paymentMethods';
4
4
  import type { FunkitActiveCheckoutItem, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
5
- import { type FlagValues } from '../providers/FunkitFlagsProvider';
5
+ import type { FlagValues } from '../providers/FunkitFlagsProvider';
6
6
  export type { AssetHoldingsItem, AssetHoldingsMap, KnownAssetHoldingsItem, } from '~/domains/wallet';
7
7
  export declare const ASSETS_LOW_VALUE_THRESHOLD = 0.1;
8
8
  export declare const getNormalizedTokenBalance: (tokenBalance: bigint | number | string, decimals: number) => number;
@@ -11,16 +11,7 @@ export declare const isAssetUsableToPayForCheckout: (flags: FlagValues, checkout
11
11
  isUsable: boolean;
12
12
  reason: string;
13
13
  };
14
- export declare const L1_FEES_ESTIMATE = 20;
15
- export declare const L2_FEES_ESTIMATE = 1;
16
14
  export declare const L2_COST_MARGIN_MULTIPLIER = 1.2;
17
- export declare const MESH_L1_FEES_ESTIMATE = 8;
18
- export declare const MESH_L2_FEES_ESTIMATE = 2;
19
- export declare const MESH_CUSTOM_CLIENT_FEE_PERCENT = 0.055;
20
- /**
21
- * Estimating overall fees
22
- */
23
- export declare const getFeesUsdEstimate: (targetChainId: string, assetChainId: string, assetUsdAmount: number | null, paymentMethod: PaymentMethod | undefined) => number;
24
15
  type RecommendedAsset = {
25
16
  chainSymbolKey: string;
26
17
  label: string | null;
@@ -2,8 +2,9 @@ import { type CheckoutHistoryItem } from '@funkit/api-base';
2
2
  import { type Config } from '@wagmi/core';
3
3
  import { type Address } from 'viem';
4
4
  import type { UseConfigReturnType } from 'wagmi';
5
- import { PaymentMethod } from '../domains/paymentMethods';
6
- import type { FunkitActiveCheckoutItem, FunkitCheckoutActionParams, FunkitCheckoutConfig, FunkitCheckoutQuoteResult, HistoricalCheckoutItem, ServerCheckoutConfig } from '../providers/FunkitCheckoutContext';
5
+ import type { ServerCheckoutConfig } from '~/domains/clientMetadata';
6
+ import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
7
+ import type { FunkitActiveCheckoutItem, FunkitCheckoutActionParams, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
7
8
  export declare const MOONPAY_TIME_ESTIMATE_MS = 120000;
8
9
  export declare const MESH_TIME_ESTIMATE_MS = 300000;
9
10
  export declare const DUMMY_TRANSFER_PARAMS: {
@@ -32,7 +33,6 @@ export declare const hasSufficientBalance: (wagmiConfig: UseConfigReturnType, wa
32
33
  result: boolean;
33
34
  tokenTicker: null;
34
35
  }>;
35
- export declare function getTokenAddress(tokenTicker: string, chainId: string): Promise<`0x${string}`>;
36
36
  /**
37
37
  * Generates an env config for checkout estimation
38
38
  * So that batch operation creation will not fail even if FW has insufficient funds to pass the estimation.
@@ -84,16 +84,7 @@ export declare function categorizeCheckoutHistories(checkoutHistoryList: Checkou
84
84
  currentDepositAddrMap: CheckoutHistoryDepositAddrMap;
85
85
  };
86
86
  export declare function formatTokenAmountForMoonpay(amount: number, mpCurrencyCode: string): string;
87
- /**
88
- * https://linear.app/funxyz/issue/ENG-1154/update-dydx-and-polymarkets-time-estimate
89
- * @returns time estimation in seconds
90
- */
91
- export declare function hackTimeEstimationForImportantCustomer(originalTimeEstimationMs: number | undefined, paymentMethod: PaymentMethod, apiKey: string): number;
92
- export declare function getEstimateEndTimeInfo(createdTimeMs: number, checkoutItem: FunkitActiveCheckoutItem | HistoricalCheckoutItem, apiKey: string): {
93
- estimatedEndTimeMs: number;
94
- estimatedEndTimeFromNowMs: number;
95
- isExceededEstimation: boolean;
96
- };
87
+ export declare function getTimeFromNowSeconds(startTimeMs: number, durationMs: number): number;
97
88
  /**
98
89
  * Given a checkout config, returns the display string for the checkout item.
99
90
  * Arbitary action checkouts: Display the checkoutItemAmount if it is greater than 0, otherwise display the checkoutItemTitle.
@@ -19,4 +19,4 @@ export declare function clearLatestWalletId(): void;
19
19
  * @param checkout
20
20
  * @returns
21
21
  */
22
- export declare function getCheckoutCompletionTime(checkout: CheckoutHistoryItem): number;
22
+ export declare function getCheckoutCompletionTime(checkout: Pick<CheckoutHistoryItem, 'stateTimestampMs' | 'createdTimeMs' | 'lastUpdatedTimeMs'>): number;
@@ -1,36 +1,3 @@
1
- /**
2
- * Remember that these values show up in our logs
3
- * Make sure the enum values are unique
4
- * Once we ship a feature flag, we can't change the key.
5
- */
6
- export declare enum FlagKey {
7
- /** Whether mantle assets can be used as source asset for payment for any checkout */
8
- DisableMantleSourceAssets = "disable_mantle_source_assets",
9
- /** Whether zksync assets can be used as source asset for payment for any checkout */
10
- DisableZkSyncSourceAssets = "disable_zksync_source_assets",
11
- /** @deprecated Which exchanges to show in the exchange selection screen */
12
- SupportedExchanges = "supported_exchanges",
13
- /** Which exchanges to show in the exchange selection screen */
14
- SupportedExchangesV2 = "supported_exchanges_v2",
15
- /** Which countries should be blocked for Funkit Checkout. Reference Alpha-2 Code format https://www.iban.com/country-codes. */
16
- BlockedCountries = "blocked_countries",
17
- /** Which users/addresses should be blocked for Funkit Checkout */
18
- AddressBlacklist = "address_blacklist",
19
- /** Whether to show the [Powered by Fun.xyz] tagline at the bottom of the checkout modal. */
20
- ShowPoweredTagline = "show_powered_tagline",
21
- /** Whether to enable Token Transfer as a payment method. */
22
- EnableTokenTransfer = "enable_token_transfer",
23
- /** Token Transfer payment method accepted source chain and assets */
24
- TokenTransferSourceChainsAndAssets = "token_transfer_source_chains_and_assets",
25
- /** Token Transfer additional disclaimer text. */
26
- TokenTransferAdditionalDisclaimer = "token_transfer_additional_disclaimer",
27
- /** Token Transfer universal deposit address */
28
- EnableTokenTransferUniversalDepositAddress = "enable_token_transfer_universal_deposit_address",
29
- /** Maximum usd amount that can be checked out. */
30
- MaxCheckoutUsd = "max_checkout_usd",
31
- /** Payment proxy server - whether we're using FROG for proxying payment (mesh) requests */
32
- EnableFrogProxyServer = "enable_frog_proxy_server"
33
- }
34
1
  export declare const flagConfig: {
35
2
  disable_mantle_source_assets: {
36
3
  type: "boolean";
@@ -92,22 +59,24 @@ export declare const flagConfig: {
92
59
  type: "string";
93
60
  default_value: string;
94
61
  };
95
- token_transfer_additional_disclaimer: {
96
- type: "string";
97
- default_value: string;
62
+ enable_token_transfer_universal_deposit_address: {
63
+ type: "boolean";
64
+ default_value: false;
98
65
  overrides: {
99
- if_any: {
100
- key: "apiKey";
66
+ if_any: ({
67
+ key: "userId";
68
+ pct: number;
69
+ type: "pctRollout";
70
+ values?: undefined;
71
+ } | {
72
+ key: "userId";
101
73
  type: "isAnyOf";
102
74
  values: string[];
103
- }[];
104
- value: string;
75
+ pct?: undefined;
76
+ })[];
77
+ value: true;
105
78
  }[];
106
79
  };
107
- enable_token_transfer_universal_deposit_address: {
108
- type: "boolean";
109
- default_value: false;
110
- };
111
80
  max_checkout_usd: {
112
81
  type: "string";
113
82
  default_value: string;
@@ -129,14 +98,18 @@ export declare const flagConfig: {
129
98
  };
130
99
  enable_frog_proxy_server: {
131
100
  type: "boolean";
132
- default_value: false;
101
+ default_value: true;
102
+ };
103
+ checkout_time_estimate_overrides: {
104
+ type: "string";
105
+ default_value: string;
133
106
  overrides: {
134
107
  if_any: {
135
108
  key: "apiKey";
136
109
  type: "isAnyOf";
137
110
  values: string[];
138
111
  }[];
139
- value: true;
112
+ value: string;
140
113
  }[];
141
114
  };
142
115
  };
@@ -6,6 +6,7 @@ declare class FunLogger {
6
6
  protected userName: string | null;
7
7
  protected userLoginType: string | null;
8
8
  protected sdkVersion: string | null;
9
+ protected deviceId: string | null;
9
10
  constructor();
10
11
  private getFunLogEnv;
11
12
  private logDataDog;
@@ -26,7 +27,8 @@ declare class FunLogger {
26
27
  getUserAddress(): string | null;
27
28
  getUserName(): string | null;
28
29
  getUserLoginType(): string | null;
29
- setUserInfo(userId: string, userAddress: string, userName: string, userLoginType: string): void;
30
+ setUserInfo(userId: string, userAddress: string, userName: string, userLoginType: string, deviceId: string): void;
31
+ setDeviceId(deviceId: string): void;
30
32
  }
31
33
  declare const logger: FunLogger;
32
34
  export { logger };
@@ -1 +1,13 @@
1
+ export declare const MINIMUM_MOONPAY_DEPOSIT_AMOUNT_USD = 35;
2
+ export declare const MAXIMUM_MOONPAY_DEPOSIT_AMOUNT_USD = 10000;
1
3
  export declare const generateMoonpayCurrencyCode: (tokenSymbol: string, chainId: string) => string;
4
+ export declare function checkAmountForMoonpay(amountUsd: number): {
5
+ readonly isInvalid: true;
6
+ readonly message: "$35 minimum required for the selected payment method.";
7
+ } | {
8
+ readonly isInvalid: true;
9
+ readonly message: "$10000 maximum exceeded for the selected payment method.";
10
+ } | {
11
+ readonly isInvalid: false;
12
+ readonly message?: undefined;
13
+ };
@@ -6,7 +6,7 @@ import { createConnector } from "wagmi";
6
6
 
7
7
  // src/consts/funkit.ts
8
8
  import { CheckoutState } from "@funkit/api-base";
9
- import { FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS } from "@funkit/core";
9
+ import { FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS } from "@funkit/chains";
10
10
  var FUNKIT_CONNECT_WALLET_ID = "funkitConnectWallet";
11
11
  var FROM_PROGRESS_CHECKOUT_STATES = [
12
12
  CheckoutState.FROM_UNFUNDED,