@xyo-network/react-wallet 7.5.8 → 7.5.12

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.
Files changed (63) hide show
  1. package/dist/browser/components/WalletAccountDetails/WalletAccountDetails.d.ts.map +1 -1
  2. package/dist/browser/contexts/SeedPhrase/Provider.d.ts.map +1 -1
  3. package/dist/browser/index.mjs +656 -566
  4. package/dist/browser/index.mjs.map +1 -1
  5. package/package.json +112 -46
  6. package/src/components/MaxAccounts/MaxAccountsTableRow.tsx +0 -75
  7. package/src/components/MaxAccounts/OutOfBoundsSnackBar.tsx +0 -41
  8. package/src/components/MaxAccounts/index.ts +0 -1
  9. package/src/components/SeedPhrase/DefaultSeedPhrase.stories.tsx +0 -27
  10. package/src/components/SeedPhrase/DefaultSeedPhrase.tsx +0 -52
  11. package/src/components/SeedPhrase/_shared/SeedPhraseIconButton.tsx +0 -53
  12. package/src/components/SeedPhrase/_shared/index.ts +0 -1
  13. package/src/components/SeedPhrase/dialog/SeedPhraseDialog.stories.tsx +0 -33
  14. package/src/components/SeedPhrase/dialog/SeedPhraseDialog.tsx +0 -84
  15. package/src/components/SeedPhrase/dialog/components/DialogActionButtons.tsx +0 -33
  16. package/src/components/SeedPhrase/dialog/components/OverwriteWarning.tsx +0 -28
  17. package/src/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.tsx +0 -45
  18. package/src/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.stories.tsx +0 -29
  19. package/src/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.tsx +0 -38
  20. package/src/components/SeedPhrase/dialog/components/fields/SavedPhraseTextField.tsx +0 -113
  21. package/src/components/SeedPhrase/dialog/components/fields/index.ts +0 -4
  22. package/src/components/SeedPhrase/dialog/components/fields/validation-messages/InvalidPhrase.tsx +0 -14
  23. package/src/components/SeedPhrase/dialog/components/fields/validation-messages/PhraseHeaderBox.tsx +0 -50
  24. package/src/components/SeedPhrase/dialog/components/fields/validation-messages/colorParser.ts +0 -14
  25. package/src/components/SeedPhrase/dialog/components/fields/validation-messages/index.ts +0 -3
  26. package/src/components/SeedPhrase/dialog/components/index.ts +0 -3
  27. package/src/components/SeedPhrase/dialog/index.ts +0 -2
  28. package/src/components/SeedPhrase/index.ts +0 -4
  29. package/src/components/SeedPhrase/settings/SeedPhraseTableRow.stories.tsx +0 -31
  30. package/src/components/SeedPhrase/settings/SeedPhraseTableRow.tsx +0 -48
  31. package/src/components/SeedPhrase/settings/index.ts +0 -1
  32. package/src/components/WalletAccountDetails/WalletAccountDetails.stories.tsx +0 -27
  33. package/src/components/WalletAccountDetails/WalletAccountDetails.tsx +0 -37
  34. package/src/components/WalletAccountDetails/WalletAccountDetailsWithProvider.stories.tsx +0 -33
  35. package/src/components/WalletAccountDetails/index.ts +0 -1
  36. package/src/components/WalletAccountSelect/RenderedMenuItem.tsx +0 -52
  37. package/src/components/WalletAccountSelect/Select.tsx +0 -84
  38. package/src/components/WalletAccountSelect/SelectBar.tsx +0 -44
  39. package/src/components/WalletAccountSelect/WalletAccountSelect.stories.tsx +0 -45
  40. package/src/components/WalletAccountSelect/WalletAccountSelectBar.stories.tsx +0 -61
  41. package/src/components/WalletAccountSelect/WalletAccountSelectWithProvider.stories.tsx +0 -43
  42. package/src/components/WalletAccountSelect/WalletInfo.tsx +0 -121
  43. package/src/components/WalletAccountSelect/index.ts +0 -2
  44. package/src/components/WalletAccountSelect/stories/WalletProviderDecorator.tsx +0 -31
  45. package/src/components/WalletAccountSelect/stories/index.ts +0 -1
  46. package/src/components/index.ts +0 -4
  47. package/src/contexts/SeedPhrase/Context.ts +0 -6
  48. package/src/contexts/SeedPhrase/Provider.tsx +0 -103
  49. package/src/contexts/SeedPhrase/State.ts +0 -19
  50. package/src/contexts/SeedPhrase/index.ts +0 -4
  51. package/src/contexts/SeedPhrase/use.ts +0 -6
  52. package/src/contexts/Wallet/Context.ts +0 -6
  53. package/src/contexts/Wallet/Provider.tsx +0 -46
  54. package/src/contexts/Wallet/State.ts +0 -15
  55. package/src/contexts/Wallet/index.ts +0 -4
  56. package/src/contexts/Wallet/use.ts +0 -37
  57. package/src/contexts/index.ts +0 -2
  58. package/src/hooks/index.ts +0 -4
  59. package/src/hooks/useAccount.ts +0 -68
  60. package/src/hooks/useWallet.ts +0 -46
  61. package/src/hooks/useWallets.ts +0 -22
  62. package/src/hooks/useWrapperAccount.ts +0 -36
  63. package/src/index.ts +0 -3
@@ -1,34 +1,55 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/components/MaxAccounts/MaxAccountsTableRow.tsx
5
- import { ButtonGroup, TableCell, TableRow, Typography } from "@mui/material";
2
+ import {
3
+ ButtonGroup,
4
+ TableCell,
5
+ TableRow,
6
+ Typography
7
+ } from "@mui/material";
6
8
  import { ButtonEx } from "@xylabs/react-button";
7
- import React2, { useState } from "react";
9
+ import { useState } from "react";
8
10
 
9
11
  // src/components/MaxAccounts/OutOfBoundsSnackBar.tsx
10
- import { Alert, AlertTitle, Snackbar } from "@mui/material";
11
- import React from "react";
12
- var OutOfBoundsSnackBar = /* @__PURE__ */ __name(({ activeAccountIndex, desiredMaximumAccounts, setShowSnackBar, showSnackBar }) => {
13
- return /* @__PURE__ */ React.createElement(Snackbar, {
14
- anchorOrigin: {
15
- horizontal: "center",
16
- vertical: "top"
17
- },
18
- autoHideDuration: 5e3,
19
- onClose: /* @__PURE__ */ __name(() => setShowSnackBar?.(false), "onClose"),
20
- open: showSnackBar
21
- }, /* @__PURE__ */ React.createElement(Alert, {
22
- severity: "error",
23
- onClose: /* @__PURE__ */ __name(() => setShowSnackBar?.(false), "onClose")
24
- }, /* @__PURE__ */ React.createElement(AlertTitle, null, "Maximum Accounts Error"), "Your currently selected account number (", activeAccountIndex === void 0 ? "" : activeAccountIndex + 1, ") cannot be greater than the desired Maximum Accounts (", desiredMaximumAccounts, ")."));
25
- }, "OutOfBoundsSnackBar");
12
+ import {
13
+ Alert,
14
+ AlertTitle,
15
+ Snackbar
16
+ } from "@mui/material";
17
+ import { jsx, jsxs } from "react/jsx-runtime";
18
+ var OutOfBoundsSnackBar = ({
19
+ activeAccountIndex,
20
+ desiredMaximumAccounts,
21
+ setShowSnackBar,
22
+ showSnackBar
23
+ }) => {
24
+ return /* @__PURE__ */ jsx(
25
+ Snackbar,
26
+ {
27
+ anchorOrigin: { horizontal: "center", vertical: "top" },
28
+ autoHideDuration: 5e3,
29
+ onClose: () => setShowSnackBar?.(false),
30
+ open: showSnackBar,
31
+ children: /* @__PURE__ */ jsxs(Alert, { severity: "error", onClose: () => setShowSnackBar?.(false), children: [
32
+ /* @__PURE__ */ jsx(AlertTitle, { children: "Maximum Accounts Error" }),
33
+ "Your currently selected account number (",
34
+ activeAccountIndex === void 0 ? "" : activeAccountIndex + 1,
35
+ ") cannot be greater than the desired Maximum Accounts (",
36
+ desiredMaximumAccounts,
37
+ ")."
38
+ ] })
39
+ }
40
+ );
41
+ };
26
42
 
27
43
  // src/components/MaxAccounts/MaxAccountsTableRow.tsx
