@xyo-network/react-wallet 2.69.3 → 2.69.4
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/SeedPhrase/dialog/SeedPhraseDialog.d.cts.map +1 -1
- package/dist/browser/components/SeedPhrase/dialog/SeedPhraseDialog.d.mts.map +1 -1
- package/dist/browser/components/SeedPhrase/dialog/SeedPhraseDialog.d.ts.map +1 -1
- package/dist/browser/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.d.cts +6 -2
- package/dist/browser/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.d.cts.map +1 -1
- package/dist/browser/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.d.mts +6 -2
- package/dist/browser/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.d.mts.map +1 -1
- package/dist/browser/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.d.ts +6 -2
- package/dist/browser/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.d.ts.map +1 -1
- package/dist/browser/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.d.cts +2 -0
- package/dist/browser/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.d.cts.map +1 -0
- package/dist/browser/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.d.mts +2 -0
- package/dist/browser/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.d.mts.map +1 -0
- package/dist/browser/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.d.ts +2 -0
- package/dist/browser/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.d.ts.map +1 -0
- package/dist/browser/components/SeedPhrase/dialog/components/fields/index.d.cts +2 -0
- package/dist/browser/components/SeedPhrase/dialog/components/fields/index.d.cts.map +1 -1
- package/dist/browser/components/SeedPhrase/dialog/components/fields/index.d.mts +2 -0
- package/dist/browser/components/SeedPhrase/dialog/components/fields/index.d.mts.map +1 -1
- package/dist/browser/components/SeedPhrase/dialog/components/fields/index.d.ts +2 -0
- package/dist/browser/components/SeedPhrase/dialog/components/fields/index.d.ts.map +1 -1
- package/dist/browser/index.cjs +104 -94
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +101 -91
- package/dist/browser/index.js.map +1 -1
- package/dist/node/components/SeedPhrase/dialog/SeedPhraseDialog.d.cts.map +1 -1
- package/dist/node/components/SeedPhrase/dialog/SeedPhraseDialog.d.mts.map +1 -1
- package/dist/node/components/SeedPhrase/dialog/SeedPhraseDialog.d.ts.map +1 -1
- package/dist/node/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.d.cts +6 -2
- package/dist/node/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.d.cts.map +1 -1
- package/dist/node/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.d.mts +6 -2
- package/dist/node/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.d.mts.map +1 -1
- package/dist/node/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.d.ts +6 -2
- package/dist/node/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.d.ts.map +1 -1
- package/dist/node/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.d.cts +2 -0
- package/dist/node/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.d.cts.map +1 -0
- package/dist/node/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.d.mts +2 -0
- package/dist/node/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.d.mts.map +1 -0
- package/dist/node/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.d.ts +2 -0
- package/dist/node/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.d.ts.map +1 -0
- package/dist/node/components/SeedPhrase/dialog/components/fields/index.d.cts +2 -0
- package/dist/node/components/SeedPhrase/dialog/components/fields/index.d.cts.map +1 -1
- package/dist/node/components/SeedPhrase/dialog/components/fields/index.d.mts +2 -0
- package/dist/node/components/SeedPhrase/dialog/components/fields/index.d.mts.map +1 -1
- package/dist/node/components/SeedPhrase/dialog/components/fields/index.d.ts +2 -0
- package/dist/node/components/SeedPhrase/dialog/components/fields/index.d.ts.map +1 -1
- package/dist/node/index.cjs +108 -94
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +101 -91
- package/dist/node/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/SeedPhrase/dialog/SeedPhraseDialog.tsx +9 -4
- package/src/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.tsx +12 -16
- package/src/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.tsx +17 -0
- package/src/components/SeedPhrase/dialog/components/fields/index.ts +2 -0
- package/src/contexts/SeedPhrase/Provider.tsx +15 -15
package/dist/browser/index.js
CHANGED
|
@@ -170,7 +170,7 @@ var SeedPhraseContext = createContextEx();
|
|
|
170
170
|
// src/contexts/SeedPhrase/Provider.tsx
|
|
171
171
|
import { generateMnemonic as generateMnemonic2, validateMnemonic } from "@scure/bip39";
|
|
172
172
|
import { wordlist as wordlist2 } from "@scure/bip39/wordlists/english";
|
|
173
|
-
import { useEffect as useEffect2, useMemo, useState as useState4 } from "react";
|
|
173
|
+
import { useCallback, useEffect as useEffect2, useMemo, useState as useState4 } from "react";
|
|
174
174
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
175
175
|
var validate = (passedPhrase) => {
|
|
176
176
|
if (!passedPhrase) {
|
|
@@ -191,36 +191,36 @@ var SeedPhraseProvider = ({
|
|
|
191
191
|
useEffect2(() => {
|
|
192
192
|
setPhrase(defaultPhrase);
|
|
193
193
|
}, [defaultPhrase]);
|
|
194
|
-
useEffect2(() => {
|
|
195
|
-
if (!open) {
|
|
196
|
-
handleCancelOverwrite();
|
|
197
|
-
}
|
|
198
|
-
}, [open]);
|
|
199
194
|
useEffect2(() => {
|
|
200
195
|
if (seedPhrase || open) {
|
|
201
196
|
setPhrase?.(seedPhrase ?? "");
|
|
202
197
|
}
|
|
203
198
|
}, [seedPhrase, open, setPhrase]);
|
|
204
|
-
const handleGenerate = () => {
|
|
199
|
+
const handleGenerate = useCallback(() => {
|
|
205
200
|
const mnemonic = generateMnemonic2(wordlist2, 256);
|
|
206
201
|
setPhrase?.(mnemonic);
|
|
207
202
|
setOverwriteWarning?.(false);
|
|
208
|
-
};
|
|
209
|
-
const handleCancelOverwrite = () => {
|
|
203
|
+
}, []);
|
|
204
|
+
const handleCancelOverwrite = useCallback(() => {
|
|
210
205
|
setOverwriteWarning?.(false);
|
|
211
|
-
};
|
|
212
|
-
const handleClear = () => {
|
|
206
|
+
}, []);
|
|
207
|
+
const handleClear = useCallback(() => {
|
|
213
208
|
setPhrase?.("");
|
|
214
209
|
setOverwriteWarning?.(false);
|
|
215
|
-
};
|
|
216
|
-
const handleSave = () => {
|
|
210
|
+
}, []);
|
|
211
|
+
const handleSave = useCallback(() => {
|
|
217
212
|
if (!overwriteWarning && seedPhrase && seedPhrase !== phrase) {
|
|
218
213
|
setOverwriteWarning?.(true);
|
|
219
214
|
} else {
|
|
220
215
|
handleChangeSeedPhrase?.(phrase ?? "");
|
|
221
216
|
saveCallback?.();
|
|
222
217
|
}
|
|
223
|
-
};
|
|
218
|
+
}, [handleChangeSeedPhrase, overwriteWarning, phrase, saveCallback, seedPhrase]);
|
|
219
|
+
useEffect2(() => {
|
|
220
|
+
if (!open) {
|
|
221
|
+
handleCancelOverwrite();
|
|
222
|
+
}
|
|
223
|
+
}, [handleCancelOverwrite, open]);
|
|
224
224
|
const validSeedPhrase = useMemo(() => validate?.(seedPhrase), [seedPhrase]);
|
|
225
225
|
const validPhrase = useMemo(() => validate?.(phrase), [phrase]);
|
|
226
226
|
return /* @__PURE__ */ jsx5(
|
|
@@ -369,7 +369,7 @@ var DialogActionButtons = ({ onClose, ...props }) => {
|
|
|
369
369
|
};
|
|
370
370
|
|
|
371
371
|
// src/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.tsx
|
|
372
|
-
import {
|
|
372
|
+
import { FormControl, TextField } from "@mui/material";
|
|
373
373
|
|
|
374
374
|
// src/components/SeedPhrase/dialog/components/fields/validation-messages/colorParser.ts
|
|
375
375
|
var colorParser = (conditional) => {
|
|
@@ -435,52 +435,57 @@ var PhraseHeaderBox = ({ children, conditional, ...props }) => {
|
|
|
435
435
|
|
|
436
436
|
// src/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.tsx
|
|
437
437
|
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
438
|
-
var NewPhraseTextField = (props) => {
|
|
439
|
-
const {
|
|
440
|
-
return /* @__PURE__ */
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
438
|
+
var NewPhraseTextField = ({ children, disableColor, ...props }) => {
|
|
439
|
+
const { phrase, setPhrase, validPhrase } = useSeedPhrase();
|
|
440
|
+
return /* @__PURE__ */ jsx10(Fragment3, { children: /* @__PURE__ */ jsxs8(FormControl, { fullWidth: true, size: "small", sx: { display: "flex", flexDirection: "column", rowGap: 1 }, children: [
|
|
441
|
+
children,
|
|
442
|
+
/* @__PURE__ */ jsx10(
|
|
443
|
+
TextField,
|
|
444
|
+
{
|
|
445
|
+
focused: true,
|
|
446
|
+
color: disableColor ? void 0 : colorParser(validPhrase),
|
|
447
|
+
error: validPhrase === false,
|
|
448
|
+
helperText: validPhrase === false ? /* @__PURE__ */ jsx10(InvalidPhraseTypography, {}) : null,
|
|
449
|
+
fullWidth: true,
|
|
450
|
+
maxRows: Number.POSITIVE_INFINITY,
|
|
451
|
+
multiline: true,
|
|
452
|
+
onChange: (e) => setPhrase?.(e.target.value),
|
|
453
|
+
value: phrase,
|
|
454
|
+
...props
|
|
455
|
+
}
|
|
456
|
+
)
|
|
457
|
+
] }) });
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
// src/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.tsx
|
|
461
|
+
import { Button as Button3, DialogActions as DialogActions3 } from "@mui/material";
|
|
462
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
463
|
+
var PhraseDialogActions = () => {
|
|
464
|
+
const { handleClear, handleGenerate, overwriteWarning } = useSeedPhrase();
|
|
465
|
+
return /* @__PURE__ */ jsxs9(DialogActions3, { sx: { justifyContent: "center" }, children: [
|
|
466
|
+
/* @__PURE__ */ jsx11(Button3, { disabled: overwriteWarning, variant: "outlined", onClick: handleGenerate, children: "Generate" }),
|
|
467
|
+
/* @__PURE__ */ jsx11(Button3, { variant: "outlined", onClick: handleClear, children: "Clear" })
|
|
463
468
|
] });
|
|
464
469
|
};
|
|
465
470
|
|
|
466
471
|
// src/components/SeedPhrase/dialog/components/fields/SavedPhraseTextField.tsx
|
|
467
|
-
import { Chip, FormControl as FormControl2, FormLabel
|
|
472
|
+
import { Chip, FormControl as FormControl2, FormLabel, TextField as TextField2 } from "@mui/material";
|
|
468
473
|
import { useState as useState6 } from "react";
|
|
469
|
-
import { Fragment as Fragment4, jsx as
|
|
474
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
470
475
|
var SavedPhraseTextField = (props) => {
|
|
471
476
|
const { validSeedPhrase, seedPhrase } = useSeedPhrase();
|
|
472
477
|
const [visible, setVisible] = useState6(false);
|
|
473
|
-
return /* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
visible ? /* @__PURE__ */
|
|
476
|
-
/* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
+
return /* @__PURE__ */ jsxs10(FormControl2, { fullWidth: true, size: "small", sx: { display: "flex", flexDirection: "column", rowGap: 1 }, children: [
|
|
479
|
+
/* @__PURE__ */ jsx12(Chip, { label: visible ? "Hide Saved Seed Phrase" : "Reveal Saved Seed Phrase", onClick: () => setVisible(!visible) }),
|
|
480
|
+
visible ? /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
481
|
+
/* @__PURE__ */ jsx12(FormLabel, { children: /* @__PURE__ */ jsx12(PhraseHeaderBox, { conditional: validSeedPhrase, children: "Saved Seed Phrase" }) }),
|
|
482
|
+
/* @__PURE__ */ jsx12(
|
|
478
483
|
TextField2,
|
|
479
484
|
{
|
|
480
485
|
defaultValue: seedPhrase,
|
|
481
486
|
disabled: true,
|
|
482
487
|
error: validSeedPhrase === false,
|
|
483
|
-
helperText: validSeedPhrase === false ? /* @__PURE__ */
|
|
488
|
+
helperText: validSeedPhrase === false ? /* @__PURE__ */ jsx12(InvalidPhraseTypography, {}) : null,
|
|
484
489
|
fullWidth: true,
|
|
485
490
|
maxRows: Number.POSITIVE_INFINITY,
|
|
486
491
|
multiline: true,
|
|
@@ -494,17 +499,17 @@ var SavedPhraseTextField = (props) => {
|
|
|
494
499
|
// src/components/SeedPhrase/dialog/components/OverwriteWarning.tsx
|
|
495
500
|
import { Alert as Alert3, Button as Button4 } from "@mui/material";
|
|
496
501
|
import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
497
|
-
import { jsx as
|
|
502
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
498
503
|
var OverwriteWarning = () => {
|
|
499
504
|
const { handleCancelOverwrite, handleSave } = useSeedPhrase();
|
|
500
|
-
return /* @__PURE__ */
|
|
505
|
+
return /* @__PURE__ */ jsx13(
|
|
501
506
|
Alert3,
|
|
502
507
|
{
|
|
503
508
|
variant: "outlined",
|
|
504
509
|
severity: "warning",
|
|
505
|
-
action: /* @__PURE__ */
|
|
506
|
-
/* @__PURE__ */
|
|
507
|
-
/* @__PURE__ */
|
|
510
|
+
action: /* @__PURE__ */ jsxs11(FlexRow2, { sx: { columnGap: 1 }, children: [
|
|
511
|
+
/* @__PURE__ */ jsx13(Button4, { variant: "outlined", color: "inherit", size: "small", onClick: handleSave, children: "Overwrite" }),
|
|
512
|
+
/* @__PURE__ */ jsx13(Button4, { variant: "outlined", color: "inherit", size: "small", onClick: handleCancelOverwrite, children: "Cancel" })
|
|
508
513
|
] }),
|
|
509
514
|
children: "Are you sure you want to overwrite existing seed phrase? This action cannot be undone."
|
|
510
515
|
}
|
|
@@ -512,33 +517,34 @@ var OverwriteWarning = () => {
|
|
|
512
517
|
};
|
|
513
518
|
|
|
514
519
|
// src/components/SeedPhrase/dialog/SeedPhraseDialog.tsx
|
|
515
|
-
import { Dialog as Dialog2, DialogContent as DialogContent2, DialogTitle as DialogTitle2 } from "@mui/material";
|
|
516
|
-
import { jsx as
|
|
520
|
+
import { Dialog as Dialog2, DialogContent as DialogContent2, DialogTitle as DialogTitle2, FormLabel as FormLabel2 } from "@mui/material";
|
|
521
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
517
522
|
var SeedPhraseDialog = ({ changeSeedPhrase, seedPhrase, ...props }) => {
|
|
518
|
-
return /* @__PURE__ */
|
|
523
|
+
return /* @__PURE__ */ jsx14(
|
|
519
524
|
SeedPhraseProvider,
|
|
520
525
|
{
|
|
521
526
|
seedPhrase,
|
|
522
527
|
handleChangeSeedPhrase: changeSeedPhrase,
|
|
523
528
|
open: props.open,
|
|
524
529
|
saveCallback: () => props.onClose?.({}, "escapeKeyDown"),
|
|
525
|
-
children: /* @__PURE__ */
|
|
530
|
+
children: /* @__PURE__ */ jsx14(SeedPhraseDialogInner, { ...props })
|
|
526
531
|
}
|
|
527
532
|
);
|
|
528
533
|
};
|
|
529
534
|
var SeedPhraseDialogInner = (props) => {
|
|
530
|
-
const { overwriteWarning, seedPhrase } = useSeedPhrase();
|
|
531
|
-
return /* @__PURE__ */
|
|
532
|
-
/* @__PURE__ */
|
|
535
|
+
const { overwriteWarning, seedPhrase, validPhrase } = useSeedPhrase();
|
|
536
|
+
return /* @__PURE__ */ jsxs12(Dialog2, { "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description", fullWidth: true, maxWidth: "sm", ...props, children: [
|
|
537
|
+
/* @__PURE__ */ jsxs12(DialogTitle2, { id: "alert-dialog-title", children: [
|
|
533
538
|
"Update Your Seed Phrase ",
|
|
534
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ jsx14(SeedPhraseIconButton, {})
|
|
535
540
|
] }),
|
|
536
|
-
/* @__PURE__ */
|
|
537
|
-
/* @__PURE__ */
|
|
538
|
-
|
|
539
|
-
|
|
541
|
+
/* @__PURE__ */ jsxs12(DialogContent2, { sx: { display: "flex", flexDirection: "column", rowGap: 2 }, children: [
|
|
542
|
+
/* @__PURE__ */ jsx14(NewPhraseTextField, { children: /* @__PURE__ */ jsx14(FormLabel2, { children: /* @__PURE__ */ jsx14(PhraseHeaderBox, { conditional: validPhrase, children: "New Seed Phrase" }) }) }),
|
|
543
|
+
/* @__PURE__ */ jsx14(PhraseDialogActions, {}),
|
|
544
|
+
seedPhrase ? /* @__PURE__ */ jsx14(SavedPhraseTextField, {}) : null,
|
|
545
|
+
overwriteWarning ? /* @__PURE__ */ jsx14(OverwriteWarning, {}) : null
|
|
540
546
|
] }),
|
|
541
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ jsx14(DialogActionButtons, { onClose: props.onClose })
|
|
542
548
|
] });
|
|
543
549
|
};
|
|
544
550
|
|
|
@@ -546,21 +552,21 @@ var SeedPhraseDialogInner = (props) => {
|
|
|
546
552
|
import { Cancel as CancelIcon, RadioButtonChecked as RadioButtonCheckedIcon } from "@mui/icons-material";
|
|
547
553
|
import { Button as Button5, ButtonGroup as ButtonGroup2, TableCell as TableCell2, TableRow as TableRow2 } from "@mui/material";
|
|
548
554
|
import { useState as useState7 } from "react";
|
|
549
|
-
import { jsx as
|
|
555
|
+
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
550
556
|
var SeedPhraseTableRow = ({ changeSeedPhrase, seedPhrase, ...props }) => {
|
|
551
557
|
const [open, setOpen] = useState7(false);
|
|
552
558
|
const handleOpen = () => {
|
|
553
559
|
setOpen(true);
|
|
554
560
|
};
|
|
555
|
-
return /* @__PURE__ */
|
|
556
|
-
/* @__PURE__ */
|
|
561
|
+
return /* @__PURE__ */ jsxs13(TableRow2, { ...props, children: [
|
|
562
|
+
/* @__PURE__ */ jsxs13(TableCell2, { children: [
|
|
557
563
|
"Seed Phrase ",
|
|
558
|
-
/* @__PURE__ */
|
|
564
|
+
/* @__PURE__ */ jsx15(SeedPhraseIconButton, {})
|
|
559
565
|
] }),
|
|
560
|
-
/* @__PURE__ */
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
/* @__PURE__ */
|
|
563
|
-
/* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ jsx15(TableCell2, { align: "center", children: seedPhrase ? /* @__PURE__ */ jsx15(RadioButtonCheckedIcon, { color: "success" }) : /* @__PURE__ */ jsx15(CancelIcon, { color: "error" }) }),
|
|
567
|
+
/* @__PURE__ */ jsxs13(TableCell2, { children: [
|
|
568
|
+
/* @__PURE__ */ jsx15(SeedPhraseDialog, { changeSeedPhrase, open, onClose: () => setOpen(false), seedPhrase }),
|
|
569
|
+
/* @__PURE__ */ jsx15(ButtonGroup2, { fullWidth: true, children: /* @__PURE__ */ jsx15(Button5, { variant: "contained", size: "small", onClick: handleOpen, children: "Update" }) })
|
|
564
570
|
] })
|
|
565
571
|
] });
|
|
566
572
|
};
|
|
@@ -680,18 +686,18 @@ var useWrapperAccount = (account) => {
|
|
|
680
686
|
};
|
|
681
687
|
|
|
682
688
|
// src/components/WalletAccountDetails/WalletAccountDetails.tsx
|
|
683
|
-
import { jsx as
|
|
689
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
684
690
|
var WalletAccountDetails = ({ exploreUrl = "https://explore.xyo.network", account, ...props }) => {
|
|
685
691
|
const [accountToUse] = useAccount({ account });
|
|
686
692
|
const { network } = useNetwork();
|
|
687
693
|
const exploreAddressUrl = `${exploreUrl}/recent?account=${accountToUse?.address}&network=${network?.name ?? "main"}`;
|
|
688
|
-
return /* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
/* @__PURE__ */
|
|
692
|
-
/* @__PURE__ */
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
/* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ jsxs14(FlexCol, { ...props, children: [
|
|
695
|
+
/* @__PURE__ */ jsx16(EthAccountButton, { address: EthAddress.fromString(accountToUse?.address) }),
|
|
696
|
+
/* @__PURE__ */ jsxs14(FlexRow3, { gap: 1, children: [
|
|
697
|
+
/* @__PURE__ */ jsx16(NumberStatus, { rounded: true, title: "Tokens", value: 0, to: `${exploreAddressUrl}&schema=network.xyo.account.tokens`, target: "_blank" }),
|
|
698
|
+
/* @__PURE__ */ jsx16(NumberStatus, { rounded: true, title: "NFTs", value: 0, to: `${exploreAddressUrl}&schema=network.xyo.account.nfts`, target: "_blank" }),
|
|
699
|
+
/* @__PURE__ */ jsx16(NumberStatus, { rounded: true, title: "Signatures", value: 0, to: `${exploreAddressUrl}&schema=network.xyo.account.signatures`, target: "_blank" }),
|
|
700
|
+
/* @__PURE__ */ jsx16(NumberStatus, { rounded: true, title: "Signins", value: 0, to: `${exploreAddressUrl}&schema=network.xyo.account.signins`, target: "_blank" })
|
|
695
701
|
] })
|
|
696
702
|
] });
|
|
697
703
|
};
|
|
@@ -700,7 +706,7 @@ var WalletAccountDetails = ({ exploreUrl = "https://explore.xyo.network", accoun
|
|
|
700
706
|
import { CircularProgress, MenuItem } from "@mui/material";
|
|
701
707
|
import { SelectEx } from "@xylabs/react-select";
|
|
702
708
|
import { AddressRenderRowBox } from "@xyo-network/react-address-render";
|
|
703
|
-
import { Fragment as Fragment5, jsx as
|
|
709
|
+
import { Fragment as Fragment5, jsx as jsx17 } from "react/jsx-runtime";
|
|
704
710
|
var arrayRange = (length, start = 0) => {
|
|
705
711
|
return [...Array.from({ length }).keys()].map((x) => x + start);
|
|
706
712
|
};
|
|
@@ -717,7 +723,7 @@ var WalletAccountSelect = ({
|
|
|
717
723
|
}) => {
|
|
718
724
|
const { activeAccountIndex = 0, setActiveAccountIndex, coinTypeWallet } = useWalletContext();
|
|
719
725
|
const disabled = !coinTypeWallet || activeAccountIndex === void 0;
|
|
720
|
-
return /* @__PURE__ */
|
|
726
|
+
return /* @__PURE__ */ jsx17(Fragment5, { children: coinTypeWallet ? /* @__PURE__ */ jsx17(
|
|
721
727
|
SelectEx,
|
|
722
728
|
{
|
|
723
729
|
margin: "dense",
|
|
@@ -727,7 +733,7 @@ var WalletAccountSelect = ({
|
|
|
727
733
|
const [selectedAccount] = useWallet({ path: selectedAccountIndex.toString(), wallet: coinTypeWallet });
|
|
728
734
|
const customName = selectedAccount ? addressNames[selectedAccount.address] : void 0;
|
|
729
735
|
const favorite = !!selectedAccount && selectedAccount.address in addressNames;
|
|
730
|
-
return /* @__PURE__ */
|
|
736
|
+
return /* @__PURE__ */ jsx17(MenuItem, { value: selectedAccountIndex, sx: { minHeight: 0, paddingBottom: 0, paddingTop: 0 }, children: /* @__PURE__ */ jsx17(
|
|
731
737
|
AddressRenderRowBox,
|
|
732
738
|
{
|
|
733
739
|
disableSharedRef: true,
|
|
@@ -742,7 +748,7 @@ var WalletAccountSelect = ({
|
|
|
742
748
|
}
|
|
743
749
|
) });
|
|
744
750
|
};
|
|
745
|
-
return /* @__PURE__ */
|
|
751
|
+
return /* @__PURE__ */ jsx17(Item, {});
|
|
746
752
|
},
|
|
747
753
|
value: activeAccountIndex,
|
|
748
754
|
onChange: (event) => setActiveAccountIndex?.(Number.parseInt(`${event.target.value}`)),
|
|
@@ -754,7 +760,7 @@ var WalletAccountSelect = ({
|
|
|
754
760
|
const [account] = useWallet({ path: index.toString(), wallet: coinTypeWallet });
|
|
755
761
|
const customName = account ? addressNames[account.address] : void 0;
|
|
756
762
|
const favorite = !!account && account.address in addressNames;
|
|
757
|
-
return /* @__PURE__ */
|
|
763
|
+
return /* @__PURE__ */ jsx17(MenuItem, { value: index, sx: { minHeight: 0, paddingBottom: 0, paddingTop: 0 }, children: /* @__PURE__ */ jsx17(
|
|
758
764
|
AddressRenderRowBox,
|
|
759
765
|
{
|
|
760
766
|
disableSharedRef: true,
|
|
@@ -769,15 +775,15 @@ var WalletAccountSelect = ({
|
|
|
769
775
|
}
|
|
770
776
|
) }, account?.address);
|
|
771
777
|
};
|
|
772
|
-
return /* @__PURE__ */
|
|
778
|
+
return /* @__PURE__ */ jsx17(Item, {}, index);
|
|
773
779
|
})
|
|
774
780
|
}
|
|
775
|
-
) : /* @__PURE__ */
|
|
781
|
+
) : /* @__PURE__ */ jsx17(CircularProgress, { size: 24 }) });
|
|
776
782
|
};
|
|
777
783
|
|
|
778
784
|
// src/components/WalletAccountSelect/SelectBar.tsx
|
|
779
785
|
import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
|
|
780
|
-
import { jsx as
|
|
786
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
781
787
|
var WalletAccountSelectBar = ({
|
|
782
788
|
addressNames = {},
|
|
783
789
|
iconOnly,
|
|
@@ -788,7 +794,7 @@ var WalletAccountSelectBar = ({
|
|
|
788
794
|
size = "small",
|
|
789
795
|
...props
|
|
790
796
|
}) => {
|
|
791
|
-
return /* @__PURE__ */
|
|
797
|
+
return /* @__PURE__ */ jsx18(FlexCol2, { alignItems: "stretch", ...props, children: /* @__PURE__ */ jsx18(
|
|
792
798
|
WalletAccountSelect,
|
|
793
799
|
{
|
|
794
800
|
addressNames,
|
|
@@ -807,9 +813,12 @@ export {
|
|
|
807
813
|
Bip44,
|
|
808
814
|
DefaultSeedPhrase,
|
|
809
815
|
DialogActionButtons,
|
|
816
|
+
InvalidPhraseTypography,
|
|
810
817
|
MaxAccountsTableRow,
|
|
811
818
|
NewPhraseTextField,
|
|
812
819
|
OverwriteWarning,
|
|
820
|
+
PhraseDialogActions,
|
|
821
|
+
PhraseHeaderBox,
|
|
813
822
|
SavedPhraseTextField,
|
|
814
823
|
SeedPhraseContext,
|
|
815
824
|
SeedPhraseDialog,
|
|
@@ -823,6 +832,7 @@ export {
|
|
|
823
832
|
WalletContext,
|
|
824
833
|
WalletProvider,
|
|
825
834
|
WalletRootPath,
|
|
835
|
+
colorParser,
|
|
826
836
|
ethereumAccountPath,
|
|
827
837
|
useAccount,
|
|
828
838
|
useCoinTypeWallet,
|