@funkit/connect 3.2.0 → 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 +23 -0
- package/README.md +0 -10
- 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/consts/customers.d.ts +1 -0
- 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 +11351 -10742
- 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 +5 -3
- 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 +40 -40
- 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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CheckoutQuoteResponse } from '@funkit/api-base';
|
|
2
|
+
import type { Config } from 'wagmi';
|
|
3
|
+
import { PaymentMethod, PaymentMethodInfo } from '../domains/paymentMethods';
|
|
4
|
+
import { FunkitActiveCheckoutItem } from '../providers/FunkitCheckoutContext';
|
|
5
|
+
interface BaseCheckoutFees {
|
|
6
|
+
paymentMethod: PaymentMethod;
|
|
7
|
+
marketMakerFeeUsd: number;
|
|
8
|
+
liquidityProviderFeePercentage: number;
|
|
9
|
+
totalFeesUsd: number;
|
|
10
|
+
totalFeesToken: number;
|
|
11
|
+
}
|
|
12
|
+
interface WalletCheckoutFees extends BaseCheckoutFees {
|
|
13
|
+
paymentMethod: PaymentMethod.ACCOUNT_BALANCE;
|
|
14
|
+
eoaWalletFeeToken: number;
|
|
15
|
+
eoaWalletFeeUsd: number;
|
|
16
|
+
}
|
|
17
|
+
interface CardCheckoutFees extends BaseCheckoutFees {
|
|
18
|
+
paymentMethod: PaymentMethod.CARD;
|
|
19
|
+
cardProcessingFeeUsd: number;
|
|
20
|
+
moonpayCostUsd: number;
|
|
21
|
+
}
|
|
22
|
+
interface BrokerageCheckoutFees extends BaseCheckoutFees {
|
|
23
|
+
paymentMethod: PaymentMethod.BROKERAGE;
|
|
24
|
+
exchangeFeeUsd: number;
|
|
25
|
+
meshCostUsd: number;
|
|
26
|
+
}
|
|
27
|
+
export type CheckoutFees = WalletCheckoutFees | CardCheckoutFees | BrokerageCheckoutFees;
|
|
28
|
+
export declare const GAS_ESTIMATE_MULTIPLER = 1.2;
|
|
29
|
+
interface EvaluateFeeBreakdownItem {
|
|
30
|
+
baseQuote: CheckoutQuoteResponse;
|
|
31
|
+
selectedSourceAssetInfo: FunkitActiveCheckoutItem['selectedSourceAssetInfo'];
|
|
32
|
+
newPaymentMethodInfo: PaymentMethodInfo;
|
|
33
|
+
wagmiConfig: Config;
|
|
34
|
+
apiKey: string;
|
|
35
|
+
isWeb3Login: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function evaluateFeeBreakdown(evalItem: EvaluateFeeBreakdownItem): Promise<CheckoutFees>;
|
|
38
|
+
export {};
|
|
@@ -5,12 +5,11 @@ import { ReactNode } from 'react';
|
|
|
5
5
|
export declare enum PaymentMethod {
|
|
6
6
|
/** Moonpay - Credit / Debit Card **/
|
|
7
7
|
CARD = "card",
|
|
8
|
-
/** Direct Transfer: used in polymarket **/
|
|
9
|
-
TRANSFER = "transfer",
|
|
10
8
|
/** Account Balance **/
|
|
11
9
|
ACCOUNT_BALANCE = "balance",
|
|
12
10
|
/** Mesh - Exchange / Brokerage **/
|
|
13
|
-
BROKERAGE = "brokerage"
|
|
11
|
+
BROKERAGE = "brokerage",
|
|
12
|
+
TOKEN_TRANSFER = "token_transfer"
|
|
14
13
|
}
|
|
15
14
|
type PaymentMethodInfoMeta = LinkPayload & {
|
|
16
15
|
checkoutMeshNetworkId?: string;
|
|
@@ -21,7 +20,7 @@ type PaymentMethodInfoMeta = LinkPayload & {
|
|
|
21
20
|
export interface PaymentMethodInfo {
|
|
22
21
|
paymentMethod: PaymentMethod;
|
|
23
22
|
title: string;
|
|
24
|
-
titleIcon: ReactNode;
|
|
23
|
+
titleIcon: (size: number) => ReactNode;
|
|
25
24
|
description: string;
|
|
26
25
|
descriptionIcon?: ReactNode;
|
|
27
26
|
meta: PaymentMethodInfoMeta;
|
|
@@ -35,11 +34,14 @@ export interface PaymentMethodBrokerageInfo extends PaymentMethodInfo {
|
|
|
35
34
|
export interface PaymentMethodAccountInfo extends PaymentMethodInfo {
|
|
36
35
|
paymentMethod: PaymentMethod.ACCOUNT_BALANCE;
|
|
37
36
|
}
|
|
37
|
+
export interface PaymentMethodTransferTokenInfo extends PaymentMethodInfo {
|
|
38
|
+
paymentMethod: PaymentMethod.TOKEN_TRANSFER;
|
|
39
|
+
}
|
|
38
40
|
/** Shouldn't be used generally. Will most likely be removed once checkoutItem usage is reduced */
|
|
39
41
|
export declare const getPartialPaymentMethodInfo: <T extends PaymentMethodInfo>(paymentMethod: T["paymentMethod"]) => {
|
|
40
42
|
paymentMethod: T["paymentMethod"];
|
|
41
43
|
title: string;
|
|
42
|
-
titleIcon: null;
|
|
44
|
+
titleIcon: () => null;
|
|
43
45
|
description: string;
|
|
44
46
|
descriptionIcon: null;
|
|
45
47
|
meta: {};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { CheckoutState } from '@funkit/api-base';
|
|
2
|
-
export
|
|
2
|
+
export type CheckoutStatus = 'failed' | 'expired' | 'processing' | 'completed';
|
|
3
|
+
type CheckoutStateBooleans = {
|
|
3
4
|
isProcessing: boolean;
|
|
4
5
|
isCompleted: boolean;
|
|
5
6
|
isError: boolean;
|
|
6
7
|
isExpired: boolean;
|
|
7
8
|
isFailed: boolean;
|
|
8
9
|
isTerminal: boolean;
|
|
10
|
+
status: CheckoutStatus;
|
|
9
11
|
};
|
|
12
|
+
export declare function useCheckoutStateBooleans(checkoutState: CheckoutState): CheckoutStateBooleans;
|
|
13
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FunkitActiveCheckoutItem, FunkitCheckoutActionParams, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
|
|
2
|
-
export declare function evaluateCheckoutGenerateActionsParams(config: FunkitCheckoutConfig): FunkitCheckoutActionParams[];
|
|
1
|
+
import { FunkitActiveCheckoutItem, FunkitCheckoutActionParams, FunkitCheckoutConfig, ServerCheckoutConfig } from '../providers/FunkitCheckoutContext';
|
|
2
|
+
export declare function evaluateCheckoutGenerateActionsParams(config: FunkitCheckoutConfig | ServerCheckoutConfig): FunkitCheckoutActionParams[];
|
|
3
3
|
export declare function isCheckoutCrFlow(checkoutItem: FunkitActiveCheckoutItem): boolean;
|
|
4
4
|
export declare function isCheckoutDirectCrFlow(checkoutItem: FunkitActiveCheckoutItem): boolean;
|
|
5
|
-
export declare function isCheckoutPostActionRequired(config: FunkitCheckoutConfig): boolean;
|
|
5
|
+
export declare function isCheckoutPostActionRequired(config: FunkitCheckoutConfig | ServerCheckoutConfig): boolean;
|
package/dist/hooks/useMesh.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { LinkPayload } from '@meshconnect/web-link-sdk';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
3
|
import { FunSelectOption } from '../components/FunSelect/FunSelect';
|
|
4
|
-
import { PaymentMethodBrokerageInfo } from '../
|
|
4
|
+
import { PaymentMethodBrokerageInfo } from '../domains/paymentMethods';
|
|
5
5
|
import { MeshExchanges } from '../utils/mesh';
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const MESH_EXCHANGE_ICON_MAP: Partial<Record<MeshExchanges, (size: number) => ReactNode>>;
|
|
7
|
+
export declare function getExchangeIcon(exchange: MeshExchanges, size: number): React.ReactNode;
|
|
7
8
|
export declare const useSupportedExchanges: () => MeshExchanges[];
|
|
8
9
|
export declare function getExchangeName(exchange: MeshExchanges): string;
|
|
10
|
+
export declare const preparePaymentInfo: (meshMeta: LinkPayload, brokerage: MeshExchanges) => PaymentMethodBrokerageInfo;
|
|
9
11
|
export declare const useMeshExchanges: ({ fullInfo, iconSize, }: {
|
|
10
12
|
fullInfo?: boolean;
|
|
11
13
|
iconSize?: number;
|
|
12
14
|
}) => {
|
|
13
15
|
options: FunSelectOption[];
|
|
14
|
-
preparePaymentInfo: (meshMeta: LinkPayload, brokerage: MeshExchanges) => PaymentMethodBrokerageInfo;
|
|
15
|
-
getIcon: (brokerage: MeshExchanges) => React.ReactNode;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* Fetches mesh-related network information across all chains, given an exchange
|