@funkit/connect 12.16.0 → 12.18.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 +86 -0
- package/dist/clients/axiom.d.ts +1 -5
- package/dist/clients/{chunk-BKK2BFIP.js → chunk-AELXD5XA.js} +1 -1
- package/dist/clients/{chunk-6IH7AWFA.js → chunk-FOXMRDKD.js} +1 -1
- package/dist/clients/{chunk-UZ3NA7HN.js → chunk-G6A62MZO.js} +3 -3
- package/dist/clients/{chunk-OB5GKTP2.js → chunk-L6JL2XJY.js} +1 -1
- package/dist/clients/{chunk-I5VRAFH6.js → chunk-LCYJLY4X.js} +1 -1
- package/dist/clients/chunk-R25GIAD5.js +59 -0
- package/dist/clients/{chunk-7JYLS7IF.js → chunk-YSAAJSWT.js} +272 -48
- package/dist/clients/fanatics.js +2 -2
- package/dist/clients/internal/nado/withdrawalCallback.js +4 -4
- package/dist/clients/internal/nado/withdrawalConfig.js +2 -2
- package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
- package/dist/clients/internal/nado/withdrawalForm.js +6 -6
- package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
- package/dist/clients/lighter.css +8 -8
- package/dist/clients/lighter.d.ts +29 -16
- package/dist/clients/lighter.js +149 -68
- package/dist/clients/mallard.js +2 -2
- package/dist/clients/nado.js +4 -4
- package/dist/components/LargeAmountInput/LargeAmountInput.d.ts +3 -1
- package/dist/components/TokenSwapWidget/TokenSelectButton/TokenSelectButton.d.ts +5 -2
- package/dist/components/TokenSwapWidget/TokenSwapCard/TokenSwapCard.d.ts +7 -3
- package/dist/components/TokenSwapWidget/TokenSwapWidget.d.ts +7 -2
- package/dist/consts/customers.d.ts +12 -1
- package/dist/domains/convert/assets.d.ts +30 -0
- package/dist/domains/convert/balances.d.ts +44 -24
- package/dist/domains/convert/errors.d.ts +38 -0
- package/dist/domains/convert/execution.d.ts +39 -0
- package/dist/domains/convert/hostTimeout.d.ts +8 -0
- package/dist/domains/convert/inputAmount.d.ts +53 -0
- package/dist/domains/convert/quote.d.ts +33 -0
- package/dist/domains/convert/recipient.d.ts +2 -1
- package/dist/domains/convert/reducer.d.ts +112 -0
- package/dist/domains/convert/screen.d.ts +169 -0
- package/dist/domains/convert/settlement.d.ts +52 -0
- package/dist/domains/convert/sourceWallet.d.ts +5 -4
- package/dist/domains/convert/submit.d.ts +67 -0
- package/dist/domains/convert/types.d.ts +52 -27
- package/dist/domains/convert/view.d.ts +111 -0
- package/dist/domains/nativeFeeReserve.d.ts +29 -0
- package/dist/domains/quote.d.ts +14 -1
- package/dist/hooks/queries/useWithdrawFops.d.ts +6 -0
- package/dist/hooks/queries/useWithdrawalQuote.d.ts +4 -1
- package/dist/hooks/track/CheckoutModalEvent.d.ts +2 -0
- package/dist/hooks/track/WithdrawModalEvent.d.ts +1 -0
- package/dist/hooks/track/analytics/events.d.ts +59 -1
- package/dist/hooks/track/analytics/mappers.d.ts +5 -4
- package/dist/hooks/track/analytics/resolveIframeStepNavigation.d.ts +18 -0
- package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +2 -2
- package/dist/hooks/track/analytics/useTrackSwappedIframeEvents.d.ts +5 -0
- package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +2 -2
- package/dist/hooks/track/useQuoteAttemptCounter.d.ts +2 -0
- package/dist/hooks/useConvertAssetList.d.ts +23 -0
- package/dist/hooks/useConvertAssets.d.ts +11 -0
- package/dist/hooks/useConvertBalances.d.ts +50 -0
- package/dist/hooks/useConvertExecute.d.ts +33 -0
- package/dist/hooks/useConvertQuote.d.ts +53 -0
- package/dist/hooks/useConvertSelectionWallets.d.ts +34 -0
- package/dist/hooks/useConvertTransactionStatus.d.ts +17 -0
- package/dist/hooks/useMaxSpendableAmount.d.ts +19 -0
- package/dist/hooks/useStepQueryReadiness.d.ts +45 -15
- package/dist/index.css +8 -8
- package/dist/index.d.ts +3 -2
- package/dist/index.js +8169 -3491
- package/dist/modals/CheckoutModal/Convert/ConvertAssetList.d.ts +16 -0
- package/dist/modals/CheckoutModal/Convert/ConvertAssetRow.d.ts +21 -0
- package/dist/modals/CheckoutModal/Convert/ConvertChainPills.d.ts +14 -0
- package/dist/modals/CheckoutModal/Convert/ConvertSelectDestinationStep.d.ts +30 -0
- package/dist/modals/CheckoutModal/Convert/ConvertSelectSourceStep.d.ts +18 -0
- package/dist/modals/CheckoutModal/Convert/ConvertStep.d.ts +4 -2
- package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +2 -0
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +5 -3
- package/dist/modals/CheckoutModal/SwappedIframe/swappedIframeReady.track.d.ts +8 -0
- package/dist/modals/CheckoutModal/Withdrawal/WithdrawalComplete.d.ts +5 -2
- package/dist/modals/CheckoutModal/Withdrawal/WithdrawalEnterAmount.d.ts +4 -2
- package/dist/modals/CheckoutModal/stepTransition.d.ts +7 -2
- package/dist/modals/CheckoutModal/stepTransition.shared.d.ts +0 -1
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +48 -15
- package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +17 -4
- package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +10 -7
- package/dist/modals/WithdrawalModal/useMaxWithdrawableAmount.d.ts +10 -0
- package/dist/modals/WithdrawalModal/useMultiSourceWithdrawal.d.ts +41 -0
- package/dist/modals/WithdrawalModal/withdrawalFormHelpers.d.ts +28 -8
- package/dist/providers/ConvertProvider.d.ts +40 -0
- package/dist/providers/FunkitCheckoutContext/index.d.ts +2 -2
- package/dist/providers/FunkitCheckoutContext/types.d.ts +36 -2
- package/dist/providers/FunkitQuoteContext.track.d.ts +23 -3
- package/dist/providers/SwappedProvider.d.ts +7 -0
- package/dist/shadow-css.js +1 -1
- package/dist/utils/customer.d.ts +34 -4
- package/dist/utils/withdrawal.d.ts +28 -1
- package/dist/wallets/multiSourceWithdrawal.d.ts +36 -0
- package/dist/wallets/walletConnectors/index.js +42 -42
- package/package.json +6 -6
- package/dist/clients/chunk-6EU6CXNH.js +0 -20
- /package/dist/clients/{chunk-4DBUYTEE.js → chunk-LICTGZXW.js} +0 -0
|
@@ -6,7 +6,7 @@ import { type PaymentMethodInfo } from '../../domains/paymentMethods';
|
|
|
6
6
|
import type { AssetHoldingsItem } from '../../utils/assets';
|
|
7
7
|
import type { WithdrawalClient, WithdrawalTransaction } from '../../wallets/Wallet';
|
|
8
8
|
import { type FunkitCheckoutQuoteResult } from '../FunkitHistoryContext';
|
|
9
|
-
import type {
|
|
9
|
+
import type { DynamicTargetAssetCandidate, FunkitActiveCheckoutItem, FunkitActiveWithdrawalItem, FunkitCheckoutConfig, FunkitWithdrawalConfig, MultiSourceWithdrawalConfig, PolymarketPerpsTransferPending, SingleWithdrawalConfig, UseFunkitCheckoutProps, UseFunkitCheckoutPropsWithFullConfig } from './types';
|
|
10
10
|
export * from './types';
|
|
11
11
|
interface FunkitCheckoutContextInterface {
|
|
12
12
|
checkoutItem: FunkitActiveCheckoutItem | null;
|
|
@@ -56,7 +56,7 @@ interface FunkitCheckoutContextInterface {
|
|
|
56
56
|
* makes revert lossless. Used by the cashier withdraw tab; the standalone
|
|
57
57
|
* `WithdrawalModal` uses {@link initNewWithdrawal} instead.
|
|
58
58
|
*/
|
|
59
|
-
convertActiveCheckoutToWithdrawal(config:
|
|
59
|
+
convertActiveCheckoutToWithdrawal(config: SingleWithdrawalConfig | MultiSourceWithdrawalConfig): void;
|
|
60
60
|
/** Restore the deposit snapshot taken by {@link convertActiveCheckoutToWithdrawal} and clear `withdrawalItem`. */
|
|
61
61
|
revertActiveCheckoutFromWithdrawal(): void;
|
|
62
62
|
applyDynamicRouting(path: ApplyDynamicRoutingPath): void;
|
|
@@ -571,7 +571,7 @@ export interface WithdrawalMethodOption {
|
|
|
571
571
|
* The actual withdrawal config that drives the flow once the user selects
|
|
572
572
|
* this option. Must be a single concrete (non-multi) config.
|
|
573
573
|
*/
|
|
574
|
-
config:
|
|
574
|
+
config: SingleWithdrawalConfig;
|
|
575
575
|
}
|
|
576
576
|
/**
|
|
577
577
|
* Withdrawal config that presents the user with a selection screen before
|
|
@@ -589,7 +589,41 @@ export interface MultiMethodWithdrawalConfig {
|
|
|
589
589
|
methods: WithdrawalMethodOption[];
|
|
590
590
|
disableConnectedWallet?: boolean;
|
|
591
591
|
}
|
|
592
|
-
|
|
592
|
+
/** A config that drives the flow directly: one chain, one token, one wallet. */
|
|
593
|
+
export type SingleWithdrawalConfig = WalletWithdrawalConfig | CustomWithdrawalConfig;
|
|
594
|
+
/** One entry in a {@link MultiSourceWithdrawalConfig} dropdown. */
|
|
595
|
+
export interface WithdrawalSourceOption {
|
|
596
|
+
/** Unique key (e.g. `ETH_BASE`); two sources may share a ticker. Used for selection and analytics. */
|
|
597
|
+
id: string;
|
|
598
|
+
/** Dropdown label. Defaults to the config's `sourceTokenSymbol`. */
|
|
599
|
+
label?: string;
|
|
600
|
+
iconSrc?: string;
|
|
601
|
+
/**
|
|
602
|
+
* Drives the whole flow while selected: chain, token, wallet, balance and
|
|
603
|
+
* limits (`getMinWithdrawalAmount`, `getMinWithdrawalUSD`, ...). Its own
|
|
604
|
+
* `sourceTokens` list is ignored.
|
|
605
|
+
*/
|
|
606
|
+
config: SingleWithdrawalConfig;
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Withdrawal config whose source is picked from the amount screen's dropdown.
|
|
610
|
+
* Sources may sit on different chains and wallets; each is a complete config,
|
|
611
|
+
* so balances and limits are per source. See `createMultiSourceWithdrawalConfig`.
|
|
612
|
+
* Crypto only: cash (Swapped) withdrawal is picked before a source, so it is
|
|
613
|
+
* not offered for this config.
|
|
614
|
+
*/
|
|
615
|
+
export interface MultiSourceWithdrawalConfig {
|
|
616
|
+
/** Title shown in the modal header. */
|
|
617
|
+
modalTitle: string;
|
|
618
|
+
/** Optional meta under the title. */
|
|
619
|
+
modalTitleMeta?: string;
|
|
620
|
+
disableConnectedWallet?: boolean;
|
|
621
|
+
/** Dropdown order. Each entry is a whole config; not a config's `sourceTokens`. */
|
|
622
|
+
sources: WithdrawalSourceOption[];
|
|
623
|
+
/** Initially selected source. Defaults to the first. */
|
|
624
|
+
defaultSourceId?: string;
|
|
625
|
+
}
|
|
626
|
+
export type FunkitWithdrawalConfig = WalletWithdrawalConfig | CustomWithdrawalConfig | MultiMethodWithdrawalConfig | MultiSourceWithdrawalConfig;
|
|
593
627
|
export interface FunkitCheckoutValidationResult {
|
|
594
628
|
isValid: boolean;
|
|
595
629
|
message: string;
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DirectExecutionType } from '@funkit/api-base';
|
|
2
|
+
import type { PaymentMethodInfo } from '../domains/paymentMethods';
|
|
3
|
+
import type { FunkitCheckoutQuoteResult, QuotePhaseResult } from '../domains/quote';
|
|
4
|
+
import { QuoteMode } from '../domains/quoteMode';
|
|
5
|
+
import type { PerfQuoteProperties } from '../hooks/track/analytics/events';
|
|
2
6
|
import type { CheckoutModalEvent } from '../hooks/track/CheckoutModalEvent';
|
|
3
|
-
import type { WithdrawModalEvent } from '../hooks/track/WithdrawModalEvent';
|
|
4
7
|
import type { TrackEventData } from '../hooks/track/useTrack';
|
|
8
|
+
import type { WithdrawModalEvent } from '../hooks/track/WithdrawModalEvent';
|
|
9
|
+
import type { FunCheckoutStep } from '../modals/CheckoutModal/FunCheckoutStep';
|
|
10
|
+
import type { WithdrawalModalStep } from '../modals/WithdrawalModal/types';
|
|
5
11
|
import type { FunkitActiveCheckoutItem } from './FunkitCheckoutContext';
|
|
6
|
-
import type { FunkitCheckoutQuoteResult } from './FunkitHistoryContext';
|
|
7
12
|
export declare const trackEventFromBaseQuote: (checkoutItem: FunkitActiveCheckoutItem, eventName: CheckoutModalEvent | WithdrawModalEvent, quoteMode?: QuoteMode) => TrackEventData;
|
|
13
|
+
type PerfQuotePropertiesContext = {
|
|
14
|
+
analyticsStep: FunCheckoutStep | WithdrawalModalStep;
|
|
15
|
+
checkoutItem: FunkitActiveCheckoutItem;
|
|
16
|
+
connectorId: string | undefined;
|
|
17
|
+
directExecutionType: DirectExecutionType | null;
|
|
18
|
+
paymentMethodInfo: PaymentMethodInfo;
|
|
19
|
+
quoteAttempt: number;
|
|
20
|
+
quoteMode: QuoteMode;
|
|
21
|
+
};
|
|
22
|
+
export declare const buildPerfQuoteProperties: (args: PerfQuotePropertiesContext & {
|
|
23
|
+
quoteResult: QuotePhaseResult;
|
|
24
|
+
resolvedAtMs: number;
|
|
25
|
+
startedAtMs: number;
|
|
26
|
+
}) => PerfQuoteProperties;
|
|
8
27
|
export declare const trackEventFromFinalQuote: (finalEstimation: FunkitCheckoutQuoteResult, checkoutItem: FunkitActiveCheckoutItem, eventName: CheckoutModalEvent | WithdrawModalEvent, quoteMode?: QuoteMode) => TrackEventData;
|
|
28
|
+
export {};
|
|
@@ -15,6 +15,13 @@ interface SwappedSlot {
|
|
|
15
15
|
setIframeRef: (el: HTMLIFrameElement | null) => void;
|
|
16
16
|
focusAmountInput: () => void;
|
|
17
17
|
swappedTransport: SwappedTransport;
|
|
18
|
+
/**
|
|
19
|
+
* Returns true the first time it's called for a given checkout id, false
|
|
20
|
+
* afterward. Lives on the slot (not the step component) so it survives the
|
|
21
|
+
* iframe step being unmounted/remounted as the user navigates back and
|
|
22
|
+
* forth, while still resetting for a genuinely new checkout id.
|
|
23
|
+
*/
|
|
24
|
+
markIframeReadyFirst: (checkoutId: string) => boolean;
|
|
18
25
|
}
|
|
19
26
|
export declare function SwappedProvider({ children, buyingCrypto, }: {
|
|
20
27
|
children: React.ReactNode;
|