UploadResult
Defined in: packages/synapse-sdk/src/types.ts:594
Upload result information with multi-copy support.
Important: Receiving an UploadResult does not guarantee all copies succeeded.
Always check copies.length against your requested count and inspect failures
if fewer copies than expected were created.
Example
Section titled “Example”const result = await synapse.storage.upload(data, { count: 3 })
if (result.copies.length < 3) { console.warn(`Only ${result.copies.length}/3 copies succeeded`) for (const failure of result.failures) { console.error(`Provider ${failure.providerId} failed: ${failure.error}`) }}Properties
Section titled “Properties”copies
Section titled “copies”copies:
CopyResult[]
Defined in: packages/synapse-sdk/src/types.ts:603
Successful copies. Primary is first (index 0) when it succeeds. Length may be less than requested count if some providers failed.
failures
Section titled “failures”failures:
FailedCopy[]
Defined in: packages/synapse-sdk/src/types.ts:612
Failed provider attempts. Empty if all copies succeeded.
Note: failures.length + copies.length may exceed the requested count
because failed providers are retried with alternates. For example,
requesting 2 copies might yield 2 successful copies and 3 failures
if multiple retry attempts were needed.
pieceCid
Section titled “pieceCid”pieceCid:
PieceLink
Defined in: packages/synapse-sdk/src/types.ts:596
The piece CID (same across all copies)
size:
number
Defined in: packages/synapse-sdk/src/types.ts:598
Raw data size in bytes