@rango-dev/widget-embedded 0.21.1-next.10 → 0.21.1-next.11
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/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts +0 -1
- package/dist/hooks/useWalletList.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +0 -1
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/ConfirmWalletsModal/WalletList.tsx +18 -24
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +3 -29
- package/src/hooks/useWalletList.ts +4 -20
- package/src/pages/WalletsPage.tsx +18 -24
- package/src/utils/wallets.ts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletsPage.d.ts","sourceRoot":"","sources":["../../src/pages/WalletsPage.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAuBxC,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AACzC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,wBAAgB,WAAW,
|
|
1
|
+
{"version":3,"file":"WalletsPage.d.ts","sourceRoot":"","sources":["../../src/pages/WalletsPage.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAuBxC,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AACzC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,wBAAgB,WAAW,sBAoE1B"}
|
package/dist/utils/wallets.d.ts
CHANGED
|
@@ -29,5 +29,4 @@ export declare function getAddress({ chain, connectedWallets, walletType, }: {
|
|
|
29
29
|
export declare function createTokenHash(token: Asset): TokenHash;
|
|
30
30
|
export declare function makeTokensBalance(connectedWallets: ConnectedWallet[]): TokensBalance;
|
|
31
31
|
export declare const isFetchingBalance: (connectedWallets: ConnectedWallet[], blockchain: string) => boolean;
|
|
32
|
-
export declare function hashWalletsState(walletsInfo: ModalWalletInfo[]): string;
|
|
33
32
|
//# sourceMappingURL=wallets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/utils/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EACV,KAAK,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EAEX,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,YAAY,EACb,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAuB5D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAWvE;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,WAAW,EAC3C,aAAa,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,EAC/C,IAAI,EAAE,UAAU,EAAE,EAClB,KAAK,CAAC,EAAE,MAAM,GACb,eAAe,EAAE,CA6BnB;AAED,wBAAgB,6BAA6B,CAC3C,oBAAoB,EAAE,cAAc,EAAE,GACrC,OAAO,EAAE,GAAG,IAAI,CAUlB;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MA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BrE;AA8CD,wBAAgB,UAAU,CACxB,MAAM,EAAE,KAAK,EAAE,EACf,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,GAAG,IAAI,EAC/C,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,WAczC;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC,GAAG,IAAI,EAC/D,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC,GAAG,IAAI,WAOhE;AAED,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,eAAe,EAAE,GACzB,eAAe,EAAE,CAcnB;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EAEf,QAAQ,SAAI,EAEZ,cAAc,SAAI,GACjB,MAAM,CAOR;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,gBAAgB,EAChB,UAAU,GACX,EAAE;IACD,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,GAAG,SAAS,CAMrB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,CAEvD;AAED,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,eAAe,EAAE,iBAmCpE;AAED,eAAO,MAAM,iBAAiB,qBACV,eAAe,EAAE,cACvB,MAAM,YAIjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -59,24 +59,23 @@ export function WalletList(props: PropTypes) {
|
|
|
59
59
|
useState<'in-progress' | 'completed' | 'rejected' | null>(null);
|
|
60
60
|
const { suggestAndConnect } = useWallets();
|
|
61
61
|
let modalTimerId: ReturnType<typeof setTimeout> | null = null;
|
|
62
|
-
const { list, error, handleClick
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
62
|
+
const { list, error, handleClick } = useWalletList({
|
|
63
|
+
config,
|
|
64
|
+
chain,
|
|
65
|
+
onBeforeConnect: (type) => {
|
|
66
|
+
modalTimerId = setTimeout(() => {
|
|
67
|
+
setOpenWalletStateModal(type);
|
|
68
|
+
}, TIME_TO_IGNORE_MODAL);
|
|
69
|
+
},
|
|
70
|
+
onConnect: () => {
|
|
71
|
+
if (modalTimerId) {
|
|
72
|
+
clearTimeout(modalTimerId);
|
|
73
|
+
}
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
setOpenWalletStateModal('');
|
|
76
|
+
}, TIME_TO_CLOSE_MODAL);
|
|
77
|
+
},
|
|
78
|
+
});
|
|
80
79
|
const [sortedList, setSortedList] = useState<WalletInfo[]>(list);
|
|
81
80
|
const numberOfSupportedWallets = list.length;
|
|
82
81
|
const shouldShowMoreWallets = limit && numberOfSupportedWallets - limit > 0;
|
|
@@ -134,11 +133,6 @@ export function WalletList(props: PropTypes) {
|
|
|
134
133
|
};
|
|
135
134
|
}, [addingExperimentalChainStatus]);
|
|
136
135
|
|
|
137
|
-
const handleCloseWalletModal = () => {
|
|
138
|
-
disconnectConnectingWallets();
|
|
139
|
-
setOpenWalletStateModal('');
|
|
140
|
-
};
|
|
141
|
-
|
|
142
136
|
return (
|
|
143
137
|
<>
|
|
144
138
|
{sortedList.slice(0, limit).map((wallet) => {
|
|
@@ -201,7 +195,7 @@ export function WalletList(props: PropTypes) {
|
|
|
201
195
|
<>
|
|
202
196
|
<WalletModal
|
|
203
197
|
open={openWalletStateModal === wallet.type}
|
|
204
|
-
onClose={
|
|
198
|
+
onClose={() => setOpenWalletStateModal('')}
|
|
205
199
|
image={wallet.image}
|
|
206
200
|
state={wallet.state}
|
|
207
201
|
error={error}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { WalletStateContentProps } from './SwapDetailsModal.types';
|
|
2
2
|
|
|
3
|
-
import { MessageBox, Wallet
|
|
3
|
+
import { MessageBox, Wallet } from '@rango-dev/ui';
|
|
4
4
|
import { useWallets } from '@rango-dev/wallets-react';
|
|
5
|
-
import React
|
|
5
|
+
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { getContainer } from '../../utils/common';
|
|
8
8
|
import { mapStatusToWalletState } from '../../utils/wallets';
|
|
@@ -18,40 +18,14 @@ export const WalletStateContent = (props: WalletStateContentProps) => {
|
|
|
18
18
|
showWalletButton,
|
|
19
19
|
walletButtonDisabled,
|
|
20
20
|
} = props;
|
|
21
|
-
const { connect, getWalletInfo, state
|
|
21
|
+
const { connect, getWalletInfo, state } = useWallets();
|
|
22
22
|
const walletType = currentStepWallet?.walletType;
|
|
23
23
|
const walletState = walletType
|
|
24
24
|
? mapStatusToWalletState(state(walletType))
|
|
25
25
|
: null;
|
|
26
|
-
const componentWillUnmount = useRef(false);
|
|
27
|
-
|
|
28
26
|
const walletInfo = walletType ? getWalletInfo(walletType) : null;
|
|
29
27
|
const shouldShowWallet =
|
|
30
28
|
showWalletButton && !!walletType && !!walletState && !!walletInfo;
|
|
31
|
-
|
|
32
|
-
/*
|
|
33
|
-
* The order of useEffects is crucial.
|
|
34
|
-
* 1- The first useEffect for componentWillUnmount sets its value to true
|
|
35
|
-
*/
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
return () => {
|
|
38
|
-
componentWillUnmount.current = true;
|
|
39
|
-
};
|
|
40
|
-
}, []);
|
|
41
|
-
|
|
42
|
-
// 2- The second useEffect checks if componentWillUnmount is true then it disconnects connecting wallet
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
return () => {
|
|
45
|
-
if (
|
|
46
|
-
componentWillUnmount.current &&
|
|
47
|
-
walletType &&
|
|
48
|
-
walletState === WalletState.CONNECTING
|
|
49
|
-
) {
|
|
50
|
-
void disconnect(walletType);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}, [walletState]);
|
|
54
|
-
|
|
55
29
|
return (
|
|
56
30
|
<>
|
|
57
31
|
<MessageBox type={type} title={title} description={message} />
|
|
@@ -9,13 +9,12 @@ import {
|
|
|
9
9
|
type WalletType,
|
|
10
10
|
WalletTypes,
|
|
11
11
|
} from '@rango-dev/wallets-shared';
|
|
12
|
-
import {
|
|
12
|
+
import { useEffect, useState } from 'react';
|
|
13
13
|
|
|
14
14
|
import { useAppStore } from '../store/AppStore';
|
|
15
15
|
import { useWalletsStore } from '../store/wallets';
|
|
16
16
|
import { configWalletsToWalletName } from '../utils/providers';
|
|
17
17
|
import {
|
|
18
|
-
hashWalletsState,
|
|
19
18
|
isExperimentalChain,
|
|
20
19
|
mapWalletTypesToWalletInfo,
|
|
21
20
|
sortWalletsBasedOnConnectionState,
|
|
@@ -40,7 +39,6 @@ export function useWalletList(params: Params) {
|
|
|
40
39
|
const { state, disconnect, getWalletInfo, connect } = useWallets();
|
|
41
40
|
const { connectedWallets } = useWalletsStore();
|
|
42
41
|
const blockchains = useAppStore().blockchains();
|
|
43
|
-
const componentWillUnmount = useRef(false);
|
|
44
42
|
|
|
45
43
|
/** It can be what has been set by widget config or as a fallback we use all the supported wallets by our library */
|
|
46
44
|
const listAvailableWalletTypes =
|
|
@@ -89,34 +87,21 @@ export function useWalletList(params: Params) {
|
|
|
89
87
|
}
|
|
90
88
|
};
|
|
91
89
|
|
|
92
|
-
const disconnectConnectingWallets =
|
|
90
|
+
const disconnectConnectingWallets = () => {
|
|
93
91
|
const connectingWallets =
|
|
94
92
|
wallets?.filter((wallet) => wallet.state === WalletState.CONNECTING) ||
|
|
95
93
|
[];
|
|
96
94
|
for (const wallet of connectingWallets) {
|
|
97
95
|
void disconnect(wallet.type);
|
|
98
96
|
}
|
|
99
|
-
}
|
|
97
|
+
};
|
|
100
98
|
|
|
101
|
-
/*
|
|
102
|
-
* The order of useEffects is crucial.
|
|
103
|
-
* 1- The first useEffect for componentWillUnmount sets its value to true
|
|
104
|
-
*/
|
|
105
99
|
useEffect(() => {
|
|
106
100
|
return () => {
|
|
107
|
-
|
|
101
|
+
disconnectConnectingWallets();
|
|
108
102
|
};
|
|
109
103
|
}, []);
|
|
110
104
|
|
|
111
|
-
// 2- The second useEffect checks if componentWillUnmount is true then it disconnects connecting wallets
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
return () => {
|
|
114
|
-
if (componentWillUnmount.current) {
|
|
115
|
-
disconnectConnectingWallets();
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
}, [disconnectConnectingWallets]);
|
|
119
|
-
|
|
120
105
|
/*
|
|
121
106
|
* Atm, we only support default injected wallet for the EVM
|
|
122
107
|
* so we show default wallet when there is no other evm wallet installed
|
|
@@ -156,6 +141,5 @@ export function useWalletList(params: Params) {
|
|
|
156
141
|
),
|
|
157
142
|
error,
|
|
158
143
|
handleClick,
|
|
159
|
-
disconnectConnectingWallets,
|
|
160
144
|
};
|
|
161
145
|
}
|
|
@@ -35,29 +35,23 @@ export function WalletsPage() {
|
|
|
35
35
|
let modalTimerId: ReturnType<typeof setTimeout> | null = null;
|
|
36
36
|
const isActiveTab = useUiStore.use.isActiveTab();
|
|
37
37
|
|
|
38
|
-
const { list, handleClick, error
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
const handleCloseWalletModal = () => {
|
|
58
|
-
disconnectConnectingWallets();
|
|
59
|
-
setOpenModal(false);
|
|
60
|
-
};
|
|
38
|
+
const { list, handleClick, error } = useWalletList({
|
|
39
|
+
config,
|
|
40
|
+
onBeforeConnect: (type) => {
|
|
41
|
+
modalTimerId = setTimeout(() => {
|
|
42
|
+
setOpenModal(true);
|
|
43
|
+
setSelectedWalletType(type);
|
|
44
|
+
}, TIME_TO_IGNORE_MODAL);
|
|
45
|
+
},
|
|
46
|
+
onConnect: () => {
|
|
47
|
+
if (modalTimerId) {
|
|
48
|
+
clearTimeout(modalTimerId);
|
|
49
|
+
}
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
setOpenModal(false);
|
|
52
|
+
}, TIME_TO_CLOSE_MODAL);
|
|
53
|
+
},
|
|
54
|
+
});
|
|
61
55
|
|
|
62
56
|
const selectedWallet = list.find(
|
|
63
57
|
(wallet) => wallet.type === selectedWalletType
|
|
@@ -93,7 +87,7 @@ export function WalletsPage() {
|
|
|
93
87
|
})}
|
|
94
88
|
<WalletModal
|
|
95
89
|
open={!!openModal}
|
|
96
|
-
onClose={
|
|
90
|
+
onClose={() => setOpenModal(false)}
|
|
97
91
|
image={selectedWalletImage}
|
|
98
92
|
state={selectedWalletState}
|
|
99
93
|
error={error}
|
package/src/utils/wallets.ts
CHANGED
|
@@ -551,7 +551,3 @@ export const isFetchingBalance = (
|
|
|
551
551
|
!!connectedWallets.find(
|
|
552
552
|
(wallet) => wallet.chain === blockchain && wallet.loading
|
|
553
553
|
);
|
|
554
|
-
|
|
555
|
-
export function hashWalletsState(walletsInfo: ModalWalletInfo[]) {
|
|
556
|
-
return walletsInfo.map((w) => w.state).join('-');
|
|
557
|
-
}
|