@funkit/connect 10.2.1 → 10.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 (145) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/{chunk-36KVHK22.js → chunk-L67HP4HQ.js} +1 -1
  3. package/dist/clients/chunk-2YWQL3AO.js +46 -0
  4. package/dist/clients/chunk-APQYFP6X.js +207 -0
  5. package/dist/clients/chunk-BNMZM23Q.js +42 -0
  6. package/dist/clients/chunk-HOORQPSY.js +4660 -0
  7. package/dist/clients/chunk-II5CZTBC.js +18 -0
  8. package/dist/clients/chunk-KNHO756P.js +28 -0
  9. package/dist/clients/chunk-L2KSNS7H.js +112 -0
  10. package/dist/clients/{chunk-ZAXSDMDU.js → chunk-M6C7MBQN.js} +2 -2
  11. package/dist/clients/chunk-OZ3KD24N.js +107 -0
  12. package/dist/clients/{chunk-E3USJY7A.js → chunk-RCMAGKMG.js} +35 -4
  13. package/dist/clients/fanatics.js +1 -1
  14. package/dist/clients/internal/nado/consts.d.ts +16 -0
  15. package/dist/clients/internal/nado/consts.js +13 -0
  16. package/dist/clients/internal/nado/encoding.d.ts +22 -0
  17. package/dist/clients/internal/nado/encoding.js +32 -0
  18. package/dist/clients/internal/nado/errors.d.ts +55 -0
  19. package/dist/clients/internal/nado/errors.js +15 -0
  20. package/dist/clients/internal/nado/fetch.d.ts +15 -0
  21. package/dist/clients/internal/nado/fetch.js +9 -0
  22. package/dist/clients/internal/nado/gateway.d.ts +83 -0
  23. package/dist/clients/internal/nado/gateway.js +23 -0
  24. package/dist/clients/internal/nado/hooks.d.ts +360 -0
  25. package/dist/clients/internal/nado/hooks.js +132 -0
  26. package/dist/clients/internal/nado/indexer.d.ts +43 -0
  27. package/dist/clients/internal/nado/indexer.js +13 -0
  28. package/dist/clients/internal/nado/products.d.ts +36 -0
  29. package/dist/clients/internal/nado/products.js +19 -0
  30. package/dist/clients/internal/nado/typedData.d.ts +80 -0
  31. package/dist/clients/internal/nado/typedData.js +43 -0
  32. package/dist/clients/lighter.css +12 -1
  33. package/dist/clients/lighter.js +118 -42
  34. package/dist/clients/mallard.js +9 -24
  35. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +12 -1
  36. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +3 -3
  37. package/dist/clients/polymarket/index.css +12 -1
  38. package/dist/clients/polymarket/index.js +3 -3
  39. package/dist/components/ChainIcon/ChainIcon.d.ts +16 -0
  40. package/dist/components/Dialog/Dialog.d.ts +1 -1
  41. package/dist/components/Dialog/hooks.d.ts +1 -2
  42. package/dist/components/FreeUsdcBanner/FreeUsdcBanner.d.ts +1 -1
  43. package/dist/components/FunAssetAvatar/FunAssetAvatar.d.ts +1 -2
  44. package/dist/components/FunInput/FunInput.d.ts +2 -0
  45. package/dist/components/FunkitTrans.d.ts +14 -0
  46. package/dist/hooks/useChainMetadata.d.ts +11 -0
  47. package/dist/hooks/useFunkitTranslation.d.ts +3 -1
  48. package/dist/hooks/usePaymentMethodTabs.d.ts +10 -1
  49. package/dist/hooks/useSwappedIframeLifecycle.d.ts +5 -2
  50. package/dist/hooks/useSwappedPreload.d.ts +8 -3
  51. package/dist/hooks/useUserIpInfo.d.ts +1 -19
  52. package/dist/index.css +12 -1
  53. package/dist/index.js +15902 -15844
  54. package/dist/modals/CheckoutModal/InputAmount/InputAmount.css.d.ts +1 -0
  55. package/dist/modals/CheckoutModal/SourceChange/FormOfPaymentsList.d.ts +6 -2
  56. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +29 -0
  57. package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframe.d.ts +4 -1
  58. package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframeController.d.ts +3 -0
  59. package/dist/modals/CheckoutModal/Withdrawal/WithdrawalComplete.d.ts +15 -1
  60. package/dist/modals/CheckoutModal/Withdrawal/WithdrawalEnterAmount.d.ts +12 -1
  61. package/dist/modals/CheckoutModal/isWithdrawalStep.d.ts +25 -0
  62. package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +15 -1
  63. package/dist/modals/WithdrawalModal/WithdrawalMethodSelect.d.ts +5 -1
  64. package/dist/providers/FunkitCheckoutContext/index.d.ts +15 -1
  65. package/dist/providers/FunkitCheckoutContext/types.d.ts +34 -5
  66. package/dist/providers/FunkitConfigContext.d.ts +4 -0
  67. package/dist/providers/FunkitI18nProvider.d.ts +6 -2
  68. package/dist/providers/SwappedProvider.d.ts +5 -3
  69. package/dist/themes/darkTheme.js +1 -1
  70. package/dist/utils/tokenIconUrl.d.ts +5 -0
  71. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  72. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  73. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  74. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  75. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  76. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  77. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  78. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  79. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  80. package/dist/wallets/walletConnectors/index.js +59 -59
  81. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  82. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  83. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  84. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  85. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  86. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  87. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  88. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  89. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  90. package/package.json +7 -5
  91. package/dist/clients/chunk-STLOQEN7.js +0 -11
  92. package/dist/components/FunInput/FunTextAreaInput.css.d.ts +0 -1
  93. package/dist/components/FunInput/FunTextAreaInput.d.ts +0 -3
  94. package/dist/components/Icons/AcornsIcon.d.ts +0 -4
  95. package/dist/components/Icons/AlpacaIcon.d.ts +0 -4
  96. package/dist/components/Icons/BitFlyerIcon.d.ts +0 -4
  97. package/dist/components/Icons/BitfinexIcon.d.ts +0 -4
  98. package/dist/components/Icons/BitstampIcon.d.ts +0 -4
  99. package/dist/components/Icons/BrokerageIcon.d.ts +0 -4
  100. package/dist/components/Icons/CexloIcon.d.ts +0 -4
  101. package/dist/components/Icons/CoinlistIcon.d.ts +0 -4
  102. package/dist/components/Icons/CryptoComIcon.d.ts +0 -4
  103. package/dist/components/Icons/CryptoIcon.d.ts +0 -2
  104. package/dist/components/Icons/DeviceConfirmationIcon.d.ts +0 -2
  105. package/dist/components/Icons/EmailConfirmationIcon.d.ts +0 -2
  106. package/dist/components/Icons/EtoroIcon.d.ts +0 -4
  107. package/dist/components/Icons/EtradeIcon.d.ts +0 -4
  108. package/dist/components/Icons/HuobiIcon.d.ts +0 -4
  109. package/dist/components/Icons/KucoinIcon.d.ts +0 -4
  110. package/dist/components/Icons/LightningBoltIcon.d.ts +0 -4
  111. package/dist/components/Icons/LockIcon.d.ts +0 -4
  112. package/dist/components/Icons/MailIcon.d.ts +0 -6
  113. package/dist/components/Icons/New/LinkExternalIcon.d.ts +0 -4
  114. package/dist/components/Icons/New/MessageIcon.d.ts +0 -2
  115. package/dist/components/Icons/OkcoinIcon.d.ts +0 -4
  116. package/dist/components/Icons/OkxIcon.d.ts +0 -4
  117. package/dist/components/Icons/PublicIcon.d.ts +0 -4
  118. package/dist/components/Icons/RobinhoodIcon.d.ts +0 -4
  119. package/dist/components/Icons/SocialMediaIcons.d.ts +0 -13
  120. package/dist/components/Icons/SocialsIcon.d.ts +0 -2
  121. package/dist/components/Icons/StashIcon.d.ts +0 -4
  122. package/dist/components/Icons/WeBullIcon.d.ts +0 -4
  123. package/dist/components/Icons/WhitelistIcon.d.ts +0 -2
  124. package/dist/hooks/useIsUsUser.d.ts +0 -1
  125. package/dist/utils/privyHelper.d.ts +0 -3
  126. package/dist/utils/safeJSON.d.ts +0 -5
  127. package/dist/utils/tokenTransfer/disabledList.d.ts +0 -1
  128. package/dist/wallets/walletConnectors/{chunk-RB3HR4R2.js → chunk-4NV5BYRP.js} +3 -3
  129. package/dist/wallets/walletConnectors/{chunk-YEZM4CK4.js → chunk-AVDUNQUW.js} +3 -3
  130. package/dist/wallets/walletConnectors/{chunk-MIQTHJ6X.js → chunk-GUQM4QSL.js} +3 -3
  131. package/dist/wallets/walletConnectors/{chunk-4T6ZSRJF.js → chunk-IULPZP2Q.js} +3 -3
  132. package/dist/wallets/walletConnectors/{chunk-HNRB7KJU.js → chunk-JPN6TWIT.js} +3 -3
  133. package/dist/wallets/walletConnectors/{chunk-ZNX4EMPB.js → chunk-KCRO2AGO.js} +3 -3
  134. package/dist/wallets/walletConnectors/{chunk-STVVP43G.js → chunk-KI5Y2BBF.js} +3 -3
  135. package/dist/wallets/walletConnectors/{chunk-X6CGV36L.js → chunk-NR2OGDHQ.js} +3 -3
  136. package/dist/wallets/walletConnectors/{chunk-UK7C2JXW.js → chunk-OEEGYENV.js} +3 -3
  137. package/dist/wallets/walletConnectors/{chunk-F5XEEVG6.js → chunk-OX37G4YT.js} +3 -3
  138. package/dist/wallets/walletConnectors/{chunk-RVOY537T.js → chunk-SWFF3TWJ.js} +3 -3
  139. package/dist/wallets/walletConnectors/{chunk-CPI4TD43.js → chunk-TKB2OY6G.js} +3 -3
  140. package/dist/wallets/walletConnectors/{chunk-2VP2F6EK.js → chunk-W2LCLDPX.js} +3 -3
  141. package/dist/wallets/walletConnectors/{chunk-6BW3HLBG.js → chunk-WAHGI5L7.js} +3 -3
  142. package/dist/wallets/walletConnectors/{chunk-HTHAK6XB.js → chunk-WKNQMP4A.js} +3 -3
  143. package/dist/wallets/walletConnectors/{chunk-VTM6EECM.js → chunk-XCNHV3HS.js} +3 -3
  144. package/dist/wallets/walletConnectors/{chunk-CCQV2ZET.js → chunk-YO2K4MBH.js} +3 -3
  145. package/dist/wallets/walletConnectors/{chunk-VAPGUPHO.js → chunk-YQFGVZGR.js} +3 -3
