Skip to content

UploadOptions

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

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:403

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


optional onPieceAdded: (transaction?) => void;

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

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:392

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:388

Called when upload to service provider completes

ParameterType
pieceCidPieceLink

void

UploadCallbacks.onUploadComplete