@xyo-network/react-connected-accounts 7.4.2 → 7.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/components/ConnectedAccountsFlexbox.stories.d.ts +2 -2
- package/dist/browser/components/ConnectedAccountsFlexbox.stories.d.ts.map +1 -1
- package/dist/browser/index.mjs +337 -371
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +19 -19
- package/src/components/wallet/table/cells/State.tsx +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Meta } from '@storybook/react-vite';
|
|
2
2
|
declare const StorybookEntry: Meta;
|
|
3
|
-
declare const Default: import("
|
|
4
|
-
declare const WithIgnoreDialog: import("
|
|
3
|
+
declare const Default: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./ConnectedAccountsFlexbox.tsx").ConnectedAccountsFlexboxProps>;
|
|
4
|
+
declare const WithIgnoreDialog: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").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,
|
|
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,qKAAoB,CAAA;AACjC,QAAA,MAAM,gBAAgB,qKAAoC,CAAA;AAE1D,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAEpC,eAAe,cAAc,CAAA"}
|
package/dist/browser/index.mjs
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/classes/EnabledWallets.ts
|
|
2
5
|
var DEFAULT_LOCAL_STORAGE_KEY = "XYO|EnabledWallets";
|
|
3
6
|
var EnabledEthWalletConnections = class {
|
|
7
|
+
static {
|
|
8
|
+
__name(this, "EnabledEthWalletConnections");
|
|
9
|
+
}
|
|
4
10
|
// control whether or not enabled/disabled preferences are persisted (i.e. in localStorage)
|
|
5
11
|
persistPreferences = true;
|
|
6
12
|
// Map of wallet names and their enabled/disabled state
|
|
@@ -25,17 +31,17 @@ var EnabledEthWalletConnections = class {
|
|
|
25
31
|
this.toggleEnabledWallet(rdns, true);
|
|
26
32
|
}
|
|
27
33
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
* Given a new set of wallets, set their enabled state based off previous preferences
|
|
35
|
+
*/
|
|
30
36
|
resetWallets(wallets) {
|
|
31
37
|
const newWallets = {};
|
|
32
|
-
const addWallet = ([walletName, wallet]) => {
|
|
38
|
+
const addWallet = /* @__PURE__ */ __name(([walletName, wallet]) => {
|
|
33
39
|
newWallets[walletName] = {
|
|
34
40
|
// preserve the existing enabled state
|
|
35
41
|
enabled: walletName in this.enabledWallets ? this.enabledWallets[walletName] : true,
|
|
36
42
|
wallet
|
|
37
43
|
};
|
|
38
|
-
};
|
|
44
|
+
}, "addWallet");
|
|
39
45
|
Object.entries(wallets).forEach((wallet) => {
|
|
40
46
|
if (wallet !== void 0) {
|
|
41
47
|
addWallet.bind(this);
|
|
@@ -45,7 +51,10 @@ var EnabledEthWalletConnections = class {
|
|
|
45
51
|
this.emitChange();
|
|
46
52
|
}
|
|
47
53
|
subscribe(listener) {
|
|
48
|
-
this.listeners = [
|
|
54
|
+
this.listeners = [
|
|
55
|
+
...this.listeners,
|
|
56
|
+
listener
|
|
57
|
+
];
|
|
49
58
|
return () => {
|
|
50
59
|
this.listeners = this.listeners.filter((existingListener) => existingListener !== listener);
|
|
51
60
|
};
|
|
@@ -53,7 +62,9 @@ var EnabledEthWalletConnections = class {
|
|
|
53
62
|
toggleEnabledWallet(rdns, enabled) {
|
|
54
63
|
if (rdns && this.ethWalletsState[rdns]) {
|
|
55
64
|
this.ethWalletsState[rdns].enabled = enabled;
|
|
56
|
-
this.ethWalletsState = {
|
|
65
|
+
this.ethWalletsState = {
|
|
66
|
+
...this.ethWalletsState
|
|
67
|
+
};
|
|
57
68
|
this.emitChange();
|
|
58
69
|
}
|
|
59
70
|
}
|
|
@@ -93,236 +104,221 @@ var EnabledEthWalletConnections = class {
|
|
|
93
104
|
// src/components/ConnectedAccountsFlexbox.tsx
|
|
94
105
|
import { Typography as Typography6, useTheme as useTheme2 } from "@mui/material";
|
|
95
106
|
import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
|
|
107
|
+
import React13 from "react";
|
|
96
108
|
|
|
97
109
|
// src/hooks/useDetectWallets.tsx
|
|
98
110
|
import { useWalletDiscovery } from "@xylabs/react-crypto";
|
|
99
111
|
import { useMemo } from "react";
|
|
100
|
-
var sortWallets = (wallets) => {
|
|
112
|
+
var sortWallets = /* @__PURE__ */ __name((wallets) => {
|
|
101
113
|
const result = [];
|
|
102
114
|
for (const wallet of Object.values(wallets)) {
|
|
103
115
|
if (wallet) {
|
|
104
|
-
if (wallet.allowedAccounts.length > 0)
|
|
105
|
-
|
|
106
|
-
else
|
|
107
|
-
result.push(wallet);
|
|
116
|
+
if (wallet.allowedAccounts.length > 0) result.unshift(wallet);
|
|
117
|
+
else result.push(wallet);
|
|
108
118
|
}
|
|
109
119
|
}
|
|
110
120
|
return result;
|
|
111
|
-
};
|
|
112
|
-
var useDetectedWallets = () => {
|
|
121
|
+
}, "sortWallets");
|
|
122
|
+
var useDetectedWallets = /* @__PURE__ */ __name(() => {
|
|
113
123
|
const wallets = useWalletDiscovery();
|
|
114
|
-
const sortedWallets = useMemo(() => sortWallets(wallets), [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
124
|
+
const sortedWallets = useMemo(() => sortWallets(wallets), [
|
|
125
|
+
wallets
|
|
126
|
+
]);
|
|
127
|
+
const totalConnectedAccounts = useMemo(() => Object.values(sortedWallets).reduce((acc, wallet) => acc + wallet.allowedAccounts.length, 0), [
|
|
128
|
+
sortedWallets
|
|
129
|
+
]);
|
|
130
|
+
return {
|
|
131
|
+
sortedWallets,
|
|
132
|
+
totalConnectedAccounts
|
|
133
|
+
};
|
|
134
|
+
}, "useDetectedWallets");
|
|
121
135
|
|
|
122
136
|
// src/hooks/useEnabledWallets.tsx
|
|
123
137
|
import { useWalletDiscovery as useWalletDiscovery2 } from "@xylabs/react-crypto";
|
|
124
138
|
import { useMemo as useMemo2, useSyncExternalStore } from "react";
|
|
125
139
|
var enabledEthWallets;
|
|
126
|
-
var useEnabledWalletsInner = (enabledWalletsRdns) => {
|
|
140
|
+
var useEnabledWalletsInner = /* @__PURE__ */ __name((enabledWalletsRdns) => {
|
|
127
141
|
const discoveredWallets = useWalletDiscovery2();
|
|
128
142
|
const wallets = useMemo2(() => {
|
|
129
143
|
if (enabledEthWallets === void 0) enabledEthWallets = new EnabledEthWalletConnections();
|
|
130
144
|
enabledEthWallets.resetWallets(discoveredWallets);
|
|
131
145
|
for (const [rdns, enabled] of Object.entries(enabledWalletsRdns ?? {})) enabledEthWallets?.toggleEnabledWallet(rdns, enabled);
|
|
132
146
|
return enabledEthWallets;
|
|
133
|
-
}, [
|
|
147
|
+
}, [
|
|
148
|
+
discoveredWallets,
|
|
149
|
+
enabledWalletsRdns
|
|
150
|
+
]);
|
|
134
151
|
return useSyncExternalStore(wallets.subscribe.bind(wallets), () => wallets.wallets);
|
|
135
|
-
};
|
|
136
|
-
var useEnabledWallets = (enabledWalletsRdns) => {
|
|
152
|
+
}, "useEnabledWalletsInner");
|
|
153
|
+
var useEnabledWallets = /* @__PURE__ */ __name((enabledWalletsRdns) => {
|
|
137
154
|
const wallets = useEnabledWalletsInner(enabledWalletsRdns);
|
|
138
|
-
const enabledWallets = useMemo2(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
);
|
|
155
|
+
const enabledWallets = useMemo2(() => (
|
|
156
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
157
|
+
Object.entries(wallets).reduce((acc, [walletName, wallet]) => {
|
|
158
|
+
if (wallet.enabled) acc[walletName] = wallet;
|
|
159
|
+
return acc;
|
|
160
|
+
}, {})
|
|
161
|
+
), [
|
|
162
|
+
wallets
|
|
163
|
+
]);
|
|
148
164
|
return {
|
|
149
165
|
disableWallet: enabledEthWallets?.disableWallet.bind(enabledEthWallets),
|
|
150
166
|
enableWallet: enabledEthWallets?.enableWallet.bind(enabledEthWallets),
|
|
151
167
|
enabledWallets,
|
|
152
168
|
wallets
|
|
153
169
|
};
|
|
154
|
-
};
|
|
170
|
+
}, "useEnabledWallets");
|
|
155
171
|
|
|
156
172
|
// src/components/wallet/dialogs/connect/CheckboxFormControl.tsx
|
|
157
|
-
import {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
FormLabel
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
-
};
|
|
173
|
+
import { Checkbox, FormControl, FormLabel } from "@mui/material";
|
|
174
|
+
import React from "react";
|
|
175
|
+
var CheckboxFormControl = /* @__PURE__ */ __name(({ onCheckChanged, ...props }) => {
|
|
176
|
+
return /* @__PURE__ */ React.createElement(FormControl, props, /* @__PURE__ */ React.createElement(FormLabel, null, /* @__PURE__ */ React.createElement(Checkbox, {
|
|
177
|
+
onChange: /* @__PURE__ */ __name((_, checked) => onCheckChanged?.(checked), "onChange")
|
|
178
|
+
}), "Do not show this again."));
|
|
179
|
+
}, "CheckboxFormControl");
|
|
169
180
|
|
|
170
181
|
// src/components/wallet/dialogs/connect/Dialog.tsx
|
|
171
|
-
import {
|
|
172
|
-
|
|
173
|
-
Dialog,
|
|
174
|
-
DialogActions,
|
|
175
|
-
DialogContent,
|
|
176
|
-
DialogTitle
|
|
177
|
-
} from "@mui/material";
|
|
182
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
|
|
183
|
+
import React4 from "react";
|
|
178
184
|
|
|
179
185
|
// src/components/wallet/dialogs/connect/LinkedProvidersFlexbox.tsx
|
|
180
186
|
import { SyncAlt } from "@mui/icons-material";
|
|
181
187
|
import { Typography } from "@mui/material";
|
|
182
188
|
import { ConstrainedImage } from "@xylabs/react-crypto";
|
|
183
189
|
import { FlexCol, FlexRow } from "@xylabs/react-flexbox";
|
|
190
|
+
import React2 from "react";
|
|
184
191
|
|
|
185
192
|
// src/img/xyo-color-logo.svg
|
|
186
193
|
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>';
|
|
187
194
|
|
|
188
195
|
// src/components/wallet/dialogs/connect/LinkedProvidersFlexbox.tsx
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
196
|
+
var LinkedProvidersFlexbox = /* @__PURE__ */ __name(({ icon, providerName, ...props }) => {
|
|
197
|
+
return /* @__PURE__ */ React2.createElement(FlexRow, {
|
|
198
|
+
gap: 4,
|
|
199
|
+
justifyContent: "space-evenly",
|
|
200
|
+
...props
|
|
201
|
+
}, /* @__PURE__ */ React2.createElement(FlexCol, {
|
|
202
|
+
gap: 0.5
|
|
203
|
+
}, /* @__PURE__ */ React2.createElement("img", {
|
|
204
|
+
alt: "XYO Logo",
|
|
205
|
+
src: xyo_color_logo_default,
|
|
206
|
+
style: {
|
|
207
|
+
height: "48px"
|
|
208
|
+
}
|
|
209
|
+
}), /* @__PURE__ */ React2.createElement(Typography, {
|
|
210
|
+
variant: "subtitle1"
|
|
211
|
+
}, "XYO App")), /* @__PURE__ */ React2.createElement(SyncAlt, {
|
|
212
|
+
fontSize: "large"
|
|
213
|
+
}), /* @__PURE__ */ React2.createElement(FlexCol, {
|
|
214
|
+
gap: 0.5
|
|
215
|
+
}, /* @__PURE__ */ React2.createElement(ConstrainedImage, {
|
|
216
|
+
constrainedValue: "48px",
|
|
217
|
+
src: icon,
|
|
218
|
+
alt: providerName,
|
|
219
|
+
style: {
|
|
220
|
+
height: "48px",
|
|
221
|
+
maxWidth: "48px"
|
|
222
|
+
}
|
|
223
|
+
}), /* @__PURE__ */ React2.createElement(Typography, {
|
|
224
|
+
variant: "subtitle1"
|
|
225
|
+
}, providerName)));
|
|
226
|
+
}, "LinkedProvidersFlexbox");
|
|
215
227
|
|
|
216
228
|
// src/components/wallet/dialogs/connect/Permissions.tsx
|
|
217
229
|
import { Link, Typography as Typography2 } from "@mui/material";
|
|
218
230
|
import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
|
|
219
|
-
import
|
|
220
|
-
var WalletPermissionsFlexbox = (props) => {
|
|
221
|
-
return /* @__PURE__ */
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
};
|
|
231
|
+
import React3 from "react";
|
|
232
|
+
var WalletPermissionsFlexbox = /* @__PURE__ */ __name((props) => {
|
|
233
|
+
return /* @__PURE__ */ React3.createElement(FlexCol2, {
|
|
234
|
+
gap: 4,
|
|
235
|
+
...props
|
|
236
|
+
}, /* @__PURE__ */ React3.createElement(Typography2, {
|
|
237
|
+
fontWeight: "bold",
|
|
238
|
+
sx: {
|
|
239
|
+
textAlign: "center"
|
|
240
|
+
}
|
|
241
|
+
}, "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, {
|
|
242
|
+
variant: "subtitle1",
|
|
243
|
+
sx: {
|
|
244
|
+
textAlign: "center"
|
|
245
|
+
}
|
|
246
|
+
}, "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, {
|
|
247
|
+
href: "https://cointelegraph.com/innovation-circle/decentralization-and-sovereignty-debunking-our-approach-to-digital-sovereignty",
|
|
248
|
+
sx: {
|
|
249
|
+
fontWeight: "bold"
|
|
250
|
+
},
|
|
251
|
+
target: "_blank"
|
|
252
|
+
}, "here"), "."));
|
|
253
|
+
}, "WalletPermissionsFlexbox");
|
|
243
254
|
|
|
244
255
|
// src/components/wallet/dialogs/connect/Dialog.tsx
|
|
245
|
-
|
|
246
|
-
var ConnectWalletDialog = ({
|
|
247
|
-
activeProvider,
|
|
248
|
-
onIgnoreConnectDialog,
|
|
249
|
-
...props
|
|
250
|
-
}) => {
|
|
256
|
+
var ConnectWalletDialog = /* @__PURE__ */ __name(({ activeProvider, onIgnoreConnectDialog, ...props }) => {
|
|
251
257
|
const { icon, providerName } = activeProvider ?? {};
|
|
252
|
-
const onConnect = async () => {
|
|
258
|
+
const onConnect = /* @__PURE__ */ __name(async () => {
|
|
253
259
|
try {
|
|
254
260
|
await activeProvider?.connectWallet?.();
|
|
255
261
|
props.onClose?.({}, "escapeKeyDown");
|
|
256
262
|
} catch (e) {
|
|
257
263
|
console.warn(`Error connecting to wallet: ${e.message}`);
|
|
258
264
|
}
|
|
259
|
-
};
|
|
260
|
-
return /* @__PURE__ */
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
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
|
-
]
|
|
265
|
+
}, "onConnect");
|
|
266
|
+
return /* @__PURE__ */ React4.createElement(Dialog, {
|
|
267
|
+
slotProps: {
|
|
268
|
+
paper: {
|
|
269
|
+
sx: {
|
|
270
|
+
display: "flex",
|
|
271
|
+
gap: 4
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
...props
|
|
276
|
+
}, /* @__PURE__ */ React4.createElement(DialogTitle, {
|
|
277
|
+
sx: {
|
|
278
|
+
textAlign: "center"
|
|
287
279
|
}
|
|
288
|
-
)
|
|
289
|
-
|
|
280
|
+
}, "XYO Wants To Access The Blockchain on Your Behalf"), /* @__PURE__ */ React4.createElement(DialogContent, {
|
|
281
|
+
sx: {
|
|
282
|
+
display: "flex",
|
|
283
|
+
flexDirection: "column",
|
|
284
|
+
gap: 4
|
|
285
|
+
}
|
|
286
|
+
}, /* @__PURE__ */ React4.createElement(LinkedProvidersFlexbox, {
|
|
287
|
+
icon,
|
|
288
|
+
providerName
|
|
289
|
+
}), /* @__PURE__ */ React4.createElement(WalletPermissionsFlexbox, null), /* @__PURE__ */ React4.createElement(CheckboxFormControl, {
|
|
290
|
+
onCheckChanged: onIgnoreConnectDialog
|
|
291
|
+
})), /* @__PURE__ */ React4.createElement(DialogActions, null, /* @__PURE__ */ React4.createElement(Button, {
|
|
292
|
+
variant: "outlined",
|
|
293
|
+
onClick: /* @__PURE__ */ __name(() => props.onClose?.({}, "escapeKeyDown"), "onClick")
|
|
294
|
+
}, "Close"), /* @__PURE__ */ React4.createElement(Button, {
|
|
295
|
+
variant: "contained",
|
|
296
|
+
onClick: onConnect
|
|
297
|
+
}, "Connect")));
|
|
298
|
+
}, "ConnectWalletDialog");
|
|
290
299
|
|
|
291
300
|
// src/components/wallet/dialogs/revoke/Dialog.tsx
|
|
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";
|
|
301
|
+
import { Button as Button2, Dialog as Dialog2, DialogActions as DialogActions2, DialogContent as DialogContent2, DialogTitle as DialogTitle2, Typography as Typography3 } from "@mui/material";
|
|
300
302
|
import { ConstrainedImage as ConstrainedImage2 } from "@xylabs/react-crypto";
|
|
301
303
|
import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
302
|
-
import
|
|
303
|
-
var RevokeWalletConnectionDialog = ({ activeProvider, ...props }) => {
|
|
304
|
-
return /* @__PURE__ */
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
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
|
-
};
|
|
304
|
+
import React5 from "react";
|
|
305
|
+
var RevokeWalletConnectionDialog = /* @__PURE__ */ __name(({ activeProvider, ...props }) => {
|
|
306
|
+
return /* @__PURE__ */ React5.createElement(Dialog2, props, /* @__PURE__ */ React5.createElement(FlexRow2, {
|
|
307
|
+
gap: 2,
|
|
308
|
+
justifyContent: "start",
|
|
309
|
+
pl: 2
|
|
310
|
+
}, /* @__PURE__ */ React5.createElement(ConstrainedImage2, {
|
|
311
|
+
src: activeProvider?.icon,
|
|
312
|
+
constrainedValue: "24px"
|
|
313
|
+
}), /* @__PURE__ */ React5.createElement(DialogTitle2, {
|
|
314
|
+
sx: {
|
|
315
|
+
pl: 0
|
|
316
|
+
}
|
|
317
|
+
}, "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, {
|
|
318
|
+
variant: "contained",
|
|
319
|
+
onClick: /* @__PURE__ */ __name(() => props.onClose?.({}, "escapeKeyDown"), "onClick")
|
|
320
|
+
}, "Close")));
|
|
321
|
+
}, "RevokeWalletConnectionDialog");
|
|
326
322
|
|
|
327
323
|
// src/components/wallet/lib/TableHeadData.ts
|
|
328
324
|
var WalletsTableHeadCells = [
|
|
@@ -364,101 +360,89 @@ var WalletsTableHeadCells = [
|
|
|
364
360
|
];
|
|
365
361
|
|
|
366
362
|
// src/components/wallet/table/cells/Accounts.tsx
|
|
367
|
-
import {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
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
|
-
};
|
|
363
|
+
import { TableCell, Tooltip, Typography as Typography4 } from "@mui/material";
|
|
364
|
+
import React6 from "react";
|
|
365
|
+
var ConnectedWalletsAccountsTableCell = /* @__PURE__ */ __name(({ additionalAccounts, currentAccount, totalAccounts, tableCellProps }) => {
|
|
366
|
+
return /* @__PURE__ */ React6.createElement(TableCell, tableCellProps, /* @__PURE__ */ React6.createElement(Tooltip, {
|
|
367
|
+
sx: {
|
|
368
|
+
cursor: totalAccounts > 0 ? "pointer" : "auto"
|
|
369
|
+
},
|
|
370
|
+
title: [
|
|
371
|
+
...currentAccount ?? [],
|
|
372
|
+
...additionalAccounts ?? []
|
|
373
|
+
].map((address, index) => /* @__PURE__ */ React6.createElement("p", {
|
|
374
|
+
key: index
|
|
375
|
+
}, address))
|
|
376
|
+
}, /* @__PURE__ */ React6.createElement(Typography4, null, totalAccounts)));
|
|
377
|
+
}, "ConnectedWalletsAccountsTableCell");
|
|
388
378
|
|
|
389
379
|
// src/components/wallet/table/cells/Actions.tsx
|
|
390
380
|
import { Check, InfoOutlined } from "@mui/icons-material";
|
|
391
|
-
import {
|
|
392
|
-
Button as Button3,
|
|
393
|
-
IconButton,
|
|
394
|
-
TableCell as TableCell2,
|
|
395
|
-
Typography as Typography5
|
|
396
|
-
} from "@mui/material";
|
|
381
|
+
import { Button as Button3, IconButton, TableCell as TableCell2, Typography as Typography5 } from "@mui/material";
|
|
397
382
|
import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
|
398
|
-
import
|
|
399
|
-
var ConnectedWalletsActionsTableCell = ({
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
383
|
+
import React7 from "react";
|
|
384
|
+
var ConnectedWalletsActionsTableCell = /* @__PURE__ */ __name(({ connected, onConnect, onRevoke, tableCellProps }) => {
|
|
385
|
+
return /* @__PURE__ */ React7.createElement(TableCell2, tableCellProps, /* @__PURE__ */ React7.createElement(FlexRow3, {
|
|
386
|
+
gap: 2,
|
|
387
|
+
justifyContent: "start"
|
|
388
|
+
}, connected ? /* @__PURE__ */ React7.createElement(Typography5, {
|
|
389
|
+
sx: {
|
|
390
|
+
display: "inline-flex",
|
|
391
|
+
gap: 0.5
|
|
392
|
+
}
|
|
393
|
+
}, /* @__PURE__ */ React7.createElement(Check, null), "Connected") : /* @__PURE__ */ React7.createElement(Button3, {
|
|
394
|
+
variant: "contained",
|
|
395
|
+
onClick: onConnect
|
|
396
|
+
}, "Connect"), connected ? /* @__PURE__ */ React7.createElement(IconButton, {
|
|
397
|
+
onClick: onRevoke
|
|
398
|
+
}, /* @__PURE__ */ React7.createElement(InfoOutlined, null)) : null));
|
|
399
|
+
}, "ConnectedWalletsActionsTableCell");
|
|
413
400
|
|
|
414
401
|
// src/components/wallet/table/cells/ChainName.tsx
|
|
415
402
|
import { TableCell as TableCell3 } from "@mui/material";
|
|
416
|
-
import
|
|
417
|
-
var ConnectedWalletsChainNameTableCell = ({ chainName, tableCellProps }) => {
|
|
418
|
-
return /* @__PURE__ */
|
|
419
|
-
};
|
|
403
|
+
import React8 from "react";
|
|
404
|
+
var ConnectedWalletsChainNameTableCell = /* @__PURE__ */ __name(({ chainName, tableCellProps }) => {
|
|
405
|
+
return /* @__PURE__ */ React8.createElement(TableCell3, tableCellProps, chainName);
|
|
406
|
+
}, "ConnectedWalletsChainNameTableCell");
|
|
420
407
|
|
|
421
408
|
// src/components/wallet/table/cells/State.tsx
|
|
422
409
|
import { Switch, TableCell as TableCell4 } from "@mui/material";
|
|
423
|
-
import { isDefined } from "@xylabs/
|
|
424
|
-
import { useMemo as useMemo3 } from "react";
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
const {
|
|
432
|
-
disableWallet,
|
|
433
|
-
enableWallet,
|
|
434
|
-
wallets
|
|
435
|
-
} = useEnabledWallets();
|
|
436
|
-
const enabled = useMemo3(() => isDefined(walletRdns) ? wallets[walletRdns]?.enabled : false, [wallets, walletRdns]);
|
|
437
|
-
const handleClick = (event) => {
|
|
410
|
+
import { isDefined } from "@xylabs/sdk-js";
|
|
411
|
+
import React9, { useMemo as useMemo3 } from "react";
|
|
412
|
+
var ConnectedWalletState = /* @__PURE__ */ __name(({ connected, walletRdns, tableCellProps }) => {
|
|
413
|
+
const { disableWallet, enableWallet, wallets } = useEnabledWallets();
|
|
414
|
+
const enabled = useMemo3(() => isDefined(walletRdns) ? wallets[walletRdns]?.enabled : false, [
|
|
415
|
+
wallets,
|
|
416
|
+
walletRdns
|
|
417
|
+
]);
|
|
418
|
+
const handleClick = /* @__PURE__ */ __name((event) => {
|
|
438
419
|
const checked = event.target?.checked;
|
|
439
420
|
if (isDefined(walletRdns)) {
|
|
440
421
|
checked ? enableWallet?.(walletRdns) : disableWallet?.(walletRdns);
|
|
441
422
|
}
|
|
442
|
-
};
|
|
443
|
-
return /* @__PURE__ */
|
|
444
|
-
|
|
423
|
+
}, "handleClick");
|
|
424
|
+
return /* @__PURE__ */ React9.createElement(TableCell4, tableCellProps, /* @__PURE__ */ React9.createElement(Switch, {
|
|
425
|
+
disabled: !connected,
|
|
426
|
+
checked: connected && enabled,
|
|
427
|
+
onChange: handleClick
|
|
428
|
+
}));
|
|
429
|
+
}, "ConnectedWalletState");
|
|
445
430
|
|
|
446
431
|
// src/components/wallet/table/cells/Wallet.tsx
|
|
447
432
|
import { TableCell as TableCell5, useTheme } from "@mui/material";
|
|
448
433
|
import { ConstrainedImage as ConstrainedImage3 } from "@xylabs/react-crypto";
|
|
449
434
|
import { FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
|
|
450
|
-
import
|
|
451
|
-
var ConnectedWalletsWalletTableCell = ({
|
|
452
|
-
icon,
|
|
453
|
-
walletName,
|
|
454
|
-
tableCellProps
|
|
455
|
-
}) => {
|
|
435
|
+
import React10 from "react";
|
|
436
|
+
var ConnectedWalletsWalletTableCell = /* @__PURE__ */ __name(({ icon, walletName, tableCellProps }) => {
|
|
456
437
|
const theme = useTheme();
|
|
457
|
-
return /* @__PURE__ */
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
438
|
+
return /* @__PURE__ */ React10.createElement(TableCell5, tableCellProps, /* @__PURE__ */ React10.createElement(FlexRow4, {
|
|
439
|
+
gap: 2,
|
|
440
|
+
justifyContent: "start"
|
|
441
|
+
}, /* @__PURE__ */ React10.createElement(ConstrainedImage3, {
|
|
442
|
+
constrainedValue: theme.spacing(4),
|
|
443
|
+
src: icon
|
|
444
|
+
}), walletName));
|
|
445
|
+
}, "ConnectedWalletsWalletTableCell");
|
|
462
446
|
|
|
463
447
|
// src/components/wallet/table/cells/Cells.tsx
|
|
464
448
|
var ConnectedWalletTableCells = [
|
|
@@ -470,163 +454,145 @@ var ConnectedWalletTableCells = [
|
|
|
470
454
|
];
|
|
471
455
|
|
|
472
456
|
// src/components/wallet/table/ConnectedWalletsTable.tsx
|
|
473
|
-
import {
|
|
474
|
-
|
|
475
|
-
TableBody,
|
|
476
|
-
TableCell as TableCell6,
|
|
477
|
-
TableHead,
|
|
478
|
-
TableRow as TableRow2
|
|
479
|
-
} from "@mui/material";
|
|
480
|
-
import { useState as useState2 } from "react";
|
|
457
|
+
import { Table, TableBody, TableCell as TableCell6, TableHead, TableRow as TableRow2 } from "@mui/material";
|
|
458
|
+
import React12, { useState as useState2 } from "react";
|
|
481
459
|
|
|
482
460
|
// src/components/wallet/table/ConnectedWalletsTableRow.tsx
|
|
483
461
|
import { TableRow } from "@mui/material";
|
|
484
462
|
import { useEthWallet } from "@xylabs/react-crypto";
|
|
485
|
-
import { useCallback, useMemo as useMemo4 } from "react";
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
wallet,
|
|
492
|
-
...props
|
|
493
|
-
}) => {
|
|
494
|
-
const {
|
|
495
|
-
currentAccount: currentAccountFromWallet,
|
|
496
|
-
additionalAccounts,
|
|
497
|
-
chainName,
|
|
498
|
-
connectWallet,
|
|
499
|
-
providerInfo
|
|
500
|
-
} = useEthWallet(wallet);
|
|
501
|
-
const currentAccount = currentAccountFromWallet?.toString() ? [currentAccountFromWallet.toString()] : [];
|
|
463
|
+
import React11, { useCallback, useMemo as useMemo4 } from "react";
|
|
464
|
+
var WalletConnectionsTableRow = /* @__PURE__ */ __name(({ ignoreConnectDialog, onConnectClick, onRevoke, wallet, ...props }) => {
|
|
465
|
+
const { currentAccount: currentAccountFromWallet, additionalAccounts, chainName, connectWallet, providerInfo } = useEthWallet(wallet);
|
|
466
|
+
const currentAccount = currentAccountFromWallet?.toString() ? [
|
|
467
|
+
currentAccountFromWallet.toString()
|
|
468
|
+
] : [];
|
|
502
469
|
const totalAccounts = (additionalAccounts?.length ?? 0) + (currentAccount?.length ?? 0);
|
|
503
470
|
const connected = !!currentAccount?.length;
|
|
504
|
-
const {
|
|
505
|
-
icon,
|
|
506
|
-
name,
|
|
507
|
-
rdns
|
|
508
|
-
} = useMemo4(() => providerInfo ?? {
|
|
471
|
+
const { icon, name, rdns } = useMemo4(() => providerInfo ?? {
|
|
509
472
|
icon: void 0,
|
|
510
473
|
name: void 0,
|
|
511
474
|
rdns: void 0
|
|
512
|
-
}, [
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
475
|
+
}, [
|
|
476
|
+
providerInfo
|
|
477
|
+
]);
|
|
478
|
+
const activeProvider = useMemo4(() => ({
|
|
479
|
+
connectWallet,
|
|
480
|
+
icon,
|
|
481
|
+
providerName: name
|
|
482
|
+
}), [
|
|
483
|
+
connectWallet,
|
|
484
|
+
icon,
|
|
485
|
+
name
|
|
486
|
+
]);
|
|
521
487
|
const onRevokeLocal = useCallback(() => {
|
|
522
488
|
onRevoke?.(activeProvider);
|
|
523
|
-
}, [
|
|
489
|
+
}, [
|
|
490
|
+
activeProvider,
|
|
491
|
+
onRevoke
|
|
492
|
+
]);
|
|
524
493
|
const onConnectLocal = useCallback(async () => {
|
|
525
494
|
if (ignoreConnectDialog) {
|
|
526
495
|
await connectWallet?.();
|
|
527
496
|
} else {
|
|
528
497
|
onConnectClick?.(activeProvider);
|
|
529
498
|
}
|
|
530
|
-
}, [
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
499
|
+
}, [
|
|
500
|
+
activeProvider,
|
|
501
|
+
connectWallet,
|
|
502
|
+
ignoreConnectDialog,
|
|
503
|
+
onConnectClick
|
|
504
|
+
]);
|
|
505
|
+
return /* @__PURE__ */ React11.createElement(TableRow, props, Object.values(ConnectedWalletTableCells).map((Cell, index) => /* @__PURE__ */ React11.createElement(Cell, {
|
|
506
|
+
key: index,
|
|
507
|
+
additionalAccounts,
|
|
508
|
+
chainName,
|
|
509
|
+
connected,
|
|
510
|
+
currentAccount,
|
|
511
|
+
icon,
|
|
512
|
+
onConnect: onConnectLocal,
|
|
513
|
+
onRevoke: onRevokeLocal,
|
|
514
|
+
totalAccounts,
|
|
515
|
+
walletName: name,
|
|
516
|
+
walletRdns: rdns
|
|
517
|
+
})));
|
|
518
|
+
}, "WalletConnectionsTableRow");
|
|
548
519
|
|
|
549
520
|
// src/components/wallet/table/hooks/useActiveProviderDialogState.tsx
|
|
550
521
|
import { useState } from "react";
|
|
551
|
-
var useActiveProviderDialogState = (setActiveProvider) => {
|
|
522
|
+
var useActiveProviderDialogState = /* @__PURE__ */ __name((setActiveProvider) => {
|
|
552
523
|
const [show, setShow] = useState(false);
|
|
553
|
-
const onSetActiveProvider = (activeProvider) => {
|
|
524
|
+
const onSetActiveProvider = /* @__PURE__ */ __name((activeProvider) => {
|
|
554
525
|
setShow(true);
|
|
555
526
|
setActiveProvider(activeProvider);
|
|
556
|
-
};
|
|
557
|
-
const onClose = () => {
|
|
527
|
+
}, "onSetActiveProvider");
|
|
528
|
+
const onClose = /* @__PURE__ */ __name(() => {
|
|
558
529
|
setShow(false);
|
|
559
530
|
setActiveProvider({});
|
|
560
|
-
};
|
|
561
|
-
return [
|
|
562
|
-
|
|
531
|
+
}, "onClose");
|
|
532
|
+
return [
|
|
533
|
+
show,
|
|
534
|
+
onSetActiveProvider,
|
|
535
|
+
onClose
|
|
536
|
+
];
|
|
537
|
+
}, "useActiveProviderDialogState");
|
|
563
538
|
|
|
564
539
|
// src/components/wallet/table/ConnectedWalletsTable.tsx
|
|
565
|
-
|
|
566
|
-
var ConnectedWalletsTable = ({
|
|
567
|
-
ignoreConnectDialog,
|
|
568
|
-
onIgnoreConnectDialog,
|
|
569
|
-
wallets,
|
|
570
|
-
...props
|
|
571
|
-
}) => {
|
|
540
|
+
var ConnectedWalletsTable = /* @__PURE__ */ __name(({ ignoreConnectDialog, onIgnoreConnectDialog, wallets, ...props }) => {
|
|
572
541
|
const [activeProvider, setActiveProvider] = useState2();
|
|
573
542
|
const [showConnect, onSetActiveProviderConnect, onConnectClose] = useActiveProviderDialogState(setActiveProvider);
|
|
574
543
|
const [showRevoke, onSetActiveProviderRevoke, onRevokeClose] = useActiveProviderDialogState(setActiveProvider);
|
|
575
|
-
return /* @__PURE__ */
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
ConnectWalletDialog,
|
|
598
|
-
{
|
|
599
|
-
activeProvider,
|
|
600
|
-
onClose: onConnectClose,
|
|
601
|
-
open: showConnect,
|
|
602
|
-
onIgnoreConnectDialog
|
|
603
|
-
}
|
|
604
|
-
)
|
|
605
|
-
] });
|
|
606
|
-
};
|
|
544
|
+
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, {
|
|
545
|
+
align,
|
|
546
|
+
key: id,
|
|
547
|
+
padding: disablePadding ? "none" : "normal",
|
|
548
|
+
width: width ?? "auto"
|
|
549
|
+
}, label)))), /* @__PURE__ */ React12.createElement(TableBody, null, (wallets ?? []).map((wallet) => /* @__PURE__ */ React12.createElement(WalletConnectionsTableRow, {
|
|
550
|
+
ignoreConnectDialog,
|
|
551
|
+
key: wallet.providerInfo?.rdns,
|
|
552
|
+
onConnectClick: onSetActiveProviderConnect,
|
|
553
|
+
onRevoke: onSetActiveProviderRevoke,
|
|
554
|
+
wallet
|
|
555
|
+
})))), /* @__PURE__ */ React12.createElement(RevokeWalletConnectionDialog, {
|
|
556
|
+
open: showRevoke,
|
|
557
|
+
onClose: onRevokeClose,
|
|
558
|
+
activeProvider
|
|
559
|
+
}), /* @__PURE__ */ React12.createElement(ConnectWalletDialog, {
|
|
560
|
+
activeProvider,
|
|
561
|
+
onClose: onConnectClose,
|
|
562
|
+
open: showConnect,
|
|
563
|
+
onIgnoreConnectDialog
|
|
564
|
+
}));
|
|
565
|
+
}, "ConnectedWalletsTable");
|
|
607
566
|
|
|
608
567
|
// src/components/ConnectedAccountsFlexbox.tsx
|
|
609
|
-
|
|
610
|
-
var ConnectedAccountsFlexbox = ({
|
|
611
|
-
ref,
|
|
612
|
-
ignoreConnectDialog,
|
|
613
|
-
onIgnoreConnectDialog,
|
|
614
|
-
...props
|
|
615
|
-
}) => {
|
|
568
|
+
var ConnectedAccountsFlexbox = /* @__PURE__ */ __name(({ ref, ignoreConnectDialog, onIgnoreConnectDialog, ...props }) => {
|
|
616
569
|
const theme = useTheme2();
|
|
617
570
|
const { totalConnectedAccounts, sortedWallets } = useDetectedWallets();
|
|
618
|
-
return /* @__PURE__ */
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
571
|
+
return /* @__PURE__ */ React13.createElement(FlexCol3, {
|
|
572
|
+
alignItems: "stretch",
|
|
573
|
+
justifyContent: "start",
|
|
574
|
+
gap: 2,
|
|
575
|
+
ref,
|
|
576
|
+
...props
|
|
577
|
+
}, /* @__PURE__ */ React13.createElement(FlexCol3, {
|
|
578
|
+
alignItems: "start"
|
|
579
|
+
}, /* @__PURE__ */ React13.createElement(Typography6, {
|
|
580
|
+
variant: "h2",
|
|
581
|
+
sx: {
|
|
582
|
+
mb: 0.5
|
|
583
|
+
}
|
|
584
|
+
}, "Detected Web3 Wallets"), totalConnectedAccounts ? /* @__PURE__ */ React13.createElement(Typography6, {
|
|
585
|
+
variant: "subtitle1",
|
|
586
|
+
color: theme.vars.palette.secondary.main,
|
|
587
|
+
sx: {
|
|
588
|
+
opacity: 0.5
|
|
589
|
+
}
|
|
590
|
+
}, "Total Connected Accounts:", " ", totalConnectedAccounts) : null), /* @__PURE__ */ React13.createElement(ConnectedWalletsTable, {
|
|
591
|
+
wallets: sortedWallets,
|
|
592
|
+
ignoreConnectDialog,
|
|
593
|
+
onIgnoreConnectDialog
|
|
594
|
+
}));
|
|
595
|
+
}, "ConnectedAccountsFlexbox");
|
|
630
596
|
ConnectedAccountsFlexbox.displayName = "ConnectedAccountsFlexbox";
|
|
631
597
|
export {
|
|
632
598
|
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((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's settings at anytime. View\n more on XYO'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's browser extension. Wallets grant access to specific domains please\n consult\n {' '}\n {activeProvider?.providerName}\n '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 { isDefined } from '@xylabs/typeof'\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(() => (isDefined(walletRdns) ? wallets[walletRdns]?.enabled : false), [wallets, walletRdns])\n\n const handleClick = (event: ChangeEvent<HTMLInputElement>) => {\n const checked = event.target?.checked\n if (isDefined(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;A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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"]}
|
|
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's settings at anytime. View\n more on XYO'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's browser extension. Wallets grant access to specific domains please\n consult\n {' '}\n {activeProvider?.providerName}\n '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 { isDefined } from '@xylabs/sdk-js'\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(() => (isDefined(walletRdns) ? wallets[walletRdns]?.enabled : false), [wallets, walletRdns])\n\n const handleClick = (event: ChangeEvent<HTMLInputElement>) => {\n const checked = event.target?.checked\n if (isDefined(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,QAAQ,CAACJ,WAAAA;AAC/B,UAAIA,WAAWK,QAAW;AACxBP,kBAAUQ,KAAK,IAAI;MACrB;IACF,CAAA;AACA,SAAKnB,kBAAkBU;AACvB,SAAKU,WAAU;EACjB;EAEAC,UAAUC,UAA0B;AAClC,SAAKrB,YAAY;SAAI,KA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;IAAQC,KAAK;IAAGb;IAAW,GAAGG;KACzE,gBAAAM,QAAA,cAACC,UAAAA;IAAQC,YAAW;KAClB,gBAAAF,QAAA,cAACK,aAAAA;IAAWC,SAAQ;IAAKC,IAAI;MAAEC,IAAI;IAAI;KAAG,uBAAA,GAGzCX,yBAEK,gBAAAG,QAAA,cAACK,aAAAA;IAAWC,SAAQ;IAAYG,OAAOd,MAAMe,KAAKC,QAAQC,UAAUC;IAAMN,IAAI;MAAEO,SAAS;IAAI;KAAG,6BAE7F,KACAjB,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","undefined","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","isDefined","React","useMemo","ConnectedWalletState","connected","walletRdns","tableCellProps","disableWallet","enableWallet","wallets","useEnabledWallets","enabled","useMemo","isDefined","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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-connected-accounts",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0",
|
|
4
4
|
"description": "Common React library for all XYO projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xyo",
|
|
@@ -43,26 +43,26 @@
|
|
|
43
43
|
"src"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@xylabs/react-crypto": "~7.1.
|
|
47
|
-
"@xylabs/react-flexbox": "~7.1.
|
|
48
|
-
"@xylabs/typeof": "~5.0.
|
|
49
|
-
"@xyo-network/react-table": "
|
|
46
|
+
"@xylabs/react-crypto": "~7.1.9",
|
|
47
|
+
"@xylabs/react-flexbox": "~7.1.9",
|
|
48
|
+
"@xylabs/typeof": "~5.0.64",
|
|
49
|
+
"@xyo-network/react-table": "7.5.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@mui/icons-material": "~7.3.
|
|
53
|
-
"@mui/material": "~7.3.
|
|
54
|
-
"@storybook/react-vite": "~10.1
|
|
55
|
-
"@types/react": "^19.2.
|
|
56
|
-
"@xylabs/ts-scripts-yarn3": "~7.2
|
|
57
|
-
"@xylabs/tsconfig": "~7.2
|
|
58
|
-
"@xylabs/tsconfig-dom": "~7.2
|
|
59
|
-
"@xylabs/tsconfig-react": "~7.2
|
|
60
|
-
"react": "^19.2.
|
|
61
|
-
"react-dom": "^19.2.
|
|
62
|
-
"react-router-dom": "^7.
|
|
63
|
-
"storybook": "~10.1
|
|
52
|
+
"@mui/icons-material": "~7.3.7",
|
|
53
|
+
"@mui/material": "~7.3.7",
|
|
54
|
+
"@storybook/react-vite": "~10.2.1",
|
|
55
|
+
"@types/react": "^19.2.10",
|
|
56
|
+
"@xylabs/ts-scripts-yarn3": "~7.3.2",
|
|
57
|
+
"@xylabs/tsconfig": "~7.3.2",
|
|
58
|
+
"@xylabs/tsconfig-dom": "~7.3.2",
|
|
59
|
+
"@xylabs/tsconfig-react": "~7.3.2",
|
|
60
|
+
"react": "^19.2.4",
|
|
61
|
+
"react-dom": "^19.2.4",
|
|
62
|
+
"react-router-dom": "^7.13.0",
|
|
63
|
+
"storybook": "~10.2.1",
|
|
64
64
|
"typescript": "^5.9.3",
|
|
65
|
-
"vite": "~7.
|
|
65
|
+
"vite": "~7.3.1"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@mui/icons-material": ">=6 <8",
|
|
@@ -75,4 +75,4 @@
|
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
77
|
"docs": "dist/docs.json"
|
|
78
|
-
}
|
|
78
|
+
}
|