@funkit/connect 8.3.1-next.0 → 8.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 (111) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/dist/{chunk-5JRQC2VM.js → chunk-4WY7FNYP.js} +14 -0
  3. package/dist/{chunk-CUWQELX3.js → chunk-UUHLEWAL.js} +4 -2
  4. package/dist/{chunk-VWSYBHAK.js → chunk-Z4QDKBBG.js} +4 -2
  5. package/dist/clients/fanatics.css +4064 -3651
  6. package/dist/clients/fanatics.d.ts +6 -0
  7. package/dist/clients/fanatics.js +118 -43
  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/FunTxSummarySections.d.ts +7 -0
  11. package/dist/components/FunCheckoutHistory/TotalTimeItem.d.ts +6 -0
  12. package/dist/components/FunCheckoutHistory/YouSendItem.d.ts +6 -0
  13. package/dist/components/FunCheckoutHistory/useCustomStatusAnimationAboveTopbar.d.ts +1 -3
  14. package/dist/components/FunCheckoutModalHeightAnimationWrapper/FunCheckoutModalHeightAnimationWrapper.d.ts +3 -1
  15. package/dist/components/FunInfoBanner/InfoBanner.d.ts +1 -1
  16. package/dist/components/FunPaymentMethodItem/FunPaymentMethodItem.d.ts +1 -0
  17. package/dist/components/FunPayments/FunPaymentMethods.d.ts +7 -0
  18. package/dist/components/Icons/New/CircleBitcoinIcon.d.ts +4 -0
  19. package/dist/components/Icons/New/DollarIcon.d.ts +3 -1
  20. package/dist/components/Tabs/Tabs.d.ts +1 -0
  21. package/dist/consts/customers.d.ts +1 -1
  22. package/dist/consts/layout.d.ts +0 -1
  23. package/dist/css/sprinkles.css.d.ts +91 -45
  24. package/dist/domains/asset.d.ts +1 -1
  25. package/dist/domains/meld.d.ts +0 -6
  26. package/dist/hooks/queries/useFops.d.ts +4 -2
  27. package/dist/hooks/queries/useSwappedDefaultCurrency.d.ts +5 -0
  28. package/dist/hooks/track/CheckoutModalEvent.d.ts +7 -0
  29. package/dist/hooks/useCheckoutDirectExecutionHistory.d.ts +1 -0
  30. package/dist/hooks/useStepQueryReadiness.d.ts +32 -0
  31. package/dist/index.css +4090 -3671
  32. package/dist/index.js +3894 -3058
  33. package/dist/modals/CheckoutModal/ConfirmationStep/useCheckoutConfirmation.d.ts +1 -0
  34. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +2 -1
  35. package/dist/modals/CheckoutModal/LoadingAccount.d.ts +1 -1
  36. package/dist/modals/CheckoutModal/MeldQuotes/MeldQuotes.d.ts +1 -1
  37. package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +5 -1
  38. package/dist/modals/CheckoutModal/SourceChange/FormOfPaymentsList.d.ts +10 -0
  39. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +10 -0
  40. package/dist/modals/CheckoutModal/SourceChange/SourceChangeLoading.d.ts +4 -0
  41. package/dist/modals/CheckoutModal/SourceChange/{DefaultSourceList.d.ts → SourceList.d.ts} +3 -3
  42. package/dist/modals/CheckoutModal/SourceChange/sourceChange.css.d.ts +2 -1
  43. package/dist/modals/CheckoutModal/stepTransition.d.ts +7 -0
  44. package/dist/providers/FunkitCheckoutContext/index.d.ts +1 -0
  45. package/dist/providers/FunkitConfigContext.d.ts +14 -0
  46. package/dist/providers/FunkitProvider.d.ts +1 -0
  47. package/dist/providers/FunkitThemeProvider.d.ts +69 -0
  48. package/dist/themes/baseTheme.js +1 -1
  49. package/dist/themes/darkTheme.js +2 -2
  50. package/dist/themes/lightTheme.js +2 -2
  51. package/dist/utils/across.d.ts +5 -0
  52. package/dist/utils/depositCutoff.d.ts +9 -0
  53. package/dist/utils/directExecution.d.ts +16 -0
  54. package/dist/utils/flags/config.d.ts +2 -2
  55. package/dist/utils/lighter.d.ts +1 -1
  56. package/dist/utils/sanitizeHtml.d.ts +7 -0
  57. package/dist/utils/sanitizeUrl.d.ts +10 -0
  58. package/dist/utils/tokenIconUrl.d.ts +1 -1
  59. package/dist/utils/transfer.d.ts +2 -1
  60. package/dist/wallets/walletConnectors/index.js +24 -24
  61. package/package.json +4 -4
  62. package/dist/atoms/activeCheckout.d.ts +0 -183
  63. package/dist/atoms/activeWithdrawal.d.ts +0 -21
  64. package/dist/atoms/bridgeProviders/acrossAdapter.d.ts +0 -109
  65. package/dist/atoms/bridgeProviders/index.d.ts +0 -25
  66. package/dist/atoms/bridgeProviders/registry.d.ts +0 -12
  67. package/dist/atoms/bridgeProviders/relayAdapter.d.ts +0 -60
  68. package/dist/atoms/bridgeProviders/types.d.ts +0 -182
  69. package/dist/atoms/checkoutProgress.d.ts +0 -22
  70. package/dist/atoms/directExecution.d.ts +0 -70
  71. package/dist/atoms/funkitCheckout.d.ts +0 -18
  72. package/dist/atoms/funkitProvider/index.d.ts +0 -24
  73. package/dist/atoms/generalWallet.d.ts +0 -45
  74. package/dist/atoms/i18n.d.ts +0 -6
  75. package/dist/atoms/modalState.d.ts +0 -30
  76. package/dist/atoms/quote.d.ts +0 -98
  77. package/dist/atoms/stepTransition.d.ts +0 -6
  78. package/dist/atoms/store.d.ts +0 -1
  79. package/dist/atoms/track/index.d.ts +0 -10
  80. package/dist/atoms/utils.d.ts +0 -2
  81. package/dist/atoms/wagmi.d.ts +0 -4
  82. package/dist/atoms/walletClient.d.ts +0 -15391
  83. package/dist/chunk-A24XIU2M.js +0 -299
  84. package/dist/chunk-CMS4F5PL.js +0 -209
  85. package/dist/chunk-FBCU3TQA.js +0 -204
  86. package/dist/chunk-GRQP5R23.js +0 -209
  87. package/dist/chunk-MGQZMUZ2.js +0 -288
  88. package/dist/chunk-OTMBU2BL.js +0 -204
  89. package/dist/domains/across.d.ts +0 -29
  90. package/dist/domains/track.d.ts +0 -14
  91. package/dist/hooks/useUsableWalletAssetsForCheckout.d.ts +0 -2
  92. package/dist/modals/CheckoutModal/SelectAsset.d.ts +0 -14
  93. package/dist/modals/CheckoutModal/SourceChange/FanaticsSourceList.d.ts +0 -15
  94. package/dist/wallets/walletConnectors/chunk-3ZWIUCOI.js +0 -96
  95. package/dist/wallets/walletConnectors/chunk-4SC3PZVM.js +0 -70
  96. package/dist/wallets/walletConnectors/chunk-5AV2NSL3.js +0 -98
  97. package/dist/wallets/walletConnectors/chunk-5FWURLPF.js +0 -218
  98. package/dist/wallets/walletConnectors/chunk-6677RKVT.js +0 -69
  99. package/dist/wallets/walletConnectors/chunk-75A4Q5E5.js +0 -92
  100. package/dist/wallets/walletConnectors/chunk-ENLR4LXN.js +0 -94
  101. package/dist/wallets/walletConnectors/chunk-FT5BX7TL.js +0 -103
  102. package/dist/wallets/walletConnectors/chunk-GEMN6DM5.js +0 -106
  103. package/dist/wallets/walletConnectors/chunk-GXTI2PZD.js +0 -100
  104. package/dist/wallets/walletConnectors/chunk-LGT6IAXI.js +0 -93
  105. package/dist/wallets/walletConnectors/chunk-N7475PGA.js +0 -110
  106. package/dist/wallets/walletConnectors/chunk-O6YFVGVQ.js +0 -99
  107. package/dist/wallets/walletConnectors/chunk-OCM5YHT5.js +0 -92
  108. package/dist/wallets/walletConnectors/chunk-PRGCIJ7Y.js +0 -87
  109. package/dist/wallets/walletConnectors/chunk-RNIMZDHW.js +0 -95
  110. package/dist/wallets/walletConnectors/chunk-TLOROKED.js +0 -96
  111. package/dist/wallets/walletConnectors/chunk-WNQ3NPHX.js +0 -66
