@funkit/connect 5.5.18 → 5.5.19
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 +21 -0
- package/dist/hooks/queries/useWithdrawalQuote.d.ts +1 -1
- package/dist/hooks/useTokenChain.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3335 -2769
- package/dist/modals/CheckoutModal/LoadingAccount.d.ts +4 -2
- package/dist/modals/CheckoutModal/stepTransition.d.ts +3 -2
- package/dist/modals/WithdrwalModal/WithdrawalContent.d.ts +1 -1
- package/dist/providers/FunkitCheckoutContext.d.ts +15 -0
- package/dist/utils/address.d.ts +7 -0
- package/dist/utils/checkout.d.ts +1 -1
- package/dist/utils/flags/config.d.ts +4 -0
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitskiWallet/bitskiWallet.js +2 -2
- package/dist/wallets/walletConnectors/braveWallet/braveWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/{chunk-KR6JBW5E.js → chunk-2GJQ4XZQ.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-G73C6P5P.js → chunk-2HYNUNAS.js} +112 -40
- package/dist/wallets/walletConnectors/{chunk-2UCNRD7H.js → chunk-2KUBG3S6.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-FRGSRLTS.js → chunk-2L43XSW3.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-6ONTSPEY.js → chunk-2STUC6QL.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-ZSVTX6EK.js → chunk-362NXNTM.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-MOOBCMMB.js → chunk-3CICVJUN.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-A5APNTGL.js → chunk-5W7VDOCL.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-LMZMXEXL.js → chunk-7QONTUXT.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-545L7Y4M.js → chunk-A5N6B5UW.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-4WEHDI4Y.js → chunk-AFXHGWBH.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-BVX4XGNP.js → chunk-BBOM42DL.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-NO7XMBB5.js → chunk-BOU4WKRZ.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-PB254NQ4.js → chunk-BPZ2XJO2.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-PIUNLQJG.js → chunk-BYXPFMI7.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-GSOYKKIS.js → chunk-CJGUM55H.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-XYBEMO3C.js → chunk-CNPKISHN.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-SLOIIJGP.js → chunk-D6AOOO5F.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-WRA2DVJ7.js → chunk-DNSG5Q7V.js} +23 -9
- package/dist/wallets/walletConnectors/{chunk-ABFSXBE6.js → chunk-DRO6WYMM.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-6LPM6LUQ.js → chunk-EC6CHBSZ.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-3NC26XLM.js → chunk-FKJJQNKX.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-P74YPRF6.js → chunk-HS3C7OQV.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-LN7OD5EC.js → chunk-HWPKCIBE.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-ZMYVTWDF.js → chunk-IFON7E6U.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-IDKVN5CF.js → chunk-J3LI3FYZ.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-HBA36GW3.js → chunk-JCHN6A47.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-AD2KIJB6.js → chunk-JWFF4AAL.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-KFFJPS5R.js → chunk-KIDC67XJ.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-W5O4YSZN.js → chunk-LNEC5RNX.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-LEXSM5KI.js → chunk-M3NZ6R2E.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-MSFKSQBY.js → chunk-NT2HYJKW.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-25VW5TZP.js → chunk-NWIQNBJU.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-DTRYS3MO.js → chunk-OBOVHCEI.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-V57WLZEE.js → chunk-OL5ZO7E4.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-SJTXS4ZW.js → chunk-OLOIXTYS.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-CTU6JCOK.js → chunk-OPAZMNA7.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-ETTNDQQG.js → chunk-Q3H3TRBS.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-63YLN6R5.js → chunk-QLVVUKYB.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-IPOC2VJX.js → chunk-RKPCWHXL.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-JROWU5BP.js → chunk-RNBEDQHF.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-R6RWZRFF.js → chunk-RZIO5TFF.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-4AD7VI2P.js → chunk-SHBUZ7U7.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-AXWP3GD4.js → chunk-SULRQO27.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-HKV7EMYZ.js → chunk-TCAGNB4B.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-7GSNBOD3.js → chunk-TDAVGY5F.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-3U3BMEH5.js → chunk-TDIEHTMB.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-W6N74MS3.js → chunk-UIASLGLV.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-N2NIIUW6.js → chunk-UYGJO62F.js} +112 -40
- package/dist/wallets/walletConnectors/{chunk-JXP2QPW7.js → chunk-VR4TBQ6S.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-3S2U24BJ.js → chunk-VWCLFMWJ.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-ISIBREBO.js → chunk-VYBAYMP3.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-VCVVV2K7.js → chunk-XWUJE7MW.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-4UM4GTKZ.js → chunk-ZSI5N4VV.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-6P2EMPZI.js → chunk-ZZZRUXZE.js} +1 -1
- 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/dawnWallet/dawnWallet.js +2 -2
- package/dist/wallets/walletConnectors/desigWallet/desigWallet.js +2 -2
- package/dist/wallets/walletConnectors/enkryptWallet/enkryptWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frameWallet/frameWallet.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 +81 -81
- package/dist/wallets/walletConnectors/injectedWallet/injectedWallet.js +2 -2
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/mewWallet/mewWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/oneKeyWallet/oneKeyWallet.js +2 -2
- package/dist/wallets/walletConnectors/phantomWallet/phantomWallet.js +2 -2
- package/dist/wallets/walletConnectors/rabbyWallet/rabbyWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/ramperWallet/ramperWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safeheronWallet/safeheronWallet.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/tahoWallet/tahoWallet.js +2 -2
- package/dist/wallets/walletConnectors/talismanWallet/talismanWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenaryWallet/tokenaryWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/xdefiWallet/xdefiWallet.js +2 -2
- package/dist/wallets/walletConnectors/zealWallet/zealWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +7 -6
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { FunCheckoutStartingStep } from '~/providers/FunkitCheckoutContext';
|
|
2
3
|
import { type ConnectablePaymentMethodInfo, PaymentMethod, type PaymentMethodAccountInfo, type PaymentMethodBrokerageInfo, type PaymentMethodVirtualBankInfo } from '../../domains/paymentMethods';
|
|
3
4
|
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from './stepTransition';
|
|
4
5
|
export type LoadingAccountState = CheckoutModalCommonState;
|
|
5
|
-
type
|
|
6
|
+
type UserEntryContext<T> = T & {
|
|
6
7
|
newUser?: boolean;
|
|
8
|
+
startingStep?: FunCheckoutStartingStep;
|
|
7
9
|
};
|
|
8
|
-
export type LoadingAccountNext =
|
|
10
|
+
export type LoadingAccountNext = UserEntryContext<{
|
|
9
11
|
chosenPaymentMethod: PaymentMethod.ACCOUNT_BALANCE;
|
|
10
12
|
paymentMethodInfo: PaymentMethodAccountInfo;
|
|
11
13
|
} | {
|
|
@@ -3,7 +3,7 @@ import { type BridgeCustomerNext, type BridgeCustomerState } from '~/modals/Chec
|
|
|
3
3
|
import { type BridgeKycNext, type BridgeKycState } from '~/modals/CheckoutModal/VirtualFiatAccount/BridgeKyc';
|
|
4
4
|
import { type ErrorScreenState } from '~/modals/CheckoutModal/VirtualFiatAccount/ErrorScreen';
|
|
5
5
|
import { type VirtualFiatAccountNext, type VirtualFiatAccountState } from '~/modals/CheckoutModal/VirtualFiatAccount/VirtualFiatAccount';
|
|
6
|
-
import type { FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
|
|
6
|
+
import type { FunCheckoutStartingStep, FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
|
|
7
7
|
import { type FunkitTextCustomizationsConfig } from '../../providers/FunkitConfigContext';
|
|
8
8
|
import { type CheckoutCompleteNext, type CheckoutCompleteState } from './CheckoutComplete/CheckoutComplete';
|
|
9
9
|
import { type CheckoutHelpState } from './CheckoutHelp/CheckoutHelp';
|
|
@@ -68,12 +68,13 @@ interface ModalStepInput<S extends FunCheckoutStep> {
|
|
|
68
68
|
state: CheckoutModalState<S>;
|
|
69
69
|
apiKey: string;
|
|
70
70
|
isDefiMode?: boolean;
|
|
71
|
+
isSourceNavWidgetEnabled: boolean;
|
|
71
72
|
}
|
|
72
73
|
export type ModalStepInfo<S extends FunCheckoutStep> = {
|
|
73
74
|
Component: ComponentType<ModalStepComponentProps<S>>;
|
|
74
75
|
disableBack?: (info: ModalStepInput<S>) => boolean;
|
|
75
76
|
/** Hides the close button in the Dialog Title element */
|
|
76
|
-
hideClose?: boolean;
|
|
77
|
+
hideClose?: (startingStep?: FunCheckoutStartingStep) => boolean;
|
|
77
78
|
onBack?(state: CheckoutModalState<S>, prevState: CheckoutModalState): CheckoutModalState;
|
|
78
79
|
onNext(state: CheckoutModalState<S>, payload: NextPayload<S>): CheckoutModalState;
|
|
79
80
|
showFullHeight?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { Hex } from 'viem';
|
|
3
3
|
import type { FunkitActiveWithdrawalItem, FunkitWithdrawalConfig } from '~/providers/FunkitCheckoutContext';
|
|
4
4
|
import { type WithdrawalFormData } from './useWithdrawal';
|
|
5
5
|
interface WithdrawContentProps {
|
|
@@ -16,6 +16,10 @@ export interface DynamicTargetAssetCandidate {
|
|
|
16
16
|
badgeText?: string;
|
|
17
17
|
targetAssetMinAmount?: number;
|
|
18
18
|
}
|
|
19
|
+
export declare enum FunCheckoutStartingStep {
|
|
20
|
+
SOURCE_CHANGE = "source_change",
|
|
21
|
+
CONFIRMATION = "confirmation"
|
|
22
|
+
}
|
|
19
23
|
export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'generateActionsParams' | 'customRecipient' | 'modalTitle' | 'iconSrc' | 'modalTitleMeta' | 'externalCheckoutUserId'> {
|
|
20
24
|
/** List of contract action params **/
|
|
21
25
|
generateActionsParams?: (targetAssetAmount: number, config?: {
|
|
@@ -41,6 +45,14 @@ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'gen
|
|
|
41
45
|
withdrawalSourceTokenBalance?: () => number;
|
|
42
46
|
/** Whether checkout should be started in Defi mode, which has various flow implications (most importantly targetAssetAmount must be set and is not editable throughout the checkout) */
|
|
43
47
|
isDefiMode?: boolean;
|
|
48
|
+
/** The step at which the checkout process should start */
|
|
49
|
+
startingStep?: FunCheckoutStartingStep;
|
|
50
|
+
/** Symbol of the source token. Required if startingStep is set to FunCheckoutStartingStep.CONFIRMATION. */
|
|
51
|
+
sourceTokenSymbol?: string;
|
|
52
|
+
/** ID of the source chain. Required if startingStep is set to FunCheckoutStartingStep.CONFIRMATION. */
|
|
53
|
+
sourceChain?: string;
|
|
54
|
+
/** Address of the source token on the source chain. Required if startingStep is set to FunCheckoutStartingStep.CONFIRMATION. */
|
|
55
|
+
sourceTokenAddress?: Address;
|
|
44
56
|
/** *****************************
|
|
45
57
|
* Miscellaneous configurations *
|
|
46
58
|
********************************/
|
|
@@ -50,6 +62,9 @@ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'gen
|
|
|
50
62
|
dynamicTargetAssetCandidates?: DynamicTargetAssetCandidate[];
|
|
51
63
|
/** minimal toAmount needed to proceed checkout. Checked after quote */
|
|
52
64
|
targetAssetMinAmount?: number;
|
|
65
|
+
/** For Checkout with Custom Action, QRCode needs special action type
|
|
66
|
+
* to specify the onchain action to execute after deposit */
|
|
67
|
+
qrcodeActionType?: string;
|
|
53
68
|
}
|
|
54
69
|
export interface FunkitWithdrawalConfig {
|
|
55
70
|
/** Title to show in the checkout modal. Defaults to "Checkout" **/
|
package/dist/utils/address.d.ts
CHANGED
|
@@ -6,3 +6,10 @@ export declare const getWalletLabel: (textCustomizations: FunkitTextCustomizatio
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function verifyIsBech32(address: string): Error | undefined;
|
|
8
8
|
export declare function isDydxAddress(address: string): boolean;
|
|
9
|
+
export declare function isAddressSupported(address: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Check if the recipient address is compatible with selected chain
|
|
12
|
+
* Will need to update this as we enable additional chains in the future.
|
|
13
|
+
* This currently works as we only support evm and solana chains for withdrawal.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isAddressCompatibleWithChain(address: string, chainId: number): boolean;
|
package/dist/utils/checkout.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { type Address, type Hex } from 'viem';
|
|
|
5
5
|
import type { UseConfigReturnType } from 'wagmi';
|
|
6
6
|
import type { ServerCheckoutConfig } from '~/domains/clientMetadata';
|
|
7
7
|
import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
|
|
8
|
-
import type
|
|
8
|
+
import { type FunkitCheckoutActionParams, type FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
|
|
9
9
|
export declare const MOONPAY_TIME_ESTIMATE_MS = 120000;
|
|
10
10
|
export declare const MESH_TIME_ESTIMATE_MS = 300000;
|
|
11
11
|
export declare const BANK_TIME_ESTIMATE_MS = 0;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
getWalletConnectConnector
|
|
4
|
-
} from "./chunk-23WIEY36.js";
|
|
5
2
|
import {
|
|
6
3
|
getInjectedConnector,
|
|
7
4
|
hasInjectedProvider
|
|
8
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DNSG5Q7V.js";
|
|
6
|
+
import {
|
|
7
|
+
getWalletConnectConnector
|
|
8
|
+
} from "./chunk-23WIEY36.js";
|
|
9
9
|
|
|
10
10
|
// src/wallets/walletConnectors/clvWallet/clvWallet.ts
|
|
11
11
|
var clvWallet = ({
|
|
@@ -5,50 +5,122 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
getInjectedConnector,
|
|
7
7
|
hasInjectedProvider
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DNSG5Q7V.js";
|
|
9
9
|
|
|
10
10
|
// src/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.ts
|
|
11
11
|
import { isAndroid, isIOS } from "@funkit/utils";
|
|
12
12
|
function isMetaMask(ethereum) {
|
|
13
|
-
if (!ethereum?.isMetaMask)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (ethereum.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (ethereum.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (ethereum.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (ethereum.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (ethereum.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (ethereum.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (ethereum.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (ethereum.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (ethereum.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (ethereum.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (ethereum.
|
|
50
|
-
|
|
51
|
-
|
|
13
|
+
if (!ethereum?.isMetaMask) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
if (ethereum.isBraveWallet && !ethereum._events && !ethereum._state) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (ethereum.isApexWallet) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
if (ethereum.isAvalanche) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
if (ethereum.isBackpack) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (ethereum.isBifrost) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
if (ethereum.isBitKeep) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
if (ethereum.isBitski) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
if (ethereum.isBlockWallet) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (ethereum.isCoinbaseWallet) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
if (ethereum.isDawn) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (ethereum.isEnkrypt) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
if (ethereum.isExodus) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
if (ethereum.isFrame) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
if (ethereum.isFrontier) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
if (ethereum.isGamestop) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
if (ethereum.isHyperPay) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
if (ethereum.isImToken) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (ethereum.isKuCoinWallet) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
if (ethereum.isMathWallet) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
if (ethereum.isNestWallet) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
if (ethereum.isOkxWallet || ethereum.isOKExWallet) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
if (ethereum.isOneInchIOSWallet || ethereum.isOneInchAndroidWallet) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
if (ethereum.isOpera) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
if (ethereum.isPhantom) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
if (ethereum.isPortal) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
if (ethereum.isRabby) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
if (ethereum.isRainbow) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
if (ethereum.isStatus) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
if (ethereum.isTalisman) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
if (ethereum.isTally) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
if (ethereum.isTokenPocket) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
if (ethereum.isTokenary) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (ethereum.isTrust || ethereum.isTrustWallet) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
if (ethereum.isXDEFI) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
if (ethereum.isZeal) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
if (ethereum.isZerion) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
52
124
|
return true;
|
|
53
125
|
}
|
|
54
126
|
var metaMaskWallet = ({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
getInjectedConnector,
|
|
4
|
-
hasInjectedProvider
|
|
5
|
-
} from "./chunk-WRA2DVJ7.js";
|
|
6
2
|
import {
|
|
7
3
|
getWalletConnectConnector
|
|
8
4
|
} from "./chunk-23WIEY36.js";
|
|
5
|
+
import {
|
|
6
|
+
getInjectedConnector,
|
|
7
|
+
hasInjectedProvider
|
|
8
|
+
} from "./chunk-DNSG5Q7V.js";
|
|
9
9
|
|
|
10
10
|
// src/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.ts
|
|
11
11
|
import { isMobile } from "@funkit/utils";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
getWalletConnectConnector
|
|
4
|
-
} from "./chunk-23WIEY36.js";
|
|
5
2
|
import {
|
|
6
3
|
getInjectedConnector,
|
|
7
4
|
hasInjectedProvider
|
|
8
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DNSG5Q7V.js";
|
|
6
|
+
import {
|
|
7
|
+
getWalletConnectConnector
|
|
8
|
+
} from "./chunk-23WIEY36.js";
|
|
9
9
|
|
|
10
10
|
// src/wallets/walletConnectors/bitgetWallet/bitgetWallet.ts
|
|
11
11
|
import { isAndroid } from "@funkit/utils";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
getInjectedConnector,
|
|
4
|
-
hasInjectedProvider
|
|
5
|
-
} from "./chunk-WRA2DVJ7.js";
|
|
6
2
|
import {
|
|
7
3
|
getWalletConnectConnector
|
|
8
4
|
} from "./chunk-23WIEY36.js";
|
|
5
|
+
import {
|
|
6
|
+
getInjectedConnector,
|
|
7
|
+
hasInjectedProvider
|
|
8
|
+
} from "./chunk-DNSG5Q7V.js";
|
|
9
9
|
|
|
10
10
|
// src/wallets/walletConnectors/bifrostWallet/bifrostWallet.ts
|
|
11
11
|
import { isAndroid } from "@funkit/utils";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
getWalletConnectConnector
|
|
4
|
-
} from "./chunk-23WIEY36.js";
|
|
5
2
|
import {
|
|
6
3
|
getInjectedConnector,
|
|
7
4
|
hasInjectedProvider
|
|
8
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DNSG5Q7V.js";
|
|
6
|
+
import {
|
|
7
|
+
getWalletConnectConnector
|
|
8
|
+
} from "./chunk-23WIEY36.js";
|
|
9
9
|
|
|
10
10
|
// src/wallets/walletConnectors/okxWallet/okxWallet.ts
|
|
11
11
|
import { isAndroid } from "@funkit/utils";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
getWalletConnectConnector
|
|
4
|
-
} from "./chunk-23WIEY36.js";
|
|
5
2
|
import {
|
|
6
3
|
getInjectedConnector,
|
|
7
4
|
hasInjectedProvider
|
|
8
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DNSG5Q7V.js";
|
|
6
|
+
import {
|
|
7
|
+
getWalletConnectConnector
|
|
8
|
+
} from "./chunk-23WIEY36.js";
|
|
9
9
|
|
|
10
10
|
// src/wallets/walletConnectors/gateWallet/gateWallet.ts
|
|
11
11
|
import { isAndroid } from "@funkit/utils";
|
|
@@ -5,8 +5,9 @@ import { createConnector } from "wagmi";
|
|
|
5
5
|
import { injected } from "wagmi/connectors";
|
|
6
6
|
function getExplicitInjectedProvider(flag) {
|
|
7
7
|
const _window = typeof window !== "undefined" ? window : void 0;
|
|
8
|
-
if (typeof _window === "undefined" || typeof _window.ethereum === "undefined")
|
|
8
|
+
if (typeof _window === "undefined" || typeof _window.ethereum === "undefined") {
|
|
9
9
|
return;
|
|
10
|
+
}
|
|
10
11
|
const providers = _window.ethereum.providers;
|
|
11
12
|
return providers ? providers.find((provider) => provider[flag]) : _window.ethereum[flag] ? _window.ethereum : void 0;
|
|
12
13
|
}
|
|
@@ -15,20 +16,26 @@ function getWindowProviderNamespace(namespace) {
|
|
|
15
16
|
const [property, ...path] = namespace2.split(".");
|
|
16
17
|
const _provider = provider[property];
|
|
17
18
|
if (_provider) {
|
|
18
|
-
if (path.length === 0)
|
|
19
|
+
if (path.length === 0) {
|
|
20
|
+
return _provider;
|
|
21
|
+
}
|
|
19
22
|
return providerSearch(_provider, path.join("."));
|
|
20
23
|
}
|
|
21
24
|
};
|
|
22
|
-
if (typeof window !== "undefined")
|
|
25
|
+
if (typeof window !== "undefined") {
|
|
26
|
+
return providerSearch(window, namespace);
|
|
27
|
+
}
|
|
23
28
|
}
|
|
24
29
|
function hasInjectedProvider({
|
|
25
30
|
flag,
|
|
26
31
|
namespace
|
|
27
32
|
}) {
|
|
28
|
-
if (namespace && typeof getWindowProviderNamespace(namespace) !== "undefined")
|
|
33
|
+
if (namespace && typeof getWindowProviderNamespace(namespace) !== "undefined") {
|
|
29
34
|
return true;
|
|
30
|
-
|
|
35
|
+
}
|
|
36
|
+
if (flag && typeof getExplicitInjectedProvider(flag) !== "undefined") {
|
|
31
37
|
return true;
|
|
38
|
+
}
|
|
32
39
|
return false;
|
|
33
40
|
}
|
|
34
41
|
function getInjectedProvider({
|
|
@@ -36,18 +43,25 @@ function getInjectedProvider({
|
|
|
36
43
|
namespace
|
|
37
44
|
}) {
|
|
38
45
|
const _window = typeof window !== "undefined" ? window : void 0;
|
|
39
|
-
if (typeof _window === "undefined")
|
|
46
|
+
if (typeof _window === "undefined") {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
40
49
|
if (namespace) {
|
|
41
50
|
const windowProvider = getWindowProviderNamespace(namespace);
|
|
42
|
-
if (windowProvider)
|
|
51
|
+
if (windowProvider) {
|
|
52
|
+
return windowProvider;
|
|
53
|
+
}
|
|
43
54
|
}
|
|
44
55
|
const providers = _window.ethereum?.providers;
|
|
45
56
|
if (flag) {
|
|
46
57
|
const provider = getExplicitInjectedProvider(flag);
|
|
47
|
-
if (provider)
|
|
58
|
+
if (provider) {
|
|
59
|
+
return provider;
|
|
60
|
+
}
|
|
48
61
|
}
|
|
49
|
-
if (typeof providers !== "undefined" && providers.length > 0)
|
|
62
|
+
if (typeof providers !== "undefined" && providers.length > 0) {
|
|
50
63
|
return providers[0];
|
|
64
|
+
}
|
|
51
65
|
return _window.ethereum;
|
|
52
66
|
}
|
|
53
67
|
function createInjectedConnector(provider) {
|