@@ -0,0 +1 @@
1
+ export declare const amountInputFontSize: string;
@@ -1,6 +1,6 @@
1
1
  import type { ExchangeRates, GetFopsResponse, SavedFormOfPayment, SwappedFormOfPayment } from '@funkit/api-base';
2
2
  import type { ListFormOfPayment, SyntheticFormOfPayment } from '@funkit/connect-core';
3
- import React from 'react';
3
+ import React, { type ReactNode } from 'react';
4
4
  /** FOP list normalized to hold real (Swapped) and synthetic methods together. */
5
5
  interface ListFopsData {
6
6
  genericFormsOfPayments: ListFormOfPayment[];
@@ -32,6 +32,10 @@ interface FormOfPaymentsListProps {
32
32
  * predicate if per-provider minimums ever diverge.
33
33
  */
34
34
  isBelowMinimumBalance?: boolean;
35
+ /**
36
+ * Rendered above FOPs within a same list
37
+ */
38
+ cryptoPaymentMethodItem?: ReactNode;
35
39
  }
36
40
  interface FormOfPaymentSection {
37
41
  items: ListFormOfPayment[];
@@ -41,5 +45,5 @@ export declare function getFormOfPaymentSections(fopsData: ListFopsData, fopPrio
41
45
  primary: FormOfPaymentSection;
42
46
  secondary: FormOfPaymentSection;
43
47
  };
44
- export declare function FormOfPaymentsList({ fopsData, isLoading, selectedFop, syntheticFops, onSelect, exchangeRatesData, getDisclaimerLimit, enableSourceGroupLabels, isDisabled, isBelowMinimumBalance, }: FormOfPaymentsListProps): React.JSX.Element;
48
+ export declare function FormOfPaymentsList({ fopsData, isLoading, selectedFop, syntheticFops, onSelect, exchangeRatesData, getDisclaimerLimit, enableSourceGroupLabels, isDisabled, isBelowMinimumBalance, cryptoPaymentMethodItem, }: FormOfPaymentsListProps): React.JSX.Element;
45
49
  export {};
@@ -1,12 +1,24 @@
1
1
  import { type SwappedFormOfPayment } from '@funkit/api-base';
2
2
  import React from 'react';
3
+ import type { Hex } from 'viem';
3
4
  import { type ConnectablePaymentMethodInfo, PaymentMethod, type PaymentMethodBitcoinLightningInfo, type PaymentMethodCardInfo, type PaymentMethodCashAppLightningInfo, type PaymentMethodVirtualBankIncompleteInfo } from '../../../domains/paymentMethods';
5
+ import type { FunkitCheckoutQuoteResult } from '../../../domains/quote';
4
6
  import { type PaymentMethodType } from '../../../hooks/usePaymentSources';
7
+ import { type CustomWithdrawalConfig, type WalletWithdrawalConfig } from '../../../providers/FunkitCheckoutContext';
5
8
  import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
9
+ import type { SwappedMode } from '../../../providers/SwappedProvider';
6
10
  export type SourceChangeState = CheckoutModalCommonState & {
7
11
  paymentMethodInfo: ConnectablePaymentMethodInfo | null;
8
12
  /** Persisted payment method type filter (crypto/fiat tab) */
9
13
  paymentMethodTypeFilter?: PaymentMethodType;
14
+ /**
15
+ * Resolved single-method withdrawal config, seeded while the Withdraw tab is
16
+ * open so the modal-level effect in `FunCheckoutModal` can enter withdrawal
17
+ * mode in lockstep with the tab — the withdraw tab may render withdrawal-mode
18
+ * UI while still on SourceChange. Cleared when leaving the tab so the effect
19
+ * reverts back to deposit mode. Read only by that effect.
20
+ */
21
+ withdrawalConfig?: WalletWithdrawalConfig | CustomWithdrawalConfig;
10
22
  };
11
23
  export type SourceChangeNext = {
12
24
  connectNew: false;
@@ -45,6 +57,8 @@ export type SourceChangeNext = {
45
57
  selectedPaymentOption: SwappedFormOfPayment;
46
58
  /** Payment method type filter to restore when returning */
47
59
  paymentMethodTypeFilter: PaymentMethodType;
60
+ /** Slot/origin for the shared Swapped iframe step */
61
+ swappedMode: SwappedMode;
48
62
  } | {
49
63
  /**
50
64
  * Skip the asset-select screen; land on InputAmount with the
@@ -53,6 +67,21 @@ export type SourceChangeNext = {
53
67
  */
54
68
  skipAssetSelect: true;
55
69
  paymentMethodInfo: ConnectablePaymentMethodInfo;
70
+ } | {
71
+ /** Enter the cashier withdrawal flow with a resolved single-method config. */
72
+ withdraw: true;
73
+ withdrawalConfig: WalletWithdrawalConfig | CustomWithdrawalConfig;
74
+ } | {
75
+ /**
76
+ * Inline withdrawal (swapped-withdrawal flag off): the amount form is
77
+ * rendered directly in the Withdraw tab, so on success we jump straight
78
+ * to the completion screen rather than through WITHDRAWAL_ENTER_AMOUNT.
79
+ */
80
+ withdrawComplete: true;
81
+ hash: Hex;
82
+ withdrawnAmount: string;
83
+ tokenSymbol: string;
84
+ quote?: FunkitCheckoutQuoteResult;
56
85
  };
57
86
  export declare const SourceChangeInfo: ModalStepInfo<FunCheckoutStep.SOURCE_CHANGE>;
58
87
  export declare function SourceChange({ modalState, onClose, onNext, onStepChange, setModalState, }: ModalStepComponentProps<FunCheckoutStep.SOURCE_CHANGE>): React.JSX.Element;
@@ -1,3 +1,6 @@
1
1
  import React from 'react';
2
- declare const _default: React.MemoExoticComponent<() => React.JSX.Element | null>;
2
+ import { type SwappedMode } from '../../../providers/SwappedProvider';
3
+ declare const _default: React.MemoExoticComponent<({ mode }: {
4
+ mode: SwappedMode;
5
+ }) => React.JSX.Element | null>;
3
6
  export default _default;
@@ -2,11 +2,14 @@ import type { SwappedFormOfPayment } from '@funkit/api-base';
2
2
  import React from 'react';
3
3
  import type { PaymentMethodType } from '../../../hooks/usePaymentSources';
4
4
  import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../../../modals/CheckoutModal/stepTransition';
5
+ import { type SwappedMode } from '../../../providers/SwappedProvider';
5
6
  export type SwappedIframeState = CheckoutModalCommonState & {
6
7
  /** The selected payment option from the fops API */
7
8
  selectedPaymentOption: SwappedFormOfPayment;
8
9
  /** Payment method type filter to restore when returning to SOURCE_CHANGE */
9
10
  paymentMethodTypeFilter?: PaymentMethodType;
11
+ /** Slot/origin for the shared Swapped iframe step */
12
+ swappedMode: SwappedMode;
10
13
  /** Set to true when an error occurs (iframe error or load timeout) */
11
14
  error?: boolean;
12
15
  };
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { Hex } from 'viem';
2
3
  import type { FunkitCheckoutQuoteResult } from '../../../domains/quote';
3
4
  import type { CustomWithdrawalConfig, WalletWithdrawalConfig } from '../../../providers/FunkitCheckoutContext';
@@ -11,4 +12,17 @@ export type WithdrawalCompleteState = CheckoutModalCommonState & {
11
12
  };
12
13
  export type WithdrawalCompleteNext = Record<never, never>;
13
14
  export declare const WithdrawalCompleteInfo: ModalStepInfo<FunCheckoutStep.WITHDRAWAL_COMPLETE>;
14
- export declare function WithdrawalComplete(_props: ModalStepComponentProps<FunCheckoutStep.WITHDRAWAL_COMPLETE>): null;
15
+ /**
16
+ * Cashier withdrawal completion screen. Mirrors the standalone `WithdrawalModal`
17
+ * success screens, adapted to the CheckoutModal step contract and its bottom-bar
18
+ * portal (`MODAL_BOTTOM_BAR_IDS.checkout`):
19
+ *
20
+ * - Wallet config → {@link WithdrawSuccess} (transaction detail keyed by tx hash).
21
+ * - Custom callback config → {@link WithdrawalCallbackSuccess} (pending screen).
22
+ *
23
+ * Lighter Secure (mainnet) is intentionally NOT branched here yet — its success
24
+ * component hard-codes the standalone `'withdrawal'` bottom-bar id, so wiring it
25
+ * into the cashier is deferred to a follow-up. A Lighter customer falls into the
26
+ * generic callback screen until then.
27
+ */
28
+ export declare function WithdrawalComplete({ modalState, onClose, onNext, }: ModalStepComponentProps<FunCheckoutStep.WITHDRAWAL_COMPLETE>): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { Hex } from 'viem';
2
3
  import type { FunkitCheckoutQuoteResult } from '../../../domains/quote';
3
4
  import type { CustomWithdrawalConfig, WalletWithdrawalConfig } from '../../../providers/FunkitCheckoutContext';
@@ -12,4 +13,14 @@ export type WithdrawalEnterAmountNext = {
12
13
  quote?: FunkitCheckoutQuoteResult;
13
14
  };
14
15
  export declare const WithdrawalEnterAmountInfo: ModalStepInfo<FunCheckoutStep.WITHDRAWAL_ENTER_AMOUNT>;
15
- export declare function WithdrawalEnterAmount(_props: ModalStepComponentProps<FunCheckoutStep.WITHDRAWAL_ENTER_AMOUNT>): null;
16
+ /**
17
+ * Cashier withdrawal amount entry. Thin adapter that renders the shared
18
+ * {@link WithdrawContent} form against the resolved single-method config carried
19
+ * on the modal state, mirroring the standalone `WithdrawalModal` amount screen
20
+ * (free-USDC banner above the form).
21
+ *
22
+ * Submitting executes the real withdrawal: `WithdrawContent`'s CTA fires
23
+ * `useWithdrawal`, whose `onSuccess` maps `onContinue` → `onNext`, advancing to
24
+ * `WITHDRAWAL_COMPLETE`.
25
+ */
26
+ export declare function WithdrawalEnterAmount({ modalState, onNext, }: ModalStepComponentProps<FunCheckoutStep.WITHDRAWAL_ENTER_AMOUNT>): React.JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { FunCheckoutStep } from './FunCheckoutStep';
2
+ import type { CheckoutModalState } from './stepTransition';
3
+ /** Steps whose state carries a `withdrawalConfig` (the withdrawal-mode region). */
4
+ type WithdrawalStep = FunCheckoutStep.WITHDRAWAL_ENTER_AMOUNT | FunCheckoutStep.WITHDRAWAL_COMPLETE | FunCheckoutStep.SOURCE_CHANGE;
5
+ /**
6
+ * Authoritative list of steps that require the shared active checkout to be in
7
+ * *withdrawal* mode (`convertActiveCheckoutToWithdrawal`). `FunCheckoutModal`'s
8
+ * checkout↔withdrawal lifecycle effect keys off this.
9
+ *
10
+ * - Dedicated withdrawal steps (enter-amount, complete) always qualify.
11
+ * - The Withdraw tab on SourceChange qualifies only once its `withdrawalConfig`
12
+ * is seeded: the swapped chooser tab leaves it undefined, so a mere tab visit
13
+ * must not hijack deposit query authority into withdrawal mode.
14
+ *
15
+ * Narrows to the states that carry `withdrawalConfig`, so callers can read it
16
+ * without re-checking the step. Adding a new withdrawal screen? Add its step
17
+ * both here and to {@link WithdrawalStep}, or the modal won't enter withdrawal
18
+ * mode for it.
19
+ *
20
+ * Lives in its own module (not `stepTransition.ts`) so it stays a pure,
21
+ * dependency-light helper — importable without pulling in the step components,
22
+ * and unit-testable without mocking the modal graph.
23
+ */
24
+ export declare function isWithdrawalStep(modalState: CheckoutModalState): modalState is CheckoutModalState<WithdrawalStep>;
25
+ export {};
@@ -1,6 +1,7 @@
1
1
  import type { TFunction } from 'i18next';
2
2
  import React from 'react';
3
3
  import type { Hex } from 'viem';
4
+ import { type ModalBottomBarIdType } from '../../components/Dialog/Dialog';
4
5
  import type { CustomWithdrawalConfig, FunkitActiveWithdrawalItem, FunkitCheckoutConfig, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
5
6
  import { type WithdrawalFormData } from './useWithdrawal';
6
7
  /**
@@ -17,6 +18,19 @@ interface WithdrawContentProps {
17
18
  * {@link WithdrawalModal}; used by the over-$3M footer.
18
19
  */
19
20
  onSwitchToSecure?: () => void;
21
+ /**
22
+ * Portal target for the CTA. Defaults to the standalone WithdrawalModal's
23
+ * bottom bar; the unified CheckoutModal cashier flow passes `'checkout'` so
24
+ * the button lands in the checkout modal's bottom section instead.
25
+ */
26
+ bottomBarId?: ModalBottomBarIdType;
27
+ /**
28
+ * When true the submit CTA is rendered inert (disabled, no-op click) — no
29
+ * withdrawal executes and `onContinue` never fires. Used by the cashier amount
30
+ * step while the continue/success flow is not yet wired. Defaults to false so
31
+ * the standalone WithdrawalModal is unaffected.
32
+ */
33
+ disableSubmit?: boolean;
20
34
  }
21
35
  /**
22
36
  * Converts a source-token amount string to its USD value using the given unit
@@ -77,5 +91,5 @@ export declare const useFrozenSourceTokenBalance: ({ isWithdrawing, sourceTokenB
77
91
  * Currently returns a single option per config; expands when Lighter exposes
78
92
  * multi-asset API support.
79
93
  */
80
- export declare const WithdrawContent: ({ onContinue, config, withdrawalItem, onSwitchToSecure, }: WithdrawContentProps) => React.JSX.Element;
94
+ export declare const WithdrawContent: ({ onContinue, config, withdrawalItem, onSwitchToSecure, bottomBarId, disableSubmit, }: WithdrawContentProps) => React.JSX.Element;
81
95
  export {};
@@ -11,6 +11,10 @@ interface WithdrawalMethodSelectProps {
11
11
  * Omit/0 when unknown — no cap is sent and the iframe stays uncapped.
12
12
  */
13
13
  usdBalance?: number;
14
+ /**
15
+ * Hide the "Crypto" / "Cash" section labels. Used by Cashier flow.
16
+ */
17
+ hideSectionLabels?: boolean;
14
18
  }
15
- export declare function WithdrawalMethodSelect({ onCryptoSelect, onCashFopSelect, sourceChainId, sourceTokenAddress, usdBalance, }: WithdrawalMethodSelectProps): React.JSX.Element;
19
+ export declare function WithdrawalMethodSelect({ onCryptoSelect, onCashFopSelect, sourceChainId, sourceTokenAddress, usdBalance, hideSectionLabels, }: WithdrawalMethodSelectProps): React.JSX.Element;
16
20
  export {};
@@ -5,7 +5,7 @@ import { type PaymentMethodInfo } from '../../domains/paymentMethods';
5
5
  import type { AssetHoldingsItem } from '../../utils/assets';
6
6
  import type { WithdrawalClient, WithdrawalTransaction } from '../../wallets/Wallet';
7
7
  import { type FunkitCheckoutQuoteResult } from '../FunkitHistoryContext';
8
- import type { DynamicTargetAssetCandidate, FunkitActiveCheckoutItem, FunkitActiveWithdrawalItem, FunkitCheckoutConfig, FunkitWithdrawalConfig, UseFunkitCheckoutProps, UseFunkitCheckoutPropsWithFullConfig } from './types';
8
+ import type { CustomWithdrawalConfig, DynamicTargetAssetCandidate, FunkitActiveCheckoutItem, FunkitActiveWithdrawalItem, FunkitCheckoutConfig, FunkitWithdrawalConfig, UseFunkitCheckoutProps, UseFunkitCheckoutPropsWithFullConfig, WalletWithdrawalConfig } from './types';
9
9
  export * from './types';
10
10
  interface FunkitCheckoutContextInterface {
11
11
  checkoutItem: FunkitActiveCheckoutItem | null;
@@ -43,6 +43,20 @@ interface FunkitCheckoutContextInterface {
43
43
  updateWithdrawalSourceAssetAmount(newSourceAmount: string): void;
44
44
  resetForNewWithdrawal(): void;
45
45
  resetForNewDeposit(): void;
46
+ /**
47
+ * Switch the active checkout into a withdrawal-shaped item (same id, so the
48
+ * open modal's frozen `modalState.checkoutId` stays coherent and the modal does
49
+ * not remount) and populate `withdrawalItem`. Reuses the shared
50
+ * `buildWithdrawalActiveItems` shape so the cashier matches the standalone, but
51
+ * snapshots the prior deposit item so {@link revertActiveCheckoutFromWithdrawal}
52
+ * can restore it — `WithdrawContent` overwrites the active item's target
53
+ * asset/chain while in withdraw mode, so the snapshot (not a flag flip) is what
54
+ * makes revert lossless. Used by the cashier withdraw tab; the standalone
55
+ * `WithdrawalModal` uses {@link initNewWithdrawal} instead.
56
+ */
57
+ convertActiveCheckoutToWithdrawal(config: WalletWithdrawalConfig | CustomWithdrawalConfig): void;
58
+ /** Restore the deposit snapshot taken by {@link convertActiveCheckoutToWithdrawal} and clear `withdrawalItem`. */
59
+ revertActiveCheckoutFromWithdrawal(): void;
46
60
  applyDynamicRouting(path: ApplyDynamicRoutingPath): void;
47
61
  updateDynamicRoutingId(dynamicRoutingId: string): void;
48
62
  /**
@@ -381,7 +381,8 @@ export type FunkitCheckoutResult = {
381
381
  message: string;
382
382
  metadata: object | Error;
383
383
  };
384
- export interface UseFunkitCheckoutProps {
384
+ /** Props common to every checkout, regardless of form factor. */
385
+ interface UseFunkitCheckoutBaseProps {
385
386
  /** @optional the checkout config object **/
386
387
  config?: FunkitCheckoutConfig;
387
388
  /** @optional fires when the checkout modal is opened **/
@@ -407,18 +408,46 @@ export interface UseFunkitCheckoutProps {
407
408
  onLoginRequired?: ({ onLoginFinished, }: {
408
409
  onLoginFinished?: () => void;
409
410
  }) => void;
410
- /** @optional fires when a withdrawal is confirmed with the funkit server. Returns the newly created withdrawalId. **/
411
- onWithdrawalConfirmation?: (withdrawalId: string) => void;
412
411
  /** @optional fires when checkout is blocked (e.g. geo-restriction, security hold, or missing wallet connection). **/
413
412
  onCheckoutBlocked?: (params: {
414
413
  blockedReason: CheckoutBlockedReason;
415
414
  }) => void;
415
+ }
416
+ /**
417
+ * Cashier form factor: the withdraw tab is explicitly requested. The coupling
418
+ * is compile-time — `withdrawalConfig` is required, so cashier intent can never
419
+ * be confused with a dropped config, and withdrawal callbacks are permitted
420
+ * only here.
421
+ */
422
+ interface CashierFormFactorProps {
423
+ formFactor: 'cashier';
424
+ withdrawalConfig: FunkitWithdrawalConfig;
425
+ /** @optional fires when a withdrawal is confirmed with the funkit server. Returns the newly created withdrawalId. **/
426
+ onWithdrawalConfirmation?: (withdrawalId: string) => void;
416
427
  /** @optional fires if the withdrawal fails at any point **/
417
428
  onWithdrawalError?: (result: FunkitCheckoutResult) => void;
418
429
  }
419
- /** Ensures that config is defined */
420
- export interface UseFunkitCheckoutPropsWithFullConfig extends UseFunkitCheckoutProps {
430
+ /** Default checkout form factor: no withdrawal wiring is permitted. */
431
+ interface CheckoutFormFactorProps {
432
+ formFactor?: 'checkout';
433
+ withdrawalConfig?: never;
434
+ onWithdrawalConfirmation?: never;
435
+ onWithdrawalError?: never;
436
+ }
437
+ export type UseFunkitCheckoutProps = UseFunkitCheckoutBaseProps & (CashierFormFactorProps | CheckoutFormFactorProps);
438
+ /**
439
+ * Resolved settings stored on the checkout item (config guaranteed). This is a
440
+ * structural superset of both public-prop union members — the `never`-typed
441
+ * withdrawal fields are relaxed — so internal rebuilds of `initSettings` don't
442
+ * fight the discriminant. The compile-time cashier↔withdrawalConfig coupling
443
+ * lives on the public `UseFunkitCheckoutProps` surface, which flows in here.
444
+ */
445
+ export interface UseFunkitCheckoutPropsWithFullConfig extends UseFunkitCheckoutBaseProps {
421
446
  config: FunkitCheckoutConfig;
447
+ formFactor?: 'cashier' | 'checkout';
448
+ withdrawalConfig?: FunkitWithdrawalConfig;
449
+ onWithdrawalConfirmation?: (withdrawalId: string) => void;
450
+ onWithdrawalError?: (result: FunkitCheckoutResult) => void;
422
451
  }
423
452
  /**
424
453
  * Checkout Item for frontend use
@@ -106,6 +106,8 @@ export interface FunkitUiCustomizationsConfig {
106
106
  simplifiedUi?: boolean;
107
107
  };
108
108
  confirmationScreen?: {
109
+ /** Whether to auto-expand the transaction breakdown once fees are loaded - defaults to false */
110
+ autoExpandFeesSummary?: boolean;
109
111
  /** Custom destination icon and text used in checkout summary */
110
112
  destinationConfig?: FunkitUiDestinationConfig;
111
113
  /** when source and destination are the same address, show destination as payment method instead of source - defaults to false */
@@ -168,6 +170,8 @@ export interface FunkitUiCustomizationsConfig {
168
170
  customTopComponent?: () => ReactNode;
169
171
  };
170
172
  withdrawalScreen?: {
173
+ /** Whether to auto-expand the transaction breakdown once fees are loaded - defaults to false */
174
+ autoExpandFeesSummary?: boolean;
171
175
  /** Function that returns a custom React component to render before other UIs in the withdrawal amount screen */
172
176
  customTopComponent?: () => ReactNode;
173
177
  };
@@ -5,8 +5,12 @@ interface FunkitI18nProviderProps {
5
5
  locale?: Locale;
6
6
  }
7
7
  /**
8
- * Provider for internationalization using react-i18next
9
- * Wraps the application with I18nextProvider and manages locale changes
8
+ * Syncs the `locale` config onto funkit's private i18next instance.
9
+ *
10
+ * Deliberately does NOT render react-i18next's <I18nextProvider>: that would
11
+ * set the react-i18next context for the host app's children and shadow the
12
+ * host's own i18n (Slack C0B6S1XHWSJ). funkit components bind the instance
13
+ * explicitly via useFunkitTranslation/FunkitTrans instead.
10
14
  */
11
15
  export declare function FunkitI18nProvider({ children, locale, }: FunkitI18nProviderProps): React.JSX.Element;
12
16
  export {};
@@ -2,7 +2,9 @@ import type { FormOfPaymentType } from '@funkit/api-base';
2
2
  import { type SwappedTransport } from '@funkit/connect-core';
3
3
  import React from 'react';
4
4
  import { type SwappedTheme } from '../utils/swapped';
5
- interface SwappedContextValue {
5
+ /** Deposit and withdrawal each own an independent Swapped iframe slot. */
6
+ export type SwappedMode = 'deposit' | 'withdrawal';
7
+ interface SwappedSlot {
6
8
  iframeUrl: string | null;
7
9
  isSwappedReady: boolean;
8
10
  isActive: boolean;
@@ -12,11 +14,11 @@ interface SwappedContextValue {
12
14
  resetIframe: () => void;
13
15
  setIframeRef: (el: HTMLIFrameElement | null) => void;
14
16
  focusAmountInput: () => void;
15
- swappedTheme: SwappedTheme;
16
17
  swappedTransport: SwappedTransport;
17
18
  }
18
19
  export declare function SwappedProvider({ children }: {
19
20
  children: React.ReactNode;
20
21
  }): React.JSX.Element;
21
- export declare function useSwappedContext(): SwappedContextValue;
22
+ export declare function useSwappedContext(mode: SwappedMode): SwappedSlot;
23
+ export declare function useSwappedTheme(): SwappedTheme;
22
24
  export {};
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  darkTheme
4
- } from "../chunk-36KVHK22.js";
4
+ } from "../chunk-L67HP4HQ.js";
5
5
  import "../chunk-4YEAUICE.js";
6
6
  export {
7
7
  darkTheme
@@ -1,2 +1,7 @@
1
1
  import type { DynamicTargetAssetCandidate } from '../providers/FunkitCheckoutContext';
2
2
  export declare const getTokenIconUrl: (symbol: string, tokens?: DynamicTargetAssetCandidate[]) => string;
3
+ export declare function resolveAssetIconSrc({ assetTicker, assetSrc, prioritizeDefaults, }: {
4
+ assetTicker?: string;
5
+ assetSrc?: string;
6
+ prioritizeDefaults: boolean;
7
+ }): string | undefined;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  bifrostWallet
4
- } from "../chunk-4T6ZSRJF.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-IULPZP2Q.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  bifrostWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  bitgetWallet
4
- } from "../chunk-CPI4TD43.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-TKB2OY6G.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  bitgetWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  bybitWallet
4
- } from "../chunk-F5XEEVG6.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-OX37G4YT.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  bybitWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  clvWallet
4
- } from "../chunk-UK7C2JXW.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-OEEGYENV.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  clvWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  coin98Wallet
4
- } from "../chunk-6BW3HLBG.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-WAHGI5L7.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  coin98Wallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  coreWallet
4
- } from "../chunk-RB3HR4R2.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-4NV5BYRP.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  coreWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  foxWallet
4
- } from "../chunk-MIQTHJ6X.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-GUQM4QSL.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  foxWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  frontierWallet
4
- } from "../chunk-YEZM4CK4.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-AVDUNQUW.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  frontierWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  gateWallet
4
- } from "../chunk-HNRB7KJU.js";
5
- import "../chunk-OLZ7626J.js";
4
+ } from "../chunk-JPN6TWIT.js";
6
5
  import "../chunk-N4IJLYFY.js";
6
+ import "../chunk-OLZ7626J.js";
7
7
  import "../chunk-IGKXZBTA.js";
8
8
  export {
9
9
  gateWallet