@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.
- package/CHANGELOG.md +46 -0
- package/dist/{chunk-36KVHK22.js → chunk-L67HP4HQ.js} +1 -1
- package/dist/clients/chunk-2YWQL3AO.js +46 -0
- package/dist/clients/chunk-APQYFP6X.js +207 -0
- package/dist/clients/chunk-BNMZM23Q.js +42 -0
- package/dist/clients/chunk-HOORQPSY.js +4660 -0
- package/dist/clients/chunk-II5CZTBC.js +18 -0
- package/dist/clients/chunk-KNHO756P.js +28 -0
- package/dist/clients/chunk-L2KSNS7H.js +112 -0
- package/dist/clients/{chunk-ZAXSDMDU.js → chunk-M6C7MBQN.js} +2 -2
- package/dist/clients/chunk-OZ3KD24N.js +107 -0
- package/dist/clients/{chunk-E3USJY7A.js → chunk-RCMAGKMG.js} +35 -4
- package/dist/clients/fanatics.js +1 -1
- package/dist/clients/internal/nado/consts.d.ts +16 -0
- package/dist/clients/internal/nado/consts.js +13 -0
- package/dist/clients/internal/nado/encoding.d.ts +22 -0
- package/dist/clients/internal/nado/encoding.js +32 -0
- package/dist/clients/internal/nado/errors.d.ts +55 -0
- package/dist/clients/internal/nado/errors.js +15 -0
- package/dist/clients/internal/nado/fetch.d.ts +15 -0
- package/dist/clients/internal/nado/fetch.js +9 -0
- package/dist/clients/internal/nado/gateway.d.ts +83 -0
- package/dist/clients/internal/nado/gateway.js +23 -0
- package/dist/clients/internal/nado/hooks.d.ts +360 -0
- package/dist/clients/internal/nado/hooks.js +132 -0
- package/dist/clients/internal/nado/indexer.d.ts +43 -0
- package/dist/clients/internal/nado/indexer.js +13 -0
- package/dist/clients/internal/nado/products.d.ts +36 -0
- package/dist/clients/internal/nado/products.js +19 -0
- package/dist/clients/internal/nado/typedData.d.ts +80 -0
- package/dist/clients/internal/nado/typedData.js +43 -0
- package/dist/clients/lighter.css +12 -1
- package/dist/clients/lighter.js +118 -42
- package/dist/clients/mallard.js +9 -24
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +12 -1
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +3 -3
- package/dist/clients/polymarket/index.css +12 -1
- package/dist/clients/polymarket/index.js +3 -3
- package/dist/components/ChainIcon/ChainIcon.d.ts +16 -0
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/hooks.d.ts +1 -2
- package/dist/components/FreeUsdcBanner/FreeUsdcBanner.d.ts +1 -1
- package/dist/components/FunAssetAvatar/FunAssetAvatar.d.ts +1 -2
- package/dist/components/FunInput/FunInput.d.ts +2 -0
- package/dist/components/FunkitTrans.d.ts +14 -0
- package/dist/hooks/useChainMetadata.d.ts +11 -0
- package/dist/hooks/useFunkitTranslation.d.ts +3 -1
- package/dist/hooks/usePaymentMethodTabs.d.ts +10 -1
- package/dist/hooks/useSwappedIframeLifecycle.d.ts +5 -2
- package/dist/hooks/useSwappedPreload.d.ts +8 -3
- package/dist/hooks/useUserIpInfo.d.ts +1 -19
- package/dist/index.css +12 -1
- package/dist/index.js +15902 -15844
- package/dist/modals/CheckoutModal/InputAmount/InputAmount.css.d.ts +1 -0
- package/dist/modals/CheckoutModal/SourceChange/FormOfPaymentsList.d.ts +6 -2
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +29 -0
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframe.d.ts +4 -1
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframeController.d.ts +3 -0
- package/dist/modals/CheckoutModal/Withdrawal/WithdrawalComplete.d.ts +15 -1
- package/dist/modals/CheckoutModal/Withdrawal/WithdrawalEnterAmount.d.ts +12 -1
- package/dist/modals/CheckoutModal/isWithdrawalStep.d.ts +25 -0
- package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +15 -1
- package/dist/modals/WithdrawalModal/WithdrawalMethodSelect.d.ts +5 -1
- package/dist/providers/FunkitCheckoutContext/index.d.ts +15 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +34 -5
- package/dist/providers/FunkitConfigContext.d.ts +4 -0
- package/dist/providers/FunkitI18nProvider.d.ts +6 -2
- package/dist/providers/SwappedProvider.d.ts +5 -3
- package/dist/themes/darkTheme.js +1 -1
- package/dist/utils/tokenIconUrl.d.ts +5 -0
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +59 -59
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +7 -5
- package/dist/clients/chunk-STLOQEN7.js +0 -11
- package/dist/components/FunInput/FunTextAreaInput.css.d.ts +0 -1
- package/dist/components/FunInput/FunTextAreaInput.d.ts +0 -3
- package/dist/components/Icons/AcornsIcon.d.ts +0 -4
- package/dist/components/Icons/AlpacaIcon.d.ts +0 -4
- package/dist/components/Icons/BitFlyerIcon.d.ts +0 -4
- package/dist/components/Icons/BitfinexIcon.d.ts +0 -4
- package/dist/components/Icons/BitstampIcon.d.ts +0 -4
- package/dist/components/Icons/BrokerageIcon.d.ts +0 -4
- package/dist/components/Icons/CexloIcon.d.ts +0 -4
- package/dist/components/Icons/CoinlistIcon.d.ts +0 -4
- package/dist/components/Icons/CryptoComIcon.d.ts +0 -4
- package/dist/components/Icons/CryptoIcon.d.ts +0 -2
- package/dist/components/Icons/DeviceConfirmationIcon.d.ts +0 -2
- package/dist/components/Icons/EmailConfirmationIcon.d.ts +0 -2
- package/dist/components/Icons/EtoroIcon.d.ts +0 -4
- package/dist/components/Icons/EtradeIcon.d.ts +0 -4
- package/dist/components/Icons/HuobiIcon.d.ts +0 -4
- package/dist/components/Icons/KucoinIcon.d.ts +0 -4
- package/dist/components/Icons/LightningBoltIcon.d.ts +0 -4
- package/dist/components/Icons/LockIcon.d.ts +0 -4
- package/dist/components/Icons/MailIcon.d.ts +0 -6
- package/dist/components/Icons/New/LinkExternalIcon.d.ts +0 -4
- package/dist/components/Icons/New/MessageIcon.d.ts +0 -2
- package/dist/components/Icons/OkcoinIcon.d.ts +0 -4
- package/dist/components/Icons/OkxIcon.d.ts +0 -4
- package/dist/components/Icons/PublicIcon.d.ts +0 -4
- package/dist/components/Icons/RobinhoodIcon.d.ts +0 -4
- package/dist/components/Icons/SocialMediaIcons.d.ts +0 -13
- package/dist/components/Icons/SocialsIcon.d.ts +0 -2
- package/dist/components/Icons/StashIcon.d.ts +0 -4
- package/dist/components/Icons/WeBullIcon.d.ts +0 -4
- package/dist/components/Icons/WhitelistIcon.d.ts +0 -2
- package/dist/hooks/useIsUsUser.d.ts +0 -1
- package/dist/utils/privyHelper.d.ts +0 -3
- package/dist/utils/safeJSON.d.ts +0 -5
- package/dist/utils/tokenTransfer/disabledList.d.ts +0 -1
- package/dist/wallets/walletConnectors/{chunk-RB3HR4R2.js → chunk-4NV5BYRP.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YEZM4CK4.js → chunk-AVDUNQUW.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-MIQTHJ6X.js → chunk-GUQM4QSL.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-4T6ZSRJF.js → chunk-IULPZP2Q.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-HNRB7KJU.js → chunk-JPN6TWIT.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-ZNX4EMPB.js → chunk-KCRO2AGO.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-STVVP43G.js → chunk-KI5Y2BBF.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-X6CGV36L.js → chunk-NR2OGDHQ.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-UK7C2JXW.js → chunk-OEEGYENV.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-F5XEEVG6.js → chunk-OX37G4YT.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-RVOY537T.js → chunk-SWFF3TWJ.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-CPI4TD43.js → chunk-TKB2OY6G.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-2VP2F6EK.js → chunk-W2LCLDPX.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-6BW3HLBG.js → chunk-WAHGI5L7.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-HTHAK6XB.js → chunk-WKNQMP4A.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-VTM6EECM.js → chunk-XCNHV3HS.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-CCQV2ZET.js → chunk-YO2K4MBH.js} +3 -3
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
/**
|
|
420
|
-
|
|
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
|
-
*
|
|
9
|
-
*
|
|
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
|
-
|
|
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():
|
|
22
|
+
export declare function useSwappedContext(mode: SwappedMode): SwappedSlot;
|
|
23
|
+
export declare function useSwappedTheme(): SwappedTheme;
|
|
22
24
|
export {};
|
package/dist/themes/darkTheme.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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
|
coin98Wallet
|
|
4
|
-
} from "../chunk-
|
|
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
|
frontierWallet
|
|
4
|
-
} from "../chunk-
|
|
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
|