@funkit/connect 11.0.0 → 11.2.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 +71 -0
- package/dist/clients/chunk-2576N7PQ.js +44 -0
- package/dist/clients/{chunk-II5CZTBC.js → chunk-3P2C436B.js} +3 -1
- package/dist/clients/chunk-63XTVHO3.js +19 -0
- package/dist/clients/chunk-6QCAWEAT.js +53 -0
- package/dist/clients/{chunk-6CYZKITE.js → chunk-6T6URLBM.js} +1 -1
- package/dist/clients/{chunk-LT4EWLDA.js → chunk-BPDLF2R6.js} +1 -0
- package/dist/clients/{chunk-JD2J5K6S.js → chunk-C45VNQXY.js} +161 -18
- package/dist/clients/chunk-DGBIV3ZS.js +36 -0
- package/dist/clients/{chunk-MGQLVTSH.js → chunk-FM7SFGAV.js} +27 -21
- package/dist/clients/{chunk-6PIIYPQK.js → chunk-IYCZWLAF.js} +5 -327
- package/dist/clients/{chunk-BNMZM23Q.js → chunk-JFDRLSYM.js} +3 -3
- package/dist/clients/chunk-PENJ5JGH.js +331 -0
- package/dist/clients/chunk-QQEGNLGD.js +40 -0
- package/dist/clients/chunk-SU3YSNMB.js +306 -0
- package/dist/clients/chunk-TZGKB6WY.js +160 -0
- package/dist/clients/{chunk-2FSEE3AW.js → chunk-UK64SY6N.js} +2 -89
- package/dist/clients/chunk-VIAEAD75.js +61 -0
- package/dist/clients/{chunk-L2KSNS7H.js → chunk-WZRW6WUM.js} +1 -1
- package/dist/clients/{chunk-C4SHJFOV.js → chunk-XJTRLB7W.js} +9 -9
- package/dist/clients/{chunk-YFHTV7DT.js → chunk-Y7WLUPTX.js} +1 -1
- package/dist/clients/chunk-YUZ3B2Q3.js +15 -0
- package/dist/clients/{chunk-2YWQL3AO.js → chunk-Z7HTQFEO.js} +26 -3
- package/dist/clients/fanatics.js +2 -1
- package/dist/clients/internal/nado/consts.d.ts +6 -0
- package/dist/clients/internal/nado/consts.js +5 -3
- package/dist/clients/internal/nado/encoding.d.ts +5 -2
- package/dist/clients/internal/nado/encoding.js +1 -1
- package/dist/clients/internal/nado/errors.d.ts +14 -1
- package/dist/clients/internal/nado/errors.js +7 -3
- package/dist/clients/internal/nado/fetch.js +2 -2
- package/dist/clients/internal/nado/gateway.d.ts +19 -20
- package/dist/clients/internal/nado/gateway.js +4 -6
- package/dist/clients/internal/nado/hooks.d.ts +8 -2
- package/dist/clients/internal/nado/hooks.js +10 -10
- package/dist/clients/internal/nado/indexer.js +4 -4
- package/dist/clients/internal/nado/typedData.js +4 -37
- package/dist/clients/internal/nado/withdrawalCallback.d.ts +20 -0
- package/dist/clients/internal/nado/withdrawalCallback.js +20 -0
- package/dist/clients/internal/nado/withdrawalConfig.d.ts +8 -3
- package/dist/clients/internal/nado/withdrawalConfig.js +7 -3
- package/dist/clients/internal/nado/withdrawalErrors.d.ts +14 -0
- package/dist/clients/internal/nado/withdrawalErrors.js +11 -0
- package/dist/clients/internal/nado/withdrawalForm.css +43 -35
- package/dist/clients/internal/nado/withdrawalForm.d.ts +9 -7
- package/dist/clients/internal/nado/withdrawalForm.js +81 -98
- package/dist/clients/internal/nado/withdrawalStatus.d.ts +41 -0
- package/dist/clients/internal/nado/withdrawalStatus.js +231 -0
- package/dist/clients/internal/nado/withdrawalTypes.d.ts +21 -7
- package/dist/clients/lighter.css +61 -53
- package/dist/clients/lighter.js +8 -7
- package/dist/clients/mallard.js +4 -3
- package/dist/clients/nado.d.ts +67 -0
- package/dist/clients/nado.js +73 -0
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +103 -95
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +9 -6
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +3 -2
- package/dist/clients/polymarket/index.css +103 -95
- package/dist/clients/polymarket/index.js +9 -6
- package/dist/clients/polymarket/polymarket.js +2 -1
- package/dist/components/Dialog/Dialog.d.ts +3 -1
- package/dist/components/Dialog/DialogContent.css.d.ts +6 -0
- package/dist/components/FunCheckbox/FunCheckbox.d.ts +3 -1
- package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +2 -1
- package/dist/consts/customers.d.ts +1 -1
- package/dist/domains/nado.d.ts +11 -2
- package/dist/domains/quoteMode/types.d.ts +16 -0
- package/dist/domains/relay.d.ts +0 -3
- package/dist/hooks/track/analytics/events.d.ts +85 -0
- package/dist/hooks/track/analytics/mappers.d.ts +8 -0
- package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +37 -0
- package/dist/hooks/track/useTrack.d.ts +3 -2
- package/dist/hooks/useFunkitTranslation.d.ts +5 -0
- package/dist/hooks/useTokenAndChainDropdown.d.ts +4 -1
- package/dist/index.css +43 -35
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4414 -3570
- package/dist/modals/CheckoutModal/InputAmount/InputAmount.d.ts +5 -1
- package/dist/modals/CheckoutModal/InputAmount/state.d.ts +13 -0
- package/dist/modals/CheckoutModal/InputAmount/useMeld.d.ts +4 -3
- package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +9 -1
- package/dist/modals/CheckoutModal/MeldQuotes/MeldQuotes.d.ts +3 -1
- package/dist/modals/CheckoutModal/MeldRedirect/MeldRedirect.d.ts +4 -1
- package/dist/modals/CheckoutModal/SourceChange/useBottomBarCloseLabel.d.ts +7 -0
- package/dist/modals/WithdrawalModal/LockedReceiveDisplay.d.ts +22 -0
- package/dist/modals/WithdrawalModal/NadoWithdrawalSuccess.d.ts +20 -0
- package/dist/modals/WithdrawalModal/withdrawalFormHelpers.d.ts +18 -1
- package/dist/modals/WithdrawalModal/withdrawalHooks.d.ts +1 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +4 -3
- package/dist/providers/FunkitStatsigProvider.d.ts +7 -0
- package/dist/providers/GeneralWalletProvider.d.ts +1 -0
- package/dist/utils/customer.d.ts +23 -230
- package/dist/utils/withdrawal.d.ts +11 -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 +33 -33
- 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 +4 -4
- package/dist/clients/chunk-SFDEST63.js +0 -18
- package/dist/clients/chunk-ZCCLJW6F.js +0 -99
- package/dist/wallets/walletConnectors/{chunk-W2LCLDPX.js → chunk-2VP2F6EK.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-IULPZP2Q.js → chunk-4T6ZSRJF.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-WAHGI5L7.js → chunk-6BW3HLBG.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YO2K4MBH.js → chunk-CCQV2ZET.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-TKB2OY6G.js → chunk-CPI4TD43.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-OX37G4YT.js → chunk-F5XEEVG6.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-JPN6TWIT.js → chunk-HNRB7KJU.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-WKNQMP4A.js → chunk-HTHAK6XB.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-GUQM4QSL.js → chunk-MIQTHJ6X.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-4NV5BYRP.js → chunk-RB3HR4R2.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-SWFF3TWJ.js → chunk-RVOY537T.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-KI5Y2BBF.js → chunk-STVVP43G.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-OEEGYENV.js → chunk-UK7C2JXW.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YQFGVZGR.js → chunk-VAPGUPHO.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-XCNHV3HS.js → chunk-VTM6EECM.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-NR2OGDHQ.js → chunk-X6CGV36L.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-AVDUNQUW.js → chunk-YEZM4CK4.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-KCRO2AGO.js → chunk-ZNX4EMPB.js} +3 -3
|
@@ -3,21 +3,25 @@ import React from 'react';
|
|
|
3
3
|
import type { Hex } from 'viem';
|
|
4
4
|
import { type PaymentMethodInfo } from '../../../domains/paymentMethods';
|
|
5
5
|
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
|
|
6
|
+
import type { AmountSelection } from './state';
|
|
6
7
|
export type InputAmountState = CheckoutModalCommonState & {
|
|
7
8
|
paymentMethodInfo: PaymentMethodInfo;
|
|
8
9
|
fiatAmount?: number;
|
|
9
10
|
fiatCurrency?: string;
|
|
10
11
|
quote?: MeldQuote;
|
|
12
|
+
serviceProvider?: MeldServiceProvider;
|
|
11
13
|
isInputInFiat?: boolean;
|
|
12
14
|
/** Preserved token amount from a previous visit (source of truth in EXACT_IN) */
|
|
13
15
|
assetAmount?: number;
|
|
14
16
|
/** Source token identifier — used to detect asset changes and discard stale values */
|
|
15
17
|
sourceTokenKey?: string;
|
|
18
|
+
/** How the current amount was selected for analytics attribution */
|
|
19
|
+
amountSelection?: AmountSelection;
|
|
16
20
|
};
|
|
17
21
|
export type InputAmountNext = Record<string, never> | {
|
|
18
22
|
fiatAmount: number | undefined;
|
|
19
23
|
fiatCurrency?: string;
|
|
20
|
-
|
|
24
|
+
serviceProvider?: MeldServiceProvider;
|
|
21
25
|
quote?: MeldQuote;
|
|
22
26
|
nextStep?: FunCheckoutStep.SOURCE_CHANGE | FunCheckoutStep.MELD_CURRENCY_SELECT | FunCheckoutStep.MELD_QUOTES | FunCheckoutStep.MELD_REDIRECT;
|
|
23
27
|
} | {
|
|
@@ -4,6 +4,19 @@ import { type PaymentMethodInfo } from '../../../domains/paymentMethods';
|
|
|
4
4
|
import type { QuoteBuilder } from '../../../domains/quoteMode/types';
|
|
5
5
|
import type { AssetHoldingsItem } from '../../../utils/assets';
|
|
6
6
|
import type { FunkitCheckoutConfig } from '../../../providers/FunkitCheckoutContext';
|
|
7
|
+
/**
|
|
8
|
+
* How the current input amount was chosen.
|
|
9
|
+
* - `default` — the auto-computed initial amount, left untouched
|
|
10
|
+
* - `manual` — the user typed a value
|
|
11
|
+
* - `preset` — a quick option whose label is carried in `presetAmount`
|
|
12
|
+
* - `max` — a 100% balance option or max recovery action
|
|
13
|
+
* - `min` — a minimum-amount recovery action
|
|
14
|
+
*/
|
|
15
|
+
export type AmountSelectionType = 'default' | 'manual' | 'preset' | 'max' | 'min';
|
|
16
|
+
export type AmountSelection = {
|
|
17
|
+
selectType: AmountSelectionType;
|
|
18
|
+
presetAmount: string | null;
|
|
19
|
+
};
|
|
7
20
|
export interface AmountInputInitOptions {
|
|
8
21
|
checkoutConfig: FunkitCheckoutConfig;
|
|
9
22
|
paymentMethodInfo: PaymentMethodInfo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MeldQuote } from '@funkit/api-base';
|
|
1
|
+
import type { MeldQuote, MeldServiceProvider } from '@funkit/api-base';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { ErrorNotification } from '../../../components/FunNotification/FunNotification';
|
|
4
4
|
import { FunCheckoutStep, type NextPayload } from '../stepTransition';
|
|
@@ -10,16 +10,17 @@ export declare function useMeldUI({ meldEnabled, manuallySelectedQuote, fiatAmou
|
|
|
10
10
|
onNext: (data: NextPayload<FunCheckoutStep.INPUT_AMOUNT>) => void;
|
|
11
11
|
}): {
|
|
12
12
|
getMeldFooter: () => React.JSX.Element;
|
|
13
|
-
handleMeldContinue: () => Promise<void>;
|
|
13
|
+
handleMeldContinue: (quote: MeldQuote) => Promise<void>;
|
|
14
14
|
isMeldContinueDisabled: boolean | undefined;
|
|
15
15
|
isMeldLinkPending: boolean;
|
|
16
16
|
getMeldError: () => ErrorNotification | undefined;
|
|
17
|
+
selectedQuote: MeldQuote | undefined;
|
|
17
18
|
};
|
|
18
19
|
export declare function useMeld(meldEnabled: boolean, manuallySelectedQuote: MeldQuote | undefined, usdAmount: number | undefined, fiatCurrency: string | undefined): {
|
|
19
20
|
meldQuotesQuery: import("@tanstack/react-query").UseQueryResult<MeldQuote[]> & {
|
|
20
21
|
isOutdated: boolean;
|
|
21
22
|
};
|
|
22
|
-
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@funkit/api-base").MeldCreateCryptoWidgetResponse, Error,
|
|
23
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@funkit/api-base").MeldCreateCryptoWidgetResponse, Error, MeldServiceProvider, unknown>;
|
|
23
24
|
isMeldLinkPending: boolean;
|
|
24
25
|
meldLimitError: {
|
|
25
26
|
issue: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ErrorNotification } from '../../../components/FunNotification/FunNotification';
|
|
2
2
|
import type { useFunkitTranslation } from '../../../hooks/useFunkitTranslation';
|
|
3
|
-
import type { AmountInputError } from './state';
|
|
3
|
+
import type { AmountInputError, AmountSelectionType } from './state';
|
|
4
4
|
type TFunction = ReturnType<typeof useFunkitTranslation>['t'];
|
|
5
5
|
export declare const ASSET_DECIMALS = 5;
|
|
6
6
|
export declare const USD_DECIMALS = 2;
|
|
@@ -8,9 +8,17 @@ export declare const USD_INITIAL_AMOUNT = 100;
|
|
|
8
8
|
export declare function getDefaultAmountFromQuickOptions(quickOptions: number[] | undefined): number | undefined;
|
|
9
9
|
export declare function getUsdMaxAmount(maxUsd: number): number | null;
|
|
10
10
|
export declare function getUsdMinAmount(minUsd?: number): number;
|
|
11
|
+
/**
|
|
12
|
+
* Format numeric percentage and fixed-fiat quick-option labels consistently
|
|
13
|
+
* for display and analytics. The 100% balance option is rendered separately
|
|
14
|
+
* as the localized Max label.
|
|
15
|
+
*/
|
|
16
|
+
export declare function formatQuickOptionPresetAmount(option: number, percentMode: boolean, fiatCurrency: string, t: TFunction): string;
|
|
11
17
|
export interface InputAmountSuggestion {
|
|
12
18
|
autoConfirm: boolean;
|
|
13
19
|
buttonLabel: string;
|
|
20
|
+
/** select_type to report for this recovery action; preset_amount is always null alongside it. */
|
|
21
|
+
selectType: Extract<AmountSelectionType, 'max' | 'min'>;
|
|
14
22
|
usdAmount: number;
|
|
15
23
|
}
|
|
16
24
|
/**
|
|
@@ -2,12 +2,14 @@ import type { MeldQuote, MeldServiceProvider } from '@funkit/api-base';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { PaymentMethodCardInfo } from '../../../domains/paymentMethods';
|
|
4
4
|
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
|
|
5
|
+
import type { AmountSelection } from '../InputAmount/state';
|
|
5
6
|
export type MeldQuotesState = CheckoutModalCommonState & {
|
|
6
7
|
paymentMethodInfo: PaymentMethodCardInfo;
|
|
7
8
|
/** Checkout amount in fiat */
|
|
8
9
|
fiatAmount: number | undefined;
|
|
9
10
|
fiatCurrency: string | undefined;
|
|
10
|
-
|
|
11
|
+
serviceProvider?: MeldServiceProvider;
|
|
12
|
+
amountSelection?: AmountSelection;
|
|
11
13
|
};
|
|
12
14
|
export type MeldQuotesNext = Record<string, never> | {
|
|
13
15
|
quote: MeldQuote;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import type { MeldQuote } from '@funkit/api-base';
|
|
1
|
+
import type { MeldQuote, MeldServiceProvider } from '@funkit/api-base';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { PaymentMethodCardInfo } from '../../../domains/paymentMethods';
|
|
4
|
+
import type { AmountSelection } from '../InputAmount/state';
|
|
4
5
|
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
|
|
5
6
|
export type MeldRedirectState = CheckoutModalCommonState & {
|
|
7
|
+
amountSelection?: AmountSelection;
|
|
6
8
|
paymentMethodInfo: PaymentMethodCardInfo;
|
|
7
9
|
/** Checkout amount in fiat */
|
|
8
10
|
fiatAmount: number | undefined;
|
|
9
11
|
fiatCurrency: string | undefined;
|
|
10
12
|
quote: MeldQuote;
|
|
13
|
+
serviceProvider?: MeldServiceProvider;
|
|
11
14
|
};
|
|
12
15
|
export type MeldRedirectNext = Record<string, never>;
|
|
13
16
|
export declare const MeldRedirectInfo: ModalStepInfo<FunCheckoutStep.MELD_REDIRECT>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type BottomBarCloseLabelKey = 'sourceChange.exploreMarketsFirst' | 'common.close';
|
|
2
|
+
/**
|
|
3
|
+
* Customers select the source-change bottom-bar label by key, so resolving it
|
|
4
|
+
* in one place keeps both screens on literal `t()` keys.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useBottomBarCloseLabel(labelKey: BottomBarCloseLabelKey): string;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type LockedReceiveDisplayProps = {
|
|
3
|
+
tokenSymbol: string;
|
|
4
|
+
iconSrc?: string;
|
|
5
|
+
chainId: number;
|
|
6
|
+
/** Overrides the standard locked-receive copy (e.g. Lighter Secure's). */
|
|
7
|
+
tokenTooltip?: string;
|
|
8
|
+
chainTooltip?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The "Receive token" / "Receive chain" pair, rendered read-only. Drops in where
|
|
12
|
+
* `TokenAndChainDropdown` would go when the flow fixes both. Tooltips default
|
|
13
|
+
* to the standard locked-receive message; a caller with its own wording (Lighter
|
|
14
|
+
* Secure) overrides per field.
|
|
15
|
+
*
|
|
16
|
+
* Chain name and icon come from `chainMetadataById` rather than `ChainIcon`:
|
|
17
|
+
* `useChainMetadata` reads that same map first anyway, and going direct keeps this
|
|
18
|
+
* a pure display with no query dependency — and consistent with callers that
|
|
19
|
+
* validate a chain against the same map before locking to it.
|
|
20
|
+
*/
|
|
21
|
+
export declare const LockedReceiveDisplay: ({ tokenSymbol, iconSrc, chainId, tokenTooltip, chainTooltip, }: LockedReceiveDisplayProps) => React.JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nado: "withdrawal requested" screen, tracked through to delivery.
|
|
3
|
+
*
|
|
4
|
+
* Nado's sequencer settles off Fun's rails, so the screen lands on `pending` off
|
|
5
|
+
* Nado's own accepted response and the user stays here for the rest — only the
|
|
6
|
+
* copy moves as the funds clear.
|
|
7
|
+
* (Mirrors LighterSecureWithdrawalSuccess; both collapse into one shell in the
|
|
8
|
+
* planned withdrawal refactor.)
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import type { Address } from 'viem';
|
|
12
|
+
export declare function NadoWithdrawalSuccess({ onClose, onNewWithdrawal, amount, tokenSymbol, depositAddress, }: {
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
onNewWithdrawal: () => void;
|
|
15
|
+
/** Amount debited from the Nado subaccount, in token units. */
|
|
16
|
+
amount: string;
|
|
17
|
+
tokenSymbol: string;
|
|
18
|
+
/** UDA the sequencer sends to; absent leaves the screen on `pending`. */
|
|
19
|
+
depositAddress: Address | undefined;
|
|
20
|
+
}): React.JSX.Element;
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import type { TFunction } from 'i18next';
|
|
2
|
+
import type { Address } from 'viem';
|
|
2
3
|
import type { FunkitCheckoutQuoteResult } from '../../domains/quote';
|
|
3
|
-
import type { CustomWithdrawalConfig, FunkitCheckoutConfig, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
4
|
+
import type { CustomWithdrawalConfig, FunkitCheckoutConfig, SourceTokenOption, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
4
5
|
type FunkitWithdrawalConfig = WalletWithdrawalConfig | CustomWithdrawalConfig;
|
|
6
|
+
/** Where a withdrawal is sending funds: the token, its chain, and its address. */
|
|
7
|
+
export interface SelectedTargetAsset {
|
|
8
|
+
selectedToken: string | undefined;
|
|
9
|
+
selectedChainId: number | undefined;
|
|
10
|
+
selectedChainName: string | undefined;
|
|
11
|
+
targetAssetAddress: Address | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The receive target, resolved once for every consumer below it. These switch as
|
|
15
|
+
* one unit — a direct-transfer-only source pins all four to the option itself,
|
|
16
|
+
* otherwise all four are the dropdown's live selection. `isLocked` saves callers
|
|
17
|
+
* from re-deciding, so this is the only place the lock is evaluated.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveTargetAsset(sourceTokenOption: SourceTokenOption | undefined, selectedTargetAsset: SelectedTargetAsset): SelectedTargetAsset & {
|
|
20
|
+
isLocked: boolean;
|
|
21
|
+
};
|
|
5
22
|
export declare function getWithdrawButtonText({ isWithdrawing, isValidAddress, isRecipientBlacklisted, isRecipientSameAsSource, withdrawalInputAmount, isWithdrawAmountValid, isWithdrawAmountTooHigh, isValidAddressAndChain, selectedToken, selectedChainId, selectedChainName, t, }: {
|
|
6
23
|
isWithdrawing: boolean;
|
|
7
24
|
isValidAddress: boolean;
|
|
@@ -3,7 +3,7 @@ type FunkitWithdrawalConfig = WalletWithdrawalConfig | CustomWithdrawalConfig;
|
|
|
3
3
|
export declare function useWithdrawalAssets(config: FunkitWithdrawalConfig): {
|
|
4
4
|
assets: import("../CheckoutModal/TransferToken/TransferToken").TokenTransferSourceChainsAndAssets;
|
|
5
5
|
selectedChainId: number | undefined;
|
|
6
|
-
handleChainChange: (chainId?: number, autoUpdate?: boolean) =>
|
|
6
|
+
handleChainChange: (chainId?: number, autoUpdate?: boolean) => string | undefined;
|
|
7
7
|
selectedToken: string | undefined;
|
|
8
8
|
selectedChainName: string | undefined;
|
|
9
9
|
handleTokenChange: (token: string, chainId?: number, autoUpdate?: boolean) => void;
|
|
@@ -8,8 +8,8 @@ import type { CheckoutBlockedReason } from '../../modals/CheckoutModal/CheckoutB
|
|
|
8
8
|
import type { WithdrawalClient, WithdrawalTransaction } from '../../wallets/Wallet';
|
|
9
9
|
import type { FunkitCheckoutQuoteResult } from '../FunkitHistoryContext';
|
|
10
10
|
export type FunkitCheckoutActionParams = ApiFunkitCheckoutActionParams;
|
|
11
|
-
import type { DynamicTargetAssetCandidate, TokenInfo } from '@funkit/connect-core';
|
|
12
|
-
export type { DynamicTargetAssetCandidate, TokenInfo, } from '@funkit/connect-core';
|
|
11
|
+
import type { AssetClass, DynamicTargetAssetCandidate, TokenInfo } from '@funkit/connect-core';
|
|
12
|
+
export type { AssetClass, DynamicTargetAssetCandidate, TokenInfo, } from '@funkit/connect-core';
|
|
13
13
|
/**
|
|
14
14
|
* Argument passed to a dynamic {@link FunkitCheckoutConfig.modalTitle} resolver.
|
|
15
15
|
* Extends {@link TokenInfo} with the active dynamic routing id so titles can be
|
|
@@ -211,6 +211,8 @@ export interface SourceTokenOption {
|
|
|
211
211
|
* it — Nado addresses balances by product id, not by token address.
|
|
212
212
|
*/
|
|
213
213
|
customData?: WithdrawalSourceCustomData;
|
|
214
|
+
/** Token class metadata, when this option isn't an ordinary ERC-20. */
|
|
215
|
+
assetClass?: AssetClass;
|
|
214
216
|
}
|
|
215
217
|
export interface WithdrawalConfigBase {
|
|
216
218
|
/** Title to show in the checkout modal. Defaults to "Checkout" **/
|
|
@@ -344,7 +346,6 @@ export type WithdrawalCustomerData = LighterWithdrawalCustomerData | NadoWithdra
|
|
|
344
346
|
* `customerConfig` counterpart to {@link WithdrawalCustomerData}.
|
|
345
347
|
*/
|
|
346
348
|
export type WithdrawalCustomerConfig = NadoWithdrawalCustomerConfig;
|
|
347
|
-
export type { NadoWithdrawalCustomerConfig, NadoWithdrawalCustomerData };
|
|
348
349
|
/**
|
|
349
350
|
* Flow-specific descriptor for the selected source token, discriminated by
|
|
350
351
|
* `type`. Needed where {@link TokenInfo} alone can't name the balance:
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { type StatsigClient } from '@statsig/react-bindings';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import type { ReactNode } from 'react';
|
|
3
4
|
export declare const STATSIG_CLIENT_KEY: "client-UmFd8WIJljA7cLmZuDqs3X25M8sKd5WIQP4BSC2bRbM";
|
|
5
|
+
export declare const STATSIG_CLIENT_KEY_FUNWHN: "client-UrueDVSY9et85npGccWMFidPs00V5jzTYyzsDKlLAjr";
|
|
6
|
+
/**
|
|
7
|
+
* THIS IS THE TEMPORARY CLIENT FOR V2 ANALYTICS. IT DOES NOT CONTAIN ANY CONFIGS.
|
|
8
|
+
* DO NOT USE THIS CONTEXT DIRECTLY. USE useTrack.logEventV2 INSTEAD.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useFunWhnStatsigClient(): StatsigClient | null;
|
|
4
11
|
interface FunkitStatsigProviderProps {
|
|
5
12
|
children: ReactNode;
|
|
6
13
|
isDevelopment?: boolean;
|
package/dist/utils/customer.d.ts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import type { LighterAccountIndex } from '@funkit/api-base';
|
|
2
2
|
import type { DynamicTargetAssetCandidate } from '@funkit/connect-core';
|
|
3
3
|
import type { Address } from 'viem';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* and perps USDC balances), `1` = Unified Trading account (one USDC balance —
|
|
7
|
-
* no spot/perps split). Unified accounts hide the spot USDC option and label
|
|
8
|
-
* perps USDC as plain `USDC` in both deposit and withdrawal flows.
|
|
9
|
-
*/
|
|
10
|
-
export declare const LIGHTER_TRADING_MODE: {
|
|
11
|
-
readonly SIMPLE: 0;
|
|
12
|
-
readonly UNIFIED: 1;
|
|
13
|
-
};
|
|
4
|
+
export { LIGHTER_TRADING_MODE, getLighterAccountsByL1Address, useLighterAccountsQuery, } from '@funkit/connect-core';
|
|
5
|
+
export type { LighterAccountsByL1AddressResponse, LighterSubAccount, } from '@funkit/connect-core';
|
|
14
6
|
/**
|
|
15
7
|
* Strips the ` (Perps)` variant suffix off a Lighter ticker (e.g.
|
|
16
8
|
* `USDC (Perps)` → `USDC`). Non-perps tickers pass through unchanged.
|
|
@@ -24,27 +16,6 @@ export declare function stripLighterPerpsSuffix(symbol: string | undefined): str
|
|
|
24
16
|
* routes (`LIGHTER_USDC_PERPS*`), only the presentation differs.
|
|
25
17
|
*/
|
|
26
18
|
export declare function adaptLighterTargetAssetsForUnifiedAccount(candidates: DynamicTargetAssetCandidate[]): DynamicTargetAssetCandidate[];
|
|
27
|
-
export type LighterSubAccount = {
|
|
28
|
-
code: number;
|
|
29
|
-
account_type: number;
|
|
30
|
-
index: number;
|
|
31
|
-
l1_address: Address;
|
|
32
|
-
cancel_all_time: number;
|
|
33
|
-
total_order_count: number;
|
|
34
|
-
total_isolated_order_count: number;
|
|
35
|
-
pending_order_count: number;
|
|
36
|
-
available_balance: string;
|
|
37
|
-
status: number;
|
|
38
|
-
collateral: string;
|
|
39
|
-
transaction_time: number;
|
|
40
|
-
account_trading_mode: number;
|
|
41
|
-
};
|
|
42
|
-
export type LighterAccountsByL1AddressResponse = {
|
|
43
|
-
code: number;
|
|
44
|
-
l1_address: Address;
|
|
45
|
-
sub_accounts: LighterSubAccount[];
|
|
46
|
-
};
|
|
47
|
-
export declare function getLighterAccountsByL1Address(address: Address): Promise<LighterAccountsByL1AddressResponse>;
|
|
48
19
|
export type LighterAsset = {
|
|
49
20
|
symbol: string;
|
|
50
21
|
asset_id: number;
|
|
@@ -460,186 +431,8 @@ export declare function useLighterAccounts({ address, }: {
|
|
|
460
431
|
}): {
|
|
461
432
|
mainAccountIndex: string | undefined;
|
|
462
433
|
isUnifiedTradingMode: boolean;
|
|
463
|
-
subAccounts: LighterSubAccount[] | undefined;
|
|
464
|
-
data: LighterAccountsByL1AddressResponse;
|
|
465
|
-
error: Error;
|
|
466
|
-
isError: true;
|
|
467
|
-
isPending: false;
|
|
468
|
-
isLoading: false;
|
|
469
|
-
isLoadingError: false;
|
|
470
|
-
isRefetchError: true;
|
|
471
|
-
isSuccess: false;
|
|
472
|
-
isPlaceholderData: false;
|
|
473
|
-
status: "error";
|
|
474
|
-
dataUpdatedAt: number;
|
|
475
|
-
errorUpdatedAt: number;
|
|
476
|
-
failureCount: number;
|
|
477
|
-
failureReason: Error | null;
|
|
478
|
-
errorUpdateCount: number;
|
|
479
|
-
isFetched: boolean;
|
|
480
|
-
isFetchedAfterMount: boolean;
|
|
481
|
-
isFetching: boolean;
|
|
482
|
-
isInitialLoading: boolean;
|
|
483
|
-
isPaused: boolean;
|
|
484
|
-
isRefetching: boolean;
|
|
485
|
-
isStale: boolean;
|
|
486
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
|
|
487
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
488
|
-
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
489
|
-
} | {
|
|
490
|
-
mainAccountIndex: string | undefined;
|
|
491
|
-
isUnifiedTradingMode: boolean;
|
|
492
|
-
subAccounts: LighterSubAccount[] | undefined;
|
|
493
|
-
data: LighterAccountsByL1AddressResponse;
|
|
494
|
-
error: null;
|
|
495
|
-
isError: false;
|
|
496
|
-
isPending: false;
|
|
497
|
-
isLoading: false;
|
|
498
|
-
isLoadingError: false;
|
|
499
|
-
isRefetchError: false;
|
|
500
|
-
isSuccess: true;
|
|
501
|
-
isPlaceholderData: false;
|
|
502
|
-
status: "success";
|
|
503
|
-
dataUpdatedAt: number;
|
|
504
|
-
errorUpdatedAt: number;
|
|
505
|
-
failureCount: number;
|
|
506
|
-
failureReason: Error | null;
|
|
507
|
-
errorUpdateCount: number;
|
|
508
|
-
isFetched: boolean;
|
|
509
|
-
isFetchedAfterMount: boolean;
|
|
510
|
-
isFetching: boolean;
|
|
511
|
-
isInitialLoading: boolean;
|
|
512
|
-
isPaused: boolean;
|
|
513
|
-
isRefetching: boolean;
|
|
514
|
-
isStale: boolean;
|
|
515
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
|
|
516
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
517
|
-
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
518
|
-
} | {
|
|
519
|
-
mainAccountIndex: string | undefined;
|
|
520
|
-
isUnifiedTradingMode: boolean;
|
|
521
|
-
subAccounts: LighterSubAccount[] | undefined;
|
|
522
|
-
data: undefined;
|
|
523
|
-
error: Error;
|
|
524
|
-
isError: true;
|
|
525
|
-
isPending: false;
|
|
526
|
-
isLoading: false;
|
|
527
|
-
isLoadingError: true;
|
|
528
|
-
isRefetchError: false;
|
|
529
|
-
isSuccess: false;
|
|
530
|
-
isPlaceholderData: false;
|
|
531
|
-
status: "error";
|
|
532
|
-
dataUpdatedAt: number;
|
|
533
|
-
errorUpdatedAt: number;
|
|
534
|
-
failureCount: number;
|
|
535
|
-
failureReason: Error | null;
|
|
536
|
-
errorUpdateCount: number;
|
|
537
|
-
isFetched: boolean;
|
|
538
|
-
isFetchedAfterMount: boolean;
|
|
539
|
-
isFetching: boolean;
|
|
540
|
-
isInitialLoading: boolean;
|
|
541
|
-
isPaused: boolean;
|
|
542
|
-
isRefetching: boolean;
|
|
543
|
-
isStale: boolean;
|
|
544
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
|
|
545
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
546
|
-
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
547
|
-
} | {
|
|
548
|
-
mainAccountIndex: string | undefined;
|
|
549
|
-
isUnifiedTradingMode: boolean;
|
|
550
|
-
subAccounts: LighterSubAccount[] | undefined;
|
|
551
|
-
data: undefined;
|
|
552
|
-
error: null;
|
|
553
|
-
isError: false;
|
|
554
|
-
isPending: true;
|
|
555
|
-
isLoading: true;
|
|
556
|
-
isLoadingError: false;
|
|
557
|
-
isRefetchError: false;
|
|
558
|
-
isSuccess: false;
|
|
559
|
-
isPlaceholderData: false;
|
|
560
|
-
status: "pending";
|
|
561
|
-
dataUpdatedAt: number;
|
|
562
|
-
errorUpdatedAt: number;
|
|
563
|
-
failureCount: number;
|
|
564
|
-
failureReason: Error | null;
|
|
565
|
-
errorUpdateCount: number;
|
|
566
|
-
isFetched: boolean;
|
|
567
|
-
isFetchedAfterMount: boolean;
|
|
568
|
-
isFetching: boolean;
|
|
569
|
-
isInitialLoading: boolean;
|
|
570
|
-
isPaused: boolean;
|
|
571
|
-
isRefetching: boolean;
|
|
572
|
-
isStale: boolean;
|
|
573
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
|
|
574
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
575
|
-
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
576
|
-
} | {
|
|
577
|
-
mainAccountIndex: string | undefined;
|
|
578
|
-
isUnifiedTradingMode: boolean;
|
|
579
|
-
subAccounts: LighterSubAccount[] | undefined;
|
|
580
|
-
data: undefined;
|
|
581
|
-
error: null;
|
|
582
|
-
isError: false;
|
|
583
|
-
isPending: true;
|
|
584
|
-
isLoadingError: false;
|
|
585
|
-
isRefetchError: false;
|
|
586
|
-
isSuccess: false;
|
|
587
|
-
isPlaceholderData: false;
|
|
588
|
-
status: "pending";
|
|
589
|
-
dataUpdatedAt: number;
|
|
590
|
-
errorUpdatedAt: number;
|
|
591
|
-
failureCount: number;
|
|
592
|
-
failureReason: Error | null;
|
|
593
|
-
errorUpdateCount: number;
|
|
594
|
-
isFetched: boolean;
|
|
595
|
-
isFetchedAfterMount: boolean;
|
|
596
|
-
isFetching: boolean;
|
|
597
|
-
isLoading: boolean;
|
|
598
|
-
isInitialLoading: boolean;
|
|
599
|
-
isPaused: boolean;
|
|
600
|
-
isRefetching: boolean;
|
|
601
|
-
isStale: boolean;
|
|
602
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
|
|
603
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
604
|
-
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
605
|
-
} | {
|
|
606
|
-
mainAccountIndex: string | undefined;
|
|
607
|
-
isUnifiedTradingMode: boolean;
|
|
608
|
-
subAccounts: LighterSubAccount[] | undefined;
|
|
609
|
-
data: LighterAccountsByL1AddressResponse;
|
|
610
|
-
isError: false;
|
|
611
|
-
error: null;
|
|
612
|
-
isPending: false;
|
|
613
|
-
isLoading: false;
|
|
614
|
-
isLoadingError: false;
|
|
615
|
-
isRefetchError: false;
|
|
616
|
-
isSuccess: true;
|
|
617
|
-
isPlaceholderData: true;
|
|
618
|
-
status: "success";
|
|
619
|
-
dataUpdatedAt: number;
|
|
620
|
-
errorUpdatedAt: number;
|
|
621
|
-
failureCount: number;
|
|
622
|
-
failureReason: Error | null;
|
|
623
|
-
errorUpdateCount: number;
|
|
624
|
-
isFetched: boolean;
|
|
625
|
-
isFetchedAfterMount: boolean;
|
|
626
|
-
isFetching: boolean;
|
|
627
|
-
isInitialLoading: boolean;
|
|
628
|
-
isPaused: boolean;
|
|
629
|
-
isRefetching: boolean;
|
|
630
|
-
isStale: boolean;
|
|
631
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
|
|
632
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
633
|
-
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
634
|
-
};
|
|
635
|
-
/** Ungated {@link useLighterAccounts}. See {@link useLighterAccountQuery}. */
|
|
636
|
-
export declare function useLighterAccountsQuery({ address, }: {
|
|
637
|
-
address: Address | '' | undefined;
|
|
638
|
-
}): {
|
|
639
|
-
mainAccountIndex: string | undefined;
|
|
640
|
-
isUnifiedTradingMode: boolean;
|
|
641
|
-
subAccounts: LighterSubAccount[] | undefined;
|
|
642
|
-
data: LighterAccountsByL1AddressResponse;
|
|
434
|
+
subAccounts: import("@funkit/connect-core").LighterSubAccount[] | undefined;
|
|
435
|
+
data: import("@funkit/connect-core").LighterAccountsByL1AddressResponse;
|
|
643
436
|
error: Error;
|
|
644
437
|
isError: true;
|
|
645
438
|
isPending: false;
|
|
@@ -661,14 +454,14 @@ export declare function useLighterAccountsQuery({ address, }: {
|
|
|
661
454
|
isPaused: boolean;
|
|
662
455
|
isRefetching: boolean;
|
|
663
456
|
isStale: boolean;
|
|
664
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
|
|
457
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@funkit/connect-core").LighterAccountsByL1AddressResponse, Error>>;
|
|
665
458
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
666
|
-
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
459
|
+
promise: Promise<import("@funkit/connect-core").LighterAccountsByL1AddressResponse>;
|
|
667
460
|
} | {
|
|
668
461
|
mainAccountIndex: string | undefined;
|
|
669
462
|
isUnifiedTradingMode: boolean;
|
|
670
|
-
subAccounts: LighterSubAccount[] | undefined;
|
|
671
|
-
data: LighterAccountsByL1AddressResponse;
|
|
463
|
+
subAccounts: import("@funkit/connect-core").LighterSubAccount[] | undefined;
|
|
464
|
+
data: import("@funkit/connect-core").LighterAccountsByL1AddressResponse;
|
|
672
465
|
error: null;
|
|
673
466
|
isError: false;
|
|
674
467
|
isPending: false;
|
|
@@ -690,13 +483,13 @@ export declare function useLighterAccountsQuery({ address, }: {
|
|
|
690
483
|
isPaused: boolean;
|
|
691
484
|
isRefetching: boolean;
|
|
692
485
|
isStale: boolean;
|
|
693
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
|
|
486
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@funkit/connect-core").LighterAccountsByL1AddressResponse, Error>>;
|
|
694
487
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
695
|
-
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
488
|
+
promise: Promise<import("@funkit/connect-core").LighterAccountsByL1AddressResponse>;
|
|
696
489
|
} | {
|
|
697
490
|
mainAccountIndex: string | undefined;
|
|
698
491
|
isUnifiedTradingMode: boolean;
|
|
699
|
-
subAccounts: LighterSubAccount[] | undefined;
|
|
492
|
+
subAccounts: import("@funkit/connect-core").LighterSubAccount[] | undefined;
|
|
700
493
|
data: undefined;
|
|
701
494
|
error: Error;
|
|
702
495
|
isError: true;
|
|
@@ -719,13 +512,13 @@ export declare function useLighterAccountsQuery({ address, }: {
|
|
|
719
512
|
isPaused: boolean;
|
|
720
513
|
isRefetching: boolean;
|
|
721
514
|
isStale: boolean;
|
|
722
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
|
|
515
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@funkit/connect-core").LighterAccountsByL1AddressResponse, Error>>;
|
|
723
516
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
724
|
-
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
517
|
+
promise: Promise<import("@funkit/connect-core").LighterAccountsByL1AddressResponse>;
|
|
725
518
|
} | {
|
|
726
519
|
mainAccountIndex: string | undefined;
|
|
727
520
|
isUnifiedTradingMode: boolean;
|
|
728
|
-
subAccounts: LighterSubAccount[] | undefined;
|
|
521
|
+
subAccounts: import("@funkit/connect-core").LighterSubAccount[] | undefined;
|
|
729
522
|
data: undefined;
|
|
730
523
|
error: null;
|
|
731
524
|
isError: false;
|
|
@@ -748,13 +541,13 @@ export declare function useLighterAccountsQuery({ address, }: {
|
|
|
748
541
|
isPaused: boolean;
|
|
749
542
|
isRefetching: boolean;
|
|
750
543
|
isStale: boolean;
|
|
751
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
|
|
544
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@funkit/connect-core").LighterAccountsByL1AddressResponse, Error>>;
|
|
752
545
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
753
|
-
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
546
|
+
promise: Promise<import("@funkit/connect-core").LighterAccountsByL1AddressResponse>;
|
|
754
547
|
} | {
|
|
755
548
|
mainAccountIndex: string | undefined;
|
|
756
549
|
isUnifiedTradingMode: boolean;
|
|
757
|
-
subAccounts: LighterSubAccount[] | undefined;
|
|
550
|
+
subAccounts: import("@funkit/connect-core").LighterSubAccount[] | undefined;
|
|
758
551
|
data: undefined;
|
|
759
552
|
error: null;
|
|
760
553
|
isError: false;
|
|
@@ -777,14 +570,14 @@ export declare function useLighterAccountsQuery({ address, }: {
|
|
|
777
570
|
isPaused: boolean;
|
|
778
571
|
isRefetching: boolean;
|
|
779
572
|
isStale: boolean;
|
|
780
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
|
|
573
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@funkit/connect-core").LighterAccountsByL1AddressResponse, Error>>;
|
|
781
574
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
782
|
-
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
575
|
+
promise: Promise<import("@funkit/connect-core").LighterAccountsByL1AddressResponse>;
|
|
783
576
|
} | {
|
|
784
577
|
mainAccountIndex: string | undefined;
|
|
785
578
|
isUnifiedTradingMode: boolean;
|
|
786
|
-
subAccounts: LighterSubAccount[] | undefined;
|
|
787
|
-
data: LighterAccountsByL1AddressResponse;
|
|
579
|
+
subAccounts: import("@funkit/connect-core").LighterSubAccount[] | undefined;
|
|
580
|
+
data: import("@funkit/connect-core").LighterAccountsByL1AddressResponse;
|
|
788
581
|
isError: false;
|
|
789
582
|
error: null;
|
|
790
583
|
isPending: false;
|
|
@@ -806,9 +599,9 @@ export declare function useLighterAccountsQuery({ address, }: {
|
|
|
806
599
|
isPaused: boolean;
|
|
807
600
|
isRefetching: boolean;
|
|
808
601
|
isStale: boolean;
|
|
809
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountsByL1AddressResponse, Error>>;
|
|
602
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@funkit/connect-core").LighterAccountsByL1AddressResponse, Error>>;
|
|
810
603
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
811
|
-
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
604
|
+
promise: Promise<import("@funkit/connect-core").LighterAccountsByL1AddressResponse>;
|
|
812
605
|
};
|
|
813
606
|
/**
|
|
814
607
|
* Returns a callback that invalidates the cached Lighter account queries so the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CustomWithdrawalConfig, FunkitWithdrawalConfig, MultiMethodWithdrawalConfig, WalletWithdrawalConfig, WithdrawalSourceTokenBalanceParams } from '../providers/FunkitCheckoutContext';
|
|
1
|
+
import type { CustomWithdrawalConfig, FunkitWithdrawalConfig, MultiMethodWithdrawalConfig, SourceTokenOption, WalletWithdrawalConfig, WithdrawalSourceTokenBalanceParams } from '../providers/FunkitCheckoutContext';
|
|
2
2
|
/**
|
|
3
3
|
* Deducts a flat fee (in token units) from a withdrawal input amount, clamped
|
|
4
4
|
* at 0. Uses `dnum` fixed-point math so decimal strings straight off the amount
|
|
@@ -35,6 +35,16 @@ export declare function isNoOpSelfWithdrawal({ config, recipientAddress, selecte
|
|
|
35
35
|
selectedChainId: number | undefined;
|
|
36
36
|
destinationTokenAddress: string | undefined;
|
|
37
37
|
}): boolean;
|
|
38
|
+
/** A source-token option that can only move as-is — its receive target is the
|
|
39
|
+
* option's own asset. */
|
|
40
|
+
export type DirectTransferOnlyOption = SourceTokenOption & {
|
|
41
|
+
asset: NonNullable<SourceTokenOption['asset']>;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* True when the selected source option supports direct transfer only: xStocks
|
|
45
|
+
* have no Relay liquidity, so the only viable route is a same-token same-chain sweep.
|
|
46
|
+
*/
|
|
47
|
+
export declare function isDirectTransferOnlyOption(sourceTokenOption: SourceTokenOption | undefined): sourceTokenOption is DirectTransferOnlyOption;
|
|
38
48
|
/**
|
|
39
49
|
* Type guard to check if withdrawal config uses custom callback flow
|
|
40
50
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bifrostWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-N4IJLYFY.js";
|
|
4
|
+
} from "../chunk-4T6ZSRJF.js";
|
|
6
5
|
import "../chunk-OLZ7626J.js";
|
|
6
|
+
import "../chunk-N4IJLYFY.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
bifrostWallet
|