@funkit/connect 4.0.2 → 4.1.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 +56 -0
- package/dist/{chunk-3F3EYDDR.js → chunk-5BMBHTAR.js} +2 -9
- package/dist/{chunk-OMAXDH7G.js → chunk-REN4AGZZ.js} +0 -2
- package/dist/{chunk-LTOE4GIY.js → chunk-TO3BYKDH.js} +2 -9
- package/dist/components/Box/Box.d.ts +52 -52
- package/dist/components/FunButton/FunButton.css.d.ts +1 -0
- package/dist/components/FunCountdown/FunCountdown.d.ts +2 -1
- package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
- package/dist/components/FunPayments/FunPaymentMethods.d.ts +2 -1
- package/dist/components/FunTransactionSummary/FunTxSummaryComponents.d.ts +0 -5
- package/dist/components/FunTransactionSummary/PaymentFeesSummary.css.d.ts +2 -0
- package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +6 -4
- package/dist/components/HelpAlert/HelpAlert.d.ts +6 -0
- package/dist/config/getDefaultConfig.d.ts +34 -34
- package/dist/consts/customers.d.ts +2 -0
- package/dist/consts/funkit.d.ts +0 -1
- package/dist/css/sprinkles.css.d.ts +54 -84
- package/dist/domains/checkoutFees.d.ts +1 -1
- package/dist/domains/paymentMethods.d.ts +7 -9
- package/dist/domains/quote.d.ts +2 -6
- package/dist/hooks/useFunkitMaxCheckoutUsdInfo.d.ts +25 -0
- package/dist/hooks/useMesh.d.ts +2 -2
- package/dist/hooks/useMountEffect.d.ts +8 -0
- package/dist/index.css +1917 -2399
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8770 -8396
- package/dist/modals/CheckoutModal/ConfirmationStep/CheckoutPrimaryInfo.d.ts +7 -2
- package/dist/modals/CheckoutModal/ConfirmationStep/ConfirmationStep.d.ts +1 -0
- package/dist/modals/CheckoutModal/ConfirmationStep/DisclaimerText.d.ts +7 -0
- package/dist/modals/CheckoutModal/{InputAmount → ConfirmationStep}/useCheckoutQuote.d.ts +3 -4
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +6 -0
- package/dist/modals/CheckoutModal/stepTransition.d.ts +1 -0
- package/dist/modals/CheckoutModal/useSourceAssetConfirm.d.ts +5 -1
- package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryTransaction.css.d.ts +1 -0
- package/dist/modals/ProfileDetails/FunProfileViews/Home/Home.css.d.ts +1 -0
- package/dist/providers/FunkitCheckoutContext.d.ts +3 -11
- package/dist/providers/FunkitConfigContext.d.ts +0 -7
- package/dist/providers/FunkitHistoryContext.d.ts +1 -1
- package/dist/providers/FunkitMeshProvider.d.ts +11 -15
- package/dist/providers/FunkitThemeProvider.d.ts +3 -48
- package/dist/providers/GeneralWalletProvider.d.ts +8 -8
- package/dist/providers/ModalContext.d.ts +0 -4
- package/dist/providers/UserPresenceContext.d.ts +9 -0
- package/dist/scroll-G3S4ZVYZ.js +7 -0
- package/dist/themes/baseTheme.js +1 -1
- package/dist/themes/darkTheme.js +2 -2
- package/dist/themes/lightTheme.js +2 -2
- package/dist/types/utils.d.ts +0 -6
- package/dist/utils/checkout.d.ts +13 -40
- package/dist/utils/checkoutHistory.d.ts +7 -0
- package/dist/utils/flags/config.d.ts +23 -1
- package/dist/utils/mesh.d.ts +3 -2
- package/dist/wallets/groupedWallets.d.ts +0 -1
- package/dist/wallets/latestWalletId.d.ts +0 -2
- 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 +65 -65
- 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/FunButton/FunViewTxButton.d.ts +0 -5
- package/dist/components/FunNotification/FunCheckoutNotification.d.ts +0 -7
- package/dist/components/FunProgressBar/FunHorizontalStepper.d.ts +0 -7
- package/dist/hooks/useChainId.d.ts +0 -1
- package/dist/hooks/useCheckoutChains.d.ts +0 -1
- package/dist/hooks/useCheckoutType.d.ts +0 -5
- package/dist/hooks/useWindowSize.d.ts +0 -4
- package/dist/modals/CheckoutModal/useCheckoutQuote.d.ts +0 -7
- package/dist/modals/DevTest/FunDevTestModal.d.ts +0 -6
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { PreviewTransferResult } from '@funkit/api-base';
|
|
2
|
-
import type {
|
|
3
|
-
import { type MeshExchangeType } from '~/consts/mesh';
|
|
2
|
+
import type { MeshConnectionInfo } from '~/providers/FunkitMeshProvider';
|
|
4
3
|
/** Supported payment methods in FunkitConnect. **/
|
|
5
4
|
export declare enum PaymentMethod {
|
|
6
5
|
/** Moonpay - Credit / Debit Card **/
|
|
@@ -11,10 +10,11 @@ export declare enum PaymentMethod {
|
|
|
11
10
|
BROKERAGE = "brokerage",
|
|
12
11
|
TOKEN_TRANSFER = "token_transfer"
|
|
13
12
|
}
|
|
14
|
-
type MeshMeta =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
type MeshMeta = MeshConnectionInfo & {
|
|
14
|
+
networkId?: string;
|
|
15
|
+
previewResult?: PreviewTransferResult & {
|
|
16
|
+
previewExpiresAt: number;
|
|
17
|
+
};
|
|
18
18
|
};
|
|
19
19
|
/** Full payment method information used in frontend during payment flows. **/
|
|
20
20
|
interface PaymentMethodInfoBase {
|
|
@@ -27,7 +27,6 @@ export interface PaymentMethodCardInfo extends PaymentMethodInfoBase {
|
|
|
27
27
|
}
|
|
28
28
|
export interface PaymentMethodBrokerageInfo extends PaymentMethodInfoBase {
|
|
29
29
|
paymentMethod: PaymentMethod.BROKERAGE;
|
|
30
|
-
brokerType: MeshExchangeType;
|
|
31
30
|
meta: MeshMeta;
|
|
32
31
|
}
|
|
33
32
|
export interface PaymentMethodAccountInfo extends PaymentMethodInfoBase {
|
|
@@ -48,8 +47,7 @@ interface AccountPaymentMethodParams {
|
|
|
48
47
|
}
|
|
49
48
|
interface BrokeragePaymentMethodParams {
|
|
50
49
|
paymentMethod: PaymentMethod.BROKERAGE;
|
|
51
|
-
|
|
52
|
-
meshMeta: LinkPayload;
|
|
50
|
+
connection: MeshConnectionInfo;
|
|
53
51
|
}
|
|
54
52
|
interface TokenTransferPaymentMethodParams {
|
|
55
53
|
paymentMethod: PaymentMethod.TOKEN_TRANSFER;
|
package/dist/domains/quote.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface FunkitCheckoutQuoteResult extends Omit<ApiFunkitCheckoutQuoteRe
|
|
|
10
10
|
finalFeesBreakdown: CheckoutFees;
|
|
11
11
|
}
|
|
12
12
|
export declare function getCheckoutBaseQuote(checkoutItem: FunkitActiveCheckoutItem, userId: string, walletAddress: Address, apiKey: string, sponsorInitialTransferGasLimit: number, wagmiConfig: Config): Promise<CheckoutQuoteResponse>;
|
|
13
|
-
export declare function getQuoteFinalEstimation(baseQuote: CheckoutQuoteResponse, checkoutItem: FunkitActiveCheckoutItem, newPaymentMethodInfo: PaymentMethodInfo, wagmiConfig: Config, apiKey: string, loginType: LoginType): Promise<FunkitCheckoutQuoteResult>;
|
|
13
|
+
export declare function getQuoteFinalEstimation(baseQuote: CheckoutQuoteResponse, checkoutItem: FunkitActiveCheckoutItem, newPaymentMethodInfo: PaymentMethodInfo, wagmiConfig: Config, apiKey: string, loginType: LoginType, enableFrogProxyServer?: boolean): Promise<FunkitCheckoutQuoteResult>;
|
|
14
14
|
export declare function getAvailableAssetAmount(checkoutItem: FunkitActiveCheckoutItem, newPaymentMethodInfo: PaymentMethodInfo, finalEstimation: FunkitCheckoutQuoteResult, wagmiConfig: Config, walletAddress: Address): Promise<number | undefined>;
|
|
15
15
|
export interface CheckoutQuoteParams {
|
|
16
16
|
checkoutItem: FunkitActiveCheckoutItem;
|
|
@@ -21,9 +21,5 @@ export interface CheckoutQuoteParams {
|
|
|
21
21
|
newPaymentMethodInfo: PaymentMethodInfo;
|
|
22
22
|
wagmiConfig: Config;
|
|
23
23
|
loginType: LoginType;
|
|
24
|
+
enableFrogProxyServer?: boolean;
|
|
24
25
|
}
|
|
25
|
-
export declare function getQuoteAndEstimation({ checkoutItem, userId, walletAddress, apiKey, sponsorInitialTransferGasLimit, newPaymentMethodInfo, wagmiConfig, loginType, }: CheckoutQuoteParams): Promise<{
|
|
26
|
-
baseQuote: CheckoutQuoteResponse;
|
|
27
|
-
finalEstimation: FunkitCheckoutQuoteResult;
|
|
28
|
-
availableAssetAmount: number | undefined;
|
|
29
|
-
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retrieves the maximum checkout amount in USD and formats the limit text.
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
* This hook uses a feature flag to determine the maximum checkout amount.
|
|
6
|
+
* If the amount is Number.MAX_VALUE, it returns 'no' as the limit text.
|
|
7
|
+
* Otherwise, it formats the amount as a currency string with specific formatting options.
|
|
8
|
+
*
|
|
9
|
+
* @returns {Object} An object containing:
|
|
10
|
+
* - `value`: The maximum checkout amount in USD (number). Defaults to Number.MAX_VALUE.
|
|
11
|
+
* - `limitLabel`: A formatted string representing the checkout limit
|
|
12
|
+
* - Returns 'no' if the limit is Number.MAX_VALUE (default)
|
|
13
|
+
* - Otherwise, returns a formatted currency string (e.g., '$1k')
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Example usage in a component
|
|
17
|
+
* const { value, limitLabel } = useFunkitMaxCheckoutUsd();
|
|
18
|
+
* console.log(value); // e.g., 1000
|
|
19
|
+
* console.log(limitLabel); // e.g., '$1k'
|
|
20
|
+
* console.log(limitLabel); // e.g., 'no'
|
|
21
|
+
*/
|
|
22
|
+
export declare const useFunkitMaxCheckoutUsdInfo: () => {
|
|
23
|
+
value: number;
|
|
24
|
+
limitLabel: string;
|
|
25
|
+
};
|
package/dist/hooks/useMesh.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MeshExchangeType } from '~/consts/mesh';
|
|
2
|
-
import type { LinkPayload } from '@meshconnect/web-link-sdk';
|
|
3
2
|
import type { FunSelectOption } from '../components/FunSelect/FunSelect';
|
|
3
|
+
import { type MeshConnectionInfo } from '../providers/FunkitMeshProvider';
|
|
4
4
|
export declare const useSupportedExchanges: () => MeshExchangeType[];
|
|
5
5
|
export declare const useMeshExchanges: ({ fullInfo, iconSize, }: {
|
|
6
6
|
fullInfo?: boolean;
|
|
@@ -16,4 +16,4 @@ export declare const useMeshActiveNetworkInfo: (chainId: string | undefined, bro
|
|
|
16
16
|
meshSupportedTokens: string[];
|
|
17
17
|
meshNetworkId: string | undefined;
|
|
18
18
|
} | null;
|
|
19
|
-
export declare function useMeshAccountHoldings(targetChain: string, connection:
|
|
19
|
+
export declare function useMeshAccountHoldings(targetChain: string, connection: MeshConnectionInfo | null): import("@tanstack/react-query").UseQueryResult<import("../domains/wallet").AssetHoldingsMap, Error>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run an effect only on the first render, EXACTLY ONCE.
|
|
3
|
+
* regardless of the dependencies, regardless of the strict mode
|
|
4
|
+
* React team thinks that it is antithetical to the React model that
|
|
5
|
+
* an effect cannot be canceled or cannot be replayed. Yet the reality
|
|
6
|
+
* isn't ideal and especially external 3rd party API cannot be controlled.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useMountEffect(effect: () => void): void;
|