From eb9f99d187dda3ba662c34a7f13f22ec63bee335 Mon Sep 17 00:00:00 2001 From: nijoe1 Date: Thu, 18 Sep 2025 13:54:55 +0300 Subject: [PATCH 1/2] chore: updated synapse-sdk version --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 36701be..161e2cb 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@filoz/synapse-sdk": "^0.24.3", + "@filoz/synapse-sdk": "^0.25.1", "@rainbow-me/rainbowkit": "^2.2.8", "@tanstack/react-query": "^5.83.0", "@wagmi/core": "^2.17.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 833259e..363b945 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@filoz/synapse-sdk': - specifier: ^0.24.3 - version: 0.24.3(bufferutil@4.0.9)(typescript@5.9.2)(utf-8-validate@5.0.10)(zod@3.22.4) + specifier: ^0.25.1 + version: 0.25.1(bufferutil@4.0.9)(typescript@5.9.2)(utf-8-validate@5.0.10)(zod@3.22.4) '@rainbow-me/rainbowkit': specifier: ^2.2.8 version: 2.2.8(@tanstack/react-query@5.85.8(react@19.1.1))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(typescript@5.9.2)(viem@2.37.1(bufferutil@4.0.9)(typescript@5.9.2)(utf-8-validate@5.0.10)(zod@3.22.4))(wagmi@2.16.9(@tanstack/query-core@5.85.7)(@tanstack/react-query@5.85.8(react@19.1.1))(@types/react@19.1.12)(bufferutil@4.0.9)(react@19.1.1)(typescript@5.9.2)(utf-8-validate@5.0.10)(viem@2.37.1(bufferutil@4.0.9)(typescript@5.9.2)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)) @@ -174,8 +174,8 @@ packages: resolution: {integrity: sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==} engines: {node: '>=14'} - '@filoz/synapse-sdk@0.24.3': - resolution: {integrity: sha512-78HyFPvSZ0T+OSxzU8UHrOeJuwUxq7JwrVj3vMIwMzdV12h/4XxbBSsg3dWdvpMCodcxM4fgZvGGc5vV2iRdMw==} + '@filoz/synapse-sdk@0.25.1': + resolution: {integrity: sha512-WHlf4ImKA0Gmicv7tJubbwDZexaWSrTWjgXJ3nQecJO5pq3LFuad7wR/ICCKUfgKi3UhYEwRfP5NjwO646xCOg==} '@gemini-wallet/core@0.2.0': resolution: {integrity: sha512-vv9aozWnKrrPWQ3vIFcWk7yta4hQW1Ie0fsNNPeXnjAxkbXr2hqMagEptLuMxpEP2W3mnRu05VDNKzcvAuuZDw==} @@ -3426,7 +3426,7 @@ snapshots: ethereum-cryptography: 2.2.1 micro-ftch: 0.3.1 - '@filoz/synapse-sdk@0.24.3(bufferutil@4.0.9)(typescript@5.9.2)(utf-8-validate@5.0.10)(zod@3.22.4)': + '@filoz/synapse-sdk@0.25.1(bufferutil@4.0.9)(typescript@5.9.2)(utf-8-validate@5.0.10)(zod@3.22.4)': dependencies: '@web3-storage/data-segment': 5.3.0 ethers: 6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) From ff22da3dda99f75224009aaed97cfc348873dda7 Mon Sep 17 00:00:00 2001 From: nijoe1 Date: Thu, 18 Sep 2025 13:55:44 +0300 Subject: [PATCH 2/2] feat: first improvements iteration --- components/DatasetsViewer.tsx | 2 + components/FileUploader.tsx | 23 +++-- hooks/useDatasets.ts | 64 ++++--------- types.ts | 12 ++- utils/calculateStorageMetrics.ts | 157 +++++++++++++++++++++++++++++-- utils/warmStorageUtils.ts | 36 ------- 6 files changed, 192 insertions(+), 102 deletions(-) diff --git a/components/DatasetsViewer.tsx b/components/DatasetsViewer.tsx index e941190..89632b9 100644 --- a/components/DatasetsViewer.tsx +++ b/components/DatasetsViewer.tsx @@ -77,6 +77,8 @@ export const DatasetsViewer = () => {

+

{dataset.message}

+

Commission: {dataset.commissionBps / 100}%

diff --git a/components/FileUploader.tsx b/components/FileUploader.tsx index a9c65fd..4236f33 100644 --- a/components/FileUploader.tsx +++ b/components/FileUploader.tsx @@ -11,8 +11,11 @@ export const FileUploader = () => { const { uploadFileMutation, uploadedInfo, handleReset, status, progress } = useFileUpload(); - const { isPending: isUploading, mutateAsync: uploadFile } = - uploadFileMutation; + const { + isPending: isUploading, + mutateAsync: uploadFile, + isError, + } = uploadFileMutation; const handleDrag = useCallback((e: React.DragEvent) => { e.preventDefault(); @@ -107,20 +110,22 @@ export const FileUploader = () => { if (!file) return; await uploadFile(file); }} - disabled={!file || isUploading || !!uploadedInfo} - aria-disabled={!file || isUploading} + disabled={(!file || isUploading || !!uploadedInfo) && !isError} + aria-disabled={(!file || isUploading || !!uploadedInfo) && !isError} className={`px-6 py-2 rounded-[20px] text-center border-2 transition-all ${ - !file || isUploading || uploadedInfo + (!file || isUploading || !!uploadedInfo) && !isError ? "border-gray-200 text-gray-400 cursor-not-allowed" : "border-secondary text-secondary hover:bg-secondary/70 hover:text-secondary-foreground focus:outline-none focus:ring-2 focus:ring-secondary/50 hover:border-secondary/70 hover:cursor-pointer" } `} > - {isUploading + {isUploading && !isError ? "Uploading..." : !uploadedInfo ? "Submit" + : isError + ? "Error(Try again) 🔄" : "Submitted"}