@funkit/connect 13.1.1 → 13.3.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 (117) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/dist/{chunk-53FF4ZHH.js → chunk-SJ7E3DKC.js} +6 -0
  3. package/dist/{chunk-2RND3WWH.js → chunk-V4VFNIG4.js} +6 -0
  4. package/dist/clients/aave.d.ts +1 -1
  5. package/dist/clients/{chunk-44LV4GCX.js → chunk-2INCUCQQ.js} +1 -0
  6. package/dist/clients/chunk-6JL6PF5P.js +22 -0
  7. package/dist/clients/chunk-747THMHY.js +185 -0
  8. package/dist/clients/{chunk-Q4JGDB4L.js → chunk-BMU5EYUJ.js} +8 -24
  9. package/dist/clients/{chunk-T6YNXIOS.js → chunk-HBW7AZUH.js} +7 -5
  10. package/dist/clients/{chunk-ZBBYOJWK.js → chunk-KDZFZETH.js} +176 -0
  11. package/dist/clients/{chunk-D6EY2WW4.js → chunk-PVBHWD47.js} +1 -1
  12. package/dist/clients/chunk-RNTQ7KEL.js +76 -0
  13. package/dist/clients/{chunk-ZEXIDBIZ.js → chunk-RTHDOT5K.js} +1 -1
  14. package/dist/clients/{chunk-AJGDTTRJ.js → chunk-SKYQYPX5.js} +58 -2
  15. package/dist/clients/{chunk-NNMZMHO6.js → chunk-Z6FHIDTD.js} +5 -5
  16. package/dist/clients/fanatics.css +3136 -2947
  17. package/dist/clients/fanatics.js +1 -1
  18. package/dist/clients/internal/nado/withdrawalCallback.js +4 -4
  19. package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
  20. package/dist/clients/internal/nado/withdrawalForm.js +12 -77
  21. package/dist/clients/internal/nado/withdrawalStatus.css +18233 -0
  22. package/dist/clients/internal/nado/withdrawalStatus.js +218 -20
  23. package/dist/clients/lighter.css +3519 -2947
  24. package/dist/clients/lighter.js +5 -7
  25. package/dist/clients/mallard.d.ts +24 -3
  26. package/dist/clients/mallard.js +7 -3
  27. package/dist/clients/nado.js +4 -4
  28. package/dist/clients/polymarket/createPolymarketDepositConfig.js +4 -3
  29. package/dist/clients/polymarket/index.js +9 -7
  30. package/dist/clients/polymarket/polymarket.js +6 -4
  31. package/dist/components/Box/Box.d.ts +18 -18
  32. package/dist/components/Dropdown/BaseDropdownItem.d.ts +1 -1
  33. package/dist/components/FunAsset/FunAssetItem.d.ts +3 -1
  34. package/dist/components/FunBadge/FunBadge.d.ts +1 -1
  35. package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +2 -3
  36. package/dist/components/FunTransactionSummary/PaymentFeesSummary.track.d.ts +2 -3
  37. package/dist/components/ModalErrorState/ModalErrorState.d.ts +2 -3
  38. package/dist/consts/customers.d.ts +1 -1
  39. package/dist/consts/polymarket.d.ts +1 -1
  40. package/dist/css/sprinkles.css.d.ts +24 -18
  41. package/dist/domains/clientMetadata.d.ts +2 -1
  42. package/dist/domains/convert/hostTimeout.d.ts +1 -1
  43. package/dist/domains/destinationAssetBalance.d.ts +1 -1
  44. package/dist/hooks/queries/useWithdrawalQuote.d.ts +2 -3
  45. package/dist/hooks/statsig/index.d.ts +1 -0
  46. package/dist/hooks/track/analytics/mappers.d.ts +11 -1
  47. package/dist/hooks/track/analytics/swappedErrorCode.d.ts +1 -0
  48. package/dist/hooks/track/analytics/useTrackErrorShown.d.ts +2 -3
  49. package/dist/hooks/useConvertBalances.d.ts +6 -1
  50. package/dist/hooks/useFunkitMaxCheckoutUsdInfo.d.ts +3 -3
  51. package/dist/hooks/useHostDepositSettlement.d.ts +12 -0
  52. package/dist/hooks/useModalStateValueWithProp.d.ts +1 -1
  53. package/dist/hooks/useRefreshBalancesOnDeposit.d.ts +20 -0
  54. package/dist/index.css +3519 -2947
  55. package/dist/index.d.ts +3 -1
  56. package/dist/index.js +6179 -3864
  57. package/dist/interfaces/solanaWallet.d.ts +2 -2
  58. package/dist/modals/CheckoutModal/FiatV2/FiatV2Step.d.ts +19 -0
  59. package/dist/modals/CheckoutModal/FiatV2/fiatV2DepositInputs.d.ts +38 -0
  60. package/dist/modals/CheckoutModal/FiatV2/fiatV2PaymentSelectionEffects.d.ts +26 -0
  61. package/dist/modals/CheckoutModal/FiatV2/useFiatV2DepositInputs.d.ts +6 -0
  62. package/dist/modals/CheckoutModal/FiatV2/useFiatV2PaymentSelectionHost.d.ts +22 -0
  63. package/dist/modals/CheckoutModal/FiatV2/useFiatV2Text.d.ts +7 -0
  64. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +3 -1
  65. package/dist/modals/CheckoutModal/InputAmount/useCheckoutAmountLimits.d.ts +3 -3
  66. package/dist/modals/CheckoutModal/SourceChange/AddCardItem.d.ts +9 -0
  67. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +5 -0
  68. package/dist/modals/CheckoutModal/SourceChange/fiatV2Reroute.d.ts +24 -0
  69. package/dist/modals/CheckoutModal/SourceChange/useAddCardRow.d.ts +13 -0
  70. package/dist/modals/CheckoutModal/SourceChange/useFiatV2Entry.d.ts +21 -0
  71. package/dist/modals/CheckoutModal/stepTransition.d.ts +3 -0
  72. package/dist/modals/PolymarketPerpsTransfer/TransferActionButton.d.ts +5 -5
  73. package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +2 -3
  74. package/dist/providers/FunSessionContext.d.ts +20 -0
  75. package/dist/providers/FunkitCheckoutContext/index.d.ts +7 -1
  76. package/dist/providers/FunkitCheckoutContext/types.d.ts +30 -0
  77. package/dist/providers/FunkitProvider.d.ts +7 -0
  78. package/dist/providers/FunkitQuoteContext.track.d.ts +2 -3
  79. package/dist/providers/FunkitThemeProvider.d.ts +9 -0
  80. package/dist/shadow-css.js +1 -1
  81. package/dist/themes/darkTheme.js +1 -1
  82. package/dist/themes/lightTheme.js +1 -1
  83. package/dist/utils/checkout.d.ts +2 -2
  84. package/dist/utils/localStorageFunSessionStorage.d.ts +9 -0
  85. package/dist/v2/components/PrimaryButton.css.d.ts +5 -0
  86. package/dist/v2/components/PrimaryButton.d.ts +16 -0
  87. package/dist/v2/components/Sheet.css.d.ts +13 -0
  88. package/dist/v2/components/Sheet.d.ts +23 -0
  89. package/dist/v2/components/Spinner.css.d.ts +2 -0
  90. package/dist/v2/components/Spinner.d.ts +6 -0
  91. package/dist/v2/flows/fiat/FiatDepositGate.d.ts +20 -0
  92. package/dist/v2/flows/fiat/FiatScreenPicker.d.ts +37 -0
  93. package/dist/v2/flows/funLogin/FunLoginScreenPicker.d.ts +30 -0
  94. package/dist/v2/screens/amount/AmountDisplay.css.d.ts +5 -0
  95. package/dist/v2/screens/amount/AmountDisplay.d.ts +15 -0
  96. package/dist/v2/screens/amount/AmountScreen.css.d.ts +2 -0
  97. package/dist/v2/screens/amount/AmountScreen.d.ts +37 -0
  98. package/dist/v2/screens/amount/PresetButton.css.d.ts +1 -0
  99. package/dist/v2/screens/amount/PresetButton.d.ts +9 -0
  100. package/dist/v2/screens/amount/fittedText/useFittedText.d.ts +19 -0
  101. package/dist/v2/screens/amount/fittedText/useIsomorphicEffect.d.ts +2 -0
  102. package/dist/v2/screens/amount/fittedText/useTextMeasurer.d.ts +3 -0
  103. package/dist/v2/screens/amount/typedAmount/amountText.d.ts +37 -0
  104. package/dist/v2/screens/amount/typedAmount/attachInputNormalization.d.ts +1 -0
  105. package/dist/v2/screens/fiat/FiatPlaceholderScreen.d.ts +9 -0
  106. package/dist/v2/screens/funLogin/FunLoginCodeScreen.d.ts +35 -0
  107. package/dist/v2/screens/funLogin/FunLoginEmailScreen.d.ts +26 -0
  108. package/dist/v2/screens/funLogin/FunLoginScreen.css.d.ts +20 -0
  109. package/dist/v2/screens/funLogin/looksLikeEmail.d.ts +5 -0
  110. package/dist/v2/theme/colors.d.ts +28 -0
  111. package/dist/v2/theme/fonts.d.ts +9 -0
  112. package/dist/v2/theme/radii.d.ts +6 -0
  113. package/dist/wallets/walletConnectors/index.js +39 -39
  114. package/package.json +4 -4
  115. package/dist/clients/chunk-JXTKKLVA.js +0 -185
  116. package/dist/clients/chunk-PZSKO3BJ.js +0 -60
  117. package/dist/components/FunPayments/icons/coinbase.d.ts +0 -5
