@xyo-network/react-connected-accounts 7.0.0 → 7.0.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"EnabledWallets.d.ts","sourceRoot":"","sources":["../../../src/classes/EnabledWallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAI/E;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,CAAC,IAAI,EAAE,MAAM,GAAG;QACd,OAAO,EAAE,OAAO,CAAA;QAChB,MAAM,EAAE,gBAAgB,CAAA;KACzB,CAAA;CACF;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CACxB;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,IAAI,CAAA;AAEvC,qBAAa,2BAA2B;IAEtC,kBAAkB,UAAO;IAGzB,OAAO,CAAC,cAAc,CAA+B;IAGrD,OAAO,CAAC,eAAe,CAA6B;IAGpD,OAAO,CAAC,SAAS,CAAuB;IAGxC,OAAO,CAAC,eAAe,CAA4B;gBAEvC,eAAe,SAA4B;IAKvD,IAAI,OAAO,2BAEV;IAED,aAAa,CAAC,IAAI,EAAE,MAAM;IAI1B,YAAY,CAAC,IAAI,EAAE,MAAM;IAIzB;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,iBAAiB;IAiBvC,SAAS,CAAC,QAAQ,EAAE,cAAc;IAOlC,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAQlD,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,cAAc;CAWvB"}
1
+ {"version":3,"file":"EnabledWallets.d.ts","sourceRoot":"","sources":["../../../src/classes/EnabledWallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAI/E;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,CAAC,IAAI,EAAE,MAAM,GAAG;QACd,OAAO,EAAE,OAAO,CAAA;QAChB,MAAM,EAAE,gBAAgB,CAAA;KACzB,CAAA;CACF;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CACxB;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,IAAI,CAAA;AAEvC,qBAAa,2BAA2B;IAEtC,kBAAkB,UAAO;IAGzB,OAAO,CAAC,cAAc,CAA+B;IAGrD,OAAO,CAAC,eAAe,CAA6B;IAGpD,OAAO,CAAC,SAAS,CAAuB;IAGxC,OAAO,CAAC,eAAe,CAA4B;gBAEvC,eAAe,SAA4B;IAKvD,IAAI,OAAO,2BAEV;IAED,aAAa,CAAC,IAAI,EAAE,MAAM;IAI1B,YAAY,CAAC,IAAI,EAAE,MAAM;IAIzB;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,iBAAiB;IAqBvC,SAAS,CAAC,QAAQ,EAAE,cAAc;IAOlC,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAQlD,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,cAAc;CAWvB"}
@@ -1,7 +1,7 @@
1
1
  import type { Meta } from '@storybook/react-vite';
2
2
  declare const StorybookEntry: Meta;
3
- declare const Default: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./ConnectedAccountsFlexbox.tsx").ConnectedAccountsFlexboxProps>;
4
- declare const WithIgnoreDialog: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./ConnectedAccountsFlexbox.tsx").ConnectedAccountsFlexboxProps>;
3
+ declare const Default: import(".store/storybook-virtual-997ab3c959/package/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./ConnectedAccountsFlexbox.tsx").ConnectedAccountsFlexboxProps>;
4
+ declare const WithIgnoreDialog: import(".store/storybook-virtual-997ab3c959/package/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./ConnectedAccountsFlexbox.tsx").ConnectedAccountsFlexboxProps>;
5
5
  export { Default, WithIgnoreDialog };
6
6
  export default StorybookEntry;
7
7
  //# sourceMappingURL=ConnectedAccountsFlexbox.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectedAccountsFlexbox.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ConnectedAccountsFlexbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;AAK1D,QAAA,MAAM,cAAc,EAAE,IAQrB,CAAA;AAaD,QAAA,MAAM,OAAO,0KAAoB,CAAA;AACjC,QAAA,MAAM,gBAAgB,0KAAoC,CAAA;AAE1D,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAEpC,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"ConnectedAccountsFlexbox.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ConnectedAccountsFlexbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;AAK1D,QAAA,MAAM,cAAc,EAAE,IAQrB,CAAA;AAaD,QAAA,MAAM,OAAO,4MAAoB,CAAA;AACjC,QAAA,MAAM,gBAAgB,4MAAoC,CAAA;AAE1D,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAEpC,eAAe,cAAc,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDetectWallets.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDetectWallets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAgB/E,eAAO,MAAM,kBAAkB;;;CAU9B,CAAA"}
1
+ {"version":3,"file":"useDetectWallets.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDetectWallets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAkB/E,eAAO,MAAM,kBAAkB;;;CAU9B,CAAA"}
@@ -1,12 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/classes/EnabledWallets.ts
5
2
  var DEFAULT_LOCAL_STORAGE_KEY = "XYO|EnabledWallets";
6
3
  var EnabledEthWalletConnections = class {
7
- static {
8
- __name(this, "EnabledEthWalletConnections");
9
- }
10
4
  // control whether or not enabled/disabled preferences are persisted (i.e. in localStorage)
11
5
  persistPreferences = true;
12
6
  // Map of wallet names and their enabled/disabled state
@@ -31,26 +25,27 @@ var EnabledEthWalletConnections = class {
31
25
  this.toggleEnabledWallet(rdns, true);
32
26
  }
33
27
  /**
34
- * Given a new set of wallets, set their enabled state based off previous preferences
35
- */
28
+ * Given a new set of wallets, set their enabled state based off previous preferences
29
+ */
36
30
  resetWallets(wallets) {
37
31
  const newWallets = {};
38
- const addWallet = /* @__PURE__ */ __name(([walletName, wallet]) => {
32
+ const addWallet = ([walletName, wallet]) => {
39
33
  newWallets[walletName] = {
40
34
  // preserve the existing enabled state
41
35
  enabled: walletName in this.enabledWallets ? this.enabledWallets[walletName] : true,
42
36
  wallet
43
37
  };
44
- }, "addWallet");
45
- Object.entries(wallets).forEach(addWallet.bind(this));
38
+ };
39
+ Object.entries(wallets).forEach((wallet) => {
40
+ if (wallet !== void 0) {
41
+ addWallet.bind(this);
42
+ }
43
+ });
46
44
  this.ethWalletsState = newWallets;
47
45
  this.emitChange();
48
46
  }
49
47
  subscribe(listener) {
50
- this.listeners = [
51
- ...this.listeners,
52
- listener
53
- ];
48
+ this.listeners = [...this.listeners, listener];
54
49
  return () => {
55
50
  this.listeners = this.listeners.filter((existingListener) => existingListener !== listener);
56
51
  };
@@ -58,9 +53,7 @@ var EnabledEthWalletConnections = class {
58
53
  toggleEnabledWallet(rdns, enabled) {
59
54
  if (rdns && this.ethWalletsState[rdns]) {
60
55
  this.ethWalletsState[rdns].enabled = enabled;
61
- this.ethWalletsState = {
62
- ...this.ethWalletsState
63
- };
56
+ this.ethWalletsState = { ...this.ethWalletsState };
64
57
  this.emitChange();
65
58
  }
66
59
  }
@@ -100,219 +93,236 @@ var EnabledEthWalletConnections = class {
100
93
  // src/components/ConnectedAccountsFlexbox.tsx
101
94
  import { Typography as Typography6, useTheme as useTheme2 } from "@mui/material";
102
95
  import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
103
- import React13 from "react";
104
96
 
105
97
  // src/hooks/useDetectWallets.tsx
106
98
  import { useWalletDiscovery } from "@xylabs/react-crypto";
107
99
  import { useMemo } from "react";
108
- var sortWallets = /* @__PURE__ */ __name((wallets) => {
100
+ var sortWallets = (wallets) => {
109
101
  const result = [];
110
102
  for (const wallet of Object.values(wallets)) {
111
- if (wallet.allowedAccounts.length > 0) result.unshift(wallet);
112
- else result.push(wallet);
103
+ if (wallet) {
104
+ if (wallet.allowedAccounts.length > 0)
105
+ result.unshift(wallet);
106
+ else
107
+ result.push(wallet);
108
+ }
113
109
  }
114
110
  return result;
115
- }, "sortWallets");
116
- var useDetectedWallets = /* @__PURE__ */ __name(() => {
111
+ };
112
+ var useDetectedWallets = () => {
117
113
  const wallets = useWalletDiscovery();
118
- const sortedWallets = useMemo(() => sortWallets(wallets), [
119
- wallets
120
- ]);
121
- const totalConnectedAccounts = useMemo(() => Object.values(sortedWallets).reduce((acc, wallet) => acc + wallet.allowedAccounts.length, 0), [
122
- sortedWallets
123
- ]);
124
- return {
125
- sortedWallets,
126
- totalConnectedAccounts
127
- };
128
- }, "useDetectedWallets");
114
+ const sortedWallets = useMemo(() => sortWallets(wallets), [wallets]);
115
+ const totalConnectedAccounts = useMemo(
116
+ () => Object.values(sortedWallets).reduce((acc, wallet) => acc + wallet.allowedAccounts.length, 0),
117
+ [sortedWallets]
118
+ );
119
+ return { sortedWallets, totalConnectedAccounts };
120
+ };
129
121
 
130
122
  // src/hooks/useEnabledWallets.tsx
131
123
  import { useWalletDiscovery as useWalletDiscovery2 } from "@xylabs/react-crypto";
132
124
  import { useMemo as useMemo2, useSyncExternalStore } from "react";
133
125
  var enabledEthWallets;
134
- var useEnabledWalletsInner = /* @__PURE__ */ __name((enabledWalletsRdns) => {
126
+ var useEnabledWalletsInner = (enabledWalletsRdns) => {
135
127
  const discoveredWallets = useWalletDiscovery2();
136
128
  const wallets = useMemo2(() => {
137
129
  if (enabledEthWallets === void 0) enabledEthWallets = new EnabledEthWalletConnections();
138
130
  enabledEthWallets.resetWallets(discoveredWallets);
139
131
  for (const [rdns, enabled] of Object.entries(enabledWalletsRdns ?? {})) enabledEthWallets?.toggleEnabledWallet(rdns, enabled);
140
132
  return enabledEthWallets;
141
- }, [
142
- discoveredWallets,
143
- enabledWalletsRdns
144
- ]);
133
+ }, [discoveredWallets, enabledWalletsRdns]);
145
134
  return useSyncExternalStore(wallets.subscribe.bind(wallets), () => wallets.wallets);
146
- }, "useEnabledWalletsInner");
147
- var useEnabledWallets = /* @__PURE__ */ __name((enabledWalletsRdns) => {
135
+ };
136
+ var useEnabledWallets = (enabledWalletsRdns) => {
148
137
  const wallets = useEnabledWalletsInner(enabledWalletsRdns);
149
- const enabledWallets = useMemo2(() => (
150
- // eslint-disable-next-line unicorn/no-array-reduce
151
- Object.entries(wallets).reduce((acc, [walletName, wallet]) => {
152
- if (wallet.enabled) acc[walletName] = wallet;
153
- return acc;
154
- }, {})
155
- ), [
156
- wallets
157
- ]);
138
+ const enabledWallets = useMemo2(
139
+ () => (
140
+ // eslint-disable-next-line unicorn/no-array-reduce
141
+ Object.entries(wallets).reduce((acc, [walletName, wallet]) => {
142
+ if (wallet.enabled) acc[walletName] = wallet;
143
+ return acc;
144
+ }, {})
145
+ ),
146
+ [wallets]
147
+ );
158
148
  return {
159
149
  disableWallet: enabledEthWallets?.disableWallet.bind(enabledEthWallets),
160
150
  enableWallet: enabledEthWallets?.enableWallet.bind(enabledEthWallets),
161
151
  enabledWallets,
162
152
  wallets
163
153
  };
164
- }, "useEnabledWallets");
154
+ };
165
155
 
166
156
  // src/components/wallet/dialogs/connect/CheckboxFormControl.tsx
167
- import { Checkbox, FormControl, FormLabel } from "@mui/material";
168
- import React from "react";
169
- var CheckboxFormControl = /* @__PURE__ */ __name(({ onCheckChanged, ...props }) => {
170
- return /* @__PURE__ */ React.createElement(FormControl, props, /* @__PURE__ */ React.createElement(FormLabel, null, /* @__PURE__ */ React.createElement(Checkbox, {
171
- onChange: /* @__PURE__ */ __name((_, checked) => onCheckChanged?.(checked), "onChange")
172
- }), "Do not show this again."));
173
- }, "CheckboxFormControl");
157
+ import {
158
+ Checkbox,
159
+ FormControl,
160
+ FormLabel
161
+ } from "@mui/material";
162
+ import { jsx, jsxs } from "react/jsx-runtime";
163
+ var CheckboxFormControl = ({ onCheckChanged, ...props }) => {
164
+ return /* @__PURE__ */ jsx(FormControl, { ...props, children: /* @__PURE__ */ jsxs(FormLabel, { children: [
165
+ /* @__PURE__ */ jsx(Checkbox, { onChange: (_, checked) => onCheckChanged?.(checked) }),
166
+ "Do not show this again."
167
+ ] }) });
168
+ };
174
169
 
175
170
  // src/components/wallet/dialogs/connect/Dialog.tsx
176
- import { Button, Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
177
- import React4 from "react";
171
+ import {
172
+ Button,
173
+ Dialog,
174
+ DialogActions,
175
+ DialogContent,
176
+ DialogTitle
177
+ } from "@mui/material";
178
178
 
179
179
  // src/components/wallet/dialogs/connect/LinkedProvidersFlexbox.tsx
180
180
  import { SyncAlt } from "@mui/icons-material";
181
181
  import { Typography } from "@mui/material";
182
182
  import { ConstrainedImage } from "@xylabs/react-crypto";
183
183
  import { FlexCol, FlexRow } from "@xylabs/react-flexbox";
184
- import React2 from "react";
185
184
 
186
185
  // src/img/xyo-color-logo.svg
187
186
  var xyo_color_logo_default = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 238"><defs><style>.cls-1{fill:#8d8fc6;}.cls-2{fill:#579fd6;}.cls-3{fill:#f27046;}.cls-4{fill:#eb407a;}</style></defs><path class="cls-1" d="M74.5,28.33,21.29,120.5,74.5,212.67H180.94l1.76-3,51.46-89.13L180.94,28.33ZM84.65,40.54h78.83L111.65,56.93a15.85,15.85,0,0,1,2,5l59.66-18.81L185.22,101a20.12,20.12,0,0,1,5.36-.78l-10-47.91,37.87,65.53h-7.62a24.21,24.21,0,0,1,.15,2.68,23.29,23.29,0,0,1-.15,2.68h7.62l-39.1,67.75,10.92-50.13A20.57,20.57,0,0,1,185,140l-12.88,59-58.37-19.53a17.61,17.61,0,0,1-1.7,5l47.5,15.92H84.65l4-6.85A20.17,20.17,0,0,1,83.93,191L80,197.78,42.67,133.13l37,32.66a20.52,20.52,0,0,1,3.6-4L36.69,120.66,85,77.79a17.45,17.45,0,0,1-3.19-4.32l-39.46,35L80,43.22l5.56,9.69A17.51,17.51,0,0,1,90.12,50Zm28.24,31.17a16.15,16.15,0,0,1-2.68,4.64l62,35.81a19.74,19.74,0,0,1,2.83-4.54Zm-20,10.51v75.33a18,18,0,0,1,2.47-.16,17.18,17.18,0,0,1,2.89.21v-75a11.21,11.21,0,0,1-1.29,0,17.57,17.57,0,0,1-4.07-.47Zm79.34,46.63-62.08,35.81a18.45,18.45,0,0,1,2.68,4.68l62.23-36a19.68,19.68,0,0,1-2.83-4.53Z"/><path class="cls-2" d="M97,48.58a17.06,17.06,0,1,0,17,17,17.08,17.08,0,0,0-17-17Zm0,5.36a11.7,11.7,0,1,1-11.7,11.69A11.65,11.65,0,0,1,97,53.94Z"/><path class="cls-3" d="M95.37,157.39a18.73,18.73,0,1,0,18.7,18.7,18.74,18.74,0,0,0-18.7-18.7Zm0,5.31A13.4,13.4,0,1,1,82,176.09a13.37,13.37,0,0,1,13.4-13.39Z"/><path class="cls-4" d="M190.73,100.2A20.3,20.3,0,1,0,211,120.5a20.34,20.34,0,0,0-20.3-20.3Zm0,5.36a14.94,14.94,0,1,1-14.94,14.94,14.88,14.88,0,0,1,14.94-14.94Z"/></svg>';
188
187
 
189
188
  // src/components/wallet/dialogs/connect/LinkedProvidersFlexbox.tsx
190
- var LinkedProvidersFlexbox = /* @__PURE__ */ __name(({ icon, providerName, ...props }) => {
191
- return /* @__PURE__ */ React2.createElement(FlexRow, {
192
- gap: 4,
193
- justifyContent: "space-evenly",
194
- ...props
195
- }, /* @__PURE__ */ React2.createElement(FlexCol, {
196
- gap: 0.5
197
- }, /* @__PURE__ */ React2.createElement("img", {
198
- alt: "XYO Logo",
199
- src: xyo_color_logo_default,
200
- style: {
201
- height: "48px"
202
- }
203
- }), /* @__PURE__ */ React2.createElement(Typography, {
204
- variant: "subtitle1"
205
- }, "XYO App")), /* @__PURE__ */ React2.createElement(SyncAlt, {
206
- fontSize: "large"
207
- }), /* @__PURE__ */ React2.createElement(FlexCol, {
208
- gap: 0.5
209
- }, /* @__PURE__ */ React2.createElement(ConstrainedImage, {
210
- constrainedValue: "48px",
211
- src: icon,
212
- alt: providerName,
213
- style: {
214
- height: "48px",
215
- maxWidth: "48px"
216
- }
217
- }), /* @__PURE__ */ React2.createElement(Typography, {
218
- variant: "subtitle1"
219
- }, providerName)));
220
- }, "LinkedProvidersFlexbox");
189
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
190
+ var LinkedProvidersFlexbox = ({
191
+ icon,
192
+ providerName,
193
+ ...props
194
+ }) => {
195
+ return /* @__PURE__ */ jsxs2(FlexRow, { gap: 4, justifyContent: "space-evenly", ...props, children: [
196
+ /* @__PURE__ */ jsxs2(FlexCol, { gap: 0.5, children: [
197
+ /* @__PURE__ */ jsx2("img", { alt: "XYO Logo", src: xyo_color_logo_default, style: { height: "48px" } }),
198
+ /* @__PURE__ */ jsx2(Typography, { variant: "subtitle1", children: "XYO App" })
199
+ ] }),
200
+ /* @__PURE__ */ jsx2(SyncAlt, { fontSize: "large" }),
201
+ /* @__PURE__ */ jsxs2(FlexCol, { gap: 0.5, children: [
202
+ /* @__PURE__ */ jsx2(
203
+ ConstrainedImage,
204
+ {
205
+ constrainedValue: "48px",
206
+ src: icon,
207
+ alt: providerName,
208
+ style: { height: "48px", maxWidth: "48px" }
209
+ }
210
+ ),
211
+ /* @__PURE__ */ jsx2(Typography, { variant: "subtitle1", children: providerName })
212
+ ] })
213
+ ] });
214
+ };
221
215
 
222
216
  // src/components/wallet/dialogs/connect/Permissions.tsx
223
217
  import { Link, Typography as Typography2 } from "@mui/material";
224
218
  import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
225
- import React3 from "react";
226
- var WalletPermissionsFlexbox = /* @__PURE__ */ __name((props) => {
227
- return /* @__PURE__ */ React3.createElement(FlexCol2, {
228
- gap: 4,
229
- ...props
230
- }, /* @__PURE__ */ React3.createElement(Typography2, {
231
- fontWeight: "bold",
232
- sx: {
233
- textAlign: "center"
234
- }
235
- }, "This will allow XYO to:"), /* @__PURE__ */ React3.createElement("ul", null, /* @__PURE__ */ React3.createElement("li", null, "View your wallet account(s) and address(es)"), /* @__PURE__ */ React3.createElement("li", null, "Read-only access to browse the public blockchain(s) you select")), /* @__PURE__ */ React3.createElement(Typography2, {
236
- variant: "subtitle1",
237
- sx: {
238
- textAlign: "center"
239
- }
240
- }, "You control what accounts to share and what blockchains to view. You can see or revoke access via your wallet's settings at anytime. View more on XYO's sovereign data philosophy", " ", /* @__PURE__ */ React3.createElement(Link, {
241
- href: "https://cointelegraph.com/innovation-circle/decentralization-and-sovereignty-debunking-our-approach-to-digital-sovereignty",
242
- sx: {
243
- fontWeight: "bold"
244
- },
245
- target: "_blank"
246
- }, "here"), "."));
247
- }, "WalletPermissionsFlexbox");
219
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
220
+ var WalletPermissionsFlexbox = (props) => {
221
+ return /* @__PURE__ */ jsxs3(FlexCol2, { gap: 4, ...props, children: [
222
+ /* @__PURE__ */ jsx3(Typography2, { fontWeight: "bold", sx: { textAlign: "center" }, children: "This will allow XYO to:" }),
223
+ /* @__PURE__ */ jsxs3("ul", { children: [
224
+ /* @__PURE__ */ jsx3("li", { children: "View your wallet account(s) and address(es)" }),
225
+ /* @__PURE__ */ jsx3("li", { children: "Read-only access to browse the public blockchain(s) you select" })
226
+ ] }),
227
+ /* @__PURE__ */ jsxs3(Typography2, { variant: "subtitle1", sx: { textAlign: "center" }, children: [
228
+ "You control what accounts to share and what blockchains to view. You can see or revoke access via your wallet's settings at anytime. View more on XYO's sovereign data philosophy",
229
+ " ",
230
+ /* @__PURE__ */ jsx3(
231
+ Link,
232
+ {
233
+ href: "https://cointelegraph.com/innovation-circle/decentralization-and-sovereignty-debunking-our-approach-to-digital-sovereignty",
234
+ sx: { fontWeight: "bold" },
235
+ target: "_blank",
236
+ children: "here"
237
+ }
238
+ ),
239
+ "."
240
+ ] })
241
+ ] });
242
+ };
248
243
 
249
244
  // src/components/wallet/dialogs/connect/Dialog.tsx
250
- var ConnectWalletDialog = /* @__PURE__ */ __name(({ activeProvider, onIgnoreConnectDialog, ...props }) => {
245
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
246
+ var ConnectWalletDialog = ({
247
+ activeProvider,
248
+ onIgnoreConnectDialog,
249
+ ...props
250
+ }) => {
251
251
  const { icon, providerName } = activeProvider ?? {};
252
- const onConnect = /* @__PURE__ */ __name(async () => {
252
+ const onConnect = async () => {
253
253
  try {
254
254
  await activeProvider?.connectWallet?.();
255
255
  props.onClose?.({}, "escapeKeyDown");
256
256
  } catch (e) {
257
257
  console.warn(`Error connecting to wallet: ${e.message}`);
258
258
  }
259
- }, "onConnect");
260
- return /* @__PURE__ */ React4.createElement(Dialog, {
261
- slotProps: {
262
- paper: {
263
- sx: {
264
- display: "flex",
265
- gap: 4
266
- }
267
- }
268
- },
269
- ...props
270
- }, /* @__PURE__ */ React4.createElement(DialogTitle, {
271
- sx: {
272
- textAlign: "center"
273
- }
274
- }, "XYO Wants To Access The Blockchain on Your Behalf"), /* @__PURE__ */ React4.createElement(DialogContent, {
275
- sx: {
276
- display: "flex",
277
- flexDirection: "column",
278
- gap: 4
259
+ };
260
+ return /* @__PURE__ */ jsxs4(
261
+ Dialog,
262
+ {
263
+ slotProps: { paper: { sx: { display: "flex", gap: 4 } } },
264
+ ...props,
265
+ children: [
266
+ /* @__PURE__ */ jsx4(DialogTitle, { sx: { textAlign: "center" }, children: "XYO Wants To Access The Blockchain on Your Behalf" }),
267
+ /* @__PURE__ */ jsxs4(
268
+ DialogContent,
269
+ {
270
+ sx: {
271
+ display: "flex",
272
+ flexDirection: "column",
273
+ gap: 4
274
+ },
275
+ children: [
276
+ /* @__PURE__ */ jsx4(LinkedProvidersFlexbox, { icon, providerName }),
277
+ /* @__PURE__ */ jsx4(WalletPermissionsFlexbox, {}),
278
+ /* @__PURE__ */ jsx4(CheckboxFormControl, { onCheckChanged: onIgnoreConnectDialog })
279
+ ]
280
+ }
281
+ ),
282
+ /* @__PURE__ */ jsxs4(DialogActions, { children: [
283
+ /* @__PURE__ */ jsx4(Button, { variant: "outlined", onClick: () => props.onClose?.({}, "escapeKeyDown"), children: "Close" }),
284
+ /* @__PURE__ */ jsx4(Button, { variant: "contained", onClick: onConnect, children: "Connect" })
285
+ ] })
286
+ ]
279
287
  }
280
- }, /* @__PURE__ */ React4.createElement(LinkedProvidersFlexbox, {
281
- icon,
282
- providerName
283
- }), /* @__PURE__ */ React4.createElement(WalletPermissionsFlexbox, null), /* @__PURE__ */ React4.createElement(CheckboxFormControl, {
284
- onCheckChanged: onIgnoreConnectDialog
285
- })), /* @__PURE__ */ React4.createElement(DialogActions, null, /* @__PURE__ */ React4.createElement(Button, {
286
- variant: "outlined",
287
- onClick: /* @__PURE__ */ __name(() => props.onClose?.({}, "escapeKeyDown"), "onClick")
288
- }, "Close"), /* @__PURE__ */ React4.createElement(Button, {
289
- variant: "contained",
290
- onClick: onConnect
291
- }, "Connect")));
292
- }, "ConnectWalletDialog");
288
+ );
289
+ };
293
290
 
294
291
  // src/components/wallet/dialogs/revoke/Dialog.tsx
295
- import { Button as Button2, Dialog as Dialog2, DialogActions as DialogActions2, DialogContent as DialogContent2, DialogTitle as DialogTitle2, Typography as Typography3 } from "@mui/material";
292
+ import {
293
+ Button as Button2,
294
+ Dialog as Dialog2,
295
+ DialogActions as DialogActions2,
296
+ DialogContent as DialogContent2,
297
+ DialogTitle as DialogTitle2,
298
+ Typography as Typography3
299
+ } from "@mui/material";
296
300
  import { ConstrainedImage as ConstrainedImage2 } from "@xylabs/react-crypto";
297
301
  import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
298
- import React5 from "react";
299
- var RevokeWalletConnectionDialog = /* @__PURE__ */ __name(({ activeProvider, ...props }) => {
300
- return /* @__PURE__ */ React5.createElement(Dialog2, props, /* @__PURE__ */ React5.createElement(FlexRow2, {
301
- gap: 2,
302
- justifyContent: "start",
303
- pl: 2
304
- }, /* @__PURE__ */ React5.createElement(ConstrainedImage2, {
305
- src: activeProvider?.icon,
306
- constrainedValue: "24px"
307
- }), /* @__PURE__ */ React5.createElement(DialogTitle2, {
308
- sx: {
309
- pl: 0
310
- }
311
- }, "Revoke", activeProvider?.providerName, " ", "Access")), /* @__PURE__ */ React5.createElement(DialogContent2, null, /* @__PURE__ */ React5.createElement(Typography3, null, "Revoking access to your wallet must be done from the wallet's browser extension. Wallets grant access to specific domains please consult", " ", activeProvider?.providerName, "'s documentation on how to revoke access to this website:"), /* @__PURE__ */ React5.createElement(Typography3, null, globalThis.location.origin)), /* @__PURE__ */ React5.createElement(DialogActions2, null, /* @__PURE__ */ React5.createElement(Button2, {
312
- variant: "contained",
313
- onClick: /* @__PURE__ */ __name(() => props.onClose?.({}, "escapeKeyDown"), "onClick")
314
- }, "Close")));
315
- }, "RevokeWalletConnectionDialog");
302
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
303
+ var RevokeWalletConnectionDialog = ({ activeProvider, ...props }) => {
304
+ return /* @__PURE__ */ jsxs5(Dialog2, { ...props, children: [
305
+ /* @__PURE__ */ jsxs5(FlexRow2, { gap: 2, justifyContent: "start", pl: 2, children: [
306
+ /* @__PURE__ */ jsx5(ConstrainedImage2, { src: activeProvider?.icon, constrainedValue: "24px" }),
307
+ /* @__PURE__ */ jsxs5(DialogTitle2, { sx: { pl: 0 }, children: [
308
+ "Revoke",
309
+ activeProvider?.providerName,
310
+ " ",
311
+ "Access"
312
+ ] })
313
+ ] }),
314
+ /* @__PURE__ */ jsxs5(DialogContent2, { children: [
315
+ /* @__PURE__ */ jsxs5(Typography3, { children: [
316
+ "Revoking access to your wallet must be done from the wallet's browser extension. Wallets grant access to specific domains please consult",
317
+ " ",
318
+ activeProvider?.providerName,
319
+ "'s documentation on how to revoke access to this website:"
320
+ ] }),
321
+ /* @__PURE__ */ jsx5(Typography3, { children: globalThis.location.origin })
322
+ ] }),
323
+ /* @__PURE__ */ jsx5(DialogActions2, { children: /* @__PURE__ */ jsx5(Button2, { variant: "contained", onClick: () => props.onClose?.({}, "escapeKeyDown"), children: "Close" }) })
324
+ ] });
325
+ };
316
326
 
317
327
  // src/components/wallet/lib/TableHeadData.ts
318
328
  var WalletsTableHeadCells = [
@@ -354,88 +364,100 @@ var WalletsTableHeadCells = [
354
364
  ];
355
365
 
356
366
  // src/components/wallet/table/cells/Accounts.tsx
357
- import { TableCell, Tooltip, Typography as Typography4 } from "@mui/material";
358
- import React6 from "react";
359
- var ConnectedWalletsAccountsTableCell = /* @__PURE__ */ __name(({ additionalAccounts, currentAccount, totalAccounts, tableCellProps }) => {
360
- return /* @__PURE__ */ React6.createElement(TableCell, tableCellProps, /* @__PURE__ */ React6.createElement(Tooltip, {
361
- sx: {
362
- cursor: totalAccounts > 0 ? "pointer" : "auto"
363
- },
364
- title: [
365
- ...currentAccount ?? [],
366
- ...additionalAccounts ?? []
367
- ].map((address, index) => /* @__PURE__ */ React6.createElement("p", {
368
- key: index
369
- }, address))
370
- }, /* @__PURE__ */ React6.createElement(Typography4, null, totalAccounts)));
371
- }, "ConnectedWalletsAccountsTableCell");
367
+ import {
368
+ TableCell,
369
+ Tooltip,
370
+ Typography as Typography4
371
+ } from "@mui/material";
372
+ import { jsx as jsx6 } from "react/jsx-runtime";
373
+ var ConnectedWalletsAccountsTableCell = ({
374
+ additionalAccounts,
375
+ currentAccount,
376
+ totalAccounts,
377
+ tableCellProps
378
+ }) => {
379
+ return /* @__PURE__ */ jsx6(TableCell, { ...tableCellProps, children: /* @__PURE__ */ jsx6(
380
+ Tooltip,
381
+ {
382
+ sx: { cursor: totalAccounts > 0 ? "pointer" : "auto" },
383
+ title: [...currentAccount ?? [], ...additionalAccounts ?? []].map((address, index) => /* @__PURE__ */ jsx6("p", { children: address }, index)),
384
+ children: /* @__PURE__ */ jsx6(Typography4, { children: totalAccounts })
385
+ }
386
+ ) });
387
+ };
372
388
 
373
389
  // src/components/wallet/table/cells/Actions.tsx
374
390
  import { Check, InfoOutlined } from "@mui/icons-material";
375
- import { Button as Button3, IconButton, TableCell as TableCell2, Typography as Typography5 } from "@mui/material";
391
+ import {
392
+ Button as Button3,
393
+ IconButton,
394
+ TableCell as TableCell2,
395
+ Typography as Typography5
396
+ } from "@mui/material";
376
397
  import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
377
- import React7 from "react";
378
- var ConnectedWalletsActionsTableCell = /* @__PURE__ */ __name(({ connected, onConnect, onRevoke, tableCellProps }) => {
379
- return /* @__PURE__ */ React7.createElement(TableCell2, tableCellProps, /* @__PURE__ */ React7.createElement(FlexRow3, {
380
- gap: 2,
381
- justifyContent: "start"
382
- }, connected ? /* @__PURE__ */ React7.createElement(Typography5, {
383
- sx: {
384
- display: "inline-flex",
385
- gap: 0.5
386
- }
387
- }, /* @__PURE__ */ React7.createElement(Check, null), "Connected") : /* @__PURE__ */ React7.createElement(Button3, {
388
- variant: "contained",
389
- onClick: onConnect
390
- }, "Connect"), connected ? /* @__PURE__ */ React7.createElement(IconButton, {
391
- onClick: onRevoke
392
- }, /* @__PURE__ */ React7.createElement(InfoOutlined, null)) : null));
393
- }, "ConnectedWalletsActionsTableCell");
398
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
399
+ var ConnectedWalletsActionsTableCell = ({
400
+ connected,
401
+ onConnect,
402
+ onRevoke,
403
+ tableCellProps
404
+ }) => {
405
+ return /* @__PURE__ */ jsx7(TableCell2, { ...tableCellProps, children: /* @__PURE__ */ jsxs6(FlexRow3, { gap: 2, justifyContent: "start", children: [
406
+ connected ? /* @__PURE__ */ jsxs6(Typography5, { sx: { display: "inline-flex", gap: 0.5 }, children: [
407
+ /* @__PURE__ */ jsx7(Check, {}),
408
+ "Connected"
409
+ ] }) : /* @__PURE__ */ jsx7(Button3, { variant: "contained", onClick: onConnect, children: "Connect" }),
410
+ connected ? /* @__PURE__ */ jsx7(IconButton, { onClick: onRevoke, children: /* @__PURE__ */ jsx7(InfoOutlined, {}) }) : null
411
+ ] }) });
412
+ };
394
413
 
395
414
  // src/components/wallet/table/cells/ChainName.tsx
396
415
  import { TableCell as TableCell3 } from "@mui/material";
397
- import React8 from "react";
398
- var ConnectedWalletsChainNameTableCell = /* @__PURE__ */ __name(({ chainName, tableCellProps }) => {
399
- return /* @__PURE__ */ React8.createElement(TableCell3, tableCellProps, chainName);
400
- }, "ConnectedWalletsChainNameTableCell");
416
+ import { jsx as jsx8 } from "react/jsx-runtime";
417
+ var ConnectedWalletsChainNameTableCell = ({ chainName, tableCellProps }) => {
418
+ return /* @__PURE__ */ jsx8(TableCell3, { ...tableCellProps, children: chainName });
419
+ };
401
420
 
402
421
  // src/components/wallet/table/cells/State.tsx
403
422
  import { Switch, TableCell as TableCell4 } from "@mui/material";
404
- import React9, { useMemo as useMemo3 } from "react";
405
- var ConnectedWalletState = /* @__PURE__ */ __name(({ connected, walletRdns, tableCellProps }) => {
406
- const { disableWallet, enableWallet, wallets } = useEnabledWallets();
407
- const enabled = useMemo3(() => walletRdns ? wallets[walletRdns].enabled : false, [
408
- wallets,
409
- walletRdns
410
- ]);
411
- const handleClick = /* @__PURE__ */ __name((event) => {
423
+ import { useMemo as useMemo3 } from "react";
424
+ import { jsx as jsx9 } from "react/jsx-runtime";
425
+ var ConnectedWalletState = ({
426
+ connected,
427
+ walletRdns,
428
+ tableCellProps
429
+ }) => {
430
+ const {
431
+ disableWallet,
432
+ enableWallet,
433
+ wallets
434
+ } = useEnabledWallets();
435
+ const enabled = useMemo3(() => walletRdns ? wallets[walletRdns].enabled : false, [wallets, walletRdns]);
436
+ const handleClick = (event) => {
412
437
  const checked = event.target?.checked;
413
438
  if (walletRdns) {
414
439
  checked ? enableWallet?.(walletRdns) : disableWallet?.(walletRdns);
415
440
  }
416
- }, "handleClick");
417
- return /* @__PURE__ */ React9.createElement(TableCell4, tableCellProps, /* @__PURE__ */ React9.createElement(Switch, {
418
- disabled: !connected,
419
- checked: connected && enabled,
420
- onChange: handleClick
421
- }));
422
- }, "ConnectedWalletState");
441
+ };
442
+ return /* @__PURE__ */ jsx9(TableCell4, { ...tableCellProps, children: /* @__PURE__ */ jsx9(Switch, { disabled: !connected, checked: connected && enabled, onChange: handleClick }) });
443
+ };
423
444
 
424
445
  // src/components/wallet/table/cells/Wallet.tsx
425
446
  import { TableCell as TableCell5, useTheme } from "@mui/material";
426
447
  import { ConstrainedImage as ConstrainedImage3 } from "@xylabs/react-crypto";
427
448
  import { FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
428
- import React10 from "react";
429
- var ConnectedWalletsWalletTableCell = /* @__PURE__ */ __name(({ icon, walletName, tableCellProps }) => {
449
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
450
+ var ConnectedWalletsWalletTableCell = ({
451
+ icon,
452
+ walletName,
453
+ tableCellProps
454
+ }) => {
430
455
  const theme = useTheme();
431
- return /* @__PURE__ */ React10.createElement(TableCell5, tableCellProps, /* @__PURE__ */ React10.createElement(FlexRow4, {
432
- gap: 2,
433
- justifyContent: "start"
434
- }, /* @__PURE__ */ React10.createElement(ConstrainedImage3, {
435
- constrainedValue: theme.spacing(4),
436
- src: icon
437
- }), walletName));
438
- }, "ConnectedWalletsWalletTableCell");
456
+ return /* @__PURE__ */ jsx10(TableCell5, { ...tableCellProps, children: /* @__PURE__ */ jsxs7(FlexRow4, { gap: 2, justifyContent: "start", children: [
457
+ /* @__PURE__ */ jsx10(ConstrainedImage3, { constrainedValue: theme.spacing(4), src: icon }),
458
+ walletName
459
+ ] }) });
460
+ };
439
461
 
440
462
  // src/components/wallet/table/cells/Cells.tsx
441
463
  var ConnectedWalletTableCells = [
@@ -447,145 +469,163 @@ var ConnectedWalletTableCells = [
447
469
  ];
448
470
 
449
471
  // src/components/wallet/table/ConnectedWalletsTable.tsx
450
- import { Table, TableBody, TableCell as TableCell6, TableHead, TableRow as TableRow2 } from "@mui/material";
451
- import React12, { useState as useState2 } from "react";
472
+ import {
473
+ Table,
474
+ TableBody,
475
+ TableCell as TableCell6,
476
+ TableHead,
477
+ TableRow as TableRow2
478
+ } from "@mui/material";
479
+ import { useState as useState2 } from "react";
452
480
 
453
481
  // src/components/wallet/table/ConnectedWalletsTableRow.tsx
454
482
  import { TableRow } from "@mui/material";
455
483
  import { useEthWallet } from "@xylabs/react-crypto";
456
- import React11, { useCallback, useMemo as useMemo4 } from "react";
457
- var WalletConnectionsTableRow = /* @__PURE__ */ __name(({ ignoreConnectDialog, onConnectClick, onRevoke, wallet, ...props }) => {
458
- const { currentAccount: currentAccountFromWallet, additionalAccounts, chainName, connectWallet, providerInfo } = useEthWallet(wallet);
459
- const currentAccount = currentAccountFromWallet?.toString() ? [
460
- currentAccountFromWallet.toString()
461
- ] : [];
484
+ import { useCallback, useMemo as useMemo4 } from "react";
485
+ import { jsx as jsx11 } from "react/jsx-runtime";
486
+ var WalletConnectionsTableRow = ({
487
+ ignoreConnectDialog,
488
+ onConnectClick,
489
+ onRevoke,
490
+ wallet,
491
+ ...props
492
+ }) => {
493
+ const {
494
+ currentAccount: currentAccountFromWallet,
495
+ additionalAccounts,
496
+ chainName,
497
+ connectWallet,
498
+ providerInfo
499
+ } = useEthWallet(wallet);
500
+ const currentAccount = currentAccountFromWallet?.toString() ? [currentAccountFromWallet.toString()] : [];
462
501
  const totalAccounts = (additionalAccounts?.length ?? 0) + (currentAccount?.length ?? 0);
463
502
  const connected = !!currentAccount?.length;
464
- const { icon, name, rdns } = useMemo4(() => providerInfo ?? {
503
+ const {
504
+ icon,
505
+ name,
506
+ rdns
507
+ } = useMemo4(() => providerInfo ?? {
465
508
  icon: void 0,
466
509
  name: void 0,
467
510
  rdns: void 0
468
- }, [
469
- providerInfo
470
- ]);
471
- const activeProvider = useMemo4(() => ({
472
- connectWallet,
473
- icon,
474
- providerName: name
475
- }), [
476
- connectWallet,
477
- icon,
478
- name
479
- ]);
511
+ }, [providerInfo]);
512
+ const activeProvider = useMemo4(
513
+ () => ({
514
+ connectWallet,
515
+ icon,
516
+ providerName: name
517
+ }),
518
+ [connectWallet, icon, name]
519
+ );
480
520
  const onRevokeLocal = useCallback(() => {
481
521
  onRevoke?.(activeProvider);
482
- }, [
483
- activeProvider,
484
- onRevoke
485
- ]);
522
+ }, [activeProvider, onRevoke]);
486
523
  const onConnectLocal = useCallback(async () => {
487
524
  if (ignoreConnectDialog) {
488
525
  await connectWallet?.();
489
526
  } else {
490
527
  onConnectClick?.(activeProvider);
491
528
  }
492
- }, [
493
- activeProvider,
494
- connectWallet,
495
- ignoreConnectDialog,
496
- onConnectClick
497
- ]);
498
- return /* @__PURE__ */ React11.createElement(TableRow, props, Object.values(ConnectedWalletTableCells).map((Cell, index) => /* @__PURE__ */ React11.createElement(Cell, {
499
- key: index,
500
- additionalAccounts,
501
- chainName,
502
- connected,
503
- currentAccount,
504
- icon,
505
- onConnect: onConnectLocal,
506
- onRevoke: onRevokeLocal,
507
- totalAccounts,
508
- walletName: name,
509
- walletRdns: rdns
510
- })));
511
- }, "WalletConnectionsTableRow");
529
+ }, [activeProvider, connectWallet, ignoreConnectDialog, onConnectClick]);
530
+ return /* @__PURE__ */ jsx11(TableRow, { ...props, children: Object.values(ConnectedWalletTableCells).map((Cell, index) => /* @__PURE__ */ jsx11(
531
+ Cell,
532
+ {
533
+ additionalAccounts,
534
+ chainName,
535
+ connected,
536
+ currentAccount,
537
+ icon,
538
+ onConnect: onConnectLocal,
539
+ onRevoke: onRevokeLocal,
540
+ totalAccounts,
541
+ walletName: name,
542
+ walletRdns: rdns
543
+ },
544
+ index
545
+ )) });
546
+ };
512
547
 
513
548
  // src/components/wallet/table/hooks/useActiveProviderDialogState.tsx
514
549
  import { useState } from "react";
515
- var useActiveProviderDialogState = /* @__PURE__ */ __name((setActiveProvider) => {
550
+ var useActiveProviderDialogState = (setActiveProvider) => {
516
551
  const [show, setShow] = useState(false);
517
- const onSetActiveProvider = /* @__PURE__ */ __name((activeProvider) => {
552
+ const onSetActiveProvider = (activeProvider) => {
518
553
  setShow(true);
519
554
  setActiveProvider(activeProvider);
520
- }, "onSetActiveProvider");
521
- const onClose = /* @__PURE__ */ __name(() => {
555
+ };
556
+ const onClose = () => {
522
557
  setShow(false);
523
558
  setActiveProvider({});
524
- }, "onClose");
525
- return [
526
- show,
527
- onSetActiveProvider,
528
- onClose
529
- ];
530
- }, "useActiveProviderDialogState");
559
+ };
560
+ return [show, onSetActiveProvider, onClose];
561
+ };
531
562
 
532
563
  // src/components/wallet/table/ConnectedWalletsTable.tsx
533
- var ConnectedWalletsTable = /* @__PURE__ */ __name(({ ignoreConnectDialog, onIgnoreConnectDialog, wallets, ...props }) => {
564
+ import { Fragment, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
565
+ var ConnectedWalletsTable = ({
566
+ ignoreConnectDialog,
567
+ onIgnoreConnectDialog,
568
+ wallets,
569
+ ...props
570
+ }) => {
534
571
  const [activeProvider, setActiveProvider] = useState2();
535
572
  const [showConnect, onSetActiveProviderConnect, onConnectClose] = useActiveProviderDialogState(setActiveProvider);
536
573
  const [showRevoke, onSetActiveProviderRevoke, onRevokeClose] = useActiveProviderDialogState(setActiveProvider);
537
- return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(Table, props, /* @__PURE__ */ React12.createElement(TableHead, null, /* @__PURE__ */ React12.createElement(TableRow2, null, WalletsTableHeadCells.map(({ disablePadding, id, label, align, width }) => /* @__PURE__ */ React12.createElement(TableCell6, {
538
- align,
539
- key: id,
540
- padding: disablePadding ? "none" : "normal",
541
- width: width ?? "auto"
542
- }, label)))), /* @__PURE__ */ React12.createElement(TableBody, null, (wallets ?? []).map((wallet) => /* @__PURE__ */ React12.createElement(WalletConnectionsTableRow, {
543
- ignoreConnectDialog,
544
- key: wallet.providerInfo?.rdns,
545
- onConnectClick: onSetActiveProviderConnect,
546
- onRevoke: onSetActiveProviderRevoke,
547
- wallet
548
- })))), /* @__PURE__ */ React12.createElement(RevokeWalletConnectionDialog, {
549
- open: showRevoke,
550
- onClose: onRevokeClose,
551
- activeProvider
552
- }), /* @__PURE__ */ React12.createElement(ConnectWalletDialog, {
553
- activeProvider,
554
- onClose: onConnectClose,
555
- open: showConnect,
556
- onIgnoreConnectDialog
557
- }));
558
- }, "ConnectedWalletsTable");
574
+ return /* @__PURE__ */ jsxs8(Fragment, { children: [
575
+ /* @__PURE__ */ jsxs8(Table, { ...props, children: [
576
+ /* @__PURE__ */ jsx12(TableHead, { children: /* @__PURE__ */ jsx12(TableRow2, { children: WalletsTableHeadCells.map(({
577
+ disablePadding,
578
+ id,
579
+ label,
580
+ align,
581
+ width
582
+ }) => /* @__PURE__ */ jsx12(TableCell6, { align, padding: disablePadding ? "none" : "normal", width: width ?? "auto", children: label }, id)) }) }),
583
+ /* @__PURE__ */ jsx12(TableBody, { children: (wallets ?? []).map((wallet) => /* @__PURE__ */ jsx12(
584
+ WalletConnectionsTableRow,
585
+ {
586
+ ignoreConnectDialog,
587
+ onConnectClick: onSetActiveProviderConnect,
588
+ onRevoke: onSetActiveProviderRevoke,
589
+ wallet
590
+ },
591
+ wallet.providerInfo?.rdns
592
+ )) })
593
+ ] }),
594
+ /* @__PURE__ */ jsx12(RevokeWalletConnectionDialog, { open: showRevoke, onClose: onRevokeClose, activeProvider }),
595
+ /* @__PURE__ */ jsx12(
596
+ ConnectWalletDialog,
597
+ {
598
+ activeProvider,
599
+ onClose: onConnectClose,
600
+ open: showConnect,
601
+ onIgnoreConnectDialog
602
+ }
603
+ )
604
+ ] });
605
+ };
559
606
 
560
607
  // src/components/ConnectedAccountsFlexbox.tsx
561
- var ConnectedAccountsFlexbox = /* @__PURE__ */ __name(({ ref, ignoreConnectDialog, onIgnoreConnectDialog, ...props }) => {
608
+ import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
609
+ var ConnectedAccountsFlexbox = ({
610
+ ref,
611
+ ignoreConnectDialog,
612
+ onIgnoreConnectDialog,
613
+ ...props
614
+ }) => {
562
615
  const theme = useTheme2();
563
616
  const { totalConnectedAccounts, sortedWallets } = useDetectedWallets();
564
- return /* @__PURE__ */ React13.createElement(FlexCol3, {
565
- alignItems: "stretch",
566
- justifyContent: "start",
567
- gap: 2,
568
- ref,
569
- ...props
570
- }, /* @__PURE__ */ React13.createElement(FlexCol3, {
571
- alignItems: "start"
572
- }, /* @__PURE__ */ React13.createElement(Typography6, {
573
- variant: "h2",
574
- sx: {
575
- mb: 0.5
576
- }
577
- }, "Detected Web3 Wallets"), totalConnectedAccounts ? /* @__PURE__ */ React13.createElement(Typography6, {
578
- variant: "subtitle1",
579
- color: theme.vars.palette.secondary.main,
580
- sx: {
581
- opacity: 0.5
582
- }
583
- }, "Total Connected Accounts:", " ", totalConnectedAccounts) : null), /* @__PURE__ */ React13.createElement(ConnectedWalletsTable, {
584
- wallets: sortedWallets,
585
- ignoreConnectDialog,
586
- onIgnoreConnectDialog
587
- }));
588
- }, "ConnectedAccountsFlexbox");
617
+ return /* @__PURE__ */ jsxs9(FlexCol3, { alignItems: "stretch", justifyContent: "start", gap: 2, ref, ...props, children: [
618
+ /* @__PURE__ */ jsxs9(FlexCol3, { alignItems: "start", children: [
619
+ /* @__PURE__ */ jsx13(Typography6, { variant: "h2", sx: { mb: 0.5 }, children: "Detected Web3 Wallets" }),
620
+ totalConnectedAccounts ? /* @__PURE__ */ jsxs9(Typography6, { variant: "subtitle1", color: theme.vars.palette.secondary.main, sx: { opacity: 0.5 }, children: [
621
+ "Total Connected Accounts:",
622
+ " ",
623
+ totalConnectedAccounts
624
+ ] }) : null
625
+ ] }),
626
+ /* @__PURE__ */ jsx13(ConnectedWalletsTable, { wallets: sortedWallets, ignoreConnectDialog, onIgnoreConnectDialog })
627
+ ] });
628
+ };
589
629
  ConnectedAccountsFlexbox.displayName = "ConnectedAccountsFlexbox";
590
630
  export {
591
631
  CheckboxFormControl,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/classes/EnabledWallets.ts","../../src/components/ConnectedAccountsFlexbox.tsx","../../src/hooks/useDetectWallets.tsx","../../src/hooks/useEnabledWallets.tsx","../../src/components/wallet/dialogs/connect/CheckboxFormControl.tsx","../../src/components/wallet/dialogs/connect/Dialog.tsx","../../src/components/wallet/dialogs/connect/LinkedProvidersFlexbox.tsx","../../src/img/xyo-color-logo.svg","../../src/components/wallet/dialogs/connect/Permissions.tsx","../../src/components/wallet/dialogs/revoke/Dialog.tsx","../../src/components/wallet/lib/TableHeadData.ts","../../src/components/wallet/table/cells/Accounts.tsx","../../src/components/wallet/table/cells/Actions.tsx","../../src/components/wallet/table/cells/ChainName.tsx","../../src/components/wallet/table/cells/State.tsx","../../src/components/wallet/table/cells/Wallet.tsx","../../src/components/wallet/table/cells/Cells.tsx","../../src/components/wallet/table/ConnectedWalletsTable.tsx","../../src/components/wallet/table/ConnectedWalletsTableRow.tsx","../../src/components/wallet/table/hooks/useActiveProviderDialogState.tsx"],"sourcesContent":["import type { DiscoveredWallets, EIP6963Connector } from '@xylabs/react-crypto'\n\nconst DEFAULT_LOCAL_STORAGE_KEY = 'XYO|EnabledWallets'\n\n/**\n * State for storing wallets and their enabled/disabled status by name\n */\nexport interface EnabledEthWalletsState {\n [rdns: string]: {\n enabled: boolean\n wallet: EIP6963Connector\n }\n}\n\n/**\n * State for storing only enabled/disabled status of a wallet by name\n */\nexport interface EnabledWalletsSavedState {\n [rdns: string]: boolean\n}\n\nexport type WalletListener = () => void\n\nexport class EnabledEthWalletConnections {\n // control whether or not enabled/disabled preferences are persisted (i.e. in localStorage)\n persistPreferences = true\n\n // Map of wallet names and their enabled/disabled state\n private enabledWallets: EnabledWalletsSavedState = {}\n\n // Map of wallet names, their enabled/disabled state, and their wallet class\n private ethWalletsState: EnabledEthWalletsState = {}\n\n // list of listeners that want to be notified on wallet changes\n private listeners: WalletListener[] = []\n\n // key to use in localStorage when persisting preferences\n private localStorageKey = DEFAULT_LOCAL_STORAGE_KEY\n\n constructor(localStorageKey = DEFAULT_LOCAL_STORAGE_KEY) {\n this.localStorageKey = localStorageKey\n this.reviveSettings()\n }\n\n get wallets() {\n return this.ethWalletsState\n }\n\n disableWallet(rdns: string) {\n this.toggleEnabledWallet(rdns, false)\n }\n\n enableWallet(rdns: string) {\n this.toggleEnabledWallet(rdns, true)\n }\n\n /**\n * Given a new set of wallets, set their enabled state based off previous preferences\n */\n resetWallets(wallets: DiscoveredWallets) {\n const newWallets: EnabledEthWalletsState = {}\n\n const addWallet = ([walletName, wallet]: [string, EIP6963Connector]) => {\n newWallets[walletName] = {\n // preserve the existing enabled state\n enabled: walletName in this.enabledWallets ? this.enabledWallets[walletName] : true,\n wallet,\n }\n }\n\n // eslint-disable-next-line unicorn/no-array-for-each\n Object.entries(wallets).forEach(addWallet.bind(this))\n this.ethWalletsState = newWallets\n this.emitChange()\n }\n\n subscribe(listener: WalletListener) {\n this.listeners = [...this.listeners, listener]\n return () => {\n this.listeners = this.listeners.filter(existingListener => existingListener !== listener)\n }\n }\n\n toggleEnabledWallet(rdns: string, enabled: boolean) {\n if (rdns && this.ethWalletsState[rdns]) {\n this.ethWalletsState[rdns].enabled = enabled\n this.ethWalletsState = { ...this.ethWalletsState }\n this.emitChange()\n }\n }\n\n private emitChange() {\n for (const listener of this.listeners) {\n listener()\n }\n\n this.persistSettings()\n }\n\n private isPersistance(method: () => void) {\n if (this.persistPreferences) {\n method()\n }\n }\n\n private persistSettings() {\n this.isPersistance(() => {\n // convert wallet enabled selections into serializable state\n // eslint-disable-next-line unicorn/no-array-reduce\n const enabledWallets = Object.entries(this.ethWalletsState).reduce((acc, [rdns, { enabled }]) => {\n acc[rdns] = enabled\n return acc\n }, {} as EnabledWalletsSavedState)\n\n localStorage.setItem(this.localStorageKey, JSON.stringify(enabledWallets))\n })\n }\n\n private reviveSettings() {\n this.isPersistance(() => {\n const existingEntries = localStorage.getItem(this.localStorageKey)\n try {\n const entries = existingEntries ? JSON.parse(existingEntries) : {}\n this.enabledWallets = entries\n } catch (e) {\n console.warn(`Error parsing saved enabled wallet entries: ${(e as Error).message}`)\n }\n })\n }\n}\n","import { Typography, useTheme } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { useDetectedWallets } from '../hooks/index.ts'\nimport { ConnectedWalletsTable } from './wallet/index.ts'\n\nexport interface ConnectedAccountsFlexboxProps extends FlexBoxProps {\n ignoreConnectDialog?: boolean\n // A callback that is invoked when the option to ignore the dialog is checked\n onIgnoreConnectDialog?: (checked: boolean) => void\n}\n\nexport const ConnectedAccountsFlexbox = ({\n ref, ignoreConnectDialog, onIgnoreConnectDialog, ...props\n}: ConnectedAccountsFlexboxProps) => {\n const theme = useTheme()\n\n const { totalConnectedAccounts, sortedWallets } = useDetectedWallets()\n\n return (\n <FlexCol alignItems=\"stretch\" justifyContent=\"start\" gap={2} ref={ref} {...props}>\n <FlexCol alignItems=\"start\">\n <Typography variant=\"h2\" sx={{ mb: 0.5 }}>\n Detected Web3 Wallets\n </Typography>\n {totalConnectedAccounts\n ? (\n <Typography variant=\"subtitle1\" color={theme.vars.palette.secondary.main} sx={{ opacity: 0.5 }}>\n Total Connected Accounts:\n {' '}\n {totalConnectedAccounts}\n </Typography>\n )\n : null}\n </FlexCol>\n <ConnectedWalletsTable wallets={sortedWallets} ignoreConnectDialog={ignoreConnectDialog} onIgnoreConnectDialog={onIgnoreConnectDialog} />\n </FlexCol>\n )\n}\n\nConnectedAccountsFlexbox.displayName = 'ConnectedAccountsFlexbox'\n","import type { DiscoveredWallets, EIP6963Connector } from '@xylabs/react-crypto'\nimport { useWalletDiscovery } from '@xylabs/react-crypto'\nimport { useMemo } from 'react'\n\nconst sortWallets = (wallets: DiscoveredWallets) => {\n const result: EIP6963Connector[] = []\n\n for (const wallet of Object.values(wallets)) {\n if (wallet.allowedAccounts.length > 0)\n result.unshift(wallet)\n else\n result.push(wallet)\n }\n return result\n}\n\nexport const useDetectedWallets = () => {\n const wallets = useWalletDiscovery()\n const sortedWallets = useMemo(() => sortWallets(wallets), [wallets])\n\n const totalConnectedAccounts = useMemo(\n () => Object.values(sortedWallets).reduce((acc, wallet) => acc + wallet.allowedAccounts.length, 0),\n [sortedWallets],\n )\n\n return { sortedWallets, totalConnectedAccounts }\n}\n","import { useWalletDiscovery } from '@xylabs/react-crypto'\nimport { useMemo, useSyncExternalStore } from 'react'\n\nimport type { EnabledEthWalletsState, EnabledWalletsSavedState } from '../classes/index.ts'\nimport { EnabledEthWalletConnections } from '../classes/index.ts'\n\nlet enabledEthWallets: EnabledEthWalletConnections | undefined\n\n/**\n * Takes the discovered wallets and tracks their enabled state globally\n */\nexport const useEnabledWalletsInner = (enabledWalletsRdns?: EnabledWalletsSavedState) => {\n const discoveredWallets = useWalletDiscovery()\n\n // when we discover new wallets, build their enabled state\n const wallets = useMemo(() => {\n if (enabledEthWallets === undefined) enabledEthWallets = new EnabledEthWalletConnections()\n enabledEthWallets.resetWallets(discoveredWallets)\n for (const [rdns, enabled] of Object.entries(enabledWalletsRdns ?? {})) enabledEthWallets?.toggleEnabledWallet(rdns, enabled)\n return enabledEthWallets\n }, [discoveredWallets, enabledWalletsRdns])\n\n return useSyncExternalStore(wallets.subscribe.bind(wallets), () => wallets.wallets)\n}\n\n/**\n * Expose an interface for enabling and disabling wallets\n */\nexport const useEnabledWallets = (enabledWalletsRdns?: EnabledWalletsSavedState) => {\n const wallets = useEnabledWalletsInner(enabledWalletsRdns)\n const enabledWallets = useMemo(\n () =>\n // eslint-disable-next-line unicorn/no-array-reduce\n Object.entries(wallets).reduce((acc, [walletName, wallet]) => {\n if (wallet.enabled) acc[walletName] = wallet\n return acc\n }, {} as EnabledEthWalletsState),\n [wallets],\n )\n\n return {\n disableWallet: enabledEthWallets?.disableWallet.bind(enabledEthWallets),\n enableWallet: enabledEthWallets?.enableWallet.bind(enabledEthWallets),\n enabledWallets,\n wallets,\n }\n}\n","import type { FormControlProps } from '@mui/material'\nimport {\n Checkbox, FormControl, FormLabel,\n} from '@mui/material'\nimport React from 'react'\n\nexport interface CheckboxFormControlProps extends FormControlProps {\n onCheckChanged?: (checked: boolean) => void\n}\n\nexport const CheckboxFormControl: React.FC<CheckboxFormControlProps> = ({ onCheckChanged, ...props }) => {\n return (\n <FormControl {...props}>\n <FormLabel>\n <Checkbox onChange={(_, checked) => onCheckChanged?.(checked)} />\n Do not show this again.\n </FormLabel>\n </FormControl>\n )\n}\n","import type { DialogProps } from '@mui/material'\nimport {\n Button, Dialog, DialogActions, DialogContent, DialogTitle,\n} from '@mui/material'\nimport React from 'react'\n\nimport type { ActiveProvider } from '../../lib/index.ts'\nimport { CheckboxFormControl } from './CheckboxFormControl.tsx'\nimport { LinkedProvidersFlexbox } from './LinkedProvidersFlexbox.tsx'\nimport { WalletPermissionsFlexbox } from './Permissions.tsx'\n\nexport interface ConnectWalletDialogProps extends DialogProps {\n activeProvider?: ActiveProvider\n onIgnoreConnectDialog?: (checked: boolean) => void\n}\n\nexport const ConnectWalletDialog: React.FC<ConnectWalletDialogProps> = ({\n activeProvider, onIgnoreConnectDialog, ...props\n}) => {\n const { icon, providerName } = activeProvider ?? {}\n\n const onConnect = async () => {\n try {\n await activeProvider?.connectWallet?.()\n props.onClose?.({}, 'escapeKeyDown')\n } catch (e) {\n console.warn(`Error connecting to wallet: ${(e as Error).message}`)\n }\n }\n\n return (\n <Dialog\n slotProps={{ paper: { sx: { display: 'flex', gap: 4 } } }}\n {...props}\n >\n <DialogTitle sx={{ textAlign: 'center' }}>XYO Wants To Access The Blockchain on Your Behalf</DialogTitle>\n <DialogContent sx={{\n display: 'flex', flexDirection: 'column', gap: 4,\n }}\n >\n <LinkedProvidersFlexbox icon={icon} providerName={providerName} />\n <WalletPermissionsFlexbox />\n <CheckboxFormControl onCheckChanged={onIgnoreConnectDialog} />\n </DialogContent>\n <DialogActions>\n <Button variant=\"outlined\" onClick={() => props.onClose?.({}, 'escapeKeyDown')}>\n Close\n </Button>\n <Button variant=\"contained\" onClick={onConnect}>\n Connect\n </Button>\n </DialogActions>\n </Dialog>\n )\n}\n","import { SyncAlt } from '@mui/icons-material'\nimport { Typography } from '@mui/material'\nimport { ConstrainedImage } from '@xylabs/react-crypto'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { xyoColorLogo } from '../../../../img/index.ts'\n\nexport interface LinkedProvidersFlexboxProps extends FlexBoxProps {\n icon?: string\n providerName?: string\n}\n\nexport const LinkedProvidersFlexbox: React.FC<LinkedProvidersFlexboxProps> = ({\n icon, providerName, ...props\n}) => {\n return (\n <FlexRow gap={4} justifyContent=\"space-evenly\" {...props}>\n <FlexCol gap={0.5}>\n <img alt=\"XYO Logo\" src={xyoColorLogo} style={{ height: '48px' }} />\n <Typography variant=\"subtitle1\">XYO App</Typography>\n </FlexCol>\n <SyncAlt fontSize=\"large\" />\n <FlexCol gap={0.5}>\n <ConstrainedImage\n constrainedValue=\"48px\"\n src={icon}\n alt={providerName}\n style={{ height: '48px', maxWidth: '48px' }}\n />\n <Typography variant=\"subtitle1\">{providerName}</Typography>\n </FlexCol>\n </FlexRow>\n )\n}\n","<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 238\"><defs><style>.cls-1{fill:#8d8fc6;}.cls-2{fill:#579fd6;}.cls-3{fill:#f27046;}.cls-4{fill:#eb407a;}</style></defs><path class=\"cls-1\" d=\"M74.5,28.33,21.29,120.5,74.5,212.67H180.94l1.76-3,51.46-89.13L180.94,28.33ZM84.65,40.54h78.83L111.65,56.93a15.85,15.85,0,0,1,2,5l59.66-18.81L185.22,101a20.12,20.12,0,0,1,5.36-.78l-10-47.91,37.87,65.53h-7.62a24.21,24.21,0,0,1,.15,2.68,23.29,23.29,0,0,1-.15,2.68h7.62l-39.1,67.75,10.92-50.13A20.57,20.57,0,0,1,185,140l-12.88,59-58.37-19.53a17.61,17.61,0,0,1-1.7,5l47.5,15.92H84.65l4-6.85A20.17,20.17,0,0,1,83.93,191L80,197.78,42.67,133.13l37,32.66a20.52,20.52,0,0,1,3.6-4L36.69,120.66,85,77.79a17.45,17.45,0,0,1-3.19-4.32l-39.46,35L80,43.22l5.56,9.69A17.51,17.51,0,0,1,90.12,50Zm28.24,31.17a16.15,16.15,0,0,1-2.68,4.64l62,35.81a19.74,19.74,0,0,1,2.83-4.54Zm-20,10.51v75.33a18,18,0,0,1,2.47-.16,17.18,17.18,0,0,1,2.89.21v-75a11.21,11.21,0,0,1-1.29,0,17.57,17.57,0,0,1-4.07-.47Zm79.34,46.63-62.08,35.81a18.45,18.45,0,0,1,2.68,4.68l62.23-36a19.68,19.68,0,0,1-2.83-4.53Z\"/><path class=\"cls-2\" d=\"M97,48.58a17.06,17.06,0,1,0,17,17,17.08,17.08,0,0,0-17-17Zm0,5.36a11.7,11.7,0,1,1-11.7,11.69A11.65,11.65,0,0,1,97,53.94Z\"/><path class=\"cls-3\" d=\"M95.37,157.39a18.73,18.73,0,1,0,18.7,18.7,18.74,18.74,0,0,0-18.7-18.7Zm0,5.31A13.4,13.4,0,1,1,82,176.09a13.37,13.37,0,0,1,13.4-13.39Z\"/><path class=\"cls-4\" d=\"M190.73,100.2A20.3,20.3,0,1,0,211,120.5a20.34,20.34,0,0,0-20.3-20.3Zm0,5.36a14.94,14.94,0,1,1-14.94,14.94,14.88,14.88,0,0,1,14.94-14.94Z\"/></svg>","import { Link, Typography } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nexport interface WalletPermissionsFlexBoxProps extends FlexBoxProps {}\n\nexport const WalletPermissionsFlexbox: React.FC<WalletPermissionsFlexBoxProps> = (props) => {\n return (\n <FlexCol gap={4} {...props}>\n <Typography fontWeight=\"bold\" sx={{ textAlign: 'center' }}>\n This will allow XYO to:\n </Typography>\n <ul>\n <li>View your wallet account(s) and address(es)</li>\n <li>Read-only access to browse the public blockchain(s) you select</li>\n </ul>\n <Typography variant=\"subtitle1\" sx={{ textAlign: 'center' }}>\n You control what accounts to share and what blockchains to view. You can see or revoke access via your wallet&apos;s settings at anytime. View\n more on XYO&apos;s sovereign data philosophy\n {' '}\n <Link\n href=\"https://cointelegraph.com/innovation-circle/decentralization-and-sovereignty-debunking-our-approach-to-digital-sovereignty\"\n sx={{ fontWeight: 'bold' }}\n target=\"_blank\"\n >\n here\n </Link>\n .\n </Typography>\n </FlexCol>\n )\n}\n","import type { DialogProps } from '@mui/material'\nimport {\n Button, Dialog, DialogActions, DialogContent, DialogTitle, Typography,\n} from '@mui/material'\nimport { ConstrainedImage } from '@xylabs/react-crypto'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport type { ActiveProvider } from '../../lib/index.ts'\n\nexport interface RevokeWalletConnectionDialogProps extends DialogProps {\n activeProvider?: ActiveProvider\n}\n\nexport const RevokeWalletConnectionDialog: React.FC<RevokeWalletConnectionDialogProps> = ({ activeProvider, ...props }) => {\n return (\n <Dialog {...props}>\n <FlexRow gap={2} justifyContent=\"start\" pl={2}>\n <ConstrainedImage src={activeProvider?.icon} constrainedValue=\"24px\" />\n <DialogTitle sx={{ pl: 0 }}>\n Revoke\n {activeProvider?.providerName}\n {' '}\n Access\n </DialogTitle>\n </FlexRow>\n <DialogContent>\n <Typography>\n Revoking access to your wallet must be done from the wallet&apos;s browser extension. Wallets grant access to specific domains please\n consult\n {' '}\n {activeProvider?.providerName}\n &apos;s documentation on how to revoke access to this website:\n </Typography>\n <Typography>{globalThis.location.origin}</Typography>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => props.onClose?.({}, 'escapeKeyDown')}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n )\n}\n","import type { TableHeadCell } from '@xyo-network/react-table'\n\nexport const WalletsTableHeadCells: TableHeadCell[] = [\n {\n disablePadding: false,\n id: 'wallet',\n label: 'Wallet',\n numeric: false,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'chain',\n label: 'Chain',\n numeric: false,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'accounts',\n label: 'Accounts',\n numeric: true,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'actions',\n label: 'Actions',\n numeric: false,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'enabled',\n label: 'Enabled',\n numeric: false,\n showOnMobile: true,\n },\n]\n","import {\n TableCell, Tooltip, Typography,\n} from '@mui/material'\nimport React from 'react'\n\nimport type { ConnectedWalletTableCellProps } from './lib/index.ts'\n\nexport const ConnectedWalletsAccountsTableCell: React.FC<ConnectedWalletTableCellProps> = ({\n additionalAccounts,\n currentAccount,\n totalAccounts,\n tableCellProps,\n}) => {\n return (\n <TableCell {...tableCellProps}>\n <Tooltip\n sx={{ cursor: totalAccounts > 0 ? 'pointer' : 'auto' }}\n title={[...(currentAccount ?? []), ...(additionalAccounts ?? [])].map((address, index) => (\n <p key={index}>{address}</p>\n ))}\n >\n <Typography>{totalAccounts}</Typography>\n </Tooltip>\n </TableCell>\n )\n}\n","import { Check, InfoOutlined } from '@mui/icons-material'\nimport {\n Button, IconButton, TableCell, Typography,\n} from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport type { ConnectedWalletTableCellProps } from './lib/index.ts'\n\nexport const ConnectedWalletsActionsTableCell: React.FC<ConnectedWalletTableCellProps> = ({\n connected, onConnect, onRevoke, tableCellProps,\n}) => {\n return (\n <TableCell {...tableCellProps}>\n <FlexRow gap={2} justifyContent=\"start\">\n {connected\n ? (\n <Typography sx={{ display: 'inline-flex', gap: 0.5 }}>\n <Check />\n Connected\n </Typography>\n )\n : (\n <Button variant=\"contained\" onClick={onConnect}>\n Connect\n </Button>\n )}\n {connected\n ? (\n <IconButton onClick={onRevoke}>\n <InfoOutlined />\n </IconButton>\n )\n : null}\n </FlexRow>\n </TableCell>\n )\n}\n","import { TableCell } from '@mui/material'\nimport React from 'react'\n\nimport type { ConnectedWalletTableCellProps } from './lib/index.ts'\n\nexport const ConnectedWalletsChainNameTableCell: React.FC<ConnectedWalletTableCellProps> = ({ chainName, tableCellProps }) => {\n return <TableCell {...tableCellProps}>{chainName}</TableCell>\n}\n","import { Switch, TableCell } from '@mui/material'\nimport type { ChangeEvent } from 'react'\nimport React, { useMemo } from 'react'\n\nimport { useEnabledWallets } from '../../../../hooks/index.ts'\nimport type { ConnectedWalletTableCellProps } from './lib/index.ts'\n\nexport const ConnectedWalletState: React.FC<ConnectedWalletTableCellProps> = ({\n connected, walletRdns, tableCellProps,\n}) => {\n const {\n disableWallet, enableWallet, wallets,\n } = useEnabledWallets()\n\n const enabled = useMemo(() => (walletRdns ? wallets[walletRdns].enabled : false), [wallets, walletRdns])\n\n const handleClick = (event: ChangeEvent<HTMLInputElement>) => {\n const checked = event.target?.checked\n if (walletRdns) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n checked ? enableWallet?.(walletRdns) : disableWallet?.(walletRdns)\n }\n }\n return (\n <TableCell {...tableCellProps}>\n <Switch disabled={!connected} checked={connected && enabled} onChange={handleClick} />\n </TableCell>\n )\n}\n","import { TableCell, useTheme } from '@mui/material'\nimport { ConstrainedImage } from '@xylabs/react-crypto'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport type { ConnectedWalletTableCellProps } from './lib/index.ts'\n\nexport const ConnectedWalletsWalletTableCell: React.FC<ConnectedWalletTableCellProps> = ({\n icon, walletName, tableCellProps,\n}) => {\n const theme = useTheme()\n\n return (\n <TableCell {...tableCellProps}>\n <FlexRow gap={2} justifyContent=\"start\">\n <ConstrainedImage constrainedValue={theme.spacing(4)} src={icon} />\n {walletName}\n </FlexRow>\n </TableCell>\n )\n}\n","import type { ComponentType } from 'react'\n\nimport { ConnectedWalletsAccountsTableCell } from './Accounts.tsx'\nimport { ConnectedWalletsActionsTableCell } from './Actions.tsx'\nimport { ConnectedWalletsChainNameTableCell } from './ChainName.tsx'\nimport type { ConnectedWalletTableCellProps } from './lib/index.ts'\nimport { ConnectedWalletState } from './State.tsx'\nimport { ConnectedWalletsWalletTableCell } from './Wallet.tsx'\n\nexport const ConnectedWalletTableCells: ComponentType<ConnectedWalletTableCellProps>[] = [\n ConnectedWalletsWalletTableCell,\n ConnectedWalletsChainNameTableCell,\n ConnectedWalletsAccountsTableCell,\n ConnectedWalletsActionsTableCell,\n ConnectedWalletState,\n]\n","import type { TableProps } from '@mui/material'\nimport {\n Table, TableBody, TableCell, TableHead, TableRow,\n} from '@mui/material'\nimport type { EIP6963Connector } from '@xylabs/react-crypto'\nimport React, { useState } from 'react'\n\nimport { ConnectWalletDialog, RevokeWalletConnectionDialog } from '../dialogs/index.ts'\nimport type { ActiveProvider } from '../lib/index.ts'\nimport { WalletsTableHeadCells } from '../lib/index.ts'\nimport { WalletConnectionsTableRow } from './ConnectedWalletsTableRow.tsx'\nimport { useActiveProviderDialogState } from './hooks/index.ts'\n\nexport interface ConnectedWalletsTableProps extends TableProps {\n ignoreConnectDialog?: boolean\n onIgnoreConnectDialog?: (checked: boolean) => void\n wallets?: EIP6963Connector[]\n}\n\nexport const ConnectedWalletsTable: React.FC<ConnectedWalletsTableProps> = ({\n ignoreConnectDialog, onIgnoreConnectDialog, wallets, ...props\n}) => {\n const [activeProvider, setActiveProvider] = useState<ActiveProvider>()\n const [showConnect, onSetActiveProviderConnect, onConnectClose] = useActiveProviderDialogState(setActiveProvider)\n const [showRevoke, onSetActiveProviderRevoke, onRevokeClose] = useActiveProviderDialogState(setActiveProvider)\n\n return (\n <>\n <Table {...props}>\n <TableHead>\n <TableRow>\n {WalletsTableHeadCells.map(({\n disablePadding, id, label, align, width,\n }) => (\n <TableCell align={align} key={id} padding={disablePadding ? 'none' : 'normal'} width={width ?? 'auto'}>\n {label}\n </TableCell>\n ))}\n </TableRow>\n </TableHead>\n <TableBody>\n {(wallets ?? []).map(wallet => (\n <WalletConnectionsTableRow\n ignoreConnectDialog={ignoreConnectDialog}\n key={wallet.providerInfo?.rdns}\n onConnectClick={onSetActiveProviderConnect}\n onRevoke={onSetActiveProviderRevoke}\n wallet={wallet}\n />\n ))}\n </TableBody>\n </Table>\n <RevokeWalletConnectionDialog open={showRevoke} onClose={onRevokeClose} activeProvider={activeProvider} />\n <ConnectWalletDialog\n activeProvider={activeProvider}\n onClose={onConnectClose}\n open={showConnect}\n onIgnoreConnectDialog={onIgnoreConnectDialog}\n />\n </>\n )\n}\n","import type { TableRowProps } from '@mui/material'\nimport { TableRow } from '@mui/material'\nimport type { EthWalletConnectorBase } from '@xylabs/react-crypto'\nimport { useEthWallet } from '@xylabs/react-crypto'\nimport React, { useCallback, useMemo } from 'react'\n\nimport type { ActiveProvider } from '../lib/index.ts'\nimport { ConnectedWalletTableCells } from './cells/index.ts'\n\nexport interface WalletConnectionsTableRowProps extends TableRowProps {\n ignoreConnectDialog?: boolean\n onConnectClick?: (activeProvider: ActiveProvider) => void\n onRevoke?: (activeProvider: ActiveProvider) => void\n wallet: EthWalletConnectorBase\n}\n\nexport const WalletConnectionsTableRow: React.FC<WalletConnectionsTableRowProps> = ({\n ignoreConnectDialog,\n onConnectClick,\n onRevoke,\n wallet,\n ...props\n}) => {\n const {\n currentAccount: currentAccountFromWallet, additionalAccounts, chainName, connectWallet, providerInfo,\n } = useEthWallet(wallet)\n\n const currentAccount = currentAccountFromWallet?.toString() ? [currentAccountFromWallet.toString()] : []\n const totalAccounts = (additionalAccounts?.length ?? 0) + (currentAccount?.length ?? 0)\n const connected = !!(currentAccount?.length)\n const {\n icon, name, rdns,\n } = useMemo(() => providerInfo ?? {\n icon: undefined, name: undefined, rdns: undefined,\n }, [providerInfo])\n\n const activeProvider = useMemo<ActiveProvider>(\n () => ({\n connectWallet,\n icon,\n providerName: name,\n }),\n [connectWallet, icon, name],\n )\n\n const onRevokeLocal = useCallback(() => {\n onRevoke?.(activeProvider)\n }, [activeProvider, onRevoke])\n\n const onConnectLocal = useCallback(async () => {\n if (ignoreConnectDialog) {\n await connectWallet?.()\n } else {\n onConnectClick?.(activeProvider)\n }\n }, [activeProvider, connectWallet, ignoreConnectDialog, onConnectClick])\n\n return (\n <TableRow {...props}>\n {Object.values(ConnectedWalletTableCells).map((Cell, index) => (\n <Cell\n key={index}\n additionalAccounts={additionalAccounts}\n chainName={chainName}\n connected={connected}\n currentAccount={currentAccount}\n icon={icon}\n onConnect={onConnectLocal}\n onRevoke={onRevokeLocal}\n totalAccounts={totalAccounts}\n walletName={name}\n walletRdns={rdns}\n />\n ))}\n </TableRow>\n )\n}\n","import type { Dispatch, SetStateAction } from 'react'\nimport { useState } from 'react'\n\nimport type { ActiveProvider } from '../../lib/index.ts'\n\nexport const useActiveProviderDialogState = (\n setActiveProvider: Dispatch<SetStateAction<ActiveProvider | undefined>>,\n): [boolean, (activeProvider: ActiveProvider) => void, () => void] => {\n const [show, setShow] = useState(false)\n const onSetActiveProvider = (activeProvider: ActiveProvider) => {\n setShow(true)\n setActiveProvider(activeProvider)\n }\n\n const onClose = () => {\n setShow(false)\n setActiveProvider({})\n }\n\n return [show, onSetActiveProvider, onClose]\n}\n"],"mappings":";;;;AAEA,IAAMA,4BAA4B;AAqB3B,IAAMC,8BAAN,MAAMA;EArBb,OAqBaA;;;;EAEXC,qBAAqB;;EAGbC,iBAA2C,CAAC;;EAG5CC,kBAA0C,CAAC;;EAG3CC,YAA8B,CAAA;;EAG9BC,kBAAkBN;EAE1B,YAAYM,kBAAkBN,2BAA2B;AACvD,SAAKM,kBAAkBA;AACvB,SAAKC,eAAc;EACrB;EAEA,IAAIC,UAAU;AACZ,WAAO,KAAKJ;EACd;EAEAK,cAAcC,MAAc;AAC1B,SAAKC,oBAAoBD,MAAM,KAAA;EACjC;EAEAE,aAAaF,MAAc;AACzB,SAAKC,oBAAoBD,MAAM,IAAA;EACjC;;;;EAKAG,aAAaL,SAA4B;AACvC,UAAMM,aAAqC,CAAC;AAE5C,UAAMC,YAAY,wBAAC,CAACC,YAAYC,MAAAA,MAAmC;AACjEH,iBAAWE,UAAAA,IAAc;;QAEvBE,SAASF,cAAc,KAAKb,iBAAiB,KAAKA,eAAea,UAAAA,IAAc;QAC/EC;MACF;IACF,GANkB;AASlBE,WAAOC,QAAQZ,OAAAA,EAASa,QAAQN,UAAUO,KAAK,IAAI,CAAA;AACnD,SAAKlB,kBAAkBU;AACvB,SAAKS,WAAU;EACjB;EAEAC,UAAUC,UAA0B;AAClC,SAAKpB,YAAY;SAAI,KAAKA;MAAWoB;;AACrC,WAAO,MAAA;AACL,WAAKpB,YAAY,KAAKA,UAAUqB,OAAOC,CAAAA,qBAAoBA,qBAAqBF,QAAAA;IAClF;EACF;EAEAd,oBAAoBD,MAAcQ,SAAkB;AAClD,QAAIR,QAAQ,KAAKN,gBAAgBM,IAAAA,GAAO;AACtC,WAAKN,gBAAgBM,IAAAA,EAAMQ,UAAUA;AAC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AjB,sBAAAA,IAGL,IAAA,GAEN,gBAAAG,QAAA,cAACe,uBAAAA;IAAsBC,SAASlB;IAAeN;IAA0CC;;AAG/F,GA1BwC;AA4BxCH,yBAAyB2B,cAAc;","names":["DEFAULT_LOCAL_STORAGE_KEY","EnabledEthWalletConnections","persistPreferences","enabledWallets","ethWalletsState","listeners","localStorageKey","reviveSettings","wallets","disableWallet","rdns","toggleEnabledWallet","enableWallet","resetWallets","newWallets","addWallet","walletName","wallet","enabled","Object","entries","forEach","bind","emitChange","subscribe","listener","filter","existingListener","persistSettings","isPersistance","method","reduce","acc","localStorage","setItem","JSON","stringify","existingEntries","getItem","parse","e","console","warn","message","Typography","useTheme","FlexCol","React","useWalletDiscovery","useMemo","sortWallets","wallets","result","wallet","Object","values","allowedAccounts","length","unshift","push","useDetectedWallets","useWalletDiscovery","sortedWallets","useMemo","totalConnectedAccounts","reduce","acc","useWalletDiscovery","useMemo","useSyncExternalStore","enabledEthWallets","useEnabledWalletsInner","enabledWalletsRdns","discoveredWallets","useWalletDiscovery","wallets","useMemo","undefined","EnabledEthWalletConnections","resetWallets","rdns","enabled","Object","entries","toggleEnabledWallet","useSyncExternalStore","subscribe","bind","useEnabledWallets","enabledWallets","reduce","acc","walletName","wallet","disableWallet","enableWallet","Checkbox","FormControl","FormLabel","React","CheckboxFormControl","onCheckChanged","props","FormControl","FormLabel","Checkbox","onChange","_","checked","Button","Dialog","DialogActions","DialogContent","DialogTitle","React","SyncAlt","Typography","ConstrainedImage","FlexCol","FlexRow","React","LinkedProvidersFlexbox","icon","providerName","props","React","FlexRow","gap","justifyContent","FlexCol","img","alt","src","xyoColorLogo","style","height","Typography","variant","SyncAlt","fontSize","ConstrainedImage","constrainedValue","maxWidth","Link","Typography","FlexCol","React","WalletPermissionsFlexbox","props","React","FlexCol","gap","Typography","fontWeight","sx","textAlign","ul","li","variant","Link","href","target","ConnectWalletDialog","activeProvider","onIgnoreConnectDialog","props","icon","providerName","onConnect","connectWallet","onClose","e","console","warn","message","React","Dialog","slotProps","paper","sx","display","gap","DialogTitle","textAlign","DialogContent","flexDirection","LinkedProvidersFlexbox","WalletPermissionsFlexbox","CheckboxFormControl","onCheckChanged","DialogActions","Button","variant","onClick","Button","Dialog","DialogActions","DialogContent","DialogTitle","Typography","ConstrainedImage","FlexRow","React","RevokeWalletConnectionDialog","activeProvider","props","React","Dialog","FlexRow","gap","justifyContent","pl","ConstrainedImage","src","icon","constrainedValue","DialogTitle","sx","providerName","DialogContent","Typography","globalThis","location","origin","DialogActions","Button","variant","onClick","onClose","WalletsTableHeadCells","disablePadding","id","label","numeric","showOnMobile","TableCell","Tooltip","Typography","React","ConnectedWalletsAccountsTableCell","additionalAccounts","currentAccount","totalAccounts","tableCellProps","React","TableCell","Tooltip","sx","cursor","title","map","address","index","p","key","Typography","Check","InfoOutlined","Button","IconButton","TableCell","Typography","FlexRow","React","ConnectedWalletsActionsTableCell","connected","onConnect","onRevoke","tableCellProps","React","TableCell","FlexRow","gap","justifyContent","Typography","sx","display","Check","Button","variant","onClick","IconButton","InfoOutlined","TableCell","React","ConnectedWalletsChainNameTableCell","chainName","tableCellProps","React","TableCell","Switch","TableCell","React","useMemo","ConnectedWalletState","connected","walletRdns","tableCellProps","disableWallet","enableWallet","wallets","useEnabledWallets","enabled","useMemo","handleClick","event","checked","target","React","TableCell","Switch","disabled","onChange","TableCell","useTheme","ConstrainedImage","FlexRow","React","ConnectedWalletsWalletTableCell","icon","walletName","tableCellProps","theme","useTheme","React","TableCell","FlexRow","gap","justifyContent","ConstrainedImage","constrainedValue","spacing","src","ConnectedWalletTableCells","ConnectedWalletsWalletTableCell","ConnectedWalletsChainNameTableCell","ConnectedWalletsAccountsTableCell","ConnectedWalletsActionsTableCell","ConnectedWalletState","Table","TableBody","TableCell","TableHead","TableRow","React","useState","TableRow","useEthWallet","React","useCallback","useMemo","WalletConnectionsTableRow","ignoreConnectDialog","onConnectClick","onRevoke","wallet","props","currentAccount","currentAccountFromWallet","additionalAccounts","chainName","connectWallet","providerInfo","useEthWallet","toString","totalAccounts","length","connected","icon","name","rdns","useMemo","undefined","activeProvider","providerName","onRevokeLocal","useCallback","onConnectLocal","React","TableRow","Object","values","ConnectedWalletTableCells","map","Cell","index","key","onConnect","walletName","walletRdns","useState","useActiveProviderDialogState","setActiveProvider","show","setShow","useState","onSetActiveProvider","activeProvider","onClose","ConnectedWalletsTable","ignoreConnectDialog","onIgnoreConnectDialog","wallets","props","activeProvider","setActiveProvider","useState","showConnect","onSetActiveProviderConnect","onConnectClose","useActiveProviderDialogState","showRevoke","onSetActiveProviderRevoke","onRevokeClose","React","Table","TableHead","TableRow","WalletsTableHeadCells","map","disablePadding","id","label","align","width","TableCell","key","padding","TableBody","wallet","WalletConnectionsTableRow","providerInfo","rdns","onConnectClick","onRevoke","RevokeWalletConnectionDialog","open","onClose","ConnectWalletDialog","ConnectedAccountsFlexbox","ref","ignoreConnectDialog","onIgnoreConnectDialog","props","theme","useTheme","totalConnectedAccounts","sortedWallets","useDetectedWallets","React","FlexCol","alignItems","justifyContent","gap","Typography","variant","sx","mb","color","vars","palette","secondary","main","opacity","ConnectedWalletsTable","wallets","displayName"]}
1
+ {"version":3,"sources":["../../src/classes/EnabledWallets.ts","../../src/components/ConnectedAccountsFlexbox.tsx","../../src/hooks/useDetectWallets.tsx","../../src/hooks/useEnabledWallets.tsx","../../src/components/wallet/dialogs/connect/CheckboxFormControl.tsx","../../src/components/wallet/dialogs/connect/Dialog.tsx","../../src/components/wallet/dialogs/connect/LinkedProvidersFlexbox.tsx","../../src/img/xyo-color-logo.svg","../../src/components/wallet/dialogs/connect/Permissions.tsx","../../src/components/wallet/dialogs/revoke/Dialog.tsx","../../src/components/wallet/lib/TableHeadData.ts","../../src/components/wallet/table/cells/Accounts.tsx","../../src/components/wallet/table/cells/Actions.tsx","../../src/components/wallet/table/cells/ChainName.tsx","../../src/components/wallet/table/cells/State.tsx","../../src/components/wallet/table/cells/Wallet.tsx","../../src/components/wallet/table/cells/Cells.tsx","../../src/components/wallet/table/ConnectedWalletsTable.tsx","../../src/components/wallet/table/ConnectedWalletsTableRow.tsx","../../src/components/wallet/table/hooks/useActiveProviderDialogState.tsx"],"sourcesContent":["import type { DiscoveredWallets, EIP6963Connector } from '@xylabs/react-crypto'\n\nconst DEFAULT_LOCAL_STORAGE_KEY = 'XYO|EnabledWallets'\n\n/**\n * State for storing wallets and their enabled/disabled status by name\n */\nexport interface EnabledEthWalletsState {\n [rdns: string]: {\n enabled: boolean\n wallet: EIP6963Connector\n }\n}\n\n/**\n * State for storing only enabled/disabled status of a wallet by name\n */\nexport interface EnabledWalletsSavedState {\n [rdns: string]: boolean\n}\n\nexport type WalletListener = () => void\n\nexport class EnabledEthWalletConnections {\n // control whether or not enabled/disabled preferences are persisted (i.e. in localStorage)\n persistPreferences = true\n\n // Map of wallet names and their enabled/disabled state\n private enabledWallets: EnabledWalletsSavedState = {}\n\n // Map of wallet names, their enabled/disabled state, and their wallet class\n private ethWalletsState: EnabledEthWalletsState = {}\n\n // list of listeners that want to be notified on wallet changes\n private listeners: WalletListener[] = []\n\n // key to use in localStorage when persisting preferences\n private localStorageKey = DEFAULT_LOCAL_STORAGE_KEY\n\n constructor(localStorageKey = DEFAULT_LOCAL_STORAGE_KEY) {\n this.localStorageKey = localStorageKey\n this.reviveSettings()\n }\n\n get wallets() {\n return this.ethWalletsState\n }\n\n disableWallet(rdns: string) {\n this.toggleEnabledWallet(rdns, false)\n }\n\n enableWallet(rdns: string) {\n this.toggleEnabledWallet(rdns, true)\n }\n\n /**\n * Given a new set of wallets, set their enabled state based off previous preferences\n */\n resetWallets(wallets: DiscoveredWallets) {\n const newWallets: EnabledEthWalletsState = {}\n\n const addWallet = ([walletName, wallet]: [string, EIP6963Connector]) => {\n newWallets[walletName] = {\n // preserve the existing enabled state\n enabled: walletName in this.enabledWallets ? this.enabledWallets[walletName] : true,\n wallet,\n }\n }\n\n // eslint-disable-next-line unicorn/no-array-for-each\n Object.entries(wallets).forEach((wallet) => {\n if (wallet !== undefined) {\n addWallet.bind(this)\n }\n })\n this.ethWalletsState = newWallets\n this.emitChange()\n }\n\n subscribe(listener: WalletListener) {\n this.listeners = [...this.listeners, listener]\n return () => {\n this.listeners = this.listeners.filter(existingListener => existingListener !== listener)\n }\n }\n\n toggleEnabledWallet(rdns: string, enabled: boolean) {\n if (rdns && this.ethWalletsState[rdns]) {\n this.ethWalletsState[rdns].enabled = enabled\n this.ethWalletsState = { ...this.ethWalletsState }\n this.emitChange()\n }\n }\n\n private emitChange() {\n for (const listener of this.listeners) {\n listener()\n }\n\n this.persistSettings()\n }\n\n private isPersistance(method: () => void) {\n if (this.persistPreferences) {\n method()\n }\n }\n\n private persistSettings() {\n this.isPersistance(() => {\n // convert wallet enabled selections into serializable state\n // eslint-disable-next-line unicorn/no-array-reduce\n const enabledWallets = Object.entries(this.ethWalletsState).reduce((acc, [rdns, { enabled }]) => {\n acc[rdns] = enabled\n return acc\n }, {} as EnabledWalletsSavedState)\n\n localStorage.setItem(this.localStorageKey, JSON.stringify(enabledWallets))\n })\n }\n\n private reviveSettings() {\n this.isPersistance(() => {\n const existingEntries = localStorage.getItem(this.localStorageKey)\n try {\n const entries = existingEntries ? JSON.parse(existingEntries) : {}\n this.enabledWallets = entries\n } catch (e) {\n console.warn(`Error parsing saved enabled wallet entries: ${(e as Error).message}`)\n }\n })\n }\n}\n","import { Typography, useTheme } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { useDetectedWallets } from '../hooks/index.ts'\nimport { ConnectedWalletsTable } from './wallet/index.ts'\n\nexport interface ConnectedAccountsFlexboxProps extends FlexBoxProps {\n ignoreConnectDialog?: boolean\n // A callback that is invoked when the option to ignore the dialog is checked\n onIgnoreConnectDialog?: (checked: boolean) => void\n}\n\nexport const ConnectedAccountsFlexbox = ({\n ref, ignoreConnectDialog, onIgnoreConnectDialog, ...props\n}: ConnectedAccountsFlexboxProps) => {\n const theme = useTheme()\n\n const { totalConnectedAccounts, sortedWallets } = useDetectedWallets()\n\n return (\n <FlexCol alignItems=\"stretch\" justifyContent=\"start\" gap={2} ref={ref} {...props}>\n <FlexCol alignItems=\"start\">\n <Typography variant=\"h2\" sx={{ mb: 0.5 }}>\n Detected Web3 Wallets\n </Typography>\n {totalConnectedAccounts\n ? (\n <Typography variant=\"subtitle1\" color={theme.vars.palette.secondary.main} sx={{ opacity: 0.5 }}>\n Total Connected Accounts:\n {' '}\n {totalConnectedAccounts}\n </Typography>\n )\n : null}\n </FlexCol>\n <ConnectedWalletsTable wallets={sortedWallets} ignoreConnectDialog={ignoreConnectDialog} onIgnoreConnectDialog={onIgnoreConnectDialog} />\n </FlexCol>\n )\n}\n\nConnectedAccountsFlexbox.displayName = 'ConnectedAccountsFlexbox'\n","import type { DiscoveredWallets, EIP6963Connector } from '@xylabs/react-crypto'\nimport { useWalletDiscovery } from '@xylabs/react-crypto'\nimport { useMemo } from 'react'\n\nconst sortWallets = (wallets: DiscoveredWallets) => {\n const result: EIP6963Connector[] = []\n\n for (const wallet of Object.values(wallets)) {\n if (wallet) {\n if (wallet.allowedAccounts.length > 0)\n result.unshift(wallet)\n else\n result.push(wallet)\n }\n }\n return result\n}\n\nexport const useDetectedWallets = () => {\n const wallets = useWalletDiscovery()\n const sortedWallets = useMemo(() => sortWallets(wallets), [wallets])\n\n const totalConnectedAccounts = useMemo(\n () => Object.values(sortedWallets).reduce((acc, wallet) => acc + wallet.allowedAccounts.length, 0),\n [sortedWallets],\n )\n\n return { sortedWallets, totalConnectedAccounts }\n}\n","import { useWalletDiscovery } from '@xylabs/react-crypto'\nimport { useMemo, useSyncExternalStore } from 'react'\n\nimport type { EnabledEthWalletsState, EnabledWalletsSavedState } from '../classes/index.ts'\nimport { EnabledEthWalletConnections } from '../classes/index.ts'\n\nlet enabledEthWallets: EnabledEthWalletConnections | undefined\n\n/**\n * Takes the discovered wallets and tracks their enabled state globally\n */\nexport const useEnabledWalletsInner = (enabledWalletsRdns?: EnabledWalletsSavedState) => {\n const discoveredWallets = useWalletDiscovery()\n\n // when we discover new wallets, build their enabled state\n const wallets = useMemo(() => {\n if (enabledEthWallets === undefined) enabledEthWallets = new EnabledEthWalletConnections()\n enabledEthWallets.resetWallets(discoveredWallets)\n for (const [rdns, enabled] of Object.entries(enabledWalletsRdns ?? {})) enabledEthWallets?.toggleEnabledWallet(rdns, enabled)\n return enabledEthWallets\n }, [discoveredWallets, enabledWalletsRdns])\n\n return useSyncExternalStore(wallets.subscribe.bind(wallets), () => wallets.wallets)\n}\n\n/**\n * Expose an interface for enabling and disabling wallets\n */\nexport const useEnabledWallets = (enabledWalletsRdns?: EnabledWalletsSavedState) => {\n const wallets = useEnabledWalletsInner(enabledWalletsRdns)\n const enabledWallets = useMemo(\n () =>\n // eslint-disable-next-line unicorn/no-array-reduce\n Object.entries(wallets).reduce((acc, [walletName, wallet]) => {\n if (wallet.enabled) acc[walletName] = wallet\n return acc\n }, {} as EnabledEthWalletsState),\n [wallets],\n )\n\n return {\n disableWallet: enabledEthWallets?.disableWallet.bind(enabledEthWallets),\n enableWallet: enabledEthWallets?.enableWallet.bind(enabledEthWallets),\n enabledWallets,\n wallets,\n }\n}\n","import type { FormControlProps } from '@mui/material'\nimport {\n Checkbox, FormControl, FormLabel,\n} from '@mui/material'\nimport React from 'react'\n\nexport interface CheckboxFormControlProps extends FormControlProps {\n onCheckChanged?: (checked: boolean) => void\n}\n\nexport const CheckboxFormControl: React.FC<CheckboxFormControlProps> = ({ onCheckChanged, ...props }) => {\n return (\n <FormControl {...props}>\n <FormLabel>\n <Checkbox onChange={(_, checked) => onCheckChanged?.(checked)} />\n Do not show this again.\n </FormLabel>\n </FormControl>\n )\n}\n","import type { DialogProps } from '@mui/material'\nimport {\n Button, Dialog, DialogActions, DialogContent, DialogTitle,\n} from '@mui/material'\nimport React from 'react'\n\nimport type { ActiveProvider } from '../../lib/index.ts'\nimport { CheckboxFormControl } from './CheckboxFormControl.tsx'\nimport { LinkedProvidersFlexbox } from './LinkedProvidersFlexbox.tsx'\nimport { WalletPermissionsFlexbox } from './Permissions.tsx'\n\nexport interface ConnectWalletDialogProps extends DialogProps {\n activeProvider?: ActiveProvider\n onIgnoreConnectDialog?: (checked: boolean) => void\n}\n\nexport const ConnectWalletDialog: React.FC<ConnectWalletDialogProps> = ({\n activeProvider, onIgnoreConnectDialog, ...props\n}) => {\n const { icon, providerName } = activeProvider ?? {}\n\n const onConnect = async () => {\n try {\n await activeProvider?.connectWallet?.()\n props.onClose?.({}, 'escapeKeyDown')\n } catch (e) {\n console.warn(`Error connecting to wallet: ${(e as Error).message}`)\n }\n }\n\n return (\n <Dialog\n slotProps={{ paper: { sx: { display: 'flex', gap: 4 } } }}\n {...props}\n >\n <DialogTitle sx={{ textAlign: 'center' }}>XYO Wants To Access The Blockchain on Your Behalf</DialogTitle>\n <DialogContent sx={{\n display: 'flex', flexDirection: 'column', gap: 4,\n }}\n >\n <LinkedProvidersFlexbox icon={icon} providerName={providerName} />\n <WalletPermissionsFlexbox />\n <CheckboxFormControl onCheckChanged={onIgnoreConnectDialog} />\n </DialogContent>\n <DialogActions>\n <Button variant=\"outlined\" onClick={() => props.onClose?.({}, 'escapeKeyDown')}>\n Close\n </Button>\n <Button variant=\"contained\" onClick={onConnect}>\n Connect\n </Button>\n </DialogActions>\n </Dialog>\n )\n}\n","import { SyncAlt } from '@mui/icons-material'\nimport { Typography } from '@mui/material'\nimport { ConstrainedImage } from '@xylabs/react-crypto'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { xyoColorLogo } from '../../../../img/index.ts'\n\nexport interface LinkedProvidersFlexboxProps extends FlexBoxProps {\n icon?: string\n providerName?: string\n}\n\nexport const LinkedProvidersFlexbox: React.FC<LinkedProvidersFlexboxProps> = ({\n icon, providerName, ...props\n}) => {\n return (\n <FlexRow gap={4} justifyContent=\"space-evenly\" {...props}>\n <FlexCol gap={0.5}>\n <img alt=\"XYO Logo\" src={xyoColorLogo} style={{ height: '48px' }} />\n <Typography variant=\"subtitle1\">XYO App</Typography>\n </FlexCol>\n <SyncAlt fontSize=\"large\" />\n <FlexCol gap={0.5}>\n <ConstrainedImage\n constrainedValue=\"48px\"\n src={icon}\n alt={providerName}\n style={{ height: '48px', maxWidth: '48px' }}\n />\n <Typography variant=\"subtitle1\">{providerName}</Typography>\n </FlexCol>\n </FlexRow>\n )\n}\n","<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 238\"><defs><style>.cls-1{fill:#8d8fc6;}.cls-2{fill:#579fd6;}.cls-3{fill:#f27046;}.cls-4{fill:#eb407a;}</style></defs><path class=\"cls-1\" d=\"M74.5,28.33,21.29,120.5,74.5,212.67H180.94l1.76-3,51.46-89.13L180.94,28.33ZM84.65,40.54h78.83L111.65,56.93a15.85,15.85,0,0,1,2,5l59.66-18.81L185.22,101a20.12,20.12,0,0,1,5.36-.78l-10-47.91,37.87,65.53h-7.62a24.21,24.21,0,0,1,.15,2.68,23.29,23.29,0,0,1-.15,2.68h7.62l-39.1,67.75,10.92-50.13A20.57,20.57,0,0,1,185,140l-12.88,59-58.37-19.53a17.61,17.61,0,0,1-1.7,5l47.5,15.92H84.65l4-6.85A20.17,20.17,0,0,1,83.93,191L80,197.78,42.67,133.13l37,32.66a20.52,20.52,0,0,1,3.6-4L36.69,120.66,85,77.79a17.45,17.45,0,0,1-3.19-4.32l-39.46,35L80,43.22l5.56,9.69A17.51,17.51,0,0,1,90.12,50Zm28.24,31.17a16.15,16.15,0,0,1-2.68,4.64l62,35.81a19.74,19.74,0,0,1,2.83-4.54Zm-20,10.51v75.33a18,18,0,0,1,2.47-.16,17.18,17.18,0,0,1,2.89.21v-75a11.21,11.21,0,0,1-1.29,0,17.57,17.57,0,0,1-4.07-.47Zm79.34,46.63-62.08,35.81a18.45,18.45,0,0,1,2.68,4.68l62.23-36a19.68,19.68,0,0,1-2.83-4.53Z\"/><path class=\"cls-2\" d=\"M97,48.58a17.06,17.06,0,1,0,17,17,17.08,17.08,0,0,0-17-17Zm0,5.36a11.7,11.7,0,1,1-11.7,11.69A11.65,11.65,0,0,1,97,53.94Z\"/><path class=\"cls-3\" d=\"M95.37,157.39a18.73,18.73,0,1,0,18.7,18.7,18.74,18.74,0,0,0-18.7-18.7Zm0,5.31A13.4,13.4,0,1,1,82,176.09a13.37,13.37,0,0,1,13.4-13.39Z\"/><path class=\"cls-4\" d=\"M190.73,100.2A20.3,20.3,0,1,0,211,120.5a20.34,20.34,0,0,0-20.3-20.3Zm0,5.36a14.94,14.94,0,1,1-14.94,14.94,14.88,14.88,0,0,1,14.94-14.94Z\"/></svg>","import { Link, Typography } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nexport interface WalletPermissionsFlexBoxProps extends FlexBoxProps {}\n\nexport const WalletPermissionsFlexbox: React.FC<WalletPermissionsFlexBoxProps> = (props) => {\n return (\n <FlexCol gap={4} {...props}>\n <Typography fontWeight=\"bold\" sx={{ textAlign: 'center' }}>\n This will allow XYO to:\n </Typography>\n <ul>\n <li>View your wallet account(s) and address(es)</li>\n <li>Read-only access to browse the public blockchain(s) you select</li>\n </ul>\n <Typography variant=\"subtitle1\" sx={{ textAlign: 'center' }}>\n You control what accounts to share and what blockchains to view. You can see or revoke access via your wallet&apos;s settings at anytime. View\n more on XYO&apos;s sovereign data philosophy\n {' '}\n <Link\n href=\"https://cointelegraph.com/innovation-circle/decentralization-and-sovereignty-debunking-our-approach-to-digital-sovereignty\"\n sx={{ fontWeight: 'bold' }}\n target=\"_blank\"\n >\n here\n </Link>\n .\n </Typography>\n </FlexCol>\n )\n}\n","import type { DialogProps } from '@mui/material'\nimport {\n Button, Dialog, DialogActions, DialogContent, DialogTitle, Typography,\n} from '@mui/material'\nimport { ConstrainedImage } from '@xylabs/react-crypto'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport type { ActiveProvider } from '../../lib/index.ts'\n\nexport interface RevokeWalletConnectionDialogProps extends DialogProps {\n activeProvider?: ActiveProvider\n}\n\nexport const RevokeWalletConnectionDialog: React.FC<RevokeWalletConnectionDialogProps> = ({ activeProvider, ...props }) => {\n return (\n <Dialog {...props}>\n <FlexRow gap={2} justifyContent=\"start\" pl={2}>\n <ConstrainedImage src={activeProvider?.icon} constrainedValue=\"24px\" />\n <DialogTitle sx={{ pl: 0 }}>\n Revoke\n {activeProvider?.providerName}\n {' '}\n Access\n </DialogTitle>\n </FlexRow>\n <DialogContent>\n <Typography>\n Revoking access to your wallet must be done from the wallet&apos;s browser extension. Wallets grant access to specific domains please\n consult\n {' '}\n {activeProvider?.providerName}\n &apos;s documentation on how to revoke access to this website:\n </Typography>\n <Typography>{globalThis.location.origin}</Typography>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => props.onClose?.({}, 'escapeKeyDown')}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n )\n}\n","import type { TableHeadCell } from '@xyo-network/react-table'\n\nexport const WalletsTableHeadCells: TableHeadCell[] = [\n {\n disablePadding: false,\n id: 'wallet',\n label: 'Wallet',\n numeric: false,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'chain',\n label: 'Chain',\n numeric: false,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'accounts',\n label: 'Accounts',\n numeric: true,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'actions',\n label: 'Actions',\n numeric: false,\n showOnMobile: true,\n },\n {\n disablePadding: false,\n id: 'enabled',\n label: 'Enabled',\n numeric: false,\n showOnMobile: true,\n },\n]\n","import {\n TableCell, Tooltip, Typography,\n} from '@mui/material'\nimport React from 'react'\n\nimport type { ConnectedWalletTableCellProps } from './lib/index.ts'\n\nexport const ConnectedWalletsAccountsTableCell: React.FC<ConnectedWalletTableCellProps> = ({\n additionalAccounts,\n currentAccount,\n totalAccounts,\n tableCellProps,\n}) => {\n return (\n <TableCell {...tableCellProps}>\n <Tooltip\n sx={{ cursor: totalAccounts > 0 ? 'pointer' : 'auto' }}\n title={[...(currentAccount ?? []), ...(additionalAccounts ?? [])].map((address, index) => (\n <p key={index}>{address}</p>\n ))}\n >\n <Typography>{totalAccounts}</Typography>\n </Tooltip>\n </TableCell>\n )\n}\n","import { Check, InfoOutlined } from '@mui/icons-material'\nimport {\n Button, IconButton, TableCell, Typography,\n} from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport type { ConnectedWalletTableCellProps } from './lib/index.ts'\n\nexport const ConnectedWalletsActionsTableCell: React.FC<ConnectedWalletTableCellProps> = ({\n connected, onConnect, onRevoke, tableCellProps,\n}) => {\n return (\n <TableCell {...tableCellProps}>\n <FlexRow gap={2} justifyContent=\"start\">\n {connected\n ? (\n <Typography sx={{ display: 'inline-flex', gap: 0.5 }}>\n <Check />\n Connected\n </Typography>\n )\n : (\n <Button variant=\"contained\" onClick={onConnect}>\n Connect\n </Button>\n )}\n {connected\n ? (\n <IconButton onClick={onRevoke}>\n <InfoOutlined />\n </IconButton>\n )\n : null}\n </FlexRow>\n </TableCell>\n )\n}\n","import { TableCell } from '@mui/material'\nimport React from 'react'\n\nimport type { ConnectedWalletTableCellProps } from './lib/index.ts'\n\nexport const ConnectedWalletsChainNameTableCell: React.FC<ConnectedWalletTableCellProps> = ({ chainName, tableCellProps }) => {\n return <TableCell {...tableCellProps}>{chainName}</TableCell>\n}\n","import { Switch, TableCell } from '@mui/material'\nimport type { ChangeEvent } from 'react'\nimport React, { useMemo } from 'react'\n\nimport { useEnabledWallets } from '../../../../hooks/index.ts'\nimport type { ConnectedWalletTableCellProps } from './lib/index.ts'\n\nexport const ConnectedWalletState: React.FC<ConnectedWalletTableCellProps> = ({\n connected, walletRdns, tableCellProps,\n}) => {\n const {\n disableWallet, enableWallet, wallets,\n } = useEnabledWallets()\n\n const enabled = useMemo(() => (walletRdns ? wallets[walletRdns].enabled : false), [wallets, walletRdns])\n\n const handleClick = (event: ChangeEvent<HTMLInputElement>) => {\n const checked = event.target?.checked\n if (walletRdns) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n checked ? enableWallet?.(walletRdns) : disableWallet?.(walletRdns)\n }\n }\n return (\n <TableCell {...tableCellProps}>\n <Switch disabled={!connected} checked={connected && enabled} onChange={handleClick} />\n </TableCell>\n )\n}\n","import { TableCell, useTheme } from '@mui/material'\nimport { ConstrainedImage } from '@xylabs/react-crypto'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport type { ConnectedWalletTableCellProps } from './lib/index.ts'\n\nexport const ConnectedWalletsWalletTableCell: React.FC<ConnectedWalletTableCellProps> = ({\n icon, walletName, tableCellProps,\n}) => {\n const theme = useTheme()\n\n return (\n <TableCell {...tableCellProps}>\n <FlexRow gap={2} justifyContent=\"start\">\n <ConstrainedImage constrainedValue={theme.spacing(4)} src={icon} />\n {walletName}\n </FlexRow>\n </TableCell>\n )\n}\n","import type { ComponentType } from 'react'\n\nimport { ConnectedWalletsAccountsTableCell } from './Accounts.tsx'\nimport { ConnectedWalletsActionsTableCell } from './Actions.tsx'\nimport { ConnectedWalletsChainNameTableCell } from './ChainName.tsx'\nimport type { ConnectedWalletTableCellProps } from './lib/index.ts'\nimport { ConnectedWalletState } from './State.tsx'\nimport { ConnectedWalletsWalletTableCell } from './Wallet.tsx'\n\nexport const ConnectedWalletTableCells: ComponentType<ConnectedWalletTableCellProps>[] = [\n ConnectedWalletsWalletTableCell,\n ConnectedWalletsChainNameTableCell,\n ConnectedWalletsAccountsTableCell,\n ConnectedWalletsActionsTableCell,\n ConnectedWalletState,\n]\n","import type { TableProps } from '@mui/material'\nimport {\n Table, TableBody, TableCell, TableHead, TableRow,\n} from '@mui/material'\nimport type { EIP6963Connector } from '@xylabs/react-crypto'\nimport React, { useState } from 'react'\n\nimport { ConnectWalletDialog, RevokeWalletConnectionDialog } from '../dialogs/index.ts'\nimport type { ActiveProvider } from '../lib/index.ts'\nimport { WalletsTableHeadCells } from '../lib/index.ts'\nimport { WalletConnectionsTableRow } from './ConnectedWalletsTableRow.tsx'\nimport { useActiveProviderDialogState } from './hooks/index.ts'\n\nexport interface ConnectedWalletsTableProps extends TableProps {\n ignoreConnectDialog?: boolean\n onIgnoreConnectDialog?: (checked: boolean) => void\n wallets?: EIP6963Connector[]\n}\n\nexport const ConnectedWalletsTable: React.FC<ConnectedWalletsTableProps> = ({\n ignoreConnectDialog, onIgnoreConnectDialog, wallets, ...props\n}) => {\n const [activeProvider, setActiveProvider] = useState<ActiveProvider>()\n const [showConnect, onSetActiveProviderConnect, onConnectClose] = useActiveProviderDialogState(setActiveProvider)\n const [showRevoke, onSetActiveProviderRevoke, onRevokeClose] = useActiveProviderDialogState(setActiveProvider)\n\n return (\n <>\n <Table {...props}>\n <TableHead>\n <TableRow>\n {WalletsTableHeadCells.map(({\n disablePadding, id, label, align, width,\n }) => (\n <TableCell align={align} key={id} padding={disablePadding ? 'none' : 'normal'} width={width ?? 'auto'}>\n {label}\n </TableCell>\n ))}\n </TableRow>\n </TableHead>\n <TableBody>\n {(wallets ?? []).map(wallet => (\n <WalletConnectionsTableRow\n ignoreConnectDialog={ignoreConnectDialog}\n key={wallet.providerInfo?.rdns}\n onConnectClick={onSetActiveProviderConnect}\n onRevoke={onSetActiveProviderRevoke}\n wallet={wallet}\n />\n ))}\n </TableBody>\n </Table>\n <RevokeWalletConnectionDialog open={showRevoke} onClose={onRevokeClose} activeProvider={activeProvider} />\n <ConnectWalletDialog\n activeProvider={activeProvider}\n onClose={onConnectClose}\n open={showConnect}\n onIgnoreConnectDialog={onIgnoreConnectDialog}\n />\n </>\n )\n}\n","import type { TableRowProps } from '@mui/material'\nimport { TableRow } from '@mui/material'\nimport type { EthWalletConnectorBase } from '@xylabs/react-crypto'\nimport { useEthWallet } from '@xylabs/react-crypto'\nimport React, { useCallback, useMemo } from 'react'\n\nimport type { ActiveProvider } from '../lib/index.ts'\nimport { ConnectedWalletTableCells } from './cells/index.ts'\n\nexport interface WalletConnectionsTableRowProps extends TableRowProps {\n ignoreConnectDialog?: boolean\n onConnectClick?: (activeProvider: ActiveProvider) => void\n onRevoke?: (activeProvider: ActiveProvider) => void\n wallet: EthWalletConnectorBase\n}\n\nexport const WalletConnectionsTableRow: React.FC<WalletConnectionsTableRowProps> = ({\n ignoreConnectDialog,\n onConnectClick,\n onRevoke,\n wallet,\n ...props\n}) => {\n const {\n currentAccount: currentAccountFromWallet, additionalAccounts, chainName, connectWallet, providerInfo,\n } = useEthWallet(wallet)\n\n const currentAccount = currentAccountFromWallet?.toString() ? [currentAccountFromWallet.toString()] : []\n const totalAccounts = (additionalAccounts?.length ?? 0) + (currentAccount?.length ?? 0)\n const connected = !!(currentAccount?.length)\n const {\n icon, name, rdns,\n } = useMemo(() => providerInfo ?? {\n icon: undefined, name: undefined, rdns: undefined,\n }, [providerInfo])\n\n const activeProvider = useMemo<ActiveProvider>(\n () => ({\n connectWallet,\n icon,\n providerName: name,\n }),\n [connectWallet, icon, name],\n )\n\n const onRevokeLocal = useCallback(() => {\n onRevoke?.(activeProvider)\n }, [activeProvider, onRevoke])\n\n const onConnectLocal = useCallback(async () => {\n if (ignoreConnectDialog) {\n await connectWallet?.()\n } else {\n onConnectClick?.(activeProvider)\n }\n }, [activeProvider, connectWallet, ignoreConnectDialog, onConnectClick])\n\n return (\n <TableRow {...props}>\n {Object.values(ConnectedWalletTableCells).map((Cell, index) => (\n <Cell\n key={index}\n additionalAccounts={additionalAccounts}\n chainName={chainName}\n connected={connected}\n currentAccount={currentAccount}\n icon={icon}\n onConnect={onConnectLocal}\n onRevoke={onRevokeLocal}\n totalAccounts={totalAccounts}\n walletName={name}\n walletRdns={rdns}\n />\n ))}\n </TableRow>\n )\n}\n","import type { Dispatch, SetStateAction } from 'react'\nimport { useState } from 'react'\n\nimport type { ActiveProvider } from '../../lib/index.ts'\n\nexport const useActiveProviderDialogState = (\n setActiveProvider: Dispatch<SetStateAction<ActiveProvider | undefined>>,\n): [boolean, (activeProvider: ActiveProvider) => void, () => void] => {\n const [show, setShow] = useState(false)\n const onSetActiveProvider = (activeProvider: ActiveProvider) => {\n setShow(true)\n setActiveProvider(activeProvider)\n }\n\n const onClose = () => {\n setShow(false)\n setActiveProvider({})\n }\n\n return [show, onSetActiveProvider, onClose]\n}\n"],"mappings":";AAEA,IAAM,4BAA4B;AAqB3B,IAAM,8BAAN,MAAkC;AAAA;AAAA,EAEvC,qBAAqB;AAAA;AAAA,EAGb,iBAA2C,CAAC;AAAA;AAAA,EAG5C,kBAA0C,CAAC;AAAA;AAAA,EAG3C,YAA8B,CAAC;AAAA;AAAA,EAG/B,kBAAkB;AAAA,EAE1B,YAAY,kBAAkB,2BAA2B;AACvD,SAAK,kBAAkB;AACvB,SAAK,eAAe;AAAA,EACtB;AAAA,EAEA,IAAI,UAAU;AACZ,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,cAAc,MAAc;AAC1B,SAAK,oBAAoB,MAAM,KAAK;AAAA,EACtC;AAAA,EAEA,aAAa,MAAc;AACzB,SAAK,oBAAoB,MAAM,IAAI;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA,EAKA,aAAa,SAA4B;AACvC,UAAM,aAAqC,CAAC;AAE5C,UAAM,YAAY,CAAC,CAAC,YAAY,MAAM,MAAkC;AACtE,iBAAW,UAAU,IAAI;AAAA;AAAA,QAEvB,SAAS,cAAc,KAAK,iBAAiB,KAAK,eAAe,UAAU,IAAI;AAAA,QAC/E;AAAA,MACF;AAAA,IACF;AAGA,WAAO,QAAQ,OAAO,EAAE,QAAQ,CAAC,WAAW;AAC1C,UAAI,WAAW,QAAW;AACxB,kBAAU,KAAK,IAAI;AAAA,MACrB;AAAA,IACF,CAAC;AACD,SAAK,kBAAkB;AACvB,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,UAAU,UAA0B;AAClC,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C,aACG,sBAAW,CAAC,GAAG,IAAI,YACnB,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UAEA,gBAAgB;AAAA,UAChB,UAAU;AAAA,UACV;AAAA;AAAA,QAHK,OAAO,cAAc;AAAA,MAI5B,CACD,GACH;AAAA,OACF;AAAA,IACA,gBAAAA,MAAC,gCAA6B,MAAM,YAAY,SAAS,eAAe,gBAAgC;AAAA,IACxG,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,SAAS;AAAA,QACT,MAAM;AAAA,QACN;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;;;AhBrCQ,gBAAAK,OAKM,QAAAC,aALN;AAVD,IAAM,2BAA2B,CAAC;AAAA,EACvC;AAAA,EAAK;AAAA,EAAqB;AAAA,EAAuB,GAAG;AACtD,MAAqC;AACnC,QAAM,QAAQC,UAAS;AAEvB,QAAM,EAAE,wBAAwB,cAAc,IAAI,mBAAmB;AAErE,SACE,gBAAAD,MAACE,UAAA,EAAQ,YAAW,WAAU,gBAAe,SAAQ,KAAK,GAAG,KAAW,GAAG,OACzE;AAAA,oBAAAF,MAACE,UAAA,EAAQ,YAAW,SAClB;AAAA,sBAAAH,MAACI,aAAA,EAAW,SAAQ,MAAK,IAAI,EAAE,IAAI,IAAI,GAAG,mCAE1C;AAAA,MACC,yBAEK,gBAAAH,MAACG,aAAA,EAAW,SAAQ,aAAY,OAAO,MAAM,KAAK,QAAQ,UAAU,MAAM,IAAI,EAAE,SAAS,IAAI,GAAG;AAAA;AAAA,QAE7F;AAAA,QACA;AAAA,SACH,IAEF;AAAA,OACN;AAAA,IACA,gBAAAJ,MAAC,yBAAsB,SAAS,eAAe,qBAA0C,uBAA8C;AAAA,KACzI;AAEJ;AAEA,yBAAyB,cAAc;","names":["Typography","useTheme","FlexCol","useWalletDiscovery","useMemo","useWalletDiscovery","useMemo","jsx","jsxs","Typography","FlexCol","jsx","jsxs","jsx","jsxs","Button","Dialog","DialogActions","DialogContent","DialogTitle","Typography","ConstrainedImage","FlexRow","jsx","jsxs","Typography","jsx","Button","TableCell","Typography","FlexRow","jsx","jsxs","TableCell","jsx","TableCell","useMemo","jsx","useMemo","TableCell","TableCell","ConstrainedImage","FlexRow","jsx","jsxs","TableCell","TableRow","useState","useMemo","jsx","useMemo","jsx","jsxs","useState","TableRow","TableCell","jsx","jsxs","useTheme","FlexCol","Typography"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-connected-accounts",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -43,27 +43,30 @@
43
43
  "src"
44
44
  ],
45
45
  "dependencies": {
46
- "@xylabs/react-crypto": "^7.0.0",
47
- "@xylabs/react-flexbox": "^7.0.0",
48
- "@xyo-network/react-table": "^7.0.0"
46
+ "@xylabs/react-crypto": "~7.0.1",
47
+ "@xylabs/react-flexbox": "~7.0.1",
48
+ "@xyo-network/react-table": "^7.0.1"
49
49
  },
50
50
  "devDependencies": {
51
- "@mui/icons-material": "^7.2.0",
52
- "@mui/material": "^7.2.0",
53
- "@storybook/react-vite": "^9.0.18",
54
- "@types/react": "^19.1.9",
55
- "@xylabs/ts-scripts-yarn3": "^7.0.2",
56
- "@xylabs/tsconfig-react": "^7.0.2",
57
- "react": "^19.1.1",
58
- "react-dom": "^19.1.1",
59
- "storybook": "^9.0.18",
60
- "typescript": "^5.8.3"
51
+ "@mui/icons-material": "~7.3.1",
52
+ "@mui/material": "~7.3.1",
53
+ "@storybook/react-vite": "~9.1.2",
54
+ "@types/react": "~19.1.10",
55
+ "@xylabs/ts-scripts-yarn3": "~7.1.1",
56
+ "@xylabs/tsconfig": "~7.1.1",
57
+ "@xylabs/tsconfig-dom": "~7.1.1",
58
+ "@xylabs/tsconfig-react": "~7.1.1",
59
+ "react": "~19.1.1",
60
+ "react-dom": "~19.1.1",
61
+ "storybook": "~9.1.2",
62
+ "typescript": "~5.9.2",
63
+ "vite": "~7.1.2"
61
64
  },
62
65
  "peerDependencies": {
63
66
  "@mui/icons-material": ">=6 <8",
64
67
  "@mui/material": ">=6 <8",
65
- "react": "^19",
66
- "react-dom": "^19"
68
+ "react": "~19",
69
+ "react-dom": "~19"
67
70
  },
68
71
  "publishConfig": {
69
72
  "access": "public"
@@ -69,7 +69,11 @@ export class EnabledEthWalletConnections {
69
69
  }
70
70
 
71
71
  // eslint-disable-next-line unicorn/no-array-for-each
72
- Object.entries(wallets).forEach(addWallet.bind(this))
72
+ Object.entries(wallets).forEach((wallet) => {
73
+ if (wallet !== undefined) {
74
+ addWallet.bind(this)
75
+ }
76
+ })
73
77
  this.ethWalletsState = newWallets
74
78
  this.emitChange()
75
79
  }
@@ -6,10 +6,12 @@ const sortWallets = (wallets: DiscoveredWallets) => {
6
6
  const result: EIP6963Connector[] = []
7
7
 
8
8
  for (const wallet of Object.values(wallets)) {
9
- if (wallet.allowedAccounts.length > 0)
10
- result.unshift(wallet)
11
- else
12
- result.push(wallet)
9
+ if (wallet) {
10
+ if (wallet.allowedAccounts.length > 0)
11
+ result.unshift(wallet)
12
+ else
13
+ result.push(wallet)
14
+ }
13
15
  }
14
16
  return result
15
17
  }