Skip to content

UploadOptions

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

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

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


optional onPieceAdded: (transaction?) => void;

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

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

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

Called when upload to service provider completes

ParameterType
pieceCidPieceLink

void

UploadCallbacks.onUploadComplete