@funkit/connect 0.1.16 → 0.1.17
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 +9 -0
- package/dist/{chunk-FUDTZOKU.js → chunk-2AOSP73X.js} +29 -14
- package/dist/components/FunkitProvider/FunkitConnectChainContext.d.ts +5 -1
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/wallets/walletConnectors/index.js +35 -35
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 0.1.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- df73a1a: Fix: cross chain assets should be selectable for brokerage checkouts regardless of enabled chains
|
|
8
|
+
- Updated dependencies [a200557]
|
|
9
|
+
- @funkit/wagmi-tools@0.1.11
|
|
10
|
+
- @funkit/core@0.10.12
|
|
11
|
+
|
|
3
12
|
## 0.1.16
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -297,6 +297,7 @@ function indexBy(items, getKey) {
|
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
// src/components/FunkitProvider/FunkitConnectChainContext.tsx
|
|
300
|
+
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO_LIST } from "@funkit/core";
|
|
300
301
|
import React2, { createContext as createContext2, useContext as useContext2, useMemo as useMemo2 } from "react";
|
|
301
302
|
|
|
302
303
|
// src/components/FunkitProvider/provideFunkitConnectChains.ts
|
|
@@ -411,15 +412,29 @@ function FunkitConnectChainProvider({
|
|
|
411
412
|
}
|
|
412
413
|
var useFunkitConnectChains = () => useContext2(FunkitConnectChainContext).chains;
|
|
413
414
|
var useInitialChainId = () => useContext2(FunkitConnectChainContext).initialChainId;
|
|
415
|
+
var useAllPossibleFunkitConnectChains = () => provideFunkitConnectChains(
|
|
416
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO_LIST
|
|
417
|
+
);
|
|
418
|
+
function groupChainsById(chains) {
|
|
419
|
+
const chainsById = {};
|
|
420
|
+
chains.forEach((chainItem) => {
|
|
421
|
+
chainsById[chainItem.id] = chainItem;
|
|
422
|
+
});
|
|
423
|
+
return chainsById;
|
|
424
|
+
}
|
|
414
425
|
var useFunkitConnectChainsById = () => {
|
|
415
426
|
const funkitConnectChains = useFunkitConnectChains();
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
funkitConnectChains.forEach((rkChain) => {
|
|
419
|
-
funkitConnectChainsById[rkChain.id] = rkChain;
|
|
420
|
-
});
|
|
421
|
-
return funkitConnectChainsById;
|
|
427
|
+
const enabledFunkitConnectChainsById = useMemo2(() => {
|
|
428
|
+
return groupChainsById(funkitConnectChains);
|
|
422
429
|
}, [funkitConnectChains]);
|
|
430
|
+
const allPossibleFunkitConnectChains = useAllPossibleFunkitConnectChains();
|
|
431
|
+
const allPossibleFunkitConnectChainsById = useMemo2(() => {
|
|
432
|
+
return groupChainsById(allPossibleFunkitConnectChains);
|
|
433
|
+
}, [allPossibleFunkitConnectChains]);
|
|
434
|
+
return {
|
|
435
|
+
enabledFunkitConnectChainsById,
|
|
436
|
+
allPossibleFunkitConnectChainsById
|
|
437
|
+
};
|
|
423
438
|
};
|
|
424
439
|
|
|
425
440
|
// src/utils/browsers.ts
|
|
@@ -1584,7 +1599,7 @@ function GeneralWalletProvider({ children }) {
|
|
|
1584
1599
|
const { disconnectAsync } = useDisconnect2();
|
|
1585
1600
|
const ensName = useMainnetEnsName(address);
|
|
1586
1601
|
const { userInfo: web2UserInfo, logout: web2Logout } = useFunkitWeb2Login();
|
|
1587
|
-
const
|
|
1602
|
+
const { enabledFunkitConnectChainsById } = useFunkitConnectChainsById();
|
|
1588
1603
|
const isWeb2Login = useMemo4(() => {
|
|
1589
1604
|
return connector && connector.id === FUNKIT_CONNECTOR_ID;
|
|
1590
1605
|
}, [connector]);
|
|
@@ -1635,7 +1650,7 @@ function GeneralWalletProvider({ children }) {
|
|
|
1635
1650
|
const assets = await getAssetsByWalletAddress(address, "ALL");
|
|
1636
1651
|
const assetsCombined = Object.keys(assets).reduce(
|
|
1637
1652
|
(acc, curChainId) => {
|
|
1638
|
-
if (!
|
|
1653
|
+
if (!enabledFunkitConnectChainsById?.[curChainId])
|
|
1639
1654
|
return acc;
|
|
1640
1655
|
else {
|
|
1641
1656
|
const chainAssets = assets?.[curChainId];
|
|
@@ -1659,7 +1674,7 @@ function GeneralWalletProvider({ children }) {
|
|
|
1659
1674
|
setIsFetchingAssets(false);
|
|
1660
1675
|
}
|
|
1661
1676
|
}
|
|
1662
|
-
}, [isConnected, address,
|
|
1677
|
+
}, [isConnected, address, enabledFunkitConnectChainsById]);
|
|
1663
1678
|
useEffect5(() => {
|
|
1664
1679
|
_fetchAssetsIfPossible();
|
|
1665
1680
|
}, [refreshSymbol, activeChain]);
|
|
@@ -19654,8 +19669,8 @@ function FunAssetAvatar({
|
|
|
19654
19669
|
chainId,
|
|
19655
19670
|
chainIconSize = "12"
|
|
19656
19671
|
}) {
|
|
19657
|
-
const
|
|
19658
|
-
const chainInfo =
|
|
19672
|
+
const { allPossibleFunkitConnectChainsById } = useFunkitConnectChainsById();
|
|
19673
|
+
const chainInfo = allPossibleFunkitConnectChainsById[parseInt(chainId.toString())];
|
|
19659
19674
|
const finalAssetSrc = useMemo17(() => {
|
|
19660
19675
|
const normalizedTicker = assetTicker.toUpperCase();
|
|
19661
19676
|
if (ASSET_LOGO_SRCS?.[normalizedTicker])
|
|
@@ -24784,9 +24799,9 @@ function ConnectButtonRenderer({
|
|
|
24784
24799
|
cacheTime: 5e4
|
|
24785
24800
|
});
|
|
24786
24801
|
const { chain: activeChain } = useNetwork10();
|
|
24787
|
-
const
|
|
24802
|
+
const { enabledFunkitConnectChainsById } = useFunkitConnectChainsById();
|
|
24788
24803
|
const authenticationStatus = useAuthenticationStatus() ?? void 0;
|
|
24789
|
-
const funkitConnectChain = activeChain ?
|
|
24804
|
+
const funkitConnectChain = activeChain ? enabledFunkitConnectChainsById[activeChain.id] : void 0;
|
|
24790
24805
|
const chainName = funkitConnectChain?.name ?? void 0;
|
|
24791
24806
|
const chainIconUrl = funkitConnectChain?.iconUrl ?? void 0;
|
|
24792
24807
|
const chainIconBackground = funkitConnectChain?.iconBackground ?? void 0;
|
|
@@ -25293,7 +25308,7 @@ function setRainbowKitVersion({ version }) {
|
|
|
25293
25308
|
}
|
|
25294
25309
|
function useFingerprint() {
|
|
25295
25310
|
const fingerprint = useCallback23(() => {
|
|
25296
|
-
setRainbowKitVersion({ version: "0.1.
|
|
25311
|
+
setRainbowKitVersion({ version: "0.1.17" });
|
|
25297
25312
|
}, []);
|
|
25298
25313
|
useEffect34(() => {
|
|
25299
25314
|
fingerprint();
|
|
@@ -15,5 +15,9 @@ interface FunkitConnectChainProviderProps {
|
|
|
15
15
|
export declare function FunkitConnectChainProvider({ chains, children, initialChain, }: FunkitConnectChainProviderProps): React.JSX.Element;
|
|
16
16
|
export declare const useFunkitConnectChains: () => FunkitConnectChain[];
|
|
17
17
|
export declare const useInitialChainId: () => number | undefined;
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const useAllPossibleFunkitConnectChains: () => Chain[];
|
|
19
|
+
export declare const useFunkitConnectChainsById: () => {
|
|
20
|
+
enabledFunkitConnectChainsById: Record<number, FunkitConnectChain>;
|
|
21
|
+
allPossibleFunkitConnectChainsById: Record<number, FunkitConnectChain>;
|
|
22
|
+
};
|
|
19
23
|
export {};
|
package/dist/components/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -3,56 +3,56 @@ import {
|
|
|
3
3
|
zerionWallet
|
|
4
4
|
} from "./chunk-77KYAV4P.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "./chunk-
|
|
6
|
+
zealWallet
|
|
7
|
+
} from "./chunk-QBKHMTGI.js";
|
|
8
|
+
import {
|
|
9
|
+
subWallet
|
|
10
|
+
} from "./chunk-PTF3JKWO.js";
|
|
11
|
+
import {
|
|
12
|
+
tahoWallet
|
|
13
|
+
} from "./chunk-OOGGCCFQ.js";
|
|
8
14
|
import {
|
|
9
15
|
talismanWallet
|
|
10
16
|
} from "./chunk-5UETJ33B.js";
|
|
11
17
|
import {
|
|
12
18
|
tokenPocketWallet
|
|
13
19
|
} from "./chunk-3XLDPS4Y.js";
|
|
14
|
-
import {
|
|
15
|
-
safepalWallet
|
|
16
|
-
} from "./chunk-TZR3P22N.js";
|
|
17
20
|
import {
|
|
18
21
|
trustWallet
|
|
19
22
|
} from "./chunk-YWKKNHO3.js";
|
|
20
|
-
import {
|
|
21
|
-
uniswapWallet
|
|
22
|
-
} from "./chunk-APZ6YBCA.js";
|
|
23
23
|
import {
|
|
24
24
|
walletConnectWallet
|
|
25
25
|
} from "./chunk-XXTDCRCW.js";
|
|
26
|
+
import {
|
|
27
|
+
uniswapWallet
|
|
28
|
+
} from "./chunk-APZ6YBCA.js";
|
|
26
29
|
import {
|
|
27
30
|
xdefiWallet
|
|
28
31
|
} from "./chunk-5ZLRNFDM.js";
|
|
29
32
|
import {
|
|
30
|
-
|
|
31
|
-
} from "./chunk-
|
|
33
|
+
okxWallet
|
|
34
|
+
} from "./chunk-GHYJ56FA.js";
|
|
32
35
|
import {
|
|
33
36
|
oneKeyWallet
|
|
34
37
|
} from "./chunk-6CW3SAA3.js";
|
|
35
38
|
import {
|
|
36
39
|
phantomWallet
|
|
37
40
|
} from "./chunk-KUZFZL2D.js";
|
|
38
|
-
import {
|
|
39
|
-
rabbyWallet
|
|
40
|
-
} from "./chunk-TNC2B7LX.js";
|
|
41
41
|
import {
|
|
42
42
|
rainbowWallet
|
|
43
43
|
} from "./chunk-IEAKLGB6.js";
|
|
44
44
|
import {
|
|
45
|
-
|
|
46
|
-
} from "./chunk-
|
|
45
|
+
rabbyWallet
|
|
46
|
+
} from "./chunk-TNC2B7LX.js";
|
|
47
47
|
import {
|
|
48
48
|
safeheronWallet
|
|
49
49
|
} from "./chunk-7WTKIVCW.js";
|
|
50
50
|
import {
|
|
51
|
-
|
|
52
|
-
} from "./chunk-
|
|
51
|
+
safeWallet
|
|
52
|
+
} from "./chunk-BNTZHUB6.js";
|
|
53
53
|
import {
|
|
54
|
-
|
|
55
|
-
} from "./chunk-
|
|
54
|
+
safepalWallet
|
|
55
|
+
} from "./chunk-TZR3P22N.js";
|
|
56
56
|
import {
|
|
57
57
|
frontierWallet
|
|
58
58
|
} from "./chunk-4EKX7Z25.js";
|
|
@@ -65,15 +65,15 @@ import {
|
|
|
65
65
|
import {
|
|
66
66
|
ledgerWallet
|
|
67
67
|
} from "./chunk-GLB4HFDR.js";
|
|
68
|
-
import {
|
|
69
|
-
metaMaskWallet
|
|
70
|
-
} from "./chunk-MOWIPEYK.js";
|
|
71
68
|
import {
|
|
72
69
|
mewWallet
|
|
73
70
|
} from "./chunk-BZFEDZQJ.js";
|
|
74
71
|
import {
|
|
75
|
-
|
|
76
|
-
} from "./chunk-
|
|
72
|
+
metaMaskWallet
|
|
73
|
+
} from "./chunk-MOWIPEYK.js";
|
|
74
|
+
import {
|
|
75
|
+
oktoWallet
|
|
76
|
+
} from "./chunk-VW5SMBMG.js";
|
|
77
77
|
import {
|
|
78
78
|
omniWallet
|
|
79
79
|
} from "./chunk-NEDPCNTA.js";
|
|
@@ -84,9 +84,6 @@ import {
|
|
|
84
84
|
coinbaseWallet
|
|
85
85
|
} from "./chunk-WFTAXMQP.js";
|
|
86
86
|
import "./chunk-UZ5XLPAW.js";
|
|
87
|
-
import {
|
|
88
|
-
coreWallet
|
|
89
|
-
} from "./chunk-T3RIVRAX.js";
|
|
90
87
|
import {
|
|
91
88
|
dawnWallet
|
|
92
89
|
} from "./chunk-QJNS6IE4.js";
|
|
@@ -96,23 +93,22 @@ import {
|
|
|
96
93
|
import {
|
|
97
94
|
enkryptWallet
|
|
98
95
|
} from "./chunk-ND76X5A2.js";
|
|
99
|
-
import {
|
|
100
|
-
frameWallet
|
|
101
|
-
} from "./chunk-MBFEMLUU.js";
|
|
102
96
|
import {
|
|
103
97
|
foxWallet
|
|
104
98
|
} from "./chunk-TG2HN6KW.js";
|
|
105
99
|
import {
|
|
106
|
-
|
|
107
|
-
} from "./chunk-
|
|
100
|
+
frameWallet
|
|
101
|
+
} from "./chunk-MBFEMLUU.js";
|
|
108
102
|
import {
|
|
109
|
-
|
|
110
|
-
} from "./chunk-
|
|
103
|
+
coreWallet
|
|
104
|
+
} from "./chunk-T3RIVRAX.js";
|
|
111
105
|
import {
|
|
112
106
|
bitKeepWallet,
|
|
113
107
|
bitgetWallet
|
|
114
108
|
} from "./chunk-6FQF7H7H.js";
|
|
115
|
-
import
|
|
109
|
+
import {
|
|
110
|
+
bifrostWallet
|
|
111
|
+
} from "./chunk-LL6T7V77.js";
|
|
116
112
|
import {
|
|
117
113
|
bitskiWallet
|
|
118
114
|
} from "./chunk-FL3REGA5.js";
|
|
@@ -122,6 +118,10 @@ import {
|
|
|
122
118
|
import {
|
|
123
119
|
clvWallet
|
|
124
120
|
} from "./chunk-EHO4MJZJ.js";
|
|
121
|
+
import {
|
|
122
|
+
argentWallet
|
|
123
|
+
} from "./chunk-LEWQ7DQV.js";
|
|
124
|
+
import "./chunk-ZOLACFTK.js";
|
|
125
125
|
import "./chunk-6T5K52ZY.js";
|
|
126
126
|
export {
|
|
127
127
|
argentWallet,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/connect",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"@meshconnect/web-link-sdk": "^2.0.1",
|
|
89
|
-
"@funkit/core": "^0.10.
|
|
90
|
-
"@funkit/wagmi-tools": "^0.1.
|
|
89
|
+
"@funkit/core": "^0.10.12",
|
|
90
|
+
"@funkit/wagmi-tools": "^0.1.11",
|
|
91
91
|
"@moonpay/moonpay-react": "^1.4.1",
|
|
92
92
|
"@privy-io/js-sdk-core": "^0.11.0",
|
|
93
93
|
"@types/uuid": "^9.0.1",
|