28
- var MaxAccountsTableRow = /* @__PURE__ */ __name(({ activeAccountIndex, changeMaxAccounts, maxAccounts }) => {
44
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
45
+ var MaxAccountsTableRow = ({
46
+ activeAccountIndex,
47
+ changeMaxAccounts,
48
+ maxAccounts
49
+ }) => {
29
50
  const [desiredMaximumAccounts, setDesiredMaximumAccounts] = useState();
30
51
  const [showSnackBar, setShowSnackBar] = useState(false);
31
- const handleChangeMaxAccounts = /* @__PURE__ */ __name((change) => {
52
+ const handleChangeMaxAccounts = (change) => {
32
53
  if (maxAccounts !== void 0 && activeAccountIndex !== void 0) {
33
54
  switch (change) {
34
55
  case "decrease": {
@@ -53,59 +74,88 @@ var MaxAccountsTableRow = /* @__PURE__ */ __name(({ activeAccountIndex, changeMa
53
74
  } else {
54
75
  throw new Error("Max Accounts is unset and needs a default");
55
76
  }
56
- }, "handleChangeMaxAccounts");
57
- return /* @__PURE__ */ React2.createElement(TableRow, null, /* @__PURE__ */ React2.createElement(TableCell, null, "Maximum Accounts"), /* @__PURE__ */ React2.createElement(TableCell, {
58
- align: "center"
59
- }, /* @__PURE__ */ React2.createElement(Typography, {
60
- variant: "caption"
61
- }, maxAccounts)), /* @__PURE__ */ React2.createElement(TableCell, {
62
- align: "center"
63
- }, /* @__PURE__ */ React2.createElement(ButtonGroup, null, /* @__PURE__ */ React2.createElement(ButtonEx, {
64
- onClick: /* @__PURE__ */ __name(() => handleChangeMaxAccounts("decrease"), "onClick"),
65
- variant: "contained",
66
- size: "small"
67
- }, "-"), /* @__PURE__ */ React2.createElement(ButtonEx, {
68
- onClick: /* @__PURE__ */ __name(() => handleChangeMaxAccounts("increase"), "onClick"),
69
- variant: "contained",
70
- size: "small"
71
- }, "+")), /* @__PURE__ */ React2.createElement(OutOfBoundsSnackBar, {
72
- desiredMaximumAccounts,
73
- activeAccountIndex,
74
- setShowSnackBar,
75
- showSnackBar
76
- })));
77
- }, "MaxAccountsTableRow");
77
+ };
78
+ return /* @__PURE__ */ jsxs2(TableRow, { children: [
79
+ /* @__PURE__ */ jsx2(TableCell, { children: "Maximum Accounts" }),
80
+ /* @__PURE__ */ jsx2(TableCell, { align: "center", children: /* @__PURE__ */ jsx2(Typography, { variant: "caption", children: maxAccounts }) }),
81
+ /* @__PURE__ */ jsxs2(TableCell, { align: "center", children: [
82
+ /* @__PURE__ */ jsxs2(ButtonGroup, { children: [
83
+ /* @__PURE__ */ jsx2(ButtonEx, { onClick: () => handleChangeMaxAccounts("decrease"), variant: "contained", size: "small", children: "-" }),
84
+ /* @__PURE__ */ jsx2(ButtonEx, { onClick: () => handleChangeMaxAccounts("increase"), variant: "contained", size: "small", children: "+" })
85
+ ] }),
86
+ /* @__PURE__ */ jsx2(
87
+ OutOfBoundsSnackBar,
88
+ {
89
+ desiredMaximumAccounts,
90
+ activeAccountIndex,
91
+ setShowSnackBar,
92
+ showSnackBar
93
+ }
94
+ )
95
+ ] })
96
+ ] });
97
+ };
78
98
 
79
99
  // src/components/SeedPhrase/_shared/SeedPhraseIconButton.tsx
80
100
  import { HelpOutline as HelpOutlineIcon } from "@mui/icons-material";
81
- import { Button, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Link, List, ListItem, Typography as Typography2 } from "@mui/material";
82
- import React3, { useState as useState2 } from "react";
83
- var SeedPhraseIconButton = /* @__PURE__ */ __name((props) => {
101
+ import {
102
+ Button,
103
+ Dialog,
104
+ DialogActions,
105
+ DialogContent,
106
+ DialogTitle,
107
+ IconButton,
108
+ Link,
109
+ List,
110
+ ListItem,
111
+ Typography as Typography2
112
+ } from "@mui/material";
113
+ import { useState as useState2 } from "react";
114
+ import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
115
+ var SeedPhraseIconButton = (props) => {
84
116
  const [open, setOpen] = useState2(false);
85
- const onClose = /* @__PURE__ */ __name(() => setOpen(false), "onClose");
86
- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(IconButton, {
87
- onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick"),
88
- ...props
89
- }, /* @__PURE__ */ React3.createElement(HelpOutlineIcon, {
90
- fontSize: "small"
91
- })), /* @__PURE__ */ React3.createElement(Dialog, {
92
- open
93
- }, /* @__PURE__ */ React3.createElement(DialogTitle, null, "Understanding your Seed Phrase"), /* @__PURE__ */ React3.createElement(DialogContent, null, /* @__PURE__ */ React3.createElement(Typography2, null, "Your Seed Phrase should adhere to the", " ", /* @__PURE__ */ React3.createElement(Link, {
94
- target: "_blank",
95
- href: "https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki"
96
- }, "bip39 specification"), " ", "and is used to generate accounts which identify your data on the XYO Network."), /* @__PURE__ */ React3.createElement(List, null, /* @__PURE__ */ React3.createElement(ListItem, null, "Do not share this phrase with anyone."), /* @__PURE__ */ React3.createElement(ListItem, null, "Do not save it to a public computer."), /* @__PURE__ */ React3.createElement(ListItem, null, "Do not use a existing phrase from another wallet (i.e. Metamask)."), /* @__PURE__ */ React3.createElement(ListItem, null, "Do not use before copying it down somewhere safe."))), /* @__PURE__ */ React3.createElement(DialogActions, null, /* @__PURE__ */ React3.createElement(Button, {
97
- onClick: onClose,
98
- variant: "outlined"
99
- }, "OK"))));
100
- }, "SeedPhraseIconButton");
117
+ const onClose = () => setOpen(false);
118
+ return /* @__PURE__ */ jsxs3(Fragment, { children: [
119
+ /* @__PURE__ */ jsx3(IconButton, { onClick: () => setOpen(true), ...props, children: /* @__PURE__ */ jsx3(HelpOutlineIcon, { fontSize: "small" }) }),
120
+ /* @__PURE__ */ jsxs3(Dialog, { open, children: [
121
+ /* @__PURE__ */ jsx3(DialogTitle, { children: "Understanding your Seed Phrase" }),
122
+ /* @__PURE__ */ jsxs3(DialogContent, { children: [
123
+ /* @__PURE__ */ jsxs3(Typography2, { children: [
124
+ "Your Seed Phrase should adhere to the",
125
+ " ",
126
+ /* @__PURE__ */ jsx3(Link, { target: "_blank", href: "https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki", children: "bip39 specification" }),
127
+ " ",
128
+ "and is used to generate accounts which identify your data on the XYO Network."
129
+ ] }),
130
+ /* @__PURE__ */ jsxs3(List, { children: [
131
+ /* @__PURE__ */ jsx3(ListItem, { children: "Do not share this phrase with anyone." }),
132
+ /* @__PURE__ */ jsx3(ListItem, { children: "Do not save it to a public computer." }),
133
+ /* @__PURE__ */ jsx3(ListItem, { children: "Do not use a existing phrase from another wallet (i.e. Metamask)." }),
134
+ /* @__PURE__ */ jsx3(ListItem, { children: "Do not use before copying it down somewhere safe." })
135
+ ] })
136
+ ] }),
137
+ /* @__PURE__ */ jsx3(DialogActions, { children: /* @__PURE__ */ jsx3(Button, { onClick: onClose, variant: "outlined", children: "OK" }) })
138
+ ] })
139
+ ] });
140
+ };
101
141
 
102
142
  // src/components/SeedPhrase/DefaultSeedPhrase.tsx
103
- import { Alert as Alert2, AlertTitle as AlertTitle2, Snackbar as Snackbar2 } from "@mui/material";
143
+ import {
144
+ Alert as Alert2,
145
+ AlertTitle as AlertTitle2,
146
+ Snackbar as Snackbar2
147
+ } from "@mui/material";
104
148
  import { generateMnemonic } from "@scure/bip39";
105
149
  import { wordlist } from "@scure/bip39/wordlists/english.js";
106
150
  import { isUndefinedOrNull } from "@xylabs/sdk-js";
107
- import React4, { useState as useState3 } from "react";
108
- var DefaultSeedPhrase = /* @__PURE__ */ __name(({ changeSeedPhrase, children, hideDefaultSeedPhraseMessage, seedPhrase }) => {
151
+ import { useState as useState3 } from "react";
152
+ import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
153
+ var DefaultSeedPhrase = ({
154
+ changeSeedPhrase,
155
+ children,
156
+ hideDefaultSeedPhraseMessage,
157
+ seedPhrase
158
+ }) => {
109
159
  const [showSnackBar, setShowSnackBar] = useState3(false);
110
160
  const [previousSeedPhrase, setPreviousSeedPhrase] = useState3();
111
161
  if (seedPhrase !== previousSeedPhrase) {
@@ -116,22 +166,26 @@ var DefaultSeedPhrase = /* @__PURE__ */ __name(({ changeSeedPhrase, children, hi
116
166
  setShowSnackBar(true);
117
167
  }
118
168
  }
119
- return /* @__PURE__ */ React4.createElement(React4.Fragment, null, hideDefaultSeedPhraseMessage ? null : /* @__PURE__ */ React4.createElement(Snackbar2, {
120
- open: showSnackBar,
121
- autoHideDuration: 5e3,
122
- onClose: /* @__PURE__ */ __name(() => setShowSnackBar(false), "onClose"),
123
- anchorOrigin: {
124
- horizontal: "center",
125
- vertical: "top"
126
- }
127
- }, /* @__PURE__ */ React4.createElement(Alert2, {
128
- severity: "success"
129
- }, /* @__PURE__ */ React4.createElement(AlertTitle2, null, "Default Seed Phrase Generated"), "Go to application settings to save it.")), children);
130
- }, "DefaultSeedPhrase");
169
+ return /* @__PURE__ */ jsxs4(Fragment2, { children: [
170
+ hideDefaultSeedPhraseMessage ? null : /* @__PURE__ */ jsx4(
171
+ Snackbar2,
172
+ {
173
+ open: showSnackBar,
174
+ autoHideDuration: 5e3,
175
+ onClose: () => setShowSnackBar(false),
176
+ anchorOrigin: { horizontal: "center", vertical: "top" },
177
+ children: /* @__PURE__ */ jsxs4(Alert2, { severity: "success", children: [
178
+ /* @__PURE__ */ jsx4(AlertTitle2, { children: "Default Seed Phrase Generated" }),
179
+ "Go to application settings to save it."
180
+ ] })
181
+ }
182
+ ),
183
+ children
184
+ ] });
185
+ };
131
186
 
132
187
  // src/components/SeedPhrase/dialog/components/DialogActionButtons.tsx
133
188
  import { Button as Button2, DialogActions as DialogActions2 } from "@mui/material";
134
- import React7 from "react";
135
189
 
136
190
  // src/contexts/SeedPhrase/Context.ts
137
191
  import { createContextEx } from "@xylabs/react-shared";
@@ -141,44 +195,46 @@ var SeedPhraseContext = createContextEx();
141
195
  import { generateMnemonic as generateMnemonic2, validateMnemonic } from "@scure/bip39";
142
196
  import { wordlist as wordlist2 } from "@scure/bip39/wordlists/english.js";
143
197
  import { useResetState } from "@xylabs/react-hooks";
144
- import React5, { useCallback, useEffect, useMemo, useState as useState4 } from "react";
145
- var validate = /* @__PURE__ */ __name((passedPhrase) => {
198
+ import {
199
+ useCallback,
200
+ useEffect,
201
+ useMemo,
202
+ useState as useState4
203
+ } from "react";
204
+ import { jsx as jsx5 } from "react/jsx-runtime";
205
+ var validate = (passedPhrase) => {
146
206
  if (!passedPhrase) {
147
207
  return null;
148
208
  }
149
209
  return validateMnemonic(passedPhrase, wordlist2);
150
- }, "validate");
151
- var SeedPhraseProvider = /* @__PURE__ */ __name(({ children, defaultPhrase, handleChangeSeedPhrase, saveCallback, seedPhrase, open }) => {
210
+ };
211
+ var SeedPhraseProvider = ({
212
+ children,
213
+ defaultPhrase,
214
+ handleChangeSeedPhrase,
215
+ saveCallback,
216
+ seedPhrase,
217
+ open
218
+ }) => {
152
219
  const [phrase, setPhrase] = useResetState(defaultPhrase);
153
220
  const [overwriteWarning, setOverwriteWarning] = useState4(false);
154
221
  useEffect(() => {
155
222
  if (seedPhrase || open) {
156
223
  setPhrase?.(seedPhrase ?? "");
157
224
  }
158
- }, [
159
- seedPhrase,
160
- open,
161
- setPhrase
162
- ]);
225
+ }, [seedPhrase, open, setPhrase]);
163
226
  const handleGenerate = useCallback(() => {
164
227
  const mnemonic = generateMnemonic2(wordlist2, 256);
165
228
  setPhrase?.(mnemonic);
166
229
  setOverwriteWarning?.(false);
167
- }, [
168
- setPhrase
169
- ]);
230
+ }, [setPhrase]);
170
231
  const handleCancelOverwrite = useCallback(() => {
171
232
  setOverwriteWarning(false);
172
- }, [
173
- setOverwriteWarning
174
- ]);
233
+ }, [setOverwriteWarning]);
175
234
  const handleClear = useCallback(() => {
176
235
  setPhrase("");
177
236
  setOverwriteWarning(false);
178
- }, [
179
- setPhrase,
180
- setOverwriteWarning
181
- ]);
237
+ }, [setPhrase, setOverwriteWarning]);
182
238
  const handleSave = useCallback(() => {
183
239
  if (!overwriteWarning && seedPhrase && seedPhrase !== phrase) {
184
240
  setOverwriteWarning?.(true);
@@ -186,27 +242,14 @@ var SeedPhraseProvider = /* @__PURE__ */ __name(({ children, defaultPhrase, hand
186
242
  handleChangeSeedPhrase?.(phrase ?? "");
187
243
  saveCallback?.();
188
244
  }
189
- }, [
190
- handleChangeSeedPhrase,
191
- overwriteWarning,
192
- phrase,
193
- saveCallback,
194
- seedPhrase
195
- ]);
245
+ }, [handleChangeSeedPhrase, overwriteWarning, phrase, saveCallback, seedPhrase]);
196
246
  useEffect(() => {
197
247
  if (!open) {
198
248
  handleCancelOverwrite();
199
249
  }
200
- }, [
201
- handleCancelOverwrite,
202
- open
203
- ]);
204
- const validSeedPhrase = useMemo(() => validate?.(seedPhrase), [
205
- seedPhrase
206
- ]);
207
- const validPhrase = useMemo(() => validate?.(phrase), [
208
- phrase
209
- ]);
250
+ }, [handleCancelOverwrite, open]);
251
+ const validSeedPhrase = useMemo(() => validate?.(seedPhrase), [seedPhrase]);
252
+ const validPhrase = useMemo(() => validate?.(phrase), [phrase]);
210
253
  const value = useMemo(() => ({
211
254
  handleCancelOverwrite,
212
255
  handleChangeSeedPhrase,
@@ -222,28 +265,19 @@ var SeedPhraseProvider = /* @__PURE__ */ __name(({ children, defaultPhrase, hand
222
265
  validPhrase,
223
266
  validSeedPhrase,
224
267
  validate
225
- }), [
226
- handleCancelOverwrite,
227
- handleChangeSeedPhrase,
228
- handleClear,
229
- handleGenerate,
230
- handleSave,
231
- overwriteWarning,
232
- phrase,
233
- seedPhrase,
234
- setOverwriteWarning,
235
- setPhrase,
236
- validPhrase,
237
- validSeedPhrase
238
- ]);
239
- return /* @__PURE__ */ React5.createElement(SeedPhraseContext, {
240
- value
241
- }, children);
242
- }, "SeedPhraseProvider");
268
+ }), [handleCancelOverwrite, handleChangeSeedPhrase, handleClear, handleGenerate, handleSave, overwriteWarning, phrase, seedPhrase, setOverwriteWarning, setPhrase, validPhrase, validSeedPhrase]);
269
+ return /* @__PURE__ */ jsx5(
270
+ SeedPhraseContext,
271
+ {
272
+ value,
273
+ children
274
+ }
275
+ );
276
+ };
243
277
 
