@xyo-network/react-wallet 4.2.11 → 4.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  export interface SeedPhraseDialogProps extends DialogProps {
4
4
  changeSeedPhrase?: (value: string) => void;
5
5
  seedPhrase?: string;
6
+ showCopyButton?: boolean;
6
7
  }
7
8
  export declare const SeedPhraseDialog: React.FC<SeedPhraseDialogProps>;
8
9
  export declare const SeedPhraseDialogInner: React.FC<SeedPhraseDialogProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"SeedPhraseDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/SeedPhrase/dialog/SeedPhraseDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAIhD,OAAO,KAAK,MAAM,OAAO,CAAA;AAazB,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAa5D,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAgCjE,CAAA"}
1
+ {"version":3,"file":"SeedPhraseDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/SeedPhrase/dialog/SeedPhraseDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAIhD,OAAO,KAAK,MAAM,OAAO,CAAA;AAazB,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAa5D,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAgCjE,CAAA"}
@@ -2,7 +2,9 @@ import type { StandardTextFieldProps } from '@mui/material';
2
2
  import React from 'react';
3
3
  export interface SavedPhraseTextFieldProps extends StandardTextFieldProps {
4
4
  fullWidth?: boolean;
5
+ showCopyButton?: boolean;
5
6
  showPhraseHeader?: boolean;
7
+ visible?: boolean;
6
8
  }
7
9
  export declare const SavedPhraseTextField: React.FC<SavedPhraseTextFieldProps>;
8
10
  //# sourceMappingURL=SavedPhraseTextField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SavedPhraseTextField.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/SeedPhrase/dialog/components/fields/SavedPhraseTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAI3D,OAAO,KAAmB,MAAM,OAAO,CAAA;AAKvC,MAAM,WAAW,yBAA0B,SAAQ,sBAAsB;IACvE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA6CpE,CAAA"}
1
+ {"version":3,"file":"SavedPhraseTextField.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/SeedPhrase/dialog/components/fields/SavedPhraseTextField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAM3D,OAAO,KAA4B,MAAM,OAAO,CAAA;AAKhD,MAAM,WAAW,yBAA0B,SAAQ,sBAAsB;IACvE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAyEpE,CAAA"}
@@ -1,9 +1,12 @@
1
+ import type { EnumValue } from '@xylabs/object';
2
+ import { Enum } from '@xylabs/object';
1
3
  import type { DependencyList } from 'react';
2
- export declare enum State {
3
- pending = "pending",
4
- rejected = "rejected",
5
- resolved = "resolved"
6
- }
4
+ export declare const State: Enum<{
5
+ pending: "pending";
6
+ rejected: "rejected";
7
+ resolved: "resolved";
8
+ }>;
9
+ export type State = EnumValue<typeof State>;
7
10
  /**
8
11
  * usePromise -
9
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"usePromise.d.ts","sourceRoot":"","sources":["../../../../src/contexts/Wallet/usePromise.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAK3C,oBAAY,KAAK;IACf,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,WACvB,MAAM,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,gBAC7B,cAAc,UACrB,MAAM,GAAG,SAAS,KACxB,CAAC,OAAO,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,CA6D5D,CAAA"}
1
+ {"version":3,"file":"usePromise.d.ts","sourceRoot":"","sources":["../../../../src/contexts/Wallet/usePromise.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAErC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAK3C,eAAO,MAAM,KAAK;;;;EAIhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,KAAK,CAAC,CAAA;AAE3C;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,WACvB,MAAM,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,gBAC7B,cAAc,UACrB,MAAM,GAAG,SAAS,KACxB,CAAC,OAAO,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,CA6D5D,CAAA"}
@@ -3,7 +3,7 @@ export interface WalletHookParams {
3
3
  mnemonic?: string;
4
4
  path?: string;
5
5
  required?: boolean;
6
- seed?: Uint8Array | string;
6
+ seed?: ArrayBufferLike | string;
7
7
  wallet?: WalletInstance | null;
8
8
  }
9
9
  export declare const useWallet: ({ mnemonic, wallet, path, required, seed, }?: WalletHookParams) => [WalletInstance | null | undefined, Error | undefined];
@@ -1 +1 @@
1
- {"version":3,"file":"useWallet.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWallet.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAK/D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAAA;IAC1B,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;CAC/B;AAED,eAAO,MAAM,SAAS,iDAEnB,gBAAgB,KAAQ,CACzB,cAAc,GAAG,IAAI,GAAG,SAAS,EACjC,KAAK,GAAG,SAAS,CAwBlB,CAAA"}
1
+ {"version":3,"file":"useWallet.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWallet.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAK/D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM,CAAA;IAC/B,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;CAC/B;AAED,eAAO,MAAM,SAAS,iDAEnB,gBAAgB,KAAQ,CACzB,cAAc,GAAG,IAAI,GAAG,SAAS,EACjC,KAAK,GAAG,SAAS,CAwBlB,CAAA"}
@@ -455,11 +455,30 @@ var PhraseDialogActions = /* @__PURE__ */ __name(() => {
455
455
  }, "PhraseDialogActions");
456
456
 
457
457
  // src/components/SeedPhrase/dialog/components/fields/SavedPhraseTextField.tsx