@@ -3,7 +3,7 @@ import type { Address } from 'viem';
3
3
  import type { FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
4
4
  import type { AssetHoldingsItem } from '../utils/assets';
5
5
  import { PaymentMethod } from '../domains/paymentMethods';
6
- export declare const isStablecoin: (symbol: string) => string | undefined;
6
+ export declare const isStablecoin: (symbol: string) => boolean;
7
7
  export declare function isPreferredChain(chainId: number, additionalChains?: number[]): boolean;
8
8
  export declare function isNativeTokenAddress(address: Address): boolean;
9
9
  export declare function isDefaultToken(asset: AssetHoldingsItem, checkoutConfig: FunkitCheckoutConfig): boolean;
@@ -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
  */
@@ -4,12 +4,14 @@ export interface UseFopsParams {
4
4
  email?: string;
5
5
  /** Whether the query is enabled */
6
6
  enabled?: boolean;
7
+ /** Theme configuration for embedded flow iframes (key-value pairs for URL params) */
8
+ themeConfig?: Record<string, string>;
7
9
  }
8
10
  /**
9
11
  * Hook to fetch available forms of payment from the /fops API.
10
12
  * Returns generic and saved payment options from providers like Swapped.
11
13
  *
12
- * @param params - Optional parameters including email and enabled state
14
+ * @param params - Optional parameters including email, enabled state, and themeConfig
13
15
  * @returns Query result with genericFormsOfPayments and savedFormsOfPayments
14
16
  */
15
- export declare const useFops: ({ email, enabled }?: UseFopsParams) => import("@tanstack/react-query").UseQueryResult<GetFopsResponse, Error>;
17
+ export declare const useFops: ({ enabled, themeConfig, }?: UseFopsParams) => import("@tanstack/react-query").UseQueryResult<GetFopsResponse, Error>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Fetches Swapped supported countries and maps the user's country (alpha2)
3
+ * to get the currency code.
4
+ */
5
+ export declare const useSwappedDefaultCurrency: () => import("@tanstack/react-query").UseQueryResult<string, 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
+ };