@funkit/connect 12.20.0 → 12.22.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 +105 -0
- package/dist/clients/{chunk-N46CL4ZT.js → chunk-4NWQR25X.js} +1 -1
- package/dist/clients/{chunk-2BBOZQLZ.js → chunk-5JVG4MS2.js} +1 -1
- package/dist/clients/chunk-B67ESBGC.js +108 -0
- package/dist/clients/{chunk-R5VAX6YA.js → chunk-HGLDKRSQ.js} +81 -33
- package/dist/clients/{chunk-VFKEUHZT.js → chunk-R7I5OO6C.js} +1 -1
- package/dist/clients/{chunk-5NYKSTGH.js → chunk-S4SMCBQ4.js} +1 -1
- package/dist/clients/{chunk-Y7ONHWCW.js → chunk-T4Q43DNC.js} +2 -2
- package/dist/clients/{chunk-TLFE74BL.js → chunk-UBZOARBX.js} +3 -3
- package/dist/clients/{chunk-TFIJZTGQ.js → chunk-Y2O77SJO.js} +1 -1
- package/dist/clients/fanatics.d.ts +5 -7
- package/dist/clients/fanatics.js +4 -4
- 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 +4 -4
- package/dist/clients/internal/nado/withdrawalStatus.js +4 -4
- package/dist/clients/lighter.css +32 -11
- package/dist/clients/lighter.js +5 -5
- package/dist/clients/lighterRh.js +1 -1
- package/dist/clients/mallard.d.ts +34 -1
- package/dist/clients/mallard.js +148 -3
- package/dist/clients/nado.js +4 -4
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +3 -3
- package/dist/clients/polymarket/index.js +3 -3
- package/dist/clients/polymarket/polymarket.d.ts +22 -22
- package/dist/clients/polymarket/polymarket.js +2 -2
- package/dist/components/Avatar/emojiAvatarForAddress.d.ts +35 -35
- package/dist/components/Box/Box.d.ts +63 -63
- package/dist/components/ConnectButton/ConnectButton.d.ts +16 -15
- package/dist/components/CustomSlot/CustomSlot.d.ts +8 -0
- package/dist/components/CustomSlot/CustomSlotBoundary.d.ts +12 -0
- package/dist/components/DestinationSelector/DestinationAssetBalanceLabel.d.ts +6 -0
- package/dist/components/DestinationSelector/DestinationSelector.css.d.ts +3 -0
- package/dist/components/DestinationSelector/DestinationSelector.d.ts +17 -0
- package/dist/components/DestinationSelector/DestinationSelectorSkeleton.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts +12 -4
- package/dist/components/Dialog/hooks.d.ts +3 -3
- package/dist/components/Dropdown/AccountSelectDropdown.d.ts +8 -1
- package/dist/components/Dropdown/BaseDropdown.d.ts +3 -1
- package/dist/components/Dropdown/BaseDropdownItem.d.ts +3 -1
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +2 -0
- package/dist/components/FreeUsdcBanner/FreeUsdcBanner.d.ts +2 -2
- package/dist/components/FunBottomBar/FunBottomBar.d.ts +3 -1
- package/dist/components/FunInfoBanner/InfoBanner.d.ts +1 -1
- package/dist/components/FunInput/FunInput.d.ts +1 -1
- package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
- package/dist/components/FunTooltip/FunTooltip.d.ts +2 -2
- package/dist/components/FunTransactionSummary/DestinationLineItems.d.ts +1 -1
- package/dist/components/HighPriceImpactAlert/HighPriceImpactAlert.d.ts +7 -0
- package/dist/components/Icons/GreenRoundCheckmark.d.ts +2 -1
- package/dist/components/Icons/StatusIcons.css.d.ts +2 -2
- package/dist/components/Icons/StatusIcons.d.ts +2 -2
- package/dist/components/LargeAmountInput/LargeAmountInput.d.ts +3 -1
- package/dist/components/ModalSelection/ModalSelection.d.ts +4 -4
- package/dist/components/TokenSwapWidget/TokenSwapCard/TokenSwapCard.d.ts +5 -2
- package/dist/components/TokenSwapWidget/TokenSwapWidget.d.ts +2 -0
- package/dist/consts/checkout.d.ts +8 -8
- package/dist/consts/polymarket.d.ts +2 -2
- package/dist/consts/quote.d.ts +25 -15
- package/dist/css/cssObjectFromTheme.d.ts +1 -1
- package/dist/css/sprinkles.css.d.ts +78 -78
- package/dist/domains/asset.d.ts +6 -0
- package/dist/domains/bridge.d.ts +1 -1
- package/dist/domains/clientMetadata.d.ts +5 -6
- package/dist/domains/convert/assets.d.ts +6 -0
- package/dist/domains/convert/balances.d.ts +4 -2
- package/dist/domains/convert/screen.d.ts +4 -0
- package/dist/domains/destinationAccount.d.ts +14 -0
- package/dist/domains/destinationAssetBalance.d.ts +39 -0
- package/dist/domains/fees.d.ts +13 -0
- package/dist/domains/inputAmountComponentContext.d.ts +11 -0
- package/dist/hooks/queries/useMeldLimits.d.ts +45 -45
- package/dist/hooks/queries/useWithdrawalQuote.d.ts +62 -62
- package/dist/hooks/track/useTrack.d.ts +1 -1
- package/dist/hooks/useCheckoutQuoteNotification.d.ts +3 -3
- package/dist/hooks/useConvertBalances.d.ts +4 -2
- package/dist/hooks/useConvertQuote.d.ts +1 -1
- package/dist/hooks/useDestinationAccountSelector.d.ts +18 -0
- package/dist/hooks/useDestinationAssetBalances.d.ts +5 -0
- package/dist/hooks/useDynamicRoutes.d.ts +1 -1
- package/dist/hooks/useFrogAccount.d.ts +77 -77
- package/dist/hooks/useHighPriceImpactPercent.d.ts +11 -0
- package/dist/hooks/useIsomorphicEffect.d.ts +2 -2
- package/dist/hooks/usePaymentMethodIcon.d.ts +1 -1
- package/dist/hooks/usePaymentSources.d.ts +1 -1
- package/dist/hooks/usePolymarketAccountBalances.d.ts +1 -1
- package/dist/index.css +32 -11
- package/dist/index.d.ts +4 -1
- package/dist/index.js +3652 -2674
- package/dist/modals/CheckoutModal/Convert/ConvertChainRail.d.ts +13 -0
- package/dist/modals/CheckoutModal/Convert/ConvertSelectDestinationStep.d.ts +6 -4
- package/dist/modals/CheckoutModal/InputAmount/InputAmountLayout.d.ts +2 -1
- package/dist/modals/CheckoutModal/SourceChange/FlatList.d.ts +2 -8
- package/dist/modals/CheckoutModal/SourceChange/SourceList.d.ts +1 -2
- package/dist/modals/CheckoutModal/SourceChange/useSourceChangeLayout.d.ts +5 -1
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframe.d.ts +13 -2
- package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsTransferScreen.d.ts +6 -1
- package/dist/modals/PolymarketPerpsTransfer/usePerpsTransferForm.d.ts +6 -1
- package/dist/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.css.d.ts +1 -1
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +1 -1
- package/dist/modals/WithdrawalModal/useMultiSourceWithdrawal.d.ts +1 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +55 -11
- package/dist/providers/FunkitConfigContext.d.ts +24 -1
- package/dist/providers/FunkitStatsigProvider.d.ts +1 -1
- package/dist/providers/GeneralWalletProvider.d.ts +21 -21
- package/dist/providers/ModalSizeContext.d.ts +4 -4
- package/dist/shadow-css.js +1 -1
- package/dist/themes/baseTheme.d.ts +1 -1
- package/dist/themes/darkTheme.d.ts +6 -4
- package/dist/themes/lightTheme.d.ts +6 -4
- package/dist/utils/checkout.d.ts +2 -1
- package/dist/utils/consts.d.ts +1 -0
- package/dist/utils/customer.d.ts +96 -96
- package/dist/utils/datadogBrowserLogsTransport.d.ts +11 -5
- package/dist/utils/datadogPageExit.d.ts +5 -0
- package/dist/utils/funError.d.ts +26 -0
- package/dist/utils/funLogger.d.ts +2 -1
- package/dist/utils/shakeElement.d.ts +7 -0
- package/dist/wallets/computeWalletConnectMetaData.d.ts +1 -1
- 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 +57 -57
- 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 +10 -10
- package/dist/clients/chunk-GTPMJGCF.js +0 -52
- package/dist/modals/CheckoutModal/Convert/ConvertChainPills.d.ts +0 -14
- package/dist/modals/CheckoutModal/SourceChange/PayPal.d.ts +0 -2
- package/dist/wallets/walletConnectors/{chunk-CU5J53XR.js → chunk-53MYTA42.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-ZSSSLFQF.js → chunk-65ULY6OC.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-XODA5ESL.js → chunk-A5POD5SV.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-RXRYHMRI.js → chunk-ANODOMIN.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-IWOMSW64.js → chunk-ASTCNVJC.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-U52QO5HF.js → chunk-F45CUFRR.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YRMBR6NA.js → chunk-FYPQ3HP4.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-BBDNB5TQ.js → chunk-IWPW26AL.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-4FHNLTR3.js → chunk-JJBLW4IU.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-NXWG6FG2.js → chunk-KE4CWI3A.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-BBB2J3US.js → chunk-MWB6LFSG.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-34B7OJNT.js → chunk-OVDCDVFX.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-SR5CZR3L.js → chunk-PPQ6L4K2.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-IA5432IR.js → chunk-RJF2YEZ5.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-RFCZYLNR.js → chunk-RQYEGJKL.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-TRZDAXCQ.js → chunk-TIHTQ3OB.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-ALGPGI6V.js → chunk-TM7UBV3Q.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-HOCKAU5H.js → chunk-USLZMUJ3.js} +3 -3
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ConvertChainRailProps {
|
|
3
|
+
chainIds: string[];
|
|
4
|
+
/** `undefined` highlights no chain, as during a search. */
|
|
5
|
+
activeChainId: string | undefined;
|
|
6
|
+
onChange: (chainId: string) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The destination screen's chain picker: a column of chain icons beside the
|
|
10
|
+
* token list, each named in a tooltip.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ConvertChainRail({ chainIds, activeChainId, onChange, }: ConvertChainRailProps): React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -20,13 +20,15 @@ export declare function getInitialDestinationChainId({ chainIds, destinationAsse
|
|
|
20
20
|
destinationAsset: ConvertResolvedAsset | undefined;
|
|
21
21
|
}): string | undefined;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* The destination rows without the source, on one chain, or on every chain
|
|
24
|
+
* when `chainId` is left out, narrowed by `query`. Held tokens come first by
|
|
25
|
+
* USD value, then the rest in the host's order.
|
|
25
26
|
*/
|
|
26
|
-
export declare function getConvertDestinationOptions({ assets, balances, chainId, sourceKey, recipientAddresses, }: {
|
|
27
|
+
export declare function getConvertDestinationOptions({ assets, balances, chainId, query, sourceKey, recipientAddresses, }: {
|
|
27
28
|
assets: ConvertResolvedAsset[];
|
|
28
29
|
balances: ConvertBalances | undefined;
|
|
29
|
-
chainId
|
|
30
|
+
chainId?: string;
|
|
31
|
+
query?: string;
|
|
30
32
|
sourceKey: string | undefined;
|
|
31
33
|
recipientAddresses: ConvertRecipientAddresses;
|
|
32
34
|
}): ConvertAssetOption[];
|
|
@@ -5,6 +5,7 @@ interface InputAmountLayoutProps {
|
|
|
5
5
|
actionButtonProps: FunButtonProps;
|
|
6
6
|
fiatCurrencySelector?: ReactNode;
|
|
7
7
|
amountOptions?: ReactNode;
|
|
8
|
+
customComponent?: ReactNode;
|
|
8
9
|
amountInput: ReactNode;
|
|
9
10
|
amountInputSwitch: ReactNode;
|
|
10
11
|
/** Symbol of the token the switcher displays — mode-dependent (EXACT_IN →
|
|
@@ -16,5 +17,5 @@ interface InputAmountLayoutProps {
|
|
|
16
17
|
footer?: ReactNode;
|
|
17
18
|
error?: ErrorNotification;
|
|
18
19
|
}
|
|
19
|
-
export declare function InputAmountLayout({ actionButtonProps, amountOptions, fiatCurrencySelector, amountInput, amountInputSwitch, switcherTokenSymbol, header, footer, error, }: InputAmountLayoutProps): React.JSX.Element;
|
|
20
|
+
export declare function InputAmountLayout({ actionButtonProps, amountOptions, customComponent, fiatCurrencySelector, amountInput, amountInputSwitch, switcherTokenSymbol, header, footer, error, }: InputAmountLayoutProps): React.JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -8,11 +8,6 @@ interface FlatListProps {
|
|
|
8
8
|
* doesn't reach into FunkitConfig.
|
|
9
9
|
*/
|
|
10
10
|
boxClassName: string;
|
|
11
|
-
/**
|
|
12
|
-
* Label rendered on the `FunDivider` between adjacent groups.
|
|
13
|
-
* Omit to render the divider without a label.
|
|
14
|
-
*/
|
|
15
|
-
dividerLabel?: string;
|
|
16
11
|
/**
|
|
17
12
|
* Trailing content rendered after the groups, inside the outer Box.
|
|
18
13
|
* Used by the source-list flat layout to place PayPal at the
|
|
@@ -24,8 +19,7 @@ interface FlatListProps {
|
|
|
24
19
|
}
|
|
25
20
|
/**
|
|
26
21
|
* Pure presentational primitive: a single column of group bodies with
|
|
27
|
-
*
|
|
28
|
-
* provider/context dependencies — composition lives in the caller.
|
|
22
|
+
* an optional footer. No provider/context dependencies — composition lives in the caller.
|
|
29
23
|
*/
|
|
30
|
-
export declare function FlatList({ groups, boxClassName,
|
|
24
|
+
export declare function FlatList({ groups, boxClassName, footer, testId, }: FlatListProps): React.JSX.Element;
|
|
31
25
|
export {};
|
|
@@ -17,8 +17,7 @@ interface SourceListProps {
|
|
|
17
17
|
* Reads translation, funkit config, and the source-list-relevant
|
|
18
18
|
* Statsig flags directly; runs `buildSourceGroups`; dispatches to the
|
|
19
19
|
* matching layout primitive — `FlatList` for the non-Swapped path
|
|
20
|
-
*
|
|
21
|
-
* the Swapped path (with optional section labels).
|
|
20
|
+
* or `GroupedList` for the Swapped path (with optional section labels).
|
|
22
21
|
*
|
|
23
22
|
* `SourceList` has no DOM of its own; the primitive it returns owns
|
|
24
23
|
* the outer `data-testid` element.
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { BoxProps } from '../../../components/Box/Box';
|
|
2
|
+
import { type DestinationAccountSelector } from '../../../hooks/useDestinationAccountSelector';
|
|
2
3
|
import type { CheckoutModalState } from '../../../modals/CheckoutModal/stepTransition';
|
|
3
4
|
/**
|
|
4
5
|
* Layout decisions shared between SourceChange and SourceChangeLoading so the
|
|
5
6
|
* loading skeleton can't drift from the loaded screen.
|
|
6
7
|
*/
|
|
7
|
-
export declare function useSourceChangeLayout(modalState: Pick<CheckoutModalState, 'step' | 'startingStep'
|
|
8
|
+
export declare function useSourceChangeLayout(modalState: Pick<CheckoutModalState, 'step' | 'startingStep'>, { isLoading }?: {
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
}): {
|
|
8
11
|
isTargetAssetSelectable: boolean;
|
|
12
|
+
destinationSelector: DestinationAccountSelector | undefined;
|
|
9
13
|
showContentDivider: boolean;
|
|
10
14
|
cryptoCashToggleMarginTop: BoxProps['marginTop'];
|
|
11
15
|
cryptoCashToggleLabelVariant: 'default' | 'deposit';
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type SwappedMode } from '../../../providers/SwappedProvider';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* A single Swapped iframe for one flow (`mode`) that lives outside the
|
|
5
|
+
* HeightAnimationWrapper. Uses absolute positioning so it never affects layout
|
|
6
|
+
* measurements. When active and loaded, it overlays the dialog content area.
|
|
7
|
+
* Deposit and withdrawal each render their own instance.
|
|
8
|
+
*
|
|
9
|
+
* Wrapped in React.memo to prevent re-renders from parent state changes
|
|
10
|
+
* (e.g., modal step transitions, tab toggles). Only re-renders when the
|
|
11
|
+
* SwappedContext value changes.
|
|
12
|
+
*/
|
|
13
|
+
declare const SwappedIframe: ({ mode }: {
|
|
4
14
|
mode: SwappedMode;
|
|
5
|
-
}) => React.JSX.Element | null
|
|
15
|
+
}) => React.JSX.Element | null;
|
|
16
|
+
declare const _default: React.MemoExoticComponent<typeof SwappedIframe>;
|
|
6
17
|
export default _default;
|
|
@@ -33,6 +33,11 @@ export interface PolymarketPerpsTransferScreenProps {
|
|
|
33
33
|
* Transfer button simply reports clicks via {@link onTransfer}.
|
|
34
34
|
*/
|
|
35
35
|
status?: PerpsTransferStatus;
|
|
36
|
+
/**
|
|
37
|
+
* Message for the `error` frame. Replaces the generic error notice; omit it
|
|
38
|
+
* to keep the generic notice.
|
|
39
|
+
*/
|
|
40
|
+
errorMessage?: string;
|
|
36
41
|
/**
|
|
37
42
|
* In-flight transfers reported by the host. While a deposit or withdrawal
|
|
38
43
|
* is pending, Transfer is disabled and shows a pending state.
|
|
@@ -63,4 +68,4 @@ export interface PolymarketPerpsTransferScreenProps {
|
|
|
63
68
|
* UI only: balances are props, and the Transfer button's processing/success
|
|
64
69
|
* states are driven by the {@link status} prop rather than any real transfer.
|
|
65
70
|
*/
|
|
66
|
-
export declare function PolymarketPerpsTransferScreen({ open, title, predictionsBalanceUsd, perpsBalanceUsd, predictionsMinTransferUsd, perpsMinTransferUsd, initialDirection, initialAmountUsd, status, pendingTransfers, onTransfer, onClose, onBack, access, }: PolymarketPerpsTransferScreenProps): React.JSX.Element;
|
|
71
|
+
export declare function PolymarketPerpsTransferScreen({ open, title, predictionsBalanceUsd, perpsBalanceUsd, predictionsMinTransferUsd, perpsMinTransferUsd, initialDirection, initialAmountUsd, status, errorMessage, pendingTransfers, onTransfer, onClose, onBack, access, }: PolymarketPerpsTransferScreenProps): React.JSX.Element;
|
|
@@ -25,6 +25,11 @@ export interface PerpsTransferFormProps {
|
|
|
25
25
|
/** Initial amount (plain USD string, up to 2 decimals). Omit for an empty field. */
|
|
26
26
|
initialAmountUsd?: string;
|
|
27
27
|
status?: PerpsTransferStatus;
|
|
28
|
+
/**
|
|
29
|
+
* Integrator-supplied failure message. Shown in place of the generic notice
|
|
30
|
+
* while `status` is `error`.
|
|
31
|
+
*/
|
|
32
|
+
errorMessage?: string | null;
|
|
28
33
|
/** Whether a retained balance is waiting for a fresh authoritative value. */
|
|
29
34
|
isBalanceRefreshing?: boolean;
|
|
30
35
|
/**
|
|
@@ -94,4 +99,4 @@ export interface PerpsTransferForm {
|
|
|
94
99
|
* identical behavior. Returns plain values; `PerpsTransferBody` and
|
|
95
100
|
* `PerpsTransferBottomBar` render them.
|
|
96
101
|
*/
|
|
97
|
-
export declare function usePerpsTransferForm({ predictionsBalanceUsd, perpsBalanceUsd, predictionsMinTransferUsd, perpsMinTransferUsd, initialDirection, initialAmountUsd, status, isBalanceRefreshing, pendingTransfers, onTransfer, access, }: PerpsTransferFormProps): PerpsTransferForm;
|
|
102
|
+
export declare function usePerpsTransferForm({ predictionsBalanceUsd, perpsBalanceUsd, predictionsMinTransferUsd, perpsMinTransferUsd, initialDirection, initialAmountUsd, status, errorMessage, isBalanceRefreshing, pendingTransfers, onTransfer, access, }: PerpsTransferFormProps): PerpsTransferForm;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const baseStyles: string;
|
|
2
|
-
export declare const homeCheckoutDisplayRowStyle: Record<"
|
|
2
|
+
export declare const homeCheckoutDisplayRowStyle: Record<"defaultBackground" | "defaultBorder" | "hoverBackground", string>;
|
|
@@ -101,7 +101,7 @@ export declare function useLighterWithdrawal(config: FunkitWithdrawalConfig, set
|
|
|
101
101
|
routeType: LighterRouteType;
|
|
102
102
|
} | undefined;
|
|
103
103
|
lighterSourceCustomData: {
|
|
104
|
-
type:
|
|
104
|
+
type: 'lighter';
|
|
105
105
|
routeType: LighterRouteType;
|
|
106
106
|
} | undefined;
|
|
107
107
|
lighterSourceAsset: TokenInfo | undefined;
|
|
@@ -27,9 +27,9 @@ export declare function useMultiSourceWithdrawal({ config, withdrawalItem, onCon
|
|
|
27
27
|
sourceId: string;
|
|
28
28
|
config: SingleWithdrawalConfig;
|
|
29
29
|
withdrawalItem: {
|
|
30
|
-
withdrawalSourceTokenBalance: ((params: import("../../providers/FunkitCheckoutContext").WithdrawalSourceTokenBalanceParams) => string | number) | undefined;
|
|
31
30
|
id: string;
|
|
32
31
|
initSettings: Partial<import("../../providers/FunkitCheckoutContext").UseFunkitCheckoutPropsWithFullConfig>;
|
|
32
|
+
withdrawalSourceTokenBalance: ((params: import("../../providers/FunkitCheckoutContext").WithdrawalSourceTokenBalanceParams) => string | number) | undefined;
|
|
33
33
|
} | null;
|
|
34
34
|
sourceSwitcher: {
|
|
35
35
|
options: SourceDropdownOption[];
|
|
@@ -10,8 +10,10 @@ import type { FunCheckoutStep } from '../../modals/CheckoutModal/FunCheckoutStep
|
|
|
10
10
|
import type { WithdrawalClient, WithdrawalTransaction } from '../../wallets/Wallet';
|
|
11
11
|
import type { FunkitCheckoutQuoteResult } from '../FunkitHistoryContext';
|
|
12
12
|
export type FunkitCheckoutActionParams = ApiFunkitCheckoutActionParams;
|
|
13
|
-
import type { AssetClass, DynamicTargetAssetCandidate, TokenInfo } from '@funkit/connect-core';
|
|
14
|
-
export type { AssetClass,
|
|
13
|
+
import type { AssetClass, DynamicTargetAssetCandidate as CoreDynamicTargetAssetCandidate, TokenInfo } from '@funkit/connect-core';
|
|
14
|
+
export type { AssetClass, TokenInfo } from '@funkit/connect-core';
|
|
15
|
+
export interface DynamicTargetAssetCandidate extends CoreDynamicTargetAssetCandidate {
|
|
16
|
+
}
|
|
15
17
|
/**
|
|
16
18
|
* Argument passed to a dynamic {@link FunkitCheckoutConfig.modalTitle} resolver.
|
|
17
19
|
* Extends {@link TokenInfo} with the active dynamic routing id so titles can be
|
|
@@ -22,6 +24,14 @@ export type { AssetClass, DynamicTargetAssetCandidate, TokenInfo, } from '@funki
|
|
|
22
24
|
export interface ModalTitleContext extends TokenInfo {
|
|
23
25
|
dynamicRoutingId?: string;
|
|
24
26
|
}
|
|
27
|
+
export interface DestinationAccount {
|
|
28
|
+
/** Integrator-defined identity matched by a candidate's destinationAccountId. */
|
|
29
|
+
id: string;
|
|
30
|
+
/** Account label supplied already translated by the integrator. */
|
|
31
|
+
label: string;
|
|
32
|
+
/** Defaults to the SDK account icon when omitted. Not persisted in checkout history. */
|
|
33
|
+
icon?: ReactNode;
|
|
34
|
+
}
|
|
25
35
|
/**
|
|
26
36
|
* A token to offer adding to the user's wallet (EIP-747 `wallet_watchAsset`) on
|
|
27
37
|
* the post-checkout success screen.
|
|
@@ -95,6 +105,9 @@ export interface PolymarketTransferAccount {
|
|
|
95
105
|
* rail's own id becomes the tracking record's key, which is the only thing
|
|
96
106
|
* that can later join a Fun record to the venue's side of the same transfer.
|
|
97
107
|
* Returning nothing still records the transfer under a locally minted id.
|
|
108
|
+
*
|
|
109
|
+
* To show a specific message on failure, throw a `FunError` (exported from
|
|
110
|
+
* `@funkit/connect`). Any other rejection shows the generic error notice.
|
|
98
111
|
*/
|
|
99
112
|
transfer: (params: {
|
|
100
113
|
toAddress: Address;
|
|
@@ -235,18 +248,22 @@ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'gen
|
|
|
235
248
|
} | null;
|
|
236
249
|
/**
|
|
237
250
|
* Additional rows rendered last in the confirmation screen's payment method
|
|
238
|
-
* summary. Called synchronously whenever live amounts
|
|
239
|
-
* live data here and set a row's `isLoading` while its
|
|
240
|
-
* Text is displayed as provided, without translation.
|
|
241
|
-
* Return `null` or `[]` to omit rows; only the first
|
|
251
|
+
* summary. Called synchronously whenever live amounts or the selected target
|
|
252
|
+
* change. Read your own live data here and set a row's `isLoading` while its
|
|
253
|
+
* data is stale. Text is displayed as provided, without translation.
|
|
254
|
+
* Return `null` or `[]` to omit rows; only the first 4 are shown.
|
|
242
255
|
*
|
|
243
256
|
* @example
|
|
244
|
-
* resolveDestinationLineItems: ({ targetAssetAmount }) => [
|
|
257
|
+
* resolveDestinationLineItems: ({ targetAssetAmount, targetAsset }) => [
|
|
245
258
|
* {
|
|
246
259
|
* id: 'initial-margin-usage',
|
|
247
260
|
* label: { text: 'Initial Margin Usage', tooltip: 'Collateral required to open positions.' },
|
|
248
261
|
* value: { text: projectInitialMargin(targetAssetAmount), color: 'success' },
|
|
249
262
|
* },
|
|
263
|
+
* {
|
|
264
|
+
* id: 'margin-balance',
|
|
265
|
+
* component: <MarginBalanceRow symbol={targetAsset.symbol} before="$0" after="$2,000" />,
|
|
266
|
+
* },
|
|
250
267
|
* ]
|
|
251
268
|
*/
|
|
252
269
|
resolveDestinationLineItems?: (ctx: DestinationLineItemContext) => DestinationLineItem[] | null;
|
|
@@ -680,6 +697,8 @@ interface UseFunkitCheckoutBaseProps {
|
|
|
680
697
|
onCheckoutBlocked?: (params: {
|
|
681
698
|
blockedReason: CheckoutBlockedReason;
|
|
682
699
|
}) => void;
|
|
700
|
+
/** @deprecated The PayPal source row has been removed, so this callback never fires. This field is ignored. */
|
|
701
|
+
onPolymarketPayPalSwitch?: () => void;
|
|
683
702
|
/**
|
|
684
703
|
* @optional fires once the withdrawal has been submitted — after the wallet
|
|
685
704
|
* transaction is sent or the custom withdrawCallback resolves. `formData`
|
|
@@ -773,19 +792,44 @@ export interface LineItemSlot {
|
|
|
773
792
|
export interface LineItemValue extends LineItemSlot {
|
|
774
793
|
color?: LineItemValueColor;
|
|
775
794
|
}
|
|
776
|
-
/**
|
|
777
|
-
|
|
795
|
+
/**
|
|
796
|
+
* Display-only row rendered in the payment method summary. See `resolveDestinationLineItems`.
|
|
797
|
+
*
|
|
798
|
+
* Either text styled by the SDK (`label` and `value`), or your own `component`
|
|
799
|
+
* for the whole row, which you style. A component row sits in the same row box,
|
|
800
|
+
* which lays out its top-level children like a label and a value. Shadow DOM mode
|
|
801
|
+
* keeps your page's CSS out of the modal, so style it inline or with the theme's
|
|
802
|
+
* CSS variables (e.g. `var(--rk-colors-secondaryText)`).
|
|
803
|
+
*/
|
|
804
|
+
export type DestinationLineItem = {
|
|
778
805
|
/** Stable identifier — the React key, and the row's `data-testid` as `rk-<id>`. */
|
|
779
806
|
id: string;
|
|
780
807
|
label: LineItemSlot;
|
|
781
808
|
value: LineItemValue;
|
|
782
809
|
/** Skeletons the value, e.g. while the data behind it is still loading. */
|
|
783
810
|
isLoading?: boolean;
|
|
784
|
-
|
|
785
|
-
|
|
811
|
+
component?: never;
|
|
812
|
+
} | {
|
|
813
|
+
/** Stable identifier — the React key, and the row's `data-testid` as `rk-<id>`. */
|
|
814
|
+
id: string;
|
|
815
|
+
component: ReactNode;
|
|
816
|
+
/** Skeletons the whole row, e.g. while the data behind it is still loading. */
|
|
817
|
+
isLoading?: boolean;
|
|
818
|
+
label?: never;
|
|
819
|
+
value?: never;
|
|
820
|
+
};
|
|
821
|
+
/** Live checkout amounts and the selected target, handed to `resolveDestinationLineItems`. */
|
|
786
822
|
export interface DestinationLineItemContext {
|
|
787
823
|
/** Target asset amount in token units (e.g. "1.5" for 1.5 USDC), matching the "You receive" row. */
|
|
788
824
|
targetAssetAmount: string;
|
|
825
|
+
/** Token the checkout delivers, following the user's pick among dynamic target assets. */
|
|
826
|
+
targetAsset: {
|
|
827
|
+
address: Address;
|
|
828
|
+
chainId: string;
|
|
829
|
+
symbol: string;
|
|
830
|
+
};
|
|
831
|
+
/** ID of the destination account the checkout deposits into, when the checkout offers destination accounts. */
|
|
832
|
+
destinationAccountId?: string;
|
|
789
833
|
/** Token the user is paying with. `null` fields when no source is selected yet. */
|
|
790
834
|
sourceTokenSymbol: string | null;
|
|
791
835
|
sourceTokenAddress: Address | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ComponentType, type JSX, type ReactNode } from 'react';
|
|
2
|
+
import type { Address } from 'viem';
|
|
2
3
|
import type { BluvoExchangeType } from '../consts/bluvo';
|
|
3
4
|
import type { PaymentMethod } from '../domains/paymentMethods';
|
|
4
5
|
import type { SourceChangeTopComponentProps } from '../modals/CheckoutModal/stepTransition';
|
|
@@ -67,6 +68,21 @@ export interface FunkitTextCustomizationsConfig {
|
|
|
67
68
|
virtualFiat?: string;
|
|
68
69
|
};
|
|
69
70
|
}
|
|
71
|
+
export interface InputAmountComponentContext {
|
|
72
|
+
/** Plain decimal target-token units, rounded to 5 decimals before fees; '0' when empty. */
|
|
73
|
+
targetAssetAmount: string;
|
|
74
|
+
targetAsset: {
|
|
75
|
+
address: Address;
|
|
76
|
+
chainId: string;
|
|
77
|
+
symbol: string;
|
|
78
|
+
};
|
|
79
|
+
/** ID of the destination account the checkout deposits into, when the checkout offers destination accounts. */
|
|
80
|
+
destinationAccountId?: string;
|
|
81
|
+
/** Selected source token, regardless of payment method; all source fields are null without an address. */
|
|
82
|
+
sourceTokenSymbol: string | null;
|
|
83
|
+
sourceTokenAddress: Address | null;
|
|
84
|
+
sourceChainId: string | null;
|
|
85
|
+
}
|
|
70
86
|
export interface FunkitUiDestinationConfig {
|
|
71
87
|
/** What icon (15x15) to show in the `destination` row - defaults to user wallet icon */
|
|
72
88
|
icon?: ReactNode;
|
|
@@ -154,6 +170,13 @@ export interface FunkitUiCustomizationsConfig {
|
|
|
154
170
|
inputAmountScreen?: {
|
|
155
171
|
/** Whether to allow entering an amount of tokens, rather than only USD - defaults to true */
|
|
156
172
|
allowTokenAmountInput?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Renders between quick amounts and You send / You receive on the loaded screen.
|
|
175
|
+
* Called synchronously on every loaded-screen render; return null to hide. Render a child
|
|
176
|
+
* component to use hooks. Style with inline styles or SDK theme CSS variables
|
|
177
|
+
* because host-page styles cannot reach content inside the SDK's shadow DOM.
|
|
178
|
+
*/
|
|
179
|
+
customComponent?: (ctx: InputAmountComponentContext) => ReactNode;
|
|
157
180
|
};
|
|
158
181
|
selectAssetScreen?: {
|
|
159
182
|
/** Whether the secondary token symbol is visible - defaults to true */
|
|
@@ -248,7 +271,7 @@ export interface FunkitUiCustomizationsConfig {
|
|
|
248
271
|
type RequiredExceptCustomComponents<T> = Required<Omit<T & {}, `${string}Component`>>;
|
|
249
272
|
export type FunkitUiCustomizationsConfigInternal = Required<FunkitUiCustomizationsConfig> & {
|
|
250
273
|
confirmationScreen: FunkitUiCustomizationsConfig['confirmationScreen'] & Required<Omit<FunkitUiCustomizationsConfig['confirmationScreen'] & {}, 'destinationConfig' | 'selectedRouteConfig' | 'showTokenAmount'>>;
|
|
251
|
-
inputAmountScreen:
|
|
274
|
+
inputAmountScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['inputAmountScreen']>;
|
|
252
275
|
selectAssetScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['selectAssetScreen']>;
|
|
253
276
|
transferCryptoScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['transferCryptoScreen']>;
|
|
254
277
|
withdrawalScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['withdrawalScreen']>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type StatsigOptions } from '@statsig/react-bindings';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
|
-
export declare const STATSIG_CLIENT_KEY:
|
|
4
|
+
export declare const STATSIG_CLIENT_KEY: 'client-UmFd8WIJljA7cLmZuDqs3X25M8sKd5WIQP4BSC2bRbM';
|
|
5
5
|
export declare function getStatsigOptions(isDevelopment: boolean): StatsigOptions;
|
|
6
6
|
interface FunkitStatsigProviderProps {
|
|
7
7
|
children: ReactNode;
|
|
@@ -61,22 +61,6 @@ export declare const useIdentity: IdentityProvider['useIdentity'];
|
|
|
61
61
|
* Replacement for wagmi's `useAccount`
|
|
62
62
|
*/
|
|
63
63
|
export declare const useFunkitAccount: () => {
|
|
64
|
-
account: "" | `0x${string}`;
|
|
65
|
-
isConnected: boolean;
|
|
66
|
-
loginType: LoginType;
|
|
67
|
-
address: undefined;
|
|
68
|
-
addresses: undefined;
|
|
69
|
-
chain: undefined;
|
|
70
|
-
chainId: undefined;
|
|
71
|
-
connector: undefined;
|
|
72
|
-
isReconnecting: false;
|
|
73
|
-
isConnecting: false;
|
|
74
|
-
isDisconnected: true;
|
|
75
|
-
status: "disconnected";
|
|
76
|
-
} | {
|
|
77
|
-
account: "" | `0x${string}`;
|
|
78
|
-
isConnected: boolean;
|
|
79
|
-
loginType: LoginType;
|
|
80
64
|
address: Address;
|
|
81
65
|
addresses: readonly [Address, ...Address[]];
|
|
82
66
|
chain: import("viem").Chain | undefined;
|
|
@@ -85,11 +69,11 @@ export declare const useFunkitAccount: () => {
|
|
|
85
69
|
isConnecting: false;
|
|
86
70
|
isDisconnected: false;
|
|
87
71
|
isReconnecting: false;
|
|
88
|
-
status:
|
|
89
|
-
} | {
|
|
72
|
+
status: 'connected';
|
|
90
73
|
account: "" | `0x${string}`;
|
|
91
74
|
isConnected: boolean;
|
|
92
75
|
loginType: LoginType;
|
|
76
|
+
} | {
|
|
93
77
|
address: Address | undefined;
|
|
94
78
|
addresses: readonly Address[] | undefined;
|
|
95
79
|
chain: import("viem").Chain | undefined;
|
|
@@ -98,11 +82,11 @@ export declare const useFunkitAccount: () => {
|
|
|
98
82
|
isConnecting: false;
|
|
99
83
|
isDisconnected: false;
|
|
100
84
|
isReconnecting: true;
|
|
101
|
-
status:
|
|
102
|
-
} | {
|
|
85
|
+
status: 'reconnecting';
|
|
103
86
|
account: "" | `0x${string}`;
|
|
104
87
|
isConnected: boolean;
|
|
105
88
|
loginType: LoginType;
|
|
89
|
+
} | {
|
|
106
90
|
address: Address | undefined;
|
|
107
91
|
addresses: readonly Address[] | undefined;
|
|
108
92
|
chain: import("viem").Chain | undefined;
|
|
@@ -111,7 +95,23 @@ export declare const useFunkitAccount: () => {
|
|
|
111
95
|
isReconnecting: false;
|
|
112
96
|
isConnecting: true;
|
|
113
97
|
isDisconnected: false;
|
|
114
|
-
status:
|
|
98
|
+
status: 'connecting';
|
|
99
|
+
account: "" | `0x${string}`;
|
|
100
|
+
isConnected: boolean;
|
|
101
|
+
loginType: LoginType;
|
|
102
|
+
} | {
|
|
103
|
+
address: undefined;
|
|
104
|
+
addresses: undefined;
|
|
105
|
+
chain: undefined;
|
|
106
|
+
chainId: undefined;
|
|
107
|
+
connector: undefined;
|
|
108
|
+
isReconnecting: false;
|
|
109
|
+
isConnecting: false;
|
|
110
|
+
isDisconnected: true;
|
|
111
|
+
status: 'disconnected';
|
|
112
|
+
account: "" | `0x${string}`;
|
|
113
|
+
isConnected: boolean;
|
|
114
|
+
loginType: LoginType;
|
|
115
115
|
};
|
|
116
116
|
export declare const useFunkitUserInfo: () => FunkitUserInfo;
|
|
117
117
|
export type FunkitDisconnectReturnType = UseDisconnectReturnType & {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react';
|
|
2
2
|
export declare const ModalSizeOptions: {
|
|
3
|
-
readonly COMPACT:
|
|
4
|
-
readonly MEDIUM:
|
|
5
|
-
readonly WIDE:
|
|
6
|
-
readonly EXTRA_WIDE:
|
|
3
|
+
readonly COMPACT: 'compact';
|
|
4
|
+
readonly MEDIUM: 'medium';
|
|
5
|
+
readonly WIDE: 'wide';
|
|
6
|
+
readonly EXTRA_WIDE: 'extraWide';
|
|
7
7
|
};
|
|
8
8
|
export type ModalSizes = (typeof ModalSizeOptions)[keyof typeof ModalSizeOptions];
|
|
9
9
|
export declare const ModalSizeContext: React.Context<ModalSizes>;
|