@funkit/connect 5.2.1 → 5.3.2
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 +41 -0
- package/dist/{chunk-3LR6KLPU.js → chunk-AIST42FG.js} +8 -3
- package/dist/{chunk-QMPPK7HO.js → chunk-ZX757M5P.js} +8 -3
- package/dist/components/Box/Box.d.ts +28 -28
- package/dist/components/Dialog/Dialog.css.d.ts +4 -2
- package/dist/components/Dialog/Dialog.d.ts +10 -6
- package/dist/components/Dialog/DialogContent.css.d.ts +2 -0
- package/dist/components/Dropdown/BaseDropdown.d.ts +4 -5
- package/dist/components/Dropdown/ChainDropdown.d.ts +1 -3
- package/dist/components/FunAsset/FunAssetLoading.d.ts +6 -3
- package/dist/components/FunBadge/BridgeCustomerStatusBadge.d.ts +9 -0
- package/dist/components/FunBadge/FunBadge.d.ts +4 -2
- package/dist/components/FunButton/FunIconButton.d.ts +1 -0
- package/dist/components/FunButton/FunLinkButton.d.ts +4 -0
- package/dist/components/FunCheckbox/FunCheckbox.d.ts +9 -0
- package/dist/components/FunCheckoutHistory/FunCheckoutStatus.d.ts +11 -2
- package/dist/components/FunCheckoutHistory/FunDirectExecutionStatus.d.ts +7 -0
- package/dist/components/FunCheckoutModalHeightAnimationWrapper/FunCheckoutModalHeightAnimationWrapper.d.ts +9 -0
- package/dist/components/FunFeatureList/FunFeatureList.d.ts +13 -0
- package/dist/components/FunFeatureList/FunFeatureListItem.d.ts +10 -0
- package/dist/components/FunGuarantees/FunGuarantees.d.ts +7 -3
- package/dist/components/FunInput/FunInput.d.ts +3 -1
- package/dist/components/FunInput/FunTextAreaInput.d.ts +1 -1
- package/dist/components/FunInputButton/FunInputButton.d.ts +14 -0
- package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
- package/dist/components/FunPayments/FunPaymentMethods.d.ts +8 -1
- package/dist/components/FunSelect/FunSelect.d.ts +3 -0
- package/dist/components/FunTooltip/FunTooltip.css.d.ts +1 -0
- package/dist/components/FunTooltip/FunTooltip.d.ts +15 -1
- package/dist/components/FunTransactionSummary/PaymentAmountSummary.d.ts +3 -4
- package/dist/components/Icons/CheckIcon.d.ts +1 -1
- package/dist/components/Icons/HomeIcon.d.ts +4 -0
- package/dist/components/Icons/Icons.css.d.ts +0 -1
- package/dist/components/Icons/New/BankIcon.d.ts +7 -0
- package/dist/components/Icons/New/BanknoteIcon.d.ts +4 -0
- package/dist/components/Icons/New/CoinsHandIcon.d.ts +4 -0
- package/dist/components/Icons/New/FiatAccountIcon.d.ts +4 -0
- package/dist/components/Icons/New/HelpIcon.d.ts +2 -0
- package/dist/components/Icons/New/LightningBoltOutlineIcon.d.ts +4 -0
- package/dist/components/Icons/New/ShieldCheckIcon.d.ts +4 -0
- package/dist/components/Icons/New/TimeIcon.d.ts +4 -0
- package/dist/components/Icons/New/UserIcon.d.ts +4 -0
- package/dist/components/Icons/SpinnerIconWithBackground.d.ts +6 -4
- package/dist/components/Icons/SuccessIcon.d.ts +3 -1
- package/dist/components/Icons/UserSquareIcon.d.ts +4 -0
- package/dist/components/Icons/VerificationFailedIcon.d.ts +4 -0
- package/dist/components/Icons/VerificationPendingIcon.d.ts +4 -0
- package/dist/components/Icons/VerificationSuccessIcon.d.ts +4 -0
- package/dist/components/Icons/VerifyIdentityIcon.d.ts +4 -0
- package/dist/components/QRCode/QRCodeSkeletonLoader.d.ts +3 -1
- package/dist/components/SourcePaymentMethodItem/SourcePaymentMethodItem.d.ts +1 -2
- package/dist/components/Tabs/Tabs.d.ts +11 -0
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/TransferTokenDetails/TransferTokenDetails.d.ts +2 -2
- package/dist/components/VirtualFiatAccount/CreateAccountScreen/CreateAccountScreen.d.ts +15 -0
- package/dist/components/VirtualFiatAccount/IntroScreen/IntroScreen.d.ts +6 -0
- package/dist/components/VirtualFiatAccount/VerifyAccountScreen/VerifyAccountScreen.d.ts +15 -0
- package/dist/consts/customers.d.ts +2 -0
- package/dist/consts/quote.d.ts +3 -10
- package/dist/css/sprinkles.css.d.ts +42 -32
- package/dist/domains/bridge.d.ts +25 -0
- package/dist/domains/fees.d.ts +14 -1
- package/dist/domains/paymentMethods.d.ts +25 -4
- package/dist/domains/quote.d.ts +13 -4
- package/dist/domains/relay.d.ts +35 -1
- package/dist/hooks/useCheckoutDirectExecution.d.ts +10 -2
- package/dist/hooks/useCheckoutDirectExecutionHistory.d.ts +11 -0
- package/dist/hooks/useCopyToClipboard.d.ts +7 -3
- package/dist/hooks/useFrogAccount.d.ts +335 -0
- package/dist/hooks/useIsUsBankrUser.d.ts +1 -0
- package/dist/hooks/usePaymentMethodIcon.d.ts +1 -0
- package/dist/hooks/usePaymentSources.d.ts +1 -1
- package/dist/hooks/useReceiveAmountLabel.d.ts +4 -0
- package/dist/hooks/useRelayExecutionInfo.d.ts +7 -0
- package/dist/hooks/useTokenTransfer.d.ts +3 -2
- package/dist/index.css +2381 -2027
- package/dist/index.js +17519 -14287
- package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +1 -1
- package/dist/modals/CheckoutModal/LoadingAccount.d.ts +4 -1
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +8 -3
- package/dist/modals/CheckoutModal/VirtualFiatAccount/BridgeCustomer.d.ts +13 -0
- package/dist/modals/CheckoutModal/VirtualFiatAccount/BridgeKyc.d.ts +22 -0
- package/dist/modals/CheckoutModal/VirtualFiatAccount/ErrorScreen.d.ts +7 -0
- package/dist/modals/CheckoutModal/VirtualFiatAccount/FiatAccountDetail.d.ts +9 -0
- package/dist/modals/CheckoutModal/VirtualFiatAccount/KycIframe.d.ts +5 -0
- package/dist/modals/CheckoutModal/VirtualFiatAccount/VirtualFiatAccount.d.ts +9 -0
- package/dist/modals/CheckoutModal/stepTransition.d.ts +26 -1
- package/dist/modals/CheckoutModal/useNewCheckoutQuote.d.ts +1 -1
- package/dist/providers/FunkitCheckoutContext.d.ts +9 -2
- package/dist/providers/FunkitConfigContext.d.ts +1 -0
- package/dist/providers/FunkitQuoteContext.d.ts +4 -1
- package/dist/providers/FunkitThemeProvider.d.ts +21 -6
- package/dist/providers/ModalContext.d.ts +1 -1
- package/dist/themes/darkTheme.js +1 -1
- package/dist/themes/lightTheme.js +1 -1
- package/dist/utils/checkout.d.ts +18 -1
- package/dist/utils/flags/config.d.ts +50 -16
- package/dist/utils/flags/types.d.ts +2 -0
- package/dist/utils/mesh.d.ts +1 -0
- 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 +55 -55
- 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 +6 -6
- /package/dist/components/{TransferTokenDetails/TransferTokenDetails.css.d.ts → FunFeatureList/FunFeatureList.css.d.ts} +0 -0
|
@@ -4,4 +4,4 @@ export declare const USD_DECIMALS = 2;
|
|
|
4
4
|
export declare const USD_INITIAL_AMOUNT = 100;
|
|
5
5
|
export declare const USD_PREFIX = "$";
|
|
6
6
|
export declare function getUsdMaxAmount(paymentMethod: PaymentMethod, maxUsd: number): number | null;
|
|
7
|
-
export declare function getUsdMinAmount(paymentMethod: PaymentMethod, minUsd?: number
|
|
7
|
+
export declare function getUsdMinAmount(paymentMethod: PaymentMethod, minUsd?: number): number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PaymentMethod, type PaymentMethodAccountInfo, type PaymentMethodBrokerageInfo } from '../../domains/paymentMethods';
|
|
2
|
+
import { PaymentMethod, type PaymentMethodAccountInfo, type PaymentMethodBrokerageInfo, type PaymentMethodVirtualBankInfo } from '../../domains/paymentMethods';
|
|
3
3
|
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from './stepTransition';
|
|
4
4
|
export type LoadingAccountState = CheckoutModalCommonState;
|
|
5
5
|
export type LoadingAccountNext = {
|
|
@@ -8,6 +8,9 @@ export type LoadingAccountNext = {
|
|
|
8
8
|
} | {
|
|
9
9
|
usablePaymentMethod: PaymentMethod.BROKERAGE;
|
|
10
10
|
paymentMethodInfo: PaymentMethodBrokerageInfo;
|
|
11
|
+
} | {
|
|
12
|
+
usablePaymentMethod: PaymentMethod.VIRTUAL_BANK;
|
|
13
|
+
paymentMethodInfo: PaymentMethodVirtualBankInfo;
|
|
11
14
|
} | {
|
|
12
15
|
usablePaymentMethod: null | PaymentMethod.TOKEN_TRANSFER;
|
|
13
16
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type ConnectablePaymentMethodInfo, PaymentMethod, type PaymentMethodCardInfo } from '~/domains/paymentMethods';
|
|
2
|
+
import { type ConnectablePaymentMethodInfo, PaymentMethod, type PaymentMethodCardInfo, type PaymentMethodVirtualBankIncompleteInfo } from '~/domains/paymentMethods';
|
|
3
3
|
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
|
|
4
4
|
export type SourceChangeState = CheckoutModalCommonState & {
|
|
5
5
|
paymentMethodInfo: ConnectablePaymentMethodInfo | null;
|
|
@@ -10,7 +10,12 @@ export type SourceChangeNext = {
|
|
|
10
10
|
brokerageFailed: false;
|
|
11
11
|
} | {
|
|
12
12
|
connectNew: true;
|
|
13
|
-
paymentMethod: Exclude<PaymentMethod, PaymentMethod.CARD>;
|
|
13
|
+
paymentMethod: Exclude<PaymentMethod, PaymentMethod.CARD | PaymentMethod.VIRTUAL_BANK>;
|
|
14
|
+
brokerageFailed: false;
|
|
15
|
+
} | {
|
|
16
|
+
connectNew: true;
|
|
17
|
+
paymentMethod: PaymentMethod.VIRTUAL_BANK;
|
|
18
|
+
paymentMethodInfo: PaymentMethodVirtualBankIncompleteInfo;
|
|
14
19
|
brokerageFailed: false;
|
|
15
20
|
} | {
|
|
16
21
|
connectNew: true;
|
|
@@ -22,4 +27,4 @@ export type SourceChangeNext = {
|
|
|
22
27
|
paymentMethodInfo: ConnectablePaymentMethodInfo;
|
|
23
28
|
};
|
|
24
29
|
export declare const SourceChangeInfo: ModalStepInfo<FunCheckoutStep.SOURCE_CHANGE>;
|
|
25
|
-
export declare function SourceChange({ modalState, onNext, onClose, }: ModalStepComponentProps<FunCheckoutStep.SOURCE_CHANGE>): React.JSX.Element;
|
|
30
|
+
export declare function SourceChange({ modalState, onNext, onClose, setModalState, }: ModalStepComponentProps<FunCheckoutStep.SOURCE_CHANGE>): React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PaymentMethodVirtualBankIncompleteInfo } from '~/domains/paymentMethods';
|
|
2
|
+
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepInfo } from '~/modals/CheckoutModal/stepTransition';
|
|
3
|
+
export type BridgeCustomerNext = {
|
|
4
|
+
hasError?: false;
|
|
5
|
+
kycLink: string;
|
|
6
|
+
} | {
|
|
7
|
+
hasError: true;
|
|
8
|
+
errorCode: string;
|
|
9
|
+
};
|
|
10
|
+
export type BridgeCustomerState = CheckoutModalCommonState & {
|
|
11
|
+
paymentMethodInfo: PaymentMethodVirtualBankIncompleteInfo;
|
|
12
|
+
};
|
|
13
|
+
export declare const BridgeCustomerInfo: ModalStepInfo<FunCheckoutStep.BRIDGE_CUSTOMER>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type BridgeCustomer, type BridgeVirtualBankAccount, type Guid } from '@funkit/api-base';
|
|
2
|
+
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepInfo } from '~/modals/CheckoutModal/stepTransition';
|
|
3
|
+
export declare enum NextStep {
|
|
4
|
+
ShowSource = "ShowSource",
|
|
5
|
+
ShowKyc = "ShowKyc",
|
|
6
|
+
ShowError = "ShowError"
|
|
7
|
+
}
|
|
8
|
+
export type BridgeKycNext = {
|
|
9
|
+
nextStep: NextStep.ShowSource;
|
|
10
|
+
bridgeCustomer: BridgeCustomer;
|
|
11
|
+
virtualFiatAccount: BridgeVirtualBankAccount;
|
|
12
|
+
} | {
|
|
13
|
+
nextStep: NextStep.ShowError;
|
|
14
|
+
} | {
|
|
15
|
+
nextStep: NextStep.ShowKyc;
|
|
16
|
+
guidForKyc: Guid;
|
|
17
|
+
};
|
|
18
|
+
export type BridgeKycState = CheckoutModalCommonState & {
|
|
19
|
+
kycLink?: string;
|
|
20
|
+
kycIframeCompleted?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare const BridgeKycInfo: ModalStepInfo<FunCheckoutStep.BRIDGE_KYC>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CheckoutModalCommonState, FunCheckoutStep, ModalStepInfo } from '~/modals/CheckoutModal/stepTransition';
|
|
3
|
+
export type ErrorScreenState = CheckoutModalCommonState & {
|
|
4
|
+
errorCode: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const ErrorScreen: () => React.JSX.Element;
|
|
7
|
+
export declare const ErrorScreenInfo: ModalStepInfo<FunCheckoutStep.ERROR_SCREEN>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type PaymentMethodVirtualBankInfo } from '~/domains/paymentMethods';
|
|
3
|
+
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
|
|
4
|
+
export type FiatAccountDetailState = CheckoutModalCommonState & {
|
|
5
|
+
paymentMethodInfo: PaymentMethodVirtualBankInfo;
|
|
6
|
+
};
|
|
7
|
+
export type FiatAccountDetailNext = Record<string, never>;
|
|
8
|
+
export declare const AccountDetailsScreen: ({ modalState, onNext, }: ModalStepComponentProps<FunCheckoutStep.FIAT_ACCOUNT_DETAIL>) => React.JSX.Element;
|
|
9
|
+
export declare const FiatAccountDetail: ModalStepInfo<FunCheckoutStep.FIAT_ACCOUNT_DETAIL>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type KycLinkLoad } from '~/hooks/useFrogAccount';
|
|
2
|
+
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepInfo } from '~/modals/CheckoutModal/stepTransition';
|
|
3
|
+
export type KycIframeState = CheckoutModalCommonState & KycLinkLoad;
|
|
4
|
+
export type KycIframeNext = Record<string, never>;
|
|
5
|
+
export declare const KycIframeInfo: ModalStepInfo<FunCheckoutStep.KYC_IFRAME>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PaymentMethodVirtualBankIncompleteInfo } from '~/domains/paymentMethods';
|
|
3
|
+
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '~/modals/CheckoutModal/stepTransition';
|
|
4
|
+
export type VirtualFiatAccountNext = Record<string, never>;
|
|
5
|
+
export type VirtualFiatAccountState = CheckoutModalCommonState & {
|
|
6
|
+
paymentMethodInfo: PaymentMethodVirtualBankIncompleteInfo;
|
|
7
|
+
};
|
|
8
|
+
export declare const VirtualFiatAccountInfo: ModalStepInfo<FunCheckoutStep.CREATE_FIAT_ACCOUNT>;
|
|
9
|
+
export declare function VirtualFiatAccount({ onNext, }: ModalStepComponentProps<FunCheckoutStep.CREATE_FIAT_ACCOUNT>): React.JSX.Element;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type ComponentType, type SetStateAction } from 'react';
|
|
2
|
+
import { type BridgeCustomerNext, type BridgeCustomerState } from '~/modals/CheckoutModal/VirtualFiatAccount/BridgeCustomer';
|
|
3
|
+
import { type BridgeKycNext, type BridgeKycState } from '~/modals/CheckoutModal/VirtualFiatAccount/BridgeKyc';
|
|
4
|
+
import { type ErrorScreenState } from '~/modals/CheckoutModal/VirtualFiatAccount/ErrorScreen';
|
|
5
|
+
import { type VirtualFiatAccountNext, type VirtualFiatAccountState } from '~/modals/CheckoutModal/VirtualFiatAccount/VirtualFiatAccount';
|
|
2
6
|
import type { FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
|
|
3
7
|
import { type FunkitTextCustomizationsConfig } from '../../providers/FunkitConfigContext';
|
|
4
8
|
import { type CheckoutCompleteNext, type CheckoutCompleteState } from './CheckoutComplete/CheckoutComplete';
|
|
@@ -13,6 +17,8 @@ import { type SelectAssetNext, type SelectAssetState } from './SelectAsset';
|
|
|
13
17
|
import { type SelectBrokerageNext, type SelectBrokerageState } from './SelectBrokerage';
|
|
14
18
|
import { type SourceChangeNext, type SourceChangeState } from './SourceChange/SourceChange';
|
|
15
19
|
import { type TransferTokenNext, type TransferTokenState } from './TransferToken/TransferToken';
|
|
20
|
+
import { type FiatAccountDetailNext, type FiatAccountDetailState } from './VirtualFiatAccount/FiatAccountDetail';
|
|
21
|
+
import { type KycIframeNext, type KycIframeState } from './VirtualFiatAccount/KycIframe';
|
|
16
22
|
export interface CheckoutModalCommonState {
|
|
17
23
|
checkoutId: string;
|
|
18
24
|
/** Handles soft hiding of the dialog (without removing it from the DOM) */
|
|
@@ -41,7 +47,13 @@ export declare enum FunCheckoutStep {
|
|
|
41
47
|
MESH_VERIFICATION = "mesh_verification",
|
|
42
48
|
CHECKOUT_COMPLETE = "checkout_complete",
|
|
43
49
|
CHECKOUT_HELP = "checkout_help",
|
|
44
|
-
TRANSFER_TOKEN = "transfer_token"
|
|
50
|
+
TRANSFER_TOKEN = "transfer_token",
|
|
51
|
+
CREATE_FIAT_ACCOUNT = "create_fiat_account",
|
|
52
|
+
BRIDGE_CUSTOMER = "bridge_customer",
|
|
53
|
+
BRIDGE_KYC = "bridge_kyc",
|
|
54
|
+
KYC_IFRAME = "KYC_IFRAME",
|
|
55
|
+
FIAT_ACCOUNT_DETAIL = "fiat_account_detail",
|
|
56
|
+
ERROR_SCREEN = "error_screen"
|
|
45
57
|
}
|
|
46
58
|
export type ModalStepInfo<S extends FunCheckoutStep> = {
|
|
47
59
|
Component: ComponentType<ModalStepComponentProps<S>>;
|
|
@@ -73,6 +85,12 @@ type CheckoutModalState<S extends FunCheckoutStep = FunCheckoutStep> = {
|
|
|
73
85
|
[FunCheckoutStep.SELECT_BROKERAGE]: SelectBrokerageState;
|
|
74
86
|
[FunCheckoutStep.SOURCE_CHANGE]: SourceChangeState;
|
|
75
87
|
[FunCheckoutStep.TRANSFER_TOKEN]: TransferTokenState;
|
|
88
|
+
[FunCheckoutStep.CREATE_FIAT_ACCOUNT]: VirtualFiatAccountState;
|
|
89
|
+
[FunCheckoutStep.BRIDGE_KYC]: BridgeKycState;
|
|
90
|
+
[FunCheckoutStep.KYC_IFRAME]: KycIframeState;
|
|
91
|
+
[FunCheckoutStep.BRIDGE_CUSTOMER]: BridgeCustomerState;
|
|
92
|
+
[FunCheckoutStep.FIAT_ACCOUNT_DETAIL]: FiatAccountDetailState;
|
|
93
|
+
[FunCheckoutStep.ERROR_SCREEN]: ErrorScreenState;
|
|
76
94
|
}[T] & {
|
|
77
95
|
step: T;
|
|
78
96
|
};
|
|
@@ -90,8 +108,15 @@ type NextPayload<S extends FunCheckoutStep = FunCheckoutStep> = {
|
|
|
90
108
|
[FunCheckoutStep.SELECT_BROKERAGE]: SelectBrokerageNext;
|
|
91
109
|
[FunCheckoutStep.SOURCE_CHANGE]: SourceChangeNext;
|
|
92
110
|
[FunCheckoutStep.TRANSFER_TOKEN]: TransferTokenNext;
|
|
111
|
+
[FunCheckoutStep.CREATE_FIAT_ACCOUNT]: VirtualFiatAccountNext;
|
|
112
|
+
[FunCheckoutStep.BRIDGE_KYC]: BridgeKycNext;
|
|
113
|
+
[FunCheckoutStep.KYC_IFRAME]: KycIframeNext;
|
|
114
|
+
[FunCheckoutStep.BRIDGE_CUSTOMER]: BridgeCustomerNext;
|
|
115
|
+
[FunCheckoutStep.FIAT_ACCOUNT_DETAIL]: FiatAccountDetailNext;
|
|
116
|
+
[FunCheckoutStep.ERROR_SCREEN]: null;
|
|
93
117
|
}[S] & {
|
|
94
118
|
reverseAnimation?: boolean;
|
|
119
|
+
skipAnimation?: boolean;
|
|
95
120
|
wipeHistory?: boolean;
|
|
96
121
|
};
|
|
97
122
|
export declare function useCheckoutModalTransition(checkoutItem: FunkitActiveCheckoutItem, onClose: () => void): {
|
|
@@ -2,6 +2,6 @@ import { type DeepPartial } from '@funkit/utils';
|
|
|
2
2
|
import { type FunkitActiveCheckoutItem } from '~/providers/FunkitCheckoutContext';
|
|
3
3
|
export declare function useNewCheckoutQuote(): (overridingCheckoutItem?: DeepPartial<FunkitActiveCheckoutItem>) => Promise<{
|
|
4
4
|
baseQuote: import("@funkit/api-base").CheckoutQuoteResponse;
|
|
5
|
+
checkedAssetAmount: import("~/domains/quote").CheckedAssetAmount;
|
|
5
6
|
finalEstimation: import("~/domains/quote").FunkitCheckoutQuoteResult;
|
|
6
|
-
availableAssetAmount: number | undefined;
|
|
7
7
|
}>;
|
|
@@ -74,8 +74,15 @@ export interface UseFunkitCheckoutProps {
|
|
|
74
74
|
onError?: (result: FunkitCheckoutResult) => void;
|
|
75
75
|
/** @optional fires if the checkout fails at any point **/
|
|
76
76
|
onSuccess?: (result: FunkitCheckoutResult) => void;
|
|
77
|
-
/**
|
|
78
|
-
|
|
77
|
+
/**
|
|
78
|
+
* @optional
|
|
79
|
+
* fires if the checkout requires an active wallet connection. If not specified, defaults to funkit wallet connection.
|
|
80
|
+
* Call the provided `onLoginFinished()` callback once login is completed to resume the checkout flow (and unhide the soft-hidden modal).
|
|
81
|
+
* It is strongly recommended to call `onLoginFinished()` after login is completed. If not called, the checkout modal may remain hidden.
|
|
82
|
+
*/
|
|
83
|
+
onLoginRequired?: ({ onLoginFinished, }: {
|
|
84
|
+
onLoginFinished?: () => void;
|
|
85
|
+
}) => void;
|
|
79
86
|
}
|
|
80
87
|
/** Ensures that config is defined */
|
|
81
88
|
export interface UseFunkitCheckoutPropsWithFullConfig extends UseFunkitCheckoutProps {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type FunkitPrioritizedLoginType, FunkitSocialLoginMethod } from '../consts/funkit';
|
|
3
3
|
export interface FunkitTextCustomizationsConfig {
|
|
4
|
+
virtualFiat: string;
|
|
4
5
|
brokerageOrExchange: string;
|
|
5
6
|
debitOrCredit: string;
|
|
6
7
|
accountBalance: string;
|
|
@@ -3,9 +3,12 @@ import { type PaymentMethodInfo } from '../domains/paymentMethods';
|
|
|
3
3
|
import type { FunkitCheckoutQuoteResult } from '../domains/quote';
|
|
4
4
|
import { type FunkitActiveCheckoutItem } from './FunkitCheckoutContext';
|
|
5
5
|
export type CheckoutQuoteError = {
|
|
6
|
-
maxTargetAssetAmount
|
|
6
|
+
maxTargetAssetAmount?: number;
|
|
7
|
+
minTargetAssetAmount?: number;
|
|
7
8
|
reason: 'insufficientBalance';
|
|
8
9
|
} | {
|
|
10
|
+
maxTargetAssetAmount?: number;
|
|
11
|
+
minTargetAssetAmount?: number;
|
|
9
12
|
minTargetUsdAmount?: number;
|
|
10
13
|
reason: 'insufficientAmount';
|
|
11
14
|
} | {
|
|
@@ -47,7 +47,6 @@ export declare const useActiveTheme: () => {
|
|
|
47
47
|
modalBorder: string;
|
|
48
48
|
offBackground: string;
|
|
49
49
|
offBackgroundInverse: string;
|
|
50
|
-
offBackgroundComplimentary: string;
|
|
51
50
|
hoverState: string;
|
|
52
51
|
lightStroke: string;
|
|
53
52
|
mediumStroke: string;
|
|
@@ -77,6 +76,7 @@ export declare const useActiveTheme: () => {
|
|
|
77
76
|
buttonTextDisabledTertiary: string;
|
|
78
77
|
buttonBackground: string;
|
|
79
78
|
buttonBackgroundHover: string;
|
|
79
|
+
buttonBackgroundPressed: string;
|
|
80
80
|
buttonBackgroundDisabled: string;
|
|
81
81
|
buttonBorderHover: string;
|
|
82
82
|
buttonTextSecondaryDisabled: string;
|
|
@@ -92,6 +92,12 @@ export declare const useActiveTheme: () => {
|
|
|
92
92
|
newBadgeBackground: string;
|
|
93
93
|
newBadgeBorder: string;
|
|
94
94
|
newBadgeText: string;
|
|
95
|
+
approvedBadgeBackground: string;
|
|
96
|
+
approvedBadgeBorder: string;
|
|
97
|
+
approvedBadgeText: string;
|
|
98
|
+
failedBadgeBackground: string;
|
|
99
|
+
failedBadgeBorder: string;
|
|
100
|
+
failedBadgeText: string;
|
|
95
101
|
inputAmountQuickOptionBaseBackground: string;
|
|
96
102
|
inputAmountQuickOptionHoverBackground: string;
|
|
97
103
|
inputAmountQuickOptionActiveBackground: string;
|
|
@@ -185,7 +191,6 @@ export declare const useActiveTheme: () => {
|
|
|
185
191
|
selectedWallet: string;
|
|
186
192
|
dropdown: string;
|
|
187
193
|
notification: string;
|
|
188
|
-
vertexDropdown: string;
|
|
189
194
|
qrCode: string;
|
|
190
195
|
buttonFocusedShadow: string;
|
|
191
196
|
};
|
|
@@ -223,7 +228,6 @@ export declare const useActiveTheme: () => {
|
|
|
223
228
|
modalBorder: string;
|
|
224
229
|
offBackground: string;
|
|
225
230
|
offBackgroundInverse: string;
|
|
226
|
-
offBackgroundComplimentary: string;
|
|
227
231
|
hoverState: string;
|
|
228
232
|
lightStroke: string;
|
|
229
233
|
mediumStroke: string;
|
|
@@ -253,6 +257,7 @@ export declare const useActiveTheme: () => {
|
|
|
253
257
|
buttonTextDisabledTertiary: string;
|
|
254
258
|
buttonBackground: string;
|
|
255
259
|
buttonBackgroundHover: string;
|
|
260
|
+
buttonBackgroundPressed: string;
|
|
256
261
|
buttonBackgroundDisabled: string;
|
|
257
262
|
buttonBorderHover: string;
|
|
258
263
|
buttonTextSecondaryDisabled: string;
|
|
@@ -268,6 +273,12 @@ export declare const useActiveTheme: () => {
|
|
|
268
273
|
newBadgeBackground: string;
|
|
269
274
|
newBadgeBorder: string;
|
|
270
275
|
newBadgeText: string;
|
|
276
|
+
approvedBadgeBackground: string;
|
|
277
|
+
approvedBadgeBorder: string;
|
|
278
|
+
approvedBadgeText: string;
|
|
279
|
+
failedBadgeBackground: string;
|
|
280
|
+
failedBadgeBorder: string;
|
|
281
|
+
failedBadgeText: string;
|
|
271
282
|
inputAmountQuickOptionBaseBackground: string;
|
|
272
283
|
inputAmountQuickOptionHoverBackground: string;
|
|
273
284
|
inputAmountQuickOptionActiveBackground: string;
|
|
@@ -361,7 +372,6 @@ export declare const useActiveTheme: () => {
|
|
|
361
372
|
selectedWallet: string;
|
|
362
373
|
dropdown: string;
|
|
363
374
|
notification: string;
|
|
364
|
-
vertexDropdown: string;
|
|
365
375
|
qrCode: string;
|
|
366
376
|
buttonFocusedShadow: string;
|
|
367
377
|
};
|
|
@@ -397,7 +407,6 @@ export declare const useActiveTheme: () => {
|
|
|
397
407
|
modalBorder: string;
|
|
398
408
|
offBackground: string;
|
|
399
409
|
offBackgroundInverse: string;
|
|
400
|
-
offBackgroundComplimentary: string;
|
|
401
410
|
hoverState: string;
|
|
402
411
|
lightStroke: string;
|
|
403
412
|
mediumStroke: string;
|
|
@@ -427,6 +436,7 @@ export declare const useActiveTheme: () => {
|
|
|
427
436
|
buttonTextDisabledTertiary: string;
|
|
428
437
|
buttonBackground: string;
|
|
429
438
|
buttonBackgroundHover: string;
|
|
439
|
+
buttonBackgroundPressed: string;
|
|
430
440
|
buttonBackgroundDisabled: string;
|
|
431
441
|
buttonBorderHover: string;
|
|
432
442
|
buttonTextSecondaryDisabled: string;
|
|
@@ -442,6 +452,12 @@ export declare const useActiveTheme: () => {
|
|
|
442
452
|
newBadgeBackground: string;
|
|
443
453
|
newBadgeBorder: string;
|
|
444
454
|
newBadgeText: string;
|
|
455
|
+
approvedBadgeBackground: string;
|
|
456
|
+
approvedBadgeBorder: string;
|
|
457
|
+
approvedBadgeText: string;
|
|
458
|
+
failedBadgeBackground: string;
|
|
459
|
+
failedBadgeBorder: string;
|
|
460
|
+
failedBadgeText: string;
|
|
445
461
|
inputAmountQuickOptionBaseBackground: string;
|
|
446
462
|
inputAmountQuickOptionHoverBackground: string;
|
|
447
463
|
inputAmountQuickOptionActiveBackground: string;
|
|
@@ -535,7 +551,6 @@ export declare const useActiveTheme: () => {
|
|
|
535
551
|
selectedWallet: string;
|
|
536
552
|
dropdown: string;
|
|
537
553
|
notification: string;
|
|
538
|
-
vertexDropdown: string;
|
|
539
554
|
qrCode: string;
|
|
540
555
|
buttonFocusedShadow: string;
|
|
541
556
|
};
|
|
@@ -21,7 +21,7 @@ export declare function useWalletConnectOpenState(): {
|
|
|
21
21
|
isWalletConnectModalOpen: boolean;
|
|
22
22
|
setIsWalletConnectModalOpen: (isWalletConnectModalOpen: boolean) => void;
|
|
23
23
|
};
|
|
24
|
-
export declare function useConnectModal(): {
|
|
24
|
+
export declare function useConnectModal(onClose?: () => void): {
|
|
25
25
|
connectModalOpen: boolean;
|
|
26
26
|
openConnectModal: ((walletsOnly?: boolean) => void) | undefined;
|
|
27
27
|
};
|
package/dist/themes/darkTheme.js
CHANGED
package/dist/utils/checkout.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CheckoutHistoryItem } from '@funkit/api-base';
|
|
1
|
+
import { type CheckoutHistoryItem, type CheckoutQuoteResponse } from '@funkit/api-base';
|
|
2
2
|
import { type Config } from '@wagmi/core';
|
|
3
3
|
import { type Address } from 'viem';
|
|
4
4
|
import type { UseConfigReturnType } from 'wagmi';
|
|
@@ -7,6 +7,7 @@ import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
|
|
|
7
7
|
import type { FunkitCheckoutActionParams, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
|
|
8
8
|
export declare const MOONPAY_TIME_ESTIMATE_MS = 120000;
|
|
9
9
|
export declare const MESH_TIME_ESTIMATE_MS = 300000;
|
|
10
|
+
export declare const BANK_TIME_ESTIMATE_MS = 0;
|
|
10
11
|
export declare const DUMMY_TRANSFER_PARAMS: {
|
|
11
12
|
toAddress: "0x000000000000000000000000000000000000dEaD";
|
|
12
13
|
tokenAmount: number;
|
|
@@ -100,6 +101,22 @@ export declare function getCheckoutItemDisplay({ checkoutConfig, hideAmount, }:
|
|
|
100
101
|
checkoutConfig: FunkitCheckoutConfig | ServerCheckoutConfig;
|
|
101
102
|
hideAmount?: boolean;
|
|
102
103
|
}): string;
|
|
104
|
+
/**
|
|
105
|
+
* Given the result of a quote, calculate the effective fees (in source asset).
|
|
106
|
+
*
|
|
107
|
+
* _These are only the fees from our base quote, **not** including the initial transfer / brokerage / card processing fees._
|
|
108
|
+
*/
|
|
109
|
+
export declare function getBaseQuoteTotalFeesFromAmount(baseQuote: CheckoutQuoteResponse): number;
|
|
110
|
+
/**
|
|
111
|
+
* Given the result of a quote, calculate the effective fees (in source asset).
|
|
112
|
+
*
|
|
113
|
+
* _These also including the initial transfer / brokerage / card processing fees._
|
|
114
|
+
*/
|
|
115
|
+
export declare function getQuoteTotalFeesFromAmount(finalQuote: FunkitCheckoutQuoteResult): number;
|
|
116
|
+
/**
|
|
117
|
+
* Given the result of a quote, calculate the effective exchange rate (target asset / source asset).
|
|
118
|
+
*/
|
|
119
|
+
export declare function getQuoteExchangeRate(config: FunkitCheckoutConfig, baseQuote: CheckoutQuoteResponse): number;
|
|
103
120
|
/**
|
|
104
121
|
* Given the result of a quote, estimate the maximum targetAssetAmount for which the checkout should succeed.
|
|
105
122
|
* The result is then reduced by 1% to further reduce the risk of insufficient funds.
|
|
@@ -55,23 +55,28 @@ export declare const flagConfig: {
|
|
|
55
55
|
value: true;
|
|
56
56
|
}[];
|
|
57
57
|
};
|
|
58
|
-
|
|
59
|
-
type: "
|
|
60
|
-
default_value:
|
|
61
|
-
overrides: {
|
|
62
|
-
if_any:
|
|
63
|
-
key: "userId";
|
|
64
|
-
type: "pctRollout";
|
|
65
|
-
pct: number;
|
|
66
|
-
values?: undefined;
|
|
67
|
-
} | {
|
|
58
|
+
enable_fiat_deposit: {
|
|
59
|
+
type: "boolean";
|
|
60
|
+
default_value: false;
|
|
61
|
+
overrides: ({
|
|
62
|
+
if_any: {
|
|
68
63
|
key: "userId";
|
|
69
64
|
type: "isAnyOf";
|
|
70
65
|
values: string[];
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
}[];
|
|
67
|
+
value: true;
|
|
68
|
+
} | {
|
|
69
|
+
if_any: {
|
|
70
|
+
key: "apiKey";
|
|
71
|
+
type: "isAnyOf";
|
|
72
|
+
values: string[];
|
|
73
|
+
}[];
|
|
74
|
+
value: true;
|
|
75
|
+
})[];
|
|
76
|
+
};
|
|
77
|
+
token_transfer_source_chains_and_assets: {
|
|
78
|
+
type: "string";
|
|
79
|
+
default_value: string;
|
|
75
80
|
};
|
|
76
81
|
enable_token_transfer_universal_deposit_address: {
|
|
77
82
|
type: "boolean";
|
|
@@ -146,11 +151,11 @@ export declare const flagConfig: {
|
|
|
146
151
|
};
|
|
147
152
|
display_solana_new_badge: {
|
|
148
153
|
type: "boolean";
|
|
149
|
-
default_value:
|
|
154
|
+
default_value: false;
|
|
150
155
|
};
|
|
151
156
|
display_solana_deposits_banner: {
|
|
152
157
|
type: "boolean";
|
|
153
|
-
default_value:
|
|
158
|
+
default_value: false;
|
|
154
159
|
};
|
|
155
160
|
token_transfer_new_tokens: {
|
|
156
161
|
type: "string";
|
|
@@ -163,6 +168,23 @@ export declare const flagConfig: {
|
|
|
163
168
|
is_relay_bypass_enabled: {
|
|
164
169
|
type: "boolean";
|
|
165
170
|
default_value: false;
|
|
171
|
+
overrides: {
|
|
172
|
+
if_all: ({
|
|
173
|
+
key: "userId";
|
|
174
|
+
type: "isAnyOf";
|
|
175
|
+
values: string[];
|
|
176
|
+
} | {
|
|
177
|
+
key: "apiKey";
|
|
178
|
+
type: "isAnyOf";
|
|
179
|
+
values: string[];
|
|
180
|
+
})[];
|
|
181
|
+
if_any: {
|
|
182
|
+
key: "userId";
|
|
183
|
+
type: "isAnyOf";
|
|
184
|
+
values: string[];
|
|
185
|
+
}[];
|
|
186
|
+
value: true;
|
|
187
|
+
}[];
|
|
166
188
|
};
|
|
167
189
|
relay_bypass_source_chains_and_assets: {
|
|
168
190
|
type: "string";
|
|
@@ -172,4 +194,16 @@ export declare const flagConfig: {
|
|
|
172
194
|
type: "string";
|
|
173
195
|
default_value: string;
|
|
174
196
|
};
|
|
197
|
+
help_tutorial_url: {
|
|
198
|
+
type: "string";
|
|
199
|
+
default_value: string;
|
|
200
|
+
overrides: {
|
|
201
|
+
if_any: {
|
|
202
|
+
key: "apiKey";
|
|
203
|
+
type: "isAnyOf";
|
|
204
|
+
values: string[];
|
|
205
|
+
}[];
|
|
206
|
+
value: string;
|
|
207
|
+
}[];
|
|
208
|
+
};
|
|
175
209
|
};
|
|
@@ -22,6 +22,8 @@ export type InferFlagType<F extends FlagConfig> = F['type'] extends 'number' ? n
|
|
|
22
22
|
type Override<T> = {
|
|
23
23
|
/** non-empty list of conditions, any condition will cause the value to match */
|
|
24
24
|
if_any: Condition[];
|
|
25
|
+
/** non-empty list of conditions, all condition will cause the value to match */
|
|
26
|
+
if_all?: Condition[];
|
|
25
27
|
value: T;
|
|
26
28
|
};
|
|
27
29
|
export type Condition = {
|
package/dist/utils/mesh.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type TransferIntegration } from '@funkit/api-base';
|
|
|
2
2
|
import type { MeshExchangeType } from '../consts/mesh';
|
|
3
3
|
import type { AssetHoldingsMap } from '../utils/assets';
|
|
4
4
|
export { FUNKIT_MESH_CLIENT_ID } from '../consts/mesh';
|
|
5
|
+
export declare const MIN_MESH_TRANSFER_AMOUNT_USD = 10;
|
|
5
6
|
export declare function fetchMeshLinkToken(funkitUserId: string, brokerType: MeshExchangeType, funApiKey: string): Promise<import("@funkit/api-base").GetLinkTokenResponse>;
|
|
6
7
|
export declare function fetchMeshTransferIntegrations(apiKey: string): Promise<TransferIntegration[]>;
|
|
7
8
|
export declare function getMeshSupportedTokensAndIdByChainIdAndBrokerage({ brokerType, chainId, integrations, }: {
|