@funkit/connect 13.1.1 → 13.3.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 +94 -0
- package/dist/{chunk-53FF4ZHH.js → chunk-SJ7E3DKC.js} +6 -0
- package/dist/{chunk-2RND3WWH.js → chunk-V4VFNIG4.js} +6 -0
- package/dist/clients/aave.d.ts +1 -1
- package/dist/clients/{chunk-44LV4GCX.js → chunk-2INCUCQQ.js} +1 -0
- package/dist/clients/chunk-6JL6PF5P.js +22 -0
- package/dist/clients/chunk-747THMHY.js +185 -0
- package/dist/clients/{chunk-Q4JGDB4L.js → chunk-BMU5EYUJ.js} +8 -24
- package/dist/clients/{chunk-T6YNXIOS.js → chunk-HBW7AZUH.js} +7 -5
- package/dist/clients/{chunk-ZBBYOJWK.js → chunk-KDZFZETH.js} +176 -0
- package/dist/clients/{chunk-D6EY2WW4.js → chunk-PVBHWD47.js} +1 -1
- package/dist/clients/chunk-RNTQ7KEL.js +76 -0
- package/dist/clients/{chunk-ZEXIDBIZ.js → chunk-RTHDOT5K.js} +1 -1
- package/dist/clients/{chunk-AJGDTTRJ.js → chunk-SKYQYPX5.js} +58 -2
- package/dist/clients/{chunk-NNMZMHO6.js → chunk-Z6FHIDTD.js} +5 -5
- package/dist/clients/fanatics.css +3136 -2947
- package/dist/clients/fanatics.js +1 -1
- package/dist/clients/internal/nado/withdrawalCallback.js +4 -4
- package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
- package/dist/clients/internal/nado/withdrawalForm.js +12 -77
- package/dist/clients/internal/nado/withdrawalStatus.css +18233 -0
- package/dist/clients/internal/nado/withdrawalStatus.js +218 -20
- package/dist/clients/lighter.css +3519 -2947
- package/dist/clients/lighter.js +5 -7
- package/dist/clients/mallard.d.ts +24 -3
- package/dist/clients/mallard.js +7 -3
- package/dist/clients/nado.js +4 -4
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +4 -3
- package/dist/clients/polymarket/index.js +9 -7
- package/dist/clients/polymarket/polymarket.js +6 -4
- package/dist/components/Box/Box.d.ts +18 -18
- package/dist/components/Dropdown/BaseDropdownItem.d.ts +1 -1
- package/dist/components/FunAsset/FunAssetItem.d.ts +3 -1
- package/dist/components/FunBadge/FunBadge.d.ts +1 -1
- package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +2 -3
- package/dist/components/FunTransactionSummary/PaymentFeesSummary.track.d.ts +2 -3
- package/dist/components/ModalErrorState/ModalErrorState.d.ts +2 -3
- package/dist/consts/customers.d.ts +1 -1
- package/dist/consts/polymarket.d.ts +1 -1
- package/dist/css/sprinkles.css.d.ts +24 -18
- package/dist/domains/clientMetadata.d.ts +2 -1
- package/dist/domains/convert/hostTimeout.d.ts +1 -1
- package/dist/domains/destinationAssetBalance.d.ts +1 -1
- package/dist/hooks/queries/useWithdrawalQuote.d.ts +2 -3
- package/dist/hooks/statsig/index.d.ts +1 -0
- package/dist/hooks/track/analytics/mappers.d.ts +11 -1
- package/dist/hooks/track/analytics/swappedErrorCode.d.ts +1 -0
- package/dist/hooks/track/analytics/useTrackErrorShown.d.ts +2 -3
- package/dist/hooks/useConvertBalances.d.ts +6 -1
- package/dist/hooks/useFunkitMaxCheckoutUsdInfo.d.ts +3 -3
- package/dist/hooks/useHostDepositSettlement.d.ts +12 -0
- package/dist/hooks/useModalStateValueWithProp.d.ts +1 -1
- package/dist/hooks/useRefreshBalancesOnDeposit.d.ts +20 -0
- package/dist/index.css +3519 -2947
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6179 -3864
- package/dist/interfaces/solanaWallet.d.ts +2 -2
- package/dist/modals/CheckoutModal/FiatV2/FiatV2Step.d.ts +19 -0
- package/dist/modals/CheckoutModal/FiatV2/fiatV2DepositInputs.d.ts +38 -0
- package/dist/modals/CheckoutModal/FiatV2/fiatV2PaymentSelectionEffects.d.ts +26 -0
- package/dist/modals/CheckoutModal/FiatV2/useFiatV2DepositInputs.d.ts +6 -0
- package/dist/modals/CheckoutModal/FiatV2/useFiatV2PaymentSelectionHost.d.ts +22 -0
- package/dist/modals/CheckoutModal/FiatV2/useFiatV2Text.d.ts +7 -0
- package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +3 -1
- package/dist/modals/CheckoutModal/InputAmount/useCheckoutAmountLimits.d.ts +3 -3
- package/dist/modals/CheckoutModal/SourceChange/AddCardItem.d.ts +9 -0
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +5 -0
- package/dist/modals/CheckoutModal/SourceChange/fiatV2Reroute.d.ts +24 -0
- package/dist/modals/CheckoutModal/SourceChange/useAddCardRow.d.ts +13 -0
- package/dist/modals/CheckoutModal/SourceChange/useFiatV2Entry.d.ts +21 -0
- package/dist/modals/CheckoutModal/stepTransition.d.ts +3 -0
- package/dist/modals/PolymarketPerpsTransfer/TransferActionButton.d.ts +5 -5
- package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +2 -3
- package/dist/providers/FunSessionContext.d.ts +20 -0
- package/dist/providers/FunkitCheckoutContext/index.d.ts +7 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +30 -0
- package/dist/providers/FunkitProvider.d.ts +7 -0
- package/dist/providers/FunkitQuoteContext.track.d.ts +2 -3
- package/dist/providers/FunkitThemeProvider.d.ts +9 -0
- package/dist/shadow-css.js +1 -1
- package/dist/themes/darkTheme.js +1 -1
- package/dist/themes/lightTheme.js +1 -1
- package/dist/utils/checkout.d.ts +2 -2
- package/dist/utils/localStorageFunSessionStorage.d.ts +9 -0
- package/dist/v2/components/PrimaryButton.css.d.ts +5 -0
- package/dist/v2/components/PrimaryButton.d.ts +16 -0
- package/dist/v2/components/Sheet.css.d.ts +13 -0
- package/dist/v2/components/Sheet.d.ts +23 -0
- package/dist/v2/components/Spinner.css.d.ts +2 -0
- package/dist/v2/components/Spinner.d.ts +6 -0
- package/dist/v2/flows/fiat/FiatDepositGate.d.ts +20 -0
- package/dist/v2/flows/fiat/FiatScreenPicker.d.ts +37 -0
- package/dist/v2/flows/funLogin/FunLoginScreenPicker.d.ts +30 -0
- package/dist/v2/screens/amount/AmountDisplay.css.d.ts +5 -0
- package/dist/v2/screens/amount/AmountDisplay.d.ts +15 -0
- package/dist/v2/screens/amount/AmountScreen.css.d.ts +2 -0
- package/dist/v2/screens/amount/AmountScreen.d.ts +37 -0
- package/dist/v2/screens/amount/PresetButton.css.d.ts +1 -0
- package/dist/v2/screens/amount/PresetButton.d.ts +9 -0
- package/dist/v2/screens/amount/fittedText/useFittedText.d.ts +19 -0
- package/dist/v2/screens/amount/fittedText/useIsomorphicEffect.d.ts +2 -0
- package/dist/v2/screens/amount/fittedText/useTextMeasurer.d.ts +3 -0
- package/dist/v2/screens/amount/typedAmount/amountText.d.ts +37 -0
- package/dist/v2/screens/amount/typedAmount/attachInputNormalization.d.ts +1 -0
- package/dist/v2/screens/fiat/FiatPlaceholderScreen.d.ts +9 -0
- package/dist/v2/screens/funLogin/FunLoginCodeScreen.d.ts +35 -0
- package/dist/v2/screens/funLogin/FunLoginEmailScreen.d.ts +26 -0
- package/dist/v2/screens/funLogin/FunLoginScreen.css.d.ts +20 -0
- package/dist/v2/screens/funLogin/looksLikeEmail.d.ts +5 -0
- package/dist/v2/theme/colors.d.ts +28 -0
- package/dist/v2/theme/fonts.d.ts +9 -0
- package/dist/v2/theme/radii.d.ts +6 -0
- package/dist/wallets/walletConnectors/index.js +39 -39
- package/package.json +4 -4
- package/dist/clients/chunk-JXTKKLVA.js +0 -185
- package/dist/clients/chunk-PZSKO3BJ.js +0 -60
- package/dist/components/FunPayments/icons/coinbase.d.ts +0 -5
|
@@ -17,7 +17,7 @@ export type DestinationAssetBalance = ConvertAssetBalance;
|
|
|
17
17
|
* Reads wallet balances for the destination asset menu, in one call.
|
|
18
18
|
* - Called when the menu opens, then every 60s while it stays open.
|
|
19
19
|
* - Answer for exactly the assets passed; leave out any you can't read or
|
|
20
|
-
* don't want
|
|
20
|
+
* don't want labeled. Don't throw.
|
|
21
21
|
* @experimental
|
|
22
22
|
*/
|
|
23
23
|
export type GetDestinationAssetBalances = (params: {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { FunCheckoutStep } from '../../modals/CheckoutModal/FunCheckoutStep';
|
|
2
|
-
import type { WithdrawalModalStep } from '../../modals/WithdrawalModal/types';
|
|
3
1
|
import { type FunkitWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
2
|
+
import type { AnalyticsNamedStep } from '../../hooks/track/analytics/mappers';
|
|
4
3
|
interface CheckoutQuoteParams {
|
|
5
|
-
analyticsStep:
|
|
4
|
+
analyticsStep: AnalyticsNamedStep;
|
|
6
5
|
recipientAddress: string;
|
|
7
6
|
selectedChainId: string | undefined;
|
|
8
7
|
selectedTokenAddress: string | null | undefined;
|
|
@@ -6,7 +6,17 @@ import { WithdrawalModalStep } from '../../../modals/WithdrawalModal/types';
|
|
|
6
6
|
import type { AnalyticsFlow, AnalyticsStep, PaymentMethodProperties } from './events';
|
|
7
7
|
/** Round analytics amounts before Statsig stringifies event metadata. */
|
|
8
8
|
export declare function formatAnalyticsAmount(amount: number | null): string | null;
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Steps that only host another renderer. Every V2 screen renders under
|
|
11
|
+
* FIAT_V2, so a step name for it would merge them all; V2 screens report
|
|
12
|
+
* their own shared names instead.
|
|
13
|
+
*/
|
|
14
|
+
export type AnalyticsHostStep = FunCheckoutStep.FIAT_V2;
|
|
15
|
+
export type AnalyticsNamedStep = Exclude<FunCheckoutStep, AnalyticsHostStep> | WithdrawalModalStep;
|
|
16
|
+
export declare function isAnalyticsHostStep(step: FunCheckoutStep | WithdrawalModalStep): step is AnalyticsHostStep;
|
|
17
|
+
export declare function formatAnalyticsStep(step: AnalyticsNamedStep): AnalyticsStep;
|
|
18
|
+
/** `prev_step` after a host step is unknown to web V1, so it is reported as none. */
|
|
19
|
+
export declare function formatPrevAnalyticsStep(step: FunCheckoutStep | null): AnalyticsStep | null;
|
|
10
20
|
export declare function getCheckoutModalAnalyticsFlow(modalState: CheckoutModalState): AnalyticsFlow;
|
|
11
21
|
export declare function getHistoricalSourceAddress(sourceOfFund: string | null | undefined): string | null;
|
|
12
22
|
/** Selected checkout provider, such as a wallet connector or Meld provider. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getSwappedErrorCode(error: unknown): string;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { ErrorNotification } from '../../../components/FunNotification/FunNotification';
|
|
2
|
-
import type { FunCheckoutStep } from '../../../modals/CheckoutModal/FunCheckoutStep';
|
|
3
|
-
import type { WithdrawalModalStep } from '../../../modals/WithdrawalModal/types';
|
|
4
2
|
import { type AnalyticsFlow } from './events';
|
|
3
|
+
import { type AnalyticsNamedStep } from './mappers';
|
|
5
4
|
type TrackErrorShownArgs = {
|
|
6
5
|
error: ErrorNotification | null;
|
|
7
6
|
flow: AnalyticsFlow;
|
|
8
|
-
step:
|
|
7
|
+
step: AnalyticsNamedStep;
|
|
9
8
|
};
|
|
10
9
|
/** Emits once for each continuous episode in which an error is displayed. */
|
|
11
10
|
export declare function useTrackErrorShown({ error, flow, step }: TrackErrorShownArgs): void;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { type QueryClient } from '@tanstack/react-query';
|
|
1
2
|
import { type ConvertBalances } from '../domains/convert/balances';
|
|
2
3
|
import type { ConvertRecipientAddresses, ConvertResolvedAsset, GetConvertBalances } from '../domains/convert/types';
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Marks every reader of the host's `getBalances` stale after funds land.
|
|
6
|
+
* Readers on screen read again now, the rest when they next show.
|
|
7
|
+
*/
|
|
8
|
+
export declare function invalidateHostBalances(queryClient: QueryClient): void;
|
|
4
9
|
interface UseConvertBalancesParams {
|
|
5
10
|
/** Scopes reads to one checkout, whose `getBalances` may differ from the last. */
|
|
6
11
|
checkoutId: string | undefined;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Retrieves the maximum checkout amount in USD and formats the limit text.
|
|
3
3
|
*
|
|
4
4
|
* @description
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The Statsig `maxcheckoutusd` config, lowered by the active checkout's
|
|
6
|
+
* `getMaxDepositUSD` (only while a checkout is active). A negative value
|
|
7
|
+
* means no limit, and the hook returns 'no' as the limit text.
|
|
8
8
|
*
|
|
9
9
|
* @returns {Object} An object containing:
|
|
10
10
|
* - `value`: The maximum checkout amount in USD (number). Defaults to Number.MAX_VALUE (no limit).
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CheckoutState, type DirectExecution } from '@funkit/api-base';
|
|
2
|
+
type HostDepositSettlement = {
|
|
3
|
+
state: CheckoutState;
|
|
4
|
+
message: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The host's answer for this deposit, or undefined when no host check applies.
|
|
8
|
+
* - It is a query so that the host is asked once however many components read
|
|
9
|
+
* the answer, and every reader gets the same one.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useHostDepositSettlement(directExecution: DirectExecution | undefined): HostDepositSettlement | undefined;
|
|
12
|
+
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Modal open state plus a prop that outlives the close animation.
|
|
3
3
|
*
|
|
4
4
|
* The prop keys the modal component, so clearing it is delayed until the
|
|
5
|
-
* animation finishes — and
|
|
5
|
+
* animation finishes — and canceled if the owner unmounts first, which would
|
|
6
6
|
* otherwise set state on a torn-down tree.
|
|
7
7
|
*/
|
|
8
8
|
export declare function useModalStateValueWithProp<T = string>(): {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type CheckoutHistoryItem } from '@funkit/api-base';
|
|
2
|
+
import type { MergedMultiStepDirectExecution } from '../domains/checkoutNotifications';
|
|
3
|
+
import type { NotificationItem } from '../modals/CheckoutModal/TransferToken/types';
|
|
4
|
+
/**
|
|
5
|
+
* Marks the host's balances stale once per completed deposit. Feed it every
|
|
6
|
+
* history update; polls keep reporting a deposit as completed. Each caller
|
|
7
|
+
* keeps its own record of the deposits it has refreshed for.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useRefreshBalancesOnDeposit(): (historyItem: NotificationItem) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Marks the host's balances stale when a deposit in the recent deposit queries
|
|
12
|
+
* completes. Deposits already complete when a list first loads are recorded
|
|
13
|
+
* without a refresh. Reads the raw query data, so it doesn't depend on which
|
|
14
|
+
* notifications are on screen. Keeps its own record, separate from
|
|
15
|
+
* useRefreshBalancesOnDeposit.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useRefreshBalancesOnRecentDeposits({ checkouts, mergedDirectExecutions, }: {
|
|
18
|
+
checkouts: CheckoutHistoryItem[] | undefined;
|
|
19
|
+
mergedDirectExecutions: MergedMultiStepDirectExecution[] | undefined;
|
|
20
|
+
}): void;
|