@funkit/connect 4.0.0 → 4.0.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 +39 -0
- package/dist/components/ConnectButton/ConnectButtonRenderer.d.ts +22 -20
- package/dist/components/FunButton/FunButton.d.ts +2 -2
- package/dist/components/FunGuarantees/FunGuarantees.d.ts +1 -1
- package/dist/components/FunKeyValue/FunKeyValue.d.ts +5 -5
- package/dist/components/FunSelectBrokerage/FunSelectBrokerage.d.ts +1 -1
- package/dist/components/FunTooltip/FunTooltip.d.ts +1 -1
- package/dist/components/FunTransactionSummary/PaymentMethodSummary.d.ts +3 -2
- package/dist/components/ModalSelection/ModalSelection.d.ts +1 -1
- package/dist/consts/moonpay.d.ts +8 -1
- package/dist/css/modalTransitionStyles.css.d.ts +4 -4
- package/dist/domains/checkoutFees.d.ts +1 -1
- package/dist/domains/clientMetadata.d.ts +1 -1
- package/dist/domains/paymentMethods.d.ts +3 -5
- package/dist/domains/quote.d.ts +2 -1
- package/dist/hooks/useAllowedAssets.d.ts +8 -0
- package/dist/hooks/useAnimatedNavigation.d.ts +7 -1
- package/dist/hooks/useEffectEvent.d.ts +1 -1
- package/dist/hooks/useMesh.d.ts +2 -2
- package/dist/index.css +74 -118
- package/dist/index.js +1496 -1804
- package/dist/locales/I18n.d.ts +3 -1
- package/dist/modals/CheckoutModal/ConfirmationStep/ConfirmationStep.d.ts +0 -8
- package/dist/modals/CheckoutModal/ConfirmationStep/useQuoteRefresh.d.ts +5 -8
- package/dist/modals/CheckoutModal/ConnectExchange.d.ts +1 -1
- package/dist/modals/CheckoutModal/InputAmount/InputAmountLoading.d.ts +1 -1
- package/dist/modals/CheckoutModal/InputAmount/useCheckoutQuote.d.ts +2 -1
- package/dist/modals/CheckoutModal/MeshVerification.d.ts +1 -1
- package/dist/modals/CheckoutModal/SelectBrokerage.d.ts +1 -1
- package/dist/modals/CheckoutModal/useSourceAssetConfirm.d.ts +3 -7
- package/dist/modals/FunCheckoutHistoryModal/FunCheckoutHistoryContent.d.ts +3 -3
- package/dist/modals/ProfileDetails/ActivityTraversalContext.d.ts +15 -9
- package/dist/modals/ProfileDetails/FunProfileViews/Home/BalanceSection.d.ts +6 -0
- package/dist/modals/ProfileDetails/FunProfileViews/Home/Home.css.d.ts +0 -7
- package/dist/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.d.ts +2 -5
- package/dist/modals/ProfileDetails/FunProfileViews/Home/HomeTokenDisplayRow.d.ts +3 -2
- package/dist/modals/ProfileDetails/FunProfileViews/Home/ProfileTitleSection.d.ts +11 -0
- package/dist/modals/ProfileDetails/FunProfileViews/Home/index.d.ts +4 -3
- package/dist/modals/ProfileDetails/ProfileDetails.d.ts +0 -2
- package/dist/providers/FunkitCheckoutContext.d.ts +20 -7
- package/dist/providers/FunkitConfigContext.d.ts +2 -2
- package/dist/providers/FunkitMeshProvider.d.ts +5 -3
- package/dist/providers/FunkitWeb2Provider.d.ts +16 -8
- package/dist/providers/GeneralWalletProvider.d.ts +9 -4
- package/dist/utils/aborts.d.ts +1 -1
- package/dist/utils/assets.d.ts +2 -2
- package/dist/utils/mesh.d.ts +3 -3
- 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 +56 -56
- 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/modals/ProfileDetails/FunProfileViews/ActivityHistory/ActivityHistory.d.ts +0 -5
package/dist/locales/I18n.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
interface TranslationOptions {
|
|
2
2
|
rawKeyIfTranslationMissing?: boolean;
|
|
3
3
|
}
|
|
4
|
-
type GenericTranslationObject =
|
|
4
|
+
export type GenericTranslationObject = {
|
|
5
|
+
[key: string]: string | GenericTranslationObject;
|
|
6
|
+
};
|
|
5
7
|
export declare class I18n {
|
|
6
8
|
listeners: Set<() => void>;
|
|
7
9
|
defaultLocale: string;
|
|
@@ -7,14 +7,6 @@ interface MoonpayDepositData {
|
|
|
7
7
|
depositTokenAmount: number;
|
|
8
8
|
depositTokenChainId: string;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* controls in what interval to refresh the quote data in case of a hard refresh, in case of pre-loading it controls when to set the data, should be more than `BEFORE_COUNTDOWN_ENDS_SEC` by at least 10 seconds to provide the API the time needed to complete the call
|
|
12
|
-
*/
|
|
13
|
-
export declare const ESTIMATE_REFRESH_INTERVAL_SEC = 60;
|
|
14
|
-
/**
|
|
15
|
-
* controls how soon before the end of `ESTIMATE_REFRESH_INTERVAL_SEC` to pre-load the quote data
|
|
16
|
-
*/
|
|
17
|
-
export declare const BEFORE_COUNTDOWN_ENDS_SEC = 10;
|
|
18
10
|
export type ConfirmationStepState = CheckoutModalCommonState & {
|
|
19
11
|
paymentMethodInfo: PaymentMethodInfo;
|
|
20
12
|
isCloseButtonHidden: boolean;
|
|
@@ -3,20 +3,17 @@ interface UseQuoteRefreshOptions {
|
|
|
3
3
|
/**
|
|
4
4
|
* Freeze the latest quote state, e.g. so we do not change the quote mid-confirmation
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Called when the quote is refreshed
|
|
9
|
-
*/
|
|
10
|
-
onRefreshed(): void;
|
|
6
|
+
isOnHold: boolean;
|
|
11
7
|
}
|
|
12
8
|
interface UseQuoteRefreshResult {
|
|
9
|
+
/** Quoting state indicated a bit in advance for UX reasons */
|
|
10
|
+
isRefreshing: boolean;
|
|
13
11
|
isQuoting: boolean;
|
|
14
|
-
|
|
15
|
-
preloadQuote(): void;
|
|
12
|
+
countdown: React.ReactNode;
|
|
16
13
|
quoteError: ErrorNotification | null;
|
|
17
14
|
quoteStepMessage: string | null;
|
|
18
15
|
/** Safe to call asynchronously */
|
|
19
16
|
refreshQuote(ignorePreloaded?: boolean): Promise<void>;
|
|
20
17
|
}
|
|
21
|
-
export declare function useQuoteRefresh({
|
|
18
|
+
export declare function useQuoteRefresh({ isOnHold, }: UseQuoteRefreshOptions): UseQuoteRefreshResult;
|
|
22
19
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MeshExchangeType } from '~/consts/mesh';
|
|
2
|
+
import { type MeshExchangeType } from '~/consts/mesh';
|
|
3
3
|
import { type PaymentMethodBrokerageInfo } from '../../domains/paymentMethods';
|
|
4
4
|
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from './stepTransition';
|
|
5
5
|
export type ConnectExchangeState = CheckoutModalCommonState & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FunCheckoutStep, ModalStepComponentProps } from '../stepTransition';
|
|
2
|
+
import type { FunCheckoutStep, ModalStepComponentProps } from '../stepTransition';
|
|
3
3
|
interface InputAmountLoadingProps extends ModalStepComponentProps<FunCheckoutStep.INPUT_AMOUNT> {
|
|
4
4
|
sourceHoldingError: Error | null;
|
|
5
5
|
unitPriceError: Error | null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { type CheckoutQuoteError } from '../../../providers/FunkitCheckoutContext';
|
|
1
2
|
interface TriggerNewQuoteOptions {
|
|
2
3
|
maxRetries: number;
|
|
3
4
|
targetAssetAmount: number;
|
|
4
5
|
}
|
|
5
6
|
interface UseCheckoutQuoteOptions {
|
|
6
|
-
onFailure(
|
|
7
|
+
onFailure(error: CheckoutQuoteError): void;
|
|
7
8
|
onSuccess(): void;
|
|
8
9
|
}
|
|
9
10
|
interface UseCheckoutQuoteResult {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
|
-
import { PaymentMethodBrokerageInfo } from '../../domains/paymentMethods';
|
|
3
|
+
import type { PaymentMethodBrokerageInfo } from '../../domains/paymentMethods';
|
|
4
4
|
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from './stepTransition';
|
|
5
5
|
export type MeshVerificationState = CheckoutModalCommonState & {
|
|
6
6
|
paymentMethodInfo: PaymentMethodBrokerageInfo;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MeshExchangeType } from '~/consts/mesh';
|
|
2
|
+
import type { MeshExchangeType } from '~/consts/mesh';
|
|
3
3
|
import { type PaymentMethodBrokerageInfo } from '../../domains/paymentMethods';
|
|
4
4
|
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from './stepTransition';
|
|
5
5
|
export type SelectBrokerageState = CheckoutModalCommonState;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { Operation } from '@funkit/core';
|
|
2
2
|
import { type PaymentMethodInfo } from '../../domains/paymentMethods';
|
|
3
|
-
import { type FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
|
|
3
|
+
import { type CheckoutQuoteResult, type FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
|
|
4
4
|
import { LoginType } from '../../providers/GeneralWalletProvider';
|
|
5
|
-
export interface SourceAssetConfirmed {
|
|
6
|
-
isQuoteSuccess: boolean;
|
|
7
|
-
maxTargetAssetAmount: number | undefined;
|
|
8
|
-
}
|
|
9
5
|
export declare function preparePaymentMethodInfo(selectedPaymentMethodInfo: PaymentMethodInfo | null, meshNetworkInfo: {
|
|
10
6
|
meshNetworkId: string | undefined;
|
|
11
7
|
} | null): Promise<import("../../domains/paymentMethods").PaymentMethodCardInfo | import("../../domains/paymentMethods").PaymentMethodBrokerageInfo | import("../../domains/paymentMethods").PaymentMethodAccountInfo>;
|
|
@@ -24,8 +20,8 @@ export declare function fetchSponsorInitialTransferGasLimit(checkoutItem: Funkit
|
|
|
24
20
|
*
|
|
25
21
|
* USE THIS WITH CAUTION
|
|
26
22
|
**/
|
|
27
|
-
export declare function useTriggerQuoteAndOtherStuffsWithExtremeCaution(
|
|
23
|
+
export declare function useTriggerQuoteAndOtherStuffsWithExtremeCaution(onResult: (result: CheckoutQuoteResult) => void, setPreloadedQuoteData?: (quoteData: FunkitActiveCheckoutItem) => void): {
|
|
28
24
|
isSourceAssetConfirming: boolean;
|
|
29
25
|
triggerAssetConfirm: () => void;
|
|
30
|
-
onSourceAssetConfirmed: (preloadQuoteData?: boolean) => Promise<
|
|
26
|
+
onSourceAssetConfirmed: (preloadQuoteData?: boolean) => Promise<CheckoutQuoteResult>;
|
|
31
27
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { HistoryContentPages } from '../../utils/checkoutHistory';
|
|
3
3
|
interface FunCheckoutHistoryContentProps {
|
|
4
4
|
depositAddress: `0x${string}`;
|
|
5
5
|
currentPage: HistoryContentPages;
|
|
6
|
-
|
|
6
|
+
onHelp: () => void;
|
|
7
7
|
onBackFromHelpPage: () => void;
|
|
8
8
|
onClose: () => void;
|
|
9
9
|
}
|
|
10
10
|
export declare const HISTORY_BOTTOM_BAR_ID = "history-bottom-section";
|
|
11
11
|
export declare const DEFAULT_CHECKOUT_HISTORY_DETAIL_TITLE = "Your Purchase";
|
|
12
|
-
export declare function FunCheckoutHistoryContent({ depositAddress, currentPage,
|
|
12
|
+
export declare function FunCheckoutHistoryContent({ depositAddress, currentPage, onHelp, onBackFromHelpPage, onClose, }: FunCheckoutHistoryContentProps): React.JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import type { StateSnapshot } from 'react-virtuoso';
|
|
2
3
|
import type { HistoryContentPages } from '../../utils/checkoutHistory';
|
|
4
|
+
import type { SelectedHomeTab } from './FunProfileViews/Home';
|
|
3
5
|
import type { FunProfileView } from './ProfileDetails';
|
|
6
|
+
export interface ReturnViewPresets {
|
|
7
|
+
selectedView?: SelectedHomeTab;
|
|
8
|
+
scrollState?: StateSnapshot;
|
|
9
|
+
}
|
|
4
10
|
export interface BaseActivitySelection {
|
|
5
11
|
depositAddress: `0x${string}`;
|
|
6
12
|
initialPage: HistoryContentPages;
|
|
7
|
-
returnViewPresets:
|
|
8
|
-
[x: string]: any;
|
|
9
|
-
};
|
|
13
|
+
returnViewPresets: ReturnViewPresets;
|
|
10
14
|
}
|
|
11
15
|
export interface ActivitySelection extends BaseActivitySelection {
|
|
12
16
|
onRedirect: () => void;
|
|
@@ -15,17 +19,19 @@ export interface ActivitySelection extends BaseActivitySelection {
|
|
|
15
19
|
export declare const ActivityTraversalContext: React.Context<{
|
|
16
20
|
selectedPurchaseId: `0x${string}` | undefined;
|
|
17
21
|
selectedPurchaseInitView: HistoryContentPages | undefined;
|
|
18
|
-
returnView:
|
|
19
|
-
returnViewPresets:
|
|
22
|
+
returnView: FunProfileView | undefined;
|
|
23
|
+
returnViewPresets: ReturnViewPresets;
|
|
20
24
|
onSelectActivity: ({ depositAddress, initialPage, returnView, returnViewPresets, onRedirect, }: ActivitySelection) => void;
|
|
21
25
|
resetActivityTraversal: () => void;
|
|
22
26
|
}>;
|
|
23
|
-
export declare const ActivityTraversalProvider: ({ children }:
|
|
27
|
+
export declare const ActivityTraversalProvider: ({ children, }: {
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}) => React.JSX.Element;
|
|
24
30
|
export declare const useActivityTraversal: () => {
|
|
25
31
|
selectedPurchaseId: `0x${string}` | undefined;
|
|
26
32
|
selectedPurchaseInitView: HistoryContentPages | undefined;
|
|
27
|
-
returnView:
|
|
28
|
-
returnViewPresets:
|
|
33
|
+
returnView: FunProfileView | undefined;
|
|
34
|
+
returnViewPresets: ReturnViewPresets;
|
|
29
35
|
onSelectActivity: ({ depositAddress, initialPage, returnView, returnViewPresets, onRedirect, }: ActivitySelection) => void;
|
|
30
36
|
resetActivityTraversal: () => void;
|
|
31
37
|
};
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
export declare const contentSection: {
|
|
2
|
-
animationDuration: string;
|
|
3
|
-
animationTimingFunction: string;
|
|
4
|
-
animationFillMode: string;
|
|
5
|
-
};
|
|
6
1
|
export declare const animateTitleInClass: string;
|
|
7
2
|
export declare const animateTitleOutClass: string;
|
|
8
|
-
export declare const animateContentInClass: string;
|
|
9
3
|
export declare const animateVirtuosoInClass: string;
|
|
10
|
-
export declare const animateContentOutClass: string;
|
|
@@ -2,11 +2,8 @@ import type { CheckoutHistoryItem } from '@funkit/api-base';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { HistoryContentPages } from '../../../../utils/checkoutHistory';
|
|
4
4
|
export declare const HOME_CHECKOUT_DISPLAY_ROW_HEIGHT = 52;
|
|
5
|
-
export declare const HomeCheckoutDisplayRow: ({ checkoutHistoryItem,
|
|
5
|
+
export declare const HomeCheckoutDisplayRow: ({ checkoutHistoryItem, onSelect, }: {
|
|
6
6
|
checkoutHistoryItem: CheckoutHistoryItem;
|
|
7
|
-
disableSidePadding?: boolean;
|
|
8
7
|
onSelect: (depositAddress: `0x${string}`, initialPage: HistoryContentPages) => void;
|
|
9
8
|
}) => React.JSX.Element;
|
|
10
|
-
export declare const HomeCheckoutDisplayRowSkeleton: (
|
|
11
|
-
disableSidePadding?: boolean;
|
|
12
|
-
}) => React.JSX.Element;
|
|
9
|
+
export declare const HomeCheckoutDisplayRowSkeleton: () => React.JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { KnownAssetBalanceInfo } from '~/providers/GeneralWalletProvider';
|
|
2
3
|
export declare const HOME_TOKEN_BALANCE_DISPLAY_ROW_HEIGHT = 52;
|
|
3
|
-
export declare const HomeTokenBalanceDisplayRow: ({ asset }: {
|
|
4
|
-
asset:
|
|
4
|
+
export declare const HomeTokenBalanceDisplayRow: ({ asset, }: {
|
|
5
|
+
asset: KnownAssetBalanceInfo;
|
|
5
6
|
}) => React.JSX.Element;
|
|
6
7
|
export declare const HomeTokenBalanceDisplayRowSkeleton: () => React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FunkitUserInfo } from '~/consts/funkit';
|
|
3
|
+
import { FunProfileView } from '../../ProfileDetails';
|
|
4
|
+
export declare const ProfileTitleSection: ({ animateOut, account, userInfo, onChangeView, onLogout, onClose, }: {
|
|
5
|
+
animateOut?: boolean;
|
|
6
|
+
account: any;
|
|
7
|
+
userInfo: FunkitUserInfo;
|
|
8
|
+
onChangeView: (newView: FunProfileView) => void;
|
|
9
|
+
onLogout: () => void;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
}) => React.JSX.Element;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type AnimationState } from '~/hooks/useAnimatedNavigation';
|
|
2
3
|
import { type BaseActivitySelection } from '../../ActivityTraversalContext';
|
|
3
|
-
import { FunProfileView } from '../../ProfileDetails';
|
|
4
|
+
import { type FunProfileView } from '../../ProfileDetails';
|
|
4
5
|
export declare enum SelectedHomeTab {
|
|
5
6
|
ASSETS = "assets",
|
|
6
7
|
CHECKOUTS = "checkouts"
|
|
7
8
|
}
|
|
8
|
-
export declare function Home({ onClose, onChangeView, onSelectActivity, defaultHomeTab,
|
|
9
|
+
export declare function Home({ onClose, onChangeView, onSelectActivity, defaultHomeTab, animation, }: {
|
|
9
10
|
onClose: () => void;
|
|
10
11
|
onChangeView: (newView: FunProfileView) => void;
|
|
11
12
|
onSelectActivity: (activity: BaseActivitySelection) => void;
|
|
12
13
|
defaultHomeTab?: SelectedHomeTab;
|
|
13
|
-
|
|
14
|
+
animation: AnimationState;
|
|
14
15
|
}): React.JSX.Element;
|
|
@@ -4,13 +4,11 @@ export declare const PROFILE_SIDE_PADDING = "18";
|
|
|
4
4
|
export declare enum FunProfileView {
|
|
5
5
|
HOME = 0,
|
|
6
6
|
SETTINGS = 1,
|
|
7
|
-
ACTIVITY = 2,
|
|
8
7
|
SINGLE_ACTIVITY = 3
|
|
9
8
|
}
|
|
10
9
|
interface ProfileDetailsProps {
|
|
11
10
|
onClose: () => void;
|
|
12
11
|
defaultTab: SelectedHomeTab | null;
|
|
13
12
|
}
|
|
14
|
-
export declare const PROFILE_DETAILS_DIALOG_CONTENT_ID = "profile-details-dialog-content";
|
|
15
13
|
export declare function ProfileDetails({ onClose, defaultTab }: ProfileDetailsProps): React.JSX.Element;
|
|
16
14
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiCheckoutClientMetadata, ApiFunkitCheckoutConfig } from '@funkit/api-base';
|
|
1
|
+
import { type ApiCheckoutClientMetadata, type ApiFunkitCheckoutConfig } from '@funkit/api-base';
|
|
2
2
|
import { type Operation } from '@funkit/core';
|
|
3
3
|
import React, { type ReactNode } from 'react';
|
|
4
4
|
import { type Abi, type Address } from 'viem';
|
|
@@ -7,11 +7,27 @@ import { type PaymentMethodInfo } from '../domains/paymentMethods';
|
|
|
7
7
|
import type { FunkitCheckoutQuoteResult } from '../domains/quote';
|
|
8
8
|
export type { HistoricalCheckoutItem, ServerCheckoutConfig, } from '~/domains/clientMetadata';
|
|
9
9
|
export type { FunkitCheckoutQuoteResult } from '~/domains/quote';
|
|
10
|
+
export type CheckoutQuoteError = {
|
|
11
|
+
maxTargetAssetAmount: number;
|
|
12
|
+
reason: 'insufficientBalance';
|
|
13
|
+
} | {
|
|
14
|
+
minTargetUsdAmount?: number;
|
|
15
|
+
reason: 'insufficientAmount';
|
|
16
|
+
} | {
|
|
17
|
+
originalError: Error;
|
|
18
|
+
reason: 'internal';
|
|
19
|
+
};
|
|
20
|
+
export type CheckoutQuoteResult = {
|
|
21
|
+
success: true;
|
|
22
|
+
} | {
|
|
23
|
+
error: CheckoutQuoteError;
|
|
24
|
+
success: false;
|
|
25
|
+
};
|
|
10
26
|
export interface FunkitCheckoutActionParams {
|
|
11
27
|
contractAbi: Abi;
|
|
12
28
|
contractAddress: Address;
|
|
13
29
|
functionName: string;
|
|
14
|
-
functionArgs:
|
|
30
|
+
functionArgs: unknown[];
|
|
15
31
|
value?: bigint;
|
|
16
32
|
}
|
|
17
33
|
export type DydxAddress = `dydx${string}`;
|
|
@@ -113,11 +129,8 @@ interface FunkitCheckoutContextInterface {
|
|
|
113
129
|
confirmCheckout(shouldBatchOpBypassInit: boolean, stepMessageSetter: (m: string) => void): Promise<Address>;
|
|
114
130
|
cancelCheckout(depositAddress: Address): Promise<boolean>;
|
|
115
131
|
clearCheckoutQuoteMessages(): void;
|
|
116
|
-
getCheckoutQuote(sponsorInitialTransferGasLimit: number, newPaymentMethodInfo: PaymentMethodInfo, disableInformationStreaming?: boolean): Promise<{
|
|
117
|
-
|
|
118
|
-
shellCheckoutItemWithNextQuote: FunkitActiveCheckoutItem | undefined;
|
|
119
|
-
maxTargetAssetAmount: number | undefined;
|
|
120
|
-
errorObject?: any;
|
|
132
|
+
getCheckoutQuote(sponsorInitialTransferGasLimit: number, newPaymentMethodInfo: PaymentMethodInfo, disableInformationStreaming?: boolean): Promise<CheckoutQuoteResult & {
|
|
133
|
+
shellCheckoutItemWithNextQuote: FunkitActiveCheckoutItem;
|
|
121
134
|
}>;
|
|
122
135
|
generateSignedBatchOperation(actionsParams: FunkitCheckoutActionParams[], assetChainId: string, bypassWalletInit: boolean, stepMessageSetter: (m: string) => void): Promise<null | Operation>;
|
|
123
136
|
setCheckoutQuote(quote: FunkitActiveCheckoutItem): void;
|
|
@@ -22,14 +22,14 @@ export interface FunkitUiCustomizationsConfig {
|
|
|
22
22
|
confirmationScreen?: {
|
|
23
23
|
/** Whether to show the amount of tokens below the USD equivalent - defaults to true */
|
|
24
24
|
showTokenAmount?: boolean;
|
|
25
|
+
/** Whether to show the total payment amount in USD below the token amount equivalent. Defaults to false */
|
|
26
|
+
showPaymentAmountUsd?: boolean;
|
|
25
27
|
/** Configure UI when `customRecipient` is specified in the config */
|
|
26
28
|
customRecipientConfig?: FunkitUiCustomRecipientConfig;
|
|
27
29
|
};
|
|
28
30
|
inputAmountScreen?: {
|
|
29
31
|
/** Whether to allow entering an amount of tokens, rather than only USD - defaults to true */
|
|
30
32
|
allowTokenAmountInput?: boolean;
|
|
31
|
-
/** Whether to show available balance in Input Amount screen (wallet/brokerage only) - defaults to true */
|
|
32
|
-
showAvailableBalance?: boolean;
|
|
33
33
|
};
|
|
34
34
|
paymentMethods?: {
|
|
35
35
|
/** Whether paying by card is a payment method the users can use - defaults to true */
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type LinkPayload } from '@meshconnect/web-link-sdk';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { MeshExchangeType } from '~/consts/mesh';
|
|
4
|
-
export declare function FunkitMeshProvider({ children }:
|
|
2
|
+
import React, { type ReactNode } from 'react';
|
|
3
|
+
import type { MeshExchangeType } from '~/consts/mesh';
|
|
4
|
+
export declare function FunkitMeshProvider({ children }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): React.JSX.Element;
|
|
5
7
|
export declare function useFunkitMesh(): {
|
|
6
8
|
unlinkBrokerage: (brokerType: MeshExchangeType) => void;
|
|
7
9
|
getActiveConnection: (brokerType: MeshExchangeType) => (LinkPayload & {
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import { type OAuthProviderType } from '@privy-io/js-sdk-core';
|
|
1
|
+
import PrivyJS, { type OAuthProviderType } from '@privy-io/js-sdk-core';
|
|
2
2
|
import React, { type ReactNode } from 'react';
|
|
3
3
|
import { type FunkitUserInfoBase, PrivyLoginMethod } from '../consts/funkit';
|
|
4
|
+
type FarcasterAuthParams = Parameters<PrivyJS['auth']['farcaster']['authenticate']>[0];
|
|
5
|
+
type FarcasterCompletedStatusResponse = Extract<Awaited<ReturnType<PrivyJS['auth']['farcaster']['getFarcasterStatus']>>, {
|
|
6
|
+
state: 'completed';
|
|
7
|
+
}>;
|
|
8
|
+
type FarcasterConnectionStatus = {
|
|
9
|
+
isCompleted: true;
|
|
10
|
+
fcMeta: FarcasterCompletedStatusResponse;
|
|
11
|
+
} | {
|
|
12
|
+
isCompleted: false;
|
|
13
|
+
fcMeta: unknown;
|
|
14
|
+
};
|
|
4
15
|
export declare const ERROR_MESSAGES: {
|
|
5
16
|
readonly MISSING_LOGIN_CODES: "Missing login codes";
|
|
6
17
|
readonly INVALID_LOGIN_METHOD: "Invalid login method";
|
|
@@ -11,12 +22,12 @@ export declare const ERROR_MESSAGES: {
|
|
|
11
22
|
readonly PRIVY_USER_NOT_INITIALIZED: "Privy user not initialized";
|
|
12
23
|
readonly FARCASTER_NOT_INITIALIZED: "Unable to initialize Farcaster login";
|
|
13
24
|
};
|
|
14
|
-
|
|
25
|
+
type PrivyLoginParams = {
|
|
15
26
|
firstLoginCode?: string;
|
|
16
27
|
secondLoginCode?: string;
|
|
17
|
-
alternateCodeMeta?:
|
|
28
|
+
alternateCodeMeta?: FarcasterAuthParams;
|
|
18
29
|
inputLoginMethod: PrivyLoginMethod;
|
|
19
|
-
}
|
|
30
|
+
};
|
|
20
31
|
interface FunkitWeb2LoginParams extends Omit<PrivyLoginParams, 'inputLoginMethod'> {
|
|
21
32
|
chainId: number;
|
|
22
33
|
inputLoginMethod?: PrivyLoginMethod;
|
|
@@ -40,10 +51,7 @@ interface FunkitWeb2ContextType {
|
|
|
40
51
|
channelToken: string;
|
|
41
52
|
connectUri: string;
|
|
42
53
|
}>;
|
|
43
|
-
getFcConnectionStatus: (channelToken: string) => Promise<
|
|
44
|
-
isCompleted: boolean;
|
|
45
|
-
fcMeta: any;
|
|
46
|
-
}>;
|
|
54
|
+
getFcConnectionStatus: (channelToken: string) => Promise<FarcasterConnectionStatus>;
|
|
47
55
|
web2UserInfo: FunkitUserInfoBase;
|
|
48
56
|
}
|
|
49
57
|
export declare const AUTH_PROVIDER = "privy.io";
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { AssetBalanceInfo } from '@funkit/api-base';
|
|
2
2
|
import { Auth, FunWallet } from '@funkit/core';
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { type ReactNode } from 'react';
|
|
4
4
|
import type { Address } from 'viem';
|
|
5
|
+
import { type Config } from 'wagmi';
|
|
6
|
+
import type { SwitchChainVariables } from 'wagmi/query';
|
|
5
7
|
import { type FunkitUserInfo } from '../consts/funkit';
|
|
8
|
+
/** AssetBalanceInfo with known price and totalUsdValue */
|
|
6
9
|
export interface KnownAssetBalanceInfo extends AssetBalanceInfo {
|
|
7
10
|
price: number;
|
|
8
11
|
totalUsdValue: number;
|
|
@@ -22,7 +25,9 @@ interface GeneralWalletContextProps {
|
|
|
22
25
|
handleLogout: () => void;
|
|
23
26
|
logoutSymbol: symbol | undefined;
|
|
24
27
|
}
|
|
25
|
-
export declare function GeneralWalletProvider({ children }:
|
|
28
|
+
export declare function GeneralWalletProvider({ children }: {
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
}): React.JSX.Element;
|
|
26
31
|
export declare const useGeneralWallet: () => GeneralWalletContextProps;
|
|
27
32
|
/**
|
|
28
33
|
* Replacement for wagmi's `useAccount`
|
|
@@ -163,8 +168,8 @@ export declare const useFunkitDisconnect: () => {
|
|
|
163
168
|
export declare const useFunkitSwitchChains: ({ onSettled, }: {
|
|
164
169
|
onSettled?: () => void;
|
|
165
170
|
}) => {
|
|
166
|
-
switchChain: (params:
|
|
167
|
-
switchChainAsync: (params:
|
|
171
|
+
switchChain: (params: SwitchChainVariables<Config, number>) => void;
|
|
172
|
+
switchChainAsync: (params: SwitchChainVariables<Config, number>) => Promise<void>;
|
|
168
173
|
pendingChainId: number | null;
|
|
169
174
|
};
|
|
170
175
|
export {};
|
package/dist/utils/aborts.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare class AssetAbortClass {
|
|
|
3
3
|
constructor(abortController: AbortController);
|
|
4
4
|
setAbortController(newAbortController: AbortController): void;
|
|
5
5
|
getAbortSignal(): AbortSignal;
|
|
6
|
-
abort(reason?:
|
|
6
|
+
abort(reason?: unknown): void;
|
|
7
7
|
}
|
|
8
8
|
export declare const singletonAssetAbort: AssetAbortClass;
|
|
9
9
|
export declare const singletonCheckoutAbort: AssetAbortClass;
|
package/dist/utils/assets.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ import type { FunkitActiveCheckoutItem, FunkitCheckoutConfig } from '../provider
|
|
|
5
5
|
import { type FlagValues } from '../providers/FunkitFlagsProvider';
|
|
6
6
|
export type { AssetHoldingsItem, AssetHoldingsMap, KnownAssetHoldingsItem, } from '~/domains/wallet';
|
|
7
7
|
export declare const ASSETS_LOW_VALUE_THRESHOLD = 0.1;
|
|
8
|
-
export declare const getNormalizedTokenBalance: (tokenBalance: bigint | number, decimals: number) => number;
|
|
8
|
+
export declare const getNormalizedTokenBalance: (tokenBalance: bigint | number | string, decimals: number) => number;
|
|
9
9
|
export declare function getUsdAvailableAmount(targetChainId: string, assetChainId: string | undefined, assetUsdAmount: number | null | undefined, paymentMethod: PaymentMethod | undefined): number | null;
|
|
10
|
-
export declare const isAssetUsableToPayForCheckout: (flags: FlagValues, checkoutItem: FunkitActiveCheckoutItem, paymentMethod: PaymentMethod, assetChainId: string, assetTokenAddress: string, assetUsdAmount: number | null, loginType: LoginType) => {
|
|
10
|
+
export declare const isAssetUsableToPayForCheckout: (flags: FlagValues, checkoutItem: FunkitActiveCheckoutItem, paymentMethod: PaymentMethod, assetChainId: string, assetTokenAddress: string, assetUsdAmount: number | null, loginType: LoginType, isAllowedForCheckout: boolean) => {
|
|
11
11
|
isUsable: boolean;
|
|
12
12
|
reason: string;
|
|
13
13
|
};
|
package/dist/utils/mesh.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TransferIntegration } from '@funkit/api-base';
|
|
2
|
-
import { MeshExchangeType } from '../consts/mesh';
|
|
3
|
-
import { AssetHoldingsMap } from '../utils/assets';
|
|
1
|
+
import { type TransferIntegration } from '@funkit/api-base';
|
|
2
|
+
import type { MeshExchangeType } from '../consts/mesh';
|
|
3
|
+
import type { AssetHoldingsMap } from '../utils/assets';
|
|
4
4
|
export { FUNKIT_MESH_CLIENT_ID } from '../consts/mesh';
|
|
5
5
|
export declare function fetchMeshLinkToken(funkitUserId: string, brokerType: MeshExchangeType, funApiKey: string): Promise<import("@funkit/api-base").GetLinkTokenResponse>;
|
|
6
6
|
export declare function fetchMeshTransferIntegrations(apiKey: string): Promise<TransferIntegration[]>;
|
package/dist/utils/safeJSON.d.ts
CHANGED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getInjectedConnector,
|
|
4
|
+
hasInjectedProvider
|
|
5
|
+
} from "./chunk-WRA2DVJ7.js";
|
|
6
|
+
import {
|
|
7
|
+
getWalletConnectConnector
|
|
8
|
+
} from "./chunk-23WIEY36.js";
|
|
9
|
+
|
|
10
|
+
// src/wallets/walletConnectors/roninWallet/roninWallet.ts
|
|
11
|
+
var roninWallet = ({
|
|
12
|
+
projectId,
|
|
13
|
+
walletConnectParameters
|
|
14
|
+
}) => {
|
|
15
|
+
const isRoninInjected = hasInjectedProvider({
|
|
16
|
+
namespace: "ronin.provider"
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
id: "ronin",
|
|
20
|
+
name: "Ronin Wallet",
|
|
21
|
+
iconUrl: async () => (await import("./roninWallet-SAB5ESVK.js")).default,
|
|
22
|
+
iconBackground: "#ffffff",
|
|
23
|
+
rdns: "com.roninchain.wallet",
|
|
24
|
+
installed: isRoninInjected || void 0,
|
|
25
|
+
downloadUrls: {
|
|
26
|
+
android: "https://play.google.com/store/apps/details?id=com.skymavis.genesis",
|
|
27
|
+
ios: "https://apps.apple.com/us/app/ronin-wallet/id1592675001",
|
|
28
|
+
mobile: "https://wallet.roninchain.com",
|
|
29
|
+
chrome: "https://chrome.google.com/webstore/detail/ronin-wallet/fnjhmkhhmkbjkkabndcnnogagogbneec",
|
|
30
|
+
edge: "https://microsoftedge.microsoft.com/addons/detail/ronin-wallet/kjmoohlgokccodicjjfebfomlbljgfhk",
|
|
31
|
+
firefox: "https://addons.mozilla.org/firefox/addon/ronin-wallet",
|
|
32
|
+
browserExtension: "https://wallet.roninchain.com/",
|
|
33
|
+
qrCode: "https://wallet.roninchain.com/"
|
|
34
|
+
},
|
|
35
|
+
mobile: {
|
|
36
|
+
getUri: (uri) => `roninwallet://wc?uri=${encodeURIComponent(uri)}`
|
|
37
|
+
},
|
|
38
|
+
qrCode: {
|
|
39
|
+
getUri: (uri) => uri,
|
|
40
|
+
instructions: {
|
|
41
|
+
learnMoreUrl: "https://wallet.roninchain.com/",
|
|
42
|
+
steps: [
|
|
43
|
+
{
|
|
44
|
+
description: "wallet_connectors.ronin.qr_code.step1.description",
|
|
45
|
+
step: "install",
|
|
46
|
+
title: "wallet_connectors.ronin.qr_code.step1.title"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
description: "wallet_connectors.ronin.qr_code.step2.description",
|
|
50
|
+
step: "create",
|
|
51
|
+
title: "wallet_connectors.ronin.qr_code.step2.title"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
description: "wallet_connectors.ronin.qr_code.step3.description",
|
|
55
|
+
step: "scan",
|
|
56
|
+
title: "wallet_connectors.ronin.qr_code.step3.title"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
extension: {
|
|
62
|
+
instructions: {
|
|
63
|
+
learnMoreUrl: "https://wallet.roninchain.com/",
|
|
64
|
+
steps: [
|
|
65
|
+
{
|
|
66
|
+
description: "wallet_connectors.ronin.extension.step1.description",
|
|
67
|
+
step: "install",
|
|
68
|
+
title: "wallet_connectors.ronin.extension.step1.title"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
description: "wallet_connectors.ronin.extension.step2.description",
|
|
72
|
+
step: "create",
|
|
73
|
+
title: "wallet_connectors.ronin.extension.step2.title"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
description: "wallet_connectors.ronin.extension.step3.description",
|
|
77
|
+
step: "refresh",
|
|
78
|
+
title: "wallet_connectors.ronin.extension.step3.title"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
createConnector: isRoninInjected ? getInjectedConnector({ namespace: "ronin.provider" }) : getWalletConnectConnector({
|
|
84
|
+
projectId,
|
|
85
|
+
walletConnectParameters
|
|
86
|
+
})
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export {
|
|
91
|
+
roninWallet
|
|
92
|
+
};
|