@funkit/connect 1.2.0 → 1.2.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 +22 -0
- package/dist/components/ProfileDetails/FunProfileViews/Settings/Settings.d.ts +1 -2
- package/dist/config/getDefaultConfig.d.ts +32 -2
- package/dist/index.js +214 -226
- package/dist/klaytn-TJOHMGUS.js +6 -0
- package/dist/manta-JIF2AIAW.js +6 -0
- package/dist/mantle-RXIQTLNV.js +6 -0
- package/dist/wallets/Wallet.d.ts +1 -2
- package/dist/wallets/connectorsForWallets.d.ts +1 -3
- 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-JRABHUUZ.js → chunk-MD5OPFAT.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/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/funkitConnectWallet/funkitConnectWallet.d.ts +1 -5
- package/dist/wallets/walletConnectors/funkitConnectWallet/funkitConnectWallet.js +2 -8
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +73 -73
- 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/tokenaryWallet/tokenaryWallet.js +1 -1
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +4 -4
- package/dist/wallets/walletConnectors/chunk-2DWBVWFI.js +0 -87
- package/dist/wallets/walletConnectors/chunk-32KBKKGT.js +0 -182
- package/dist/wallets/walletConnectors/chunk-3CLNL7LR.js +0 -73
- package/dist/wallets/walletConnectors/chunk-3F5GNHAG.js +0 -182
- package/dist/wallets/walletConnectors/chunk-3R3RNCGE.js +0 -100
- package/dist/wallets/walletConnectors/chunk-5L2OLU3J.js +0 -102
- package/dist/wallets/walletConnectors/chunk-7GGRZNT3.js +0 -96
- package/dist/wallets/walletConnectors/chunk-7YDZTPO4.js +0 -100
- package/dist/wallets/walletConnectors/chunk-BCXBFAL4.js +0 -98
- package/dist/wallets/walletConnectors/chunk-CMXZK5RR.js +0 -94
- package/dist/wallets/walletConnectors/chunk-F4EJ42XO.js +0 -105
- package/dist/wallets/walletConnectors/chunk-FL2VIO76.js +0 -71
- package/dist/wallets/walletConnectors/chunk-IIJOJ6AD.js +0 -102
- package/dist/wallets/walletConnectors/chunk-KZFAL4RZ.js +0 -27
- package/dist/wallets/walletConnectors/chunk-LJRV5JY7.js +0 -95
- package/dist/wallets/walletConnectors/chunk-M4SPCKW4.js +0 -66
- package/dist/wallets/walletConnectors/chunk-MFS6NY6T.js +0 -105
- package/dist/wallets/walletConnectors/chunk-MOAWRDEM.js +0 -95
- package/dist/wallets/walletConnectors/chunk-MSRKKVDE.js +0 -98
- package/dist/wallets/walletConnectors/chunk-NK3DYIAB.js +0 -92
- package/dist/wallets/walletConnectors/chunk-OMKARG6Y.js +0 -94
- package/dist/wallets/walletConnectors/chunk-OPO2D6GL.js +0 -102
- package/dist/wallets/walletConnectors/chunk-OXWTS7HX.js +0 -98
- package/dist/wallets/walletConnectors/chunk-PJRUHFBT.js +0 -71
- package/dist/wallets/walletConnectors/chunk-R5GNFRXW.js +0 -96
- package/dist/wallets/walletConnectors/chunk-S2IWMXKX.js +0 -94
- package/dist/wallets/walletConnectors/chunk-WH7S23VZ.js +0 -73
- package/dist/wallets/walletConnectors/chunk-XB2GFXBL.js +0 -107
- package/dist/wallets/walletConnectors/chunk-XUXFYTCV.js +0 -96
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-RRG76BJM.js";
|
|
8
5
|
import {
|
|
9
6
|
lightTheme
|
|
10
7
|
} from "./chunk-UDJBGTFV.js";
|
|
8
|
+
import {
|
|
9
|
+
darkTheme
|
|
10
|
+
} from "./chunk-RRG76BJM.js";
|
|
11
11
|
import "./chunk-FECCKVZV.js";
|
|
12
12
|
|
|
13
13
|
// src/components/ConnectButton/ConnectButton.tsx
|
|
@@ -45,7 +45,7 @@ function touchablePrimaryStyles({
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// src/hooks/useConnectionStatus.ts
|
|
48
|
-
import { useAccount as
|
|
48
|
+
import { useAccount as useAccount12 } from "wagmi";
|
|
49
49
|
|
|
50
50
|
// src/components/FunkitProvider/AuthenticationContext.tsx
|
|
51
51
|
import React, {
|
|
@@ -139,7 +139,7 @@ import React143, {
|
|
|
139
139
|
useMemo as useMemo34,
|
|
140
140
|
useState as useState40
|
|
141
141
|
} from "react";
|
|
142
|
-
import { useConnect as useConnect2, useDisconnect as useDisconnect3 } from "wagmi";
|
|
142
|
+
import { useConfig as useConfig5, useConnect as useConnect2, useDisconnect as useDisconnect3 } from "wagmi";
|
|
143
143
|
|
|
144
144
|
// src/consts/funkit.ts
|
|
145
145
|
import {
|
|
@@ -660,10 +660,22 @@ var hardhatIcon = {
|
|
|
660
660
|
iconBackground: "#f9f7ec",
|
|
661
661
|
iconUrl: async () => (await import("./hardhat-KHA6XAVO.js")).default
|
|
662
662
|
};
|
|
663
|
+
var klaytnIcon = {
|
|
664
|
+
iconBackground: "transparent",
|
|
665
|
+
iconUrl: async () => (await import("./klaytn-TJOHMGUS.js")).default
|
|
666
|
+
};
|
|
663
667
|
var optimismIcon = {
|
|
664
668
|
iconBackground: "#ff5a57",
|
|
665
669
|
iconUrl: async () => (await import("./optimism-D4AW5EQB.js")).default
|
|
666
670
|
};
|
|
671
|
+
var mantaIcon = {
|
|
672
|
+
iconBackground: "#ffffff",
|
|
673
|
+
iconUrl: async () => (await import("./manta-JIF2AIAW.js")).default
|
|
674
|
+
};
|
|
675
|
+
var mantleIcon = {
|
|
676
|
+
iconBackground: "#000000",
|
|
677
|
+
iconUrl: async () => (await import("./mantle-RXIQTLNV.js")).default
|
|
678
|
+
};
|
|
667
679
|
var polygonIcon = {
|
|
668
680
|
iconBackground: "#9f71ec",
|
|
669
681
|
iconUrl: async () => (await import("./polygon-ODE634XZ.js")).default
|
|
@@ -707,8 +719,15 @@ var chainMetadataByName = {
|
|
|
707
719
|
hardhat: { chainId: 31337, ...hardhatIcon },
|
|
708
720
|
holesky: { chainId: 17e3, ...ethereumIcon },
|
|
709
721
|
kovan: { chainId: 42, ...ethereumIcon },
|
|
722
|
+
klaytn: { chainId: 8217, name: "Klaytn", ...klaytnIcon },
|
|
723
|
+
klaytnBaobab: { chainId: 1001, name: "Klaytn Baobab", ...klaytnIcon },
|
|
710
724
|
localhost: { chainId: 1337, ...ethereumIcon },
|
|
711
725
|
mainnet: { chainId: 1, name: "Ethereum", ...ethereumIcon },
|
|
726
|
+
manta: { chainId: 169, name: "Manta", ...mantaIcon },
|
|
727
|
+
mantaSepolia: { chainId: 3441006, ...mantaIcon },
|
|
728
|
+
mantaTestnet: { chainId: 3441005, ...mantaIcon },
|
|
729
|
+
mantle: { chainId: 5e3, ...mantleIcon },
|
|
730
|
+
mantleTestnet: { chainId: 5001, ...mantleIcon },
|
|
712
731
|
optimism: { chainId: 10, name: "Optimism", ...optimismIcon },
|
|
713
732
|
optimismGoerli: { chainId: 420, ...optimismIcon },
|
|
714
733
|
optimismKovan: { chainId: 69, ...optimismIcon },
|
|
@@ -798,7 +817,7 @@ import React142, {
|
|
|
798
817
|
useMemo as useMemo33,
|
|
799
818
|
useState as useState39
|
|
800
819
|
} from "react";
|
|
801
|
-
import { useAccount as
|
|
820
|
+
import { useAccount as useAccount11, useAccountEffect as useAccountEffect2, useConfig as useConfig4 } from "wagmi";
|
|
802
821
|
|
|
803
822
|
// src/utils/checkoutHistory.ts
|
|
804
823
|
var combineDepositAddressAndInitialPage = ({
|
|
@@ -1404,6 +1423,8 @@ function DialogContent({
|
|
|
1404
1423
|
import { getAllWalletTokens } from "@funkit/api-base";
|
|
1405
1424
|
import {
|
|
1406
1425
|
Auth,
|
|
1426
|
+
Chain,
|
|
1427
|
+
configureEnvironment as configureEnvironment2,
|
|
1407
1428
|
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO2,
|
|
1408
1429
|
FunWallet
|
|
1409
1430
|
} from "@funkit/core";
|
|
@@ -1670,6 +1691,9 @@ function GeneralWalletProvider({ children }) {
|
|
|
1670
1691
|
const provider = await ((_c = connector == null ? void 0 : connector.getProvider) == null ? void 0 : _c.call(connector));
|
|
1671
1692
|
if (!provider)
|
|
1672
1693
|
return;
|
|
1694
|
+
await configureEnvironment2({
|
|
1695
|
+
chain: await Chain.getChain({ chainIdentifier: activeChain == null ? void 0 : activeChain.id })
|
|
1696
|
+
});
|
|
1673
1697
|
newFunWalletAuth = new Auth({ provider });
|
|
1674
1698
|
newFunWallet = new FunWallet({
|
|
1675
1699
|
users: [{ userId: await newFunWalletAuth.getAddress() }],
|
|
@@ -1909,7 +1933,7 @@ import {
|
|
|
1909
1933
|
} from "@funkit/api-base";
|
|
1910
1934
|
import {
|
|
1911
1935
|
addOwnerTxParams,
|
|
1912
|
-
Chain,
|
|
1936
|
+
Chain as Chain2,
|
|
1913
1937
|
ContractInterface,
|
|
1914
1938
|
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5,
|
|
1915
1939
|
getDecimals,
|
|
@@ -1934,7 +1958,7 @@ import {
|
|
|
1934
1958
|
formatEther,
|
|
1935
1959
|
pad
|
|
1936
1960
|
} from "viem";
|
|
1937
|
-
import { useConfig as useConfig2 } from "wagmi";
|
|
1961
|
+
import { useAccount as useAccount3, useConfig as useConfig2 } from "wagmi";
|
|
1938
1962
|
|
|
1939
1963
|
// src/consts/checkout.ts
|
|
1940
1964
|
var CHECKOUT_STEP_MESSAGE_GENERATOR = {
|
|
@@ -2575,6 +2599,7 @@ var ONE_MINUTE_MS = 6e4;
|
|
|
2575
2599
|
function FunkitCheckoutProvider({ children }) {
|
|
2576
2600
|
const funkitConfig = useFunkitConfig();
|
|
2577
2601
|
const wagmiConfig = useConfig2();
|
|
2602
|
+
const { connector } = useAccount3();
|
|
2578
2603
|
const {
|
|
2579
2604
|
walletAddress,
|
|
2580
2605
|
accountBalancePaymentDefaultInfo,
|
|
@@ -2585,6 +2610,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
2585
2610
|
isWeb3Login,
|
|
2586
2611
|
isUserLoggedIn
|
|
2587
2612
|
} = useGeneralWallet();
|
|
2613
|
+
const { switchChainAsync } = useFunkitSwitchChains({});
|
|
2588
2614
|
const [activeCheckouts, setActiveCheckouts] = useState10({});
|
|
2589
2615
|
const [checkoutHistoryList, setCheckoutHistoryList] = useState10([]);
|
|
2590
2616
|
const {
|
|
@@ -2701,7 +2727,10 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
2701
2727
|
config: {
|
|
2702
2728
|
...initSettings.config,
|
|
2703
2729
|
targetAsset: initSettings.config.targetAsset.toLowerCase(),
|
|
2704
|
-
|
|
2730
|
+
targetChain: initSettings.config.targetChain.toString(),
|
|
2731
|
+
targetAssetAmount: parseFloat(
|
|
2732
|
+
(initSettings.config.targetAssetAmount || 0).toString()
|
|
2733
|
+
) || 0
|
|
2705
2734
|
}
|
|
2706
2735
|
},
|
|
2707
2736
|
isFastForwarded
|
|
@@ -3138,7 +3167,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
3138
3167
|
});
|
|
3139
3168
|
logger.log("originalTxParamsList", { txParamsList });
|
|
3140
3169
|
if (isWeb3Login) {
|
|
3141
|
-
const funChainItem = await
|
|
3170
|
+
const funChainItem = await Chain2.getChain({
|
|
3142
3171
|
chainIdentifier: assetChainId
|
|
3143
3172
|
});
|
|
3144
3173
|
const [funWalletAddress, isFunWalletInited, funRbacContractAddr] = await Promise.all([
|
|
@@ -3226,7 +3255,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
3226
3255
|
);
|
|
3227
3256
|
const _confirmCheckout = useCallback7(
|
|
3228
3257
|
async (checkoutId, shouldbatchOpBypassInit, stepMessageSetter) => {
|
|
3229
|
-
var _a, _b, _c;
|
|
3258
|
+
var _a, _b, _c, _d, _e;
|
|
3230
3259
|
if (!(funkitConfig == null ? void 0 : funkitConfig.apiKey)) {
|
|
3231
3260
|
throw new Error(
|
|
3232
3261
|
`Funkit Internal Error: Unable to detect funkit api key`
|
|
@@ -3243,6 +3272,12 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
3243
3272
|
const { isCheckoutPostActionRequired } = getCheckoutType(checkoutItem);
|
|
3244
3273
|
logger.log("beforeSignatureChecks", { isCheckoutPostActionRequired });
|
|
3245
3274
|
if (isCheckoutPostActionRequired) {
|
|
3275
|
+
const currentChainId = await ((_b = connector == null ? void 0 : connector.getChainId()) == null ? void 0 : _b.toString());
|
|
3276
|
+
if (!FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5[checkoutItem.initSettings.config.targetChain].isStandardEvmAddress || currentChainId && !((_c = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5[currentChainId]) == null ? void 0 : _c.isStandardEvmAddress)) {
|
|
3277
|
+
await switchChainAsync({
|
|
3278
|
+
chainId: parseInt(checkoutItem.initSettings.config.targetChain)
|
|
3279
|
+
});
|
|
3280
|
+
}
|
|
3246
3281
|
const signedBatchOperation = await _generateSignedBatchOperation(
|
|
3247
3282
|
checkoutItem.initSettings.config.actionsParams,
|
|
3248
3283
|
checkoutItem.initSettings.config.targetChain,
|
|
@@ -3266,7 +3301,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
3266
3301
|
}),
|
|
3267
3302
|
clientMetadata: _generateClientMetadataForBackend(checkoutId)
|
|
3268
3303
|
});
|
|
3269
|
-
(
|
|
3304
|
+
(_e = (_d = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _d.onConfirmation) == null ? void 0 : _e.call(_d);
|
|
3270
3305
|
logger.log("checkoutConfirmed", { depositAddress });
|
|
3271
3306
|
setActiveCheckouts({
|
|
3272
3307
|
...activeCheckouts,
|
|
@@ -3458,6 +3493,7 @@ var useFunkitCheckout = (props) => {
|
|
|
3458
3493
|
const [pendingCheckoutConfig, setPendingCheckoutConfig] = useState10();
|
|
3459
3494
|
const beginCheckout = useCallback7(
|
|
3460
3495
|
async (inputConfig) => {
|
|
3496
|
+
var _a, _b;
|
|
3461
3497
|
const combinedConfig = {
|
|
3462
3498
|
...propsConfig || {},
|
|
3463
3499
|
...inputConfig || {}
|
|
@@ -3476,7 +3512,7 @@ var useFunkitCheckout = (props) => {
|
|
|
3476
3512
|
if (isUserLoggedIn || !!finalConfig.customRecipient) {
|
|
3477
3513
|
setPendingCheckoutConfig(void 0);
|
|
3478
3514
|
if (isUserLoggedIn) {
|
|
3479
|
-
if (!FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5[finalConfig.targetChain].isMainnet) {
|
|
3515
|
+
if (!((_b = (_a = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5) == null ? void 0 : _a[finalConfig.targetChain]) == null ? void 0 : _b.isMainnet)) {
|
|
3480
3516
|
onErrorWrapper == null ? void 0 : onErrorWrapper({
|
|
3481
3517
|
type: "error",
|
|
3482
3518
|
message: "Unable to begin a new checkout: Insufficient funds on testnet account",
|
|
@@ -3875,7 +3911,11 @@ var ASSET_LOGO_SRCS = {
|
|
|
3875
3911
|
PENDLE: "https://assets.coingecko.com/coins/images/15069/large/Pendle_Logo_Normal-03.png?1696514728",
|
|
3876
3912
|
WEETH: "https://assets.coingecko.com/coins/images/33033/large/weETH.png?1701438396",
|
|
3877
3913
|
GMX: "https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/arbitrum/assets/0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a/logo.png",
|
|
3878
|
-
TYBG: "https://assets.coingecko.com/coins/images/34563/large/tybg.png?1705400778"
|
|
3914
|
+
TYBG: "https://assets.coingecko.com/coins/images/34563/large/tybg.png?1705400778",
|
|
3915
|
+
LUCK: "https://pbs.twimg.com/profile_images/1798811045005516800/6UGU4Mjm_400x400.jpg",
|
|
3916
|
+
WSTETH: "https://assets.coingecko.com/coins/images/18834/large/wstETH.png?1696518295",
|
|
3917
|
+
WETH: "https://www.cryptocompare.com/media/38553079/weth.png",
|
|
3918
|
+
MNT: "https://img.cryptorank.io/coins/mantle1681720399218.png"
|
|
3879
3919
|
};
|
|
3880
3920
|
|
|
3881
3921
|
// src/components/AsyncImage/AsyncImage.tsx
|
|
@@ -4435,7 +4475,7 @@ import {
|
|
|
4435
4475
|
getTokenInfo as getTokenInfo2
|
|
4436
4476
|
} from "@funkit/core";
|
|
4437
4477
|
import React84, { useCallback as useCallback20, useEffect as useEffect21, useMemo as useMemo22, useState as useState25 } from "react";
|
|
4438
|
-
import { arbitrum, mainnet as mainnet3, zkSync } from "viem/chains";
|
|
4478
|
+
import { arbitrum, mainnet as mainnet3, mantle, zkSync } from "viem/chains";
|
|
4439
4479
|
|
|
4440
4480
|
// src/hooks/useCheckoutAccountBalanceTransfer.ts
|
|
4441
4481
|
import { useCallback as useCallback9 } from "react";
|
|
@@ -4517,7 +4557,7 @@ function useCheckoutQuoteNotification(checkoutId) {
|
|
|
4517
4557
|
|
|
4518
4558
|
// src/hooks/useMesh.tsx
|
|
4519
4559
|
import React46, { useCallback as useCallback11, useMemo as useMemo9, useRef as useRef5, useState as useState12 } from "react";
|
|
4520
|
-
import { useAccount as
|
|
4560
|
+
import { useAccount as useAccount4 } from "wagmi";
|
|
4521
4561
|
|
|
4522
4562
|
// src/components/FunDot/FunDot.tsx
|
|
4523
4563
|
import React34 from "react";
|
|
@@ -5227,7 +5267,7 @@ var useMeshNetworkInfo = (exchange) => {
|
|
|
5227
5267
|
};
|
|
5228
5268
|
};
|
|
5229
5269
|
var useMeshActiveNetworkInfo = (exchange) => {
|
|
5230
|
-
const { chain: activeChain } =
|
|
5270
|
+
const { chain: activeChain } = useAccount4();
|
|
5231
5271
|
const [meshNetworkId, setMeshNetworkId] = useState12(null);
|
|
5232
5272
|
const [meshSupportedTokens, setMeshSupportedTokens] = useState12([]);
|
|
5233
5273
|
const networkandExchange = useRef5(`${exchange}${meshNetworkId}`);
|
|
@@ -6806,7 +6846,7 @@ import {
|
|
|
6806
6846
|
isAddress as isAddress3
|
|
6807
6847
|
} from "@funkit/core";
|
|
6808
6848
|
import React78, { useCallback as useCallback17, useMemo as useMemo19, useState as useState22 } from "react";
|
|
6809
|
-
import { useAccount as
|
|
6849
|
+
import { useAccount as useAccount5, useSendTransaction, useWriteContract } from "wagmi";
|
|
6810
6850
|
|
|
6811
6851
|
// src/utils/deposit.ts
|
|
6812
6852
|
var MINIMUM_MOONPAY_DEPOSIT_AMOUNT_USD = 35;
|
|
@@ -7679,7 +7719,7 @@ function ChainLineItem({
|
|
|
7679
7719
|
testId: `chain-option-${chainId}-icon`
|
|
7680
7720
|
})), /* @__PURE__ */ React74.createElement("div", null, chainItem.name));
|
|
7681
7721
|
}
|
|
7682
|
-
var
|
|
7722
|
+
var Chain3 = ({
|
|
7683
7723
|
chainId,
|
|
7684
7724
|
currentChainId,
|
|
7685
7725
|
switchChain,
|
|
@@ -7741,7 +7781,7 @@ var Chain2 = ({
|
|
|
7741
7781
|
marginX: "8"
|
|
7742
7782
|
}));
|
|
7743
7783
|
};
|
|
7744
|
-
var Chain_default =
|
|
7784
|
+
var Chain_default = Chain3;
|
|
7745
7785
|
|
|
7746
7786
|
// src/components/FunTransactionSummary/FunTxSummaryComponents.tsx
|
|
7747
7787
|
import React76 from "react";
|
|
@@ -8195,7 +8235,7 @@ function FunCheckoutConfirmationStep({
|
|
|
8195
8235
|
generateCheckoutTransferOpItems
|
|
8196
8236
|
]
|
|
8197
8237
|
);
|
|
8198
|
-
const {
|
|
8238
|
+
const { connector } = useAccount5();
|
|
8199
8239
|
const { switchChainAsync } = useFunkitSwitchChains({});
|
|
8200
8240
|
const handleWeb3AccountBalancePostCheckout = useCallback17(
|
|
8201
8241
|
async (depositAddress) => {
|
|
@@ -8207,10 +8247,11 @@ function FunCheckoutConfirmationStep({
|
|
|
8207
8247
|
const sourceAssetAmountBaseUnit = BigInt(
|
|
8208
8248
|
checkoutItem.latestQuote.baseQuote.estTotalFromAmountBaseUnit
|
|
8209
8249
|
);
|
|
8210
|
-
|
|
8250
|
+
const latestChainId = await (connector == null ? void 0 : connector.getChainId());
|
|
8251
|
+
if (parseInt(sourceAssetChainId) !== latestChainId) {
|
|
8211
8252
|
logger.log("handleWeb3AccountBalancePostCheckout_needToSwitchChhain", {
|
|
8212
8253
|
sourceAssetChainId,
|
|
8213
|
-
currentChain:
|
|
8254
|
+
currentChain: latestChainId
|
|
8214
8255
|
});
|
|
8215
8256
|
const chainName = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6[sourceAssetChainId].chainInfo.name;
|
|
8216
8257
|
setPostCheckoutStepMessage(
|
|
@@ -8251,7 +8292,6 @@ function FunCheckoutConfirmationStep({
|
|
|
8251
8292
|
checkoutItem == null ? void 0 : checkoutItem.selectedSourceAssetInfo.chainId,
|
|
8252
8293
|
(_n = checkoutItem == null ? void 0 : checkoutItem.selectedSourceAssetInfo) == null ? void 0 : _n.address,
|
|
8253
8294
|
checkoutItem == null ? void 0 : checkoutItem.selectedSourceAssetInfo.symbol,
|
|
8254
|
-
chain,
|
|
8255
8295
|
switchChainAsync,
|
|
8256
8296
|
sendTransactionAsync,
|
|
8257
8297
|
writeContractAsync
|
|
@@ -8845,11 +8885,12 @@ function MeshOrAccountSelectAsset({
|
|
|
8845
8885
|
manualFetchNetworkInfo
|
|
8846
8886
|
]);
|
|
8847
8887
|
const generateAccountHoldingsMapForBalance = useCallback19(async () => {
|
|
8888
|
+
var _a2, _b2;
|
|
8848
8889
|
const itemMap = {};
|
|
8849
8890
|
const checkoutTargetChainId = checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain;
|
|
8850
|
-
const isCheckoutOnMainnet = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7[checkoutTargetChainId || ""].isMainnet;
|
|
8891
|
+
const isCheckoutOnMainnet = (_b2 = (_a2 = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7) == null ? void 0 : _a2[checkoutTargetChainId || ""]) == null ? void 0 : _b2.isMainnet;
|
|
8851
8892
|
Object.values(walletAssets || {}).forEach((fwAsset) => {
|
|
8852
|
-
var
|
|
8893
|
+
var _a3, _b3, _c2, _d2;
|
|
8853
8894
|
if (!fwAsset.symbol || !fwAsset.contractAddress)
|
|
8854
8895
|
return;
|
|
8855
8896
|
const isAssetOnMainnet = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7[fwAsset.chainId].isMainnet;
|
|
@@ -8858,7 +8899,7 @@ function MeshOrAccountSelectAsset({
|
|
|
8858
8899
|
if (!isCheckoutOnMainnet && checkoutTargetChainId !== fwAsset.chainId)
|
|
8859
8900
|
return;
|
|
8860
8901
|
let normalizedTokenAddress = fwAsset.contractAddress;
|
|
8861
|
-
if (((_d2 = (_c2 = (
|
|
8902
|
+
if (((_d2 = (_c2 = (_b3 = (_a3 = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7) == null ? void 0 : _a3[fwAsset.chainId]) == null ? void 0 : _b3.nativeCurrency) == null ? void 0 : _c2.symbol) == null ? void 0 : _d2.toUpperCase()) === fwAsset.symbol.toUpperCase()) {
|
|
8862
8903
|
normalizedTokenAddress = FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS3;
|
|
8863
8904
|
}
|
|
8864
8905
|
const chainSymbol = combineChainSymbolOrAddress2({
|
|
@@ -9376,7 +9417,10 @@ function FunCheckoutModal({
|
|
|
9376
9417
|
const isNyOrTxOrVi = userIpInfo ? userIpInfo.alpha2 === "US" && ["NY", "TX", "VI"].includes(userIpInfo.state) : false;
|
|
9377
9418
|
const isCanada = userIpInfo ? userIpInfo.alpha2 === "CA" : false;
|
|
9378
9419
|
const originalTargetChainId = checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain.toString();
|
|
9379
|
-
const moonpayChainId =
|
|
9420
|
+
const moonpayChainId = [
|
|
9421
|
+
zkSync.id.toString(),
|
|
9422
|
+
mantle.id.toString()
|
|
9423
|
+
].includes(originalTargetChainId) ? arbitrum.id.toString() : originalTargetChainId;
|
|
9380
9424
|
const wethAddrOnTargetChain = (await getTokenInfo2("weth", moonpayChainId)).toLowerCase();
|
|
9381
9425
|
const isTargetAssetEthOrWeth = [NATIVE_TOKEN, wethAddrOnTargetChain].includes(
|
|
9382
9426
|
(_a2 = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _a2.config.targetAsset
|
|
@@ -10726,8 +10770,8 @@ function ActivityHistory({
|
|
|
10726
10770
|
}
|
|
10727
10771
|
|
|
10728
10772
|
// src/components/ProfileDetails/FunProfileViews/Home/index.tsx
|
|
10729
|
-
import
|
|
10730
|
-
import { useAccount as
|
|
10773
|
+
import React106, { useMemo as useMemo30, useState as useState31 } from "react";
|
|
10774
|
+
import { useAccount as useAccount6 } from "wagmi";
|
|
10731
10775
|
|
|
10732
10776
|
// src/components/Avatar/Avatar.tsx
|
|
10733
10777
|
import React99, { useContext as useContext15 } from "react";
|
|
@@ -10863,22 +10907,41 @@ function Avatar({ address, imageUrl, loading, size }) {
|
|
|
10863
10907
|
})));
|
|
10864
10908
|
}
|
|
10865
10909
|
|
|
10866
|
-
// src/components/Icons/
|
|
10910
|
+
// src/components/Icons/LogoutIcon.tsx
|
|
10867
10911
|
import React100 from "react";
|
|
10868
|
-
var
|
|
10912
|
+
var LogoutIcon = () => {
|
|
10869
10913
|
return /* @__PURE__ */ React100.createElement("svg", {
|
|
10914
|
+
width: "16",
|
|
10915
|
+
height: "16",
|
|
10916
|
+
viewBox: "0 0 16 16",
|
|
10917
|
+
fill: "none",
|
|
10918
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10919
|
+
}, /* @__PURE__ */ React100.createElement("path", {
|
|
10920
|
+
d: "M9.33463 13.3337H4.0013C3.26492 13.3337 2.66797 12.7367 2.66797 12.0003V4.00033C2.66797 3.26395 3.26492 2.66699 4.0013 2.66699H9.33463M6.66797 8.00033H14.0013M14.0013 8.00033L12.0013 10.0003M14.0013 8.00033L12.0013 6.00033",
|
|
10921
|
+
stroke: "currentColor",
|
|
10922
|
+
strokeWidth: "1.33333",
|
|
10923
|
+
strokeLinecap: "round",
|
|
10924
|
+
strokeLinejoin: "round",
|
|
10925
|
+
color: "currentColor"
|
|
10926
|
+
}));
|
|
10927
|
+
};
|
|
10928
|
+
|
|
10929
|
+
// src/components/Icons/PlusIcon.tsx
|
|
10930
|
+
import React101 from "react";
|
|
10931
|
+
var PlusIcon = () => {
|
|
10932
|
+
return /* @__PURE__ */ React101.createElement("svg", {
|
|
10870
10933
|
width: "14",
|
|
10871
10934
|
height: "14",
|
|
10872
10935
|
viewBox: "0 0 14 14",
|
|
10873
10936
|
fill: "none",
|
|
10874
10937
|
xmlns: "http://www.w3.org/2000/svg"
|
|
10875
|
-
}, /* @__PURE__ */
|
|
10938
|
+
}, /* @__PURE__ */ React101.createElement("path", {
|
|
10876
10939
|
d: "M7 13V1",
|
|
10877
10940
|
stroke: "currentColor",
|
|
10878
10941
|
strokeWidth: "2",
|
|
10879
10942
|
strokeLinecap: "round",
|
|
10880
10943
|
strokeLinejoin: "round"
|
|
10881
|
-
}), /* @__PURE__ */
|
|
10944
|
+
}), /* @__PURE__ */ React101.createElement("path", {
|
|
10882
10945
|
d: "M1 7H13",
|
|
10883
10946
|
stroke: "currentColor",
|
|
10884
10947
|
strokeWidth: "2",
|
|
@@ -10888,45 +10951,45 @@ var PlusIcon = () => {
|
|
|
10888
10951
|
};
|
|
10889
10952
|
|
|
10890
10953
|
// src/components/Icons/ReceiptIcon.tsx
|
|
10891
|
-
import
|
|
10954
|
+
import React102 from "react";
|
|
10892
10955
|
var ReceiptIcon = () => {
|
|
10893
|
-
return /* @__PURE__ */
|
|
10956
|
+
return /* @__PURE__ */ React102.createElement("svg", {
|
|
10894
10957
|
width: "16",
|
|
10895
10958
|
height: "16",
|
|
10896
10959
|
viewBox: "0 0 16 16",
|
|
10897
10960
|
fill: "none",
|
|
10898
10961
|
xmlns: "http://www.w3.org/2000/svg"
|
|
10899
|
-
}, /* @__PURE__ */
|
|
10962
|
+
}, /* @__PURE__ */ React102.createElement("g", {
|
|
10900
10963
|
clipPath: "url(#clip0_3891_6630)"
|
|
10901
|
-
}, /* @__PURE__ */
|
|
10964
|
+
}, /* @__PURE__ */ React102.createElement("path", {
|
|
10902
10965
|
d: "M14.666 4.00065V5.61398C14.666 6.66732 13.9993 7.33398 12.946 7.33398H10.666V2.67398C10.666 1.93398 11.2727 1.33398 12.0127 1.33398C12.7393 1.34065 13.406 1.63398 13.886 2.11398C14.366 2.60065 14.666 3.26732 14.666 4.00065Z",
|
|
10903
10966
|
stroke: "currentColor",
|
|
10904
10967
|
strokeWidth: "1",
|
|
10905
10968
|
strokeMiterlimit: "10",
|
|
10906
10969
|
strokeLinecap: "round",
|
|
10907
10970
|
strokeLinejoin: "round"
|
|
10908
|
-
}), /* @__PURE__ */
|
|
10971
|
+
}), /* @__PURE__ */ React102.createElement("path", {
|
|
10909
10972
|
d: "M1.33398 4.66732V14.0006C1.33398 14.554 1.96064 14.8673 2.40064 14.534L3.54065 13.6806C3.80732 13.4806 4.18065 13.5073 4.42065 13.7473L5.5273 14.8606C5.7873 15.1206 6.214 15.1206 6.474 14.8606L7.59398 13.7406C7.82732 13.5073 8.20065 13.4806 8.46065 13.6806L9.60065 14.534C10.0407 14.8606 10.6673 14.5473 10.6673 14.0006V2.66732C10.6673 1.93398 11.2673 1.33398 12.0007 1.33398H4.66732H4.00065C2.00065 1.33398 1.33398 2.52732 1.33398 4.00065V4.66732Z",
|
|
10910
10973
|
stroke: "currentColor",
|
|
10911
10974
|
strokeWidth: "1",
|
|
10912
10975
|
strokeMiterlimit: "10",
|
|
10913
10976
|
strokeLinecap: "round",
|
|
10914
10977
|
strokeLinejoin: "round"
|
|
10915
|
-
}), /* @__PURE__ */
|
|
10978
|
+
}), /* @__PURE__ */ React102.createElement("path", {
|
|
10916
10979
|
d: "M4 6H8",
|
|
10917
10980
|
stroke: "currentColor",
|
|
10918
10981
|
strokeWidth: "1",
|
|
10919
10982
|
strokeLinecap: "round",
|
|
10920
10983
|
strokeLinejoin: "round"
|
|
10921
|
-
}), /* @__PURE__ */
|
|
10984
|
+
}), /* @__PURE__ */ React102.createElement("path", {
|
|
10922
10985
|
d: "M4.5 8.66602H7.5",
|
|
10923
10986
|
stroke: "currentColor",
|
|
10924
10987
|
strokeWidth: "1",
|
|
10925
10988
|
strokeLinecap: "round",
|
|
10926
10989
|
strokeLinejoin: "round"
|
|
10927
|
-
})), /* @__PURE__ */
|
|
10990
|
+
})), /* @__PURE__ */ React102.createElement("defs", null, /* @__PURE__ */ React102.createElement("clipPath", {
|
|
10928
10991
|
id: "clip0_3891_6630"
|
|
10929
|
-
}, /* @__PURE__ */
|
|
10992
|
+
}, /* @__PURE__ */ React102.createElement("rect", {
|
|
10930
10993
|
width: "16",
|
|
10931
10994
|
height: "16",
|
|
10932
10995
|
fill: "white"
|
|
@@ -10934,18 +10997,18 @@ var ReceiptIcon = () => {
|
|
|
10934
10997
|
};
|
|
10935
10998
|
|
|
10936
10999
|
// src/components/Icons/SettingsIcon.tsx
|
|
10937
|
-
import
|
|
11000
|
+
import React103 from "react";
|
|
10938
11001
|
var SettingsIcon = () => {
|
|
10939
|
-
return /* @__PURE__ */
|
|
11002
|
+
return /* @__PURE__ */ React103.createElement("svg", {
|
|
10940
11003
|
width: "17",
|
|
10941
11004
|
height: "17",
|
|
10942
11005
|
viewBox: "0 0 17 17",
|
|
10943
11006
|
fill: "none",
|
|
10944
11007
|
xmlns: "http://www.w3.org/2000/svg"
|
|
10945
|
-
}, /* @__PURE__ */
|
|
11008
|
+
}, /* @__PURE__ */ React103.createElement("path", {
|
|
10946
11009
|
d: "M8.75 10.167C9.85457 10.167 10.75 9.27156 10.75 8.16699C10.75 7.06242 9.85457 6.16699 8.75 6.16699C7.64543 6.16699 6.75 7.06242 6.75 8.16699C6.75 9.27156 7.64543 10.167 8.75 10.167Z",
|
|
10947
11010
|
stroke: "currentColor"
|
|
10948
|
-
}), /* @__PURE__ */
|
|
11011
|
+
}), /* @__PURE__ */ React103.createElement("path", {
|
|
10949
11012
|
d: "M9.92726 1.60149C9.68219 1.5 9.37159 1.5 8.75032 1.5C8.12906 1.5 7.81846 1.5 7.57339 1.60149C7.2467 1.73682 6.98714 1.99639 6.85181 2.32309C6.79004 2.47223 6.76586 2.64567 6.7564 2.89866C6.7425 3.27045 6.55183 3.61459 6.22962 3.80062C5.90742 3.98664 5.51405 3.97969 5.18512 3.80584C4.96129 3.68753 4.799 3.62175 4.63895 3.60068C4.28835 3.55452 3.93378 3.64953 3.65323 3.8648C3.44282 4.02625 3.2875 4.29527 2.97688 4.83329C2.66625 5.37131 2.51094 5.64032 2.47632 5.90327C2.43016 6.25387 2.52517 6.60844 2.74044 6.889C2.8387 7.01707 2.97679 7.12467 3.19112 7.25933C3.50619 7.45733 3.70892 7.7946 3.7089 8.16667C3.70888 8.53873 3.50616 8.87593 3.19111 9.07387C2.97676 9.2086 2.83864 9.31627 2.74038 9.44433C2.5251 9.72487 2.4301 10.0794 2.47626 10.43C2.51087 10.6929 2.66618 10.962 2.97681 11.5C3.28744 12.038 3.44276 12.3071 3.65316 12.4685C3.93371 12.6837 4.28828 12.7787 4.63888 12.7326C4.79892 12.7115 4.9612 12.6457 5.18502 12.5275C5.51397 12.3536 5.90736 12.3467 6.22959 12.5327C6.55182 12.7187 6.7425 13.0629 6.7564 13.4347C6.76586 13.6877 6.79004 13.8611 6.85181 14.0103C6.98714 14.3369 7.2467 14.5965 7.57339 14.7319C7.81846 14.8333 8.12906 14.8333 8.75032 14.8333C9.37159 14.8333 9.68219 14.8333 9.92726 14.7319C10.2539 14.5965 10.5135 14.3369 10.6488 14.0103C10.7106 13.8611 10.7348 13.6877 10.7443 13.4347C10.7581 13.0629 10.9488 12.7187 11.271 12.5327C11.5932 12.3466 11.9866 12.3536 12.3156 12.5275C12.5394 12.6457 12.7017 12.7115 12.8617 12.7325C13.2123 12.7787 13.5669 12.6837 13.8474 12.4685C14.0578 12.307 14.2131 12.038 14.5237 11.4999C14.8344 10.9619 14.9897 10.6929 15.0243 10.43C15.0705 10.0794 14.9755 9.7248 14.7602 9.44427C14.6619 9.3162 14.5238 9.20853 14.3095 9.07387C13.9945 8.87593 13.7917 8.53867 13.7917 8.1666C13.7917 7.79453 13.9945 7.4574 14.3095 7.25947C14.5239 7.12473 14.662 7.01713 14.7603 6.889C14.9755 6.60849 15.0705 6.25391 15.0244 5.90331C14.9898 5.64037 14.8345 5.37135 14.5238 4.83333C14.2132 4.29531 14.0579 4.0263 13.8475 3.86485C13.5669 3.64957 13.2123 3.55457 12.8617 3.60073C12.7017 3.62179 12.5395 3.68757 12.3156 3.80587C11.9867 3.97973 11.5933 3.98668 11.2711 3.80064C10.9488 3.61461 10.7581 3.27044 10.7443 2.89863C10.7348 2.64565 10.7106 2.47222 10.6488 2.32309C10.5135 1.99639 10.2539 1.73682 9.92726 1.60149Z",
|
|
10950
11013
|
stroke: "currentColor"
|
|
10951
11014
|
}));
|
|
@@ -10960,7 +11023,7 @@ var animateTitleInClass2 = "_1x1d6jx6";
|
|
|
10960
11023
|
var animateTitleOutClass2 = "_1x1d6jx7";
|
|
10961
11024
|
|
|
10962
11025
|
// src/components/ProfileDetails/FunProfileViews/Home/HomeCheckoutSection.tsx
|
|
10963
|
-
import
|
|
11026
|
+
import React104, { Fragment as Fragment3, useMemo as useMemo29 } from "react";
|
|
10964
11027
|
var MAX_LATEST_CHECKOUTS = 1;
|
|
10965
11028
|
function HomeCheckoutSection({
|
|
10966
11029
|
onSelectActivity
|
|
@@ -10978,16 +11041,16 @@ function HomeCheckoutSection({
|
|
|
10978
11041
|
remainingCount: remaining
|
|
10979
11042
|
};
|
|
10980
11043
|
}, [checkoutHistoryStateMap]);
|
|
10981
|
-
return latestCheckoutHistories.length > 0 ? /* @__PURE__ */
|
|
11044
|
+
return latestCheckoutHistories.length > 0 ? /* @__PURE__ */ React104.createElement(Fragment3, null, /* @__PURE__ */ React104.createElement(FunDivider, {
|
|
10982
11045
|
marginTop: "0",
|
|
10983
11046
|
marginBottom: "16"
|
|
10984
|
-
}), /* @__PURE__ */
|
|
11047
|
+
}), /* @__PURE__ */ React104.createElement(Box, {
|
|
10985
11048
|
display: "flex",
|
|
10986
11049
|
flexDirection: "column",
|
|
10987
11050
|
gap: "24",
|
|
10988
11051
|
paddingTop: "8",
|
|
10989
11052
|
paddingBottom: "24"
|
|
10990
|
-
}, latestCheckoutHistories.map((item) => /* @__PURE__ */
|
|
11053
|
+
}, latestCheckoutHistories.map((item) => /* @__PURE__ */ React104.createElement(FunCheckoutNotification, {
|
|
10991
11054
|
key: item.depositAddr,
|
|
10992
11055
|
checkoutHistoryItem: item,
|
|
10993
11056
|
onSelect: onSelectActivity
|
|
@@ -10995,45 +11058,45 @@ function HomeCheckoutSection({
|
|
|
10995
11058
|
}
|
|
10996
11059
|
|
|
10997
11060
|
// src/components/ProfileDetails/FunProfileViews/Home/HomeTokenDisplayRow.tsx
|
|
10998
|
-
import
|
|
11061
|
+
import React105 from "react";
|
|
10999
11062
|
var HomeTokenBalanceDisplayRow = ({ asset }) => {
|
|
11000
11063
|
const normalizedAmount = getNormalizedTokenBalance(
|
|
11001
11064
|
asset.tokenBalance,
|
|
11002
11065
|
asset.decimals
|
|
11003
11066
|
);
|
|
11004
|
-
return /* @__PURE__ */
|
|
11067
|
+
return /* @__PURE__ */ React105.createElement(Box, {
|
|
11005
11068
|
display: "flex",
|
|
11006
11069
|
justifyContent: "space-between",
|
|
11007
11070
|
alignItems: "center"
|
|
11008
|
-
}, /* @__PURE__ */
|
|
11071
|
+
}, /* @__PURE__ */ React105.createElement(Box, {
|
|
11009
11072
|
display: "flex",
|
|
11010
11073
|
flexDirection: "row",
|
|
11011
11074
|
gap: "8",
|
|
11012
11075
|
alignItems: "flex-start",
|
|
11013
11076
|
height: "full"
|
|
11014
|
-
}, /* @__PURE__ */
|
|
11077
|
+
}, /* @__PURE__ */ React105.createElement(FunAssetAvatar, {
|
|
11015
11078
|
assetSrc: asset.logo,
|
|
11016
11079
|
assetName: asset.name,
|
|
11017
11080
|
assetTicker: asset.symbol,
|
|
11018
11081
|
chainId: asset.chainId,
|
|
11019
11082
|
chainIconSize: "14"
|
|
11020
|
-
}), /* @__PURE__ */
|
|
11083
|
+
}), /* @__PURE__ */ React105.createElement(Box, {
|
|
11021
11084
|
display: "flex",
|
|
11022
11085
|
flexDirection: "column",
|
|
11023
11086
|
justifyContent: "space-between"
|
|
11024
|
-
}, /* @__PURE__ */
|
|
11087
|
+
}, /* @__PURE__ */ React105.createElement(Text, {
|
|
11025
11088
|
color: "modalText",
|
|
11026
11089
|
size: "18",
|
|
11027
11090
|
weight: "semibold"
|
|
11028
|
-
}, asset.name), /* @__PURE__ */
|
|
11091
|
+
}, asset.name), /* @__PURE__ */ React105.createElement(Text, {
|
|
11029
11092
|
color: "modalTextSecondary",
|
|
11030
11093
|
size: "14",
|
|
11031
11094
|
weight: "medium"
|
|
11032
|
-
}, formatCryptoAndStringify(normalizedAmount, asset.symbol)))), /* @__PURE__ */
|
|
11095
|
+
}, formatCryptoAndStringify(normalizedAmount, asset.symbol)))), /* @__PURE__ */ React105.createElement(Box, {
|
|
11033
11096
|
display: "flex",
|
|
11034
11097
|
alignSelf: "flex-start",
|
|
11035
11098
|
height: "full"
|
|
11036
|
-
}, /* @__PURE__ */
|
|
11099
|
+
}, /* @__PURE__ */ React105.createElement(Text, {
|
|
11037
11100
|
color: "modalText",
|
|
11038
11101
|
size: "18",
|
|
11039
11102
|
weight: "semibold"
|
|
@@ -11047,48 +11110,53 @@ var ProfileTitleSection = ({
|
|
|
11047
11110
|
userInfo,
|
|
11048
11111
|
setAnimateOut,
|
|
11049
11112
|
onChangeView,
|
|
11113
|
+
onLogout,
|
|
11050
11114
|
onClose
|
|
11051
11115
|
}) => {
|
|
11052
|
-
return /* @__PURE__ */
|
|
11116
|
+
return /* @__PURE__ */ React106.createElement(Box, {
|
|
11053
11117
|
display: "flex",
|
|
11054
11118
|
alignItems: "center",
|
|
11055
11119
|
justifyContent: "space-between",
|
|
11056
11120
|
width: "full"
|
|
11057
|
-
}, /* @__PURE__ */
|
|
11121
|
+
}, /* @__PURE__ */ React106.createElement(Box, {
|
|
11058
11122
|
display: "flex",
|
|
11059
11123
|
alignItems: "center",
|
|
11060
11124
|
flexDirection: "row",
|
|
11061
11125
|
gap: "8"
|
|
11062
|
-
}, /* @__PURE__ */
|
|
11126
|
+
}, /* @__PURE__ */ React106.createElement(Box, {
|
|
11063
11127
|
className: animateOut ? animateAvatarOutClass : animateAvatarInClass
|
|
11064
|
-
}, /* @__PURE__ */
|
|
11128
|
+
}, /* @__PURE__ */ React106.createElement(Avatar, {
|
|
11065
11129
|
address: account.address,
|
|
11066
11130
|
imageUrl: account.ensAvatar || userInfo.accountPicSrc,
|
|
11067
11131
|
loading: account.hasPendingTransactions,
|
|
11068
11132
|
size: 24
|
|
11069
|
-
})), /* @__PURE__ */
|
|
11133
|
+
})), /* @__PURE__ */ React106.createElement(Text, {
|
|
11070
11134
|
color: "modalText",
|
|
11071
11135
|
size: "16",
|
|
11072
11136
|
weight: "semibold",
|
|
11073
11137
|
className: animateOut ? animateTitleOutClass2 : animateTitleInClass2
|
|
11074
|
-
}, userInfo.accountNameDisplay)), /* @__PURE__ */
|
|
11138
|
+
}, userInfo.accountNameDisplay)), /* @__PURE__ */ React106.createElement(Box, {
|
|
11075
11139
|
display: "flex",
|
|
11076
11140
|
alignItems: "center",
|
|
11077
11141
|
flexDirection: "row",
|
|
11078
11142
|
gap: "8"
|
|
11079
|
-
}, /* @__PURE__ */
|
|
11080
|
-
icon: /* @__PURE__ */
|
|
11143
|
+
}, /* @__PURE__ */ React106.createElement(FunIconButton, {
|
|
11144
|
+
icon: /* @__PURE__ */ React106.createElement(SettingsIcon, null),
|
|
11081
11145
|
onClick: () => {
|
|
11082
11146
|
setAnimateOut(true);
|
|
11083
11147
|
setTimeout(() => onChangeView(1 /* SETTINGS */), 200);
|
|
11084
11148
|
},
|
|
11085
11149
|
size: "24"
|
|
11086
|
-
}), /* @__PURE__ */
|
|
11087
|
-
icon: /* @__PURE__ */
|
|
11150
|
+
}), /* @__PURE__ */ React106.createElement(FunIconButton, {
|
|
11151
|
+
icon: /* @__PURE__ */ React106.createElement(ReceiptIcon, null),
|
|
11088
11152
|
onClick: () => onChangeView(2 /* ACTIVITY */),
|
|
11089
11153
|
size: "24"
|
|
11090
|
-
}), /* @__PURE__ */
|
|
11091
|
-
icon: /* @__PURE__ */
|
|
11154
|
+
}), /* @__PURE__ */ React106.createElement(FunIconButton, {
|
|
11155
|
+
icon: /* @__PURE__ */ React106.createElement(LogoutIcon, null),
|
|
11156
|
+
onClick: onLogout,
|
|
11157
|
+
size: "24"
|
|
11158
|
+
}), /* @__PURE__ */ React106.createElement(FunIconButton, {
|
|
11159
|
+
icon: /* @__PURE__ */ React106.createElement(CloseIcon, null),
|
|
11092
11160
|
onClick: onClose,
|
|
11093
11161
|
size: "24"
|
|
11094
11162
|
})));
|
|
@@ -11098,9 +11166,9 @@ function Home({
|
|
|
11098
11166
|
onChangeView,
|
|
11099
11167
|
onSelectActivity
|
|
11100
11168
|
}) {
|
|
11101
|
-
const account =
|
|
11169
|
+
const account = useAccount6();
|
|
11102
11170
|
const { accountModalConfig } = useFunkitConfig();
|
|
11103
|
-
const { userInfo } = useGeneralWallet();
|
|
11171
|
+
const { userInfo, handleLogout } = useGeneralWallet();
|
|
11104
11172
|
useWalletAssetsListener();
|
|
11105
11173
|
useCheckoutHistoryListener();
|
|
11106
11174
|
const { walletAssets } = useGeneralWallet();
|
|
@@ -11108,14 +11176,14 @@ function Home({
|
|
|
11108
11176
|
const [balance, setBalance] = useState31("0.00");
|
|
11109
11177
|
const AssetsList = useMemo30(() => {
|
|
11110
11178
|
if (walletAssets == null) {
|
|
11111
|
-
return [/* @__PURE__ */
|
|
11179
|
+
return [/* @__PURE__ */ React106.createElement(SkeletalLoader, {
|
|
11112
11180
|
key: "skeletal-loader-1"
|
|
11113
11181
|
})];
|
|
11114
11182
|
}
|
|
11115
11183
|
const tokenKeys = Object.keys(walletAssets || {});
|
|
11116
11184
|
if (tokenKeys.length === 0) {
|
|
11117
11185
|
return [
|
|
11118
|
-
/* @__PURE__ */
|
|
11186
|
+
/* @__PURE__ */ React106.createElement(Box, {
|
|
11119
11187
|
display: "flex",
|
|
11120
11188
|
flexDirection: "column",
|
|
11121
11189
|
justifyContent: "center",
|
|
@@ -11123,7 +11191,7 @@ function Home({
|
|
|
11123
11191
|
gap: "12",
|
|
11124
11192
|
key: "no-assets",
|
|
11125
11193
|
color: "modalText"
|
|
11126
|
-
}, /* @__PURE__ */
|
|
11194
|
+
}, /* @__PURE__ */ React106.createElement(NotFoundIcon, null), /* @__PURE__ */ React106.createElement(Text, {
|
|
11127
11195
|
color: "modalText",
|
|
11128
11196
|
size: "18",
|
|
11129
11197
|
weight: "semibold"
|
|
@@ -11136,7 +11204,7 @@ function Home({
|
|
|
11136
11204
|
).map((assetKey) => {
|
|
11137
11205
|
const asset = walletAssets == null ? void 0 : walletAssets[assetKey];
|
|
11138
11206
|
newBalance = newBalance + asset.totalUsdValue;
|
|
11139
|
-
return /* @__PURE__ */
|
|
11207
|
+
return /* @__PURE__ */ React106.createElement(HomeTokenBalanceDisplayRow, {
|
|
11140
11208
|
asset,
|
|
11141
11209
|
key: assetKey
|
|
11142
11210
|
});
|
|
@@ -11145,53 +11213,54 @@ function Home({
|
|
|
11145
11213
|
setBalance(nextBalance);
|
|
11146
11214
|
return outputRows;
|
|
11147
11215
|
}, [walletAssets]);
|
|
11148
|
-
return /* @__PURE__ */
|
|
11216
|
+
return /* @__PURE__ */ React106.createElement(Box, null, /* @__PURE__ */ React106.createElement(ProfileTitleSection, {
|
|
11149
11217
|
animateOut,
|
|
11150
11218
|
account,
|
|
11151
11219
|
userInfo,
|
|
11152
11220
|
setAnimateOut,
|
|
11153
11221
|
onChangeView,
|
|
11222
|
+
onLogout: handleLogout,
|
|
11154
11223
|
onClose
|
|
11155
|
-
}), /* @__PURE__ */
|
|
11224
|
+
}), /* @__PURE__ */ React106.createElement(Box, {
|
|
11156
11225
|
display: "flex",
|
|
11157
11226
|
flexDirection: "column",
|
|
11158
11227
|
paddingTop: "24",
|
|
11159
11228
|
paddingBottom: "0",
|
|
11160
11229
|
className: animateOut ? animateContentOutClass2 : animateContentInClass2
|
|
11161
|
-
}, /* @__PURE__ */
|
|
11230
|
+
}, /* @__PURE__ */ React106.createElement(Box, {
|
|
11162
11231
|
display: "flex",
|
|
11163
11232
|
flexDirection: "column",
|
|
11164
11233
|
gap: "16"
|
|
11165
|
-
}, /* @__PURE__ */
|
|
11234
|
+
}, /* @__PURE__ */ React106.createElement(Box, {
|
|
11166
11235
|
display: "flex",
|
|
11167
11236
|
justifyContent: "center",
|
|
11168
11237
|
alignItems: "center"
|
|
11169
|
-
}, /* @__PURE__ */
|
|
11238
|
+
}, /* @__PURE__ */ React106.createElement(Text, {
|
|
11170
11239
|
as: "h1",
|
|
11171
11240
|
color: "modalText",
|
|
11172
11241
|
weight: "heavy",
|
|
11173
11242
|
style: { fontSize: "56px", lineHeight: "68px" }
|
|
11174
|
-
}, formatCurrencyAndStringify(parseFloat(balance.toString())))), (accountModalConfig == null ? void 0 : accountModalConfig.allowDepositing) ? /* @__PURE__ */
|
|
11243
|
+
}, formatCurrencyAndStringify(parseFloat(balance.toString())))), (accountModalConfig == null ? void 0 : accountModalConfig.allowDepositing) ? /* @__PURE__ */ React106.createElement(Box, {
|
|
11175
11244
|
id: "button-row",
|
|
11176
11245
|
display: "flex",
|
|
11177
11246
|
flexDirection: "row",
|
|
11178
11247
|
gap: "12"
|
|
11179
|
-
}, /* @__PURE__ */
|
|
11248
|
+
}, /* @__PURE__ */ React106.createElement(FunButton, {
|
|
11180
11249
|
title: "Deposit",
|
|
11181
|
-
titlePrefix: /* @__PURE__ */
|
|
11250
|
+
titlePrefix: /* @__PURE__ */ React106.createElement(Box, {
|
|
11182
11251
|
display: "flex",
|
|
11183
11252
|
alignItems: "center",
|
|
11184
11253
|
color: "buttonTextSecondary"
|
|
11185
|
-
}, /* @__PURE__ */
|
|
11254
|
+
}, /* @__PURE__ */ React106.createElement(PlusIcon, null)),
|
|
11186
11255
|
type: "secondary",
|
|
11187
11256
|
titleWeight: "semibold",
|
|
11188
11257
|
onClick: () => {
|
|
11189
11258
|
}
|
|
11190
|
-
})) : null), /* @__PURE__ */
|
|
11259
|
+
})) : null), /* @__PURE__ */ React106.createElement(FunDivider, {
|
|
11191
11260
|
marginTop: "16",
|
|
11192
11261
|
marginBottom: "0",
|
|
11193
11262
|
transparent: walletAssets != null && Object.keys(walletAssets || {}).length === 0
|
|
11194
|
-
}), /* @__PURE__ */
|
|
11263
|
+
}), /* @__PURE__ */ React106.createElement(Box, {
|
|
11195
11264
|
id: "token-list",
|
|
11196
11265
|
display: "flex",
|
|
11197
11266
|
flexDirection: "column",
|
|
@@ -11200,7 +11269,7 @@ function Home({
|
|
|
11200
11269
|
paddingTop: "16",
|
|
11201
11270
|
paddingBottom: "16",
|
|
11202
11271
|
style: { maxHeight: 300, overflow: "auto" }
|
|
11203
|
-
}, AssetsList.map((component) => component)), /* @__PURE__ */
|
|
11272
|
+
}, AssetsList.map((component) => component)), /* @__PURE__ */ React106.createElement(HomeCheckoutSection, {
|
|
11204
11273
|
onSelectActivity: (depositAddress, initialPage) => {
|
|
11205
11274
|
onSelectActivity({
|
|
11206
11275
|
depositAddress,
|
|
@@ -11213,28 +11282,7 @@ function Home({
|
|
|
11213
11282
|
|
|
11214
11283
|
// src/components/ProfileDetails/FunProfileViews/Settings/Settings.tsx
|
|
11215
11284
|
import React107, { useCallback as useCallback23, useState as useState32 } from "react";
|
|
11216
|
-
import { useAccount as
|
|
11217
|
-
|
|
11218
|
-
// src/components/Icons/LogoutIcon.tsx
|
|
11219
|
-
import React106 from "react";
|
|
11220
|
-
var LogoutIcon = () => {
|
|
11221
|
-
return /* @__PURE__ */ React106.createElement("svg", {
|
|
11222
|
-
width: "16",
|
|
11223
|
-
height: "16",
|
|
11224
|
-
viewBox: "0 0 16 16",
|
|
11225
|
-
fill: "none",
|
|
11226
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
11227
|
-
}, /* @__PURE__ */ React106.createElement("path", {
|
|
11228
|
-
d: "M9.33463 13.3337H4.0013C3.26492 13.3337 2.66797 12.7367 2.66797 12.0003V4.00033C2.66797 3.26395 3.26492 2.66699 4.0013 2.66699H9.33463M6.66797 8.00033H14.0013M14.0013 8.00033L12.0013 10.0003M14.0013 8.00033L12.0013 6.00033",
|
|
11229
|
-
stroke: "currentColor",
|
|
11230
|
-
strokeWidth: "1.33333",
|
|
11231
|
-
strokeLinecap: "round",
|
|
11232
|
-
strokeLinejoin: "round",
|
|
11233
|
-
color: "currentColor"
|
|
11234
|
-
}));
|
|
11235
|
-
};
|
|
11236
|
-
|
|
11237
|
-
// src/components/ProfileDetails/FunProfileViews/Settings/Settings.tsx
|
|
11285
|
+
import { useAccount as useAccount7 } from "wagmi";
|
|
11238
11286
|
function LineItem({
|
|
11239
11287
|
label,
|
|
11240
11288
|
value,
|
|
@@ -11265,64 +11313,23 @@ function LineItem({
|
|
|
11265
11313
|
}
|
|
11266
11314
|
function Settings({
|
|
11267
11315
|
onClose,
|
|
11268
|
-
onBack
|
|
11269
|
-
onDisconnect
|
|
11316
|
+
onBack
|
|
11270
11317
|
}) {
|
|
11271
|
-
const { chain: activeChain } =
|
|
11272
|
-
const { walletAddress, isWeb3Login, userInfo } = useGeneralWallet();
|
|
11318
|
+
const { chain: activeChain } = useAccount7();
|
|
11319
|
+
const { walletAddress, isWeb3Login, userInfo, handleLogout } = useGeneralWallet();
|
|
11273
11320
|
const [animateOut, setAnimateOut] = useState32(false);
|
|
11274
|
-
const [logoutConfirmationOpen, setLogoutConfirmationOpen] = useState32(false);
|
|
11275
11321
|
const handleBack = useCallback23(() => {
|
|
11276
11322
|
setAnimateOut(true);
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
setLogoutConfirmationOpen(false);
|
|
11280
|
-
setAnimateOut(false);
|
|
11281
|
-
}, 150);
|
|
11282
|
-
} else {
|
|
11283
|
-
setTimeout(onBack, 150);
|
|
11284
|
-
}
|
|
11285
|
-
}, [logoutConfirmationOpen, onBack]);
|
|
11323
|
+
setTimeout(onBack, 150);
|
|
11324
|
+
}, [onBack]);
|
|
11286
11325
|
return /* @__PURE__ */ React107.createElement(Box, null, /* @__PURE__ */ React107.createElement(FunModalTitleSection, {
|
|
11287
11326
|
hasBackButton: true,
|
|
11288
11327
|
onBack: handleBack,
|
|
11289
11328
|
backAnimation: true,
|
|
11290
|
-
title:
|
|
11329
|
+
title: "Settings",
|
|
11291
11330
|
hasCloseButton: true,
|
|
11292
11331
|
onClose
|
|
11293
|
-
}),
|
|
11294
|
-
paddingTop: "16",
|
|
11295
|
-
paddingBottom: "28",
|
|
11296
|
-
className: animateOut ? animateContentOutClass : animateContentInClass
|
|
11297
|
-
}, /* @__PURE__ */ React107.createElement(Box, {
|
|
11298
|
-
paddingTop: "10",
|
|
11299
|
-
paddingBottom: "24"
|
|
11300
|
-
}, /* @__PURE__ */ React107.createElement(Text, {
|
|
11301
|
-
color: "modalTextSecondary",
|
|
11302
|
-
size: "14",
|
|
11303
|
-
weight: "medium"
|
|
11304
|
-
}, "Are you sure you want to logout?")), /* @__PURE__ */ React107.createElement(Box, {
|
|
11305
|
-
display: "flex",
|
|
11306
|
-
flexDirection: "column",
|
|
11307
|
-
gap: "5"
|
|
11308
|
-
}, /* @__PURE__ */ React107.createElement(FunButton, {
|
|
11309
|
-
type: "warning",
|
|
11310
|
-
onClick: () => {
|
|
11311
|
-
onDisconnect();
|
|
11312
|
-
onClose();
|
|
11313
|
-
},
|
|
11314
|
-
title: "Logout"
|
|
11315
|
-
}), /* @__PURE__ */ React107.createElement(FunButton, {
|
|
11316
|
-
type: "secondary",
|
|
11317
|
-
onClick: () => {
|
|
11318
|
-
setAnimateOut(true);
|
|
11319
|
-
setTimeout(() => {
|
|
11320
|
-
setAnimateOut(false);
|
|
11321
|
-
setLogoutConfirmationOpen(false);
|
|
11322
|
-
}, 150);
|
|
11323
|
-
},
|
|
11324
|
-
title: "Cancel"
|
|
11325
|
-
}))) : /* @__PURE__ */ React107.createElement(Box, {
|
|
11332
|
+
}), /* @__PURE__ */ React107.createElement(Box, {
|
|
11326
11333
|
display: "flex",
|
|
11327
11334
|
flexDirection: "column",
|
|
11328
11335
|
gap: "24",
|
|
@@ -11356,13 +11363,7 @@ function Settings({
|
|
|
11356
11363
|
}), /* @__PURE__ */ React107.createElement(FunButton, {
|
|
11357
11364
|
titlePrefix: /* @__PURE__ */ React107.createElement(LogoutIcon, null),
|
|
11358
11365
|
title: "Logout",
|
|
11359
|
-
onClick:
|
|
11360
|
-
setAnimateOut(true);
|
|
11361
|
-
setTimeout(() => {
|
|
11362
|
-
setAnimateOut(false);
|
|
11363
|
-
setLogoutConfirmationOpen(true);
|
|
11364
|
-
}, 150);
|
|
11365
|
-
},
|
|
11366
|
+
onClick: handleLogout,
|
|
11366
11367
|
type: "secondary"
|
|
11367
11368
|
})));
|
|
11368
11369
|
}
|
|
@@ -11410,8 +11411,7 @@ function ProfileDetails({ onClose, onDisconnect }) {
|
|
|
11410
11411
|
onSelectActivity: onSelectActivityWrapper
|
|
11411
11412
|
}) : view === 1 /* SETTINGS */ ? /* @__PURE__ */ React108.createElement(Settings, {
|
|
11412
11413
|
onClose,
|
|
11413
|
-
onBack: onBackToHome
|
|
11414
|
-
onDisconnect
|
|
11414
|
+
onBack: onBackToHome
|
|
11415
11415
|
}) : view === 2 /* ACTIVITY */ ? /* @__PURE__ */ React108.createElement(ActivityHistory, {
|
|
11416
11416
|
onClose,
|
|
11417
11417
|
onBack: onBackToHome,
|
|
@@ -11447,7 +11447,7 @@ function AccountModal({ onClose, open }) {
|
|
|
11447
11447
|
|
|
11448
11448
|
// src/components/ChainModal/ChainModal.tsx
|
|
11449
11449
|
import React111, { useContext as useContext16 } from "react";
|
|
11450
|
-
import { useAccount as
|
|
11450
|
+
import { useAccount as useAccount8, useConfig as useConfig3 } from "wagmi";
|
|
11451
11451
|
|
|
11452
11452
|
// src/components/Icons/DisconnectSq.tsx
|
|
11453
11453
|
import React110 from "react";
|
|
@@ -11468,7 +11468,7 @@ var MobileScrollClassName = "_1107ixc1";
|
|
|
11468
11468
|
|
|
11469
11469
|
// src/components/ChainModal/ChainModal.tsx
|
|
11470
11470
|
function ChainModal({ onClose, open }) {
|
|
11471
|
-
const { chainId } =
|
|
11471
|
+
const { chainId } = useAccount8();
|
|
11472
11472
|
const { chains } = useConfig3();
|
|
11473
11473
|
const { switchChain, pendingChainId } = useFunkitSwitchChains({
|
|
11474
11474
|
onSettled: () => onClose()
|
|
@@ -11578,7 +11578,7 @@ function ChainModal({ onClose, open }) {
|
|
|
11578
11578
|
|
|
11579
11579
|
// src/components/ConnectModal/ConnectModal.tsx
|
|
11580
11580
|
import React139 from "react";
|
|
11581
|
-
import { useAccount as
|
|
11581
|
+
import { useAccount as useAccount10, useDisconnect as useDisconnect2 } from "wagmi";
|
|
11582
11582
|
|
|
11583
11583
|
// src/components/FunConnectOptions/FunConnectOptions.tsx
|
|
11584
11584
|
import React137, { useCallback as useCallback28, useState as useState38 } from "react";
|
|
@@ -11624,27 +11624,27 @@ import React113, { useCallback as useCallback25, useEffect as useEffect25, useMe
|
|
|
11624
11624
|
|
|
11625
11625
|
// src/utils/browsers.ts
|
|
11626
11626
|
function isSafari() {
|
|
11627
|
-
return typeof navigator !== "undefined" && /Version\/([0-9._]+).*Safari/.test(navigator.userAgent);
|
|
11627
|
+
return typeof navigator !== "undefined" && typeof navigator.userAgent !== "undefined" && /Version\/([0-9._]+).*Safari/.test(navigator.userAgent);
|
|
11628
11628
|
}
|
|
11629
11629
|
function isArc() {
|
|
11630
11630
|
return typeof document !== "undefined" && getComputedStyle(document.body).getPropertyValue("--arc-palette-focus") !== "";
|
|
11631
11631
|
}
|
|
11632
11632
|
function getBrowser() {
|
|
11633
|
-
var _a;
|
|
11634
|
-
if (typeof navigator === "undefined")
|
|
11633
|
+
var _a, _b;
|
|
11634
|
+
if (typeof navigator === "undefined" || Object.keys(navigator).length === 0)
|
|
11635
11635
|
return "Browser" /* Browser */;
|
|
11636
|
-
const ua2 = navigator.userAgent.toLowerCase();
|
|
11637
|
-
if ((
|
|
11636
|
+
const ua2 = (_a = navigator.userAgent) == null ? void 0 : _a.toLowerCase();
|
|
11637
|
+
if ((_b = navigator.brave) == null ? void 0 : _b.isBrave)
|
|
11638
11638
|
return "Brave" /* Brave */;
|
|
11639
|
-
if (ua2.indexOf("edg/") > -1)
|
|
11639
|
+
if ((ua2 == null ? void 0 : ua2.indexOf("edg/")) > -1)
|
|
11640
11640
|
return "Edge" /* Edge */;
|
|
11641
|
-
if (ua2.indexOf("op") > -1)
|
|
11641
|
+
if ((ua2 == null ? void 0 : ua2.indexOf("op")) > -1)
|
|
11642
11642
|
return "Opera" /* Opera */;
|
|
11643
11643
|
if (isArc())
|
|
11644
11644
|
return "Arc" /* Arc */;
|
|
11645
|
-
if (ua2.indexOf("chrome") > -1)
|
|
11645
|
+
if ((ua2 == null ? void 0 : ua2.indexOf("chrome")) > -1)
|
|
11646
11646
|
return "Chrome" /* Chrome */;
|
|
11647
|
-
if (ua2.indexOf("firefox") > -1)
|
|
11647
|
+
if ((ua2 == null ? void 0 : ua2.indexOf("firefox")) > -1)
|
|
11648
11648
|
return "Firefox" /* Firefox */;
|
|
11649
11649
|
if (isSafari())
|
|
11650
11650
|
return "Safari" /* Safari */;
|
|
@@ -14383,7 +14383,7 @@ function FunConnectOptions({ onClose }) {
|
|
|
14383
14383
|
// src/components/SignIn/SignIn.tsx
|
|
14384
14384
|
import React138, { useCallback as useCallback29, useContext as useContext23, useRef as useRef11 } from "react";
|
|
14385
14385
|
import { UserRejectedRequestError } from "viem";
|
|
14386
|
-
import { useAccount as
|
|
14386
|
+
import { useAccount as useAccount9, useSignMessage } from "wagmi";
|
|
14387
14387
|
var signInIcon = async () => (await import("./sign-FZVB2CS6.js")).default;
|
|
14388
14388
|
function SignIn({
|
|
14389
14389
|
onClose,
|
|
@@ -14412,7 +14412,7 @@ function SignIn({
|
|
|
14412
14412
|
getNonce();
|
|
14413
14413
|
}, [getNonce]);
|
|
14414
14414
|
const mobile = isMobile();
|
|
14415
|
-
const { address, chain: activeChain } =
|
|
14415
|
+
const { address, chain: activeChain } = useAccount9();
|
|
14416
14416
|
const { signMessageAsync } = useSignMessage();
|
|
14417
14417
|
const signIn = async () => {
|
|
14418
14418
|
try {
|
|
@@ -14560,7 +14560,7 @@ function ConnectModal({ onClose, open }) {
|
|
|
14560
14560
|
const titleId = "rk_connect_title";
|
|
14561
14561
|
const connectionStatus = useConnectionStatus();
|
|
14562
14562
|
const { disconnect } = useDisconnect2();
|
|
14563
|
-
const { isConnecting } =
|
|
14563
|
+
const { isConnecting } = useAccount10();
|
|
14564
14564
|
const onAuthCancel = React139.useCallback(() => {
|
|
14565
14565
|
onClose();
|
|
14566
14566
|
disconnect();
|
|
@@ -14715,7 +14715,7 @@ function ModalProvider({ children }) {
|
|
|
14715
14715
|
openModal: openFunDevTestModal
|
|
14716
14716
|
} = useModalStateValue();
|
|
14717
14717
|
const connectionStatus = useConnectionStatus();
|
|
14718
|
-
const { chainId } =
|
|
14718
|
+
const { chainId } = useAccount11();
|
|
14719
14719
|
const { chains } = useConfig4();
|
|
14720
14720
|
const isCurrentChainSupported = chains.some((chain) => chain.id === chainId);
|
|
14721
14721
|
function closeModals({
|
|
@@ -15111,6 +15111,7 @@ var FunkitWeb2Provider = ({
|
|
|
15111
15111
|
}) => {
|
|
15112
15112
|
const funkitConfig = useFunkitConfig();
|
|
15113
15113
|
const { connectAsync } = useConnect2();
|
|
15114
|
+
const { chains } = useConfig5();
|
|
15114
15115
|
const { connectors, disconnectAsync } = useDisconnect3();
|
|
15115
15116
|
const [privy, setPrivy] = useState40(null);
|
|
15116
15117
|
const [privyIframeUrl, setPrivyIframeUrl] = useState40();
|
|
@@ -15139,7 +15140,8 @@ var FunkitWeb2Provider = ({
|
|
|
15139
15140
|
useEffect31(() => {
|
|
15140
15141
|
const newPrivy = new PrivyJS({
|
|
15141
15142
|
appId: funkitConfig.privyAppId,
|
|
15142
|
-
storage: new LocalStorage()
|
|
15143
|
+
storage: new LocalStorage(),
|
|
15144
|
+
supportedChains: chains
|
|
15143
15145
|
});
|
|
15144
15146
|
setPrivyIframeUrl(newPrivy.embeddedWallet.getURL());
|
|
15145
15147
|
setPrivy(newPrivy);
|
|
@@ -15274,8 +15276,10 @@ var FunkitWeb2Provider = ({
|
|
|
15274
15276
|
const funkitConnectWallet2 = wallets.find(
|
|
15275
15277
|
(wallet) => wallet.id === FUNKIT_CONNECT_WALLET_ID
|
|
15276
15278
|
);
|
|
15277
|
-
if (!funkitConnectWallet2)
|
|
15278
|
-
|
|
15279
|
+
if (!funkitConnectWallet2) {
|
|
15280
|
+
setLoginMethodAndCache(null);
|
|
15281
|
+
return false;
|
|
15282
|
+
}
|
|
15279
15283
|
logger.log("privyChainSwitch", { provider, chainId });
|
|
15280
15284
|
await provider.request({
|
|
15281
15285
|
method: "wallet_switchEthereumChain",
|
|
@@ -15544,7 +15548,7 @@ var useFunkitWeb2Login = () => useContext25(FunkitWeb2Context);
|
|
|
15544
15548
|
// src/hooks/useConnectionStatus.ts
|
|
15545
15549
|
function useConnectionStatus() {
|
|
15546
15550
|
const authenticationStatus = useAuthenticationStatus();
|
|
15547
|
-
const { isConnected } =
|
|
15551
|
+
const { isConnected } = useAccount12();
|
|
15548
15552
|
const { isLoggingIn: isWeb2Connecting } = useFunkitWeb2Login();
|
|
15549
15553
|
if (isWeb2Connecting) {
|
|
15550
15554
|
return "loading";
|
|
@@ -15593,7 +15597,7 @@ var DropdownIcon = () => /* @__PURE__ */ React145.createElement("svg", {
|
|
|
15593
15597
|
|
|
15594
15598
|
// src/components/ConnectButton/ConnectButtonRenderer.tsx
|
|
15595
15599
|
import React147, { useContext as useContext28 } from "react";
|
|
15596
|
-
import { useAccount as
|
|
15600
|
+
import { useAccount as useAccount16, useBalance, useConfig as useConfig6 } from "wagmi";
|
|
15597
15601
|
|
|
15598
15602
|
// src/hooks/useIsMounted.ts
|
|
15599
15603
|
import { useCallback as useCallback32, useEffect as useEffect32, useState as useState42 } from "react";
|
|
@@ -15626,19 +15630,19 @@ function useMainnetEnsAvatar(name) {
|
|
|
15626
15630
|
|
|
15627
15631
|
// src/transactions/useRecentTransactions.ts
|
|
15628
15632
|
import { useEffect as useEffect34, useState as useState44 } from "react";
|
|
15629
|
-
import { useAccount as
|
|
15633
|
+
import { useAccount as useAccount15 } from "wagmi";
|
|
15630
15634
|
|
|
15631
15635
|
// src/hooks/useChainId.ts
|
|
15632
|
-
import { useAccount as
|
|
15636
|
+
import { useAccount as useAccount13 } from "wagmi";
|
|
15633
15637
|
function useChainId() {
|
|
15634
15638
|
var _a;
|
|
15635
|
-
const { chain: activeChain } =
|
|
15639
|
+
const { chain: activeChain } = useAccount13();
|
|
15636
15640
|
return (_a = activeChain == null ? void 0 : activeChain.id) != null ? _a : null;
|
|
15637
15641
|
}
|
|
15638
15642
|
|
|
15639
15643
|
// src/transactions/TransactionStoreContext.tsx
|
|
15640
15644
|
import React146, { createContext as createContext21, useContext as useContext27, useEffect as useEffect33, useState as useState43 } from "react";
|
|
15641
|
-
import { useAccount as
|
|
15645
|
+
import { useAccount as useAccount14, usePublicClient } from "wagmi";
|
|
15642
15646
|
|
|
15643
15647
|
// src/transactions/transactionStore.ts
|
|
15644
15648
|
var storageKey5 = "rk-transactions";
|
|
@@ -15785,7 +15789,7 @@ function TransactionStoreProvider({
|
|
|
15785
15789
|
children
|
|
15786
15790
|
}) {
|
|
15787
15791
|
const provider = usePublicClient();
|
|
15788
|
-
const { address } =
|
|
15792
|
+
const { address } = useAccount14();
|
|
15789
15793
|
const chainId = useChainId();
|
|
15790
15794
|
const [store] = useState43(
|
|
15791
15795
|
() => storeSingleton != null ? storeSingleton : storeSingleton = createTransactionStore({ provider })
|
|
@@ -15813,7 +15817,7 @@ function useTransactionStore() {
|
|
|
15813
15817
|
// src/transactions/useRecentTransactions.ts
|
|
15814
15818
|
function useRecentTransactions() {
|
|
15815
15819
|
const store = useTransactionStore();
|
|
15816
|
-
const { address } =
|
|
15820
|
+
const { address } = useAccount15();
|
|
15817
15821
|
const chainId = useChainId();
|
|
15818
15822
|
const [transactions, setTransactions] = useState44(
|
|
15819
15823
|
() => store && address && chainId ? store.getTransactions(address, chainId) : []
|
|
@@ -15866,11 +15870,11 @@ function ConnectButtonRenderer({
|
|
|
15866
15870
|
}) {
|
|
15867
15871
|
var _a, _b, _c, _d;
|
|
15868
15872
|
const isMounted = useIsMounted();
|
|
15869
|
-
const { address } =
|
|
15873
|
+
const { address } = useAccount16();
|
|
15870
15874
|
const ensName = useMainnetEnsName(address);
|
|
15871
15875
|
const ensAvatar = useMainnetEnsAvatar(ensName);
|
|
15872
|
-
const { chainId } =
|
|
15873
|
-
const { chains: wagmiChains } =
|
|
15876
|
+
const { chainId } = useAccount16();
|
|
15877
|
+
const { chains: wagmiChains } = useConfig6();
|
|
15874
15878
|
const isCurrentChainSupported = wagmiChains.some(
|
|
15875
15879
|
(chain) => chain.id === chainId
|
|
15876
15880
|
);
|
|
@@ -16198,9 +16202,7 @@ var connectorsForWallets = (walletList, {
|
|
|
16198
16202
|
appName,
|
|
16199
16203
|
appDescription,
|
|
16200
16204
|
appUrl,
|
|
16201
|
-
appIcon
|
|
16202
|
-
funkitApiKey,
|
|
16203
|
-
initialChainId
|
|
16205
|
+
appIcon
|
|
16204
16206
|
}) => {
|
|
16205
16207
|
let index = -1;
|
|
16206
16208
|
const connectors = [];
|
|
@@ -16226,9 +16228,7 @@ var connectorsForWallets = (walletList, {
|
|
|
16226
16228
|
walletConnectParameters: {
|
|
16227
16229
|
metadata: walletConnectMetaData,
|
|
16228
16230
|
...walletConnectParameters
|
|
16229
|
-
}
|
|
16230
|
-
funkitApiKey,
|
|
16231
|
-
initialChainId
|
|
16231
|
+
}
|
|
16232
16232
|
});
|
|
16233
16233
|
if ((wallet == null ? void 0 : wallet.iconAccent) && !isHexString(wallet == null ? void 0 : wallet.iconAccent)) {
|
|
16234
16234
|
throw new Error(
|
|
@@ -16765,10 +16765,7 @@ var walletConnectWallet = ({
|
|
|
16765
16765
|
// src/wallets/walletConnectors/funkitConnectWallet/funkitConnectWallet.ts
|
|
16766
16766
|
import { funkitWagmiConnectorWallet } from "@funkit/wagmi-tools";
|
|
16767
16767
|
import { createConnector as createConnector4 } from "wagmi";
|
|
16768
|
-
var funkitConnectWallet = ({
|
|
16769
|
-
funkitApiKey,
|
|
16770
|
-
initialChainId
|
|
16771
|
-
}) => {
|
|
16768
|
+
var funkitConnectWallet = () => {
|
|
16772
16769
|
return {
|
|
16773
16770
|
id: FUNKIT_CONNECT_WALLET_ID,
|
|
16774
16771
|
name: "FunkitConnect Wallet",
|
|
@@ -16779,10 +16776,7 @@ var funkitConnectWallet = ({
|
|
|
16779
16776
|
downloadUrls: void 0,
|
|
16780
16777
|
createConnector: (walletDetails) => {
|
|
16781
16778
|
return createConnector4((config) => ({
|
|
16782
|
-
...funkitWagmiConnectorWallet(
|
|
16783
|
-
funkitApiKey,
|
|
16784
|
-
chainId: initialChainId
|
|
16785
|
-
})(config),
|
|
16779
|
+
...funkitWagmiConnectorWallet()(config),
|
|
16786
16780
|
...walletDetails
|
|
16787
16781
|
}));
|
|
16788
16782
|
}
|
|
@@ -16824,8 +16818,6 @@ var getDefaultConfig = ({
|
|
|
16824
16818
|
appIcon,
|
|
16825
16819
|
wallets,
|
|
16826
16820
|
projectId,
|
|
16827
|
-
funkitApiKey,
|
|
16828
|
-
initialChainId,
|
|
16829
16821
|
...wagmiParameters
|
|
16830
16822
|
}) => {
|
|
16831
16823
|
const { transports, connectors, chains, ...restWagmiParameters } = wagmiParameters;
|
|
@@ -16859,9 +16851,7 @@ var getDefaultConfig = ({
|
|
|
16859
16851
|
appDescription,
|
|
16860
16852
|
appUrl,
|
|
16861
16853
|
appIcon,
|
|
16862
|
-
walletConnectParameters: { metadata }
|
|
16863
|
-
funkitApiKey,
|
|
16864
|
-
initialChainId: initialChainId.toString()
|
|
16854
|
+
walletConnectParameters: { metadata }
|
|
16865
16855
|
}
|
|
16866
16856
|
);
|
|
16867
16857
|
}
|
|
@@ -16992,7 +16982,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
16992
16982
|
localStorage.setItem(storageKey6, version);
|
|
16993
16983
|
}
|
|
16994
16984
|
function getCurrentSdkVersion() {
|
|
16995
|
-
return "1.2.
|
|
16985
|
+
return "1.2.2";
|
|
16996
16986
|
}
|
|
16997
16987
|
function useFingerprint() {
|
|
16998
16988
|
const fingerprint = useCallback33(() => {
|
|
@@ -17044,9 +17034,7 @@ function FunkitProvider(props) {
|
|
|
17044
17034
|
if (props.wagmiConfig && initialChainId) {
|
|
17045
17035
|
finalWagmiConfig = createFunkitWagmiConfig({
|
|
17046
17036
|
...props.wagmiConfig,
|
|
17047
|
-
appName: props.funkitConfig.appName
|
|
17048
|
-
funkitApiKey: props.funkitConfig.apiKey,
|
|
17049
|
-
initialChainId: initialChainId.toString()
|
|
17037
|
+
appName: props.funkitConfig.appName
|
|
17050
17038
|
});
|
|
17051
17039
|
}
|
|
17052
17040
|
let finalQueryClient;
|
|
@@ -17154,7 +17142,7 @@ import React150, {
|
|
|
17154
17142
|
useMemo as useMemo35,
|
|
17155
17143
|
useState as useState46
|
|
17156
17144
|
} from "react";
|
|
17157
|
-
import { useAccount as
|
|
17145
|
+
import { useAccount as useAccount17, useAccountEffect as useAccountEffect4 } from "wagmi";
|
|
17158
17146
|
function WalletButtonRenderer({
|
|
17159
17147
|
wallet = "rainbow",
|
|
17160
17148
|
children
|
|
@@ -17175,7 +17163,7 @@ function WalletButtonRenderer({
|
|
|
17175
17163
|
if (!connectModalOpen && connector)
|
|
17176
17164
|
setConnector(null);
|
|
17177
17165
|
}, [connectModalOpen, connector, setConnector]);
|
|
17178
|
-
const { isConnected, isConnecting } =
|
|
17166
|
+
const { isConnected, isConnecting } = useAccount17();
|
|
17179
17167
|
useAccountEffect4({
|
|
17180
17168
|
onConnect: () => {
|
|
17181
17169
|
if (isError)
|
|
@@ -17993,10 +17981,10 @@ function FunkitPaymentsIconLine({
|
|
|
17993
17981
|
|
|
17994
17982
|
// src/transactions/useAddRecentTransaction.ts
|
|
17995
17983
|
import { useCallback as useCallback36 } from "react";
|
|
17996
|
-
import { useAccount as
|
|
17984
|
+
import { useAccount as useAccount18 } from "wagmi";
|
|
17997
17985
|
function useAddRecentTransaction() {
|
|
17998
17986
|
const store = useTransactionStore();
|
|
17999
|
-
const { address } =
|
|
17987
|
+
const { address } = useAccount18();
|
|
18000
17988
|
const chainId = useChainId();
|
|
18001
17989
|
return useCallback36(
|
|
18002
17990
|
(transaction) => {
|