@ethersphere/bee-dashboard 0.35.2 → 0.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +21 -5
  2. package/build/assets/{__vite-browser-external-9jrN1CIx.js → __vite-browser-external-DmQu5B2A.js} +2 -2
  3. package/build/assets/{download.browser-DkW-1Tu7.js → download.browser-Cpjk6LAy.js} +1 -1
  4. package/build/assets/{download.node-DYTXAdrY.js → download.node-BhI545cO.js} +1 -1
  5. package/build/assets/{fs.node-DwBlG7zh.js → fs.node-DsMWLAtR.js} +2 -2
  6. package/build/assets/index-T9boIyrz.js +133 -0
  7. package/build/assets/vendor-ethers-DdwEM-gK.js +87 -0
  8. package/build/assets/vendor-react-mui-tUcmOwCz.js +227 -0
  9. package/build/index.html +3 -3
  10. package/lib/{App-C_kvJWIL.js → App-7cAV7lii.js} +11204 -21656
  11. package/lib/{App-BaED7J22.mjs → App-_sIcw37E.mjs} +11204 -21656
  12. package/lib/App.cjs.js +1 -1
  13. package/lib/App.d.ts +5 -1
  14. package/lib/App.js +1 -1
  15. package/lib/assets/data/nodes-db.json.d.ts +8670 -47142
  16. package/lib/components/ChainSync.d.ts +1 -1
  17. package/lib/components/Flex.d.ts +1 -1
  18. package/lib/constants.d.ts +4 -0
  19. package/lib/{download.browser-Brcsou-R.js → download.browser-CkVF14pl.js} +1 -1
  20. package/lib/{download.browser-CuzNogtF.mjs → download.browser-D4xwSLDm.mjs} +1 -1
  21. package/lib/{download.node-C_QRIakM.mjs → download.node-CmYlr7RX.mjs} +1 -1
  22. package/lib/{download.node-Bnd9C4co.js → download.node-sjp1kwLg.js} +1 -1
  23. package/lib/{fs.node-p28LxQ49.mjs → fs.node-DCqDmotb.mjs} +1 -1
  24. package/lib/{fs.node-BOfQnDum.js → fs.node-DTMYb9kO.js} +1 -1
  25. package/lib/modules/filemanager/components/CustomDropdown/CustomDropdown.d.ts +1 -1
  26. package/lib/modules/filemanager/components/VersionHistoryModal/VersionList/VersionList.d.ts +1 -1
  27. package/lib/pages/filemanager/SearchContext.d.ts +1 -1
  28. package/lib/pages/filemanager/ViewContext.d.ts +1 -1
  29. package/lib/pages/giftCode/index.d.ts +1 -1
  30. package/lib/pages/info/ChequebookInfoCard.d.ts +1 -1
  31. package/lib/pages/info/WalletInfoCard.d.ts +1 -1
  32. package/lib/providers/FileManager.d.ts +1 -1
  33. package/lib/providers/Settings.d.ts +10 -0
  34. package/lib/theme.d.ts +1 -1
  35. package/lib/{upload.node-BsycYU0Z.mjs → upload.node-9Q7y6klc.mjs} +3 -3
  36. package/lib/{upload.node-BOc26jHW.js → upload.node-DBWX-yGw.js} +3 -3
  37. package/lib/utils/bee-error.d.ts +22 -0
  38. package/lib/utils/common.d.ts +1 -0
  39. package/lib/utils/desktop.d.ts +5 -0
  40. package/lib/utils/index.d.ts +1 -0
  41. package/package.json +9 -6
  42. package/build/assets/index-BWr_7okq.js +0 -126
  43. package/build/assets/vendor-ethers-Dmh4iz5c.js +0 -87
  44. package/build/assets/vendor-react-mui-Dv6xxk4a.js +0 -227
