@funkit/connect 4.0.1 → 4.0.3
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 +46 -0
- package/dist/components/Box/Box.d.ts +1 -1
- package/dist/components/FunButton/FunButton.css.d.ts +1 -0
- package/dist/components/FunCountdown/FunCountdown.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/FunTransactionSummary/PaymentMethodSummary.d.ts +3 -2
- package/dist/consts/customers.d.ts +1 -0
- package/dist/css/sprinkles.css.d.ts +1 -1
- package/dist/domains/paymentMethods.d.ts +7 -9
- package/dist/domains/quote.d.ts +1 -0
- package/dist/hooks/useFunkitMaxCheckoutUsdInfo.d.ts +25 -0
- package/dist/hooks/useMesh.d.ts +2 -2
- package/dist/index.css +2067 -2001
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1782 -1660
- package/dist/modals/CheckoutModal/ConfirmationStep/CheckoutPrimaryInfo.d.ts +7 -2
- 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/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 +1 -8
- package/dist/providers/FunkitConfigContext.d.ts +2 -2
- package/dist/providers/FunkitMeshProvider.d.ts +9 -15
- package/dist/providers/UserPresenceContext.d.ts +9 -0
- package/dist/scroll-G557LOXM.js +7 -0
- package/dist/utils/checkout.d.ts +5 -1
- package/dist/utils/flags/config.d.ts +8 -0
- package/dist/utils/safeJSON.d.ts +3 -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/chunk-25VW5TZP.js +92 -0
- package/dist/wallets/walletConnectors/chunk-3NC26XLM.js +92 -0
- package/dist/wallets/walletConnectors/chunk-3U3BMEH5.js +94 -0
- package/dist/wallets/walletConnectors/chunk-4UM4GTKZ.js +103 -0
- package/dist/wallets/walletConnectors/chunk-545L7Y4M.js +69 -0
- package/dist/wallets/walletConnectors/chunk-6LPM6LUQ.js +110 -0
- package/dist/wallets/walletConnectors/chunk-7GSNBOD3.js +99 -0
- package/dist/wallets/walletConnectors/chunk-ETTNDQQG.js +100 -0
- package/dist/wallets/walletConnectors/chunk-FRGSRLTS.js +93 -0
- package/dist/wallets/walletConnectors/chunk-HKV7EMYZ.js +96 -0
- package/dist/wallets/walletConnectors/chunk-IPOC2VJX.js +106 -0
- package/dist/wallets/walletConnectors/chunk-JXP2QPW7.js +95 -0
- package/dist/wallets/walletConnectors/chunk-KFFJPS5R.js +96 -0
- package/dist/wallets/walletConnectors/chunk-LEXSM5KI.js +87 -0
- package/dist/wallets/walletConnectors/chunk-MOOBCMMB.js +70 -0
- package/dist/wallets/walletConnectors/chunk-N2NIIUW6.js +146 -0
- package/dist/wallets/walletConnectors/chunk-W5O4YSZN.js +98 -0
- package/dist/wallets/walletConnectors/chunk-XYBEMO3C.js +66 -0
- 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 +60 -60
- 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 +8 -8
- package/dist/components/FunNotification/FunCheckoutNotification.d.ts +0 -7
- package/dist/modals/CheckoutModal/useCheckoutQuote.d.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 4.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- aa8cf95: feat: display confirmation step immediately when quoting starts
|
|
8
|
+
- b965382: fix: add mobile modal max height
|
|
9
|
+
- 959807e: feat(connect): add input amount tooltip
|
|
10
|
+
- 48754fa: feat(connect,core,utils): unify json parsing
|
|
11
|
+
- cecbc0a: feat: add scroll chain icon
|
|
12
|
+
- 243f27f: feat: add useFunkitMaxCheckoutUsdInfo hook
|
|
13
|
+
- 04c91f2: chore: migrate custom error codes to utils package
|
|
14
|
+
- 763a16f: feat(connect): clean mesh metadata sent to be backend
|
|
15
|
+
- f8a81e2: feat: use dynamic flag text in dydx modal
|
|
16
|
+
- 21144e0: fix: pause hidden countdown during confirmation
|
|
17
|
+
- a150758: fix(connect): fix accessibility of elements
|
|
18
|
+
- af06c99: refactor(connect): refactor mesh metadata
|
|
19
|
+
- d4aadb5: feat: detect user presence
|
|
20
|
+
- 33d1eb6: fix: dedupe arbitrum usdc and usdc.e
|
|
21
|
+
- 3d19b46: fix: remove unused function in FunkitContext
|
|
22
|
+
- f486a82: fix: keep uninterrupted loading state during intial quoting retries
|
|
23
|
+
- aba0334: feat(connect): adjust spacings and alignment for FunPoweredTagline
|
|
24
|
+
- Updated dependencies [48754fa]
|
|
25
|
+
- Updated dependencies [04c91f2]
|
|
26
|
+
- Updated dependencies [84b7225]
|
|
27
|
+
- Updated dependencies [0733732]
|
|
28
|
+
- @funkit/utils@1.0.3
|
|
29
|
+
- @funkit/core@2.2.9
|
|
30
|
+
- @funkit/api-base@1.4.2
|
|
31
|
+
- @funkit/wagmi-tools@3.0.20
|
|
32
|
+
|
|
33
|
+
## 4.0.2
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- 67b7b1e: feat(fits,connect,utils): add search suggestions (history), move safe json parsing to utils package
|
|
38
|
+
- 76ac39b: fix: remove unused showAvailableBalance option
|
|
39
|
+
- e2419b9: fix: pin datadog version
|
|
40
|
+
- df63829: fix: update tsconfig version
|
|
41
|
+
- 3519ae0: feat: new uiCustomization.showPaymentAmountUsd to show source token amount in confirmation page
|
|
42
|
+
- Updated dependencies [67b7b1e]
|
|
43
|
+
- Updated dependencies [df63829]
|
|
44
|
+
- @funkit/utils@1.0.2
|
|
45
|
+
- @funkit/api-base@1.4.1
|
|
46
|
+
- @funkit/core@2.2.8
|
|
47
|
+
- @funkit/wagmi-tools@3.0.19
|
|
48
|
+
|
|
3
49
|
## 4.0.1
|
|
4
50
|
|
|
5
51
|
### Patch Changes
|
|
@@ -50,7 +50,7 @@ export declare const Box: React.ForwardRefExoticComponent<{
|
|
|
50
50
|
readonly borderRadius?: "1" | "8" | "10" | "13" | "16" | "actionButton" | "connectButton" | "menuButton" | "modal" | "modalMobile" | "4" | "6" | "11" | "24" | "25%" | "full" | undefined;
|
|
51
51
|
readonly borderStyle?: "dotted" | "hidden" | "solid" | undefined;
|
|
52
52
|
readonly borderWidth?: "0" | "1" | "2" | "3" | "4" | "0.5" | undefined;
|
|
53
|
-
readonly cursor?: "default" | "not-allowed" | "pointer" | undefined;
|
|
53
|
+
readonly cursor?: "default" | "help" | "not-allowed" | "pointer" | undefined;
|
|
54
54
|
readonly flexDirection?: "column" | "row" | undefined;
|
|
55
55
|
readonly fontFamily?: "body" | undefined;
|
|
56
56
|
readonly fontSize?: "8" | "10" | "12" | "13" | "14" | "16" | "18" | "20" | "23" | "40" | "57" | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const funLinkButtonStyle: string;
|
|
2
2
|
export declare const transitionStyles: string;
|
|
3
3
|
export declare const pressedStyles: string;
|
|
4
|
+
export declare const baseFunIconButtonStyle: string;
|
|
4
5
|
export declare const funIconButtonClickableStyle: string;
|
|
5
6
|
export declare const funIconButtonNonClickableStyle: string;
|
|
6
7
|
export declare const funIconButtonDisabledStyle: string;
|
|
@@ -10,6 +10,7 @@ export interface FunCountdownProps {
|
|
|
10
10
|
onCountdownLastSecond?: () => void;
|
|
11
11
|
children?: ReactNode | ((remainingSeconds: number) => ReactNode);
|
|
12
12
|
isHidden?: boolean;
|
|
13
|
+
isPaused?: boolean;
|
|
13
14
|
showPending?: boolean;
|
|
14
15
|
}
|
|
15
|
-
export declare const FunCountdown: ({ countdownSeconds, initialRemainingSeconds, counterSize, onCountdownEnded, onBeforeCountdownEnds, onBeforeCountdownEndsSeconds, onCountdownLastSecond, strokeWidth, isHidden, children, showPending, }: FunCountdownProps) => React.JSX.Element | null;
|
|
16
|
+
export declare const FunCountdown: ({ countdownSeconds, initialRemainingSeconds, counterSize, onCountdownEnded, onBeforeCountdownEnds, onBeforeCountdownEndsSeconds, onCountdownLastSecond, strokeWidth, isHidden, isPaused, children, showPending, }: FunCountdownProps) => React.JSX.Element | null;
|
|
@@ -3,11 +3,6 @@ import React, { type ReactNode } from 'react';
|
|
|
3
3
|
import { type BoxProps } from '../Box/Box';
|
|
4
4
|
export declare function FunTxSummaryBox({ children, ...otherProps }: BoxProps): React.JSX.Element;
|
|
5
5
|
export declare function FunTxSummaryLineItem({ children, ...otherProps }: BoxProps): React.JSX.Element;
|
|
6
|
-
export declare function FunTxSummaryLineItemCollapsibleTrigger({ children, isDisabled, onClick, }: {
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
isDisabled: boolean;
|
|
9
|
-
onClick: () => void;
|
|
10
|
-
}): React.JSX.Element;
|
|
11
6
|
export declare function FunTxSummaryCollapsibleBox({ isExpanded, children, }: {
|
|
12
7
|
isExpanded: boolean;
|
|
13
8
|
children: ReactNode;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type { FunkitCheckoutQuoteResult } from '../../providers/FunkitCheckoutContext';
|
|
3
|
+
interface PaymentFeesSummaryProps {
|
|
4
4
|
isLoading: boolean;
|
|
5
|
-
|
|
6
|
-
}
|
|
5
|
+
quote: FunkitCheckoutQuoteResult | null | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare function PaymentFeesSummary({ isLoading, quote, }: PaymentFeesSummaryProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type PaymentMethodInfo } from '../../domains/paymentMethods';
|
|
3
3
|
import type { FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
|
|
4
|
-
import type
|
|
4
|
+
import { type FunkitTextCustomizationsConfig, type FunkitUiCustomRecipientConfig, type FunkitUiCustomizationsConfig } from '../../providers/FunkitConfigContext';
|
|
5
5
|
interface PaymentMethodSummaryProps {
|
|
6
6
|
paymentMethodInfo: PaymentMethodInfo;
|
|
7
7
|
walletAddress: string | undefined;
|
|
@@ -16,6 +16,7 @@ interface PaymentAmountSummaryProps {
|
|
|
16
16
|
targetChainId: string;
|
|
17
17
|
checkoutItem: FunkitActiveCheckoutItem | null;
|
|
18
18
|
textCustomizations: FunkitTextCustomizationsConfig['confirmationScreen'];
|
|
19
|
+
uiCustomizations: FunkitUiCustomizationsConfig['confirmationScreen'];
|
|
19
20
|
}
|
|
20
|
-
export declare function PaymentAmountSummary({ isLoading, targetChainId, checkoutItem, textCustomizations, }: PaymentAmountSummaryProps): React.JSX.Element;
|
|
21
|
+
export declare function PaymentAmountSummary({ isLoading, targetChainId, checkoutItem, textCustomizations, uiCustomizations, }: PaymentAmountSummaryProps): React.JSX.Element;
|
|
21
22
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const DEGEN_API_KEY = "m4iHIILHcL4gN8EXCMzGe8zIdhuCXxck49mWajzJ";
|
|
1
2
|
export declare const DYDX_API_KEY = "NJq0CGrsE19xBbP1vHyBOp8xJvzYo9kayJHqDFP5";
|
|
2
3
|
export declare const POLYMARKET_API_KEY = "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6";
|
|
3
4
|
export declare function isDydxCustomer(apiKey: string): apiKey is "NJq0CGrsE19xBbP1vHyBOp8xJvzYo9kayJHqDFP5";
|
|
@@ -534,7 +534,7 @@ export declare const sprinkles: ((props: {
|
|
|
534
534
|
readonly borderRadius?: "1" | "8" | "10" | "13" | "16" | "actionButton" | "connectButton" | "menuButton" | "modal" | "modalMobile" | "4" | "6" | "11" | "24" | "25%" | "full" | undefined;
|
|
535
535
|
readonly borderStyle?: "dotted" | "hidden" | "solid" | undefined;
|
|
536
536
|
readonly borderWidth?: "0" | "1" | "2" | "3" | "4" | "0.5" | undefined;
|
|
537
|
-
readonly cursor?: "default" | "not-allowed" | "pointer" | undefined;
|
|
537
|
+
readonly cursor?: "default" | "help" | "not-allowed" | "pointer" | undefined;
|
|
538
538
|
readonly flexDirection?: "column" | "row" | undefined;
|
|
539
539
|
readonly fontFamily?: "body" | undefined;
|
|
540
540
|
readonly fontSize?: "8" | "10" | "12" | "13" | "14" | "16" | "18" | "20" | "23" | "40" | "57" | undefined;
|
|
@@ -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
|
@@ -6,6 +6,7 @@ import type { LoginType } from '~/providers/GeneralWalletProvider';
|
|
|
6
6
|
import { type CheckoutFees } from './checkoutFees';
|
|
7
7
|
import { type PaymentMethodInfo } from './paymentMethods';
|
|
8
8
|
export interface FunkitCheckoutQuoteResult extends Omit<ApiFunkitCheckoutQuoteResult, 'finalFeesBreakdown'> {
|
|
9
|
+
finalSpreadUsd: string;
|
|
9
10
|
finalFeesBreakdown: CheckoutFees;
|
|
10
11
|
}
|
|
11
12
|
export declare function getCheckoutBaseQuote(checkoutItem: FunkitActiveCheckoutItem, userId: string, walletAddress: Address, apiKey: string, sponsorInitialTransferGasLimit: number, wagmiConfig: Config): Promise<CheckoutQuoteResponse>;
|
|
@@ -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>;
|