@funkit/connect 8.3.0 → 8.4.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/__generated__/default_configs.d.ts +63 -0
  3. package/dist/{chunk-A24XIU2M.js → chunk-UE3P6YHW.js} +14 -0
  4. package/dist/{chunk-CMS4F5PL.js → chunk-XX5CVGHN.js} +3 -2
  5. package/dist/{chunk-GRQP5R23.js → chunk-YUWSE22N.js} +3 -2
  6. package/dist/clients/fanatics.css +3956 -3651
  7. package/dist/clients/fanatics.js +35 -6
  8. package/dist/components/Box/Box.d.ts +45 -45
  9. package/dist/components/FunCheckoutHistory/FunDirectExecutionHistoryBottomBar.d.ts +1 -0
  10. package/dist/components/FunCheckoutHistory/useCustomStatusAnimationAboveTopbar.d.ts +1 -3
  11. package/dist/components/FunCheckoutModalHeightAnimationWrapper/FunCheckoutModalHeightAnimationWrapper.d.ts +3 -1
  12. package/dist/components/FunInfoBanner/InfoBanner.d.ts +1 -1
  13. package/dist/components/FunPaymentMethodItem/FunPaymentMethodItem.d.ts +1 -0
  14. package/dist/components/FunPaymentMethodItem/FunPaymentMethodItemSkeleton.d.ts +2 -0
  15. package/dist/components/FunPayments/FunPaymentMethods.d.ts +7 -0
  16. package/dist/components/Icons/AcrossIcon.d.ts +4 -0
  17. package/dist/components/Tabs/Tabs.d.ts +1 -0
  18. package/dist/consts/customers.d.ts +1 -1
  19. package/dist/css/sprinkles.css.d.ts +87 -45
  20. package/dist/domains/meld.d.ts +0 -6
  21. package/dist/hooks/queries/useFops.d.ts +17 -0
  22. package/dist/hooks/track/CheckoutModalEvent.d.ts +7 -0
  23. package/dist/hooks/useCheckoutDirectExecutionHistory.d.ts +1 -0
  24. package/dist/hooks/useStepQueryReadiness.d.ts +32 -0
  25. package/dist/index.css +3976 -3665
  26. package/dist/index.js +3643 -2985
  27. package/dist/modals/CheckoutModal/ConfirmationStep/useCheckoutConfirmation.d.ts +1 -0
  28. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +2 -1
  29. package/dist/modals/CheckoutModal/LoadingAccount.d.ts +1 -1
  30. package/dist/modals/CheckoutModal/MeldQuotes/MeldQuotes.d.ts +1 -1
  31. package/dist/modals/CheckoutModal/SourceChange/ConnectedSource.d.ts +11 -0
  32. package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +5 -1
  33. package/dist/modals/CheckoutModal/SourceChange/FormOfPaymentsList.d.ts +10 -0
  34. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +10 -0
  35. package/dist/modals/CheckoutModal/SourceChange/SourceChangeLoading.d.ts +4 -0
  36. package/dist/modals/CheckoutModal/SourceChange/{DefaultSourceList.d.ts → SourceList.d.ts} +3 -3
  37. package/dist/modals/CheckoutModal/SourceChange/sourceChange.css.d.ts +2 -1
  38. package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframe.d.ts +16 -0
  39. package/dist/modals/CheckoutModal/SwappedIframe/index.d.ts +1 -0
  40. package/dist/modals/CheckoutModal/stepTransition.d.ts +7 -0
  41. package/dist/providers/FunkitCheckoutContext/index.d.ts +1 -0
  42. package/dist/providers/FunkitCheckoutContext/types.d.ts +1 -0
  43. package/dist/providers/FunkitConfigContext.d.ts +2 -0
  44. package/dist/providers/FunkitThemeProvider.d.ts +63 -0
  45. package/dist/themes/baseTheme.js +1 -1
  46. package/dist/themes/darkTheme.js +2 -2
  47. package/dist/themes/lightTheme.js +2 -2
  48. package/dist/utils/across.d.ts +5 -0
  49. package/dist/utils/depositCutoff.d.ts +9 -0
  50. package/dist/utils/directExecution.d.ts +16 -0
  51. package/dist/utils/flags/config.d.ts +2 -2
  52. package/dist/utils/lighter.d.ts +1 -3
  53. package/dist/utils/sanitizeHtml.d.ts +7 -0
  54. package/dist/utils/sanitizeUrl.d.ts +10 -0
  55. package/dist/utils/tokenIconUrl.d.ts +1 -1
  56. package/dist/wallets/walletConnectors/index.js +13 -13
  57. package/package.json +4 -4
  58. package/dist/modals/CheckoutModal/SourceChange/FanaticsSourceList.d.ts +0 -15
@@ -1,12 +1,6 @@
1
1
  import { type MeldQuote } from '@funkit/api-base';
2
2
  /**
3
3
  * Auto-pick the best quote for the user.
4
- * 1. If a quote has a customerScore >= 30, pick it
5
- * 2. If no quote has customerScore >= 30, pick either Coinbase or Binance
6
- * 2a. If both are available and they are at least 96% of the highest destinationAmount, pick the one with the best customerScore
7
- * 2aa. If they're have the same customerScore, pick the one with the highest destinationAmount
8
- * 2b. If both are available and they are less than 96% of the highest destinationAmount, pick the one with the highest destinationAmount
9
- * 3. If no quote has customerScore >= 30 and no Coinbase or Binance is available, pick the quote with the highest destinationAmount
10
4
  * @param quotes - the quotes to pick from
11
5
  * @returns the best quote based on the criteria
12
6
  */