@@ -1 +1 @@
1
- export declare function ChainSync(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function ChainSync(): import("react").JSX.Element;
@@ -2,5 +2,5 @@ import { ReactNode } from 'react';
2
2
  interface Props {
3
3
  children: ReactNode;
4
4
  }
5
- export declare function Flex({ children }: Props): import("react/jsx-runtime").JSX.Element;
5
+ export declare function Flex({ children }: Props): import("react").JSX.Element;
6
6
  export {};
@@ -14,5 +14,9 @@ export declare const BEE_DESKTOP_LATEST_RELEASE_PAGE = "https://github.com/ether
14
14
  export declare const BEE_DESKTOP_LATEST_RELEASE_PAGE_API = "https://api.github.com/repos/ethersphere/bee-desktop/releases/latest";
15
15
  export declare const DEFAULT_BEE_API_HOST = "http://localhost:1633";
16
16
  export declare const DEFAULT_RPC_URL = "https://xdai.fairdatasociety.org";
17
+ export declare const DEFAULT_GIFT_WALLET_FEES: {
18
+ dai: string;
19
+ bzz: string;
20
+ };
17
21
  export declare const MIN_STAMP_DEPTH = 17;
18
22
  export declare const MAX_STAMP_DEPTH = 255;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const App = require("./App-C_kvJWIL.js");
3
+ const App = require("./App-7cAV7lii.js");
4
4
  async function downloadReadableFetch(resource, apiUrl, endpoint, options, requestOptions) {
5
5
  if (options) {
6
6
  options = prepareDownloadOptions(options);
@@ -1,4 +1,4 @@
1
- import { T as Types, R as Reference, P as PublicKey } from "./App-BaED7J22.mjs";
1
+ import { T as Types, R as Reference, P as PublicKey } from "./App-_sIcw37E.mjs";
2
2
  async function downloadReadableFetch(resource, apiUrl, endpoint, options, requestOptions) {
3
3
  if (options) {
4
4
  options = prepareDownloadOptions(options);
@@ -1,4 +1,4 @@
1
- import { s as settlePromises } from "./App-BaED7J22.mjs";
1
+ import { s as settlePromises } from "./App-_sIcw37E.mjs";
2
2
  async function downloadNode(bee, resources, options, requestOptions) {
3
3
  const dataPromises = [];
4
4
  for (const resource of resources) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const App = require("./App-C_kvJWIL.js");
3
+ const App = require("./App-7cAV7lii.js");
4
4
  async function downloadNode(bee, resources, options, requestOptions) {
5
5
  const dataPromises = [];
6
6
  for (const resource of resources) {
@@ -1,4 +1,4 @@
1
- import { F as FileError } from "./App-BaED7J22.mjs";
1
+ import { F as FileError } from "./App-_sIcw37E.mjs";
2
2
  const contentTypes = /* @__PURE__ */ new Map([
3
3
  [".mp4", "video/mp4"],
4
4
  [".webm", "video/webm"],
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const App = require("./App-C_kvJWIL.js");
3
+ const App = require("./App-7cAV7lii.js");
4
4
  const contentTypes = /* @__PURE__ */ new Map([
5
5
  [".mp4", "video/mp4"],
6
6
  [".webm", "video/webm"],
@@ -12,5 +12,5 @@ interface CustomDropdownProps {
12
12
  icon?: React.ReactNode;
13
13
  infoText?: string;
14
14
  }
15
- export declare function CustomDropdown({ options, value, onChange, placeholder, id, label, icon, infoText, }: CustomDropdownProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function CustomDropdown({ options, value, onChange, placeholder, id, label, icon, infoText, }: CustomDropdownProps): import("react").JSX.Element;
16
16
  export {};
@@ -6,5 +6,5 @@ interface VersionListProps {
6
6
  onDownload: (props: TrackDownloadProps) => (dp: DownloadProgress) => void;
7
7
  restoreVersion: (fi: FileInfo) => Promise<void>;
8
8
  }
9
- export declare function VersionsList({ versions, headFi, restoreVersion, onDownload }: VersionListProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export declare function VersionsList({ versions, headFi, restoreVersion, onDownload }: VersionListProps): import("react").JSX.Element | null;
10
10
  export {};
@@ -13,6 +13,6 @@ export interface SearchState {
13
13
  }
14
14
  export declare function SearchProvider({ children }: {
15
15
  children: ReactNode;
16
- }): import("react/jsx-runtime").JSX.Element;
16
+ }): import("react").JSX.Element;
17
17
  export declare function useSearch(): SearchState;
18
18
  export {};
@@ -8,6 +8,6 @@ interface ViewContextProps {
8
8
  }
9
9
  export declare function ViewProvider({ children }: {
10
10
  children: ReactNode;
11
- }): import("react/jsx-runtime").JSX.Element;
11
+ }): import("react").JSX.Element;
12
12
  export declare function useView(): ViewContextProps;
13
13
  export {};
@@ -1,2 +1,2 @@
1
1
  import { ReactElement } from 'react';
2
- export default function Index(): ReactElement;
2
+ export default function Index(): ReactElement | null;
@@ -1 +1 @@
1
- export declare function ChequebookInfoCard(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function ChequebookInfoCard(): import("react").JSX.Element;
@@ -1 +1 @@
1
- export declare function WalletInfoCard(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function WalletInfoCard(): import("react").JSX.Element;
@@ -27,5 +27,5 @@ export declare const Consumer: import('react').Consumer<ContextInterface>;
27
27
  interface Props {
28
28
  children: ReactNode;
29
29
  }
30
- export declare function Provider({ children }: Props): import("react/jsx-runtime").JSX.Element;
30
+ export declare function Provider({ children }: Props): import("react").JSX.Element;
31
31
  export {};
@@ -8,13 +8,19 @@ interface ContextInterface {
8
8
  desktopApiKey: string;
9
9
  isDesktop: boolean;
10
10
  desktopUrl: string;
11
+ giftWalletFees?: {
12
+ bzz: string;
13
+ dai: string;
14
+ };
11
15
  rpcProviderUrl: string;
12
16
  rpcProvider: JsonRpcProvider | null;
13
17
  cors: string | null;
14
18
  dataDir: string | null;
19
+ configFile: string | null;
15
20
  ensResolver: string | null;
16
21
  setApiUrl: (url: string) => void;
17
22
  setAndPersistJsonRpcProvider: (url: string) => void;
23
+ setEnsResolver: (url: string) => void;
18
24
  isLoading: boolean;
19
25
  error: Error | null;
20
26
  }
@@ -26,6 +32,10 @@ interface InitialSettings {
26
32
  isDesktop?: boolean;
27
33
  desktopUrl?: string;
28
34
  defaultRpcUrl?: string;
35
+ giftWalletFees?: {
36
+ bzz: string;
37
+ dai: string;
38
+ };
29
39
  }
30
40
  interface Props extends InitialSettings {
31
41
  children: ReactNode;
package/lib/theme.d.ts CHANGED
@@ -6,4 +6,4 @@ declare module '@mui/material/styles' {
6
6
  mode?: 'light' | 'dark';
7
7
  }
8
8
  }
9
- export declare const theme: import('@mui/material/styles').Theme;
9
+ export declare const theme: import('@mui/material').Theme;
@@ -1,4 +1,4 @@
1
- import { B as BatchId, F as FileError } from "./App-BaED7J22.mjs";
1
+ import { B as BatchId, F as FileError } from "./App-_sIcw37E.mjs";
2
2
  async function uploadNode(bee, batchId, nodeOptions, uploadOptions, requestOptions) {
3
3
  const uploadFilesRes = await uploadFileOrDirectory(bee, new BatchId(batchId), nodeOptions.path, { ...uploadOptions, act: false }, requestOptions);
4
4
  let uploadPreviewRes;
@@ -12,7 +12,7 @@ async function uploadNode(bee, batchId, nodeOptions, uploadOptions, requestOptio
12
12
  return await bee.uploadData(batchId, JSON.stringify(wrappedData), { ...uploadOptions, act: true }, requestOptions);
13
13
  }
14
14
  async function uploadFileOrDirectory(bee, batchId, resolvedPath, uploadOptions, requestOptions) {
15
- const { isDir } = await import("./fs.node-p28LxQ49.mjs");
15
+ const { isDir } = await import("./fs.node-DCqDmotb.mjs");
16
16
  const isPathDir = await isDir(resolvedPath);
17
17
  if (isPathDir) {
18
18
  return uploadDirectory(bee, batchId, resolvedPath, uploadOptions, requestOptions);
@@ -21,7 +21,7 @@ async function uploadFileOrDirectory(bee, batchId, resolvedPath, uploadOptions,
21
21
  }
22
22
  async function uploadFile(bee, batchId, resolvedPath, uploadOptions, requestOptions) {
23
23
  try {
24
- const { readFile } = await import("./fs.node-p28LxQ49.mjs");
24
+ const { readFile } = await import("./fs.node-DCqDmotb.mjs");
25
25
  const { data, name, contentType } = await readFile(resolvedPath);
26
26
  return await bee.uploadFile(batchId, data, name, {
27
27
  ...uploadOptions,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const App = require("./App-C_kvJWIL.js");
3
+ const App = require("./App-7cAV7lii.js");
4
4
  async function uploadNode(bee, batchId, nodeOptions, uploadOptions, requestOptions) {
5
5
  const uploadFilesRes = await uploadFileOrDirectory(bee, new App.BatchId(batchId), nodeOptions.path, { ...uploadOptions, act: false }, requestOptions);
6
6
  let uploadPreviewRes;
@@ -14,7 +14,7 @@ async function uploadNode(bee, batchId, nodeOptions, uploadOptions, requestOptio
14
14
  return await bee.uploadData(batchId, JSON.stringify(wrappedData), { ...uploadOptions, act: true }, requestOptions);
15
15
  }
16
16
  async function uploadFileOrDirectory(bee, batchId, resolvedPath, uploadOptions, requestOptions) {
17
- const { isDir } = await Promise.resolve().then(() => require("./fs.node-BOfQnDum.js"));
17
+ const { isDir } = await Promise.resolve().then(() => require("./fs.node-DTMYb9kO.js"));
18
18
  const isPathDir = await isDir(resolvedPath);
19
19
  if (isPathDir) {
20
20
  return uploadDirectory(bee, batchId, resolvedPath, uploadOptions, requestOptions);
@@ -23,7 +23,7 @@ async function uploadFileOrDirectory(bee, batchId, resolvedPath, uploadOptions,
23
23
  }
24
24
  async function uploadFile(bee, batchId, resolvedPath, uploadOptions, requestOptions) {
25
25
  try {
26
- const { readFile } = await Promise.resolve().then(() => require("./fs.node-BOfQnDum.js"));
26
+ const { readFile } = await Promise.resolve().then(() => require("./fs.node-DTMYb9kO.js"));
27
27
  const { data, name, contentType } = await readFile(resolvedPath);
28
28
  return await bee.uploadFile(batchId, data, name, {
29
29
  ...uploadOptions,
@@ -0,0 +1,22 @@
1
+ import { BZZ, WalletBalance } from '@ethersphere/bee-js';
2
+ import { ProviderContext } from 'notistack';
3
+ /**
4
+ * Extracts the most meaningful, human-readable reason from an error thrown by the Bee API.
5
+ *
6
+ * Bee-js `BeeResponseError.message` only contains the generic HTTP layer message
7
+ * (e.g. "Request failed with status code 402"), while the actual reason reported by the
8
+ * Bee node (e.g. "out of funds") is in `responseBody`.
9
+ */
10
+ export declare function extractBeeApiErrorMessage(error: unknown): string;
11
+ /**
12
+ * Checks whether the node's wallet can cover a stamp purchase before sending the transaction.
13
+ *
14
+ * @returns an actionable error message, or null when the balance is sufficient or unknown
15
+ */
16
+ export declare function getStampFundsShortageMessage(cost: BZZ, walletBalance: WalletBalance | null): string | null;
17
+ /**
18
+ * Shows an error snackbar when the node's wallet cannot cover a stamp purchase.
19
+ *
20
+ * @returns true when the purchase should be aborted
21
+ */
22
+ export declare function notifyStampFundsShortage(cost: BZZ, walletBalance: WalletBalance | null, enqueueSnackbar: ProviderContext['enqueueSnackbar']): boolean;
@@ -0,0 +1 @@
1
+ export declare function tryCatch<T>(fn: () => Promise<T>): Promise<[T, null] | [null, unknown]>;
@@ -10,11 +10,16 @@ export interface BeeConfig {
10
10
  'resolver-options': string;
11
11
  'use-postage-snapshot': boolean;
12
12
  'data-dir': string;
13
+ 'config-file-path'?: string;
13
14
  'blockchain-rpc-endpoint'?: string;
15
+ 'swap-endpoint'?: string;
14
16
  }
17
+ export declare function resolveBlockchainRpcEndpoint(config: BeeConfig): string | undefined;
15
18
  export declare function getBzzPriceAsDai(desktopUrl: string): Promise<DAI>;
16
19
  export declare function upgradeToLightNode(desktopUrl: string, rpcProvider: string): Promise<BeeConfig>;
17
20
  export declare function setJsonRpcInDesktop(desktopUrl: string, value: string): Promise<void>;
21
+ export declare function setEnsResolverInDesktop(desktopUrl: string, value: string): Promise<void>;
22
+ export declare function extractEnsResolverUrl(value: string): string | null;
18
23
  export declare function getDesktopConfiguration(desktopUrl: string): Promise<BeeConfig>;
19
24
  export declare function restartBeeNode(desktopUrl: string): Promise<void>;
20
25
  export declare function createGiftWallet(desktopUrl: string, address: string): Promise<void>;
@@ -55,5 +55,6 @@ export declare function extractEns(value: string): string | undefined;
55
55
  export declare function recognizeEnsOrSwarmHash(value: string): string;
56
56
  export declare function uuidV4(): string;
57
57
  export declare function formatEnum(string: string): string;
58
+ export declare function preciseTimeString(seconds: number): string;
58
59
  export declare function secondsToTimeString(seconds: number | bigint): string;
59
60
  export declare function shortenText(text: string, length?: number, separator?: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethersphere/bee-dashboard",
3
- "version": "0.35.2",
3
+ "version": "0.36.1",
4
4
  "description": "An app which helps users to setup their Bee node and do actions like cash out cheques",
5
5
  "homepage": ".",
6
6
  "bin": {
@@ -29,8 +29,8 @@
29
29
  "peerDependencies": {
30
30
  "react": ">=19",
31
31
  "react-dom": ">=19",
32
- "react-router": ">=7",
33
- "react-router-dom": ">=7",
32
+ "react-router": "^7.18.1",
33
+ "react-router-dom": "^7.18.1",
34
34
  "tss-react": ">=4"
35
35
  },
36
36
  "dependencies": {
@@ -41,7 +41,7 @@
41
41
  "@mui/icons-material": "^7.3.7",
42
42
  "@mui/material": "^7.3.7",
43
43
  "@solarpunkltd/file-manager-lib": "^1.0.9",
44
- "axios": "^0.30.2",
44
+ "axios": "^1.16.1",
45
45
  "bignumber.js": "^9.3.1",
46
46
  "dotted-map": "^2.2.3",
47
47
  "ethers": "^6.16.0",
@@ -55,7 +55,7 @@
55
55
  "react-qr-code": "^2.0.18",
56
56
  "react-syntax-highlighter": "16.1.0",
57
57
  "remixicon-react": "^1.0.0",
58
- "serve-handler": "6.1.6"
58
+ "serve-handler": "6.1.7"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@babel/core": "^7.26.10",
@@ -140,7 +140,7 @@
140
140
  "node": ">=24.0.0",
141
141
  "npm": ">=11.0.0",
142
142
  "pnpm": ">=10.0.0",
143
- "bee": "2.7.0"
143
+ "bee": "2.8.1"
144
144
  },
145
145
  "scripts": {
146
146
  "start": "vite",
@@ -155,6 +155,9 @@
155
155
  "lint:fix": "pnpm run lint --fix",
156
156
  "check:types": "tsc --project tsconfig.lib.json",
157
157
  "update-map-data": "node ./utils/update-map-data.js",
158
+ "mock:bee": "node ./utils/mock-bee-proxy.js",
159
+ "mock:bee:nofunds": "STATUS=400 MESSAGE='out of funds' node ./utils/mock-bee-proxy.js",
160
+ "mock:bee:poor": "POOR_WALLET=1 node ./utils/mock-bee-proxy.js",
158
161
  "init:husky": "pnpm husky install"
159
162
  }
160
163
  }