@@ -17,7 +17,7 @@ export type DestinationAssetBalance = ConvertAssetBalance;
17
17
  * Reads wallet balances for the destination asset menu, in one call.
18
18
  * - Called when the menu opens, then every 60s while it stays open.
19
19
  * - Answer for exactly the assets passed; leave out any you can't read or
20
- * don't want labelled. Don't throw.
20
+ * don't want labeled. Don't throw.
21
21
  * @experimental
22
22
  */
23
23
  export type GetDestinationAssetBalances = (params: {
@@ -1,8 +1,7 @@
1
- import type { FunCheckoutStep } from '../../modals/CheckoutModal/FunCheckoutStep';
2
- import type { WithdrawalModalStep } from '../../modals/WithdrawalModal/types';
3
1
  import { type FunkitWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
2
+ import type { AnalyticsNamedStep } from '../../hooks/track/analytics/mappers';
4
3
  interface CheckoutQuoteParams {
5
- analyticsStep: FunCheckoutStep | WithdrawalModalStep;
4
+ analyticsStep: AnalyticsNamedStep;
6
5
  recipientAddress: string;
7
6
  selectedChainId: string | undefined;
8
7
  selectedTokenAddress: string | null | undefined;
@@ -2,3 +2,4 @@ export { useDynamicConfig } from './useDynamicConfig';
2
2
  export { useExperiment } from './useExperiment';
3
3
  export { useExperimentV2 } from '@funkit/connect-core';
4
4
  export { useFeatureGate } from './useFeatureGate';
5
+ export { useFeatureGateV2 } from '@funkit/connect-core';
@@ -6,7 +6,17 @@ import { WithdrawalModalStep } from '../../../modals/WithdrawalModal/types';
6
6
  import type { AnalyticsFlow, AnalyticsStep, PaymentMethodProperties } from './events';
7
7
  /** Round analytics amounts before Statsig stringifies event metadata. */
8
8
  export declare function formatAnalyticsAmount(amount: number | null): string | null;
9
- export declare function formatAnalyticsStep(step: FunCheckoutStep | WithdrawalModalStep): AnalyticsStep;
9
+ /**
10
+ * Steps that only host another renderer. Every V2 screen renders under
11
+ * FIAT_V2, so a step name for it would merge them all; V2 screens report
12
+ * their own shared names instead.
13
+ */
14
+ export type AnalyticsHostStep = FunCheckoutStep.FIAT_V2;
15
+ export type AnalyticsNamedStep = Exclude<FunCheckoutStep, AnalyticsHostStep> | WithdrawalModalStep;
16
+ export declare function isAnalyticsHostStep(step: FunCheckoutStep | WithdrawalModalStep): step is AnalyticsHostStep;
17
+ export declare function formatAnalyticsStep(step: AnalyticsNamedStep): AnalyticsStep;
18
+ /** `prev_step` after a host step is unknown to web V1, so it is reported as none. */
19
+ export declare function formatPrevAnalyticsStep(step: FunCheckoutStep | null): AnalyticsStep | null;
10
20
  export declare function getCheckoutModalAnalyticsFlow(modalState: CheckoutModalState): AnalyticsFlow;
11
21
  export declare function getHistoricalSourceAddress(sourceOfFund: string | null | undefined): string | null;
12
22
  /** Selected checkout provider, such as a wallet connector or Meld provider. */
@@ -0,0 +1 @@
1
+ export declare function getSwappedErrorCode(error: unknown): string;
@@ -1,11 +1,10 @@
1
1
  import type { ErrorNotification } from '../../../components/FunNotification/FunNotification';
2
- import type { FunCheckoutStep } from '../../../modals/CheckoutModal/FunCheckoutStep';
3
- import type { WithdrawalModalStep } from '../../../modals/WithdrawalModal/types';
4
2
  import { type AnalyticsFlow } from './events';
3
+ import { type AnalyticsNamedStep } from './mappers';
5
4
  type TrackErrorShownArgs = {
6
5
  error: ErrorNotification | null;
7
6
  flow: AnalyticsFlow;
8
- step: FunCheckoutStep | WithdrawalModalStep;
7
+ step: AnalyticsNamedStep;
9
8
  };
10
9
  /** Emits once for each continuous episode in which an error is displayed. */
11
10
  export declare function useTrackErrorShown({ error, flow, step }: TrackErrorShownArgs): void;
@@ -1,6 +1,11 @@
1
+ import { type QueryClient } from '@tanstack/react-query';
1
2
  import { type ConvertBalances } from '../domains/convert/balances';
2
3
  import type { ConvertRecipientAddresses, ConvertResolvedAsset, GetConvertBalances } from '../domains/convert/types';
3
- export declare const BALANCES_QUERY_KEY: readonly ['convert', 'balances'];
4
+ /**
5
+ * Marks every reader of the host's `getBalances` stale after funds land.
6
+ * Readers on screen read again now, the rest when they next show.
7
+ */
8
+ export declare function invalidateHostBalances(queryClient: QueryClient): void;
4
9
  interface UseConvertBalancesParams {
5
10
  /** Scopes reads to one checkout, whose `getBalances` may differ from the last. */
6
11
  checkoutId: string | undefined;
@@ -2,9 +2,9 @@
2
2
  * Retrieves the maximum checkout amount in USD and formats the limit text.
3
3
  *
4
4
  * @description
5
- * This hook uses a Statsig dynamic config to determine the maximum checkout amount.
6
- * If the amount is negative (e.g. -1), it returns 'no' as the limit text (no limit).
7
- * Otherwise, it formats the amount as a currency string with specific formatting options.
5
+ * The Statsig `maxcheckoutusd` config, lowered by the active checkout's
6
+ * `getMaxDepositUSD` (only while a checkout is active). A negative value
7
+ * means no limit, and the hook returns 'no' as the limit text.
8
8
  *
9
9
  * @returns {Object} An object containing:
10
10
  * - `value`: The maximum checkout amount in USD (number). Defaults to Number.MAX_VALUE (no limit).
@@ -0,0 +1,12 @@
1
+ import { CheckoutState, type DirectExecution } from '@funkit/api-base';
2
+ type HostDepositSettlement = {
3
+ state: CheckoutState;
4
+ message: string | undefined;
5
+ };
6
+ /**
7
+ * The host's answer for this deposit, or undefined when no host check applies.
8
+ * - It is a query so that the host is asked once however many components read
9
+ * the answer, and every reader gets the same one.
10
+ */
11
+ export declare function useHostDepositSettlement(directExecution: DirectExecution | undefined): HostDepositSettlement | undefined;
12
+ export {};
@@ -2,7 +2,7 @@
2
2
  * Modal open state plus a prop that outlives the close animation.
3
3
  *
4
4
  * The prop keys the modal component, so clearing it is delayed until the
5
- * animation finishes — and cancelled if the owner unmounts first, which would
5
+ * animation finishes — and canceled if the owner unmounts first, which would
6
6
  * otherwise set state on a torn-down tree.
7
7
  */
8
8
  export declare function useModalStateValueWithProp<T = string>(): {
@@ -0,0 +1,20 @@
1
+ import { type CheckoutHistoryItem } from '@funkit/api-base';
2
+ import type { MergedMultiStepDirectExecution } from '../domains/checkoutNotifications';
3
+ import type { NotificationItem } from '../modals/CheckoutModal/TransferToken/types';
4
+ /**
5
+ * Marks the host's balances stale once per completed deposit. Feed it every
6
+ * history update; polls keep reporting a deposit as completed. Each caller
7
+ * keeps its own record of the deposits it has refreshed for.
8
+ */
9
+ export declare function useRefreshBalancesOnDeposit(): (historyItem: NotificationItem) => void;
10
+ /**
11
+ * Marks the host's balances stale when a deposit in the recent deposit queries
12
+ * completes. Deposits already complete when a list first loads are recorded
13
+ * without a refresh. Reads the raw query data, so it doesn't depend on which
14
+ * notifications are on screen. Keeps its own record, separate from
15
+ * useRefreshBalancesOnDeposit.
16
+ */
17
+ export declare function useRefreshBalancesOnRecentDeposits({ checkouts, mergedDirectExecutions, }: {
18
+ checkouts: CheckoutHistoryItem[] | undefined;
19
+ mergedDirectExecutions: MergedMultiStepDirectExecution[] | undefined;
20
+ }): void;