@rango-dev/wallets-react 0.30.2-next.1 → 0.30.2-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.
@@ -19,6 +19,9 @@ import {
19
19
  import { useInitializers } from './hooks.js';
20
20
  import { useAutoConnect } from './useAutoConnect.js';
21
21
 
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
+ type ProviderType = any;
24
+
22
25
  export type LegacyProviderProps = Omit<ProviderProps, 'providers'> & {
23
26
  providers: LegacyProviderInterface[];
24
27
  };
@@ -86,7 +89,7 @@ export function useLegacyProviders(
86
89
  }
87
90
  },
88
91
  async disconnectAll() {
89
- const disconnect_promises: Promise<any>[] = [];
92
+ const disconnect_promises: Promise<void>[] = [];
90
93
 
91
94
  /*
92
95
  * When a wallet is initializing, a record will be added to `providersState`
@@ -134,7 +137,7 @@ export function useLegacyProviders(
134
137
  : false;
135
138
  },
136
139
  providers() {
137
- const providers: { [type in WalletType]?: any } = {};
140
+ const providers: { [type in WalletType]?: ProviderType } = {};
138
141
  availableWallets(providersState).forEach((type) => {
139
142
  const wallet = wallets.get(type);
140
143
  if (wallet) {
@@ -42,18 +42,18 @@ function useProviders(props: ProviderProps) {
42
42
  }
43
43
  return legacyApi.canSwitchNetworkTo(type, network);
44
44
  },
45
- async connect(type, network): Promise<ConnectResult[]> {
45
+ async connect(type, namespaces): Promise<ConnectResult[]> {
46
46
  const hubProvider = findProviderByType(hubProviders, type);
47
47
  if (hubProvider) {
48
- return await hubApi.connect(type, network);
48
+ return await hubApi.connect(type, namespaces);
49
49
  }
50
50
 
51
- return await legacyApi.connect(type, network);
51
+ return await legacyApi.connect(type, namespaces);
52
52
  },
53
- async disconnect(type): Promise<void> {
53
+ async disconnect(type, namespaces): Promise<void> {
54
54
  const hubProvider = findProviderByType(hubProviders, type);
55
55
  if (hubProvider) {
56
- return await hubApi.disconnect(type);
56
+ return await hubApi.disconnect(type, namespaces);
57
57
  }
58
58
 
59
59
  return await legacyApi.disconnect(type);