Skip to main content

Interface: Chunk

Defined in: core-sdk/src/chunk/cac.ts:25

Content Addressed Chunk (CAC) - the immutable building block of Swarm, holding at most 4096 bytes of payload.

  • span indicates the size of the payload in bytes.
  • payload contains the actual data or the body of the chunk.
  • data contains the full chunk data - span and payload.
  • address is the Swarm hash (or reference) of the chunk.

The toSingleOwnerChunk method allows converting the CAC into a Single Owner Chunk (SOC).

Properties

address

address: Reference

Defined in: core-sdk/src/chunk/cac.ts:29


data

readonly data: Uint8Array

Defined in: core-sdk/src/chunk/cac.ts:26


payload

payload: Bytes

Defined in: core-sdk/src/chunk/cac.ts:28


span

span: Span

Defined in: core-sdk/src/chunk/cac.ts:27


toSingleOwnerChunk()

toSingleOwnerChunk: (identifier, privateKey) => SingleOwnerChunk

Defined in: core-sdk/src/chunk/cac.ts:34

Converts this CAC into a Single Owner Chunk (SOC), signed by privateKey over identifier and this chunk's address.

Parameters

identifier

string | Uint8Array<ArrayBufferLike> | Identifier

privateKey

string | Uint8Array<ArrayBufferLike> | PrivateKey

Returns

SingleOwnerChunk

💬 Get Help