@rango-dev/widget-embedded 0.29.1-next.12 → 0.29.1-next.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.29.1-next.12",
3
+ "version": "0.29.1-next.13",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -53,4 +53,4 @@
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  }
56
- }
56
+ }
@@ -28,6 +28,7 @@ interface Params {
28
28
  chain?: string;
29
29
  onBeforeConnect?: (walletType: string) => void;
30
30
  onConnect?: (walletType: string) => void;
31
+ onError?: (error?: string) => void;
31
32
  }
32
33
 
33
34
  /**
@@ -36,7 +37,7 @@ interface Params {
36
37
  * you can use this list whenever you need to show the list of wallets and needed callbacks
37
38
  */
38
39
  export function useWalletList(params: Params) {
39
- const { chain, onBeforeConnect, onConnect } = params;
40
+ const { chain, onBeforeConnect, onConnect, onError } = params;
40
41
  const { config } = useAppStore();
41
42
  const { state, disconnect, getWalletInfo, connect } = useWallets();
42
43
  const { connectedWallets } = useWalletsStore();
@@ -90,8 +91,10 @@ export function useWalletList(params: Params) {
90
91
  await connect(type, undefined, namespaces);
91
92
  onConnect?.(type);
92
93
  }
93
- } catch (e) {
94
- setError('Error: ' + (e as any)?.message);
94
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
95
+ } catch (e: any) {
96
+ onError?.(e?.message);
97
+ setError('Error: ' + e?.message);
95
98
  }
96
99
  };
97
100
 
package/src/index.ts CHANGED
@@ -5,6 +5,7 @@ import type {
5
5
  QuoteEventData,
6
6
  Tokens,
7
7
  WalletEventData,
8
+ WalletInfoWithNamespaces,
8
9
  WidgetColors,
9
10
  WidgetColorsKeys,
10
11
  WidgetConfig,
@@ -64,6 +65,7 @@ import { WidgetWallets } from './containers/Wallets';
64
65
  import { Widget } from './containers/Widget';
65
66
  import { useWidget } from './containers/WidgetInfo';
66
67
  import { WidgetProvider } from './containers/WidgetProvider';
68
+ import { useWalletList } from './hooks/useWalletList';
67
69
  import { useWidgetEvents } from './hooks/useWidgetEvents';
68
70
  import { widgetEventEmitter } from './services/eventEmitter';
69
71
  import {
@@ -106,6 +108,7 @@ export type {
106
108
  WidgetVariant,
107
109
  WalletEventData,
108
110
  QuoteEventData,
111
+ WalletInfoWithNamespaces,
109
112
  };
110
113
  export {
111
114
  Widget,
@@ -120,6 +123,7 @@ export {
120
123
  * @deprecated Use `widgetEventEmitter` instead. This hook will be removed in future versions.
121
124
  */
122
125
  useWidgetEvents,
126
+ useWalletList,
123
127
  customizedThemeTokens,
124
128
  widgetEventEmitter,
125
129
  WidgetEvents,