Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents an immutable block of data that is uniquely referenced with a cid.

example

const block = new Block(Uint8Array.from([0, 1, 2, 3]), new CID('...'))

Hierarchy

  • Block

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new Block(data: Uint8Array, cid: CID): Block
  • Parameters

    • data: Uint8Array

      The data to be stored in the block as a Uint8Array.

    • cid: CID

      The cid of the data

    Returns Block

Properties

cid

cid: CID

data

data: Uint8Array

Accessors

[Symbol.toStringTag]

  • get [Symbol.toStringTag](): string

[blockSymbol]

  • get [blockSymbol](): boolean

_cid

  • get _cid(): CID
  • The cid of the data this block represents.

    deprecated

    Returns CID

_data

  • get _data(): Uint8Array
  • The data of this block.

    deprecated

    Returns Uint8Array

Methods

Static isBlock

  • isBlock(other: any): other is Block
  • Check if the given value is a Block.

    Parameters

    • other: any

    Returns other is Block