@funkit/connect 4.0.0 → 4.0.1
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/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/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 +1 -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 +1446 -1747
- 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/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/wallets/walletConnectors/index.js +46 -46
- package/package.json +5 -5
- 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;
|
|
@@ -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[]>;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
xdefiWallet
|
|
4
|
+
} from "./chunk-NO7XMBB5.js";
|
|
5
|
+
import {
|
|
6
|
+
omniWallet
|
|
7
|
+
} from "./chunk-7CUY5G6R.js";
|
|
5
8
|
import {
|
|
6
9
|
zerionWallet
|
|
7
10
|
} from "./chunk-AXWP3GD4.js";
|
|
8
11
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
subWallet
|
|
13
|
+
} from "./chunk-AD2KIJB6.js";
|
|
11
14
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
15
|
+
tahoWallet
|
|
16
|
+
} from "./chunk-6P2EMPZI.js";
|
|
14
17
|
import {
|
|
15
18
|
tokenPocketWallet
|
|
16
19
|
} from "./chunk-IDKVN5CF.js";
|
|
@@ -26,15 +29,12 @@ import {
|
|
|
26
29
|
import {
|
|
27
30
|
walletConnectWallet
|
|
28
31
|
} from "./chunk-NP5QGWNL.js";
|
|
29
|
-
import {
|
|
30
|
-
xdefiWallet
|
|
31
|
-
} from "./chunk-NO7XMBB5.js";
|
|
32
32
|
import {
|
|
33
33
|
zealWallet
|
|
34
34
|
} from "./chunk-JROWU5BP.js";
|
|
35
35
|
import {
|
|
36
|
-
|
|
37
|
-
} from "./chunk-
|
|
36
|
+
rabbyWallet
|
|
37
|
+
} from "./chunk-BVX4XGNP.js";
|
|
38
38
|
import {
|
|
39
39
|
ramperWallet
|
|
40
40
|
} from "./chunk-PIUNLQJG.js";
|
|
@@ -54,83 +54,80 @@ import {
|
|
|
54
54
|
safepalWallet
|
|
55
55
|
} from "./chunk-MSFKSQBY.js";
|
|
56
56
|
import {
|
|
57
|
-
|
|
58
|
-
} from "./chunk-
|
|
57
|
+
talismanWallet
|
|
58
|
+
} from "./chunk-ABFSXBE6.js";
|
|
59
59
|
import {
|
|
60
|
-
|
|
61
|
-
} from "./chunk-
|
|
60
|
+
coin98Wallet
|
|
61
|
+
} from "./chunk-DTRYS3MO.js";
|
|
62
62
|
import {
|
|
63
63
|
mewWallet
|
|
64
64
|
} from "./chunk-V57WLZEE.js";
|
|
65
65
|
import {
|
|
66
66
|
oktoWallet
|
|
67
67
|
} from "./chunk-ADIXAKUL.js";
|
|
68
|
+
import {
|
|
69
|
+
coreWallet
|
|
70
|
+
} from "./chunk-HBA36GW3.js";
|
|
68
71
|
import {
|
|
69
72
|
okxWallet
|
|
70
73
|
} from "./chunk-4WEHDI4Y.js";
|
|
71
|
-
import {
|
|
72
|
-
omniWallet
|
|
73
|
-
} from "./chunk-7CUY5G6R.js";
|
|
74
74
|
import {
|
|
75
75
|
oneInchWallet
|
|
76
76
|
} from "./chunk-OESTDX6I.js";
|
|
77
77
|
import {
|
|
78
|
-
|
|
79
|
-
} from "./chunk-
|
|
78
|
+
phantomWallet
|
|
79
|
+
} from "./chunk-ZSVTX6EK.js";
|
|
80
80
|
import {
|
|
81
81
|
oneKeyWallet
|
|
82
82
|
} from "./chunk-4AD7VI2P.js";
|
|
83
|
-
import {
|
|
84
|
-
enkryptWallet
|
|
85
|
-
} from "./chunk-SJTXS4ZW.js";
|
|
86
|
-
import {
|
|
87
|
-
frameWallet
|
|
88
|
-
} from "./chunk-ZMYVTWDF.js";
|
|
89
83
|
import {
|
|
90
84
|
frontierWallet
|
|
91
85
|
} from "./chunk-3S2U24BJ.js";
|
|
86
|
+
import {
|
|
87
|
+
imTokenWallet
|
|
88
|
+
} from "./chunk-COZ7MIQS.js";
|
|
92
89
|
import {
|
|
93
90
|
gateWallet
|
|
94
91
|
} from "./chunk-GSOYKKIS.js";
|
|
95
92
|
import {
|
|
96
|
-
|
|
97
|
-
} from "./chunk-
|
|
93
|
+
ledgerWallet
|
|
94
|
+
} from "./chunk-BRBKM4PW.js";
|
|
98
95
|
import {
|
|
99
96
|
injectedWallet
|
|
100
97
|
} from "./chunk-VCVVV2K7.js";
|
|
101
98
|
import {
|
|
102
99
|
kresusWallet
|
|
103
100
|
} from "./chunk-MJXPRJZT.js";
|
|
101
|
+
import {
|
|
102
|
+
metaMaskWallet
|
|
103
|
+
} from "./chunk-G73C6P5P.js";
|
|
104
104
|
import {
|
|
105
105
|
bybitWallet
|
|
106
106
|
} from "./chunk-6ONTSPEY.js";
|
|
107
|
-
import {
|
|
108
|
-
clvWallet
|
|
109
|
-
} from "./chunk-KR6JBW5E.js";
|
|
110
|
-
import {
|
|
111
|
-
coin98Wallet
|
|
112
|
-
} from "./chunk-DTRYS3MO.js";
|
|
113
|
-
import {
|
|
114
|
-
coinbaseWallet
|
|
115
|
-
} from "./chunk-H4IRCEZN.js";
|
|
116
|
-
import {
|
|
117
|
-
coreWallet
|
|
118
|
-
} from "./chunk-HBA36GW3.js";
|
|
119
107
|
import {
|
|
120
108
|
dawnWallet
|
|
121
109
|
} from "./chunk-LN7OD5EC.js";
|
|
110
|
+
import {
|
|
111
|
+
bloomWallet
|
|
112
|
+
} from "./chunk-S27IADFU.js";
|
|
122
113
|
import {
|
|
123
114
|
desigWallet
|
|
124
115
|
} from "./chunk-CTU6JCOK.js";
|
|
116
|
+
import {
|
|
117
|
+
coinbaseWallet
|
|
118
|
+
} from "./chunk-H4IRCEZN.js";
|
|
119
|
+
import {
|
|
120
|
+
enkryptWallet
|
|
121
|
+
} from "./chunk-SJTXS4ZW.js";
|
|
125
122
|
import {
|
|
126
123
|
foxWallet
|
|
127
124
|
} from "./chunk-LMZMXEXL.js";
|
|
125
|
+
import {
|
|
126
|
+
frameWallet
|
|
127
|
+
} from "./chunk-ZMYVTWDF.js";
|
|
128
128
|
import {
|
|
129
129
|
argentWallet
|
|
130
130
|
} from "./chunk-WSQ2YJO2.js";
|
|
131
|
-
import {
|
|
132
|
-
bifrostWallet
|
|
133
|
-
} from "./chunk-W6N74MS3.js";
|
|
134
131
|
import {
|
|
135
132
|
bitgetWallet
|
|
136
133
|
} from "./chunk-A5APNTGL.js";
|
|
@@ -141,12 +138,15 @@ import {
|
|
|
141
138
|
bitverseWallet
|
|
142
139
|
} from "./chunk-3HZRRP4Y.js";
|
|
143
140
|
import {
|
|
144
|
-
|
|
145
|
-
} from "./chunk-
|
|
146
|
-
import "./chunk-23WIEY36.js";
|
|
141
|
+
bifrostWallet
|
|
142
|
+
} from "./chunk-W6N74MS3.js";
|
|
147
143
|
import {
|
|
148
144
|
braveWallet
|
|
149
145
|
} from "./chunk-PB254NQ4.js";
|
|
146
|
+
import {
|
|
147
|
+
clvWallet
|
|
148
|
+
} from "./chunk-KR6JBW5E.js";
|
|
149
|
+
import "./chunk-23WIEY36.js";
|
|
150
150
|
import "./chunk-WRA2DVJ7.js";
|
|
151
151
|
export {
|
|
152
152
|
argentWallet,
|