458
- import { Chip, FormControl as FormControl2, FormLabel, TextField as TextField2 } from "@mui/material";
459
- import React12, { useState as useState5 } from "react";
460
- var SavedPhraseTextField = /* @__PURE__ */ __name(({ fullWidth, showPhraseHeader, ...props }) => {
458
+ import { ContentCopy } from "@mui/icons-material";
459
+ import { Chip, FormControl as FormControl2, FormLabel, IconButton as IconButton2, TextField as TextField2, Tooltip } from "@mui/material";
460
+ import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
461
+ import React12, { useMemo as useMemo5, useState as useState5 } from "react";
462
+ var SavedPhraseTextField = /* @__PURE__ */ __name(({ fullWidth, showCopyButton, showPhraseHeader, visible: visibleProp, ...props }) => {
461
463
  const { validSeedPhrase, seedPhrase } = useSeedPhrase();
462
- const [visible, setVisible] = useState5(false);
464
+ const [visible, setVisible] = useState5(visibleProp);
465
+ useMemo5(() => {
466
+ setVisible(visibleProp);
467
+ }, [
468
+ visibleProp
469
+ ]);
470
+ const [copied, setCopied] = useState5(false);
471
+ const onCopyPhrase = /* @__PURE__ */ __name(async () => {
472
+ if (seedPhrase) {
473
+ try {
474
+ await navigator.clipboard.writeText(seedPhrase);
475
+ setCopied(true);
476
+ setTimeout(() => setCopied(false), 2e3);
477
+ } catch (e) {
478
+ console.error("Error copying resolvedSelectedAddress to clipboard", e);
479
+ }
480
+ }
481
+ }, "onCopyPhrase");
463
482
  return /* @__PURE__ */ React12.createElement(FormControl2, {
464
483
  fullWidth,
465
484
  size: "small",
@@ -468,13 +487,21 @@ var SavedPhraseTextField = /* @__PURE__ */ __name(({ fullWidth, showPhraseHeader
468
487
  flexDirection: "column",
469
488
  rowGap: 1
470
489
  }
490
+ }, /* @__PURE__ */ React12.createElement(FlexRow2, {
491
+ gap: 0.5
471
492
  }, /* @__PURE__ */ React12.createElement(Chip, {
472
493
  label: visible ? "Hide Saved Seed Phrase" : "Reveal Saved Seed Phrase",
473
494
  onClick: /* @__PURE__ */ __name(() => setVisible(!visible), "onClick"),
474
495
  sx: {
475
496
  alignSelf: "center"
476
497
  }
477
- }), visible ? /* @__PURE__ */ React12.createElement(React12.Fragment, null, showPhraseHeader ? /* @__PURE__ */ React12.createElement(FormLabel, null, /* @__PURE__ */ React12.createElement(PhraseHeaderBox, {
498
+ }), showCopyButton && visible ? /* @__PURE__ */ React12.createElement(Tooltip, {
499
+ title: copied ? "Copied!" : "Copy"
500
+ }, /* @__PURE__ */ React12.createElement(IconButton2, {
501
+ onClick: /* @__PURE__ */ __name(() => void onCopyPhrase(), "onClick")
502
+ }, /* @__PURE__ */ React12.createElement(ContentCopy, {
503
+ fontSize: "small"
504
+ }))) : null), visible ? /* @__PURE__ */ React12.createElement(React12.Fragment, null, showPhraseHeader ? /* @__PURE__ */ React12.createElement(FormLabel, null, /* @__PURE__ */ React12.createElement(PhraseHeaderBox, {
478
505
  conditional: validSeedPhrase
479
506
  }, "Saved Seed Phrase")) : null, /* @__PURE__ */ React12.createElement(TextField2, {
480
507
  defaultValue: seedPhrase,
@@ -490,14 +517,14 @@ var SavedPhraseTextField = /* @__PURE__ */ __name(({ fullWidth, showPhraseHeader
490
517
 
491
518
  // src/components/SeedPhrase/dialog/components/OverwriteWarning.tsx
492
519
  import { Alert as Alert3, Button as Button4 } from "@mui/material";
493
- import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
520
+ import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
494
521
  import React13 from "react";
495
522
  var OverwriteWarning = /* @__PURE__ */ __name(() => {
496
523
  const { handleCancelOverwrite, handleSave } = useSeedPhrase();
497
524
  return /* @__PURE__ */ React13.createElement(Alert3, {
498
525
  variant: "outlined",
499
526
  severity: "warning",
500
- action: /* @__PURE__ */ React13.createElement(FlexRow2, {
527
+ action: /* @__PURE__ */ React13.createElement(FlexRow3, {
501
528
  sx: {
502
529
  columnGap: 1
503
530
  }
@@ -526,7 +553,7 @@ var SeedPhraseDialog = /* @__PURE__ */ __name(({ changeSeedPhrase, seedPhrase, .
526
553
  saveCallback: /* @__PURE__ */ __name(() => props.onClose?.({}, "escapeKeyDown"), "saveCallback")
527
554
  }, /* @__PURE__ */ React14.createElement(SeedPhraseDialogInner, props));
528
555
  }, "SeedPhraseDialog");
529
- var SeedPhraseDialogInner = /* @__PURE__ */ __name((props) => {
556
+ var SeedPhraseDialogInner = /* @__PURE__ */ __name(({ showCopyButton, ...props }) => {
530
557
  const { overwriteWarning, seedPhrase, validPhrase } = useSeedPhrase();
531
558
  return /* @__PURE__ */ React14.createElement(Dialog2, {
532
559
  "aria-labelledby": "alert-dialog-title",
@@ -544,7 +571,9 @@ var SeedPhraseDialogInner = /* @__PURE__ */ __name((props) => {
544
571
  }
545
572
  }, /* @__PURE__ */ React14.createElement(NewPhraseTextField, null, /* @__PURE__ */ React14.createElement(FormLabel2, null, /* @__PURE__ */ React14.createElement(PhraseHeaderBox, {
546
573
  conditional: validPhrase
547
- }, "New Seed Phrase"))), /* @__PURE__ */ React14.createElement(PhraseDialogActions, null), seedPhrase ? /* @__PURE__ */ React14.createElement(SavedPhraseTextField, null) : null, overwriteWarning ? /* @__PURE__ */ React14.createElement(OverwriteWarning, null) : null), /* @__PURE__ */ React14.createElement(DialogActionButtons, {
574
+ }, "New Seed Phrase"))), /* @__PURE__ */ React14.createElement(PhraseDialogActions, null), seedPhrase ? /* @__PURE__ */ React14.createElement(SavedPhraseTextField, {
575
+ showCopyButton
576
+ }) : null, overwriteWarning ? /* @__PURE__ */ React14.createElement(OverwriteWarning, null) : null), /* @__PURE__ */ React14.createElement(DialogActionButtons, {
548
577
  onClose: props.onClose
549
578
  }));
550
579
  }, "SeedPhraseDialogInner");
@@ -581,7 +610,7 @@ var SeedPhraseTableRow = /* @__PURE__ */ __name(({ changeSeedPhrase, seedPhrase,
581
610
  // src/components/WalletAccountDetails/WalletAccountDetails.tsx
582
611
  import { EthAddress } from "@xylabs/eth-address";
583
612
  import { EthAccountButton } from "@xylabs/react-crypto";
584
- import { FlexCol, FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
613
+ import { FlexCol, FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
585
614
  import { NumberStatus } from "@xylabs/react-number-status";
586
615
  import { useNetwork } from "@xyo-network/react-network";
587
616
  import React16 from "react";
@@ -724,7 +753,7 @@ var WalletAccountDetails = /* @__PURE__ */ __name(({ exploreUrl = "https://explo
724
753
  const exploreAddressUrl = `${exploreUrl}/recent?account=${accountToUse?.address}&network=${network?.name ?? "main"}`;
725
754
  return /* @__PURE__ */ React16.createElement(FlexCol, props, /* @__PURE__ */ React16.createElement(EthAccountButton, {
726
755
  address: EthAddress.fromString(accountToUse?.address)
727
- }), /* @__PURE__ */ React16.createElement(FlexRow3, {
756
+ }), /* @__PURE__ */ React16.createElement(FlexRow4, {
728
757
  gap: 1
729
758
  }, /* @__PURE__ */ React16.createElement(NumberStatus, {
730
759
  rounded: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/MaxAccounts/MaxAccountsTableRow.tsx","../../src/components/MaxAccounts/OutOfBoundsSnackBar.tsx","../../src/components/SeedPhrase/_shared/SeedPhraseIconButton.tsx","../../src/components/SeedPhrase/DefaultSeedPhrase.tsx","../../src/components/SeedPhrase/dialog/components/DialogActionButtons.tsx","../../src/contexts/SeedPhrase/Context.ts","../../src/contexts/SeedPhrase/Provider.tsx","../../src/contexts/SeedPhrase/use.ts","../../src/contexts/Wallet/Context.ts","../../src/contexts/Wallet/Provider.tsx","../../src/contexts/Wallet/use.ts","../../src/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.tsx","../../src/components/SeedPhrase/dialog/components/fields/validation-messages/colorParser.ts","../../src/components/SeedPhrase/dialog/components/fields/validation-messages/InvalidPhrase.tsx","../../src/components/SeedPhrase/dialog/components/fields/validation-messages/PhraseHeaderBox.tsx","../../src/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.tsx","../../src/components/SeedPhrase/dialog/components/fields/SavedPhraseTextField.tsx","../../src/components/SeedPhrase/dialog/components/OverwriteWarning.tsx","../../src/components/SeedPhrase/dialog/SeedPhraseDialog.tsx","../../src/components/SeedPhrase/settings/SeedPhraseTableRow.tsx","../../src/components/WalletAccountDetails/WalletAccountDetails.tsx","../../src/hooks/useAccount.ts","../../src/hooks/useWallet.ts","../../src/hooks/useWallets.ts","../../src/hooks/useWrapperAccount.ts","../../src/components/WalletAccountSelect/Select.tsx","../../src/components/WalletAccountSelect/SelectBar.tsx"],"sourcesContent":["import type { TableRowProps } from '@mui/material'\nimport {\n ButtonGroup, TableCell, TableRow, Typography,\n} from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport React, { useState } from 'react'\n\nimport { OutOfBoundsSnackBar } from './OutOfBoundsSnackBar.tsx'\n\nexport interface MaxAccountsTableRow extends TableRowProps {\n activeAccountIndex?: number\n changeMaxAccounts?: (maxAccounts: number) => void\n maxAccounts?: number\n}\n\nexport const MaxAccountsTableRow: React.FC<MaxAccountsTableRow> = ({\n activeAccountIndex, changeMaxAccounts, maxAccounts,\n}) => {\n const [desiredMaximumAccounts, setDesiredMaximumAccounts] = useState<number | undefined>()\n const [showSnackBar, setShowSnackBar] = useState(false)\n\n const handleChangeMaxAccounts = (change: 'increase' | 'decrease') => {\n if (maxAccounts !== undefined && activeAccountIndex !== undefined) {\n switch (change) {\n case 'decrease': {\n const desiredMaximumAccounts = maxAccounts - 1\n const validMaximumAccounts = desiredMaximumAccounts > 0\n const maxAccountsWithinRange = activeAccountIndex + 1 <= desiredMaximumAccounts\n if (validMaximumAccounts && maxAccountsWithinRange) {\n changeMaxAccounts?.(desiredMaximumAccounts)\n }\n if (!maxAccountsWithinRange) setShowSnackBar(true)\n setDesiredMaximumAccounts(desiredMaximumAccounts)\n return\n }\n case 'increase': {\n changeMaxAccounts?.(maxAccounts + 1)\n return\n }\n default: {\n console.error(change, 'is not a recognized value')\n }\n }\n } else {\n throw new Error('Max Accounts is unset and needs a default')\n }\n }\n\n return (\n <TableRow>\n <TableCell>Maximum Accounts</TableCell>\n <TableCell align=\"center\">\n <Typography variant=\"caption\">{maxAccounts}</Typography>\n </TableCell>\n <TableCell align=\"center\">\n <ButtonGroup>\n <ButtonEx onClick={() => handleChangeMaxAccounts('decrease')} variant=\"contained\" size=\"small\">\n -\n </ButtonEx>\n <ButtonEx onClick={() => handleChangeMaxAccounts('increase')} variant=\"contained\" size=\"small\">\n +\n </ButtonEx>\n </ButtonGroup>\n <OutOfBoundsSnackBar\n desiredMaximumAccounts={desiredMaximumAccounts}\n activeAccountIndex={activeAccountIndex}\n setShowSnackBar={setShowSnackBar}\n showSnackBar={showSnackBar}\n />\n </TableCell>\n </TableRow>\n )\n}\n","import type { SnackbarProps } from '@mui/material'\nimport {\n Alert, AlertTitle, Snackbar,\n} from '@mui/material'\nimport type { Dispatch, SetStateAction } from 'react'\nimport React from 'react'\n\nexport interface OutOfBoundsSnackBarProps extends SnackbarProps {\n activeAccountIndex?: number\n desiredMaximumAccounts?: number\n setShowSnackBar?: Dispatch<SetStateAction<boolean>>\n showSnackBar?: boolean\n}\n\nexport const OutOfBoundsSnackBar: React.FC<OutOfBoundsSnackBarProps> = ({\n activeAccountIndex,\n desiredMaximumAccounts,\n setShowSnackBar,\n showSnackBar,\n}) => {\n return (\n <Snackbar\n anchorOrigin={{ horizontal: 'center', vertical: 'top' }}\n autoHideDuration={5000}\n onClose={() => setShowSnackBar?.(false)}\n open={showSnackBar}\n >\n <Alert severity=\"error\" onClose={() => setShowSnackBar?.(false)}>\n <AlertTitle>Maximum Accounts Error</AlertTitle>\n Your currently selected account number (\n {activeAccountIndex === undefined ? '' : activeAccountIndex + 1}\n ) cannot be greater than the desired\n Maximum Accounts (\n {desiredMaximumAccounts}\n ).\n </Alert>\n </Snackbar>\n )\n}\n","import { HelpOutline as HelpOutlineIcon } from '@mui/icons-material'\nimport type { IconButtonProps } from '@mui/material'\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n Link,\n List,\n ListItem,\n Typography,\n} from '@mui/material'\nimport React, { useState } from 'react'\n\nexport const SeedPhraseIconButton: React.FC<IconButtonProps> = (props) => {\n const [open, setOpen] = useState(false)\n const onClose = () => setOpen(false)\n return (\n <>\n <IconButton onClick={() => setOpen(true)} {...props}>\n <HelpOutlineIcon fontSize=\"small\" />\n </IconButton>\n <Dialog open={open}>\n <DialogTitle>Understanding your Seed Phrase</DialogTitle>\n <DialogContent>\n <Typography>\n Your Seed Phrase should adhere to the\n {' '}\n <Link target=\"_blank\" href=\"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki\">\n bip39 specification\n </Link>\n {' '}\n and is used to generate accounts which identify your data on the XYO Network.\n </Typography>\n <List>\n <ListItem>Do not share this phrase with anyone.</ListItem>\n <ListItem>Do not save it to a public computer.</ListItem>\n <ListItem>Do not use a existing phrase from another wallet (i.e. Metamask).</ListItem>\n <ListItem>Do not use before copying it down somewhere safe.</ListItem>\n </List>\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose} variant=\"outlined\">\n OK\n </Button>\n </DialogActions>\n </Dialog>\n </>\n )\n}\n","import {\n Alert, AlertTitle, Snackbar,\n} from '@mui/material'\nimport { generateMnemonic } from '@scure/bip39'\nimport { wordlist } from '@scure/bip39/wordlists/english'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo, useState } from 'react'\n\nexport interface DefaultSeedPhraseProps extends PropsWithChildren {\n changeSeedPhrase?: (seedPhrase: string) => void\n hideDefaultSeedPhraseMessage?: boolean\n seedPhrase?: string\n}\n\nexport const DefaultSeedPhrase: React.FC<DefaultSeedPhraseProps> = ({\n changeSeedPhrase, children, hideDefaultSeedPhraseMessage, seedPhrase,\n}) => {\n const [showSnackBar, setShowSnackBar] = useState(false)\n\n useMemo(() => {\n if (!seedPhrase) {\n const mnemonic = generateMnemonic(wordlist, 256)\n changeSeedPhrase?.(mnemonic)\n setShowSnackBar(true)\n }\n }, [changeSeedPhrase, seedPhrase])\n\n return (\n <>\n {hideDefaultSeedPhraseMessage\n ? null\n : (\n <Snackbar\n open={showSnackBar}\n autoHideDuration={5000}\n onClose={() => setShowSnackBar(false)}\n anchorOrigin={{ horizontal: 'center', vertical: 'top' }}\n >\n <Alert severity=\"success\">\n <AlertTitle>Default Seed Phrase Generated</AlertTitle>\n Go to application settings to save it.\n </Alert>\n </Snackbar>\n )}\n {children}\n </>\n )\n}\n","import type { DialogActionsProps, DialogProps } from '@mui/material'\nimport { Button, DialogActions } from '@mui/material'\nimport type { MouseEvent } from 'react'\nimport React from 'react'\n\nimport { useSeedPhrase } from '../../../../contexts/index.ts'\n\ninterface DialogActionButtonsProps extends DialogActionsProps {\n onClose?: DialogProps['onClose']\n}\n\nexport const DialogActionButtons: React.FC<DialogActionButtonsProps> = ({ onClose, ...props }) => {\n const { handleSave, setPhrase } = useSeedPhrase()\n\n const wrappedOnClose = (e: MouseEvent<HTMLElement>) => {\n // clear local copy of phrase when modal closes\n setPhrase?.('')\n onClose?.(e, 'escapeKeyDown')\n }\n\n return (\n <DialogActions {...props}>\n <Button variant=\"outlined\" onClick={wrappedOnClose}>\n Cancel\n </Button>\n <Button variant=\"outlined\" onClick={handleSave}>\n Save\n </Button>\n </DialogActions>\n )\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport type { SeedPhraseContextState } from './State.ts'\n\nexport const SeedPhraseContext = createContextEx<SeedPhraseContextState>()\n","import { generateMnemonic, validateMnemonic } from '@scure/bip39'\nimport { wordlist } from '@scure/bip39/wordlists/english'\nimport { useResetState } from '@xylabs/react-hooks'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useCallback, useEffect, useMemo, useState,\n} from 'react'\n\nimport { SeedPhraseContext } from './Context.ts'\n\nexport interface SeedPhraseProviderProps extends PropsWithChildren {\n defaultPhrase?: string\n handleChangeSeedPhrase?: (phrase: string) => void\n open?: boolean\n saveCallback?: () => void\n seedPhrase?: string\n}\n\nconst validate = (passedPhrase?: string) => {\n if (!passedPhrase) {\n return null\n }\n return validateMnemonic(passedPhrase, wordlist)\n}\n\nexport const SeedPhraseProvider: React.FC<SeedPhraseProviderProps> = ({\n children,\n defaultPhrase,\n handleChangeSeedPhrase,\n saveCallback,\n seedPhrase,\n open,\n}) => {\n const [phrase, setPhrase] = useResetState<string | undefined>(defaultPhrase)\n const [overwriteWarning, setOverwriteWarning] = useState(false)\n\n useEffect(() => {\n if (seedPhrase || open) {\n setPhrase?.(seedPhrase ?? '')\n }\n }, [seedPhrase, open, setPhrase])\n\n const handleGenerate = useCallback(() => {\n const mnemonic = generateMnemonic(wordlist, 256)\n setPhrase?.(mnemonic)\n setOverwriteWarning?.(false)\n }, [])\n\n const handleCancelOverwrite = useCallback(() => {\n // eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect\n setOverwriteWarning(false)\n }, [setOverwriteWarning])\n\n const handleClear = useCallback(() => {\n setPhrase('')\n setOverwriteWarning(false)\n }, [setPhrase, setOverwriteWarning])\n\n const handleSave = useCallback(() => {\n if (!overwriteWarning && seedPhrase && seedPhrase !== phrase) {\n setOverwriteWarning?.(true)\n } else {\n handleChangeSeedPhrase?.(phrase ?? '')\n saveCallback?.()\n }\n }, [handleChangeSeedPhrase, overwriteWarning, phrase, saveCallback, seedPhrase])\n\n useEffect(() => {\n if (!open) {\n handleCancelOverwrite()\n }\n }, [handleCancelOverwrite, open])\n\n const validSeedPhrase = useMemo(() => validate?.(seedPhrase), [seedPhrase])\n const validPhrase = useMemo(() => validate?.(phrase), [phrase])\n\n const value = useMemo(() => ({\n handleCancelOverwrite,\n handleChangeSeedPhrase,\n handleClear,\n handleGenerate,\n handleSave,\n overwriteWarning,\n phrase,\n provided: true,\n seedPhrase,\n setOverwriteWarning,\n setPhrase,\n validPhrase,\n validSeedPhrase,\n validate,\n }), [handleCancelOverwrite,\n handleChangeSeedPhrase,\n handleClear,\n handleGenerate,\n handleSave,\n overwriteWarning,\n phrase,\n seedPhrase,\n setOverwriteWarning,\n setPhrase,\n validPhrase,\n validSeedPhrase,\n validate])\n\n return (\n <SeedPhraseContext.Provider\n value={value}\n >\n {children}\n </SeedPhraseContext.Provider>\n )\n}\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { SeedPhraseContext } from './Context.ts'\n\nexport const useSeedPhrase = () => useContextEx(SeedPhraseContext, 'SeedPhrase', true)\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport type { WalletContextState } from './State.ts'\n\nexport const WalletContext = createContextEx<WalletContextState>()\n","import { useResetState } from '@xylabs/react-hooks'\nimport { usePromise } from '@xylabs/react-promise'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo } from 'react'\n\nimport { WalletContext } from './Context.ts'\n\nexport interface WalletProviderProps {\n defaultActiveAccountIndex?: number\n rootWallet?: WalletInstance | null\n}\n\nexport const WalletProvider: React.FC<PropsWithChildren<WalletProviderProps>> = ({\n children,\n defaultActiveAccountIndex = 0,\n rootWallet = null,\n ...props\n}) => {\n const [activeAccountIndex, setActiveAccountIndex] = useResetState(defaultActiveAccountIndex)\n\n const [activeAccount = null] = usePromise(async () => await rootWallet?.derivePath(activeAccountIndex.toString()), [activeAccountIndex, rootWallet])\n\n const value = useMemo(() => ({\n activeAccount,\n activeAccountIndex,\n provided: true,\n rootWallet,\n setActiveAccountIndex,\n }), [activeAccount,\n activeAccountIndex,\n rootWallet,\n setActiveAccountIndex])\n\n return (\n <WalletContext.Provider\n value={value}\n {...props}\n >\n {children}\n </WalletContext.Provider>\n )\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport { useContextEx, useProvided } from '@xyo-network/react-shared'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\n\nimport { WalletContext } from './Context.ts'\n\nexport const useWalletContext = (required = true) => {\n return useContextEx(WalletContext, 'Wallet', required)\n}\n\nexport const useWalletProvided = () => {\n return useProvided(WalletContext)\n}\n\nexport const useRootWallet = (required = true): [WalletInstance | null | undefined, Error | undefined] => {\n const { rootWallet } = useWalletContext(required)\n return [rootWallet, undefined]\n}\n\nexport const useIndexedWalletFromContext = (index: number, required = true): [WalletInstance | null | undefined, Error | undefined] => {\n const { rootWallet } = useWalletContext(required)\n const [wallet] = usePromise(async () => (await rootWallet?.derivePath(index.toString())) ?? rootWallet, [rootWallet, index])\n return [wallet, undefined]\n}\n\nexport const useSelectedWalletAccount = (required = true): [WalletInstance | null | undefined, Error | undefined] => {\n const { activeAccountIndex } = useWalletContext(required)\n // we pass in 0 as default since we can not call the hook optionally,\n // we resolve this false result by checking whether activeAccountIndex is defined before returning it\n const [account] = useIndexedWalletFromContext(activeAccountIndex ?? 0, required)\n return activeAccountIndex === undefined && account === null ? [null, undefined] : [account, undefined]\n}\n","import type { StandardTextFieldProps } from '@mui/material'\nimport { FormControl, TextField } from '@mui/material'\nimport type { ReactNode } from 'react'\nimport React from 'react'\n\nimport { useSeedPhrase } from '../../../../../contexts/index.ts'\nimport { colorParser, InvalidPhraseTypography } from './validation-messages/index.ts'\n\nexport interface NewPhraseTextFieldProps extends StandardTextFieldProps {\n children?: ReactNode\n disableColor?: boolean\n}\n\nexport const NewPhraseTextField: React.FC<NewPhraseTextFieldProps> = ({\n children, disableColor, ...props\n}) => {\n const {\n phrase, setPhrase, validPhrase,\n } = useSeedPhrase()\n return (\n <>\n <FormControl\n fullWidth\n size=\"small\"\n sx={{\n display: 'flex', flexDirection: 'column', rowGap: 1,\n }}\n >\n {children}\n <TextField\n focused\n color={disableColor ? undefined : colorParser(validPhrase)}\n error={validPhrase === false}\n helperText={validPhrase === false ? <InvalidPhraseTypography /> : null}\n fullWidth\n maxRows={Number.POSITIVE_INFINITY}\n multiline\n onChange={e => setPhrase?.(e.target.value)}\n value={phrase}\n {...props}\n />\n </FormControl>\n </>\n )\n}\n","export const colorParser = (conditional?: boolean | null) => {\n switch (conditional) {\n case true: {\n return 'success'\n }\n case false: {\n return 'error'\n }\n default: {\n return\n }\n }\n}\n","import type { TypographyProps } from '@mui/material'\nimport { Link, Typography } from '@mui/material'\nimport React from 'react'\n\nexport const InvalidPhraseTypography: React.FC<TypographyProps> = props => (\n <Typography variant=\"caption\" color=\"error\" {...props}>\n Invalid seed phrase. See -\n {' '}\n <Link target=\"_blank\" href=\"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki\">\n bip39 Proposal\n </Link>\n </Typography>\n)\n","import { CheckCircleOutline as CheckCircleOutlineIcon, HighlightOff as HighlightOffIcon } from '@mui/icons-material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo } from 'react'\n\ninterface PhraseHeaderBox extends FlexBoxProps, PropsWithChildren {\n conditional?: boolean | null\n}\n\nexport const PhraseHeaderBox: React.FC<PhraseHeaderBox> = ({\n children, conditional, ...props\n}) => {\n const state = useMemo(() => {\n switch (conditional) {\n case true: {\n return 'success'\n }\n case false: {\n return 'error'\n }\n default: {\n return null\n }\n }\n }, [conditional])\n\n const Icon = useMemo(() => {\n switch (state) {\n case 'success': {\n return <CheckCircleOutlineIcon fontSize=\"small\" color=\"success\" />\n }\n case 'error': {\n return <HighlightOffIcon fontSize=\"small\" color=\"error\" />\n }\n default: {\n return null\n }\n }\n }, [state])\n\n return (\n <FlexRow justifyContent=\"start\" columnGap={1} {...props}>\n {Icon}\n {children}\n </FlexRow>\n )\n}\n","import { Button, DialogActions } from '@mui/material'\nimport React from 'react'\n\nimport { useSeedPhrase } from '../../../../../contexts/index.ts'\n\nexport const PhraseDialogActions = () => {\n const {\n handleClear, handleGenerate, overwriteWarning,\n } = useSeedPhrase()\n return (\n <DialogActions sx={{ justifyContent: 'center' }}>\n <Button disabled={overwriteWarning} variant=\"outlined\" onClick={handleGenerate}>\n Generate\n </Button>\n <Button variant=\"outlined\" onClick={handleClear}>\n Clear\n </Button>\n </DialogActions>\n )\n}\n","import type { StandardTextFieldProps } from '@mui/material'\nimport {\n Chip, FormControl, FormLabel, TextField,\n} from '@mui/material'\nimport React, { useState } from 'react'\n\nimport { useSeedPhrase } from '../../../../../contexts/index.ts'\nimport { InvalidPhraseTypography, PhraseHeaderBox } from './validation-messages/index.ts'\n\nexport interface SavedPhraseTextFieldProps extends StandardTextFieldProps {\n fullWidth?: boolean\n showPhraseHeader?: boolean\n}\n\nexport const SavedPhraseTextField: React.FC<SavedPhraseTextFieldProps> = ({\n fullWidth, showPhraseHeader, ...props\n}) => {\n const { validSeedPhrase, seedPhrase } = useSeedPhrase()\n\n const [visible, setVisible] = useState(false)\n\n return (\n <FormControl\n fullWidth={fullWidth}\n size=\"small\"\n sx={{\n display: 'flex', flexDirection: 'column', rowGap: 1,\n }}\n >\n <Chip\n label={visible ? 'Hide Saved Seed Phrase' : 'Reveal Saved Seed Phrase'}\n onClick={() => setVisible(!visible)}\n sx={{ alignSelf: 'center' }}\n />\n {visible\n ? (\n <>\n {showPhraseHeader\n ? (\n <FormLabel>\n <PhraseHeaderBox conditional={validSeedPhrase}>Saved Seed Phrase</PhraseHeaderBox>\n </FormLabel>\n )\n : null}\n <TextField\n defaultValue={seedPhrase}\n disabled\n error={validSeedPhrase === false}\n helperText={validSeedPhrase === false ? <InvalidPhraseTypography /> : null}\n fullWidth\n maxRows={Number.POSITIVE_INFINITY}\n multiline\n {...props}\n />\n </>\n )\n : null}\n </FormControl>\n )\n}\n","import { Alert, Button } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { useSeedPhrase } from '../../../../contexts/index.ts'\n\nexport const OverwriteWarning = () => {\n const { handleCancelOverwrite, handleSave } = useSeedPhrase()\n return (\n <Alert\n variant=\"outlined\"\n severity=\"warning\"\n action={(\n <FlexRow sx={{ columnGap: 1 }}>\n <Button variant=\"outlined\" color=\"inherit\" size=\"small\" onClick={handleSave}>\n Overwrite\n </Button>\n <Button variant=\"outlined\" color=\"inherit\" size=\"small\" onClick={handleCancelOverwrite}>\n Cancel\n </Button>\n </FlexRow>\n )}\n >\n Are you sure you want to overwrite existing seed phrase? This action cannot be undone.\n </Alert>\n )\n}\n","import type { DialogProps } from '@mui/material'\nimport {\n Dialog, DialogContent, DialogTitle, FormLabel,\n} from '@mui/material'\nimport React from 'react'\n\nimport { SeedPhraseProvider, useSeedPhrase } from '../../../contexts/index.ts'\nimport { SeedPhraseIconButton } from '../_shared/index.ts'\nimport {\n DialogActionButtons,\n NewPhraseTextField,\n OverwriteWarning,\n PhraseDialogActions,\n PhraseHeaderBox,\n SavedPhraseTextField,\n} from './components/index.ts'\n\nexport interface SeedPhraseDialogProps extends DialogProps {\n changeSeedPhrase?: (value: string) => void\n seedPhrase?: string\n}\n\nexport const SeedPhraseDialog: React.FC<SeedPhraseDialogProps> = ({\n changeSeedPhrase, seedPhrase, ...props\n}) => {\n return (\n <SeedPhraseProvider\n seedPhrase={seedPhrase}\n handleChangeSeedPhrase={changeSeedPhrase}\n open={props.open}\n saveCallback={() => props.onClose?.({}, 'escapeKeyDown')}\n >\n <SeedPhraseDialogInner {...props} />\n </SeedPhraseProvider>\n )\n}\n\nexport const SeedPhraseDialogInner: React.FC<SeedPhraseDialogProps> = (props) => {\n const {\n overwriteWarning, seedPhrase, validPhrase,\n } = useSeedPhrase()\n\n return (\n <Dialog aria-labelledby=\"alert-dialog-title\" aria-describedby=\"alert-dialog-description\" fullWidth maxWidth=\"sm\" {...props}>\n <DialogTitle id=\"alert-dialog-title\">\n Update Your Seed Phrase\n {' '}\n <SeedPhraseIconButton />\n </DialogTitle>\n <DialogContent sx={{\n display: 'flex', flexDirection: 'column', rowGap: 2,\n }}\n >\n <NewPhraseTextField>\n <FormLabel>\n <PhraseHeaderBox conditional={validPhrase}>New Seed Phrase</PhraseHeaderBox>\n </FormLabel>\n </NewPhraseTextField>\n <PhraseDialogActions />\n {seedPhrase\n ? <SavedPhraseTextField />\n : null}\n {overwriteWarning\n ? <OverwriteWarning />\n : null}\n </DialogContent>\n <DialogActionButtons onClose={props.onClose} />\n </Dialog>\n )\n}\n","import { Cancel as CancelIcon, RadioButtonChecked as RadioButtonCheckedIcon } from '@mui/icons-material'\nimport type { TableRowProps } from '@mui/material'\nimport {\n Button, ButtonGroup, TableCell, TableRow,\n} from '@mui/material'\nimport React, { useState } from 'react'\n\nimport { SeedPhraseIconButton } from '../_shared/index.ts'\nimport { SeedPhraseDialog } from '../dialog/index.ts'\n\nexport interface SeedPhraseTableRowProps extends TableRowProps {\n changeSeedPhrase?: (seedPhrase: string) => void\n seedPhrase?: string\n}\n\nexport const SeedPhraseTableRow: React.FC<SeedPhraseTableRowProps> = ({\n changeSeedPhrase, seedPhrase, ...props\n}) => {\n const [open, setOpen] = useState(false)\n\n const handleOpen = () => {\n setOpen(true)\n }\n return (\n <TableRow {...props}>\n <TableCell>\n Seed Phrase\n {' '}\n <SeedPhraseIconButton />\n </TableCell>\n <TableCell align=\"center\">\n {seedPhrase\n ? <RadioButtonCheckedIcon color=\"success\" />\n : <CancelIcon color=\"error\" />}\n </TableCell>\n <TableCell>\n <SeedPhraseDialog changeSeedPhrase={changeSeedPhrase} open={open} onClose={() => setOpen(false)} seedPhrase={seedPhrase} />\n <ButtonGroup fullWidth>\n <Button variant=\"contained\" size=\"small\" onClick={handleOpen}>\n Update\n </Button>\n </ButtonGroup>\n </TableCell>\n </TableRow>\n )\n}\n","import { EthAddress } from '@xylabs/eth-address'\nimport { EthAccountButton } from '@xylabs/react-crypto'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport { NumberStatus } from '@xylabs/react-number-status'\nimport { useNetwork } from '@xyo-network/react-network'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\nimport React from 'react'\n\nimport { useAccount } from '../../hooks/index.ts'\n\nexport interface WalletAccountDetailsProps extends FlexBoxProps {\n account?: WalletInstance\n exploreUrl?: string\n}\n\nexport const WalletAccountDetails: React.FC<WalletAccountDetailsProps> = ({\n exploreUrl = 'https://explore.xyo.network', account, ...props\n}) => {\n const [accountToUse] = useAccount({ account })\n const { network } = useNetwork()\n const exploreAddressUrl = `${exploreUrl}/recent?account=${accountToUse?.address}&network=${network?.name ?? 'main'}`\n\n return (\n <FlexCol {...props}>\n <EthAccountButton address={EthAddress.fromString(accountToUse?.address)} />\n <FlexRow gap={1}>\n <NumberStatus rounded title=\"Tokens\" value={0} to={`${exploreAddressUrl}&schema=network.xyo.account.tokens`} target=\"_blank\" />\n <NumberStatus rounded title=\"NFTs\" value={0} to={`${exploreAddressUrl}&schema=network.xyo.account.nfts`} target=\"_blank\" />\n <NumberStatus rounded title=\"Signatures\" value={0} to={`${exploreAddressUrl}&schema=network.xyo.account.signatures`} target=\"_blank\" />\n <NumberStatus rounded title=\"Signins\" value={0} to={`${exploreAddressUrl}&schema=network.xyo.account.signins`} target=\"_blank\" />\n </FlexRow>\n </FlexCol>\n )\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\nimport { useState } from 'react'\n\nimport {\n useRootWallet, useWalletContext, useWalletProvided,\n} from '../contexts/index.ts'\n\nexport interface AccountHookParams {\n account?: AccountInstance\n index?: number\n required?: boolean\n wallet?: WalletInstance\n}\n\nexport const useAccount = ({\n wallet, account, index, required = false,\n}: AccountHookParams = {}): [\n AccountInstance | null | undefined,\n Error | undefined,\n] => {\n const walletContextProvided = useWalletProvided()\n const [validationError, setValidationError] = useState<Error>()\n if (wallet && account && !validationError) {\n setValidationError(new Error('useAccount can not have both a wallet and an account in the parameters'))\n }\n\n if (index && account && !validationError) {\n setValidationError(new Error('useAccount can not have both a index and an account in the parameters'))\n }\n\n const [error, setError] = useState<Error>()\n const [rootWallet] = useRootWallet(!wallet && required)\n const { activeAccountIndex } = useWalletContext(false)\n const [activeAccount] = usePromise(async () => {\n try {\n if (!validationError) {\n if (wallet) {\n return await wallet?.derivePath?.(`${index ?? 0}'\\0`)\n } else if (rootWallet) {\n return await rootWallet?.derivePath?.(`${index ?? activeAccountIndex ?? 0}'\\0`)\n }\n }\n } catch (ex) {\n const error = ex as Error\n console.error(error.message)\n setError(error)\n }\n }, [index, wallet, rootWallet, activeAccountIndex, validationError])\n if (validationError && !error) {\n console.error(validationError.message)\n setError(validationError)\n }\n\n return [\n error\n ? undefined\n : (account ?? activeAccount ?? walletContextProvided)\n ? null\n : undefined,\n error,\n ]\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport { HDWallet } from '@xyo-network/account'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\nimport { useState } from 'react'\n\nimport { useSelectedWalletAccount, useWalletContext } from '../contexts/index.ts'\n\nexport interface WalletHookParams {\n mnemonic?: string\n path?: string\n required?: boolean\n seed?: Uint8Array | string\n wallet?: WalletInstance | null\n}\n\nexport const useWallet = ({\n mnemonic, wallet, path, required = false, seed,\n}: WalletHookParams = {}): [\n WalletInstance | null | undefined,\n Error | undefined,\n] => {\n const walletContextProvided = useWalletContext(false)\n const [error, setError] = useState<Error>()\n const [contextAccount] = useSelectedWalletAccount(!wallet && required)\n const [activeAccount] = usePromise(async () => {\n try {\n const newAccount = await (() => {\n if (wallet) {\n return wallet\n } else if (mnemonic) {\n return HDWallet.fromPhrase(mnemonic)\n } else if (seed) {\n return HDWallet.fromSeed(seed)\n }\n return contextAccount\n })()\n\n return path ? newAccount?.derivePath?.(path) : (newAccount ?? wallet)\n } catch (ex) {\n setError(ex as Error)\n }\n }, [mnemonic, contextAccount, seed, path, wallet])\n return [activeAccount ?? (walletContextProvided ? null : activeAccount), error]\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\n\nimport { useWalletContext } from '../contexts/index.ts'\nimport { useWallet } from './useWallet.ts'\n\nexport interface WalletsHookParams {\n paths: string[]\n wallet?: WalletInstance | null\n}\n\nexport const useWallets = ({ wallet, paths }: WalletsHookParams): [WalletInstance[] | null | undefined, Error | undefined] => {\n const walletContextProvided = useWalletContext(false)\n const [foundWallet] = useWallet({ wallet })\n const [wallets, error] = usePromise(\n async () => (foundWallet ? await Promise.all(paths.map(path => foundWallet.derivePath(path))) : undefined),\n [foundWallet, paths],\n )\n return [wallets ?? (walletContextProvided ? null : wallets), error]\n}\n","import type { UsePromiseState } from '@xylabs/react-promise'\nimport { usePromise } from '@xylabs/react-promise'\nimport { HDWallet } from '@xyo-network/account'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\nimport { Mutex } from 'async-mutex'\n\nlet globalWrapperWallet: WalletInstance | undefined\nconst globalWrapperWalletMutex = new Mutex()\n\nexport const useWrapperAccount = (\n account?: AccountInstance | null,\n): [AccountInstance | null | undefined, Error | undefined, UsePromiseState | undefined] => {\n return usePromise(async () => {\n return await globalWrapperWalletMutex.runExclusive(async () => {\n // if we are expecting to receive a wallet or did receive on, return the override account\n if (account !== undefined) {\n return account\n }\n\n if (globalWrapperWallet) {\n return globalWrapperWallet\n }\n\n try {\n globalWrapperWallet = await HDWallet.random()\n console.log(`Global Wrapper Wallet Creation Success: ${globalWrapperWallet.address}`)\n } catch (ex) {\n const error = ex as Error\n console.error(`Global Wrapper Wallet Creation Failed: ${error.message}`)\n }\n return globalWrapperWallet\n })\n }, [account])\n}\n","import type { SelectProps } from '@mui/material'\nimport { CircularProgress, MenuItem } from '@mui/material'\nimport { SelectEx } from '@xylabs/react-select'\nimport type { AddressRenderRowBoxProps } from '@xyo-network/react-address-render'\nimport { AddressRenderRowBox } from '@xyo-network/react-address-render'\nimport React from 'react'\n\nimport { useWalletContext } from '../../contexts/index.ts'\nimport { useWallet } from '../../hooks/index.ts'\n\ntype SharedAddressRenderRowBoxProps = Pick<AddressRenderRowBoxProps, 'iconOnly' | 'iconSize' | 'icons' | 'showFavorite'>\n\nexport type WalletAccountSelectProps = SharedAddressRenderRowBoxProps &\n Omit<SelectProps<number>, 'variant'> &\n Partial<SelectProps<number>> & {\n addressNames?: Record<string, string | undefined>\n maxAccounts?: number\n }\n\nconst arrayRange = (length: number, start = 0) => {\n return [...Array.from({ length }).keys()].map(x => x + start)\n}\n\nexport const WalletAccountSelect: React.FC<WalletAccountSelectProps> = ({\n addressNames,\n iconOnly,\n iconSize = 24,\n icons,\n maxAccounts = 1,\n showFavorite = false,\n size,\n variant = 'outlined',\n ...props\n}) => {\n const {\n activeAccountIndex = 0, setActiveAccountIndex, rootWallet,\n } = useWalletContext()\n const disabled = !rootWallet || activeAccountIndex === undefined\n\n return (\n <>\n {rootWallet\n ? (\n <SelectEx\n margin=\"dense\"\n disabled={disabled}\n renderValue={(selectedAccountIndex) => {\n // eslint-disable-next-line @eslint-react/no-nested-components\n const Item: React.FC = () => {\n const [selectedAccount] = useWallet({ path: selectedAccountIndex.toString(), wallet: rootWallet })\n const customName = selectedAccount ? addressNames?.[selectedAccount.address] : undefined\n const favorite = !!selectedAccount && selectedAccount.address in (addressNames ?? {})\n return (\n <MenuItem\n value={selectedAccountIndex}\n sx={{\n minHeight: 0, paddingBottom: 0, paddingTop: 0,\n }}\n >\n <AddressRenderRowBox\n disableSharedRef={true}\n flexGrow={1}\n address={selectedAccount?.address}\n iconOnly={iconOnly}\n iconSize={iconSize}\n icons={icons}\n name={customName}\n favorite={favorite}\n showFavorite={showFavorite}\n />\n </MenuItem>\n )\n }\n return <Item />\n }}\n value={activeAccountIndex}\n onChange={event => setActiveAccountIndex?.(Number.parseInt(`${event.target.value}`))}\n size={size}\n variant={variant}\n {...props}\n >\n {arrayRange(maxAccounts).map((index) => {\n // eslint-disable-next-line @eslint-react/no-nested-components\n const Item: React.FC = () => {\n const [account] = useWallet({ path: index.toString(), wallet: rootWallet })\n const customName = account ? addressNames?.[account.address] : undefined\n const favorite = !!account && account.address in (addressNames ?? {})\n return (\n <MenuItem\n key={account?.address}\n value={index}\n sx={{\n minHeight: 0, paddingBottom: 0, paddingTop: 0,\n }}\n >\n <AddressRenderRowBox\n disableSharedRef={true}\n flexGrow={1}\n address={account?.address}\n favorite={favorite}\n iconOnly={iconOnly}\n iconSize={iconSize}\n icons={icons}\n name={customName}\n showFavorite={showFavorite}\n />\n </MenuItem>\n )\n }\n\n return <Item key={index} />\n })}\n </SelectEx>\n )\n : <CircularProgress size={24} />}\n </>\n )\n}\n","import type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { WalletAccountSelect } from './Select.tsx'\n\nexport interface WalletAccountSelectBarProps extends FlexBoxProps {\n addressNames?: Record<string, string | undefined>\n iconOnly?: boolean\n iconSize?: number\n icons?: boolean\n maxAccounts?: number\n showFavorite?: boolean\n size?: 'small' | 'medium'\n}\n\nexport const WalletAccountSelectBar: React.FC<WalletAccountSelectBarProps> = ({\n addressNames,\n iconOnly,\n iconSize,\n icons,\n maxAccounts = 1,\n showFavorite = false,\n size = 'small',\n ...props\n}) => {\n return (\n <FlexCol alignItems=\"stretch\" {...props}>\n <WalletAccountSelect\n addressNames={addressNames}\n fullWidth\n showFavorite={showFavorite}\n iconSize={iconSize}\n iconOnly={iconOnly}\n icons={icons}\n maxAccounts={maxAccounts}\n size={size ?? 'small'}\n variant=\"outlined\"\n />\n </FlexCol>\n )\n}\n"],"mappings":";;;;AACA,SACEA,aAAaC,WAAWC,UAAUC,kBAC7B;AACP,SAASC,gBAAgB;AACzB,OAAOC,UAASC,gBAAgB;;;ACJhC,SACEC,OAAOC,YAAYC,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C,UACAC,UACAC,OACAC,cAAc,GACdC,eAAe,OACfC,OAAO,SACP,GAAGC,MAAAA,MACJ;AACC,SACE,gBAAAC,QAAA,cAACC,UAAAA;IAAQC,YAAW;IAAW,GAAGH;KAChC,gBAAAC,QAAA,cAACG,qBAAAA;IACCX;IACAY,WAAAA;IACAP;IACAH;IACAD;IACAE;IACAC;IACAE,MAAMA,QAAQ;IACdO,SAAQ;;AAIhB,GAzB6E;","names":["ButtonGroup","TableCell","TableRow","Typography","ButtonEx","React","useState","Alert","AlertTitle","Snackbar","React","OutOfBoundsSnackBar","activeAccountIndex","desiredMaximumAccounts","setShowSnackBar","showSnackBar","Snackbar","anchorOrigin","horizontal","vertical","autoHideDuration","onClose","open","Alert","severity","AlertTitle","undefined","MaxAccountsTableRow","activeAccountIndex","changeMaxAccounts","maxAccounts","desiredMaximumAccounts","setDesiredMaximumAccounts","useState","showSnackBar","setShowSnackBar","handleChangeMaxAccounts","change","undefined","validMaximumAccounts","maxAccountsWithinRange","console","error","Error","React","TableRow","TableCell","align","Typography","variant","ButtonGroup","ButtonEx","onClick","size","OutOfBoundsSnackBar","HelpOutline","HelpOutlineIcon","Button","Dialog","DialogActions","DialogContent","DialogTitle","IconButton","Link","List","ListItem","Typography","React","useState","SeedPhraseIconButton","props","open","setOpen","useState","onClose","React","IconButton","onClick","HelpOutlineIcon","fontSize","Dialog","DialogTitle","DialogContent","Typography","Link","target","href","List","ListItem","DialogActions","Button","variant","Alert","AlertTitle","Snackbar","generateMnemonic","wordlist","React","useMemo","useState","DefaultSeedPhrase","changeSeedPhrase","children","hideDefaultSeedPhraseMessage","seedPhrase","showSnackBar","setShowSnackBar","useState","useMemo","mnemonic","generateMnemonic","wordlist","React","Snackbar","open","autoHideDuration","onClose","anchorOrigin","horizontal","vertical","Alert","severity","AlertTitle","Button","DialogActions","React","createContextEx","SeedPhraseContext","generateMnemonic","validateMnemonic","wordlist","useResetState","React","useCallback","useEffect","useMemo","useState","validate","passedPhrase","validateMnemonic","wordlist","SeedPhraseProvider","children","defaultPhrase","handleChangeSeedPhrase","saveCallback","seedPhrase","open","phrase","setPhrase","useResetState","overwriteWarning","setOverwriteWarning","useState","useEffect","handleGenerate","useCallback","mnemonic","generateMnemonic","handleCancelOverwrite","handleClear","handleSave","validSeedPhrase","useMemo","validPhrase","value","provided","React","SeedPhraseContext","Provider","useContextEx","useSeedPhrase","useContextEx","SeedPhraseContext","createContextEx","WalletContext","useResetState","usePromise","React","useMemo","WalletProvider","children","defaultActiveAccountIndex","rootWallet","props","activeAccountIndex","setActiveAccountIndex","useResetState","activeAccount","usePromise","derivePath","toString","value","useMemo","provided","React","WalletContext","Provider","usePromise","useContextEx","useProvided","useWalletContext","required","useContextEx","WalletContext","useWalletProvided","useProvided","useRootWallet","rootWallet","undefined","useIndexedWalletFromContext","index","wallet","usePromise","derivePath","toString","useSelectedWalletAccount","activeAccountIndex","account","DialogActionButtons","onClose","props","handleSave","setPhrase","useSeedPhrase","wrappedOnClose","e","React","DialogActions","Button","variant","onClick","FormControl","TextField","React","colorParser","conditional","Link","Typography","React","InvalidPhraseTypography","props","React","Typography","variant","color","Link","target","href","CheckCircleOutline","CheckCircleOutlineIcon","HighlightOff","HighlightOffIcon","FlexRow","React","useMemo","PhraseHeaderBox","children","conditional","props","state","useMemo","Icon","React","CheckCircleOutlineIcon","fontSize","color","HighlightOffIcon","FlexRow","justifyContent","columnGap","NewPhraseTextField","children","disableColor","props","phrase","setPhrase","validPhrase","useSeedPhrase","React","FormControl","fullWidth","size","sx","display","flexDirection","rowGap","TextField","focused","color","undefined","colorParser","error","helperText","InvalidPhraseTypography","maxRows","Number","POSITIVE_INFINITY","multiline","onChange","e","target","value","Button","DialogActions","React","PhraseDialogActions","handleClear","handleGenerate","overwriteWarning","useSeedPhrase","React","DialogActions","sx","justifyContent","Button","disabled","variant","onClick","Chip","FormControl","FormLabel","TextField","React","useState","SavedPhraseTextField","fullWidth","showPhraseHeader","props","validSeedPhrase","seedPhrase","useSeedPhrase","visible","setVisible","useState","React","FormControl","size","sx","display","flexDirection","rowGap","Chip","label","onClick","alignSelf","FormLabel","PhraseHeaderBox","conditional","TextField","defaultValue","disabled","error","helperText","InvalidPhraseTypography","maxRows","Number","POSITIVE_INFINITY","multiline","Alert","Button","FlexRow","React","OverwriteWarning","handleCancelOverwrite","handleSave","useSeedPhrase","React","Alert","variant","severity","action","FlexRow","sx","columnGap","Button","color","size","onClick","Dialog","DialogContent","DialogTitle","FormLabel","React","SeedPhraseDialog","changeSeedPhrase","seedPhrase","props","React","SeedPhraseProvider","handleChangeSeedPhrase","open","saveCallback","onClose","SeedPhraseDialogInner","overwriteWarning","validPhrase","useSeedPhrase","Dialog","aria-labelledby","aria-describedby","fullWidth","maxWidth","DialogTitle","id","SeedPhraseIconButton","DialogContent","sx","display","flexDirection","rowGap","NewPhraseTextField","FormLabel","PhraseHeaderBox","conditional","PhraseDialogActions","SavedPhraseTextField","OverwriteWarning","DialogActionButtons","Cancel","CancelIcon","RadioButtonChecked","RadioButtonCheckedIcon","Button","ButtonGroup","TableCell","TableRow","React","useState","SeedPhraseTableRow","changeSeedPhrase","seedPhrase","props","open","setOpen","useState","handleOpen","React","TableRow","TableCell","SeedPhraseIconButton","align","RadioButtonCheckedIcon","color","CancelIcon","SeedPhraseDialog","onClose","ButtonGroup","fullWidth","Button","variant","size","onClick","EthAddress","EthAccountButton","FlexCol","FlexRow","NumberStatus","useNetwork","React","usePromise","useState","useAccount","wallet","account","index","required","walletContextProvided","useWalletProvided","validationError","setValidationError","useState","Error","error","setError","rootWallet","useRootWallet","activeAccountIndex","useWalletContext","activeAccount","usePromise","derivePath","ex","console","message","undefined","usePromise","HDWallet","useState","useWallet","mnemonic","wallet","path","required","seed","walletContextProvided","useWalletContext","error","setError","useState","contextAccount","useSelectedWalletAccount","activeAccount","usePromise","newAccount","HDWallet","fromPhrase","fromSeed","derivePath","ex","usePromise","useWallets","wallet","paths","walletContextProvided","useWalletContext","foundWallet","useWallet","wallets","error","usePromise","Promise","all","map","path","derivePath","undefined","usePromise","HDWallet","Mutex","globalWrapperWallet","globalWrapperWalletMutex","Mutex","useWrapperAccount","account","usePromise","runExclusive","undefined","HDWallet","random","console","log","address","ex","error","message","WalletAccountDetails","exploreUrl","account","props","accountToUse","useAccount","network","useNetwork","exploreAddressUrl","address","name","React","FlexCol","EthAccountButton","EthAddress","fromString","FlexRow","gap","NumberStatus","rounded","title","value","to","target","CircularProgress","MenuItem","SelectEx","AddressRenderRowBox","React","arrayRange","length","start","Array","from","keys","map","x","WalletAccountSelect","addressNames","iconOnly","iconSize","icons","maxAccounts","showFavorite","size","variant","props","activeAccountIndex","setActiveAccountIndex","rootWallet","useWalletContext","disabled","undefined","React","SelectEx","margin","renderValue","selectedAccountIndex","Item","selectedAccount","useWallet","path","toString","wallet","customName","address","favorite","MenuItem","value","sx","minHeight","paddingBottom","paddingTop","AddressRenderRowBox","disableSharedRef","flexGrow","name","onChange","event","Number","parseInt","target","index","account","key","CircularProgress","FlexCol","React","WalletAccountSelectBar","addressNames","iconOnly","iconSize","icons","maxAccounts","showFavorite","size","props","React","FlexCol","alignItems","WalletAccountSelect","fullWidth","variant"]}
1
+ {"version":3,"sources":["../../src/components/MaxAccounts/MaxAccountsTableRow.tsx","../../src/components/MaxAccounts/OutOfBoundsSnackBar.tsx","../../src/components/SeedPhrase/_shared/SeedPhraseIconButton.tsx","../../src/components/SeedPhrase/DefaultSeedPhrase.tsx","../../src/components/SeedPhrase/dialog/components/DialogActionButtons.tsx","../../src/contexts/SeedPhrase/Context.ts","../../src/contexts/SeedPhrase/Provider.tsx","../../src/contexts/SeedPhrase/use.ts","../../src/contexts/Wallet/Context.ts","../../src/contexts/Wallet/Provider.tsx","../../src/contexts/Wallet/use.ts","../../src/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.tsx","../../src/components/SeedPhrase/dialog/components/fields/validation-messages/colorParser.ts","../../src/components/SeedPhrase/dialog/components/fields/validation-messages/InvalidPhrase.tsx","../../src/components/SeedPhrase/dialog/components/fields/validation-messages/PhraseHeaderBox.tsx","../../src/components/SeedPhrase/dialog/components/fields/PhraseDialogActions.tsx","../../src/components/SeedPhrase/dialog/components/fields/SavedPhraseTextField.tsx","../../src/components/SeedPhrase/dialog/components/OverwriteWarning.tsx","../../src/components/SeedPhrase/dialog/SeedPhraseDialog.tsx","../../src/components/SeedPhrase/settings/SeedPhraseTableRow.tsx","../../src/components/WalletAccountDetails/WalletAccountDetails.tsx","../../src/hooks/useAccount.ts","../../src/hooks/useWallet.ts","../../src/hooks/useWallets.ts","../../src/hooks/useWrapperAccount.ts","../../src/components/WalletAccountSelect/Select.tsx","../../src/components/WalletAccountSelect/SelectBar.tsx"],"sourcesContent":["import type { TableRowProps } from '@mui/material'\nimport {\n ButtonGroup, TableCell, TableRow, Typography,\n} from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport React, { useState } from 'react'\n\nimport { OutOfBoundsSnackBar } from './OutOfBoundsSnackBar.tsx'\n\nexport interface MaxAccountsTableRow extends TableRowProps {\n activeAccountIndex?: number\n changeMaxAccounts?: (maxAccounts: number) => void\n maxAccounts?: number\n}\n\nexport const MaxAccountsTableRow: React.FC<MaxAccountsTableRow> = ({\n activeAccountIndex, changeMaxAccounts, maxAccounts,\n}) => {\n const [desiredMaximumAccounts, setDesiredMaximumAccounts] = useState<number | undefined>()\n const [showSnackBar, setShowSnackBar] = useState(false)\n\n const handleChangeMaxAccounts = (change: 'increase' | 'decrease') => {\n if (maxAccounts !== undefined && activeAccountIndex !== undefined) {\n switch (change) {\n case 'decrease': {\n const desiredMaximumAccounts = maxAccounts - 1\n const validMaximumAccounts = desiredMaximumAccounts > 0\n const maxAccountsWithinRange = activeAccountIndex + 1 <= desiredMaximumAccounts\n if (validMaximumAccounts && maxAccountsWithinRange) {\n changeMaxAccounts?.(desiredMaximumAccounts)\n }\n if (!maxAccountsWithinRange) setShowSnackBar(true)\n setDesiredMaximumAccounts(desiredMaximumAccounts)\n return\n }\n case 'increase': {\n changeMaxAccounts?.(maxAccounts + 1)\n return\n }\n default: {\n console.error(change, 'is not a recognized value')\n }\n }\n } else {\n throw new Error('Max Accounts is unset and needs a default')\n }\n }\n\n return (\n <TableRow>\n <TableCell>Maximum Accounts</TableCell>\n <TableCell align=\"center\">\n <Typography variant=\"caption\">{maxAccounts}</Typography>\n </TableCell>\n <TableCell align=\"center\">\n <ButtonGroup>\n <ButtonEx onClick={() => handleChangeMaxAccounts('decrease')} variant=\"contained\" size=\"small\">\n -\n </ButtonEx>\n <ButtonEx onClick={() => handleChangeMaxAccounts('increase')} variant=\"contained\" size=\"small\">\n +\n </ButtonEx>\n </ButtonGroup>\n <OutOfBoundsSnackBar\n desiredMaximumAccounts={desiredMaximumAccounts}\n activeAccountIndex={activeAccountIndex}\n setShowSnackBar={setShowSnackBar}\n showSnackBar={showSnackBar}\n />\n </TableCell>\n </TableRow>\n )\n}\n","import type { SnackbarProps } from '@mui/material'\nimport {\n Alert, AlertTitle, Snackbar,\n} from '@mui/material'\nimport type { Dispatch, SetStateAction } from 'react'\nimport React from 'react'\n\nexport interface OutOfBoundsSnackBarProps extends SnackbarProps {\n activeAccountIndex?: number\n desiredMaximumAccounts?: number\n setShowSnackBar?: Dispatch<SetStateAction<boolean>>\n showSnackBar?: boolean\n}\n\nexport const OutOfBoundsSnackBar: React.FC<OutOfBoundsSnackBarProps> = ({\n activeAccountIndex,\n desiredMaximumAccounts,\n setShowSnackBar,\n showSnackBar,\n}) => {\n return (\n <Snackbar\n anchorOrigin={{ horizontal: 'center', vertical: 'top' }}\n autoHideDuration={5000}\n onClose={() => setShowSnackBar?.(false)}\n open={showSnackBar}\n >\n <Alert severity=\"error\" onClose={() => setShowSnackBar?.(false)}>\n <AlertTitle>Maximum Accounts Error</AlertTitle>\n Your currently selected account number (\n {activeAccountIndex === undefined ? '' : activeAccountIndex + 1}\n ) cannot be greater than the desired\n Maximum Accounts (\n {desiredMaximumAccounts}\n ).\n </Alert>\n </Snackbar>\n )\n}\n","import { HelpOutline as HelpOutlineIcon } from '@mui/icons-material'\nimport type { IconButtonProps } from '@mui/material'\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n Link,\n List,\n ListItem,\n Typography,\n} from '@mui/material'\nimport React, { useState } from 'react'\n\nexport const SeedPhraseIconButton: React.FC<IconButtonProps> = (props) => {\n const [open, setOpen] = useState(false)\n const onClose = () => setOpen(false)\n return (\n <>\n <IconButton onClick={() => setOpen(true)} {...props}>\n <HelpOutlineIcon fontSize=\"small\" />\n </IconButton>\n <Dialog open={open}>\n <DialogTitle>Understanding your Seed Phrase</DialogTitle>\n <DialogContent>\n <Typography>\n Your Seed Phrase should adhere to the\n {' '}\n <Link target=\"_blank\" href=\"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki\">\n bip39 specification\n </Link>\n {' '}\n and is used to generate accounts which identify your data on the XYO Network.\n </Typography>\n <List>\n <ListItem>Do not share this phrase with anyone.</ListItem>\n <ListItem>Do not save it to a public computer.</ListItem>\n <ListItem>Do not use a existing phrase from another wallet (i.e. Metamask).</ListItem>\n <ListItem>Do not use before copying it down somewhere safe.</ListItem>\n </List>\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose} variant=\"outlined\">\n OK\n </Button>\n </DialogActions>\n </Dialog>\n </>\n )\n}\n","import {\n Alert, AlertTitle, Snackbar,\n} from '@mui/material'\nimport { generateMnemonic } from '@scure/bip39'\nimport { wordlist } from '@scure/bip39/wordlists/english'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo, useState } from 'react'\n\nexport interface DefaultSeedPhraseProps extends PropsWithChildren {\n changeSeedPhrase?: (seedPhrase: string) => void\n hideDefaultSeedPhraseMessage?: boolean\n seedPhrase?: string\n}\n\nexport const DefaultSeedPhrase: React.FC<DefaultSeedPhraseProps> = ({\n changeSeedPhrase, children, hideDefaultSeedPhraseMessage, seedPhrase,\n}) => {\n const [showSnackBar, setShowSnackBar] = useState(false)\n\n useMemo(() => {\n if (!seedPhrase) {\n const mnemonic = generateMnemonic(wordlist, 256)\n changeSeedPhrase?.(mnemonic)\n setShowSnackBar(true)\n }\n }, [changeSeedPhrase, seedPhrase])\n\n return (\n <>\n {hideDefaultSeedPhraseMessage\n ? null\n : (\n <Snackbar\n open={showSnackBar}\n autoHideDuration={5000}\n onClose={() => setShowSnackBar(false)}\n anchorOrigin={{ horizontal: 'center', vertical: 'top' }}\n >\n <Alert severity=\"success\">\n <AlertTitle>Default Seed Phrase Generated</AlertTitle>\n Go to application settings to save it.\n </Alert>\n </Snackbar>\n )}\n {children}\n </>\n )\n}\n","import type { DialogActionsProps, DialogProps } from '@mui/material'\nimport { Button, DialogActions } from '@mui/material'\nimport type { MouseEvent } from 'react'\nimport React from 'react'\n\nimport { useSeedPhrase } from '../../../../contexts/index.ts'\n\ninterface DialogActionButtonsProps extends DialogActionsProps {\n onClose?: DialogProps['onClose']\n}\n\nexport const DialogActionButtons: React.FC<DialogActionButtonsProps> = ({ onClose, ...props }) => {\n const { handleSave, setPhrase } = useSeedPhrase()\n\n const wrappedOnClose = (e: MouseEvent<HTMLElement>) => {\n // clear local copy of phrase when modal closes\n setPhrase?.('')\n onClose?.(e, 'escapeKeyDown')\n }\n\n return (\n <DialogActions {...props}>\n <Button variant=\"outlined\" onClick={wrappedOnClose}>\n Cancel\n </Button>\n <Button variant=\"outlined\" onClick={handleSave}>\n Save\n </Button>\n </DialogActions>\n )\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport type { SeedPhraseContextState } from './State.ts'\n\nexport const SeedPhraseContext = createContextEx<SeedPhraseContextState>()\n","import { generateMnemonic, validateMnemonic } from '@scure/bip39'\nimport { wordlist } from '@scure/bip39/wordlists/english'\nimport { useResetState } from '@xylabs/react-hooks'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useCallback, useEffect, useMemo, useState,\n} from 'react'\n\nimport { SeedPhraseContext } from './Context.ts'\n\nexport interface SeedPhraseProviderProps extends PropsWithChildren {\n defaultPhrase?: string\n handleChangeSeedPhrase?: (phrase: string) => void\n open?: boolean\n saveCallback?: () => void\n seedPhrase?: string\n}\n\nconst validate = (passedPhrase?: string) => {\n if (!passedPhrase) {\n return null\n }\n return validateMnemonic(passedPhrase, wordlist)\n}\n\nexport const SeedPhraseProvider: React.FC<SeedPhraseProviderProps> = ({\n children,\n defaultPhrase,\n handleChangeSeedPhrase,\n saveCallback,\n seedPhrase,\n open,\n}) => {\n const [phrase, setPhrase] = useResetState<string | undefined>(defaultPhrase)\n const [overwriteWarning, setOverwriteWarning] = useState(false)\n\n useEffect(() => {\n if (seedPhrase || open) {\n setPhrase?.(seedPhrase ?? '')\n }\n }, [seedPhrase, open, setPhrase])\n\n const handleGenerate = useCallback(() => {\n const mnemonic = generateMnemonic(wordlist, 256)\n setPhrase?.(mnemonic)\n setOverwriteWarning?.(false)\n }, [])\n\n const handleCancelOverwrite = useCallback(() => {\n // eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect\n setOverwriteWarning(false)\n }, [setOverwriteWarning])\n\n const handleClear = useCallback(() => {\n setPhrase('')\n setOverwriteWarning(false)\n }, [setPhrase, setOverwriteWarning])\n\n const handleSave = useCallback(() => {\n if (!overwriteWarning && seedPhrase && seedPhrase !== phrase) {\n setOverwriteWarning?.(true)\n } else {\n handleChangeSeedPhrase?.(phrase ?? '')\n saveCallback?.()\n }\n }, [handleChangeSeedPhrase, overwriteWarning, phrase, saveCallback, seedPhrase])\n\n useEffect(() => {\n if (!open) {\n handleCancelOverwrite()\n }\n }, [handleCancelOverwrite, open])\n\n const validSeedPhrase = useMemo(() => validate?.(seedPhrase), [seedPhrase])\n const validPhrase = useMemo(() => validate?.(phrase), [phrase])\n\n const value = useMemo(() => ({\n handleCancelOverwrite,\n handleChangeSeedPhrase,\n handleClear,\n handleGenerate,\n handleSave,\n overwriteWarning,\n phrase,\n provided: true,\n seedPhrase,\n setOverwriteWarning,\n setPhrase,\n validPhrase,\n validSeedPhrase,\n validate,\n }), [handleCancelOverwrite,\n handleChangeSeedPhrase,\n handleClear,\n handleGenerate,\n handleSave,\n overwriteWarning,\n phrase,\n seedPhrase,\n setOverwriteWarning,\n setPhrase,\n validPhrase,\n validSeedPhrase,\n validate])\n\n return (\n <SeedPhraseContext.Provider\n value={value}\n >\n {children}\n </SeedPhraseContext.Provider>\n )\n}\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { SeedPhraseContext } from './Context.ts'\n\nexport const useSeedPhrase = () => useContextEx(SeedPhraseContext, 'SeedPhrase', true)\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport type { WalletContextState } from './State.ts'\n\nexport const WalletContext = createContextEx<WalletContextState>()\n","import { useResetState } from '@xylabs/react-hooks'\nimport { usePromise } from '@xylabs/react-promise'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo } from 'react'\n\nimport { WalletContext } from './Context.ts'\n\nexport interface WalletProviderProps {\n defaultActiveAccountIndex?: number\n rootWallet?: WalletInstance | null\n}\n\nexport const WalletProvider: React.FC<PropsWithChildren<WalletProviderProps>> = ({\n children,\n defaultActiveAccountIndex = 0,\n rootWallet = null,\n ...props\n}) => {\n const [activeAccountIndex, setActiveAccountIndex] = useResetState(defaultActiveAccountIndex)\n\n const [activeAccount = null] = usePromise(async () => await rootWallet?.derivePath(activeAccountIndex.toString()), [activeAccountIndex, rootWallet])\n\n const value = useMemo(() => ({\n activeAccount,\n activeAccountIndex,\n provided: true,\n rootWallet,\n setActiveAccountIndex,\n }), [activeAccount,\n activeAccountIndex,\n rootWallet,\n setActiveAccountIndex])\n\n return (\n <WalletContext.Provider\n value={value}\n {...props}\n >\n {children}\n </WalletContext.Provider>\n )\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport { useContextEx, useProvided } from '@xyo-network/react-shared'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\n\nimport { WalletContext } from './Context.ts'\n\nexport const useWalletContext = (required = true) => {\n return useContextEx(WalletContext, 'Wallet', required)\n}\n\nexport const useWalletProvided = () => {\n return useProvided(WalletContext)\n}\n\nexport const useRootWallet = (required = true): [WalletInstance | null | undefined, Error | undefined] => {\n const { rootWallet } = useWalletContext(required)\n return [rootWallet, undefined]\n}\n\nexport const useIndexedWalletFromContext = (index: number, required = true): [WalletInstance | null | undefined, Error | undefined] => {\n const { rootWallet } = useWalletContext(required)\n const [wallet] = usePromise(async () => (await rootWallet?.derivePath(index.toString())) ?? rootWallet, [rootWallet, index])\n return [wallet, undefined]\n}\n\nexport const useSelectedWalletAccount = (required = true): [WalletInstance | null | undefined, Error | undefined] => {\n const { activeAccountIndex } = useWalletContext(required)\n // we pass in 0 as default since we can not call the hook optionally,\n // we resolve this false result by checking whether activeAccountIndex is defined before returning it\n const [account] = useIndexedWalletFromContext(activeAccountIndex ?? 0, required)\n return activeAccountIndex === undefined && account === null ? [null, undefined] : [account, undefined]\n}\n","import type { StandardTextFieldProps } from '@mui/material'\nimport { FormControl, TextField } from '@mui/material'\nimport type { ReactNode } from 'react'\nimport React from 'react'\n\nimport { useSeedPhrase } from '../../../../../contexts/index.ts'\nimport { colorParser, InvalidPhraseTypography } from './validation-messages/index.ts'\n\nexport interface NewPhraseTextFieldProps extends StandardTextFieldProps {\n children?: ReactNode\n disableColor?: boolean\n}\n\nexport const NewPhraseTextField: React.FC<NewPhraseTextFieldProps> = ({\n children, disableColor, ...props\n}) => {\n const {\n phrase, setPhrase, validPhrase,\n } = useSeedPhrase()\n return (\n <>\n <FormControl\n fullWidth\n size=\"small\"\n sx={{\n display: 'flex', flexDirection: 'column', rowGap: 1,\n }}\n >\n {children}\n <TextField\n focused\n color={disableColor ? undefined : colorParser(validPhrase)}\n error={validPhrase === false}\n helperText={validPhrase === false ? <InvalidPhraseTypography /> : null}\n fullWidth\n maxRows={Number.POSITIVE_INFINITY}\n multiline\n onChange={e => setPhrase?.(e.target.value)}\n value={phrase}\n {...props}\n />\n </FormControl>\n </>\n )\n}\n","export const colorParser = (conditional?: boolean | null) => {\n switch (conditional) {\n case true: {\n return 'success'\n }\n case false: {\n return 'error'\n }\n default: {\n return\n }\n }\n}\n","import type { TypographyProps } from '@mui/material'\nimport { Link, Typography } from '@mui/material'\nimport React from 'react'\n\nexport const InvalidPhraseTypography: React.FC<TypographyProps> = props => (\n <Typography variant=\"caption\" color=\"error\" {...props}>\n Invalid seed phrase. See -\n {' '}\n <Link target=\"_blank\" href=\"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki\">\n bip39 Proposal\n </Link>\n </Typography>\n)\n","import { CheckCircleOutline as CheckCircleOutlineIcon, HighlightOff as HighlightOffIcon } from '@mui/icons-material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo } from 'react'\n\ninterface PhraseHeaderBox extends FlexBoxProps, PropsWithChildren {\n conditional?: boolean | null\n}\n\nexport const PhraseHeaderBox: React.FC<PhraseHeaderBox> = ({\n children, conditional, ...props\n}) => {\n const state = useMemo(() => {\n switch (conditional) {\n case true: {\n return 'success'\n }\n case false: {\n return 'error'\n }\n default: {\n return null\n }\n }\n }, [conditional])\n\n const Icon = useMemo(() => {\n switch (state) {\n case 'success': {\n return <CheckCircleOutlineIcon fontSize=\"small\" color=\"success\" />\n }\n case 'error': {\n return <HighlightOffIcon fontSize=\"small\" color=\"error\" />\n }\n default: {\n return null\n }\n }\n }, [state])\n\n return (\n <FlexRow justifyContent=\"start\" columnGap={1} {...props}>\n {Icon}\n {children}\n </FlexRow>\n )\n}\n","import { Button, DialogActions } from '@mui/material'\nimport React from 'react'\n\nimport { useSeedPhrase } from '../../../../../contexts/index.ts'\n\nexport const PhraseDialogActions = () => {\n const {\n handleClear, handleGenerate, overwriteWarning,\n } = useSeedPhrase()\n return (\n <DialogActions sx={{ justifyContent: 'center' }}>\n <Button disabled={overwriteWarning} variant=\"outlined\" onClick={handleGenerate}>\n Generate\n </Button>\n <Button variant=\"outlined\" onClick={handleClear}>\n Clear\n </Button>\n </DialogActions>\n )\n}\n","import { ContentCopy } from '@mui/icons-material'\nimport type { StandardTextFieldProps } from '@mui/material'\nimport {\n Chip, FormControl, FormLabel, IconButton, TextField,\n Tooltip,\n} from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React, { useMemo, useState } from 'react'\n\nimport { useSeedPhrase } from '../../../../../contexts/index.ts'\nimport { InvalidPhraseTypography, PhraseHeaderBox } from './validation-messages/index.ts'\n\nexport interface SavedPhraseTextFieldProps extends StandardTextFieldProps {\n fullWidth?: boolean\n showCopyButton?: boolean\n showPhraseHeader?: boolean\n visible?: boolean\n}\n\nexport const SavedPhraseTextField: React.FC<SavedPhraseTextFieldProps> = ({\n fullWidth, showCopyButton, showPhraseHeader, visible: visibleProp, ...props\n}) => {\n const { validSeedPhrase, seedPhrase } = useSeedPhrase()\n\n const [visible, setVisible] = useState(visibleProp)\n\n useMemo(() => {\n setVisible(visibleProp)\n }, [visibleProp])\n\n const [copied, setCopied] = useState(false)\n const onCopyPhrase = async () => {\n if (seedPhrase) {\n try {\n await navigator.clipboard.writeText(seedPhrase)\n setCopied(true)\n setTimeout(() => setCopied(false), 2000)\n } catch (e) {\n console.error('Error copying resolvedSelectedAddress to clipboard', e)\n }\n }\n }\n\n return (\n <FormControl\n fullWidth={fullWidth}\n size=\"small\"\n sx={{\n display: 'flex', flexDirection: 'column', rowGap: 1,\n }}\n >\n <FlexRow gap={0.5}>\n <Chip\n label={visible ? 'Hide Saved Seed Phrase' : 'Reveal Saved Seed Phrase'}\n onClick={() => setVisible(!visible)}\n sx={{ alignSelf: 'center' }}\n />\n {showCopyButton && visible\n ? (\n <Tooltip title={copied ? 'Copied!' : 'Copy'}>\n <IconButton onClick={() => void onCopyPhrase()}>\n <ContentCopy fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n )\n : null}\n </FlexRow>\n {visible\n ? (\n <>\n {showPhraseHeader\n ? (\n <FormLabel>\n <PhraseHeaderBox conditional={validSeedPhrase}>Saved Seed Phrase</PhraseHeaderBox>\n </FormLabel>\n )\n : null}\n <TextField\n defaultValue={seedPhrase}\n disabled\n error={validSeedPhrase === false}\n helperText={validSeedPhrase === false ? <InvalidPhraseTypography /> : null}\n fullWidth\n maxRows={Number.POSITIVE_INFINITY}\n multiline\n {...props}\n />\n </>\n )\n : null}\n </FormControl>\n )\n}\n","import { Alert, Button } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { useSeedPhrase } from '../../../../contexts/index.ts'\n\nexport const OverwriteWarning = () => {\n const { handleCancelOverwrite, handleSave } = useSeedPhrase()\n return (\n <Alert\n variant=\"outlined\"\n severity=\"warning\"\n action={(\n <FlexRow sx={{ columnGap: 1 }}>\n <Button variant=\"outlined\" color=\"inherit\" size=\"small\" onClick={handleSave}>\n Overwrite\n </Button>\n <Button variant=\"outlined\" color=\"inherit\" size=\"small\" onClick={handleCancelOverwrite}>\n Cancel\n </Button>\n </FlexRow>\n )}\n >\n Are you sure you want to overwrite existing seed phrase? This action cannot be undone.\n </Alert>\n )\n}\n","import type { DialogProps } from '@mui/material'\nimport {\n Dialog, DialogContent, DialogTitle, FormLabel,\n} from '@mui/material'\nimport React from 'react'\n\nimport { SeedPhraseProvider, useSeedPhrase } from '../../../contexts/index.ts'\nimport { SeedPhraseIconButton } from '../_shared/index.ts'\nimport {\n DialogActionButtons,\n NewPhraseTextField,\n OverwriteWarning,\n PhraseDialogActions,\n PhraseHeaderBox,\n SavedPhraseTextField,\n} from './components/index.ts'\n\nexport interface SeedPhraseDialogProps extends DialogProps {\n changeSeedPhrase?: (value: string) => void\n seedPhrase?: string\n showCopyButton?: boolean\n}\n\nexport const SeedPhraseDialog: React.FC<SeedPhraseDialogProps> = ({\n changeSeedPhrase, seedPhrase, ...props\n}) => {\n return (\n <SeedPhraseProvider\n seedPhrase={seedPhrase}\n handleChangeSeedPhrase={changeSeedPhrase}\n open={props.open}\n saveCallback={() => props.onClose?.({}, 'escapeKeyDown')}\n >\n <SeedPhraseDialogInner {...props} />\n </SeedPhraseProvider>\n )\n}\n\nexport const SeedPhraseDialogInner: React.FC<SeedPhraseDialogProps> = ({ showCopyButton, ...props }) => {\n const {\n overwriteWarning, seedPhrase, validPhrase,\n } = useSeedPhrase()\n\n return (\n <Dialog aria-labelledby=\"alert-dialog-title\" aria-describedby=\"alert-dialog-description\" fullWidth maxWidth=\"sm\" {...props}>\n <DialogTitle id=\"alert-dialog-title\">\n Update Your Seed Phrase\n {' '}\n <SeedPhraseIconButton />\n </DialogTitle>\n <DialogContent sx={{\n display: 'flex', flexDirection: 'column', rowGap: 2,\n }}\n >\n <NewPhraseTextField>\n <FormLabel>\n <PhraseHeaderBox conditional={validPhrase}>New Seed Phrase</PhraseHeaderBox>\n </FormLabel>\n </NewPhraseTextField>\n <PhraseDialogActions />\n {seedPhrase\n ? <SavedPhraseTextField showCopyButton={showCopyButton} />\n : null}\n {overwriteWarning\n ? <OverwriteWarning />\n : null}\n </DialogContent>\n <DialogActionButtons onClose={props.onClose} />\n </Dialog>\n )\n}\n","import { Cancel as CancelIcon, RadioButtonChecked as RadioButtonCheckedIcon } from '@mui/icons-material'\nimport type { TableRowProps } from '@mui/material'\nimport {\n Button, ButtonGroup, TableCell, TableRow,\n} from '@mui/material'\nimport React, { useState } from 'react'\n\nimport { SeedPhraseIconButton } from '../_shared/index.ts'\nimport { SeedPhraseDialog } from '../dialog/index.ts'\n\nexport interface SeedPhraseTableRowProps extends TableRowProps {\n changeSeedPhrase?: (seedPhrase: string) => void\n seedPhrase?: string\n}\n\nexport const SeedPhraseTableRow: React.FC<SeedPhraseTableRowProps> = ({\n changeSeedPhrase, seedPhrase, ...props\n}) => {\n const [open, setOpen] = useState(false)\n\n const handleOpen = () => {\n setOpen(true)\n }\n return (\n <TableRow {...props}>\n <TableCell>\n Seed Phrase\n {' '}\n <SeedPhraseIconButton />\n </TableCell>\n <TableCell align=\"center\">\n {seedPhrase\n ? <RadioButtonCheckedIcon color=\"success\" />\n : <CancelIcon color=\"error\" />}\n </TableCell>\n <TableCell>\n <SeedPhraseDialog changeSeedPhrase={changeSeedPhrase} open={open} onClose={() => setOpen(false)} seedPhrase={seedPhrase} />\n <ButtonGroup fullWidth>\n <Button variant=\"contained\" size=\"small\" onClick={handleOpen}>\n Update\n </Button>\n </ButtonGroup>\n </TableCell>\n </TableRow>\n )\n}\n","import { EthAddress } from '@xylabs/eth-address'\nimport { EthAccountButton } from '@xylabs/react-crypto'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport { NumberStatus } from '@xylabs/react-number-status'\nimport { useNetwork } from '@xyo-network/react-network'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\nimport React from 'react'\n\nimport { useAccount } from '../../hooks/index.ts'\n\nexport interface WalletAccountDetailsProps extends FlexBoxProps {\n account?: WalletInstance\n exploreUrl?: string\n}\n\nexport const WalletAccountDetails: React.FC<WalletAccountDetailsProps> = ({\n exploreUrl = 'https://explore.xyo.network', account, ...props\n}) => {\n const [accountToUse] = useAccount({ account })\n const { network } = useNetwork()\n const exploreAddressUrl = `${exploreUrl}/recent?account=${accountToUse?.address}&network=${network?.name ?? 'main'}`\n\n return (\n <FlexCol {...props}>\n <EthAccountButton address={EthAddress.fromString(accountToUse?.address)} />\n <FlexRow gap={1}>\n <NumberStatus rounded title=\"Tokens\" value={0} to={`${exploreAddressUrl}&schema=network.xyo.account.tokens`} target=\"_blank\" />\n <NumberStatus rounded title=\"NFTs\" value={0} to={`${exploreAddressUrl}&schema=network.xyo.account.nfts`} target=\"_blank\" />\n <NumberStatus rounded title=\"Signatures\" value={0} to={`${exploreAddressUrl}&schema=network.xyo.account.signatures`} target=\"_blank\" />\n <NumberStatus rounded title=\"Signins\" value={0} to={`${exploreAddressUrl}&schema=network.xyo.account.signins`} target=\"_blank\" />\n </FlexRow>\n </FlexCol>\n )\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\nimport { useState } from 'react'\n\nimport {\n useRootWallet, useWalletContext, useWalletProvided,\n} from '../contexts/index.ts'\n\nexport interface AccountHookParams {\n account?: AccountInstance\n index?: number\n required?: boolean\n wallet?: WalletInstance\n}\n\nexport const useAccount = ({\n wallet, account, index, required = false,\n}: AccountHookParams = {}): [\n AccountInstance | null | undefined,\n Error | undefined,\n] => {\n const walletContextProvided = useWalletProvided()\n const [validationError, setValidationError] = useState<Error>()\n if (wallet && account && !validationError) {\n setValidationError(new Error('useAccount can not have both a wallet and an account in the parameters'))\n }\n\n if (index && account && !validationError) {\n setValidationError(new Error('useAccount can not have both a index and an account in the parameters'))\n }\n\n const [error, setError] = useState<Error>()\n const [rootWallet] = useRootWallet(!wallet && required)\n const { activeAccountIndex } = useWalletContext(false)\n const [activeAccount] = usePromise(async () => {\n try {\n if (!validationError) {\n if (wallet) {\n return await wallet?.derivePath?.(`${index ?? 0}'\\0`)\n } else if (rootWallet) {\n return await rootWallet?.derivePath?.(`${index ?? activeAccountIndex ?? 0}'\\0`)\n }\n }\n } catch (ex) {\n const error = ex as Error\n console.error(error.message)\n setError(error)\n }\n }, [index, wallet, rootWallet, activeAccountIndex, validationError])\n if (validationError && !error) {\n console.error(validationError.message)\n setError(validationError)\n }\n\n return [\n error\n ? undefined\n : (account ?? activeAccount ?? walletContextProvided)\n ? null\n : undefined,\n error,\n ]\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport { HDWallet } from '@xyo-network/account'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\nimport { useState } from 'react'\n\nimport { useSelectedWalletAccount, useWalletContext } from '../contexts/index.ts'\n\nexport interface WalletHookParams {\n mnemonic?: string\n path?: string\n required?: boolean\n seed?: ArrayBufferLike | string\n wallet?: WalletInstance | null\n}\n\nexport const useWallet = ({\n mnemonic, wallet, path, required = false, seed,\n}: WalletHookParams = {}): [\n WalletInstance | null | undefined,\n Error | undefined,\n] => {\n const walletContextProvided = useWalletContext(false)\n const [error, setError] = useState<Error>()\n const [contextAccount] = useSelectedWalletAccount(!wallet && required)\n const [activeAccount] = usePromise(async () => {\n try {\n const newAccount = await (() => {\n if (wallet) {\n return wallet\n } else if (mnemonic) {\n return HDWallet.fromPhrase(mnemonic)\n } else if (seed) {\n return HDWallet.fromSeed(seed)\n }\n return contextAccount\n })()\n\n return path ? newAccount?.derivePath?.(path) : (newAccount ?? wallet)\n } catch (ex) {\n setError(ex as Error)\n }\n }, [mnemonic, contextAccount, seed, path, wallet])\n return [activeAccount ?? (walletContextProvided ? null : activeAccount), error]\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\n\nimport { useWalletContext } from '../contexts/index.ts'\nimport { useWallet } from './useWallet.ts'\n\nexport interface WalletsHookParams {\n paths: string[]\n wallet?: WalletInstance | null\n}\n\nexport const useWallets = ({ wallet, paths }: WalletsHookParams): [WalletInstance[] | null | undefined, Error | undefined] => {\n const walletContextProvided = useWalletContext(false)\n const [foundWallet] = useWallet({ wallet })\n const [wallets, error] = usePromise(\n async () => (foundWallet ? await Promise.all(paths.map(path => foundWallet.derivePath(path))) : undefined),\n [foundWallet, paths],\n )\n return [wallets ?? (walletContextProvided ? null : wallets), error]\n}\n","import type { UsePromiseState } from '@xylabs/react-promise'\nimport { usePromise } from '@xylabs/react-promise'\nimport { HDWallet } from '@xyo-network/account'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\nimport { Mutex } from 'async-mutex'\n\nlet globalWrapperWallet: WalletInstance | undefined\nconst globalWrapperWalletMutex = new Mutex()\n\nexport const useWrapperAccount = (\n account?: AccountInstance | null,\n): [AccountInstance | null | undefined, Error | undefined, UsePromiseState | undefined] => {\n return usePromise(async () => {\n return await globalWrapperWalletMutex.runExclusive(async () => {\n // if we are expecting to receive a wallet or did receive on, return the override account\n if (account !== undefined) {\n return account\n }\n\n if (globalWrapperWallet) {\n return globalWrapperWallet\n }\n\n try {\n globalWrapperWallet = await HDWallet.random()\n console.log(`Global Wrapper Wallet Creation Success: ${globalWrapperWallet.address}`)\n } catch (ex) {\n const error = ex as Error\n console.error(`Global Wrapper Wallet Creation Failed: ${error.message}`)\n }\n return globalWrapperWallet\n })\n }, [account])\n}\n","import type { SelectProps } from '@mui/material'\nimport { CircularProgress, MenuItem } from '@mui/material'\nimport { SelectEx } from '@xylabs/react-select'\nimport type { AddressRenderRowBoxProps } from '@xyo-network/react-address-render'\nimport { AddressRenderRowBox } from '@xyo-network/react-address-render'\nimport React from 'react'\n\nimport { useWalletContext } from '../../contexts/index.ts'\nimport { useWallet } from '../../hooks/index.ts'\n\ntype SharedAddressRenderRowBoxProps = Pick<AddressRenderRowBoxProps, 'iconOnly' | 'iconSize' | 'icons' | 'showFavorite'>\n\nexport type WalletAccountSelectProps = SharedAddressRenderRowBoxProps &\n Omit<SelectProps<number>, 'variant'> &\n Partial<SelectProps<number>> & {\n addressNames?: Record<string, string | undefined>\n maxAccounts?: number\n }\n\nconst arrayRange = (length: number, start = 0) => {\n return [...Array.from({ length }).keys()].map(x => x + start)\n}\n\nexport const WalletAccountSelect: React.FC<WalletAccountSelectProps> = ({\n addressNames,\n iconOnly,\n iconSize = 24,\n icons,\n maxAccounts = 1,\n showFavorite = false,\n size,\n variant = 'outlined',\n ...props\n}) => {\n const {\n activeAccountIndex = 0, setActiveAccountIndex, rootWallet,\n } = useWalletContext()\n const disabled = !rootWallet || activeAccountIndex === undefined\n\n return (\n <>\n {rootWallet\n ? (\n <SelectEx\n margin=\"dense\"\n disabled={disabled}\n renderValue={(selectedAccountIndex) => {\n // eslint-disable-next-line @eslint-react/no-nested-components\n const Item: React.FC = () => {\n const [selectedAccount] = useWallet({ path: selectedAccountIndex.toString(), wallet: rootWallet })\n const customName = selectedAccount ? addressNames?.[selectedAccount.address] : undefined\n const favorite = !!selectedAccount && selectedAccount.address in (addressNames ?? {})\n return (\n <MenuItem\n value={selectedAccountIndex}\n sx={{\n minHeight: 0, paddingBottom: 0, paddingTop: 0,\n }}\n >\n <AddressRenderRowBox\n disableSharedRef={true}\n flexGrow={1}\n address={selectedAccount?.address}\n iconOnly={iconOnly}\n iconSize={iconSize}\n icons={icons}\n name={customName}\n favorite={favorite}\n showFavorite={showFavorite}\n />\n </MenuItem>\n )\n }\n return <Item />\n }}\n value={activeAccountIndex}\n onChange={event => setActiveAccountIndex?.(Number.parseInt(`${event.target.value}`))}\n size={size}\n variant={variant}\n {...props}\n >\n {arrayRange(maxAccounts).map((index) => {\n // eslint-disable-next-line @eslint-react/no-nested-components\n const Item: React.FC = () => {\n const [account] = useWallet({ path: index.toString(), wallet: rootWallet })\n const customName = account ? addressNames?.[account.address] : undefined\n const favorite = !!account && account.address in (addressNames ?? {})\n return (\n <MenuItem\n key={account?.address}\n value={index}\n sx={{\n minHeight: 0, paddingBottom: 0, paddingTop: 0,\n }}\n >\n <AddressRenderRowBox\n disableSharedRef={true}\n flexGrow={1}\n address={account?.address}\n favorite={favorite}\n iconOnly={iconOnly}\n iconSize={iconSize}\n icons={icons}\n name={customName}\n showFavorite={showFavorite}\n />\n </MenuItem>\n )\n }\n\n return <Item key={index} />\n })}\n </SelectEx>\n )\n : <CircularProgress size={24} />}\n </>\n )\n}\n","import type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { WalletAccountSelect } from './Select.tsx'\n\nexport interface WalletAccountSelectBarProps extends FlexBoxProps {\n addressNames?: Record<string, string | undefined>\n iconOnly?: boolean\n iconSize?: number\n icons?: boolean\n maxAccounts?: number\n showFavorite?: boolean\n size?: 'small' | 'medium'\n}\n\nexport const WalletAccountSelectBar: React.FC<WalletAccountSelectBarProps> = ({\n addressNames,\n iconOnly,\n iconSize,\n icons,\n maxAccounts = 1,\n showFavorite = false,\n size = 'small',\n ...props\n}) => {\n return (\n <FlexCol alignItems=\"stretch\" {...props}>\n <WalletAccountSelect\n addressNames={addressNames}\n fullWidth\n showFavorite={showFavorite}\n iconSize={iconSize}\n iconOnly={iconOnly}\n icons={icons}\n maxAccounts={maxAccounts}\n size={size ?? 'small'}\n variant=\"outlined\"\n />\n </FlexCol>\n )\n}\n"],"mappings":";;;;AACA,SACEA,aAAaC,WAAWC,UAAUC,kBAC7B;AACP,SAASC,gBAAgB;AACzB,OAAOC,UAASC,gBAAgB;;;ACJhC,SACEC,OAAOC,YAAYC,gBACd;AAEP,OAAOC,WAAW;AASX,IAAMC,sBAA0D,wBAAC,EACtEC,oBACAC,wBACAC,iBACAC,aAAY,MACb;AACC,SACE,sBAAA,cAACC,UAAAA;IACCC,cAAc;MAAEC,YAAY;MAAUC,UAAU;IAAM;IACtDC,kBAAkB;IAClBC,SAAS,6BAAMP,kBAAkB,KAAA,GAAxB;IACTQ,MAAMP;KAEN,sBAAA,cAACQ,OAAAA;IAAMC,UAAS;IAAQH,SAAS,6BAAMP,kBAAkB,KAAA,GAAxB;KAC/B,sBAAA,cAACW,YAAAA,MAAW,wBAAA,GAAmC,4CAE9Cb,uBAAuBc,SAAY,KAAKd,qBAAqB,GAAE,2DAG/DC,wBAAuB,IAAA,CAAA;AAKhC,GAxBuE;;;ADChE,IAAMc,sBAAqD,wBAAC,EACjEC,oBAAoBC,mBAAmBC,YAAW,MACnD;AACC,QAAM,CAACC,wBAAwBC,yBAAAA,IAA6BC,SAAAA;AAC5D,QAAM,CAACC,cAAcC,eAAAA,IAAmBF,SAAS,KAAA;AAEjD,QAAMG,0BAA0B,wBAACC,WAAAA;AAC/B,QAAIP,gBAAgBQ,UAAaV,uBAAuBU,QAAW;AACjE,cAAQD,QAAAA;QACN,KAAK,YAAY;AACf,gBAAMN,0BAAyBD,cAAc;AAC7C,gBAAMS,uBAAuBR,0BAAyB;AACtD,gBAAMS,yBAAyBZ,qBAAqB,KAAKG;AACzD,cAAIQ,wBAAwBC,wBAAwB;AAClDX,gCAAo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AW;IAAW,GAAGH;KAChC,gBAAAC,QAAA,cAACG,qBAAAA;IACCX;IACAY,WAAAA;IACAP;IACAH;IACAD;IACAE;IACAC;IACAE,MAAMA,QAAQ;IACdO,SAAQ;;AAIhB,GAzB6E;","names":["ButtonGroup","TableCell","TableRow","Typography","ButtonEx","React","useState","Alert","AlertTitle","Snackbar","React","OutOfBoundsSnackBar","activeAccountIndex","desiredMaximumAccounts","setShowSnackBar","showSnackBar","Snackbar","anchorOrigin","horizontal","vertical","autoHideDuration","onClose","open","Alert","severity","AlertTitle","undefined","MaxAccountsTableRow","activeAccountIndex","changeMaxAccounts","maxAccounts","desiredMaximumAccounts","setDesiredMaximumAccounts","useState","showSnackBar","setShowSnackBar","handleChangeMaxAccounts","change","undefined","validMaximumAccounts","maxAccountsWithinRange","console","error","Error","React","TableRow","TableCell","align","Typography","variant","ButtonGroup","ButtonEx","onClick","size","OutOfBoundsSnackBar","HelpOutline","HelpOutlineIcon","Button","Dialog","DialogActions","DialogContent","DialogTitle","IconButton","Link","List","ListItem","Typography","React","useState","SeedPhraseIconButton","props","open","setOpen","useState","onClose","React","IconButton","onClick","HelpOutlineIcon","fontSize","Dialog","DialogTitle","DialogContent","Typography","Link","target","href","List","ListItem","DialogActions","Button","variant","Alert","AlertTitle","Snackbar","generateMnemonic","wordlist","React","useMemo","useState","DefaultSeedPhrase","changeSeedPhrase","children","hideDefaultSeedPhraseMessage","seedPhrase","showSnackBar","setShowSnackBar","useState","useMemo","mnemonic","generateMnemonic","wordlist","React","Snackbar","open","autoHideDuration","onClose","anchorOrigin","horizontal","vertical","Alert","severity","AlertTitle","Button","DialogActions","React","createContextEx","SeedPhraseContext","generateMnemonic","validateMnemonic","wordlist","useResetState","React","useCallback","useEffect","useMemo","useState","validate","passedPhrase","validateMnemonic","wordlist","SeedPhraseProvider","children","defaultPhrase","handleChangeSeedPhrase","saveCallback","seedPhrase","open","phrase","setPhrase","useResetState","overwriteWarning","setOverwriteWarning","useState","useEffect","handleGenerate","useCallback","mnemonic","generateMnemonic","handleCancelOverwrite","handleClear","handleSave","validSeedPhrase","useMemo","validPhrase","value","provided","React","SeedPhraseContext","Provider","useContextEx","useSeedPhrase","useContextEx","SeedPhraseContext","createContextEx","WalletContext","useResetState","usePromise","React","useMemo","WalletProvider","children","defaultActiveAccountIndex","rootWallet","props","activeAccountIndex","setActiveAccountIndex","useResetState","activeAccount","usePromise","derivePath","toString","value","useMemo","provided","React","WalletContext","Provider","usePromise","useContextEx","useProvided","useWalletContext","required","useContextEx","WalletContext","useWalletProvided","useProvided","useRootWallet","rootWallet","undefined","useIndexedWalletFromContext","index","wallet","usePromise","derivePath","toString","useSelectedWalletAccount","activeAccountIndex","account","DialogActionButtons","onClose","props","handleSave","setPhrase","useSeedPhrase","wrappedOnClose","e","React","DialogActions","Button","variant","onClick","FormControl","TextField","React","colorParser","conditional","Link","Typography","React","InvalidPhraseTypography","props","React","Typography","variant","color","Link","target","href","CheckCircleOutline","CheckCircleOutlineIcon","HighlightOff","HighlightOffIcon","FlexRow","React","useMemo","PhraseHeaderBox","children","conditional","props","state","useMemo","Icon","React","CheckCircleOutlineIcon","fontSize","color","HighlightOffIcon","FlexRow","justifyContent","columnGap","NewPhraseTextField","children","disableColor","props","phrase","setPhrase","validPhrase","useSeedPhrase","React","FormControl","fullWidth","size","sx","display","flexDirection","rowGap","TextField","focused","color","undefined","colorParser","error","helperText","InvalidPhraseTypography","maxRows","Number","POSITIVE_INFINITY","multiline","onChange","e","target","value","Button","DialogActions","React","PhraseDialogActions","handleClear","handleGenerate","overwriteWarning","useSeedPhrase","React","DialogActions","sx","justifyContent","Button","disabled","variant","onClick","ContentCopy","Chip","FormControl","FormLabel","IconButton","TextField","Tooltip","FlexRow","React","useMemo","useState","SavedPhraseTextField","fullWidth","showCopyButton","showPhraseHeader","visible","visibleProp","props","validSeedPhrase","seedPhrase","useSeedPhrase","setVisible","useState","useMemo","copied","setCopied","onCopyPhrase","navigator","clipboard","writeText","setTimeout","e","console","error","React","FormControl","size","sx","display","flexDirection","rowGap","FlexRow","gap","Chip","label","onClick","alignSelf","Tooltip","title","IconButton","ContentCopy","fontSize","FormLabel","PhraseHeaderBox","conditional","TextField","defaultValue","disabled","helperText","InvalidPhraseTypography","maxRows","Number","POSITIVE_INFINITY","multiline","Alert","Button","FlexRow","React","OverwriteWarning","handleCancelOverwrite","handleSave","useSeedPhrase","React","Alert","variant","severity","action","FlexRow","sx","columnGap","Button","color","size","onClick","Dialog","DialogContent","DialogTitle","FormLabel","React","SeedPhraseDialog","changeSeedPhrase","seedPhrase","props","React","SeedPhraseProvider","handleChangeSeedPhrase","open","saveCallback","onClose","SeedPhraseDialogInner","showCopyButton","overwriteWarning","validPhrase","useSeedPhrase","Dialog","aria-labelledby","aria-describedby","fullWidth","maxWidth","DialogTitle","id","SeedPhraseIconButton","DialogContent","sx","display","flexDirection","rowGap","NewPhraseTextField","FormLabel","PhraseHeaderBox","conditional","PhraseDialogActions","SavedPhraseTextField","OverwriteWarning","DialogActionButtons","Cancel","CancelIcon","RadioButtonChecked","RadioButtonCheckedIcon","Button","ButtonGroup","TableCell","TableRow","React","useState","SeedPhraseTableRow","changeSeedPhrase","seedPhrase","props","open","setOpen","useState","handleOpen","React","TableRow","TableCell","SeedPhraseIconButton","align","RadioButtonCheckedIcon","color","CancelIcon","SeedPhraseDialog","onClose","ButtonGroup","fullWidth","Button","variant","size","onClick","EthAddress","EthAccountButton","FlexCol","FlexRow","NumberStatus","useNetwork","React","usePromise","useState","useAccount","wallet","account","index","required","walletContextProvided","useWalletProvided","validationError","setValidationError","useState","Error","error","setError","rootWallet","useRootWallet","activeAccountIndex","useWalletContext","activeAccount","usePromise","derivePath","ex","console","message","undefined","usePromise","HDWallet","useState","useWallet","mnemonic","wallet","path","required","seed","walletContextProvided","useWalletContext","error","setError","useState","contextAccount","useSelectedWalletAccount","activeAccount","usePromise","newAccount","HDWallet","fromPhrase","fromSeed","derivePath","ex","usePromise","useWallets","wallet","paths","walletContextProvided","useWalletContext","foundWallet","useWallet","wallets","error","usePromise","Promise","all","map","path","derivePath","undefined","usePromise","HDWallet","Mutex","globalWrapperWallet","globalWrapperWalletMutex","Mutex","useWrapperAccount","account","usePromise","runExclusive","undefined","HDWallet","random","console","log","address","ex","error","message","WalletAccountDetails","exploreUrl","account","props","accountToUse","useAccount","network","useNetwork","exploreAddressUrl","address","name","React","FlexCol","EthAccountButton","EthAddress","fromString","FlexRow","gap","NumberStatus","rounded","title","value","to","target","CircularProgress","MenuItem","SelectEx","AddressRenderRowBox","React","arrayRange","length","start","Array","from","keys","map","x","WalletAccountSelect","addressNames","iconOnly","iconSize","icons","maxAccounts","showFavorite","size","variant","props","activeAccountIndex","setActiveAccountIndex","rootWallet","useWalletContext","disabled","undefined","React","SelectEx","margin","renderValue","selectedAccountIndex","Item","selectedAccount","useWallet","path","toString","wallet","customName","address","favorite","MenuItem","value","sx","minHeight","paddingBottom","paddingTop","AddressRenderRowBox","disableSharedRef","flexGrow","name","onChange","event","Number","parseInt","target","index","account","key","CircularProgress","FlexCol","React","WalletAccountSelectBar","addressNames","iconOnly","iconSize","icons","maxAccounts","showFavorite","size","props","React","FlexCol","alignItems","WalletAccountSelect","fullWidth","variant"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-wallet",
3
- "version": "4.2.11",
3
+ "version": "4.2.13",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -43,38 +43,39 @@
43
43
  "lint-pkg": "npmPkgJsonLint ."
44
44
  },
45
45
  "dependencies": {
46
- "@scure/bip39": "^1.4.0",
47
- "@xylabs/eth-address": "^4.4.0",
48
- "@xylabs/react-button": "^5.3.7",
49
- "@xylabs/react-crypto": "^5.3.7",
50
- "@xylabs/react-flexbox": "^5.3.7",
51
- "@xylabs/react-hooks": "^5.3.7",
52
- "@xylabs/react-identicon": "^5.3.7",
53
- "@xylabs/react-number-status": "^5.3.7",
54
- "@xylabs/react-promise": "^5.3.7",
55
- "@xylabs/react-quick-tip-button": "^5.3.7",
56
- "@xylabs/react-select": "^5.3.7",
57
- "@xyo-network/account": "^3.4.2",
58
- "@xyo-network/account-model": "^3.4.2",
59
- "@xyo-network/react-address-render": "^4.2.11",
60
- "@xyo-network/react-network": "^4.2.11",
61
- "@xyo-network/react-shared": "^4.2.11",
62
- "@xyo-network/wallet-model": "^3.4.2",
46
+ "@scure/bip39": "^1.5.0",
47
+ "@xylabs/eth-address": "^4.4.25",
48
+ "@xylabs/object": "^4.4.25",
49
+ "@xylabs/react-button": "^5.3.13",
50
+ "@xylabs/react-crypto": "^5.3.13",
51
+ "@xylabs/react-flexbox": "^5.3.13",
52
+ "@xylabs/react-hooks": "^5.3.13",
53
+ "@xylabs/react-identicon": "^5.3.13",
54
+ "@xylabs/react-number-status": "^5.3.13",
55
+ "@xylabs/react-promise": "^5.3.13",
56
+ "@xylabs/react-quick-tip-button": "^5.3.13",
57
+ "@xylabs/react-select": "^5.3.13",
58
+ "@xyo-network/account": "^3.5.2",
59
+ "@xyo-network/account-model": "^3.5.2",
60
+ "@xyo-network/react-address-render": "^4.2.13",
61
+ "@xyo-network/react-network": "^4.2.13",
62
+ "@xyo-network/react-shared": "^4.2.13",
63
+ "@xyo-network/wallet-model": "^3.5.2",
63
64
  "async-mutex": "^0.5.0"
64
65
  },
65
66
  "devDependencies": {
66
- "@mui/icons-material": "^6.1.8",
67
- "@mui/material": "^6.1.8",
68
- "@mui/styles": "^6.1.8",
69
- "@storybook/react": "^8.4.5",
70
- "@xylabs/ts-scripts-yarn3": "^4.2.4",
71
- "@xylabs/tsconfig-react": "^4.2.4",
72
- "@xyo-network/react-storybook": "^4.2.11",
67
+ "@mui/icons-material": "^6.2.1",
68
+ "@mui/material": "^6.2.1",
69
+ "@mui/styles": "^6.2.1",
70
+ "@storybook/react": "^8.4.7",
71
+ "@xylabs/ts-scripts-yarn3": "^4.2.6",
72
+ "@xylabs/tsconfig-react": "^4.2.6",
73
+ "@xyo-network/react-storybook": "^4.2.13",
73
74
  "react": "^18.3.1",
74
75
  "react-dom": "^18.3.1",
75
- "react-router-dom": "^6.28.0",
76
- "storybook": "^8.4.5",
77
- "typescript": "^5.6.3"
76
+ "react-router-dom": "^7.0.2",
77
+ "storybook": "^8.4.7",
78
+ "typescript": "^5.7.2"
78
79
  },
79
80
  "peerDependencies": {
80
81
  "@mui/icons-material": "^6",
@@ -23,7 +23,7 @@ const Template: StoryFn<typeof SeedPhraseDialog> = (props) => {
23
23
  </Button>
24
24
  <Typography>Seed Phrase</Typography>
25
25
  <code>{seedPhrase}</code>
26
- <SeedPhraseDialog seedPhrase={seedPhrase} changeSeedPhrase={setSeedPhrase} {...props} open={open} onClose={() => setOpen(false)} />
26
+ <SeedPhraseDialog showCopyButton seedPhrase={seedPhrase} changeSeedPhrase={setSeedPhrase} {...props} open={open} onClose={() => setOpen(false)} />
27
27
  </FlexCol>
28
28
  )
29
29
  }
@@ -18,6 +18,7 @@ import {
18
18
  export interface SeedPhraseDialogProps extends DialogProps {
19
19
  changeSeedPhrase?: (value: string) => void
20
20
  seedPhrase?: string
21
+ showCopyButton?: boolean
21
22
  }
22
23
 
23
24
  export const SeedPhraseDialog: React.FC<SeedPhraseDialogProps> = ({
@@ -35,7 +36,7 @@ export const SeedPhraseDialog: React.FC<SeedPhraseDialogProps> = ({
35
36
  )
36
37
  }
37
38
 
38
- export const SeedPhraseDialogInner: React.FC<SeedPhraseDialogProps> = (props) => {
39
+ export const SeedPhraseDialogInner: React.FC<SeedPhraseDialogProps> = ({ showCopyButton, ...props }) => {
39
40
  const {
40
41
  overwriteWarning, seedPhrase, validPhrase,
41
42
  } = useSeedPhrase()
@@ -58,7 +59,7 @@ export const SeedPhraseDialogInner: React.FC<SeedPhraseDialogProps> = (props) =>
58
59
  </NewPhraseTextField>
59
60
  <PhraseDialogActions />
60
61
  {seedPhrase
61
- ? <SavedPhraseTextField />
62
+ ? <SavedPhraseTextField showCopyButton={showCopyButton} />
62
63
  : null}
63
64
  {overwriteWarning
64
65
  ? <OverwriteWarning />
@@ -1,23 +1,45 @@
1
+ import { ContentCopy } from '@mui/icons-material'
1
2
  import type { StandardTextFieldProps } from '@mui/material'
2
3
  import {
3
- Chip, FormControl, FormLabel, TextField,
4
+ Chip, FormControl, FormLabel, IconButton, TextField,
5
+ Tooltip,
4
6
  } from '@mui/material'
5
- import React, { useState } from 'react'
7
+ import { FlexRow } from '@xylabs/react-flexbox'
8
+ import React, { useMemo, useState } from 'react'
6
9
 
7
10
  import { useSeedPhrase } from '../../../../../contexts/index.ts'
8
11
  import { InvalidPhraseTypography, PhraseHeaderBox } from './validation-messages/index.ts'
9
12
 
10
13
  export interface SavedPhraseTextFieldProps extends StandardTextFieldProps {
11
14
  fullWidth?: boolean
15
+ showCopyButton?: boolean
12
16
  showPhraseHeader?: boolean
17
+ visible?: boolean
13
18
  }
14
19
 
15
20
  export const SavedPhraseTextField: React.FC<SavedPhraseTextFieldProps> = ({
16
- fullWidth, showPhraseHeader, ...props
21
+ fullWidth, showCopyButton, showPhraseHeader, visible: visibleProp, ...props
17
22
  }) => {
18
23
  const { validSeedPhrase, seedPhrase } = useSeedPhrase()
19
24
 
20
- const [visible, setVisible] = useState(false)
25
+ const [visible, setVisible] = useState(visibleProp)
26
+
27
+ useMemo(() => {
28
+ setVisible(visibleProp)
29
+ }, [visibleProp])
30
+
31
+ const [copied, setCopied] = useState(false)
32
+ const onCopyPhrase = async () => {
33
+ if (seedPhrase) {
34
+ try {
35
+ await navigator.clipboard.writeText(seedPhrase)
36
+ setCopied(true)
37
+ setTimeout(() => setCopied(false), 2000)
38
+ } catch (e) {
39
+ console.error('Error copying resolvedSelectedAddress to clipboard', e)
40
+ }
41
+ }
42
+ }
21
43
 
22
44
  return (
23
45
  <FormControl
@@ -27,11 +49,22 @@ export const SavedPhraseTextField: React.FC<SavedPhraseTextFieldProps> = ({
27
49
  display: 'flex', flexDirection: 'column', rowGap: 1,
28
50
  }}
29
51
  >
30
- <Chip
31
- label={visible ? 'Hide Saved Seed Phrase' : 'Reveal Saved Seed Phrase'}
32
- onClick={() => setVisible(!visible)}
33
- sx={{ alignSelf: 'center' }}
34
- />
52
+ <FlexRow gap={0.5}>
53
+ <Chip
54
+ label={visible ? 'Hide Saved Seed Phrase' : 'Reveal Saved Seed Phrase'}
55
+ onClick={() => setVisible(!visible)}
56
+ sx={{ alignSelf: 'center' }}
57
+ />
58
+ {showCopyButton && visible
59
+ ? (
60
+ <Tooltip title={copied ? 'Copied!' : 'Copy'}>
61
+ <IconButton onClick={() => void onCopyPhrase()}>
62
+ <ContentCopy fontSize="small" />
63
+ </IconButton>
64
+ </Tooltip>
65
+ )
66
+ : null}
67
+ </FlexRow>
35
68
  {visible
36
69
  ? (
37
70
  <>
@@ -1,16 +1,20 @@
1
1
  // Inspired from https://github.com/bsonntag/react-use-promise
2
2
 
3
+ import type { EnumValue } from '@xylabs/object'
4
+ import { Enum } from '@xylabs/object'
3
5
  import { Mutex } from 'async-mutex'
4
6
  import type { DependencyList } from 'react'
5
7
  import {
6
8
  useEffect, useMemo, useState,
7
9
  } from 'react'
8
10
 
9
- export enum State {
10
- pending = 'pending',
11
- rejected = 'rejected',
12
- resolved = 'resolved',
13
- }
11
+ export const State = Enum({
12
+ pending: 'pending',
13
+ rejected: 'rejected',
14
+ resolved: 'resolved',
15
+ })
16
+
17
+ export type State = EnumValue<typeof State>
14
18
 
15
19
  /**
16
20
  * usePromise -
@@ -9,7 +9,7 @@ export interface WalletHookParams {
9
9
  mnemonic?: string
10
10
  path?: string
11
11
  required?: boolean
12
- seed?: Uint8Array | string
12
+ seed?: ArrayBufferLike | string
13
13
  wallet?: WalletInstance | null
14
14
  }
15
15