@funkit/connect 6.14.0 → 6.14.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 +12 -0
- package/dist/consts/funkit.d.ts +1 -0
- package/dist/index.js +21 -16
- 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/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 +51 -51
- 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 +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 6.14.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 014910c: Fix connected state detection by adding explicit isConnected field to user info
|
|
8
|
+
|
|
9
|
+
## 6.14.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- bc75836: Fix login state detection for external users in GeneralWalletProvider and remove redundant check in useRecentDirectExecutions
|
|
14
|
+
|
|
3
15
|
## 6.14.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/consts/funkit.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -565,7 +565,8 @@ var PLACEHOLDER_FUNKIT_USER_INFO = {
|
|
|
565
565
|
nameTruncated: "Guest",
|
|
566
566
|
type: "unknown",
|
|
567
567
|
typeLabel: "",
|
|
568
|
-
iconSrc: ""
|
|
568
|
+
iconSrc: "",
|
|
569
|
+
isConnected: false
|
|
569
570
|
};
|
|
570
571
|
|
|
571
572
|
// src/utils/funLogger.ts
|
|
@@ -1659,7 +1660,7 @@ function GeneralWalletProvider({ children }) {
|
|
|
1659
1660
|
const { web2UserInfo, handleFunkitWeb2Logout } = useFunkitWeb2Login();
|
|
1660
1661
|
const { externalUserId, apiKey } = useFunkitConfig();
|
|
1661
1662
|
const loginType = !connector ? "guest" /* Guest */ : connector.id === FUNKIT_CONNECT_WALLET_ID ? "web2" /* Web2 */ : "web3" /* Web3 */;
|
|
1662
|
-
const isUserLoggedIn = loginType !== "guest" /* Guest
|
|
1663
|
+
const isUserLoggedIn = loginType !== "guest" /* Guest */ || !!externalUserId;
|
|
1663
1664
|
const userInfo = useMemo4(() => {
|
|
1664
1665
|
const id = externalUserId ? generateSyntheticUserId(apiKey, externalUserId) : address || "0x";
|
|
1665
1666
|
if (!address) {
|
|
@@ -1683,7 +1684,8 @@ function GeneralWalletProvider({ children }) {
|
|
|
1683
1684
|
nameTruncated: ensName ? formatENS(ensName) : formatAddress2(address),
|
|
1684
1685
|
type: "eoa",
|
|
1685
1686
|
typeLabel: connector?.name || "",
|
|
1686
|
-
iconSrc: ensAvatar || ""
|
|
1687
|
+
iconSrc: ensAvatar || "",
|
|
1688
|
+
isConnected: true
|
|
1687
1689
|
};
|
|
1688
1690
|
}
|
|
1689
1691
|
return PLACEHOLDER_FUNKIT_USER_INFO;
|
|
@@ -22023,11 +22025,12 @@ function usePaymentMethodEnablement({
|
|
|
22023
22025
|
};
|
|
22024
22026
|
}
|
|
22025
22027
|
var usePaymentSources = (paymentMethodInfo, targetChainId, checkoutConfig) => {
|
|
22026
|
-
const {
|
|
22028
|
+
const { userInfo, walletAddress } = useGeneralWallet();
|
|
22027
22029
|
const { data: allFiatAccounts } = useVirtualFiatAccounts();
|
|
22028
22030
|
const matchingFiatAccount = useMatchingVirtualFiatAccount(allFiatAccounts);
|
|
22029
22031
|
const { hasUsableBalance } = useWalletAssetHoldings(targetChainId);
|
|
22030
22032
|
const { apiKey } = useFunkitConfig();
|
|
22033
|
+
const isConnected = userInfo.isConnected;
|
|
22031
22034
|
const { isFiatEnabled, isTokenTransferEnabled, isCardEnabled } = usePaymentMethodEnablement({ checkoutConfig });
|
|
22032
22035
|
const accountPaymentMethodInfo = createPaymentMethodInfo({
|
|
22033
22036
|
paymentMethod: "balance" /* ACCOUNT_BALANCE */,
|
|
@@ -22039,17 +22042,17 @@ var usePaymentSources = (paymentMethodInfo, targetChainId, checkoutConfig) => {
|
|
|
22039
22042
|
bridgeCustomer: allFiatAccounts.bridgeCustomer
|
|
22040
22043
|
}) : null;
|
|
22041
22044
|
const showBalanceOption = isKatanaCustomer(apiKey) || hasUsableBalance;
|
|
22042
|
-
const connectedAccountInfo = paymentMethodInfo?.paymentMethod !== "balance" /* ACCOUNT_BALANCE */ &&
|
|
22045
|
+
const connectedAccountInfo = paymentMethodInfo?.paymentMethod !== "balance" /* ACCOUNT_BALANCE */ && isConnected && showBalanceOption ? accountPaymentMethodInfo : null;
|
|
22043
22046
|
const connected = [
|
|
22044
22047
|
paymentMethodInfo,
|
|
22045
22048
|
connectedAccountInfo,
|
|
22046
22049
|
virtualBankPaymentMethodInfo
|
|
22047
22050
|
].filter(isNotNullish7);
|
|
22048
|
-
const ignoreFallback =
|
|
22051
|
+
const ignoreFallback = isConnected && !hasUsableBalance;
|
|
22049
22052
|
const fallback2 = connected.length === 0 && !ignoreFallback ? isTokenTransferEnabled ? ["token_transfer" /* TOKEN_TRANSFER */] : isCardEnabled ? ["card" /* CARD */] : ["balance" /* ACCOUNT_BALANCE */] : [];
|
|
22050
22053
|
const isTokenInNewSources = !fallback2.includes("token_transfer" /* TOKEN_TRANSFER */) && isTokenTransferEnabled;
|
|
22051
|
-
const isWalletInNewSources = !
|
|
22052
|
-
const isBankInNewSources = !matchingFiatAccount &&
|
|
22054
|
+
const isWalletInNewSources = !isConnected;
|
|
22055
|
+
const isBankInNewSources = !matchingFiatAccount && isConnected && isFiatEnabled;
|
|
22053
22056
|
const newSources = [
|
|
22054
22057
|
isTokenInNewSources && "token_transfer" /* TOKEN_TRANSFER */,
|
|
22055
22058
|
!fallback2.includes("card" /* CARD */) && isCardEnabled && "card" /* CARD */,
|
|
@@ -22303,7 +22306,7 @@ function LoadingAccount({
|
|
|
22303
22306
|
modalState,
|
|
22304
22307
|
onNext
|
|
22305
22308
|
}) {
|
|
22306
|
-
const { walletAddress } = useGeneralWallet();
|
|
22309
|
+
const { walletAddress, userInfo } = useGeneralWallet();
|
|
22307
22310
|
const { apiKey } = useFunkitConfig();
|
|
22308
22311
|
const { targetChainId, isDefiMode } = modalState;
|
|
22309
22312
|
const { isLoading: isFetchingAssets, walletAssets } = useWalletAssets();
|
|
@@ -22327,7 +22330,7 @@ function LoadingAccount({
|
|
|
22327
22330
|
if (isLoadingFlags || isLoadingFiat || !checkoutConfig) {
|
|
22328
22331
|
return;
|
|
22329
22332
|
}
|
|
22330
|
-
if (startsOnSelectAssetStep) {
|
|
22333
|
+
if (startsOnSelectAssetStep && userInfo.isConnected) {
|
|
22331
22334
|
const paymentMethodInfo = createPaymentMethodInfo({
|
|
22332
22335
|
paymentMethod: "balance" /* ACCOUNT_BALANCE */,
|
|
22333
22336
|
walletAddress
|
|
@@ -22379,7 +22382,8 @@ function LoadingAccount({
|
|
|
22379
22382
|
targetChainId,
|
|
22380
22383
|
onNext,
|
|
22381
22384
|
updateSelectedPaymentMethodInfo,
|
|
22382
|
-
checkoutConfig
|
|
22385
|
+
checkoutConfig,
|
|
22386
|
+
userInfo.isConnected
|
|
22383
22387
|
]);
|
|
22384
22388
|
return startsOnConfirmationStep ? /* @__PURE__ */ React150.createElement(ConfirmationStepLoading, null) : /* @__PURE__ */ React150.createElement(FunAssetLoading, { count: 5 });
|
|
22385
22389
|
}
|
|
@@ -26952,7 +26956,7 @@ var useRecentCheckouts = ({
|
|
|
26952
26956
|
).sort((a, b) => b.createdTimeMs - a.createdTimeMs);
|
|
26953
26957
|
},
|
|
26954
26958
|
refetchInterval: listRefresh,
|
|
26955
|
-
enabled:
|
|
26959
|
+
enabled: isUserLoggedIn && isVisible
|
|
26956
26960
|
});
|
|
26957
26961
|
return query;
|
|
26958
26962
|
};
|
|
@@ -26973,7 +26977,7 @@ var useRecentDirectExecutions = ({
|
|
|
26973
26977
|
isVisible,
|
|
26974
26978
|
filterFunc = () => true
|
|
26975
26979
|
}) => {
|
|
26976
|
-
const {
|
|
26980
|
+
const { userInfo, isUserLoggedIn } = useGeneralWallet();
|
|
26977
26981
|
const { apiKey } = useFunkitConfig();
|
|
26978
26982
|
const { listRefresh } = useCheckoutRefreshInterval();
|
|
26979
26983
|
const query = useQuery19({
|
|
@@ -26988,7 +26992,7 @@ var useRecentDirectExecutions = ({
|
|
|
26988
26992
|
return directExecutions.filter((de) => isRecent2(de, defaultTimestampCutoff) && filterFunc(de)).sort((a, b) => b.createdTimeMs - a.createdTimeMs);
|
|
26989
26993
|
},
|
|
26990
26994
|
refetchInterval: listRefresh,
|
|
26991
|
-
enabled:
|
|
26995
|
+
enabled: isUserLoggedIn && isVisible
|
|
26992
26996
|
});
|
|
26993
26997
|
return query;
|
|
26994
26998
|
};
|
|
@@ -30691,7 +30695,8 @@ var FunkitWeb2Provider = ({
|
|
|
30691
30695
|
nameTruncated,
|
|
30692
30696
|
type,
|
|
30693
30697
|
typeLabel,
|
|
30694
|
-
iconSrc
|
|
30698
|
+
iconSrc,
|
|
30699
|
+
isConnected: true
|
|
30695
30700
|
};
|
|
30696
30701
|
}, [loggedInUser, loginMethod]);
|
|
30697
30702
|
const contextValue = {
|
|
@@ -31630,7 +31635,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
31630
31635
|
localStorage.setItem(storageKey5, version);
|
|
31631
31636
|
}
|
|
31632
31637
|
function getCurrentSdkVersion() {
|
|
31633
|
-
return "6.14.
|
|
31638
|
+
return "6.14.2";
|
|
31634
31639
|
}
|
|
31635
31640
|
function useFingerprint() {
|
|
31636
31641
|
const fingerprint = useCallback50(() => {
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
xdefiWallet
|
|
4
|
-
} from "./chunk-BOU4WKRZ.js";
|
|
5
2
|
import {
|
|
6
3
|
zealWallet
|
|
7
4
|
} from "./chunk-RNBEDQHF.js";
|
|
8
5
|
import {
|
|
9
6
|
zerionWallet
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
subWallet
|
|
13
|
-
} from "./chunk-JWFF4AAL.js";
|
|
7
|
+
} from "./chunk-Q3H3TRBS.js";
|
|
14
8
|
import {
|
|
15
|
-
|
|
16
|
-
} from "./chunk-
|
|
9
|
+
xdefiWallet
|
|
10
|
+
} from "./chunk-BOU4WKRZ.js";
|
|
17
11
|
import {
|
|
18
12
|
talismanWallet
|
|
19
13
|
} from "./chunk-DRO6WYMM.js";
|
|
14
|
+
import {
|
|
15
|
+
safepalWallet
|
|
16
|
+
} from "./chunk-EC6CHBSZ.js";
|
|
17
|
+
import {
|
|
18
|
+
tahoWallet
|
|
19
|
+
} from "./chunk-ZZZRUXZE.js";
|
|
20
20
|
import {
|
|
21
21
|
tokenPocketWallet
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-J3LI3FYZ.js";
|
|
23
23
|
import {
|
|
24
24
|
trustWallet
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-RKPCWHXL.js";
|
|
26
26
|
import {
|
|
27
27
|
tokenaryWallet
|
|
28
28
|
} from "./chunk-D6AOOO5F.js";
|
|
@@ -40,10 +40,13 @@ import {
|
|
|
40
40
|
} from "./chunk-BBOM42DL.js";
|
|
41
41
|
import {
|
|
42
42
|
rainbowWallet
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-3CICVJUN.js";
|
|
44
44
|
import {
|
|
45
45
|
ramperWallet
|
|
46
46
|
} from "./chunk-BYXPFMI7.js";
|
|
47
|
+
import {
|
|
48
|
+
roninWallet
|
|
49
|
+
} from "./chunk-QLVVUKYB.js";
|
|
47
50
|
import {
|
|
48
51
|
safeWallet
|
|
49
52
|
} from "./chunk-BQQQL6UD.js";
|
|
@@ -51,50 +54,47 @@ import {
|
|
|
51
54
|
safeheronWallet
|
|
52
55
|
} from "./chunk-RZIO5TFF.js";
|
|
53
56
|
import {
|
|
54
|
-
|
|
55
|
-
} from "./chunk-
|
|
56
|
-
import {
|
|
57
|
-
safepalWallet
|
|
58
|
-
} from "./chunk-NT2HYJKW.js";
|
|
57
|
+
subWallet
|
|
58
|
+
} from "./chunk-ZSI5N4VV.js";
|
|
59
59
|
import {
|
|
60
60
|
metaMaskWallet
|
|
61
|
-
} from "./chunk-
|
|
62
|
-
import {
|
|
63
|
-
ledgerWallet
|
|
64
|
-
} from "./chunk-BRBKM4PW.js";
|
|
61
|
+
} from "./chunk-UYGJO62F.js";
|
|
65
62
|
import {
|
|
66
63
|
mewWallet
|
|
67
64
|
} from "./chunk-OL5ZO7E4.js";
|
|
68
65
|
import {
|
|
69
66
|
oktoWallet
|
|
70
67
|
} from "./chunk-ADIXAKUL.js";
|
|
68
|
+
import {
|
|
69
|
+
okxWallet
|
|
70
|
+
} from "./chunk-AFXHGWBH.js";
|
|
71
71
|
import {
|
|
72
72
|
omniWallet
|
|
73
73
|
} from "./chunk-7CUY5G6R.js";
|
|
74
|
+
import {
|
|
75
|
+
ledgerWallet
|
|
76
|
+
} from "./chunk-BRBKM4PW.js";
|
|
74
77
|
import {
|
|
75
78
|
oneInchWallet
|
|
76
79
|
} from "./chunk-OESTDX6I.js";
|
|
77
|
-
import {
|
|
78
|
-
okxWallet
|
|
79
|
-
} from "./chunk-TDIEHTMB.js";
|
|
80
80
|
import {
|
|
81
81
|
oneKeyWallet
|
|
82
82
|
} from "./chunk-SHBUZ7U7.js";
|
|
83
83
|
import {
|
|
84
84
|
foxWallet
|
|
85
|
-
} from "./chunk-
|
|
86
|
-
import {
|
|
87
|
-
frameWallet
|
|
88
|
-
} from "./chunk-IFON7E6U.js";
|
|
85
|
+
} from "./chunk-CNPKISHN.js";
|
|
89
86
|
import {
|
|
90
87
|
frontierWallet
|
|
91
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-VWCLFMWJ.js";
|
|
92
89
|
import {
|
|
93
|
-
|
|
94
|
-
} from "./chunk-
|
|
90
|
+
frameWallet
|
|
91
|
+
} from "./chunk-IFON7E6U.js";
|
|
95
92
|
import {
|
|
96
93
|
imTokenWallet
|
|
97
94
|
} from "./chunk-COZ7MIQS.js";
|
|
95
|
+
import {
|
|
96
|
+
gateWallet
|
|
97
|
+
} from "./chunk-CJGUM55H.js";
|
|
98
98
|
import {
|
|
99
99
|
injectedWallet
|
|
100
100
|
} from "./chunk-XWUJE7MW.js";
|
|
@@ -102,52 +102,52 @@ import {
|
|
|
102
102
|
kresusWallet
|
|
103
103
|
} from "./chunk-MJXPRJZT.js";
|
|
104
104
|
import {
|
|
105
|
-
|
|
106
|
-
} from "./chunk-
|
|
107
|
-
import {
|
|
108
|
-
bloomWallet
|
|
109
|
-
} from "./chunk-S27IADFU.js";
|
|
105
|
+
bybitWallet
|
|
106
|
+
} from "./chunk-LNEC5RNX.js";
|
|
110
107
|
import {
|
|
111
108
|
coin98Wallet
|
|
112
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-KIDC67XJ.js";
|
|
110
|
+
import {
|
|
111
|
+
coreWallet
|
|
112
|
+
} from "./chunk-JCHN6A47.js";
|
|
113
|
+
import {
|
|
114
|
+
dawnWallet
|
|
115
|
+
} from "./chunk-HWPKCIBE.js";
|
|
113
116
|
import {
|
|
114
117
|
coinbaseWallet
|
|
115
118
|
} from "./chunk-H4IRCEZN.js";
|
|
116
|
-
import {
|
|
117
|
-
coreWallet
|
|
118
|
-
} from "./chunk-VR4TBQ6S.js";
|
|
119
119
|
import {
|
|
120
120
|
desigWallet
|
|
121
121
|
} from "./chunk-OPAZMNA7.js";
|
|
122
|
-
import {
|
|
123
|
-
dawnWallet
|
|
124
|
-
} from "./chunk-HWPKCIBE.js";
|
|
125
122
|
import {
|
|
126
123
|
enkryptWallet
|
|
127
124
|
} from "./chunk-OLOIXTYS.js";
|
|
125
|
+
import {
|
|
126
|
+
clvWallet
|
|
127
|
+
} from "./chunk-2GJQ4XZQ.js";
|
|
128
128
|
import {
|
|
129
129
|
argentWallet
|
|
130
130
|
} from "./chunk-WSQ2YJO2.js";
|
|
131
|
-
import {
|
|
132
|
-
bitskiWallet
|
|
133
|
-
} from "./chunk-HS3C7OQV.js";
|
|
134
131
|
import {
|
|
135
132
|
bifrostWallet
|
|
136
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-UIASLGLV.js";
|
|
137
134
|
import {
|
|
138
135
|
bitverseWallet
|
|
139
136
|
} from "./chunk-3HZRRP4Y.js";
|
|
137
|
+
import {
|
|
138
|
+
bitskiWallet
|
|
139
|
+
} from "./chunk-HS3C7OQV.js";
|
|
140
140
|
import {
|
|
141
141
|
bitgetWallet
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-5W7VDOCL.js";
|
|
143
143
|
import {
|
|
144
144
|
braveWallet
|
|
145
145
|
} from "./chunk-BPZ2XJO2.js";
|
|
146
|
+
import "./chunk-DNSG5Q7V.js";
|
|
146
147
|
import {
|
|
147
|
-
|
|
148
|
-
} from "./chunk-
|
|
148
|
+
bloomWallet
|
|
149
|
+
} from "./chunk-S27IADFU.js";
|
|
149
150
|
import "./chunk-23WIEY36.js";
|
|
150
|
-
import "./chunk-DNSG5Q7V.js";
|
|
151
151
|
export {
|
|
152
152
|
argentWallet,
|
|
153
153
|
bifrostWallet,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/connect",
|
|
3
|
-
"version": "6.14.
|
|
3
|
+
"version": "6.14.2",
|
|
4
4
|
"description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -92,12 +92,12 @@
|
|
|
92
92
|
"ua-parser-js": "^1.0.37",
|
|
93
93
|
"use-debounce": "^10.0.5",
|
|
94
94
|
"uuid": "^9.0.1",
|
|
95
|
+
"@funkit/utils": "1.1.11",
|
|
95
96
|
"@funkit/api-base": "1.12.3",
|
|
96
97
|
"@funkit/core": "2.3.48",
|
|
97
|
-
"@funkit/utils": "1.1.11",
|
|
98
|
-
"@funkit/chains": "0.4.0",
|
|
99
98
|
"@funkit/wagmi-tools": "3.0.71",
|
|
100
|
-
"@funkit/fun-relay": "2.0.3"
|
|
99
|
+
"@funkit/fun-relay": "2.0.3",
|
|
100
|
+
"@funkit/chains": "0.4.0"
|
|
101
101
|
},
|
|
102
102
|
"repository": {
|
|
103
103
|
"type": "git",
|