@funkit/connect 2.0.0 → 2.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 +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +42 -34
- package/dist/utils/flags/config.d.ts +8 -2
- package/dist/utils/flags/index.d.ts +2 -0
- package/dist/utils/privyHelper.d.ts +1 -1
- package/dist/wallets/walletConnectors/chunk-2DWBVWFI.js +87 -0
- package/dist/wallets/walletConnectors/chunk-3F5GNHAG.js +182 -0
- package/dist/wallets/walletConnectors/chunk-3R3RNCGE.js +100 -0
- package/dist/wallets/walletConnectors/chunk-5L2OLU3J.js +102 -0
- package/dist/wallets/walletConnectors/chunk-BCXBFAL4.js +98 -0
- package/dist/wallets/walletConnectors/chunk-M4SPCKW4.js +66 -0
- package/dist/wallets/walletConnectors/chunk-MFS6NY6T.js +105 -0
- package/dist/wallets/walletConnectors/chunk-MOAWRDEM.js +95 -0
- package/dist/wallets/walletConnectors/chunk-NK3DYIAB.js +92 -0
- package/dist/wallets/walletConnectors/chunk-OMKARG6Y.js +94 -0
- package/dist/wallets/walletConnectors/chunk-OPO2D6GL.js +102 -0
- package/dist/wallets/walletConnectors/chunk-OXWTS7HX.js +98 -0
- package/dist/wallets/walletConnectors/chunk-PJRUHFBT.js +71 -0
- package/dist/wallets/walletConnectors/chunk-R5GNFRXW.js +96 -0
- package/dist/wallets/walletConnectors/chunk-S2IWMXKX.js +94 -0
- package/dist/wallets/walletConnectors/chunk-WH7S23VZ.js +73 -0
- package/dist/wallets/walletConnectors/chunk-XB2GFXBL.js +107 -0
- package/dist/wallets/walletConnectors/chunk-XUXFYTCV.js +96 -0
- package/dist/wallets/walletConnectors/index.js +60 -60
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 2.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 212d32f: feat: conditionally disable zksync source assets for dydx & mantle checkouts
|
|
8
|
+
- 10c3f9e: refactor(connect): web2 login redirects should persist existing query params
|
|
9
|
+
- 116235a: feat: enable bech32 decoding check on dydx addresses
|
|
10
|
+
|
|
3
11
|
## 2.0.0
|
|
4
12
|
|
|
5
13
|
### Major Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,6 @@ export { cssStringFromTheme } from './css/cssStringFromTheme';
|
|
|
22
22
|
export type { Locale } from './locales/';
|
|
23
23
|
export { darkTheme } from './themes/darkTheme';
|
|
24
24
|
export { lightTheme } from './themes/lightTheme';
|
|
25
|
-
export { useAddRecentTransaction } from './transactions/useAddRecentTransaction';
|
|
26
25
|
export type { FunkitConnectWalletConnectParameters, Wallet, WalletDetailsParams, WalletList, } from './wallets/Wallet';
|
|
27
26
|
export { useFunkitAccount, useFunkitDisconnect, useFunkitSwitchChains, } from './components/FunkitProvider/GeneralWalletProvider';
|
|
27
|
+
export { isDydxAddress } from './utils/isDydxAddress';
|
package/dist/index.js
CHANGED
|
@@ -321,9 +321,11 @@ var validateEmailString = (emailInput) => {
|
|
|
321
321
|
const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
322
322
|
return emailRegex.test(emailInput);
|
|
323
323
|
};
|
|
324
|
-
var
|
|
324
|
+
var removeSpecificURLParameters = (paramsToRemove) => {
|
|
325
325
|
if (window.history.pushState) {
|
|
326
|
-
const
|
|
326
|
+
const url = new URL(window.location.href);
|
|
327
|
+
paramsToRemove.forEach((param) => url.searchParams.delete(param));
|
|
328
|
+
const cleanUrl = url.protocol + "//" + url.host + url.pathname + url.search;
|
|
327
329
|
window.history.pushState({ path: cleanUrl }, "", cleanUrl);
|
|
328
330
|
}
|
|
329
331
|
};
|
|
@@ -420,6 +422,14 @@ var flagConfig = {
|
|
|
420
422
|
["disable_mantle_source_assets" /* DisableMantleSourceAssets */]: {
|
|
421
423
|
type: "boolean",
|
|
422
424
|
default_value: true
|
|
425
|
+
},
|
|
426
|
+
["disable_zksync_source_assets_for_mantle_checkouts" /* DisableZkSyncSourceAssetsForMantleCheckouts */]: {
|
|
427
|
+
type: "boolean",
|
|
428
|
+
default_value: true
|
|
429
|
+
},
|
|
430
|
+
["disable_zksync_source_assets_for_dydx_checkouts" /* DisableZkSyncSourceAssetsForDydxCheckouts */]: {
|
|
431
|
+
type: "boolean",
|
|
432
|
+
default_value: true
|
|
423
433
|
}
|
|
424
434
|
};
|
|
425
435
|
|
|
@@ -1739,9 +1749,9 @@ function useSymbolRefresh() {
|
|
|
1739
1749
|
var useSymbolRefresh_default = useSymbolRefresh;
|
|
1740
1750
|
|
|
1741
1751
|
// src/utils/assets.ts
|
|
1742
|
-
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO } from "@funkit/core";
|
|
1752
|
+
import { dydxChain, FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO } from "@funkit/core";
|
|
1743
1753
|
import { formatUnits } from "viem";
|
|
1744
|
-
import { mantle } from "viem/chains";
|
|
1754
|
+
import { mantle, zkSync } from "viem/chains";
|
|
1745
1755
|
|
|
1746
1756
|
// src/hooks/useCheckoutType.ts
|
|
1747
1757
|
function getCheckoutType(checkoutItem) {
|
|
@@ -1779,14 +1789,23 @@ var getNormalizedTokenBalance = (tokenBalance, decimals) => {
|
|
|
1779
1789
|
return Number(formatUnits(BigInt(tokenBalance), decimals));
|
|
1780
1790
|
};
|
|
1781
1791
|
var isAssetUsableToPayForCheckout = (checkoutItem, paymentMethod, assetChainId, assetTokenAddress, isWeb2Login, isWeb3Login) => {
|
|
1792
|
+
const targetChainId = checkoutItem.initSettings.config.targetChain;
|
|
1782
1793
|
const { isCheckoutPostActionRequired } = getCheckoutType(checkoutItem);
|
|
1783
|
-
const isSameAsPurchasingToken = !isCheckoutPostActionRequired && paymentMethod === "balance" /* ACCOUNT_BALANCE */ &&
|
|
1794
|
+
const isSameAsPurchasingToken = !isCheckoutPostActionRequired && paymentMethod === "balance" /* ACCOUNT_BALANCE */ && targetChainId === assetChainId && checkoutItem.initSettings.config.targetAsset.toLowerCase() === assetTokenAddress.toLowerCase();
|
|
1784
1795
|
const isConnectedAccountSupported = isWeb2Login && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO[assetChainId].isFunWalletSupported || isWeb3Login || !isWeb2Login && !isWeb3Login;
|
|
1796
|
+
const isZkSyncAssetsDisabledForMantleCheckouts = flags.getBool(
|
|
1797
|
+
"disable_zksync_source_assets_for_mantle_checkouts" /* DisableZkSyncSourceAssetsForMantleCheckouts */,
|
|
1798
|
+
true
|
|
1799
|
+
);
|
|
1800
|
+
const isZkSyncAssetsDisabledForDydxCheckouts = flags.getBool(
|
|
1801
|
+
"disable_zksync_source_assets_for_dydx_checkouts" /* DisableZkSyncSourceAssetsForDydxCheckouts */,
|
|
1802
|
+
true
|
|
1803
|
+
);
|
|
1785
1804
|
const isMantleAssetsDisabled = flags.getBool(
|
|
1786
1805
|
"disable_mantle_source_assets" /* DisableMantleSourceAssets */,
|
|
1787
1806
|
true
|
|
1788
1807
|
);
|
|
1789
|
-
const isAssetDisabled = isMantleAssetsDisabled && assetChainId === mantle.id.toString();
|
|
1808
|
+
const isAssetDisabled = isMantleAssetsDisabled && assetChainId === mantle.id.toString() || isZkSyncAssetsDisabledForMantleCheckouts && assetChainId === zkSync.id.toString() && targetChainId === mantle.id.toString() || isZkSyncAssetsDisabledForDydxCheckouts && assetChainId === zkSync.id.toString() && targetChainId === dydxChain.id.toString();
|
|
1790
1809
|
const isPickedChainSupportedForCheckout = isConnectedAccountSupported && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO[assetChainId].isCheckoutSupported && !isAssetDisabled;
|
|
1791
1810
|
const isUsable = !isSameAsPurchasingToken && isPickedChainSupportedForCheckout;
|
|
1792
1811
|
return {
|
|
@@ -2231,7 +2250,7 @@ import {
|
|
|
2231
2250
|
formatEther,
|
|
2232
2251
|
pad
|
|
2233
2252
|
} from "viem";
|
|
2234
|
-
import { zkSync } from "viem/zksync";
|
|
2253
|
+
import { zkSync as zkSync2 } from "viem/zksync";
|
|
2235
2254
|
import { useAccount as useAccount3, useConfig as useConfig2 } from "wagmi";
|
|
2236
2255
|
|
|
2237
2256
|
// src/consts/checkout.ts
|
|
@@ -2565,8 +2584,10 @@ function normalizeSmallUsdNumber(usdNumber) {
|
|
|
2565
2584
|
}
|
|
2566
2585
|
|
|
2567
2586
|
// src/utils/isDydxAddress.ts
|
|
2587
|
+
import { bech32 } from "bech32";
|
|
2568
2588
|
function verifyIsBech32(address) {
|
|
2569
2589
|
try {
|
|
2590
|
+
bech32.decode(address);
|
|
2570
2591
|
} catch (error) {
|
|
2571
2592
|
return error;
|
|
2572
2593
|
}
|
|
@@ -3268,7 +3289,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
3268
3289
|
};
|
|
3269
3290
|
let additionalFeesTokenAmount = 0;
|
|
3270
3291
|
let additionalTimeMs = 0;
|
|
3271
|
-
if (newPaymentMethodInfo.paymentMethod === "balance" /* ACCOUNT_BALANCE */ && isWeb3Login && checkoutItem.selectedSourceAssetInfo.chainId !==
|
|
3292
|
+
if (newPaymentMethodInfo.paymentMethod === "balance" /* ACCOUNT_BALANCE */ && isWeb3Login && checkoutItem.selectedSourceAssetInfo.chainId !== zkSync2.id.toString()) {
|
|
3272
3293
|
let gasEstimateResult = BigInt(0);
|
|
3273
3294
|
const isNativeTokenTransfer = checkoutItem.selectedSourceAssetInfo.address === NATIVE_TOKEN;
|
|
3274
3295
|
logger.log("gasEstimateResult:before", { gasEstimateResult });
|
|
@@ -4689,12 +4710,12 @@ var EditIcon = ({ size = "24" }) => /* @__PURE__ */ React32.createElement("svg",
|
|
|
4689
4710
|
|
|
4690
4711
|
// src/components/FunCheckoutModal/FunCheckoutModal.tsx
|
|
4691
4712
|
import {
|
|
4692
|
-
dydxChain,
|
|
4713
|
+
dydxChain as dydxChain2,
|
|
4693
4714
|
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8,
|
|
4694
4715
|
getTokenInfo as getTokenInfo2
|
|
4695
4716
|
} from "@funkit/core";
|
|
4696
4717
|
import React83, { useCallback as useCallback20, useEffect as useEffect20, useMemo as useMemo22, useState as useState23 } from "react";
|
|
4697
|
-
import { arbitrum, mainnet as mainnet3, mantle as mantle2, zkSync as
|
|
4718
|
+
import { arbitrum, mainnet as mainnet3, mantle as mantle2, zkSync as zkSync3 } from "viem/chains";
|
|
4698
4719
|
|
|
4699
4720
|
// src/hooks/useCheckoutAccountBalanceTransfer.ts
|
|
4700
4721
|
import { useCallback as useCallback9 } from "react";
|
|
@@ -9698,9 +9719,9 @@ function FunCheckoutModal({
|
|
|
9698
9719
|
const isCanada = userIpInfo ? userIpInfo.alpha2 === "CA" : false;
|
|
9699
9720
|
const originalTargetChainId = checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain.toString();
|
|
9700
9721
|
const moonpayChainId = [
|
|
9701
|
-
|
|
9722
|
+
zkSync3.id.toString(),
|
|
9702
9723
|
mantle2.id.toString(),
|
|
9703
|
-
|
|
9724
|
+
dydxChain2.id.toString()
|
|
9704
9725
|
].includes(originalTargetChainId) ? arbitrum.id.toString() : originalTargetChainId;
|
|
9705
9726
|
const wethAddrOnTargetChain = (await getTokenInfo2("weth", moonpayChainId)).toLowerCase();
|
|
9706
9727
|
const isTargetAssetEthOrWeth = [NATIVE_TOKEN, wethAddrOnTargetChain].includes(
|
|
@@ -14129,6 +14150,7 @@ var PRIVY_AUTH_URL = "https://auth.privy.io";
|
|
|
14129
14150
|
var PRIVY_IFRAME_ID = "privy-funkit-iframe";
|
|
14130
14151
|
var PRIVY_OAUTH_CODE_URL_PARAM = "privy_oauth_code";
|
|
14131
14152
|
var PRIVY_OAUTH_STATE_URL_PARAM = "privy_oauth_state";
|
|
14153
|
+
var PRIVY_OAUTH_PROVIDER_URL_PARAM = "privy_oauth_provider";
|
|
14132
14154
|
var RESEND_EMAIL_TIMEOUT_MS = 3e3;
|
|
14133
14155
|
var getLoginMethodFromCache = () => {
|
|
14134
14156
|
try {
|
|
@@ -14364,7 +14386,11 @@ var FunkitWeb2Provider = ({
|
|
|
14364
14386
|
secondLoginCode: oauthState,
|
|
14365
14387
|
inputLoginMethod: loginMethod
|
|
14366
14388
|
});
|
|
14367
|
-
|
|
14389
|
+
removeSpecificURLParameters([
|
|
14390
|
+
PRIVY_OAUTH_CODE_URL_PARAM,
|
|
14391
|
+
PRIVY_OAUTH_STATE_URL_PARAM,
|
|
14392
|
+
PRIVY_OAUTH_PROVIDER_URL_PARAM
|
|
14393
|
+
]);
|
|
14368
14394
|
} else {
|
|
14369
14395
|
await handleFunkitWeb2Login({ chainId: initChainId });
|
|
14370
14396
|
}
|
|
@@ -14393,7 +14419,7 @@ var FunkitWeb2Provider = ({
|
|
|
14393
14419
|
if (!privy)
|
|
14394
14420
|
throw new Error(ERROR_MESSAGES.PRIVY_NOT_INITIALIZED);
|
|
14395
14421
|
try {
|
|
14396
|
-
const redirectURI = window.location.
|
|
14422
|
+
const redirectURI = window.location.href;
|
|
14397
14423
|
const resp = await privy.auth.oauth.generateURL(
|
|
14398
14424
|
authProvider,
|
|
14399
14425
|
redirectURI
|
|
@@ -16018,7 +16044,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
16018
16044
|
localStorage.setItem(storageKey6, version);
|
|
16019
16045
|
}
|
|
16020
16046
|
function getCurrentSdkVersion() {
|
|
16021
|
-
return "2.0.
|
|
16047
|
+
return "2.0.1";
|
|
16022
16048
|
}
|
|
16023
16049
|
function useFingerprint() {
|
|
16024
16050
|
const fingerprint = useCallback33(() => {
|
|
@@ -16638,24 +16664,6 @@ function FunkitPaymentsIconLine({
|
|
|
16638
16664
|
size
|
|
16639
16665
|
}));
|
|
16640
16666
|
}
|
|
16641
|
-
|
|
16642
|
-
// src/transactions/useAddRecentTransaction.ts
|
|
16643
|
-
import { useCallback as useCallback35 } from "react";
|
|
16644
|
-
import { useAccount as useAccount18 } from "wagmi";
|
|
16645
|
-
function useAddRecentTransaction() {
|
|
16646
|
-
const store = useTransactionStore();
|
|
16647
|
-
const { address } = useAccount18();
|
|
16648
|
-
const chainId = useChainId();
|
|
16649
|
-
return useCallback35(
|
|
16650
|
-
(transaction) => {
|
|
16651
|
-
if (!address || !chainId) {
|
|
16652
|
-
throw new Error("No address or chain ID found");
|
|
16653
|
-
}
|
|
16654
|
-
store.addTransaction(address, chainId, transaction);
|
|
16655
|
-
},
|
|
16656
|
-
[store, address, chainId]
|
|
16657
|
-
);
|
|
16658
|
-
}
|
|
16659
16667
|
export {
|
|
16660
16668
|
ConnectButton,
|
|
16661
16669
|
FunkitConnectAuthenticationProvider,
|
|
@@ -16674,10 +16682,10 @@ export {
|
|
|
16674
16682
|
getDefaultChains,
|
|
16675
16683
|
getDefaultTransports,
|
|
16676
16684
|
getDefaultWallets,
|
|
16685
|
+
isDydxAddress,
|
|
16677
16686
|
lightTheme,
|
|
16678
16687
|
useAccountModal,
|
|
16679
16688
|
useActiveTheme,
|
|
16680
|
-
useAddRecentTransaction,
|
|
16681
16689
|
useChainModal,
|
|
16682
16690
|
useConnectModal,
|
|
16683
16691
|
useFunkitAccount,
|
|
@@ -16,12 +16,18 @@ export declare enum FlagKey {
|
|
|
16
16
|
* - “Brokerage or Exchange” → Exchange
|
|
17
17
|
*/
|
|
18
18
|
PaymentMethodCopyV1 = "payment_method_copy_v1",
|
|
19
|
-
/** Whether mantle assets can be used as source asset for payment
|
|
20
|
-
DisableMantleSourceAssets = "disable_mantle_source_assets"
|
|
19
|
+
/** Whether mantle assets can be used as source asset for payment for any checkout */
|
|
20
|
+
DisableMantleSourceAssets = "disable_mantle_source_assets",
|
|
21
|
+
/** Whether zksync assets can be used as source asset for payment in a mantle checkout */
|
|
22
|
+
DisableZkSyncSourceAssetsForMantleCheckouts = "disable_zksync_source_assets_for_mantle_checkouts",
|
|
23
|
+
/** Whether zksync assets can be used as source asset for payment in a dydx checkout */
|
|
24
|
+
DisableZkSyncSourceAssetsForDydxCheckouts = "disable_zksync_source_assets_for_dydx_checkouts"
|
|
21
25
|
}
|
|
22
26
|
export declare const flagConfig: {
|
|
23
27
|
[FlagKey.ConnectSignInShowSocialLabel]: BooleanFlagConfig;
|
|
24
28
|
[FlagKey.SelectPaymentMethodText]: StringFlagConfig;
|
|
25
29
|
[FlagKey.PaymentMethodCopyV1]: BooleanFlagConfig;
|
|
26
30
|
[FlagKey.DisableMantleSourceAssets]: BooleanFlagConfig;
|
|
31
|
+
[FlagKey.DisableZkSyncSourceAssetsForMantleCheckouts]: BooleanFlagConfig;
|
|
32
|
+
[FlagKey.DisableZkSyncSourceAssetsForDydxCheckouts]: BooleanFlagConfig;
|
|
27
33
|
};
|
|
@@ -6,5 +6,7 @@ declare const singleton: FeatureFlag<{
|
|
|
6
6
|
select_payment_method_text: import("./types").StringFlagConfig;
|
|
7
7
|
payment_method_copy_v1: import("./types").BooleanFlagConfig;
|
|
8
8
|
disable_mantle_source_assets: import("./types").BooleanFlagConfig;
|
|
9
|
+
disable_zksync_source_assets_for_mantle_checkouts: import("./types").BooleanFlagConfig;
|
|
10
|
+
disable_zksync_source_assets_for_dydx_checkouts: import("./types").BooleanFlagConfig;
|
|
9
11
|
}>;
|
|
10
12
|
export declare const flags: Pick<typeof singleton, "init" | "getBool" | "getNumber" | "getString">;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const validateEmailString: (emailInput: string) => boolean;
|
|
2
2
|
export declare const validatePhoneString: (phoneInput: string) => boolean;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const removeSpecificURLParameters: (paramsToRemove: string[]) => void;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getInjectedConnector,
|
|
4
|
+
hasInjectedProvider
|
|
5
|
+
} from "./chunk-F3VCNZXS.js";
|
|
6
|
+
import {
|
|
7
|
+
getWalletConnectConnector
|
|
8
|
+
} from "./chunk-ZDU3JFGR.js";
|
|
9
|
+
|
|
10
|
+
// src/wallets/walletConnectors/clvWallet/clvWallet.ts
|
|
11
|
+
var clvWallet = ({
|
|
12
|
+
projectId,
|
|
13
|
+
walletConnectParameters
|
|
14
|
+
}) => {
|
|
15
|
+
const isCLVInjected = hasInjectedProvider({ namespace: "clover" });
|
|
16
|
+
const shouldUseWalletConnect = !isCLVInjected;
|
|
17
|
+
return {
|
|
18
|
+
id: "clv",
|
|
19
|
+
name: "CLV",
|
|
20
|
+
iconUrl: async () => (await import("./clvWallet-RM4V57ZB.js")).default,
|
|
21
|
+
iconBackground: "#fff",
|
|
22
|
+
iconAccent: "#BDFDE2",
|
|
23
|
+
installed: isCLVInjected,
|
|
24
|
+
downloadUrls: {
|
|
25
|
+
chrome: "https://chrome.google.com/webstore/detail/clv-wallet/nhnkbkgjikgcigadomkphalanndcapjk",
|
|
26
|
+
ios: "https://apps.apple.com/app/clover-wallet/id1570072858",
|
|
27
|
+
mobile: "https://apps.apple.com/app/clover-wallet/id1570072858",
|
|
28
|
+
qrCode: "https://clv.org/"
|
|
29
|
+
},
|
|
30
|
+
extension: {
|
|
31
|
+
instructions: {
|
|
32
|
+
learnMoreUrl: "https://clv.org/",
|
|
33
|
+
steps: [
|
|
34
|
+
{
|
|
35
|
+
description: "wallet_connectors.clv.extension.step1.description",
|
|
36
|
+
step: "install",
|
|
37
|
+
title: "wallet_connectors.clv.extension.step1.title"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
description: "wallet_connectors.clv.extension.step2.description",
|
|
41
|
+
step: "create",
|
|
42
|
+
title: "wallet_connectors.clv.extension.step2.title"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
description: "wallet_connectors.clv.extension.step3.description",
|
|
46
|
+
step: "refresh",
|
|
47
|
+
title: "wallet_connectors.clv.extension.step3.title"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
mobile: {
|
|
53
|
+
getUri: shouldUseWalletConnect ? (uri) => uri : void 0
|
|
54
|
+
},
|
|
55
|
+
qrCode: shouldUseWalletConnect ? {
|
|
56
|
+
getUri: (uri) => uri,
|
|
57
|
+
instructions: {
|
|
58
|
+
learnMoreUrl: "https://clv.org/",
|
|
59
|
+
steps: [
|
|
60
|
+
{
|
|
61
|
+
description: "wallet_connectors.clv.qr_code.step1.description",
|
|
62
|
+
step: "install",
|
|
63
|
+
title: "wallet_connectors.clv.qr_code.step1.title"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
description: "wallet_connectors.clv.qr_code.step2.description",
|
|
67
|
+
step: "create",
|
|
68
|
+
title: "wallet_connectors.clv.qr_code.step2.title"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
description: "wallet_connectors.clv.qr_code.step3.description",
|
|
72
|
+
step: "scan",
|
|
73
|
+
title: "wallet_connectors.clv.qr_code.step3.title"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
} : void 0,
|
|
78
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
79
|
+
projectId,
|
|
80
|
+
walletConnectParameters
|
|
81
|
+
}) : getInjectedConnector({ namespace: "clover" })
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export {
|
|
86
|
+
clvWallet
|
|
87
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
isAndroid,
|
|
4
|
+
isIOS
|
|
5
|
+
} from "./chunk-ZOLACFTK.js";
|
|
6
|
+
import {
|
|
7
|
+
getInjectedConnector,
|
|
8
|
+
hasInjectedProvider
|
|
9
|
+
} from "./chunk-F3VCNZXS.js";
|
|
10
|
+
import {
|
|
11
|
+
getWalletConnectConnector
|
|
12
|
+
} from "./chunk-ZDU3JFGR.js";
|
|
13
|
+
|
|
14
|
+
// src/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.ts
|
|
15
|
+
function isMetaMask(ethereum) {
|
|
16
|
+
if (!(ethereum == null ? void 0 : ethereum.isMetaMask))
|
|
17
|
+
return false;
|
|
18
|
+
if (ethereum.isBraveWallet && !ethereum._events && !ethereum._state)
|
|
19
|
+
return false;
|
|
20
|
+
if (ethereum.isApexWallet)
|
|
21
|
+
return false;
|
|
22
|
+
if (ethereum.isAvalanche)
|
|
23
|
+
return false;
|
|
24
|
+
if (ethereum.isBackpack)
|
|
25
|
+
return false;
|
|
26
|
+
if (ethereum.isBifrost)
|
|
27
|
+
return false;
|
|
28
|
+
if (ethereum.isBitKeep)
|
|
29
|
+
return false;
|
|
30
|
+
if (ethereum.isBitski)
|
|
31
|
+
return false;
|
|
32
|
+
if (ethereum.isBlockWallet)
|
|
33
|
+
return false;
|
|
34
|
+
if (ethereum.isCoinbaseWallet)
|
|
35
|
+
return false;
|
|
36
|
+
if (ethereum.isDawn)
|
|
37
|
+
return false;
|
|
38
|
+
if (ethereum.isEnkrypt)
|
|
39
|
+
return false;
|
|
40
|
+
if (ethereum.isExodus)
|
|
41
|
+
return false;
|
|
42
|
+
if (ethereum.isFrame)
|
|
43
|
+
return false;
|
|
44
|
+
if (ethereum.isFrontier)
|
|
45
|
+
return false;
|
|
46
|
+
if (ethereum.isGamestop)
|
|
47
|
+
return false;
|
|
48
|
+
if (ethereum.isHyperPay)
|
|
49
|
+
return false;
|
|
50
|
+
if (ethereum.isImToken)
|
|
51
|
+
return false;
|
|
52
|
+
if (ethereum.isKuCoinWallet)
|
|
53
|
+
return false;
|
|
54
|
+
if (ethereum.isMathWallet)
|
|
55
|
+
return false;
|
|
56
|
+
if (ethereum.isNestWallet)
|
|
57
|
+
return false;
|
|
58
|
+
if (ethereum.isOkxWallet || ethereum.isOKExWallet)
|
|
59
|
+
return false;
|
|
60
|
+
if (ethereum.isOneInchIOSWallet || ethereum.isOneInchAndroidWallet)
|
|
61
|
+
return false;
|
|
62
|
+
if (ethereum.isOpera)
|
|
63
|
+
return false;
|
|
64
|
+
if (ethereum.isPhantom)
|
|
65
|
+
return false;
|
|
66
|
+
if (ethereum.isPortal)
|
|
67
|
+
return false;
|
|
68
|
+
if (ethereum.isRabby)
|
|
69
|
+
return false;
|
|
70
|
+
if (ethereum.isRainbow)
|
|
71
|
+
return false;
|
|
72
|
+
if (ethereum.isStatus)
|
|
73
|
+
return false;
|
|
74
|
+
if (ethereum.isTalisman)
|
|
75
|
+
return false;
|
|
76
|
+
if (ethereum.isTally)
|
|
77
|
+
return false;
|
|
78
|
+
if (ethereum.isTokenPocket)
|
|
79
|
+
return false;
|
|
80
|
+
if (ethereum.isTokenary)
|
|
81
|
+
return false;
|
|
82
|
+
if (ethereum.isTrust || ethereum.isTrustWallet)
|
|
83
|
+
return false;
|
|
84
|
+
if (ethereum.isXDEFI)
|
|
85
|
+
return false;
|
|
86
|
+
if (ethereum.isZeal)
|
|
87
|
+
return false;
|
|
88
|
+
if (ethereum.isZerion)
|
|
89
|
+
return false;
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
var metaMaskWallet = ({
|
|
93
|
+
projectId,
|
|
94
|
+
walletConnectParameters
|
|
95
|
+
}) => {
|
|
96
|
+
var _a, _b, _c;
|
|
97
|
+
const isMetaMaskInjected = hasInjectedProvider({ flag: "isMetaMask" });
|
|
98
|
+
const shouldUseWalletConnect = !isMetaMaskInjected;
|
|
99
|
+
const getUri = (uri) => {
|
|
100
|
+
return isAndroid() ? uri : isIOS() ? `metamask://wc?uri=${encodeURIComponent(uri)}` : `https://metamask.app.link/wc?uri=${encodeURIComponent(uri)}`;
|
|
101
|
+
};
|
|
102
|
+
return {
|
|
103
|
+
id: "metaMask",
|
|
104
|
+
name: "MetaMask",
|
|
105
|
+
rdns: "io.metamask",
|
|
106
|
+
iconUrl: async () => (await import("./metaMaskWallet-ORHUNQRP.js")).default,
|
|
107
|
+
iconAccent: "#f6851a",
|
|
108
|
+
iconBackground: "#fff",
|
|
109
|
+
installed: !shouldUseWalletConnect ? isMetaMaskInjected : void 0,
|
|
110
|
+
downloadUrls: {
|
|
111
|
+
android: "https://play.google.com/store/apps/details?id=io.metamask",
|
|
112
|
+
ios: "https://apps.apple.com/us/app/metamask/id1438144202",
|
|
113
|
+
mobile: "https://metamask.io/download",
|
|
114
|
+
qrCode: "https://metamask.io/download",
|
|
115
|
+
chrome: "https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",
|
|
116
|
+
edge: "https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",
|
|
117
|
+
firefox: "https://addons.mozilla.org/firefox/addon/ether-metamask",
|
|
118
|
+
opera: "https://addons.opera.com/extensions/details/metamask-10",
|
|
119
|
+
browserExtension: "https://metamask.io/download"
|
|
120
|
+
},
|
|
121
|
+
mobile: {
|
|
122
|
+
getUri: shouldUseWalletConnect ? getUri : void 0
|
|
123
|
+
},
|
|
124
|
+
qrCode: shouldUseWalletConnect ? {
|
|
125
|
+
getUri,
|
|
126
|
+
instructions: {
|
|
127
|
+
learnMoreUrl: "https://metamask.io/faqs/",
|
|
128
|
+
steps: [
|
|
129
|
+
{
|
|
130
|
+
description: "wallet_connectors.metamask.qr_code.step1.description",
|
|
131
|
+
step: "install",
|
|
132
|
+
title: "wallet_connectors.metamask.qr_code.step1.title"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
description: "wallet_connectors.metamask.qr_code.step2.description",
|
|
136
|
+
step: "create",
|
|
137
|
+
title: "wallet_connectors.metamask.qr_code.step2.title"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
description: "wallet_connectors.metamask.qr_code.step3.description",
|
|
141
|
+
step: "refresh",
|
|
142
|
+
title: "wallet_connectors.metamask.qr_code.step3.title"
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
} : void 0,
|
|
147
|
+
extension: {
|
|
148
|
+
instructions: {
|
|
149
|
+
learnMoreUrl: "https://metamask.io/faqs/",
|
|
150
|
+
steps: [
|
|
151
|
+
{
|
|
152
|
+
description: "wallet_connectors.metamask.extension.step1.description",
|
|
153
|
+
step: "install",
|
|
154
|
+
title: "wallet_connectors.metamask.extension.step1.title"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
description: "wallet_connectors.metamask.extension.step2.description",
|
|
158
|
+
step: "create",
|
|
159
|
+
title: "wallet_connectors.metamask.extension.step2.title"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
description: "wallet_connectors.metamask.extension.step3.description",
|
|
163
|
+
step: "refresh",
|
|
164
|
+
title: "wallet_connectors.metamask.extension.step3.title"
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
170
|
+
projectId,
|
|
171
|
+
walletConnectParameters
|
|
172
|
+
}) : getInjectedConnector({
|
|
173
|
+
target: typeof window !== "undefined" ? (_c = (_b = (_a = window.ethereum) == null ? void 0 : _a.providers) == null ? void 0 : _b.find(
|
|
174
|
+
isMetaMask
|
|
175
|
+
)) != null ? _c : window.ethereum : void 0
|
|
176
|
+
})
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export {
|
|
181
|
+
metaMaskWallet
|
|
182
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
isAndroid
|
|
4
|
+
} from "./chunk-ZOLACFTK.js";
|
|
5
|
+
import {
|
|
6
|
+
getInjectedConnector,
|
|
7
|
+
hasInjectedProvider
|
|
8
|
+
} from "./chunk-F3VCNZXS.js";
|
|
9
|
+
import {
|
|
10
|
+
getWalletConnectConnector
|
|
11
|
+
} from "./chunk-ZDU3JFGR.js";
|
|
12
|
+
|
|
13
|
+
// src/wallets/walletConnectors/bitgetWallet/bitgetWallet.ts
|
|
14
|
+
var bitgetWallet = ({
|
|
15
|
+
projectId,
|
|
16
|
+
walletConnectParameters
|
|
17
|
+
}) => {
|
|
18
|
+
const isBitKeepInjected = hasInjectedProvider({
|
|
19
|
+
namespace: "bitkeep.ethereum",
|
|
20
|
+
flag: "isBitKeep"
|
|
21
|
+
});
|
|
22
|
+
const shouldUseWalletConnect = !isBitKeepInjected;
|
|
23
|
+
return {
|
|
24
|
+
id: "bitget",
|
|
25
|
+
name: "Bitget Wallet",
|
|
26
|
+
iconUrl: async () => (await import("./bitgetWallet-JVNCB4EB.js")).default,
|
|
27
|
+
iconAccent: "#f6851a",
|
|
28
|
+
iconBackground: "#fff",
|
|
29
|
+
installed: !shouldUseWalletConnect ? isBitKeepInjected : void 0,
|
|
30
|
+
downloadUrls: {
|
|
31
|
+
android: "https://web3.bitget.com/en/wallet-download?type=0",
|
|
32
|
+
ios: "https://apps.apple.com/app/bitkeep/id1395301115",
|
|
33
|
+
mobile: "https://web3.bitget.com/en/wallet-download?type=2",
|
|
34
|
+
qrCode: "https://web3.bitget.com/en/wallet-download",
|
|
35
|
+
chrome: "https://chrome.google.com/webstore/detail/bitkeep-crypto-nft-wallet/jiidiaalihmmhddjgbnbgdfflelocpak",
|
|
36
|
+
browserExtension: "https://web3.bitget.com/en/wallet-download"
|
|
37
|
+
},
|
|
38
|
+
extension: {
|
|
39
|
+
instructions: {
|
|
40
|
+
learnMoreUrl: "https://web3.bitget.com/en/academy",
|
|
41
|
+
steps: [
|
|
42
|
+
{
|
|
43
|
+
description: "wallet_connectors.bitget.extension.step1.description",
|
|
44
|
+
step: "install",
|
|
45
|
+
title: "wallet_connectors.bitget.extension.step1.title"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
description: "wallet_connectors.bitget.extension.step2.description",
|
|
49
|
+
step: "create",
|
|
50
|
+
title: "wallet_connectors.bitget.extension.step2.title"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
description: "wallet_connectors.bitget.extension.step3.description",
|
|
54
|
+
step: "refresh",
|
|
55
|
+
title: "wallet_connectors.bitget.extension.step3.description"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
mobile: {
|
|
61
|
+
getUri: shouldUseWalletConnect ? (uri) => {
|
|
62
|
+
return isAndroid() ? uri : `bitkeep://wc?uri=${encodeURIComponent(uri)}`;
|
|
63
|
+
} : void 0
|
|
64
|
+
},
|
|
65
|
+
qrCode: shouldUseWalletConnect ? {
|
|
66
|
+
getUri: (uri) => uri,
|
|
67
|
+
instructions: {
|
|
68
|
+
learnMoreUrl: "https://web3.bitget.com/en/academy",
|
|
69
|
+
steps: [
|
|
70
|
+
{
|
|
71
|
+
description: "wallet_connectors.bitget.qr_code.step1.description",
|
|
72
|
+
step: "install",
|
|
73
|
+
title: "wallet_connectors.bitget.qr_code.step1.title"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
description: "wallet_connectors.bitget.qr_code.step2.description",
|
|
77
|
+
step: "create",
|
|
78
|
+
title: "wallet_connectors.bitget.qr_code.step2.title"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
description: "wallet_connectors.bitget.qr_code.step3.description",
|
|
82
|
+
step: "scan",
|
|
83
|
+
title: "wallet_connectors.bitget.qr_code.step3.title"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
} : void 0,
|
|
88
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
89
|
+
projectId,
|
|
90
|
+
walletConnectParameters
|
|
91
|
+
}) : getInjectedConnector({
|
|
92
|
+
namespace: "bitkeep.ethereum",
|
|
93
|
+
flag: "isBitKeep"
|
|
94
|
+
})
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export {
|
|
99
|
+
bitgetWallet
|
|
100
|
+
};
|