@@ -0,0 +1,17 @@
1
+ import { type GetFopsResponse } from '@funkit/api-base';
2
+ export interface UseFopsParams {
3
+ /** User's email for Swapped integration */
4
+ email?: string;
5
+ /** Whether the query is enabled */
6
+ enabled?: boolean;
7
+ /** Theme configuration for embedded flow iframes (key-value pairs for URL params) */
8
+ themeConfig?: Record<string, string>;
9
+ }
10
+ /**
11
+ * Hook to fetch available forms of payment from the /fops API.
12
+ * Returns generic and saved payment options from providers like Swapped.
13
+ *
14
+ * @param params - Optional parameters including email, enabled state, and themeConfig
15
+ * @returns Query result with genericFormsOfPayments and savedFormsOfPayments
16
+ */
17
+ export declare const useFops: ({ enabled, themeConfig, }?: UseFopsParams) => import("@tanstack/react-query").UseQueryResult<GetFopsResponse, Error>;
@@ -24,10 +24,17 @@ export declare enum CheckoutModalEvent {
24
24
  NAVIGATE_CONNECT_EXCHANGE = "fc::navigate::connect_exchange",
25
25
  NAVIGATE_BROKERAGE_TWO_FA = "fc::navigate::brokerage_two_fa",
26
26
  NAVIGATE_BROKERAGE_SUCCESS = "fc::navigate::brokerage_success",
27
+ NAVIGATE_SWAPPED_IFRAME = "fc::navigate::swapped_iframe",
27
28
  READY_CONFIRMATION = "fc::ready::confirmation",
28
29
  READY_INPUT_AMOUNT = "fc::ready::input_amount",
29
30
  READY_SELECT_ASSET = "fc::ready::select_asset",
30
31
  READY_SOURCE_CHANGE = "fc::ready::source_change",
32
+ READY_TRANSFER_TOKEN = "fc::ready::transfer_token",
33
+ READY_LOADING_ACCOUNT = "fc::ready::loading_account",
34
+ QUERY_FROG_SUB_ACCOUNTS = "fc::query::frog_sub_accounts",
35
+ QUERY_UDA_ADDRESS = "fc::query::uda_address",
36
+ QUERY_WALLET_ASSETS = "fc::query::wallet_assets",
37
+ QUERY_VIRTUAL_FIAT_ACCOUNTS = "fc::query::virtual_fiat_accounts",
31
38
  BASE_QUOTE = "fc::quote::base_quote",
32
39
  FINAL_QUOTE = "fc::quote::final_quote",
33
40
  VIEW_TRANSACTION_BREAKDOWN = "fc::quote::view_transaction_breakdown",
@@ -8,6 +8,7 @@ export declare function useCheckoutDirectExecutionHistory({ initDirectExecution,
8
8
  }): {
9
9
  state: CheckoutState;
10
10
  refundState: CheckoutRefundState | undefined;
11
+ isAcross: boolean;
11
12
  isLayerZero: boolean | null | undefined;
12
13
  isRefunded: boolean;
13
14
  isCompleted: boolean;
@@ -0,0 +1,32 @@
1
+ import type { CheckoutModalEvent } from '../hooks/track/CheckoutModalEvent';
2
+ import type { useTrack } from '../hooks/track/useTrack';
3
+ import type { FunCheckoutStep } from '../modals/CheckoutModal/FunCheckoutStep';
4
+ export interface StepQueryMeta extends Record<string, unknown> {
5
+ /** Checkout steps that depend on this query being loaded */
6
+ dependentSteps: FunCheckoutStep[];
7
+ /** camelCase identifier for this query, used as key in timing metadata */
8
+ name: string;
9
+ /** Statsig event to emit with this query's individual timing */
10
+ timingEvent: CheckoutModalEvent;
11
+ }
12
+ export declare function stepQueryMeta(params: {
13
+ name: string;
14
+ timingEvent: CheckoutModalEvent;
15
+ dependentSteps: FunCheckoutStep[];
16
+ }): StepQueryMeta;
17
+ /**
18
+ * Ensures all React Query dependencies for a checkout step are loaded before
19
+ * marking the step as ready. Queries opt in via `stepQueryMeta()` in their
20
+ * query options.
21
+ *
22
+ * Emits:
23
+ * - A per-query Statsig event (the query's `timingEvent`) with duration as value
24
+ * - A step-level measured event (`fc::ready::*`) with per-query timing metadata
25
+ *
26
+ * Steps without dependencies are skipped — no event is emitted and
27
+ * `isStepReady` is set immediately.
28
+ */
29
+ export declare function useStepQueryReadiness(logEvent: ReturnType<typeof useTrack>['logEvent'], logMeasuredEvent: ReturnType<typeof useTrack>['logMeasuredEvent']): {
30
+ isStepReady: boolean;
31
+ ensureStepQueries: (step: FunCheckoutStep) => Promise<void>;
32
+ };