@rango-dev/wallets-react 0.27.1-next.0 → 0.27.1-next.10
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/helpers/index.d.ts +2 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +2 -0
- package/dist/helpers/index.js.map +7 -0
- package/dist/hub/autoConnect.d.ts.map +1 -1
- package/dist/hub/helpers.d.ts +1 -1
- package/dist/hub/helpers.d.ts.map +1 -1
- package/dist/hub/lastConnectedWallets.d.ts +2 -1
- package/dist/hub/lastConnectedWallets.d.ts.map +1 -1
- package/dist/hub/mod.d.ts +1 -1
- package/dist/hub/mod.d.ts.map +1 -1
- package/dist/hub/useHubAdapter.d.ts.map +1 -1
- package/dist/hub/utils.d.ts +3 -8
- package/dist/hub/utils.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/legacy/autoConnect.d.ts.map +1 -1
- package/dist/legacy/types.d.ts +0 -1
- package/dist/legacy/types.d.ts.map +1 -1
- package/dist/useProviders.d.ts.map +1 -1
- package/dist/wallets-react.build.json +1 -1
- package/helpers/package.json +8 -0
- package/package.json +12 -7
- package/src/helpers/index.ts +1 -0
- package/src/hub/autoConnect.ts +62 -33
- package/src/hub/helpers.ts +9 -3
- package/src/hub/lastConnectedWallets.ts +22 -1
- package/src/hub/mod.ts +5 -1
- package/src/hub/useHubAdapter.ts +8 -4
- package/src/hub/utils.ts +83 -43
- package/src/index.ts +0 -1
- package/src/legacy/autoConnect.ts +12 -24
- package/src/legacy/types.ts +0 -1
- package/src/useProviders.ts +2 -6
|
@@ -46,33 +46,21 @@ export async function autoConnect(
|
|
|
46
46
|
eagerConnectQueue.map(async ({ eagerConnect }) => eagerConnect())
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/*
|
|
54
|
-
*After successfully connecting to at least one wallet,
|
|
55
|
-
*we will removing the other wallets from persistence.
|
|
56
|
-
*If we are unable to connect to any wallet,
|
|
57
|
-
*the persistence will not be removed and the eager connection will be retried with another page load.
|
|
58
|
-
*/
|
|
59
|
-
if (canRestoreAnyConnection) {
|
|
60
|
-
const walletsToRemoveFromPersistance: WalletType[] = [];
|
|
61
|
-
result.forEach((settleResult, index) => {
|
|
62
|
-
const { status } = settleResult;
|
|
63
|
-
|
|
64
|
-
if (status === 'rejected') {
|
|
65
|
-
walletsToRemoveFromPersistance.push(
|
|
66
|
-
eagerConnectQueue[index].walletType
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
49
|
+
const walletsToRemoveFromPersistance: WalletType[] = [];
|
|
50
|
+
result.forEach((settleResult, index) => {
|
|
51
|
+
const { status } = settleResult;
|
|
70
52
|
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
|
|
53
|
+
if (status === 'rejected') {
|
|
54
|
+
walletsToRemoveFromPersistance.push(
|
|
55
|
+
eagerConnectQueue[index].walletType
|
|
74
56
|
);
|
|
75
57
|
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (walletsToRemoveFromPersistance.length) {
|
|
61
|
+
lastConnectedWalletsFromStorage.removeWallets(
|
|
62
|
+
walletsToRemoveFromPersistance
|
|
63
|
+
);
|
|
76
64
|
}
|
|
77
65
|
}
|
|
78
66
|
}
|
package/src/legacy/types.ts
CHANGED
package/src/useProviders.ts
CHANGED
|
@@ -22,12 +22,8 @@ import { useLegacyProviders } from './legacy/mod.js';
|
|
|
22
22
|
*/
|
|
23
23
|
function useProviders(props: ProviderProps) {
|
|
24
24
|
const { providers, ...restProps } = props;
|
|
25
|
-
const [legacyProviders, hubProviders] =
|
|
26
|
-
providers
|
|
27
|
-
{
|
|
28
|
-
isExperimentalEnabled: restProps.configs?.isExperimentalEnabled,
|
|
29
|
-
}
|
|
30
|
-
);
|
|
25
|
+
const [legacyProviders, hubProviders] =
|
|
26
|
+
separateLegacyAndHubProviders(providers);
|
|
31
27
|
|
|
32
28
|
const legacyApi = useLegacyProviders({
|
|
33
29
|
...restProps,
|