244
278
  // src/contexts/SeedPhrase/use.ts
245
279
  import { useContextEx } from "@xylabs/react-shared";
246
- var useSeedPhrase = /* @__PURE__ */ __name(() => useContextEx(SeedPhraseContext, "SeedPhrase", true), "useSeedPhrase");
280
+ var useSeedPhrase = () => useContextEx(SeedPhraseContext, "SeedPhrase", true);
247
281
 
248
282
  // src/contexts/Wallet/Context.ts
249
283
  import { createContextEx as createContextEx2 } from "@xylabs/react-shared";
@@ -252,13 +286,16 @@ var WalletContext = createContextEx2();
252
286
  // src/contexts/Wallet/Provider.tsx
253
287
  import { useResetState as useResetState2 } from "@xylabs/react-hooks";
254
288
  import { usePromise } from "@xylabs/react-promise";
255
- import React6, { useMemo as useMemo2 } from "react";
256
- var WalletProvider = /* @__PURE__ */ __name(({ children, defaultActiveAccountIndex = 0, rootWallet = null, ...props }) => {
289
+ import { useMemo as useMemo2 } from "react";
290
+ import { jsx as jsx6 } from "react/jsx-runtime";
291
+ var WalletProvider = ({
292
+ children,
293
+ defaultActiveAccountIndex = 0,
294
+ rootWallet = null,
295
+ ...props
296
+ }) => {
257
297
  const [activeAccountIndex, setActiveAccountIndex] = useResetState2(defaultActiveAccountIndex);
258
- const [activeAccount = null] = usePromise(async () => await rootWallet?.derivePath(activeAccountIndex.toString()), [
259
- activeAccountIndex,
260
- rootWallet
261
- ]);
298
+ const [activeAccount = null] = usePromise(async () => await rootWallet?.derivePath(activeAccountIndex.toString()), [activeAccountIndex, rootWallet]);
262
299
  const value = useMemo2(() => ({
263
300
  activeAccount,
264
301
  activeAccountIndex,
@@ -271,74 +308,59 @@ var WalletProvider = /* @__PURE__ */ __name(({ children, defaultActiveAccountInd
271
308
  rootWallet,
272
309
  setActiveAccountIndex
273
310
  ]);
274
- return /* @__PURE__ */ React6.createElement(WalletContext, {
275
- value,
276
- ...props
277
- }, children);
278
- }, "WalletProvider");
311
+ return /* @__PURE__ */ jsx6(
312
+ WalletContext,
313
+ {
314
+ value,
315
+ ...props,
316
+ children
317
+ }
318
+ );
319
+ };
279
320
 
280
321
  // src/contexts/Wallet/use.ts
281
322
  import { usePromise as usePromise2 } from "@xylabs/react-promise";
282
323
  import { useContextEx as useContextEx2, useProvided } from "@xylabs/react-shared";
283
- var useWalletContext = /* @__PURE__ */ __name((required = true) => {
324
+ var useWalletContext = (required = true) => {
284
325
  return useContextEx2(WalletContext, "Wallet", required);
285
- }, "useWalletContext");
286
- var useWalletProvided = /* @__PURE__ */ __name(() => {
326
+ };
327
+ var useWalletProvided = () => {
287
328
  return useProvided(WalletContext);
288
- }, "useWalletProvided");
289
- var useRootWallet = /* @__PURE__ */ __name((required = true) => {
329
+ };
330
+ var useRootWallet = (required = true) => {
290
331
  const { rootWallet } = useWalletContext(required);
291
- return [
292
- rootWallet,
293
- void 0
294
- ];
295
- }, "useRootWallet");
296
- var useIndexedWalletFromContext = /* @__PURE__ */ __name((index, required = true) => {
332
+ return [rootWallet, void 0];
333
+ };
334
+ var useIndexedWalletFromContext = (index, required = true) => {
297
335
  const { rootWallet } = useWalletContext(required);
298
- const [wallet] = usePromise2(async () => await rootWallet?.derivePath(index.toString()) ?? rootWallet, [
299
- rootWallet,
300
- index
301
- ]);
302
- return [
303
- wallet,
304
- void 0
305
- ];
306
- }, "useIndexedWalletFromContext");
307
- var useSelectedWalletAccount = /* @__PURE__ */ __name((required = true) => {
336
+ const [wallet] = usePromise2(async () => await rootWallet?.derivePath(index.toString()) ?? rootWallet, [rootWallet, index]);
337
+ return [wallet, void 0];
338
+ };
339
+ var useSelectedWalletAccount = (required = true) => {
308
340
  const { activeAccountIndex } = useWalletContext(required);
309
341
  const [account] = useIndexedWalletFromContext(activeAccountIndex ?? 0, required);
310
- return activeAccountIndex === void 0 && account === null ? [
311
- null,
312
- void 0
313
- ] : [
314
- account,
315
- void 0
316
- ];
317
- }, "useSelectedWalletAccount");
342
+ return activeAccountIndex === void 0 && account === null ? [null, void 0] : [account, void 0];
343
+ };
318
344
 
319
345
  // src/components/SeedPhrase/dialog/components/DialogActionButtons.tsx
320
- var DialogActionButtons = /* @__PURE__ */ __name(({ onClose, ...props }) => {
346
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
347
+ var DialogActionButtons = ({ onClose, ...props }) => {
321
348
  const { handleSave, setPhrase } = useSeedPhrase();
322
- const wrappedOnClose = /* @__PURE__ */ __name((e) => {
349
+ const wrappedOnClose = (e) => {
323
350
  setPhrase?.("");
324
351
  onClose?.(e, "escapeKeyDown");
325
- }, "wrappedOnClose");
326
- return /* @__PURE__ */ React7.createElement(DialogActions2, props, /* @__PURE__ */ React7.createElement(Button2, {
327
- variant: "outlined",
328
- onClick: wrappedOnClose
329
- }, "Cancel"), /* @__PURE__ */ React7.createElement(Button2, {
330
- type: "submit",
331
- variant: "contained",
332
- onClick: handleSave
333
- }, "Save"));
334
- }, "DialogActionButtons");
352
+ };
353
+ return /* @__PURE__ */ jsxs5(DialogActions2, { ...props, children: [
354
+ /* @__PURE__ */ jsx7(Button2, { variant: "outlined", onClick: wrappedOnClose, children: "Cancel" }),
355
+ /* @__PURE__ */ jsx7(Button2, { type: "submit", variant: "contained", onClick: handleSave, children: "Save" })
356
+ ] });
357
+ };
335
358
 
336
359
  // src/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.tsx
337
360
  import { FormControl, TextField } from "@mui/material";
338
- import React10 from "react";
339
361
 
340
362
  // src/components/SeedPhrase/dialog/components/fields/validation-messages/colorParser.ts
341
- var colorParser = /* @__PURE__ */ __name((conditional) => {
363
+ var colorParser = (conditional) => {
342
364
  switch (conditional) {
343
365
  case true: {
344
366
  return "success";
@@ -350,25 +372,27 @@ var colorParser = /* @__PURE__ */ __name((conditional) => {
350
372
  return;
351
373
  }
352
374
  }
353
- }, "colorParser");
375
+ };
354
376
 
355
377
  // src/components/SeedPhrase/dialog/components/fields/validation-messages/InvalidPhrase.tsx
356
378
  import { Link as Link2, Typography as Typography3 } from "@mui/material";
357
- import React8 from "react";
358
- var InvalidPhraseTypography = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React8.createElement(Typography3, {
359
- variant: "caption",
360
- color: "error",
361
- ...props
362
- }, "Invalid seed phrase. See -", " ", /* @__PURE__ */ React8.createElement(Link2, {
363
- target: "_blank",
364
- href: "https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki"
365
- }, "bip39 Proposal")), "InvalidPhraseTypography");
379
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
380
+ var InvalidPhraseTypography = (props) => /* @__PURE__ */ jsxs6(Typography3, { variant: "caption", color: "error", ...props, children: [
381
+ "Invalid seed phrase. See -",
382
+ " ",
383
+ /* @__PURE__ */ jsx8(Link2, { target: "_blank", href: "https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki", children: "bip39 Proposal" })
384
+ ] });
366
385
 
367
386
  // src/components/SeedPhrase/dialog/components/fields/validation-messages/PhraseHeaderBox.tsx
368
387
  import { CheckCircleOutline as CheckCircleOutlineIcon, HighlightOff as HighlightOffIcon } from "@mui/icons-material";
369
388
  import { FlexRow } from "@xylabs/react-flexbox";
370
- import React9, { useMemo as useMemo3 } from "react";
371
- var PhraseHeaderBox = /* @__PURE__ */ __name(({ children, conditional, ...props }) => {
389
+ import { useMemo as useMemo3 } from "react";
390
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
391
+ var PhraseHeaderBox = ({
392
+ children,
393
+ conditional,
394
+ ...props
395
+ }) => {
372
396
  const state = useMemo3(() => {
373
397
  switch (conditional) {
374
398
  case true: {
@@ -381,88 +405,110 @@ var PhraseHeaderBox = /* @__PURE__ */ __name(({ children, conditional, ...props
381
405
  return null;
382
406
  }
383
407
  }
384
- }, [
385
- conditional
386
- ]);
408
+ }, [conditional]);
387
409
  const Icon = useMemo3(() => {
388
410
  switch (state) {
389
411
  case "success": {
390
- return /* @__PURE__ */ React9.createElement(CheckCircleOutlineIcon, {
391
- fontSize: "small",
392
- color: "success"
393
- });
412
+ return /* @__PURE__ */ jsx9(CheckCircleOutlineIcon, { fontSize: "small", color: "success" });
394
413
  }
395
414
  case "error": {
396
- return /* @__PURE__ */ React9.createElement(HighlightOffIcon, {
397
- fontSize: "small",
398
- color: "error"
399
- });
415
+ return /* @__PURE__ */ jsx9(HighlightOffIcon, { fontSize: "small", color: "error" });
400
416
  }
401
417
  default: {
402
418
  return null;
403
419
  }
404
420
  }
405
- }, [
406
- state
407
- ]);
408
- return /* @__PURE__ */ React9.createElement(FlexRow, {
409
- justifyContent: "start",
410
- columnGap: 1,
411
- ...props
412
- }, Icon, children);
413
- }, "PhraseHeaderBox");
421
+ }, [state]);
422
+ return /* @__PURE__ */ jsxs7(FlexRow, { justifyContent: "start", columnGap: 1, ...props, children: [
423
+ Icon,
424
+ children
425
+ ] });
426
+ };
414
427
 
415
428
  // src/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.tsx
416
- var NewPhraseTextField = /* @__PURE__ */ __name(({ children, disableColor, ...props }) => {
417
- const { phrase, setPhrase, validPhrase } = useSeedPhrase();
418
- return /* @__PURE__ */ React10.createElement(FormControl, {
419
- fullWidth: true,
420
- size: "small",
421
- sx: {
422
- display: "flex",
423
- flexDirection: "column",
424
- rowGap: 1
429
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
430
+ var NewPhraseTextField = ({
431
+ children,
432
+ disableColor,
433
+ ...props
434
+ }) => {
435
+ const {
436
+ phrase,
437
+ setPhrase,
438
+ validPhrase
439
+ } = useSeedPhrase();
440
+ return /* @__PURE__ */ jsxs8(
441
+ FormControl,
442
+ {
443
+ fullWidth: true,
444
+ size: "small",
445
+ sx: {
446
+ display: "flex",
447
+ flexDirection: "column",
448
+ rowGap: 1
449
+ },
450
+ children: [
451
+ children,
452
+ /* @__PURE__ */ jsx10(
453
+ TextField,
454
+ {
455
+ focused: true,
456
+ color: disableColor ? void 0 : colorParser(validPhrase),
457
+ error: validPhrase === false,
458
+ helperText: validPhrase === false ? /* @__PURE__ */ jsx10(InvalidPhraseTypography, {}) : null,
459
+ fullWidth: true,
460
+ maxRows: Number.POSITIVE_INFINITY,
461
+ multiline: true,
462
+ onChange: (e) => setPhrase?.(e.target.value),
463
+ value: phrase,
464
+ ...props
465
+ }
466
+ )
467
+ ]
425
468
  }
426
- }, children, /* @__PURE__ */ React10.createElement(TextField, {
427
- focused: true,
428
- color: disableColor ? void 0 : colorParser(validPhrase),
429
- error: validPhrase === false,
430
- helperText: validPhrase === false ? /* @__PURE__ */ React10.createElement(InvalidPhraseTypography, null) : null,
431
- fullWidth: true,
432
- maxRows: Number.POSITIVE_INFINITY,
433
- multiline: true,
434
- onChange: /* @__PURE__ */ __name((e) => setPhrase?.(e.target.value), "onChange"),
435
- value: phrase,
436
- ...props
437
- }));
438
- }, "NewPhraseTextField");
469
+ );
470
+ };
439
471
 
440
472
  // src/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.tsx
441
473
  import { Button as Button3, DialogActions as DialogActions3 } from "@mui/material";
442
- import React11 from "react";
443
- var PhraseDialogActions = /* @__PURE__ */ __name(({ hideClear, hideGenerate, ...props }) => {
444
- const { handleClear, handleGenerate, overwriteWarning } = useSeedPhrase();
445
- return /* @__PURE__ */ React11.createElement(DialogActions3, {
446
- sx: {
447
- justifyContent: "center"
448
- },
449
- ...props
450
- }, hideGenerate ? null : /* @__PURE__ */ React11.createElement(Button3, {
451
- disabled: overwriteWarning,
452
- variant: "contained",
453
- onClick: handleGenerate
454
- }, "Generate"), hideClear ? null : /* @__PURE__ */ React11.createElement(Button3, {
455
- variant: "outlined",
456
- onClick: handleClear
457
- }, "Clear"));
458
- }, "PhraseDialogActions");
474
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
475
+ var PhraseDialogActions = ({
476
+ hideClear,
477
+ hideGenerate,
478
+ ...props
479
+ }) => {
480
+ const {
481
+ handleClear,
482
+ handleGenerate,
483
+ overwriteWarning
484
+ } = useSeedPhrase();
485
+ return /* @__PURE__ */ jsxs9(DialogActions3, { sx: { justifyContent: "center" }, ...props, children: [
486
+ hideGenerate ? null : /* @__PURE__ */ jsx11(Button3, { disabled: overwriteWarning, variant: "contained", onClick: handleGenerate, children: "Generate" }),
487
+ hideClear ? null : /* @__PURE__ */ jsx11(Button3, { variant: "outlined", onClick: handleClear, children: "Clear" })
488
+ ] });
489
+ };
459
490
 
460
491
  // src/components/SeedPhrase/dialog/components/fields/SavedPhraseTextField.tsx
461
492
  import { ContentCopy } from "@mui/icons-material";
462
- import { Chip, FormControl as FormControl2, FormLabel, IconButton as IconButton2, TextField as TextField2, Tooltip, useTheme } from "@mui/material";
493
+ import {
494
+ Chip,
495
+ FormControl as FormControl2,
496
+ FormLabel,
497
+ IconButton as IconButton2,
498
+ TextField as TextField2,
499
+ Tooltip,
500
+ useTheme
501
+ } from "@mui/material";
463
502
  import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
464
- import React12, { useState as useState5 } from "react";
465
- var SavedPhraseTextField = /* @__PURE__ */ __name(({ fullWidth, showCopyButton, showPhraseHeader, visible: visibleProp, ...props }) => {
503
+ import { useState as useState5 } from "react";
504
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
505
+ var SavedPhraseTextField = ({
506
+ fullWidth,
507
+ showCopyButton,
508
+ showPhraseHeader,
509
+ visible: visibleProp,
510
+ ...props
511
+ }) => {
466
512
  const { validSeedPhrase, seedPhrase } = useSeedPhrase();
467
513
  const theme = useTheme();
468
514
  const [visible, setVisible] = useState5(visibleProp);
@@ -472,7 +518,7 @@ var SavedPhraseTextField = /* @__PURE__ */ __name(({ fullWidth, showCopyButton,
472
518
  setVisible(visibleProp);
473
519
  }
474
520
  const [copied, setCopied] = useState5(false);
475
- const onCopyPhrase = /* @__PURE__ */ __name(async () => {
521
+ const onCopyPhrase = async () => {
476
522
  if (seedPhrase) {
477
523
  try {
478
524
  await navigator.clipboard.writeText(seedPhrase);
@@ -482,177 +528,215 @@ var SavedPhraseTextField = /* @__PURE__ */ __name(({ fullWidth, showCopyButton,
482
528
  console.error("Error copying resolvedSelectedAddress to clipboard", e);
483
529
  }
484
530
  }
485
- }, "onCopyPhrase");
486
- return /* @__PURE__ */ React12.createElement(FormControl2, {
487
- fullWidth,
488
- size: "small",
489
- sx: {
490
- display: "flex",
491
- flexDirection: "column",
492
- rowGap: 1
493
- }
494
- }, /* @__PURE__ */ React12.createElement(FlexRow2, {
495
- gap: 0.5
496
- }, /* @__PURE__ */ React12.createElement(Chip, {
497
- label: "Show Seed Phrase",
498
- onClick: /* @__PURE__ */ __name(() => setVisible(!visible), "onClick"),
499
- // Margin is set to 2px to match the Copy Button size and remove jumping during animation
500
- sx: {
501
- alignSelf: "center",
502
- my: "2px"
503
- }
504
- }), /* @__PURE__ */ React12.createElement(Tooltip, {
505
- title: copied ? "Copied!" : "Copy"
506
- }, /* @__PURE__ */ React12.createElement(IconButton2, {
507
- onClick: /* @__PURE__ */ __name(() => void onCopyPhrase(), "onClick"),
508
- sx: {
509
- height: visible ? "auto" : 0,
510
- opacity: visible ? 1 : 0,
511
- overflow: "hidden",
512
- padding: visible ? theme.spacing(1) : 0,
513
- transition: "all .25s ease-in-out",
514
- width: visible ? "max-content" : 0
531
+ };
532
+ return /* @__PURE__ */ jsxs10(
533
+ FormControl2,
534
+ {
535
+ fullWidth,
536
+ size: "small",
537
+ sx: {
538
+ display: "flex",
539
+ flexDirection: "column",
540
+ rowGap: 1
541
+ },
542
+ children: [
543
+ /* @__PURE__ */ jsxs10(FlexRow2, { gap: 0.5, children: [
544
+ /* @__PURE__ */ jsx12(
545
+ Chip,
546
+ {
547
+ label: "Show Seed Phrase",
548
+ onClick: () => setVisible(!visible),
549
+ sx: { alignSelf: "center", my: "2px" }
550
+ }
551
+ ),
552
+ /* @__PURE__ */ jsx12(Tooltip, { title: copied ? "Copied!" : "Copy", children: /* @__PURE__ */ jsx12(
553
+ IconButton2,
554
+ {
555
+ onClick: () => void onCopyPhrase(),
556
+ sx: {
557
+ height: visible ? "auto" : 0,
558
+ opacity: visible ? 1 : 0,
559
+ overflow: "hidden",
560
+ padding: visible ? theme.spacing(1) : 0,
561
+ transition: "all .25s ease-in-out",
562
+ width: visible ? "max-content" : 0
563
+ },
564
+ children: /* @__PURE__ */ jsx12(ContentCopy, { fontSize: "small" })
565
+ }
566
+ ) })
567
+ ] }),
568
+ visible && showPhraseHeader ? /* @__PURE__ */ jsx12(FormLabel, { children: /* @__PURE__ */ jsx12(PhraseHeaderBox, { conditional: validSeedPhrase, children: "Saved Seed Phrase" }) }) : null,
569
+ /* @__PURE__ */ jsx12(
570
+ TextField2,
571
+ {
572
+ defaultValue: seedPhrase,
573
+ disabled: true,
574
+ error: validSeedPhrase === false,
575
+ helperText: validSeedPhrase === false ? /* @__PURE__ */ jsx12(InvalidPhraseTypography, {}) : null,
576
+ fullWidth: true,
577
+ maxRows: Number.POSITIVE_INFINITY,
578
+ multiline: true,
579
+ slotProps: {
580
+ input: {
581
+ style: {
582
+ height: visible ? "auto" : "0",
583
+ overflow: "hidden",
584
+ opacity: visible ? 1 : 0,
585
+ padding: visible ? theme.spacing(1) : 0,
586
+ transition: "all .25s ease-in-out"
587
+ }
588
+ }
589
+ },
590
+ ...props
591
+ }
592
+ )
593
+ ]
515
594
  }
516
- }, /* @__PURE__ */ React12.createElement(ContentCopy, {
517
- fontSize: "small"
518
- })))), visible && showPhraseHeader ? /* @__PURE__ */ React12.createElement(FormLabel, null, /* @__PURE__ */ React12.createElement(PhraseHeaderBox, {
519
- conditional: validSeedPhrase
520
- }, "Saved Seed Phrase")) : null, /* @__PURE__ */ React12.createElement(TextField2, {
521
- defaultValue: seedPhrase,
522
- disabled: true,
523
- error: validSeedPhrase === false,
524
- helperText: validSeedPhrase === false ? /* @__PURE__ */ React12.createElement(InvalidPhraseTypography, null) : null,
525
- fullWidth: true,
526
- maxRows: Number.POSITIVE_INFINITY,
527
- multiline: true,
528
- slotProps: {
529
- input: {
530
- style: {
531
- height: visible ? "auto" : "0",
532
- overflow: "hidden",
533
- opacity: visible ? 1 : 0,
534
- padding: visible ? theme.spacing(1) : 0,
535
- transition: "all .25s ease-in-out"
536
- }
537
- }
538
- },
539
- ...props
540
- }));
541
- }, "SavedPhraseTextField");
595
+ );
596
+ };
542
597
 
543
598
  // src/components/SeedPhrase/dialog/components/OverwriteWarning.tsx
544
599
  import { Alert as Alert3, Button as Button4 } from "@mui/material";
545
600
  import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
546
- import React13 from "react";
547
- var OverwriteWarning = /* @__PURE__ */ __name(() => {
601
+ import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
602
+ var OverwriteWarning = () => {
548
603
  const { handleCancelOverwrite, handleSave } = useSeedPhrase();
549
- return /* @__PURE__ */ React13.createElement(Alert3, {
550
- variant: "outlined",
551
- severity: "warning",
552
- action: /* @__PURE__ */ React13.createElement(FlexRow3, {
553
- sx: {
554
- columnGap: 1
555
- }
556
- }, /* @__PURE__ */ React13.createElement(Button4, {
557
- variant: "outlined",
558
- color: "inherit",
559
- size: "small",
560
- onClick: handleSave
561
- }, "Overwrite"), /* @__PURE__ */ React13.createElement(Button4, {
604
+ return /* @__PURE__ */ jsx13(
605
+ Alert3,
606
+ {
562
607
  variant: "outlined",
563
- color: "inherit",
564
- size: "small",
565
- onClick: handleCancelOverwrite
566
- }, "Cancel"))
567
- }, "Are you sure you want to overwrite existing seed phrase? This action cannot be undone.");
568
- }, "OverwriteWarning");
608
+ severity: "warning",
609
+ action: /* @__PURE__ */ jsxs11(FlexRow3, { sx: { columnGap: 1 }, children: [
610
+ /* @__PURE__ */ jsx13(Button4, { variant: "outlined", color: "inherit", size: "small", onClick: handleSave, children: "Overwrite" }),
611
+ /* @__PURE__ */ jsx13(Button4, { variant: "outlined", color: "inherit", size: "small", onClick: handleCancelOverwrite, children: "Cancel" })
612
+ ] }),
613
+ children: "Are you sure you want to overwrite existing seed phrase? This action cannot be undone."
614
+ }
615
+ );
616
+ };
569
617
 
570
618
  // src/components/SeedPhrase/dialog/SeedPhraseDialog.tsx
571
- import { Dialog as Dialog2, DialogContent as DialogContent2, DialogTitle as DialogTitle2, FormLabel as FormLabel2 } from "@mui/material";
572
- import React14 from "react";
573
- var SeedPhraseDialog = /* @__PURE__ */ __name(({ changeSeedPhrase, dialogTitle = "Update Your Seed Phrase", seedPhrase, seedPhraseTextFieldTitle = "New Seed Phrase", ...props }) => {
574
- return /* @__PURE__ */ React14.createElement(SeedPhraseProvider, {
575
- seedPhrase,
576
- handleChangeSeedPhrase: changeSeedPhrase,
577
- open: props.open,
578
- saveCallback: /* @__PURE__ */ __name(() => props.onClose?.({}, "escapeKeyDown"), "saveCallback")
579
- }, /* @__PURE__ */ React14.createElement(SeedPhraseDialogInner, {
580
- dialogTitle,
581
- seedPhraseTextFieldTitle,
582
- ...props
583
- }));
584
- }, "SeedPhraseDialog");
585
- var SeedPhraseDialogInner = /* @__PURE__ */ __name(({ dialogTitle, seedPhraseTextFieldTitle, showCopyButton, ...props }) => {
586
- const { overwriteWarning, seedPhrase, validPhrase } = useSeedPhrase();
587
- return /* @__PURE__ */ React14.createElement(Dialog2, {
588
- "aria-labelledby": "alert-dialog-title",
589
- "aria-describedby": "alert-dialog-description",
590
- fullWidth: true,
591
- maxWidth: "sm",
592
- ...props
593
- }, /* @__PURE__ */ React14.createElement(DialogTitle2, {
594
- id: "alert-dialog-title",
595
- sx: {
596
- alignItems: "center",
597
- display: "inline-flex",
598
- flexDirection: "row"
599
- }
600
- }, dialogTitle, /* @__PURE__ */ React14.createElement(SeedPhraseIconButton, null)), /* @__PURE__ */ React14.createElement(DialogContent2, {
601
- sx: {
602
- display: "flex",
603
- flexDirection: "column",
604
- rowGap: 2
619
+ import {
620
+ Dialog as Dialog2,
621
+ DialogContent as DialogContent2,
622
+ DialogTitle as DialogTitle2,
623
+ FormLabel as FormLabel2
624
+ } from "@mui/material";
625
+ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
626
+ var SeedPhraseDialog = ({
627
+ changeSeedPhrase,
628
+ dialogTitle = "Update Your Seed Phrase",
629
+ seedPhrase,
630
+ seedPhraseTextFieldTitle = "New Seed Phrase",
631
+ ...props
632
+ }) => {
633
+ return /* @__PURE__ */ jsx14(
634
+ SeedPhraseProvider,
635
+ {
636
+ seedPhrase,
637
+ handleChangeSeedPhrase: changeSeedPhrase,
638
+ open: props.open,
639
+ saveCallback: () => props.onClose?.({}, "escapeKeyDown"),
640
+ children: /* @__PURE__ */ jsx14(SeedPhraseDialogInner, { dialogTitle, seedPhraseTextFieldTitle, ...props })
605
641
  }
606
- }, /* @__PURE__ */ React14.createElement(NewPhraseTextField, null, /* @__PURE__ */ React14.createElement(FormLabel2, null, /* @__PURE__ */ React14.createElement(PhraseHeaderBox, {
607
- conditional: validPhrase
608
- }, seedPhraseTextFieldTitle))), /* @__PURE__ */ React14.createElement(PhraseDialogActions, null), seedPhrase ? /* @__PURE__ */ React14.createElement(SavedPhraseTextField, {
609
- showCopyButton
610
- }) : null, overwriteWarning ? /* @__PURE__ */ React14.createElement(OverwriteWarning, null) : null), /* @__PURE__ */ React14.createElement(DialogActionButtons, {
611
- onClose: props.onClose
612
- }));
613
- }, "SeedPhraseDialogInner");
642
+ );
643
+ };
644
+ var SeedPhraseDialogInner = ({
645
+ dialogTitle,
646
+ seedPhraseTextFieldTitle,
647
+ showCopyButton,
648
+ ...props
649
+ }) => {
650
+ const {
651
+ overwriteWarning,
652
+ seedPhrase,
653
+ validPhrase
654
+ } = useSeedPhrase();
655
+ return /* @__PURE__ */ jsxs12(Dialog2, { "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description", fullWidth: true, maxWidth: "sm", ...props, children: [
656
+ /* @__PURE__ */ jsxs12(
657
+ DialogTitle2,
658
+ {
659
+ id: "alert-dialog-title",
660
+ sx: {
661
+ alignItems: "center",
662
+ display: "inline-flex",
663
+ flexDirection: "row"
664
+ },
665
+ children: [
666
+ dialogTitle,
667
+ /* @__PURE__ */ jsx14(SeedPhraseIconButton, {})
668
+ ]
669
+ }
670
+ ),
671
+ /* @__PURE__ */ jsxs12(
672
+ DialogContent2,
673
+ {
674
+ sx: {
675
+ display: "flex",
676
+ flexDirection: "column",
677
+ rowGap: 2
678
+ },
679
+ children: [
680
+ /* @__PURE__ */ jsx14(NewPhraseTextField, { children: /* @__PURE__ */ jsx14(FormLabel2, { children: /* @__PURE__ */ jsx14(PhraseHeaderBox, { conditional: validPhrase, children: seedPhraseTextFieldTitle }) }) }),
681
+ /* @__PURE__ */ jsx14(PhraseDialogActions, {}),
682
+ seedPhrase ? /* @__PURE__ */ jsx14(SavedPhraseTextField, { showCopyButton }) : null,
683
+ overwriteWarning ? /* @__PURE__ */ jsx14(OverwriteWarning, {}) : null
684
+ ]
685
+ }
686
+ ),
687
+ /* @__PURE__ */ jsx14(DialogActionButtons, { onClose: props.onClose })
688
+ ] });
689
+ };
614
690
 
615
691
  // src/components/SeedPhrase/settings/SeedPhraseTableRow.tsx
616
692
  import { Cancel as CancelIcon, RadioButtonChecked as RadioButtonCheckedIcon } from "@mui/icons-material";
617
- import { Button as Button5, ButtonGroup as ButtonGroup2, TableCell as TableCell2, TableRow as TableRow2 } from "@mui/material";
618
- import React15, { useState as useState6 } from "react";
619
- var SeedPhraseTableRow = /* @__PURE__ */ __name(({ changeSeedPhrase, seedPhrase, ...props }) => {
693
+ import {
694
+ Button as Button5,
695
+ ButtonGroup as ButtonGroup2,
696
+ TableCell as TableCell2,
697
+ TableRow as TableRow2
698
+ } from "@mui/material";
699
+ import { useState as useState6 } from "react";
700
+ import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
701
+ var SeedPhraseTableRow = ({
702
+ changeSeedPhrase,
703
+ seedPhrase,
704
+ ...props
705
+ }) => {
620
706
  const [open, setOpen] = useState6(false);
621
- const handleOpen = /* @__PURE__ */ __name(() => {
707
+ const handleOpen = () => {
622
708
  setOpen(true);
623
- }, "handleOpen");
624
- return /* @__PURE__ */ React15.createElement(TableRow2, props, /* @__PURE__ */ React15.createElement(TableCell2, null, "Seed Phrase", " ", /* @__PURE__ */ React15.createElement(SeedPhraseIconButton, null)), /* @__PURE__ */ React15.createElement(TableCell2, {
625
- align: "center"
626
- }, seedPhrase ? /* @__PURE__ */ React15.createElement(RadioButtonCheckedIcon, {
627
- color: "success"
628
- }) : /* @__PURE__ */ React15.createElement(CancelIcon, {
629
- color: "error"
630
- })), /* @__PURE__ */ React15.createElement(TableCell2, null, /* @__PURE__ */ React15.createElement(SeedPhraseDialog, {
631
- changeSeedPhrase,
632
- open,
633
- onClose: /* @__PURE__ */ __name(() => setOpen(false), "onClose"),
634
- seedPhrase
635
- }), /* @__PURE__ */ React15.createElement(ButtonGroup2, {
636
- fullWidth: true
637
- }, /* @__PURE__ */ React15.createElement(Button5, {
638
- variant: "contained",
639
- size: "small",
640
- onClick: handleOpen
641
- }, "Update"))));
642
- }, "SeedPhraseTableRow");
709
+ };
710
+ return /* @__PURE__ */ jsxs13(TableRow2, { ...props, children: [
711
+ /* @__PURE__ */ jsxs13(TableCell2, { children: [
712
+ "Seed Phrase",
713
+ " ",
714
+ /* @__PURE__ */ jsx15(SeedPhraseIconButton, {})
715
+ ] }),
716
+ /* @__PURE__ */ jsx15(TableCell2, { align: "center", children: seedPhrase ? /* @__PURE__ */ jsx15(RadioButtonCheckedIcon, { color: "success" }) : /* @__PURE__ */ jsx15(CancelIcon, { color: "error" }) }),
717
+ /* @__PURE__ */ jsxs13(TableCell2, { children: [
718
+ /* @__PURE__ */ jsx15(SeedPhraseDialog, { changeSeedPhrase, open, onClose: () => setOpen(false), seedPhrase }),
719
+ /* @__PURE__ */ jsx15(ButtonGroup2, { fullWidth: true, children: /* @__PURE__ */ jsx15(Button5, { variant: "contained", size: "small", onClick: handleOpen, children: "Update" }) })
720
+ ] })
721
+ ] });
722
+ };
643
723
 
644
724
  // src/components/WalletAccountDetails/WalletAccountDetails.tsx
645
- import { EthAddressWrapper } from "@xylabs/eth-address";
646
725
  import { EthAccountButton } from "@xylabs/react-crypto";
647
726
  import { FlexCol, FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
648
727
  import { NumberStatus } from "@xylabs/react-number-status";
728
+ import { EthAddressWrapper } from "@xylabs/sdk-js";
649
729
  import { useNetwork } from "@xyo-network/react-network";
650
- import React16 from "react";
651
730
 
652
731
  // src/hooks/useAccount.ts
653
732
  import { usePromise as usePromise3 } from "@xylabs/react-promise";
654
733
  import { useState as useState7 } from "react";
655
- var useAccount = /* @__PURE__ */ __name(({ wallet, account, index, required = false } = {}) => {
734
+ var useAccount = ({
735
+ wallet,
736
+ account,
737
+ index,
738
+ required = false
739
+ } = {}) => {
656
740
  const walletContextProvided = useWalletProvided();
657
741
  const [validationError, setValidationError] = useState7();
658
742
  if (wallet && account && !validationError) {
@@ -680,13 +764,7 @@ var useAccount = /* @__PURE__ */ __name(({ wallet, account, index, required = fa
680
764
  console.error(error2.message);
681
765
  setError(error2);
682
766
  }
683
- }, [
684
- index,
685
- wallet,
686
- rootWallet,
687
- activeAccountIndex,
688
- validationError
689
- ]);
767
+ }, [index, wallet, rootWallet, activeAccountIndex, validationError]);
690
768
  if (validationError && !error) {
691
769
  console.error(validationError.message);
692
770
  setError(validationError);
@@ -695,13 +773,19 @@ var useAccount = /* @__PURE__ */ __name(({ wallet, account, index, required = fa
695
773
  error ? void 0 : account ?? activeAccount ?? walletContextProvided ? null : void 0,
696
774
  error
697
775
  ];
698
- }, "useAccount");
776
+ };
699
777
 
700
778
  // src/hooks/useWallet.ts
701
779
  import { usePromise as usePromise4 } from "@xylabs/react-promise";
702
780
  import { HDWallet } from "@xyo-network/wallet";
703
781
  import { useState as useState8 } from "react";
704
- var useWallet = /* @__PURE__ */ __name(({ mnemonic, wallet, path, required = false, seed } = {}) => {
782
+ var useWallet = ({
783
+ mnemonic,
784
+ wallet,
785
+ path,
786
+ required = false,
787
+ seed
788
+ } = {}) => {
705
789
  const walletContextProvided = useWalletContext(false);
706
790
  const [error, setError] = useState8();
707
791
  const [contextAccount] = useSelectedWalletAccount(!wallet && required);
@@ -721,35 +805,21 @@ var useWallet = /* @__PURE__ */ __name(({ mnemonic, wallet, path, required = fal
721
805
  } catch (ex) {
722
806
  setError(ex);
723
807
  }
724
- }, [
725
- mnemonic,
726
- contextAccount,
727
- seed,
728
- path,
729
- wallet
730
- ]);
731
- return [
732
- activeAccount ?? (walletContextProvided ? null : activeAccount),
733
- error
734
- ];
735
- }, "useWallet");
808
+ }, [mnemonic, contextAccount, seed, path, wallet]);
809
+ return [activeAccount ?? (walletContextProvided ? null : activeAccount), error];
810
+ };
736
811
 
737
812
  // src/hooks/useWallets.ts
738
813
  import { usePromise as usePromise5 } from "@xylabs/react-promise";
739
- var useWallets = /* @__PURE__ */ __name(({ wallet, paths }) => {
814
+ var useWallets = ({ wallet, paths }) => {
740
815
  const walletContextProvided = useWalletContext(false);
741
- const [foundWallet] = useWallet({
742
- wallet
743
- });
744
- const [wallets, error] = usePromise5(async () => foundWallet ? await Promise.all(paths.map((path) => foundWallet.derivePath(path))) : void 0, [
745
- foundWallet,
746
- paths
747
- ]);
748
- return [
749
- wallets ?? (walletContextProvided ? null : wallets),
750
- error
751
- ];
752
- }, "useWallets");
816
+ const [foundWallet] = useWallet({ wallet });
817
+ const [wallets, error] = usePromise5(
818
+ async () => foundWallet ? await Promise.all(paths.map((path) => foundWallet.derivePath(path))) : void 0,
819
+ [foundWallet, paths]
820
+ );
821
+ return [wallets ?? (walletContextProvided ? null : wallets), error];
822
+ };
753
823
 
754
824
  // src/hooks/useWrapperAccount.ts
755
825
  import { usePromise as usePromise6 } from "@xylabs/react-promise";
@@ -757,7 +827,7 @@ import { HDWallet as HDWallet2 } from "@xyo-network/wallet";
757
827
  import { Mutex } from "async-mutex";
758
828
  var globalWrapperWallet;
759
829
  var globalWrapperWalletMutex = new Mutex();
760
- var useWrapperAccount = /* @__PURE__ */ __name((account) => {
830
+ var useWrapperAccount = (account) => {
761
831
  return usePromise6(async () => {
762
832
  return await globalWrapperWalletMutex.runExclusive(async () => {
763
833
  if (account !== void 0) {
@@ -775,148 +845,168 @@ var useWrapperAccount = /* @__PURE__ */ __name((account) => {
775
845
  }
776
846
  return globalWrapperWallet;
777
847
  });
778
- }, [
779
- account
780
- ]);
781
- }, "useWrapperAccount");
848
+ }, [account]);
849
+ };
782
850
 
783
851
  // src/components/WalletAccountDetails/WalletAccountDetails.tsx
784
- var WalletAccountDetails = /* @__PURE__ */ __name(({ exploreUrl = "https://explore.xyo.network", account, ...props }) => {
785
- const [accountToUse] = useAccount({
786
- account
787
- });
852
+ import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
853
+ var WalletAccountDetails = ({
854
+ exploreUrl = "https://explore.xyo.network",
855
+ account,
856
+ ...props
857
+ }) => {
858
+ const [accountToUse] = useAccount({ account });
788
859
  const { network } = useNetwork();
789
860
  const exploreAddressUrl = `${exploreUrl}/recent?account=${accountToUse?.address}&network=${network?.name ?? "main"}`;
790
- return /* @__PURE__ */ React16.createElement(FlexCol, props, /* @__PURE__ */ React16.createElement(EthAccountButton, {
791
- address: EthAddressWrapper.fromString(accountToUse?.address)
792
- }), /* @__PURE__ */ React16.createElement(FlexRow4, {
793
- gap: 1
794
- }, /* @__PURE__ */ React16.createElement(NumberStatus, {
795
- rounded: true,
796
- title: "Tokens",
797
- value: 0,
798
- to: `${exploreAddressUrl}&schema=network.xyo.account.tokens`,
799
- target: "_blank"
800
- }), /* @__PURE__ */ React16.createElement(NumberStatus, {
801
- rounded: true,
802
- title: "NFTs",
803
- value: 0,
804
- to: `${exploreAddressUrl}&schema=network.xyo.account.nfts`,
805
- target: "_blank"
806
- }), /* @__PURE__ */ React16.createElement(NumberStatus, {
807
- rounded: true,
808
- title: "Signatures",
809
- value: 0,
810
- to: `${exploreAddressUrl}&schema=network.xyo.account.signatures`,
811
- target: "_blank"
812
- }), /* @__PURE__ */ React16.createElement(NumberStatus, {
813
- rounded: true,
814
- title: "Signins",
815
- value: 0,
816
- to: `${exploreAddressUrl}&schema=network.xyo.account.signins`,
817
- target: "_blank"
818
- })));
819
- }, "WalletAccountDetails");
861
+ return /* @__PURE__ */ jsxs14(FlexCol, { ...props, children: [
862
+ /* @__PURE__ */ jsx16(EthAccountButton, { address: EthAddressWrapper.fromString(accountToUse?.address) }),
863
+ /* @__PURE__ */ jsxs14(FlexRow4, { gap: 1, children: [
864
+ /* @__PURE__ */ jsx16(NumberStatus, { rounded: true, title: "Tokens", value: 0, to: `${exploreAddressUrl}&schema=network.xyo.account.tokens`, target: "_blank" }),
865
+ /* @__PURE__ */ jsx16(NumberStatus, { rounded: true, title: "NFTs", value: 0, to: `${exploreAddressUrl}&schema=network.xyo.account.nfts`, target: "_blank" }),
866
+ /* @__PURE__ */ jsx16(NumberStatus, { rounded: true, title: "Signatures", value: 0, to: `${exploreAddressUrl}&schema=network.xyo.account.signatures`, target: "_blank" }),
867
+ /* @__PURE__ */ jsx16(NumberStatus, { rounded: true, title: "Signins", value: 0, to: `${exploreAddressUrl}&schema=network.xyo.account.signins`, target: "_blank" })
868
+ ] })
869
+ ] });
870
+ };
820
871
 
821
872
  // src/components/WalletAccountSelect/Select.tsx
822
873
  import { CircularProgress } from "@mui/material";
823
874
  import { SelectEx } from "@xylabs/react-select";
824
- import React18 from "react";
825
875
 
826
876
  // src/components/WalletAccountSelect/RenderedMenuItem.tsx
827
877
  import { MenuItem } from "@mui/material";
828
878
  import { AddressRenderRowBox } from "@xyo-network/react-address-render";
829
- import React17 from "react";
830
- var RenderedAccountMenuItem = /* @__PURE__ */ __name(({ selectedAccountIndex, rootWallet, addressNames, iconOnly, iconSize, icons, showFavorite }) => {
831
- const [selectedAccount] = useWallet({
832
- path: selectedAccountIndex?.toString(),
833
- wallet: rootWallet
834
- });
879
+ import { jsx as jsx17 } from "react/jsx-runtime";
880
+ var RenderedAccountMenuItem = ({
881
+ selectedAccountIndex,
882
+ rootWallet,
883
+ addressNames,
884
+ iconOnly,
885
+ iconSize,
886
+ icons,
887
+ showFavorite
888
+ }) => {
889
+ const [selectedAccount] = useWallet({ path: selectedAccountIndex?.toString(), wallet: rootWallet });
835
890
  const customName = selectedAccount ? addressNames?.[selectedAccount.address] : void 0;
836
891
  const favorite = !!selectedAccount && selectedAccount.address in (addressNames ?? {});
837
- return /* @__PURE__ */ React17.createElement(MenuItem, {
838
- value: selectedAccountIndex,
839
- sx: {
840
- minHeight: 0,
841
- paddingBottom: 0,
842
- paddingTop: 0
892
+ return /* @__PURE__ */ jsx17(
893
+ MenuItem,
894
+ {
895
+ value: selectedAccountIndex,
896
+ sx: {
897
+ minHeight: 0,
898
+ paddingBottom: 0,
899
+ paddingTop: 0
900
+ },
901
+ children: /* @__PURE__ */ jsx17(
902
+ AddressRenderRowBox,
903
+ {
904
+ disableSharedRef: true,
905
+ flexGrow: 1,
906
+ address: selectedAccount?.address,
907
+ iconOnly,
908
+ iconSize,
909
+ icons,
910
+ name: customName,
911
+ favorite,
912
+ showFavorite
913
+ }
914
+ )
843
915
  }
844
- }, /* @__PURE__ */ React17.createElement(AddressRenderRowBox, {
845
- disableSharedRef: true,
846
- flexGrow: 1,
847
- address: selectedAccount?.address,
848
- iconOnly,
849
- iconSize,
850
- icons,
851
- name: customName,
852
- favorite,
853
- showFavorite
854
- }));
855
- }, "RenderedAccountMenuItem");
916
+ );
917
+ };
856
918
 
857
919
  // src/components/WalletAccountSelect/Select.tsx
858
- var arrayRange = /* @__PURE__ */ __name((length, start = 0) => {
859
- return [
860
- ...Array.from({
861
- length
862
- }).keys()
863
- ].map((x) => x + start);
864
- }, "arrayRange");
865
- var WalletAccountSelect = /* @__PURE__ */ __name(({ addressNames, iconOnly, iconSize = 24, icons, maxAccounts = 1, showFavorite = false, size, variant = "outlined", ...props }) => {
866
- const { activeAccountIndex, setActiveAccountIndex, rootWallet } = useWalletContext();
920
+ import { Fragment as Fragment3, jsx as jsx18 } from "react/jsx-runtime";
921
+ var arrayRange = (length, start = 0) => {
922
+ return [...Array.from({ length }).keys()].map((x) => x + start);
923
+ };
924
+ var WalletAccountSelect = ({
925
+ addressNames,
926
+ iconOnly,
927
+ iconSize = 24,
928
+ icons,
929
+ maxAccounts = 1,
930
+ showFavorite = false,
931
+ size,
932
+ variant = "outlined",
933
+ ...props
934
+ }) => {
935
+ const {
936
+ activeAccountIndex,
937
+ setActiveAccountIndex,
938
+ rootWallet
939
+ } = useWalletContext();
867
940
  const disabled = !rootWallet || activeAccountIndex === void 0;
868
- return /* @__PURE__ */ React18.createElement(React18.Fragment, null, rootWallet ? /* @__PURE__ */ React18.createElement(SelectEx, {
869
- margin: "dense",
870
- disabled,
871
- renderValue: /* @__PURE__ */ __name((selectedAccountIndex) => {
872
- return /* @__PURE__ */ React18.createElement(RenderedAccountMenuItem, {
873
- addressNames,
874
- iconOnly,
875
- iconSize,
876
- icons,
877
- rootWallet,
878
- selectedAccountIndex,
879
- showFavorite
880
- });
881
- }, "renderValue"),
882
- value: activeAccountIndex === void 0 ? "" : activeAccountIndex,
883
- onChange: /* @__PURE__ */ __name((event) => setActiveAccountIndex?.(Number.parseInt(`${event.target.value}`)), "onChange"),
884
- size,
885
- variant,
886
- ...props
887
- }, rootWallet && arrayRange(maxAccounts).map((index) => /* @__PURE__ */ React18.createElement(RenderedAccountMenuItem, {
888
- key: index,
889
- addressNames,
890
- iconOnly,
891
- iconSize,
892
- icons,
893
- rootWallet,
894
- selectedAccountIndex: index,
895
- showFavorite
896
- }))) : /* @__PURE__ */ React18.createElement(CircularProgress, {
897
- size: 24
898
- }));
899
- }, "WalletAccountSelect");
941
+ return /* @__PURE__ */ jsx18(Fragment3, { children: rootWallet ? /* @__PURE__ */ jsx18(
942
+ SelectEx,
943
+ {
944
+ margin: "dense",
945
+ disabled,
946
+ renderValue: (selectedAccountIndex) => {
947
+ return /* @__PURE__ */ jsx18(
948
+ RenderedAccountMenuItem,
949
+ {
950
+ addressNames,
951
+ iconOnly,
952
+ iconSize,
953
+ icons,
954
+ rootWallet,
955
+ selectedAccountIndex,
956
+ showFavorite
957
+ }
958
+ );
959
+ },
960
+ value: activeAccountIndex === void 0 ? "" : activeAccountIndex,
961
+ onChange: (event) => setActiveAccountIndex?.(Number.parseInt(`${event.target.value}`)),
962
+ size,
963
+ variant,
964
+ ...props,
965
+ children: rootWallet && arrayRange(maxAccounts).map((index) => /* @__PURE__ */ jsx18(
966
+ RenderedAccountMenuItem,
967
+ {
968
+ addressNames,
969
+ iconOnly,
970
+ iconSize,
971
+ icons,
972
+ rootWallet,
973
+ selectedAccountIndex: index,
974
+ showFavorite
975
+ },
976
+ index
977
+ ))
978
+ }
979
+ ) : /* @__PURE__ */ jsx18(CircularProgress, { size: 24 }) });
980
+ };
900
981
 
901
982
  // src/components/WalletAccountSelect/SelectBar.tsx
902
983
  import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
903
- import React19 from "react";
904
- var WalletAccountSelectBar = /* @__PURE__ */ __name(({ addressNames, iconOnly, iconSize, icons, maxAccounts = 1, showFavorite = false, size = "small", ...props }) => {
905
- return /* @__PURE__ */ React19.createElement(FlexCol2, {
906
- alignItems: "stretch",
907
- ...props
908
- }, /* @__PURE__ */ React19.createElement(WalletAccountSelect, {
909
- addressNames,
910
- fullWidth: true,
911
- showFavorite,
912
- iconSize,
913
- iconOnly,
914
- icons,
915
- maxAccounts,
916
- size: size ?? "small",
917
- variant: "outlined"
918
- }));
919
- }, "WalletAccountSelectBar");
984
+ import { jsx as jsx19 } from "react/jsx-runtime";
985
+ var WalletAccountSelectBar = ({
986
+ addressNames,
987
+ iconOnly,
988
+ iconSize,
989
+ icons,
990
+ maxAccounts = 1,
991
+ showFavorite = false,
992
+ size = "small",
993
+ ...props
994
+ }) => {
995
+ return /* @__PURE__ */ jsx19(FlexCol2, { alignItems: "stretch", ...props, children: /* @__PURE__ */ jsx19(
996
+ WalletAccountSelect,
997
+ {
998
+ addressNames,
999
+ fullWidth: true,
1000
+ showFavorite,
1001
+ iconSize,
1002
+ iconOnly,
1003
+ icons,
1004
+ maxAccounts,
1005
+ size: size ?? "small",
1006
+ variant: "outlined"
1007
+ }
1008
+ ) });
1009
+ };
920
1010
  export {
921
1011
  DefaultSeedPhrase,
922
1012
  DialogActionButtons,