Constructors

  • Creates an instance of Cell.

    Parameters

    • outPoint: OutPoint

      The output point of the cell.

    • cellOutput: CellOutput

      The cell output of the cell.

    • outputData: `0x${string}`

      The output data of the cell.

    Returns Cell

Properties

outPoint: OutPoint

The output point of the cell.

cellOutput: CellOutput

The cell output of the cell.

outputData: `0x${string}`

The output data of the cell.

Accessors

  • get occupiedSize(): number
  • Occupied bytes of a cell on chain It's CellOutput.occupiedSize + bytesFrom(outputData).byteLength

    Returns number

Methods

  • Creates a Cell instance from a CellLike object. This method accepts either outPoint or previousOutput to specify the cell's location, and supports automatic capacity calculation for the cell output.

    Parameters

    • cell: CellLike

      A CellLike object or an instance of Cell. The object can use either: - outPoint: For referencing a cell output - previousOutput: For referencing a cell input (alternative name for outPoint) The cellOutput can omit capacity for automatic calculation.

    Returns Cell

    A Cell instance.

    // Using outPoint with explicit capacity
    const cell1 = Cell.from({
    outPoint: { txHash: "0x...", index: 0 },
    cellOutput: {
    capacity: 1000n,
    lock: { codeHash: "0x...", hashType: "type", args: "0x..." }
    },
    outputData: "0x"
    });

    // Using previousOutput with automatic capacity calculation
    const cell2 = Cell.from({
    previousOutput: { txHash: "0x...", index: 0 },
    cellOutput: {
    lock: { codeHash: "0x...", hashType: "type", args: "0x..." }
    // capacity will be calculated automatically
    },
    outputData: "0x1234"
    });
  • Parameters

    • client: Client
    • Optionalphase: "deposited" | "withdrew"

    Returns Promise<boolean>