Skip to content

UploadOptions

Defined in: packages/synapse-sdk/src/types.ts:407

Options for uploading individual pieces to an existing storage context

Used by StorageContext.upload() for uploading data to a specific provider and data set that has already been created/selected.

optional metadata: Record<string, string>;

Defined in: packages/synapse-sdk/src/types.ts:409

Custom metadata for this specific piece (key-value pairs)


optional onPieceAdded: (transaction?) => void;

Defined in: packages/synapse-sdk/src/types.ts:396

Called when the service provider has added the piece and submitted the transaction to the chain

ParameterType
transaction?TransactionResponse

void

UploadCallbacks.onPieceAdded


optional onPieceConfirmed: (pieceIds) => void;

Defined in: packages/synapse-sdk/src/types.ts:398

Called when the service provider agrees that the piece addition is confirmed on-chain

ParameterType
pieceIdsnumber[]

void

UploadCallbacks.onPieceConfirmed


optional onUploadComplete: (pieceCid) => void;

Defined in: packages/synapse-sdk/src/types.ts:394

Called when upload to service provider completes

ParameterType
pieceCidPieceLink

void

UploadCallbacks.onUploadComplete