@funkit/connect 2.0.0 → 2.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 +14 -0
- package/dist/index.css +5 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +47 -38
- 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/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-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/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 +61 -61
- 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 +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 2.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c6dd2bd: fix: MoonPayBuyWidget height fix
|
|
8
|
+
|
|
9
|
+
## 2.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 212d32f: feat: conditionally disable zksync source assets for dydx & mantle checkouts
|
|
14
|
+
- 10c3f9e: refactor(connect): web2 login redirects should persist existing query params
|
|
15
|
+
- 116235a: feat: enable bech32 decoding check on dydx addresses
|
|
16
|
+
|
|
3
17
|
## 2.0.0
|
|
4
18
|
|
|
5
19
|
### Major Changes
|
package/dist/index.css
CHANGED
|
@@ -5105,7 +5105,11 @@ input[type=number] {
|
|
|
5105
5105
|
overflow-y: auto;
|
|
5106
5106
|
}
|
|
5107
5107
|
|
|
5108
|
-
/* vanilla-extract-css-ns:src/components/FunPayments/FunPaymentMoonpayType.css.ts.vanilla.css?source=
|
|
5108
|
+
/* vanilla-extract-css-ns:src/components/FunPayments/FunPaymentMoonpayType.css.ts.vanilla.css?source=Ll8xa21wZXlmMCB7CiAgbWF4LWhlaWdodDogMTAwJSAhaW1wb3J0YW50OwogIGhlaWdodDogaW5oZXJpdCAhaW1wb3J0YW50Owp9Ci5fMWttcGV5ZjAgaWZyYW1lIHsKICBib3JkZXI6IG5vbmU7Cn0= */
|
|
5109
|
+
[data-rk] ._1kmpeyf0 {
|
|
5110
|
+
max-height: 100% !important;
|
|
5111
|
+
height: inherit !important;
|
|
5112
|
+
}
|
|
5109
5113
|
[data-rk] ._1kmpeyf0 iframe {
|
|
5110
5114
|
border: none;
|
|
5111
5115
|
}
|
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
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
en_US_default
|
|
4
4
|
} from "./chunk-SW6GAS7K.js";
|
|
5
|
-
import {
|
|
6
|
-
darkTheme
|
|
7
|
-
} from "./chunk-ICLRFHOV.js";
|
|
8
5
|
import {
|
|
9
6
|
lightTheme
|
|
10
7
|
} from "./chunk-FRT63PFR.js";
|
|
8
|
+
import {
|
|
9
|
+
darkTheme
|
|
10
|
+
} from "./chunk-ICLRFHOV.js";
|
|
11
11
|
import "./chunk-I24HX4XM.js";
|
|
12
12
|
|
|
13
13
|
// src/components/ConnectButton/ConnectButton.tsx
|
|
@@ -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";
|
|
@@ -6663,7 +6684,8 @@ function FunPaymentMoonpayType({
|
|
|
6663
6684
|
})) : null, /* @__PURE__ */ React59.createElement(Box, {
|
|
6664
6685
|
display: "flex",
|
|
6665
6686
|
justifyContent: "center",
|
|
6666
|
-
paddingBottom: "24"
|
|
6687
|
+
paddingBottom: "24",
|
|
6688
|
+
style: { minHeight: "65vh", maxHeight: "65vh" }
|
|
6667
6689
|
}, /* @__PURE__ */ React59.createElement(MoonPayBuyWidget, {
|
|
6668
6690
|
variant: "embedded",
|
|
6669
6691
|
baseCurrencyCode: "usd",
|
|
@@ -9698,9 +9720,9 @@ function FunCheckoutModal({
|
|
|
9698
9720
|
const isCanada = userIpInfo ? userIpInfo.alpha2 === "CA" : false;
|
|
9699
9721
|
const originalTargetChainId = checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain.toString();
|
|
9700
9722
|
const moonpayChainId = [
|
|
9701
|
-
|
|
9723
|
+
zkSync3.id.toString(),
|
|
9702
9724
|
mantle2.id.toString(),
|
|
9703
|
-
|
|
9725
|
+
dydxChain2.id.toString()
|
|
9704
9726
|
].includes(originalTargetChainId) ? arbitrum.id.toString() : originalTargetChainId;
|
|
9705
9727
|
const wethAddrOnTargetChain = (await getTokenInfo2("weth", moonpayChainId)).toLowerCase();
|
|
9706
9728
|
const isTargetAssetEthOrWeth = [NATIVE_TOKEN, wethAddrOnTargetChain].includes(
|
|
@@ -14129,6 +14151,7 @@ var PRIVY_AUTH_URL = "https://auth.privy.io";
|
|
|
14129
14151
|
var PRIVY_IFRAME_ID = "privy-funkit-iframe";
|
|
14130
14152
|
var PRIVY_OAUTH_CODE_URL_PARAM = "privy_oauth_code";
|
|
14131
14153
|
var PRIVY_OAUTH_STATE_URL_PARAM = "privy_oauth_state";
|
|
14154
|
+
var PRIVY_OAUTH_PROVIDER_URL_PARAM = "privy_oauth_provider";
|
|
14132
14155
|
var RESEND_EMAIL_TIMEOUT_MS = 3e3;
|
|
14133
14156
|
var getLoginMethodFromCache = () => {
|
|
14134
14157
|
try {
|
|
@@ -14364,7 +14387,11 @@ var FunkitWeb2Provider = ({
|
|
|
14364
14387
|
secondLoginCode: oauthState,
|
|
14365
14388
|
inputLoginMethod: loginMethod
|
|
14366
14389
|
});
|
|
14367
|
-
|
|
14390
|
+
removeSpecificURLParameters([
|
|
14391
|
+
PRIVY_OAUTH_CODE_URL_PARAM,
|
|
14392
|
+
PRIVY_OAUTH_STATE_URL_PARAM,
|
|
14393
|
+
PRIVY_OAUTH_PROVIDER_URL_PARAM
|
|
14394
|
+
]);
|
|
14368
14395
|
} else {
|
|
14369
14396
|
await handleFunkitWeb2Login({ chainId: initChainId });
|
|
14370
14397
|
}
|
|
@@ -14393,7 +14420,7 @@ var FunkitWeb2Provider = ({
|
|
|
14393
14420
|
if (!privy)
|
|
14394
14421
|
throw new Error(ERROR_MESSAGES.PRIVY_NOT_INITIALIZED);
|
|
14395
14422
|
try {
|
|
14396
|
-
const redirectURI = window.location.
|
|
14423
|
+
const redirectURI = window.location.href;
|
|
14397
14424
|
const resp = await privy.auth.oauth.generateURL(
|
|
14398
14425
|
authProvider,
|
|
14399
14426
|
redirectURI
|
|
@@ -16018,7 +16045,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
16018
16045
|
localStorage.setItem(storageKey6, version);
|
|
16019
16046
|
}
|
|
16020
16047
|
function getCurrentSdkVersion() {
|
|
16021
|
-
return "2.0.
|
|
16048
|
+
return "2.0.2";
|
|
16022
16049
|
}
|
|
16023
16050
|
function useFingerprint() {
|
|
16024
16051
|
const fingerprint = useCallback33(() => {
|
|
@@ -16638,24 +16665,6 @@ function FunkitPaymentsIconLine({
|
|
|
16638
16665
|
size
|
|
16639
16666
|
}));
|
|
16640
16667
|
}
|
|
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
16668
|
export {
|
|
16660
16669
|
ConnectButton,
|
|
16661
16670
|
FunkitConnectAuthenticationProvider,
|
|
@@ -16674,10 +16683,10 @@ export {
|
|
|
16674
16683
|
getDefaultChains,
|
|
16675
16684
|
getDefaultTransports,
|
|
16676
16685
|
getDefaultWallets,
|
|
16686
|
+
isDydxAddress,
|
|
16677
16687
|
lightTheme,
|
|
16678
16688
|
useAccountModal,
|
|
16679
16689
|
useActiveTheme,
|
|
16680
|
-
useAddRecentTransaction,
|
|
16681
16690
|
useChainModal,
|
|
16682
16691
|
useConnectModal,
|
|
16683
16692
|
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;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bifrostWallet
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-PJRUHFBT.js";
|
|
5
5
|
import "../chunk-ZOLACFTK.js";
|
|
6
|
-
import "../chunk-ZDU3JFGR.js";
|
|
7
6
|
import "../chunk-F3VCNZXS.js";
|
|
7
|
+
import "../chunk-ZDU3JFGR.js";
|
|
8
8
|
export {
|
|
9
9
|
bifrostWallet
|
|
10
10
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bitgetWallet
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-3R3RNCGE.js";
|
|
5
5
|
import "../chunk-ZOLACFTK.js";
|
|
6
|
-
import "../chunk-ZDU3JFGR.js";
|
|
7
6
|
import "../chunk-F3VCNZXS.js";
|
|
7
|
+
import "../chunk-ZDU3JFGR.js";
|
|
8
8
|
export {
|
|
9
9
|
bitgetWallet
|
|
10
10
|
};
|
|
@@ -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
|
+
};
|