Hierarchy

Constructors

  • Creates an instance of CellOutput.

    Parameters

    • capacity: bigint

      The capacity of the cell.

    • lock: Script

      The lock script of the cell.

    • Optionaltype: Script

      The optional type script of the cell.

    Returns CellOutput

Properties

capacity: bigint

The capacity of the cell.

lock: Script

The lock script of the cell.

type?: Script

The optional type script of the cell.

byteLength?: number

The bytes length of the entity, if it is fixed, otherwise undefined

Accessors

Methods

  • Creates a CellOutput instance from a CellOutputLike object.

    Parameters

    • cellOutput: CellOutputLike

      A CellOutputLike object or an instance of CellOutput.

    Returns CellOutput

    A CellOutput instance.

    const cellOutput = CellOutput.from({
    capacity: 1000n,
    lock: { codeHash: "0x...", hashType: "type", args: "0x..." },
    type: { codeHash: "0x...", hashType: "type", args: "0x..." }
    });
  • Encode the entity into bytes

    Parameters

    Returns Uint8Array

    The encoded bytes

    Will throw an error if the entity is not serializable

  • Decode the entity from bytes

    Parameters

    Returns CellOutput

    The decoded entity

    Will throw an error if the entity is not serializable

  • Create an entity from bytes

    Parameters

    Returns CellOutput

    The created entity

    Will throw an error if the entity is not serializable

  • Convert the entity to bytes

    Returns Uint8Array

    The bytes representation of the entity

  • Check if the entity is equal to another entity

    Parameters

    Returns boolean

    True if the entities are equal, false otherwise

  • Calculate the hash of the entity

    Returns `0x${string}`

    The hash of the entity