@funkit/connect 3.2.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/{chunk-76VEFMWE.js → chunk-YOJVBRUJ.js} +4 -0
- package/dist/{chunk-EUSK63OY.js → chunk-ZGK66FYG.js} +4 -0
- package/dist/components/Box/Box.d.ts +44 -43
- package/dist/components/CopyAddress/CopyAddress.d.ts +7 -1
- package/dist/components/Dialog/Dialog.d.ts +2 -2
- package/dist/components/Dropdown/BaseActiveDropdownItem.d.ts +12 -0
- package/dist/components/Dropdown/BaseDropdown.d.ts +21 -0
- package/dist/components/Dropdown/BaseDropdownItem.d.ts +13 -0
- package/dist/components/Dropdown/ChainDropdown.d.ts +6 -0
- package/dist/components/Dropdown/TokenDropdown.d.ts +3 -0
- package/dist/components/FunAlert/FunAlert.d.ts +6 -3
- package/dist/components/FunBottomBar/FunBottomBar.d.ts +2 -1
- package/dist/components/FunButton/FunIconButton.d.ts +4 -1
- package/dist/components/FunButton/FunSignInButton.d.ts +8 -0
- package/dist/components/FunConnectOptions/FunConnectOptions.d.ts +5 -2
- package/dist/components/FunConnectOptions/FunConnectResultStep.d.ts +1 -3
- package/dist/components/FunConnectOptions/FunSignInStep.d.ts +2 -1
- package/dist/components/FunConnectOptions/FunWeb3ConnectingStep.d.ts +1 -1
- package/dist/components/FunCountdown/FunCountdown.css.d.ts +2 -0
- package/dist/components/FunDivider/FunDivider.d.ts +2 -2
- package/dist/components/FunNotification/FunNotification.d.ts +1 -1
- package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
- package/dist/components/FunPayments/FunPaymentMethods.d.ts +25 -5
- package/dist/components/FunTransactionSummary/FunTxSummaryComponents.d.ts +4 -5
- package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +6 -0
- package/dist/components/Icons/CopyDoublePaperSheetIcon.d.ts +5 -0
- package/dist/components/Icons/CopyDoubleRoundedSquareIcon.d.ts +5 -0
- package/dist/components/Icons/Gas.d.ts +4 -0
- package/dist/components/Icons/LightningBoltIcon.d.ts +2 -0
- package/dist/components/Icons/PaymentMethodIcons.d.ts +2 -5
- package/dist/components/QRCode/QRCode.d.ts +8 -1
- package/dist/css/sprinkles.css.d.ts +51 -43
- package/dist/domains/checkoutFees.d.ts +38 -0
- package/dist/{consts/payment.d.ts → domains/paymentMethods.d.ts} +7 -5
- package/dist/hooks/useCheckoutStateBooleans.d.ts +5 -1
- package/dist/hooks/useCheckoutTransferDepositAddress.d.ts +2 -0
- package/dist/hooks/useCheckoutType.d.ts +3 -3
- package/dist/hooks/useMesh.d.ts +4 -4
- package/dist/index.css +2382 -2086
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11266 -10688
- package/dist/modals/CheckoutModal/CheckoutPrimaryInfo.d.ts +1 -11
- package/dist/modals/CheckoutModal/ConfirmationStep.d.ts +1 -1
- package/dist/modals/CheckoutModal/ConnectExchange.d.ts +1 -1
- package/dist/modals/CheckoutModal/InputAmount.d.ts +1 -1
- package/dist/modals/CheckoutModal/LoadingAccount.d.ts +1 -1
- package/dist/modals/CheckoutModal/MeshVerification.d.ts +1 -1
- package/dist/modals/CheckoutModal/SelectAsset.d.ts +1 -1
- package/dist/modals/CheckoutModal/SelectBrokerage.d.ts +1 -1
- package/dist/modals/CheckoutModal/SelectPaymentMethod.d.ts +4 -1
- package/dist/modals/CheckoutModal/SourceChange.d.ts +1 -1
- package/dist/modals/CheckoutModal/TransferToken.d.ts +15 -0
- package/dist/modals/CheckoutModal/stepTransition.d.ts +9 -9
- package/dist/modals/CheckoutModal/useAccountBalancePostCheckout.d.ts +1 -2
- package/dist/modals/CheckoutModal/useAvailableBalanceForCheckout.d.ts +1 -1
- package/dist/modals/CheckoutModal/useSourceAssetConfirm.d.ts +1 -1
- package/dist/modals/ConnectModal/ConnectModal.d.ts +3 -1
- package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryContent.d.ts +3 -2
- package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.d.ts +8 -6
- package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryTransaction.css.d.ts +0 -1
- package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryTransaction.d.ts +5 -2
- package/dist/modals/FunCheckoutHistoryModal/FunCheckoutStatus.d.ts +2 -1
- package/dist/providers/FunkitCheckoutContext.d.ts +21 -3
- package/dist/providers/FunkitConfigContext.d.ts +13 -0
- package/dist/providers/FunkitThemeProvider.d.ts +16 -0
- package/dist/providers/GeneralWalletProvider.d.ts +12 -13
- package/dist/providers/ModalContext.d.ts +1 -1
- package/dist/providers/useAccountBalancePaymentDefaultInfo.d.ts +4 -0
- package/dist/themes/darkTheme.d.ts +4 -0
- package/dist/themes/darkTheme.js +1 -1
- package/dist/themes/lightTheme.d.ts +4 -0
- package/dist/themes/lightTheme.js +1 -1
- package/dist/utils/assets.d.ts +1 -1
- package/dist/utils/checkout.d.ts +4 -4
- package/dist/utils/formatNumber.d.ts +1 -0
- package/dist/utils/payment.d.ts +1 -1
- package/dist/wallets/walletConnectors/chunk-2EMZOYQI.js +101 -0
- package/dist/wallets/walletConnectors/chunk-5K4DIMYR.js +95 -0
- package/dist/wallets/walletConnectors/chunk-AUVBWDIK.js +102 -0
- package/dist/wallets/walletConnectors/chunk-AXPQHNUI.js +71 -0
- package/dist/wallets/walletConnectors/chunk-B7FHT3CB.js +94 -0
- package/dist/wallets/walletConnectors/chunk-EFIENLEE.js +98 -0
- package/dist/wallets/walletConnectors/chunk-FLTQRYFS.js +27 -0
- package/dist/wallets/walletConnectors/chunk-L7QI6PBN.js +108 -0
- package/dist/wallets/walletConnectors/chunk-QP2BIVXD.js +73 -0
- package/dist/wallets/walletConnectors/chunk-UWZQZY4S.js +149 -0
- package/dist/wallets/walletConnectors/chunk-UZEMNN3Q.js +96 -0
- package/dist/wallets/walletConnectors/index.js +34 -34
- package/package.json +4 -4
- package/dist/components/FunCallToAction/FunCallToAction.d.ts +0 -10
- package/dist/components/FunContainer/FunContainer.d.ts +0 -9
- package/dist/components/FunTransactionSummary/FunTransactionSummary.d.ts +0 -14
- package/dist/components/Icons/CopyDoubleIcon.d.ts +0 -2
- package/dist/consts/checkoutFees.d.ts +0 -27
- package/dist/modals/CheckoutModal/TransferSetup.d.ts +0 -14
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export declare function CheckoutPrimaryInfoSnapshot({ checkoutItem, isLoading, prioritizeDraftValue, preserveMinHeight, showTokenAmount, }: {
|
|
4
|
-
checkoutItem: FunkitActiveCheckoutItem;
|
|
5
|
-
isLoading: boolean;
|
|
6
|
-
prioritizeDraftValue: boolean;
|
|
7
|
-
preserveMinHeight?: boolean;
|
|
8
|
-
showTokenAmount?: boolean;
|
|
9
|
-
}): React.JSX.Element;
|
|
10
|
-
export declare function CheckoutPrimaryInfo({ checkoutId, prioritizeDraftValue, preserveMinHeight, showTokenAmount, }: {
|
|
2
|
+
export declare function CheckoutPrimaryInfo({ checkoutId, showTokenAmount, }: {
|
|
11
3
|
checkoutId: string;
|
|
12
|
-
prioritizeDraftValue: boolean;
|
|
13
|
-
preserveMinHeight?: boolean;
|
|
14
4
|
showTokenAmount?: boolean;
|
|
15
5
|
}): React.JSX.Element | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Address } from 'viem';
|
|
3
|
-
import { PaymentMethodInfo } from '../../
|
|
3
|
+
import { PaymentMethodInfo } from '../../domains/paymentMethods';
|
|
4
4
|
import { CheckoutModalCommonState, FunCheckoutStep, StateTransitionProps, StepTransition } from './stepTransition';
|
|
5
5
|
interface MoonpayDepositData {
|
|
6
6
|
depositToken: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PaymentMethodBrokerageInfo } from '../../
|
|
2
|
+
import { PaymentMethodBrokerageInfo } from '../../domains/paymentMethods';
|
|
3
3
|
import { MeshExchanges } from '../../utils/mesh';
|
|
4
4
|
import { CheckoutModalCommonState, FunCheckoutStep, StateTransitionProps, StepTransition } from './stepTransition';
|
|
5
5
|
export interface ConnectExchangeState extends CheckoutModalCommonState {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PaymentMethodInfo } from '../../
|
|
2
|
+
import { PaymentMethodInfo } from '../../domains/paymentMethods';
|
|
3
3
|
import { CheckoutModalCommonState, FunCheckoutStep, StateTransitionProps, StepTransition } from './stepTransition';
|
|
4
4
|
export interface InputAmountState extends CheckoutModalCommonState {
|
|
5
5
|
step: FunCheckoutStep.INPUT_AMOUNT;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PaymentMethod, PaymentMethodAccountInfo, PaymentMethodBrokerageInfo } from '../../
|
|
2
|
+
import { PaymentMethod, PaymentMethodAccountInfo, PaymentMethodBrokerageInfo } from '../../domains/paymentMethods';
|
|
3
3
|
import { CheckoutModalCommonState, FunCheckoutStep, StateTransitionProps, StepTransition } from './stepTransition';
|
|
4
4
|
export interface LoadingAccountState extends CheckoutModalCommonState {
|
|
5
5
|
step: FunCheckoutStep.LOADING_ACCOUNT;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Address } from 'viem';
|
|
3
|
-
import { PaymentMethodInfo } from '../../
|
|
3
|
+
import { PaymentMethodInfo } from '../../domains/paymentMethods';
|
|
4
4
|
import { CheckoutModalCommonState, FunCheckoutStep, StateTransitionProps, StepTransition } from './stepTransition';
|
|
5
5
|
export interface MeshVerificationState extends CheckoutModalCommonState {
|
|
6
6
|
step: FunCheckoutStep.MESH_VERIFICATION;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PaymentMethodAccountInfo, PaymentMethodBrokerageInfo } from '../../
|
|
2
|
+
import { PaymentMethodAccountInfo, PaymentMethodBrokerageInfo } from '../../domains/paymentMethods';
|
|
3
3
|
import { CheckoutModalCommonState, FunCheckoutStep, StateTransitionProps, StepTransition } from './stepTransition';
|
|
4
4
|
export interface SelectAssetState extends CheckoutModalCommonState {
|
|
5
5
|
step: FunCheckoutStep.SELECT_ASSET;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PaymentMethodBrokerageInfo } from '../../
|
|
2
|
+
import { PaymentMethodBrokerageInfo } from '../../domains/paymentMethods';
|
|
3
3
|
import { MeshExchanges } from '../../utils/mesh';
|
|
4
4
|
import { CheckoutModalCommonState, FunCheckoutStep, StateTransitionProps, StepTransition } from './stepTransition';
|
|
5
5
|
export interface SelectBrokerageState extends CheckoutModalCommonState {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UnionOmit } from 'viem';
|
|
3
|
-
import { PaymentMethod, PaymentMethodAccountInfo, PaymentMethodCardInfo } from '../../
|
|
3
|
+
import { PaymentMethod, PaymentMethodAccountInfo, PaymentMethodCardInfo } from '../../domains/paymentMethods';
|
|
4
4
|
import { CheckoutModalCommonState, FunCheckoutStep, StateTransitionProps, StepTransition } from './stepTransition';
|
|
5
5
|
export interface SelectPaymentMethodState extends CheckoutModalCommonState {
|
|
6
6
|
step: FunCheckoutStep.SELECT_PAYMENT_METHOD;
|
|
@@ -16,6 +16,9 @@ export type SelectPaymentMethodNext = {
|
|
|
16
16
|
step: FunCheckoutStep.SELECT_PAYMENT_METHOD;
|
|
17
17
|
paymentMethod: PaymentMethod.ACCOUNT_BALANCE;
|
|
18
18
|
paymentMethodInfo: PaymentMethodAccountInfo;
|
|
19
|
+
} | {
|
|
20
|
+
step: FunCheckoutStep.SELECT_PAYMENT_METHOD;
|
|
21
|
+
paymentMethod: PaymentMethod.TOKEN_TRANSFER;
|
|
19
22
|
};
|
|
20
23
|
export declare function selectPaymentMethodNext(state: SelectPaymentMethodState, payload: SelectPaymentMethodNext): StepTransition[FunCheckoutStep.SELECT_PAYMENT_METHOD];
|
|
21
24
|
type Props = StateTransitionProps<SelectPaymentMethodState, SelectPaymentMethodNext>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PaymentMethod, PaymentMethodAccountInfo, PaymentMethodBrokerageInfo, PaymentMethodCardInfo } from '../../
|
|
2
|
+
import { PaymentMethod, PaymentMethodAccountInfo, PaymentMethodBrokerageInfo, PaymentMethodCardInfo } from '../../domains/paymentMethods';
|
|
3
3
|
import { CheckoutModalCommonState, FunCheckoutStep, StateTransitionProps, StepTransition } from './stepTransition';
|
|
4
4
|
type ConnectablePaymentMethodInfo = PaymentMethodAccountInfo | PaymentMethodBrokerageInfo;
|
|
5
5
|
export interface SourceChangeState extends CheckoutModalCommonState {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PaymentMethodAccountInfo } from '../../domains/paymentMethods';
|
|
3
|
+
import { CheckoutModalCommonState, FunCheckoutStep, StateTransitionProps, StepTransition } from './stepTransition';
|
|
4
|
+
export interface TransferTokenState extends CheckoutModalCommonState {
|
|
5
|
+
step: FunCheckoutStep.TRANSFER_TOKEN;
|
|
6
|
+
}
|
|
7
|
+
export type TransferTokenNext = {
|
|
8
|
+
step: FunCheckoutStep.TRANSFER_TOKEN;
|
|
9
|
+
paymentMethodInfo: PaymentMethodAccountInfo;
|
|
10
|
+
isLoggedIn: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function transferTokenNext(state: TransferTokenState, payload: TransferTokenNext): StepTransition[FunCheckoutStep.TRANSFER_TOKEN];
|
|
13
|
+
type Props = StateTransitionProps<TransferTokenState, TransferTokenNext>;
|
|
14
|
+
export declare function TransferToken({ onBack, modalState }: Props): React.JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -11,7 +11,7 @@ import { SelectAssetNext, SelectAssetState } from './SelectAsset';
|
|
|
11
11
|
import { SelectBrokerageNext, SelectBrokerageState } from './SelectBrokerage';
|
|
12
12
|
import { SelectPaymentMethodNext, SelectPaymentMethodState } from './SelectPaymentMethod';
|
|
13
13
|
import { SourceChangeNext, SourceChangeState } from './SourceChange';
|
|
14
|
-
import {
|
|
14
|
+
import { TransferTokenNext, TransferTokenState } from './TransferToken';
|
|
15
15
|
export interface CheckoutModalCommonState {
|
|
16
16
|
checkoutId: string;
|
|
17
17
|
targetChainId: string;
|
|
@@ -26,7 +26,7 @@ export interface StateTransitionProps<T, N> {
|
|
|
26
26
|
onClose: () => void;
|
|
27
27
|
}
|
|
28
28
|
export declare function extractCommonState(state: CheckoutModalState): CheckoutModalCommonState;
|
|
29
|
-
type CheckoutModalState = LoadingAccountState | ConfirmationStepState | ConnectExchangeState | InputAmountState | SelectAssetState | SelectPaymentMethodState | SelectBrokerageState | SourceChangeState | MoonpaySetupState | MeshVerificationState | CheckoutCompleteState;
|
|
29
|
+
type CheckoutModalState = LoadingAccountState | ConfirmationStepState | ConnectExchangeState | InputAmountState | SelectAssetState | SelectPaymentMethodState | SelectBrokerageState | SourceChangeState | MoonpaySetupState | MeshVerificationState | CheckoutCompleteState | TransferTokenState;
|
|
30
30
|
export declare enum FunCheckoutStep {
|
|
31
31
|
LOADING_ACCOUNT = "loading_account",
|
|
32
32
|
INPUT_AMOUNT = "input_amount",
|
|
@@ -35,26 +35,26 @@ export declare enum FunCheckoutStep {
|
|
|
35
35
|
CONFIRMATION = "confirmation",
|
|
36
36
|
MOONPAY_SETUP = "payment_setup",
|
|
37
37
|
SELECT_BROKERAGE = "select_brokerage",
|
|
38
|
-
TRANSFER_SETUP = "transfer_setup",
|
|
39
38
|
CONNECT_EXCHANGE = "connect_exchange",
|
|
40
39
|
SELECT_ASSET = "select_asset",
|
|
41
40
|
MESH_VERIFICATION = "mesh_verification",
|
|
42
|
-
CHECKOUT_COMPLETE = "checkout_complete"
|
|
41
|
+
CHECKOUT_COMPLETE = "checkout_complete",
|
|
42
|
+
TRANSFER_TOKEN = "transfer_token"
|
|
43
43
|
}
|
|
44
44
|
export interface StepTransition {
|
|
45
|
-
[FunCheckoutStep.LOADING_ACCOUNT]: SelectPaymentMethodState | SelectAssetState;
|
|
45
|
+
[FunCheckoutStep.LOADING_ACCOUNT]: SelectPaymentMethodState | SelectAssetState | TransferTokenState;
|
|
46
46
|
[FunCheckoutStep.INPUT_AMOUNT]: ConfirmationStepState;
|
|
47
|
-
[FunCheckoutStep.SELECT_PAYMENT_METHOD]: SelectBrokerageState | InputAmountState | SelectAssetState;
|
|
47
|
+
[FunCheckoutStep.SELECT_PAYMENT_METHOD]: SelectBrokerageState | InputAmountState | SelectAssetState | TransferTokenState;
|
|
48
48
|
[FunCheckoutStep.CONFIRMATION]: MeshVerificationState | MoonpaySetupState | CheckoutCompleteState;
|
|
49
49
|
[FunCheckoutStep.MOONPAY_SETUP]: CheckoutCompleteState;
|
|
50
50
|
[FunCheckoutStep.SELECT_BROKERAGE]: ConnectExchangeState | SelectAssetState;
|
|
51
|
-
[FunCheckoutStep.TRANSFER_SETUP]: CheckoutModalState;
|
|
52
51
|
[FunCheckoutStep.CONNECT_EXCHANGE]: SelectAssetState;
|
|
53
52
|
[FunCheckoutStep.SELECT_ASSET]: InputAmountState | SourceChangeState | LoadingAccountState;
|
|
54
53
|
[FunCheckoutStep.MESH_VERIFICATION]: CheckoutCompleteState;
|
|
55
|
-
[FunCheckoutStep.SOURCE_CHANGE]: SelectAssetState | SelectBrokerageState | InputAmountState;
|
|
54
|
+
[FunCheckoutStep.SOURCE_CHANGE]: SelectAssetState | SelectBrokerageState | InputAmountState | TransferTokenState;
|
|
55
|
+
[FunCheckoutStep.TRANSFER_TOKEN]: TransferTokenState | SelectPaymentMethodState | SourceChangeState;
|
|
56
56
|
}
|
|
57
|
-
type NextPayload = LoadingAccountNext | ConfirmationStepNext | ConnectExchangeNext | InputAmountNext | MeshVerificationNext | MoonpaySetupNext |
|
|
57
|
+
type NextPayload = LoadingAccountNext | ConfirmationStepNext | ConnectExchangeNext | InputAmountNext | MeshVerificationNext | MoonpaySetupNext | SelectAssetNext | SelectPaymentMethodNext | SelectBrokerageNext | SourceChangeNext | TransferTokenNext | {
|
|
58
58
|
step: FunCheckoutStep.CHECKOUT_COMPLETE;
|
|
59
59
|
};
|
|
60
60
|
export declare function useCheckoutModalTransition(checkoutItem: FunkitActiveCheckoutItem, onClose: () => void): {
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { Address } from 'viem';
|
|
2
|
-
|
|
3
|
-
export declare function useAccountBalancePostCheckout(checkoutId: string, setPostCheckoutStepMessage: (s: string) => void, funkitConfig: ReturnType<typeof useFunkitConfig>): (depositAddress: Address) => Promise<void>;
|
|
2
|
+
export declare function useAccountBalancePostCheckout(checkoutId: string, setPostCheckoutStepMessage: (s: string) => void, apiKey: string): (depositAddress: Address) => Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PaymentMethodInfo } from '../../
|
|
1
|
+
import { PaymentMethodInfo } from '../../domains/paymentMethods';
|
|
2
2
|
import { QueryResult } from '../../types/utils';
|
|
3
3
|
import { AssetHoldingsItem } from '../../utils/assets';
|
|
4
4
|
export declare function useAvailableBalanceForCheckout(checkoutId: string, paymentMethodInfo: PaymentMethodInfo, targetChainId: string, assetChainId: string, assetSymbol: string | null): QueryResult<AssetHoldingsItem>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PaymentMethodInfo } from '../../
|
|
1
|
+
import { PaymentMethodInfo } from '../../domains/paymentMethods';
|
|
2
2
|
import { FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
|
|
3
3
|
export interface SourceAssetConfirmed {
|
|
4
4
|
isQuoteSuccess: boolean;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface ConnectModalProps {
|
|
3
|
+
/** Shows only a list of available wallets to connect (ignoring other web2 options) */
|
|
4
|
+
walletsOnly?: boolean;
|
|
3
5
|
open: boolean;
|
|
4
6
|
onClose: () => void;
|
|
5
7
|
}
|
|
6
|
-
export declare function ConnectModal({ onClose, open }: ConnectModalProps): React.JSX.Element | null;
|
|
8
|
+
export declare function ConnectModal({ onClose, open, walletsOnly, }: ConnectModalProps): React.JSX.Element | null;
|
|
@@ -5,8 +5,9 @@ interface FunCheckoutHistoryContentProps {
|
|
|
5
5
|
currentPage: HistoryContentPages;
|
|
6
6
|
setCurrentPage: Dispatch<SetStateAction<HistoryContentPages>>;
|
|
7
7
|
onBackFromHelpPage: () => void;
|
|
8
|
+
onClose: () => void;
|
|
8
9
|
}
|
|
9
|
-
export declare const
|
|
10
|
+
export declare const HISTORY_BOTTOM_BAR_ID = "history-bottom-section";
|
|
10
11
|
export declare const DEFAULT_CHECKOUT_HISTORY_DETAIL_TITLE = "Your Purchase";
|
|
11
|
-
export declare function FunCheckoutHistoryContent({ depositAddress, currentPage, setCurrentPage, onBackFromHelpPage, }: FunCheckoutHistoryContentProps): React.JSX.Element;
|
|
12
|
+
export declare function FunCheckoutHistoryContent({ depositAddress, currentPage, setCurrentPage, onBackFromHelpPage, onClose, }: FunCheckoutHistoryContentProps): React.JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { CheckoutHistoryItem } from '@funkit/api-base';
|
|
2
|
-
import React
|
|
3
|
-
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface FunCheckoutHistoryDetailProps {
|
|
4
|
+
checkoutHistoryInfo: CheckoutHistoryItem;
|
|
5
|
+
onHelp: () => void;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}
|
|
4
8
|
/**
|
|
5
9
|
* Processing info about a checkout history item (already created in backend)
|
|
6
10
|
*/
|
|
7
|
-
export declare function FunCheckoutHistoryDetail({ checkoutHistoryInfo,
|
|
8
|
-
|
|
9
|
-
setCurrentPage: Dispatch<SetStateAction<HistoryContentPages>>;
|
|
10
|
-
}): React.JSX.Element;
|
|
11
|
+
export declare function FunCheckoutHistoryDetail({ checkoutHistoryInfo, onHelp, onClose, }: FunCheckoutHistoryDetailProps): React.JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { CheckoutHistoryItem } from '@funkit/api-base';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
3
|
+
interface FunTxSummaryHistoryProps {
|
|
4
4
|
checkoutHistoryItem: CheckoutHistoryItem;
|
|
5
|
-
|
|
5
|
+
isDelayed?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function FunTxSummaryHistory({ checkoutHistoryItem, isDelayed, }: FunTxSummaryHistoryProps): React.JSX.Element;
|
|
6
8
|
export declare function OrderDetail({ checkoutHistoryItem, }: {
|
|
7
9
|
checkoutHistoryItem: CheckoutHistoryItem;
|
|
8
10
|
}): React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { CheckoutHistoryItem } from '@funkit/api-base';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
interface FunCheckoutStatusProps {
|
|
4
4
|
checkoutHistoryItem: CheckoutHistoryItem;
|
|
5
|
+
onOrderDelayed?: () => void;
|
|
5
6
|
}
|
|
6
|
-
export declare function FunCheckoutStatus({ checkoutHistoryItem, }: FunCheckoutStatusProps): React.JSX.Element;
|
|
7
|
+
export declare function FunCheckoutStatus({ checkoutHistoryItem, onOrderDelayed, }: FunCheckoutStatusProps): React.JSX.Element | null;
|
|
7
8
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CheckoutHistoryItem, CheckoutQuoteResponse } from '@funkit/api-base';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
3
|
import { Abi, Address } from 'viem';
|
|
4
|
-
import {
|
|
5
|
-
import { PaymentMethod, PaymentMethodInfo } from '../
|
|
4
|
+
import { CheckoutFees } from '../domains/checkoutFees';
|
|
5
|
+
import { PaymentMethod, PaymentMethodInfo } from '../domains/paymentMethods';
|
|
6
6
|
import { CheckoutHistoryStateMap } from '../utils/checkout';
|
|
7
7
|
import { PurifiedCheckoutHistoryItem } from '../utils/purifyCheckoutHistoryItem';
|
|
8
8
|
export interface FunkitCheckoutActionParams {
|
|
@@ -57,7 +57,7 @@ type FunkitCheckoutQuoteResult = {
|
|
|
57
57
|
finalTimeEstimationMs: number;
|
|
58
58
|
finalPaymentTokenAmount: string;
|
|
59
59
|
finalTotalUsd: string;
|
|
60
|
-
finalFeesBreakdown:
|
|
60
|
+
finalFeesBreakdown: CheckoutFees;
|
|
61
61
|
};
|
|
62
62
|
interface FunkitCheckoutValidationResult {
|
|
63
63
|
isValid: boolean;
|
|
@@ -126,6 +126,24 @@ export interface FunkitActiveCheckoutItem {
|
|
|
126
126
|
chainId: string;
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
|
+
export type ServerPaymentMethodInfo = Omit<PaymentMethodInfo, 'titleIcon' | 'descriptionIcon'>;
|
|
130
|
+
export type ServerCheckoutConfig = Omit<FunkitCheckoutConfig, 'generateActionsParams'> & {
|
|
131
|
+
generateActionsParams?: string;
|
|
132
|
+
};
|
|
133
|
+
/** Serializable data from FE checkout item */
|
|
134
|
+
export type HistoricalCheckoutItem = {
|
|
135
|
+
id: FunkitActiveCheckoutItem['id'];
|
|
136
|
+
startTimestampMs: FunkitActiveCheckoutItem['startTimestampMs'];
|
|
137
|
+
draftDollarValue: FunkitActiveCheckoutItem['draftDollarValue'];
|
|
138
|
+
finalDollarValue: FunkitActiveCheckoutItem['finalDollarValue'];
|
|
139
|
+
latestQuote: FunkitActiveCheckoutItem['latestQuote'];
|
|
140
|
+
depositAddress: FunkitActiveCheckoutItem['depositAddress'];
|
|
141
|
+
initSettings: {
|
|
142
|
+
config: ServerCheckoutConfig;
|
|
143
|
+
};
|
|
144
|
+
selectedSourceAssetInfo: FunkitActiveCheckoutItem['selectedSourceAssetInfo'];
|
|
145
|
+
selectedPaymentMethodInfo: ServerPaymentMethodInfo | null;
|
|
146
|
+
};
|
|
129
147
|
export declare function FunkitCheckoutProvider({ children }: {
|
|
130
148
|
children: ReactNode;
|
|
131
149
|
}): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { FunkitPrioritizedLoginType, FunkitSocialLoginMethod } from '../consts/funkit';
|
|
2
3
|
export interface FunkitTextCustomizationsConfig {
|
|
3
4
|
brokerageOrExchange: string;
|
|
@@ -5,11 +6,23 @@ export interface FunkitTextCustomizationsConfig {
|
|
|
5
6
|
accountBalance: string;
|
|
6
7
|
transferCrypto: string;
|
|
7
8
|
selectAccount: string;
|
|
9
|
+
transferTokens: string;
|
|
10
|
+
confirmationScreen: {
|
|
11
|
+
receiveAmountLabel: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface FunkitUiCustomRecipientConfig {
|
|
15
|
+
/** What icon (15x15) to show in the `destination` row - defaults to user wallet icon */
|
|
16
|
+
destinationIcon?: ReactNode;
|
|
17
|
+
/** What text to show in the `destination` row - defaults to formatted destination wallet address */
|
|
18
|
+
destinationText?: string;
|
|
8
19
|
}
|
|
9
20
|
export interface FunkitUiCustomizationsConfig {
|
|
10
21
|
confirmationScreen?: {
|
|
11
22
|
/** Whether to show the amount of tokens below the USD equivalent - defaults to true */
|
|
12
23
|
showTokenAmount?: boolean;
|
|
24
|
+
/** Configure UI when `customRecipient` is specified in the config */
|
|
25
|
+
customRecipientConfig?: FunkitUiCustomRecipientConfig;
|
|
13
26
|
};
|
|
14
27
|
inputAmountScreen?: {
|
|
15
28
|
/** Whether to allow entering an amount of tokens, rather than only USD - defaults to true */
|
|
@@ -11,6 +11,8 @@ export declare const defaultTheme: {
|
|
|
11
11
|
connectButtonTextError: string;
|
|
12
12
|
connectionIndicator: string;
|
|
13
13
|
error: string;
|
|
14
|
+
errorBackground: string;
|
|
15
|
+
errorBorder: string;
|
|
14
16
|
generalBorder: string;
|
|
15
17
|
generalBorderDim: string;
|
|
16
18
|
menuItemBackground: string;
|
|
@@ -28,6 +30,8 @@ export declare const defaultTheme: {
|
|
|
28
30
|
offBackground: string;
|
|
29
31
|
hoverState: string;
|
|
30
32
|
offBackgroundInverse: string;
|
|
33
|
+
lightStroke: string;
|
|
34
|
+
strokeColor: string;
|
|
31
35
|
dydxSwitchActiveBackground: string;
|
|
32
36
|
primaryText: string;
|
|
33
37
|
secondaryText: string;
|
|
@@ -163,6 +167,8 @@ export declare const useActiveTheme: () => {
|
|
|
163
167
|
connectButtonTextError: string;
|
|
164
168
|
connectionIndicator: string;
|
|
165
169
|
error: string;
|
|
170
|
+
errorBackground: string;
|
|
171
|
+
errorBorder: string;
|
|
166
172
|
generalBorder: string;
|
|
167
173
|
generalBorderDim: string;
|
|
168
174
|
menuItemBackground: string;
|
|
@@ -180,6 +186,8 @@ export declare const useActiveTheme: () => {
|
|
|
180
186
|
offBackground: string;
|
|
181
187
|
hoverState: string;
|
|
182
188
|
offBackgroundInverse: string;
|
|
189
|
+
lightStroke: string;
|
|
190
|
+
strokeColor: string;
|
|
183
191
|
dydxSwitchActiveBackground: string;
|
|
184
192
|
primaryText: string;
|
|
185
193
|
secondaryText: string;
|
|
@@ -303,6 +311,8 @@ export declare const useActiveTheme: () => {
|
|
|
303
311
|
connectButtonTextError: string;
|
|
304
312
|
connectionIndicator: string;
|
|
305
313
|
error: string;
|
|
314
|
+
errorBackground: string;
|
|
315
|
+
errorBorder: string;
|
|
306
316
|
generalBorder: string;
|
|
307
317
|
generalBorderDim: string;
|
|
308
318
|
menuItemBackground: string;
|
|
@@ -320,6 +330,8 @@ export declare const useActiveTheme: () => {
|
|
|
320
330
|
offBackground: string;
|
|
321
331
|
hoverState: string;
|
|
322
332
|
offBackgroundInverse: string;
|
|
333
|
+
lightStroke: string;
|
|
334
|
+
strokeColor: string;
|
|
323
335
|
dydxSwitchActiveBackground: string;
|
|
324
336
|
primaryText: string;
|
|
325
337
|
secondaryText: string;
|
|
@@ -442,6 +454,8 @@ export declare const useActiveTheme: () => {
|
|
|
442
454
|
connectButtonTextError: string;
|
|
443
455
|
connectionIndicator: string;
|
|
444
456
|
error: string;
|
|
457
|
+
errorBackground: string;
|
|
458
|
+
errorBorder: string;
|
|
445
459
|
generalBorder: string;
|
|
446
460
|
generalBorderDim: string;
|
|
447
461
|
menuItemBackground: string;
|
|
@@ -459,6 +473,8 @@ export declare const useActiveTheme: () => {
|
|
|
459
473
|
offBackground: string;
|
|
460
474
|
hoverState: string;
|
|
461
475
|
offBackgroundInverse: string;
|
|
476
|
+
lightStroke: string;
|
|
477
|
+
strokeColor: string;
|
|
462
478
|
dydxSwitchActiveBackground: string;
|
|
463
479
|
primaryText: string;
|
|
464
480
|
secondaryText: string;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { AssetBalanceInfo } from '@funkit/api-base';
|
|
2
2
|
import { Auth, FunWallet } from '@funkit/core';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { Address } from 'viem';
|
|
4
5
|
import { FunkitUserInfo } from '../consts/funkit';
|
|
5
|
-
import { PaymentMethodAccountInfo } from '../consts/payment';
|
|
6
6
|
export interface KnownAssetBalanceInfo extends AssetBalanceInfo {
|
|
7
7
|
price: number;
|
|
8
8
|
totalUsdValue: number;
|
|
9
9
|
}
|
|
10
10
|
interface GeneralWalletContextProps {
|
|
11
|
-
walletAddress:
|
|
12
|
-
accountBalancePaymentDefaultInfo: PaymentMethodAccountInfo | null;
|
|
11
|
+
walletAddress: Address | '';
|
|
13
12
|
isUserLoggedIn: boolean;
|
|
14
13
|
isWeb2Login: boolean;
|
|
15
14
|
isWeb3Login: boolean;
|
|
@@ -25,7 +24,7 @@ export declare const useGeneralWallet: () => GeneralWalletContextProps;
|
|
|
25
24
|
* Replacement for wagmi's `useAccount`
|
|
26
25
|
*/
|
|
27
26
|
export declare const useFunkitAccount: () => {
|
|
28
|
-
account: string
|
|
27
|
+
account: "" | `0x${string}`;
|
|
29
28
|
isConnected: boolean;
|
|
30
29
|
isWeb2Login: boolean;
|
|
31
30
|
isWeb3Login: boolean;
|
|
@@ -39,12 +38,12 @@ export declare const useFunkitAccount: () => {
|
|
|
39
38
|
isDisconnected: true;
|
|
40
39
|
status: "disconnected";
|
|
41
40
|
} | {
|
|
42
|
-
account: string
|
|
41
|
+
account: "" | `0x${string}`;
|
|
43
42
|
isConnected: boolean;
|
|
44
43
|
isWeb2Login: boolean;
|
|
45
44
|
isWeb3Login: boolean;
|
|
46
|
-
address:
|
|
47
|
-
addresses: readonly [
|
|
45
|
+
address: Address;
|
|
46
|
+
addresses: readonly [Address, ...Address[]];
|
|
48
47
|
chain: import("viem").Chain | undefined;
|
|
49
48
|
chainId: number;
|
|
50
49
|
connector: import("wagmi").Connector;
|
|
@@ -53,12 +52,12 @@ export declare const useFunkitAccount: () => {
|
|
|
53
52
|
isReconnecting: false;
|
|
54
53
|
status: "connected";
|
|
55
54
|
} | {
|
|
56
|
-
account: string
|
|
55
|
+
account: "" | `0x${string}`;
|
|
57
56
|
isConnected: boolean;
|
|
58
57
|
isWeb2Login: boolean;
|
|
59
58
|
isWeb3Login: boolean;
|
|
60
|
-
address:
|
|
61
|
-
addresses: readonly
|
|
59
|
+
address: Address | undefined;
|
|
60
|
+
addresses: readonly Address[] | undefined;
|
|
62
61
|
chain: import("viem").Chain | undefined;
|
|
63
62
|
chainId: number | undefined;
|
|
64
63
|
connector: import("wagmi").Connector | undefined;
|
|
@@ -67,12 +66,12 @@ export declare const useFunkitAccount: () => {
|
|
|
67
66
|
isReconnecting: true;
|
|
68
67
|
status: "reconnecting";
|
|
69
68
|
} | {
|
|
70
|
-
account: string
|
|
69
|
+
account: "" | `0x${string}`;
|
|
71
70
|
isConnected: boolean;
|
|
72
71
|
isWeb2Login: boolean;
|
|
73
72
|
isWeb3Login: boolean;
|
|
74
|
-
address:
|
|
75
|
-
addresses: readonly
|
|
73
|
+
address: Address | undefined;
|
|
74
|
+
addresses: readonly Address[] | undefined;
|
|
76
75
|
chain: import("viem").Chain | undefined;
|
|
77
76
|
chainId: number | undefined;
|
|
78
77
|
connector: import("wagmi").Connector | undefined;
|
|
@@ -23,7 +23,7 @@ export declare function useWalletConnectOpenState(): {
|
|
|
23
23
|
};
|
|
24
24
|
export declare function useConnectModal(): {
|
|
25
25
|
connectModalOpen: boolean;
|
|
26
|
-
openConnectModal: (() => void) | undefined;
|
|
26
|
+
openConnectModal: ((walletsOnly?: boolean) => void) | undefined;
|
|
27
27
|
};
|
|
28
28
|
export declare function useFunCheckoutModal(): {
|
|
29
29
|
funCheckoutModalOpen: boolean;
|
|
@@ -11,6 +11,8 @@ export declare const darkTheme: {
|
|
|
11
11
|
connectButtonTextError: string;
|
|
12
12
|
connectionIndicator: string;
|
|
13
13
|
error: string;
|
|
14
|
+
errorBackground: string;
|
|
15
|
+
errorBorder: string;
|
|
14
16
|
generalBorder: string;
|
|
15
17
|
generalBorderDim: string;
|
|
16
18
|
menuItemBackground: string;
|
|
@@ -28,6 +30,8 @@ export declare const darkTheme: {
|
|
|
28
30
|
offBackground: string;
|
|
29
31
|
hoverState: string;
|
|
30
32
|
offBackgroundInverse: string;
|
|
33
|
+
lightStroke: string;
|
|
34
|
+
strokeColor: string;
|
|
31
35
|
dydxSwitchActiveBackground: string;
|
|
32
36
|
primaryText: string;
|
|
33
37
|
secondaryText: string;
|
package/dist/themes/darkTheme.js
CHANGED
|
@@ -11,6 +11,8 @@ export declare const lightTheme: {
|
|
|
11
11
|
connectButtonTextError: string;
|
|
12
12
|
connectionIndicator: string;
|
|
13
13
|
error: string;
|
|
14
|
+
errorBackground: string;
|
|
15
|
+
errorBorder: string;
|
|
14
16
|
generalBorder: string;
|
|
15
17
|
generalBorderDim: string;
|
|
16
18
|
menuItemBackground: string;
|
|
@@ -28,6 +30,8 @@ export declare const lightTheme: {
|
|
|
28
30
|
offBackground: string;
|
|
29
31
|
hoverState: string;
|
|
30
32
|
offBackgroundInverse: string;
|
|
33
|
+
lightStroke: string;
|
|
34
|
+
strokeColor: string;
|
|
31
35
|
dydxSwitchActiveBackground: string;
|
|
32
36
|
primaryText: string;
|
|
33
37
|
secondaryText: string;
|
package/dist/utils/assets.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PaymentMethod } from '../
|
|
1
|
+
import { PaymentMethod } from '../domains/paymentMethods';
|
|
2
2
|
import { FunkitActiveCheckoutItem, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
|
|
3
3
|
import { FlagValues } from '../providers/FunkitFlagsProvider';
|
|
4
4
|
export declare const getNormalizedTokenBalance: (tokenBalance: bigint | number, decimals: number) => number;
|
package/dist/utils/checkout.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CheckoutHistoryItem, CheckoutState } from '@funkit/api-base';
|
|
2
2
|
import { Address, Hex } from 'viem';
|
|
3
3
|
import { UseConfigReturnType } from 'wagmi';
|
|
4
|
-
import { PaymentMethod } from '../
|
|
5
|
-
import { FunkitActiveCheckoutItem, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
|
|
4
|
+
import { PaymentMethod } from '../domains/paymentMethods';
|
|
5
|
+
import { FunkitActiveCheckoutItem, FunkitCheckoutConfig, HistoricalCheckoutItem, ServerCheckoutConfig } from '../providers/FunkitCheckoutContext';
|
|
6
6
|
export declare const MOONPAY_TIME_ESTIMATE_MS = 120000;
|
|
7
7
|
export declare const MESH_TIME_ESTIMATE_MS = 300000;
|
|
8
8
|
export declare const DUMMY_TRANSFER_PARAMS: {
|
|
@@ -109,7 +109,7 @@ export declare function categorizeCheckoutHistories(checkoutHistoryList: Checkou
|
|
|
109
109
|
export declare function getCheckoutStateStepNumber(state: CheckoutState): 0 | 1 | 3 | 2;
|
|
110
110
|
export declare function formatTokenAmountForMoonpay(amount: number, mpCurrencyCode: string): string;
|
|
111
111
|
export declare function hackTimeEstimationForImportantCustomer(originalTimeEstimation: number, paymentMethod: PaymentMethod, apiKey: string): any;
|
|
112
|
-
export declare function getEstimateEndTimeInfo(createdTimeMs: number, checkoutItem: FunkitActiveCheckoutItem, apiKey: string): {
|
|
112
|
+
export declare function getEstimateEndTimeInfo(createdTimeMs: number, checkoutItem: FunkitActiveCheckoutItem | HistoricalCheckoutItem, apiKey: string): {
|
|
113
113
|
estimatedEndTimeMs: number;
|
|
114
114
|
estimatedEndTimeFromNowMs: number;
|
|
115
115
|
isExceededEstimation: boolean;
|
|
@@ -121,4 +121,4 @@ export declare function getEstimateEndTimeInfo(createdTimeMs: number, checkoutIt
|
|
|
121
121
|
* Basic buy checkouts: Display the targetAssetAmount with the targetAssetTicker.
|
|
122
122
|
* - e.g. "0.12345 ETH"
|
|
123
123
|
*/
|
|
124
|
-
export declare function getCheckoutItemDisplay(checkoutConfig: FunkitCheckoutConfig, hideAmount?: boolean): string;
|
|
124
|
+
export declare function getCheckoutItemDisplay(checkoutConfig: FunkitCheckoutConfig | ServerCheckoutConfig, hideAmount?: boolean): string;
|
|
@@ -36,6 +36,7 @@ export declare function formatCurrencyAndStringify(amount: number,
|
|
|
36
36
|
options?: FormatNumberOptions,
|
|
37
37
|
/** Options to pass toLocaleString */
|
|
38
38
|
numberFormatOptions?: Intl.NumberFormatOptions): string;
|
|
39
|
+
export declare function formatPercent(percent: number): string;
|
|
39
40
|
/**
|
|
40
41
|
* Formats a cryptocurrency amount as a string for display.
|
|
41
42
|
*
|
package/dist/utils/payment.d.ts
CHANGED