@funkit/connect 9.5.0 → 9.6.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 +44 -0
- package/dist/__generated__/default_configs.d.ts +145 -6
- package/dist/__generated__/default_feature_gates.d.ts +2 -0
- package/dist/clients/{chunk-SBQ2UUPK.js → chunk-H6F75ULR.js} +7 -1
- package/dist/clients/fanatics.js +1 -1
- package/dist/clients/polymarket.js +1 -1
- package/dist/components/CopyAddress/CopyInputDisplayedAddress.d.ts +1 -0
- package/dist/components/Dialog/Dialog.d.ts +13 -7
- package/dist/components/Dialog/DialogContent.css.d.ts +7 -2
- package/dist/components/Dropdown/ChainDropdown.d.ts +1 -3
- package/dist/components/Dropdown/TokenAndChainDropdown.d.ts +1 -3
- package/dist/components/FunFeatureList/FunFeatureList.d.ts +2 -1
- package/dist/components/FunNotificationBanner/FunNotificationBanner.d.ts +2 -1
- package/dist/components/FunTransactionSummary/PaymentAmountSummary.d.ts +4 -1
- package/dist/components/Icons/GlobeIcon.d.ts +4 -0
- package/dist/components/PaddedScrollableArea/PaddedScrollableArea.d.ts +28 -0
- package/dist/components/PaddedScrollableArea/paddedScrollableArea.css.d.ts +4 -0
- package/dist/components/TransferTokenDetails/TransferTokenDetails.d.ts +2 -1
- package/dist/domains/asset.d.ts +0 -1
- package/dist/domains/quote.d.ts +6 -4
- package/dist/domains/quoteMode/index.d.ts +2 -2
- package/dist/domains/quoteMode/resolveQuoteMode.d.ts +8 -7
- package/dist/domains/quoteMode/types.d.ts +13 -5
- package/dist/domains/swapped.d.ts +7 -1
- package/dist/domains/wallet.d.ts +6 -0
- package/dist/hooks/queries/useWithdrawFops.d.ts +7 -4
- package/dist/hooks/track/CheckoutModalEvent.d.ts +14 -1
- package/dist/hooks/useAssetPrice.d.ts +3 -1
- package/dist/hooks/useNewTokenBanner.d.ts +2 -0
- package/dist/hooks/useTokenAndChainDropdown.d.ts +0 -1
- package/dist/hooks/useTokenTransfer.d.ts +7 -11
- package/dist/hooks/useTokenTransferConfig.d.ts +1 -1
- package/dist/index.css +67 -81
- package/dist/index.js +5477 -3841
- package/dist/modals/CheckoutModal/ConfirmationStep/CheckoutPrimaryInfo.d.ts +6 -1
- package/dist/modals/CheckoutModal/ConfirmationStep/mapRetryAction.d.ts +18 -0
- package/dist/modals/CheckoutModal/ConfirmationStep/useCheckoutQuote.d.ts +3 -2
- package/dist/modals/CheckoutModal/InputAmount/InputAmount.d.ts +4 -0
- package/dist/modals/CheckoutModal/InputAmount/InputAmountLoaded.d.ts +3 -1
- package/dist/modals/CheckoutModal/InputAmount/state.d.ts +32 -1
- package/dist/modals/CheckoutModal/InputAmount/useAmountInput.d.ts +3 -0
- package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +19 -0
- package/dist/modals/CheckoutModal/SourceChange/EmptyFormOfPaymentsMessage.d.ts +4 -0
- package/dist/modals/CheckoutModal/SourceChange/FormOfPaymentsList.d.ts +2 -1
- package/dist/modals/CheckoutModal/SourceChange/sourceChange.css.d.ts +0 -3
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframeContainer.d.ts +1 -1
- package/dist/modals/CheckoutModal/TransferToken/CheckoutNotifications.track.d.ts +2 -0
- package/dist/modals/CheckoutModal/TransferToken/useTransferTokenTracking.d.ts +29 -0
- package/dist/modals/CheckoutModal/stepTransition.d.ts +3 -3
- package/dist/modals/WithdrawalModal/WithdrawalMethodSelect.d.ts +3 -1
- package/dist/providers/FunkitCheckoutContext/index.d.ts +1 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +7 -0
- package/dist/providers/FunkitQuoteContext.d.ts +5 -4
- package/dist/providers/FunkitQuoteContext.track.d.ts +3 -2
- package/dist/providers/QuoteModeContext.d.ts +6 -0
- package/dist/providers/SwappedProvider.d.ts +2 -1
- package/dist/utils/address.d.ts +3 -4
- package/dist/utils/bluvo.d.ts +2 -4
- package/dist/utils/checkout.d.ts +2 -1
- package/dist/utils/funLogger.d.ts +3 -1
- package/dist/utils/tokenTransfer/types.d.ts +7 -1
- package/dist/wagmi/hooks.d.ts +1 -1
- package/dist/wallets/walletConnectors/argentWallet/argentWallet.js +3 -3
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +4 -4
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +4 -4
- package/dist/wallets/walletConnectors/bitskiWallet/bitskiWallet.js +3 -3
- package/dist/wallets/walletConnectors/bitverseWallet/bitverseWallet.js +3 -3
- package/dist/wallets/walletConnectors/bloomWallet/bloomWallet.js +3 -3
- package/dist/wallets/walletConnectors/braveWallet/braveWallet.js +3 -3
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +4 -4
- package/dist/wallets/walletConnectors/{chunk-W6TXXLCO.js → chunk-2DKNXOPL.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-KV4HGYM3.js → chunk-3K2MFXCO.js} +1 -0
- package/dist/wallets/walletConnectors/{chunk-GVOQTORD.js → chunk-3ZJN3PXP.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-GH4M6FTK.js → chunk-55VS2NKG.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-XMNVOYSJ.js → chunk-57GN4W23.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-6UCI7GM6.js → chunk-7IEUTLHY.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-WFNPWKU3.js → chunk-7PVUEV4M.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-HE2LMIPD.js → chunk-A5EZBNME.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-4R4AARTG.js → chunk-AM5MSNVQ.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-GSHSWVEG.js → chunk-AZYMJ4C6.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-BVX22N7L.js → chunk-BBPTPMH7.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-YKVWTGU7.js → chunk-BHAPTB57.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-IUVO4IN3.js → chunk-BWLMNATA.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-HKVDCVCG.js → chunk-DP5ICBEB.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-HE5J5T7X.js → chunk-E3NZE4UP.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-RVWLP4IM.js → chunk-EUMOVTRQ.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-MAPXJUOO.js → chunk-FMVNQKZL.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-KO56HCTI.js → chunk-FWM4KTOV.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-INNF7G5X.js → chunk-G3RQSCYR.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-W6MXINYY.js → chunk-HPUEYLLS.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-HOPH3TQ3.js → chunk-IMNI4AGV.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-HETS3KKI.js → chunk-IRHK6SOW.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-CJJT7LMT.js → chunk-J3PJOMO7.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-4BMUFNMT.js → chunk-KS5MJNGD.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-O7RSASRH.js → chunk-KSNA53EX.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-7OARWILZ.js → chunk-LEAZMT5Y.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-WDTNOIMF.js → chunk-MTJIPVYB.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-G4V5B6YC.js → chunk-O4IDLNBH.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-J34FG3W4.js → chunk-O7ZCUI2Y.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-EKJHJFRN.js → chunk-OD6B2ISG.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-PKMAPNN6.js → chunk-OSOB6QYX.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-RZXMOPIV.js → chunk-OUM6H3WU.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-R4S234FL.js → chunk-P4E2ZFQB.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-TFVCCI2D.js → chunk-PARFRRNI.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-34LO6Q7A.js → chunk-R7X5RIO7.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-GROWFRGP.js → chunk-RZH4FSX7.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-6YO27XOM.js → chunk-RZQ4B4Z7.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-UB2SSFH7.js → chunk-S6R4B763.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-6MFOL6EB.js → chunk-T3VMQBBI.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-JYVLYSH3.js → chunk-TNVLCMJD.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-TTHM3WUR.js → chunk-UFYNHHDU.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-NHLG5PVD.js → chunk-UKSIXGWC.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-4C7ER452.js → chunk-UYW6MV74.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-WKCCLGHJ.js → chunk-V4EXM3KB.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-IICWJWGZ.js → chunk-VMMROPXK.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-VUOAIUZE.js → chunk-XTD6OMZP.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-ZRNBHLUU.js → chunk-XVH4JIXB.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-A7FNGC4A.js → chunk-Y36HPFB3.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-53VYSPXK.js → chunk-YGMU5VWD.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-BAVE62IL.js → chunk-YYYRPQHB.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-XBLHZICW.js → chunk-ZJJWGKB6.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-LI6QY2B5.js → chunk-ZL6XCMV5.js} +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +4 -4
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +4 -4
- package/dist/wallets/walletConnectors/coinbaseWallet/coinbaseWallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +4 -4
- package/dist/wallets/walletConnectors/dawnWallet/dawnWallet.js +3 -3
- package/dist/wallets/walletConnectors/desigWallet/desigWallet.js +3 -3
- package/dist/wallets/walletConnectors/enkryptWallet/enkryptWallet.js +3 -3
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +4 -4
- package/dist/wallets/walletConnectors/frameWallet/frameWallet.js +3 -3
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +4 -4
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +4 -4
- package/dist/wallets/walletConnectors/imTokenWallet/imTokenWallet.js +3 -3
- package/dist/wallets/walletConnectors/index.js +63 -63
- package/dist/wallets/walletConnectors/injectedWallet/injectedWallet.js +3 -3
- package/dist/wallets/walletConnectors/kresusWallet/kresusWallet.js +3 -3
- package/dist/wallets/walletConnectors/ledgerWallet/ledgerWallet.js +3 -3
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +4 -4
- package/dist/wallets/walletConnectors/mewWallet/mewWallet.js +3 -3
- package/dist/wallets/walletConnectors/oktoWallet/oktoWallet.js +3 -3
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +4 -4
- package/dist/wallets/walletConnectors/omniWallet/omniWallet.js +3 -3
- package/dist/wallets/walletConnectors/oneInchWallet/oneInchWallet.js +3 -3
- package/dist/wallets/walletConnectors/oneKeyWallet/oneKeyWallet.js +3 -3
- package/dist/wallets/walletConnectors/phantomWallet/phantomWallet.js +3 -3
- package/dist/wallets/walletConnectors/rabbyWallet/rabbyWallet.js +3 -3
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +4 -4
- package/dist/wallets/walletConnectors/ramperWallet/ramperWallet.js +3 -3
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +4 -4
- package/dist/wallets/walletConnectors/safeWallet/safeWallet.js +2 -2
- package/dist/wallets/walletConnectors/safeheronWallet/safeheronWallet.js +3 -3
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +4 -4
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +4 -4
- package/dist/wallets/walletConnectors/tahoWallet/tahoWallet.js +3 -3
- package/dist/wallets/walletConnectors/talismanWallet/talismanWallet.js +3 -3
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +4 -4
- package/dist/wallets/walletConnectors/tokenaryWallet/tokenaryWallet.js +3 -3
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +4 -4
- package/dist/wallets/walletConnectors/uniswapWallet/uniswapWallet.js +3 -3
- package/dist/wallets/walletConnectors/walletConnectWallet/walletConnectWallet.js +3 -3
- package/dist/wallets/walletConnectors/xdefiWallet/xdefiWallet.js +3 -3
- package/dist/wallets/walletConnectors/zealWallet/zealWallet.js +3 -3
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +4 -4
- package/package.json +3 -3
- package/dist/components/Dropdown/TokenAndChainDropdown.css.d.ts +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { QuoteDisplayAmounts } from '../../../domains/quoteMode';
|
|
2
3
|
import type { FunkitCheckoutConfig } from '../../../providers/FunkitCheckoutContext';
|
|
3
4
|
interface CheckoutPrimaryInfoProps {
|
|
4
5
|
showLeftAlignedDollarValueWithLabel: boolean;
|
|
@@ -6,6 +7,10 @@ interface CheckoutPrimaryInfoProps {
|
|
|
6
7
|
config: FunkitCheckoutConfig;
|
|
7
8
|
usdAmount?: number;
|
|
8
9
|
isLoading?: boolean;
|
|
10
|
+
/** Mode-aware display amounts from QuoteBuilder.getDisplayAmounts() */
|
|
11
|
+
displayAmounts?: QuoteDisplayAmounts | null;
|
|
12
|
+
/** In EXACT_IN mode, the fiat value the user entered on InputAmount (avoids skeleton flash) */
|
|
13
|
+
inputFiatAmount?: number | null;
|
|
9
14
|
}
|
|
10
|
-
export declare function CheckoutPrimaryInfo({ showLeftAlignedDollarValueWithLabel, showTokenAmount, usdAmount, config, isLoading, }: CheckoutPrimaryInfoProps): React.JSX.Element;
|
|
15
|
+
export declare function CheckoutPrimaryInfo({ showLeftAlignedDollarValueWithLabel, showTokenAmount, usdAmount, config, isLoading, displayAmounts, inputFiatAmount, }: CheckoutPrimaryInfoProps): React.JSX.Element;
|
|
11
16
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type QuoteBuilder, type QuoteRetryError } from '../../../domains/quoteMode/types';
|
|
2
|
+
export type MappedRetryAction = {
|
|
3
|
+
action: 'calibrate';
|
|
4
|
+
newTargetAssetAmount: number;
|
|
5
|
+
} | {
|
|
6
|
+
action: 'giveUp';
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Bridge between the domain-layer `handleRetry` and the React-layer retry loop.
|
|
10
|
+
*
|
|
11
|
+
* Calls `quoteBuilder.handleRetry()` and converts the result into a simple
|
|
12
|
+
* action the hook can act on:
|
|
13
|
+
* - `calibrate` → call `updateTargetAssetAmount(newTargetAssetAmount)` and re-quote
|
|
14
|
+
* - `giveUp` → stop retrying, surface the error
|
|
15
|
+
*/
|
|
16
|
+
export declare function mapRetryAction(quoteBuilder: QuoteBuilder, params: {
|
|
17
|
+
error: QuoteRetryError;
|
|
18
|
+
}): MappedRetryAction;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
+
import type { QuoteBuilder } from '../../../domains/quoteMode/types';
|
|
2
3
|
import type { CheckoutQuoteError } from '../../../providers/FunkitQuoteContext';
|
|
3
4
|
interface TriggerNewQuoteOptions {
|
|
4
5
|
maxRetries: number;
|
|
5
6
|
}
|
|
6
7
|
interface UseCheckoutQuoteOptions {
|
|
7
|
-
|
|
8
|
+
quoteBuilder: QuoteBuilder;
|
|
8
9
|
onFailure: (error: CheckoutQuoteError) => void;
|
|
9
10
|
onSuccess?: () => void;
|
|
10
11
|
}
|
|
@@ -14,5 +15,5 @@ interface UseCheckoutQuoteResult {
|
|
|
14
15
|
step: string | null;
|
|
15
16
|
triggerNewQuote: (options: TriggerNewQuoteOptions) => void;
|
|
16
17
|
}
|
|
17
|
-
export declare function useCheckoutQuote({
|
|
18
|
+
export declare function useCheckoutQuote({ quoteBuilder, onFailure, onSuccess, }: UseCheckoutQuoteOptions): UseCheckoutQuoteResult;
|
|
18
19
|
export {};
|
|
@@ -8,6 +8,10 @@ export type InputAmountState = CheckoutModalCommonState & {
|
|
|
8
8
|
fiatCurrency?: string;
|
|
9
9
|
quote?: MeldQuote;
|
|
10
10
|
isInputInFiat?: boolean;
|
|
11
|
+
/** Preserved token amount from a previous visit (source of truth in EXACT_IN) */
|
|
12
|
+
assetAmount?: number;
|
|
13
|
+
/** Source token identifier — used to detect asset changes and discard stale values */
|
|
14
|
+
sourceTokenKey?: string;
|
|
11
15
|
};
|
|
12
16
|
export type InputAmountNext = Record<string, never> | {
|
|
13
17
|
fiatAmount: number | undefined;
|
|
@@ -11,6 +11,8 @@ interface InputAmountLoadedProps extends ModalStepComponentProps<FunCheckoutStep
|
|
|
11
11
|
/** default fiat currency to be used*/
|
|
12
12
|
defaultFiatCurrency?: string;
|
|
13
13
|
textCustomizations: FunkitTextCustomizationsConfig['confirmationScreen'];
|
|
14
|
+
/** Live gas price in wei for native token gas buffer, null for ERC-20s */
|
|
15
|
+
gasPriceWei: bigint | null;
|
|
14
16
|
}
|
|
15
|
-
export declare function InputAmountLoaded({ checkoutConfig, modalState, onNext, onClose, setModalState, sourceHolding, unitPrice, defaultFiatCurrency, textCustomizations, }: InputAmountLoadedProps): React.JSX.Element;
|
|
17
|
+
export declare function InputAmountLoaded({ checkoutConfig, modalState, onNext, onClose, setModalState, sourceHolding, unitPrice, defaultFiatCurrency, textCustomizations, gasPriceWei, }: InputAmountLoadedProps): React.JSX.Element;
|
|
16
18
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { Dnum } from 'dnum';
|
|
1
2
|
import { type PaymentMethodInfo } from '../../../domains/paymentMethods';
|
|
3
|
+
import type { QuoteBuilder } from '../../../domains/quoteMode/types';
|
|
2
4
|
import type { AssetHoldingsItem } from '../../../utils/assets';
|
|
3
5
|
import type { FunkitCheckoutConfig } from '../../../providers/FunkitCheckoutContext';
|
|
4
6
|
export interface AmountInputInitOptions {
|
|
@@ -24,6 +26,14 @@ export interface AmountInputInitOptions {
|
|
|
24
26
|
apiKey: string;
|
|
25
27
|
/** Default value for isInputInFiat (preserved from modal state when navigating back) */
|
|
26
28
|
defaultIsInputInFiat?: boolean;
|
|
29
|
+
/** Preserved token amount (in human-readable form) from a previous visit */
|
|
30
|
+
defaultAssetAmount?: number;
|
|
31
|
+
/** Quote builder adapter (EXACT_IN / EXACT_OUT / ONE_TO_ONE) */
|
|
32
|
+
quoteBuilder: QuoteBuilder;
|
|
33
|
+
/** Whether the source token is the chain's native gas token */
|
|
34
|
+
isNativeToken: boolean;
|
|
35
|
+
/** Current gas price in wei (for native token gas buffer calculation) */
|
|
36
|
+
gasPriceWei: bigint | null;
|
|
27
37
|
}
|
|
28
38
|
export interface AmountInputState {
|
|
29
39
|
/** Current amount, in target asset. Undefined if input is empty */
|
|
@@ -50,6 +60,16 @@ export interface AmountInputState {
|
|
|
50
60
|
* https://linear.app/funxyz/issue/CUS-142/product-enable-customers-to-pass-in-an-exchange-rate-for-vault
|
|
51
61
|
**/
|
|
52
62
|
isVaultDeposit: boolean;
|
|
63
|
+
/** Frozen token→USD exchange rate, set on InputAmount screen mount */
|
|
64
|
+
frozenUnitPrice?: number;
|
|
65
|
+
/** Exact token balance as a Dnum (decimals embedded) */
|
|
66
|
+
tokenBalanceBaseUnit: Dnum | null;
|
|
67
|
+
/** Whether quote mode is EXACT_IN (token amount is source of truth) */
|
|
68
|
+
isExactIn: boolean;
|
|
69
|
+
/** Canonical token amount as a Dnum, set by setTokenAmount for lossless balance comparison */
|
|
70
|
+
tokenAmountBaseUnit: Dnum | null;
|
|
71
|
+
/** Maximum sendable token amount, accounting for gas buffer on native tokens */
|
|
72
|
+
maxSendableAmount: Dnum | null;
|
|
53
73
|
}
|
|
54
74
|
/** Derived state includes additional fields that are pure functions of base state */
|
|
55
75
|
export interface AmountInputDerivedState extends AmountInputState {
|
|
@@ -81,6 +101,17 @@ export type AmountInputAction = {
|
|
|
81
101
|
/** Changes formatting to new currency code */
|
|
82
102
|
type: 'setFiatCurrency';
|
|
83
103
|
fiatCurrency: string;
|
|
104
|
+
} | {
|
|
105
|
+
/** Sets the input value as an exact token amount (for EXACT_IN max button) */
|
|
106
|
+
type: 'setTokenAmount';
|
|
107
|
+
/** Exact token amount as a Dnum (decimals embedded) */
|
|
108
|
+
tokenAmountBaseUnit: Dnum;
|
|
109
|
+
frozenUnitPrice: number;
|
|
110
|
+
} | {
|
|
111
|
+
/** Sets the input value as a target asset amount (for EXACT_OUT token-mode quick options) */
|
|
112
|
+
type: 'setAssetAmount';
|
|
113
|
+
assetAmount: number;
|
|
114
|
+
unitPrice: number;
|
|
84
115
|
};
|
|
85
116
|
export type AmountInputError = {
|
|
86
117
|
/** Current amount is above available balance */
|
|
@@ -106,6 +137,6 @@ export type AmountInputError = {
|
|
|
106
137
|
* Return half the balance and round up to nearest 10, 100, 1000 etc
|
|
107
138
|
*/
|
|
108
139
|
export declare function calcInitialFiatAmount(balance: number): number;
|
|
109
|
-
export declare function initializeState({ checkoutConfig, defaultAmount, fiatCurrency, locale, maxUsd, minUsd, paymentMethodInfo, quickOptions, sourceHolding, unitPrice: realUnitPrice, meldEnabled, defaultIsInputInFiat, }: AmountInputInitOptions): AmountInputState;
|
|
140
|
+
export declare function initializeState({ checkoutConfig, defaultAmount, fiatCurrency, quoteBuilder, locale, maxUsd, minUsd, paymentMethodInfo, quickOptions, sourceHolding, unitPrice: realUnitPrice, meldEnabled, defaultAssetAmount, defaultIsInputInFiat, isNativeToken, gasPriceWei, }: AmountInputInitOptions): AmountInputState;
|
|
110
141
|
export declare function reduceState(state: AmountInputState, action: AmountInputAction): AmountInputState;
|
|
111
142
|
export declare function getDerivedState(state: AmountInputState, targetAssetTicker: string): AmountInputDerivedState;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Dnum } from 'dnum';
|
|
1
2
|
import { type RefObject } from 'react';
|
|
2
3
|
import type { FunInputChangeEvent } from '../../../components/FunInput/FunInput';
|
|
3
4
|
import { type AmountInputDerivedState, type AmountInputInitOptions } from './state';
|
|
@@ -8,7 +9,9 @@ export interface UseAmountInputResult extends AmountInputDerivedState {
|
|
|
8
9
|
inputWidth: number | undefined;
|
|
9
10
|
onChange(event: FunInputChangeEvent): void;
|
|
10
11
|
ref: RefObject<HTMLInputElement | null>;
|
|
12
|
+
setAssetAmount(assetAmount: number): AmountInputDerivedState;
|
|
11
13
|
setFiatAmount(usdAmount: number): AmountInputDerivedState;
|
|
14
|
+
setTokenAmount(tokenAmountBaseUnit: Dnum, frozenUnitPrice: number): AmountInputDerivedState;
|
|
12
15
|
/** Possible user action to recover from the current error */
|
|
13
16
|
suggestion: InputAmountSuggestion | undefined;
|
|
14
17
|
toggleInputInFiat: () => void;
|
|
@@ -43,6 +43,25 @@ export declare function formatCurrencyAmountWithLocale(value: number, options: {
|
|
|
43
43
|
fiatCurrency: string;
|
|
44
44
|
locale: Intl.LocalesArgument;
|
|
45
45
|
}): string;
|
|
46
|
+
/**
|
|
47
|
+
* Canonical fiat display formatter for the InputAmount UI.
|
|
48
|
+
*
|
|
49
|
+
* Combines our decimal rules with the utility library's suffix abbreviations:
|
|
50
|
+
* - Adds locale-aware currency symbol prefix (e.g. `$` for USD, `Kč ` for CZK)
|
|
51
|
+
* - Min 2, max ASSET_DECIMALS decimal places — trailing zeros trimmed beyond minimum
|
|
52
|
+
* - Thousands separators (e.g. `$1,234.00`)
|
|
53
|
+
* - M / B / T suffix abbreviation for amounts ≥ 1,000,000 (e.g. `$1.23M`)
|
|
54
|
+
*
|
|
55
|
+
* State-stored fiatAmounts are already floor-rounded to ASSET_DECIMALS precision,
|
|
56
|
+
* so this function does not apply additional rounding.
|
|
57
|
+
*
|
|
58
|
+
* Note: the suffix path (≥ 1M) always uses USD `$` — acceptable since only USD
|
|
59
|
+
* is currently supported in this flow.
|
|
60
|
+
*/
|
|
61
|
+
export declare function formatFiatAmountAndStringify(value: number, options: {
|
|
62
|
+
fiatCurrency: string;
|
|
63
|
+
locale: Intl.LocalesArgument;
|
|
64
|
+
}): string;
|
|
46
65
|
export declare function replaceStringRange(original: string, replacement: string, start: number, end: number): string;
|
|
47
66
|
export declare function reformatDecimalPart(decimalPart: string, decimals: number): string;
|
|
48
67
|
export declare function reformatIntegerPart(integerPart: string, locale: Intl.LocalesArgument, preserveLeadingZeroes: boolean): string;
|
|
@@ -6,6 +6,7 @@ interface FormOfPaymentsListProps {
|
|
|
6
6
|
selectedFop?: SwappedFormOfPayment | null;
|
|
7
7
|
onFopSelect: (fop: SwappedFormOfPayment) => void;
|
|
8
8
|
exchangeRatesData?: ExchangeRates;
|
|
9
|
+
enableSourceGroupLabels: boolean;
|
|
9
10
|
}
|
|
10
11
|
interface FormOfPaymentSection {
|
|
11
12
|
items: SwappedFormOfPayment[];
|
|
@@ -15,5 +16,5 @@ export declare function getFormOfPaymentSections(fopsData: GetFopsResponse, fopP
|
|
|
15
16
|
primary: FormOfPaymentSection;
|
|
16
17
|
secondary: FormOfPaymentSection;
|
|
17
18
|
};
|
|
18
|
-
export declare function FormOfPaymentsList({ fopsData, isLoading, selectedFop, onFopSelect, exchangeRatesData, }: FormOfPaymentsListProps): React.JSX.Element;
|
|
19
|
+
export declare function FormOfPaymentsList({ fopsData, isLoading, selectedFop, onFopSelect, exchangeRatesData, enableSourceGroupLabels, }: FormOfPaymentsListProps): React.JSX.Element;
|
|
19
20
|
export {};
|
|
@@ -4,8 +4,5 @@ export declare const sourceListBoxStyles: string;
|
|
|
4
4
|
export declare const sourceListGroupContainerStyles: string;
|
|
5
5
|
export declare const sourceListGroupContainerNoLabelsStyles: string;
|
|
6
6
|
export declare const sourceListCompactBoxStyles: string;
|
|
7
|
-
export declare const removeBottomPaddingFromSurroundingDialog: string;
|
|
8
7
|
export declare const paymentMethodStaticArea: string;
|
|
9
|
-
export declare const paymentMethodScrollArea: string;
|
|
10
|
-
export declare const paymentMethodScrollbarHidden: string;
|
|
11
8
|
export declare const fullWidthContentDivider: string;
|
|
@@ -14,4 +14,4 @@ export type SwappedIframeNext = {
|
|
|
14
14
|
success?: boolean;
|
|
15
15
|
};
|
|
16
16
|
export declare const SwappedIframeInfo: ModalStepInfo<FunCheckoutStep.SWAPPED_IFRAME>;
|
|
17
|
-
export declare function SwappedIframeContainer({ modalState,
|
|
17
|
+
export declare function SwappedIframeContainer({ modalState, onBack, onClose, setModalState, }: ModalStepComponentProps<FunCheckoutStep.SWAPPED_IFRAME>): React.JSX.Element;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { TrackEventData } from '../../../hooks/track/useTrack';
|
|
2
2
|
import type { NotificationItem } from './types';
|
|
3
|
+
export declare function getNotificationId(item: NotificationItem): string;
|
|
4
|
+
export declare function buildNotificationMetadata(item: NotificationItem, extras: Record<string, unknown>): Record<string, unknown>;
|
|
3
5
|
export declare const trackEventFromNotification: (item: NotificationItem) => TrackEventData;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { NotificationStatus } from './CheckoutNotification';
|
|
2
|
+
import type { NotificationItem } from './types';
|
|
3
|
+
export declare const addressDisplayedAtMsByCheckoutKey: {
|
|
4
|
+
[key in string]?: number;
|
|
5
|
+
};
|
|
6
|
+
interface UseTransferTokenTrackingProps {
|
|
7
|
+
depositAddress: string | undefined;
|
|
8
|
+
fromChainId: string;
|
|
9
|
+
fromTokenSymbol: string;
|
|
10
|
+
toChainId: string | undefined;
|
|
11
|
+
toTokenAddress: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
type UseTransferTokenTrackingResult = {
|
|
14
|
+
trackAddressCopied: () => void;
|
|
15
|
+
trackImpactExpanded: (estPriceImpactPct: number | undefined) => void;
|
|
16
|
+
trackSourceChainChange: (newChainId: string) => void;
|
|
17
|
+
trackSourceTokenChange: (newTokenSymbol: string) => void;
|
|
18
|
+
};
|
|
19
|
+
export declare function useTransferTokenTracking({ depositAddress, fromChainId, fromTokenSymbol, toChainId, toTokenAddress, }: UseTransferTokenTrackingProps): UseTransferTokenTrackingResult;
|
|
20
|
+
interface UseNotificationTrackingProps {
|
|
21
|
+
item: NotificationItem | null;
|
|
22
|
+
status: NotificationStatus;
|
|
23
|
+
}
|
|
24
|
+
interface UseNotificationTrackingResult {
|
|
25
|
+
trackDismissal: () => void;
|
|
26
|
+
trackShowMore: () => void;
|
|
27
|
+
}
|
|
28
|
+
export declare function useNotificationTracking({ item, status, }: UseNotificationTrackingProps): UseNotificationTrackingResult;
|
|
29
|
+
export {};
|
|
@@ -55,12 +55,12 @@ interface ModalStepInput<S extends FunCheckoutStep> {
|
|
|
55
55
|
export type ModalStepInfo<S extends FunCheckoutStep> = {
|
|
56
56
|
Component: ComponentType<ModalStepComponentProps<S>>;
|
|
57
57
|
disableBack?: (info: ModalStepInput<S>) => boolean;
|
|
58
|
+
/** Hides the bottom section (portal target for bottom bar content) */
|
|
59
|
+
hideBottomSection?: (state: CheckoutModalState<S>) => boolean;
|
|
58
60
|
/** Hides the close button in the Dialog Title element */
|
|
59
61
|
hideClose?: (startingStep?: FunCheckoutStartingStep) => boolean;
|
|
60
62
|
/** Hides the entire topbar including back button, close button, and title */
|
|
61
63
|
hideTopbar?: (state: CheckoutModalState<S>) => boolean;
|
|
62
|
-
/** Hides the bottom section (portal target for bottom bar content) */
|
|
63
|
-
hideBottomSection?: (state: CheckoutModalState<S>) => boolean;
|
|
64
64
|
onBack?(state: CheckoutModalState<S>, prevState: CheckoutModalState): CheckoutModalState;
|
|
65
65
|
onNext(state: CheckoutModalState<S>, payload: NextPayload<S>): CheckoutModalState;
|
|
66
66
|
showFullHeight?: boolean;
|
|
@@ -150,9 +150,9 @@ export declare function useCheckoutModalTransition(checkoutItem: FunkitActiveChe
|
|
|
150
150
|
};
|
|
151
151
|
export declare function useTitleConfig<S extends FunCheckoutStep>(checkoutItem: FunkitActiveCheckoutItem, state: CheckoutModalState<S>): {
|
|
152
152
|
disableBack: boolean;
|
|
153
|
+
hideBottomSection: boolean;
|
|
153
154
|
hideClose: boolean;
|
|
154
155
|
hideTopbar: boolean;
|
|
155
|
-
hideBottomSection: boolean;
|
|
156
156
|
showFullHeight: boolean;
|
|
157
157
|
title: string;
|
|
158
158
|
};
|
|
@@ -3,6 +3,8 @@ import React from 'react';
|
|
|
3
3
|
interface WithdrawalMethodSelectProps {
|
|
4
4
|
onCryptoSelect: () => void;
|
|
5
5
|
onCashFopSelect: (fop: SwappedFormOfPayment) => void;
|
|
6
|
+
sourceChainId: string;
|
|
7
|
+
sourceTokenAddress: string;
|
|
6
8
|
}
|
|
7
|
-
export declare function WithdrawalMethodSelect({ onCryptoSelect, onCashFopSelect, }: WithdrawalMethodSelectProps): React.JSX.Element;
|
|
9
|
+
export declare function WithdrawalMethodSelect({ onCryptoSelect, onCashFopSelect, sourceChainId, sourceTokenAddress, }: WithdrawalMethodSelectProps): React.JSX.Element;
|
|
8
10
|
export {};
|
|
@@ -14,7 +14,7 @@ interface FunkitCheckoutContextInterface {
|
|
|
14
14
|
initNewCheckout(initSettings: UseFunkitCheckoutPropsWithFullConfig): string;
|
|
15
15
|
updateModalTitleMeta(newMeta: string): void;
|
|
16
16
|
updateSourceAsset(selectedSource: Omit<AssetHoldingsItem, 'amount' | 'usdAmount' | 'chainSymbolKey'>): void;
|
|
17
|
-
updateTargetAssetAmount(newTargetAssetAmount: number): void;
|
|
17
|
+
updateTargetAssetAmount(newTargetAssetAmount: number, fiatAmount?: number, tokenAmountBaseUnits?: bigint): void;
|
|
18
18
|
updateTargetAsset(asset: {
|
|
19
19
|
targetAsset: Address;
|
|
20
20
|
targetChain: string;
|
|
@@ -204,6 +204,13 @@ export interface FunkitActiveCheckoutItem extends Omit<ApiCheckoutClientMetadata
|
|
|
204
204
|
/** Time of completion of the active checkout item. For frontend use only. **/
|
|
205
205
|
completedTimestampMs: number | null;
|
|
206
206
|
sourceAssetAmount: string | null;
|
|
207
|
+
/** In EXACT_IN mode, the fiat value the user entered on InputAmount.
|
|
208
|
+
* Stored alongside targetAssetAmount so the confirmation screen can display
|
|
209
|
+
* the same dollar value without recomputing from the token amount. */
|
|
210
|
+
inputFiatAmount: number | null;
|
|
211
|
+
/** Canonical token amount in base units (e.g. 328257705848429095n).
|
|
212
|
+
* Avoids precision loss from bigint→number round-trips for EXACT_IN quotes. */
|
|
213
|
+
inputTokenAmountBaseUnits: bigint | null;
|
|
207
214
|
}
|
|
208
215
|
export interface FunkitActiveWithdrawalItem {
|
|
209
216
|
/** Unique identifier for frontend use only. */
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type { Dnum } from 'dnum';
|
|
1
2
|
import React, { type Dispatch, type ReactNode } from 'react';
|
|
2
3
|
import type { FunkitCheckoutQuoteResult } from '../domains/quote';
|
|
3
4
|
import { type FunkitActiveCheckoutItem } from './FunkitCheckoutContext';
|
|
4
5
|
export type CheckoutQuoteError = {
|
|
5
|
-
maxTargetAssetAmount?:
|
|
6
|
-
minTargetAssetAmount?:
|
|
6
|
+
maxTargetAssetAmount?: Dnum;
|
|
7
|
+
minTargetAssetAmount?: Dnum;
|
|
7
8
|
reason: 'insufficientBalance';
|
|
8
9
|
} | {
|
|
9
|
-
maxTargetAssetAmount?:
|
|
10
|
-
minTargetAssetAmount?:
|
|
10
|
+
maxTargetAssetAmount?: Dnum;
|
|
11
|
+
minTargetAssetAmount?: Dnum;
|
|
11
12
|
minTargetUsdAmount?: number;
|
|
12
13
|
reason: 'insufficientAmount';
|
|
13
14
|
} | {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { QuoteMode } from '../domains/quoteMode';
|
|
1
2
|
import type { CheckoutModalEvent } from '../hooks/track/CheckoutModalEvent';
|
|
2
3
|
import type { WithdrawModalEvent } from '../hooks/track/WithdrawModalEvent';
|
|
3
4
|
import type { TrackEventData } from '../hooks/track/useTrack';
|
|
4
5
|
import type { FunkitActiveCheckoutItem } from './FunkitCheckoutContext';
|
|
5
6
|
import type { FunkitCheckoutQuoteResult } from './FunkitHistoryContext';
|
|
6
|
-
export declare const trackEventFromBaseQuote: (checkoutItem: FunkitActiveCheckoutItem, eventName: CheckoutModalEvent | WithdrawModalEvent) => TrackEventData;
|
|
7
|
-
export declare const trackEventFromFinalQuote: (finalEstimation: FunkitCheckoutQuoteResult, checkoutItem: FunkitActiveCheckoutItem, eventName: CheckoutModalEvent | WithdrawModalEvent) => TrackEventData;
|
|
7
|
+
export declare const trackEventFromBaseQuote: (checkoutItem: FunkitActiveCheckoutItem, eventName: CheckoutModalEvent | WithdrawModalEvent, quoteMode?: QuoteMode) => TrackEventData;
|
|
8
|
+
export declare const trackEventFromFinalQuote: (finalEstimation: FunkitCheckoutQuoteResult, checkoutItem: FunkitActiveCheckoutItem, eventName: CheckoutModalEvent | WithdrawModalEvent, quoteMode?: QuoteMode) => TrackEventData;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type QuoteBuilder } from '../domains/quoteMode';
|
|
3
|
+
export declare function QuoteModeProvider({ children }: {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
export declare function useQuoteBuilder(): QuoteBuilder;
|
|
@@ -2,13 +2,13 @@ import { type FormOfPaymentType } from '@funkit/api-base';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { type SwappedTheme } from '../utils/swapped';
|
|
4
4
|
export interface SwappedIframeCallbacks {
|
|
5
|
-
onComplete: () => void;
|
|
6
5
|
onBack: () => void;
|
|
7
6
|
onExit: () => void;
|
|
8
7
|
onNewDeposit: () => void;
|
|
9
8
|
onError: (data: Record<string, unknown>) => void;
|
|
10
9
|
onNavigation: (step: string) => void;
|
|
11
10
|
onOrderData: (data: Record<string, unknown>) => void;
|
|
11
|
+
onSuccess: (data: Record<string, unknown>) => void;
|
|
12
12
|
onLogout: () => void;
|
|
13
13
|
}
|
|
14
14
|
interface SwappedContextValue {
|
|
@@ -21,6 +21,7 @@ interface SwappedContextValue {
|
|
|
21
21
|
resetIframe: () => void;
|
|
22
22
|
setIframeRef: (el: HTMLIFrameElement | null) => void;
|
|
23
23
|
setActiveCallbacks: (cb: SwappedIframeCallbacks | null) => void;
|
|
24
|
+
focusAmountInput: () => void;
|
|
24
25
|
swappedTheme: SwappedTheme;
|
|
25
26
|
}
|
|
26
27
|
export declare function SwappedProvider({ children }: {
|
package/dist/utils/address.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { TFunction } from 'i18next';
|
|
2
2
|
import type { FunkitTextCustomizationsConfig } from '../providers/FunkitConfigContext';
|
|
3
3
|
export declare const getWalletLabel: (t: TFunction, textCustomizations: FunkitTextCustomizationsConfig, walletAddress?: string) => string;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function isWithdrawalAddressSupported(address: string): boolean;
|
|
5
5
|
/**
|
|
6
|
-
* Check if the recipient address is compatible with selected chain
|
|
7
|
-
*
|
|
8
|
-
* This currently works as we only support evm and solana chains for withdrawal.
|
|
6
|
+
* Check if the recipient address is compatible with selected chain.
|
|
7
|
+
* Supports EVM, Solana, and Tron chains for withdrawal.
|
|
9
8
|
*/
|
|
10
9
|
export declare function isAddressCompatibleWithChain(address: string, chainId: number): boolean;
|
package/dist/utils/bluvo.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ type WithdrawableBalance = WalletwithdrawbalancebalanceResponse['balances'][numb
|
|
|
3
3
|
import { type BluvoExecuteWithdrawalResponse, BluvoWithdrawalError } from '@funkit/api-base';
|
|
4
4
|
import type { BluvoExchangeType } from '../consts/bluvo';
|
|
5
5
|
import type { AssetHoldingsItem, AssetHoldingsMap, BrokerageAssetHoldingsItem } from '../domains/wallet';
|
|
6
|
+
import { type MinTransferConfig } from '../hooks/useTokenTransfer';
|
|
6
7
|
export declare const isBrokerageAsset: (asset: AssetHoldingsItem) => asset is BrokerageAssetHoldingsItem & {
|
|
7
8
|
usdAmount: number;
|
|
8
9
|
};
|
|
@@ -15,10 +16,7 @@ export declare const isBrokerageAsset: (asset: AssetHoldingsItem) => asset is Br
|
|
|
15
16
|
*/
|
|
16
17
|
export declare function getBrokerageMinMax(asset: BrokerageAssetHoldingsItem & {
|
|
17
18
|
usdAmount: number;
|
|
18
|
-
}, minTransferLimits: {
|
|
19
|
-
mainnet: number;
|
|
20
|
-
nonMainnet: number;
|
|
21
|
-
}, minDeposit?: number): {
|
|
19
|
+
}, minTransferLimits: MinTransferConfig, minDeposit?: number): {
|
|
22
20
|
minUsd: number;
|
|
23
21
|
maxUsd: number;
|
|
24
22
|
};
|
package/dist/utils/checkout.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CheckoutHistoryItem, type CheckoutRefundState, CheckoutState, type DirectExecution } from '@funkit/api-base';
|
|
2
2
|
import { type ApiFunkitCheckoutQuoteResult, type CheckoutQuoteResponse } from '@funkit/utils';
|
|
3
|
+
import type { Dnum } from 'dnum';
|
|
3
4
|
import { type Address, type Hex } from 'viem';
|
|
4
5
|
import type { ServerCheckoutConfig } from '../domains/clientMetadata';
|
|
5
6
|
import type { FunkitCheckoutQuoteResult } from '../domains/quote';
|
|
@@ -92,7 +93,7 @@ export declare function getQuoteExchangeRate(config: FunkitCheckoutConfig, baseQ
|
|
|
92
93
|
* @param config - Checkout config
|
|
93
94
|
* @param quoteResult - Failed quote results
|
|
94
95
|
*/
|
|
95
|
-
export declare function getMaxTargetAssetAmountEstimate(sourceAssetBalance: number, config: FunkitCheckoutConfig, quoteResult: FunkitCheckoutQuoteResult):
|
|
96
|
+
export declare function getMaxTargetAssetAmountEstimate(sourceAssetBalance: number, config: FunkitCheckoutConfig, quoteResult: FunkitCheckoutQuoteResult, targetAssetDecimals: number): Dnum;
|
|
96
97
|
export declare function getTokenDecimals(wagmiConfig: Config, chainId: string, tokenAddress: Address): Promise<number>;
|
|
97
98
|
export declare function evaluateCheckoutGenerateActionsParams(config: FunkitCheckoutConfig): Promise<FunkitCheckoutActionParams[]>;
|
|
98
99
|
export declare function isCheckoutCrFlow(config: FunkitCheckoutConfig): boolean;
|
|
@@ -5,6 +5,7 @@ declare class FunLogger {
|
|
|
5
5
|
protected userAddress: string | null;
|
|
6
6
|
protected userName: string | null;
|
|
7
7
|
protected userLoginType: string | null;
|
|
8
|
+
protected typeLabel: string | null;
|
|
8
9
|
protected sdkVersion: string | null;
|
|
9
10
|
protected l2Address: string | null;
|
|
10
11
|
private isConfigured;
|
|
@@ -38,8 +39,9 @@ declare class FunLogger {
|
|
|
38
39
|
getUserAddress(): string | null;
|
|
39
40
|
getUserName(): string | null;
|
|
40
41
|
getUserLoginType(): string | null;
|
|
42
|
+
getTypeLabel(): string | null;
|
|
41
43
|
getL2Address(): string | null;
|
|
42
|
-
setUserInfo(userId: string, userAddress: string, userName: string, userLoginType: string, l2Address?: string): void;
|
|
44
|
+
setUserInfo(userId: string, userAddress: string, userName: string, userLoginType: string, typeLabel: string, l2Address?: string): void;
|
|
43
45
|
}
|
|
44
46
|
declare const logger: FunLogger;
|
|
45
47
|
export { logger, FunLogger };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import type { GetSupportedAssetsResponse } from '@funkit/api-base';
|
|
1
|
+
import type { GetSupportedAssetsResponse, SupportedAssetInfo } from '@funkit/api-base';
|
|
2
2
|
/** Raw asset entry from the Statsig tokentransferconfig */
|
|
3
3
|
export interface TokenTransferAssetConfig {
|
|
4
4
|
address: string;
|
|
5
|
+
/** Show a "New" badge for this token. 'primary' promotes it as the highlighted new token. */
|
|
6
|
+
showNewBadge?: 'primary' | true;
|
|
5
7
|
}
|
|
8
|
+
/** Resolved asset: API metadata merged with config-driven fields */
|
|
9
|
+
export type ResolvedAssetInfo = SupportedAssetInfo & TokenTransferAssetConfig;
|
|
6
10
|
/** Raw chain entry from the Statsig tokentransferconfig */
|
|
7
11
|
export interface TokenTransferChainConfig {
|
|
8
12
|
readonly chainId: number;
|
|
@@ -21,6 +25,8 @@ export interface TokenTransferConfig {
|
|
|
21
25
|
defaultChainId: number | undefined;
|
|
22
26
|
/** Token symbols to prioritize at the top of the dropdown */
|
|
23
27
|
priorityTokenSymbols: string[];
|
|
28
|
+
/** Token symbols that have a "New" badge. The 'primary' symbol is first. */
|
|
29
|
+
newBadgeSymbols: Set<string>;
|
|
24
30
|
/** True while /assets/supported is still loading */
|
|
25
31
|
isLoading: boolean;
|
|
26
32
|
}
|
package/dist/wagmi/hooks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { useAccount, useAccountEffect, useBalance, useConfig, useConnect, useDisconnect, useEnsAvatar, useEnsName, useReconnect, useSendTransaction, useSwitchChain, useWalletClient, useWriteContract, } from 'wagmi';
|
|
1
|
+
export { useAccount, useAccountEffect, useBalance, useConfig, useConnect, useDisconnect, useEnsAvatar, useEnsName, useGasPrice, useReconnect, useSendTransaction, useSwitchChain, useWalletClient, useWriteContract, } from 'wagmi';
|
|
2
2
|
export { WagmiProvider } from 'wagmi';
|
|
3
3
|
export { createConfig, createConnector, http } from 'wagmi';
|
|
4
4
|
export type { Config, Connector, CreateConfigParameters, CreateConnectorFn, UseAccountReturnType, UseConfigReturnType, UseDisconnectReturnType, UseReconnectReturnType, WagmiProviderProps, } from 'wagmi';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
argentWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-XTD6OMZP.js";
|
|
5
|
+
import "../chunk-FMVNQKZL.js";
|
|
6
|
+
import "../chunk-3K2MFXCO.js";
|
|
7
7
|
export {
|
|
8
8
|
argentWallet
|
|
9
9
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bifrostWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-OD6B2ISG.js";
|
|
5
|
+
import "../chunk-FMVNQKZL.js";
|
|
6
|
+
import "../chunk-YYYRPQHB.js";
|
|
7
|
+
import "../chunk-3K2MFXCO.js";
|
|
8
8
|
export {
|
|
9
9
|
bifrostWallet
|
|
10
10
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bitgetWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-IMNI4AGV.js";
|
|
5
|
+
import "../chunk-FMVNQKZL.js";
|
|
6
|
+
import "../chunk-YYYRPQHB.js";
|
|
7
|
+
import "../chunk-3K2MFXCO.js";
|
|
8
8
|
export {
|
|
9
9
|
bitgetWallet
|
|
10
10
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bitskiWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-Y36HPFB3.js";
|
|
5
|
+
import "../chunk-YYYRPQHB.js";
|
|
6
|
+
import "../chunk-3K2MFXCO.js";
|
|
7
7
|
export {
|
|
8
8
|
bitskiWallet
|
|
9
9
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bitverseWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-RZH4FSX7.js";
|
|
5
|
+
import "../chunk-FMVNQKZL.js";
|
|
6
|
+
import "../chunk-3K2MFXCO.js";
|
|
7
7
|
export {
|
|
8
8
|
bitverseWallet
|
|
9
9
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bloomWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-S6R4B763.js";
|
|
5
|
+
import "../chunk-FMVNQKZL.js";
|
|
6
|
+
import "../chunk-3K2MFXCO.js";
|
|
7
7
|
export {
|
|
8
8
|
bloomWallet
|
|
9
9
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
braveWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-XVH4JIXB.js";
|
|
5
|
+
import "../chunk-YYYRPQHB.js";
|
|
6
|
+
import "../chunk-3K2MFXCO.js";
|
|
7
7
|
export {
|
|
8
8
|
braveWallet
|
|
9
9
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bybitWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-7IEUTLHY.js";
|
|
5
|
+
import "../chunk-FMVNQKZL.js";
|
|
6
|
+
import "../chunk-YYYRPQHB.js";
|
|
7
|
+
import "../chunk-3K2MFXCO.js";
|
|
8
8
|
export {
|
|
9
9
|
bybitWallet
|
|
10
10
|
};
|