Hierarchy

Constructors

  • Creates an instance of CellInput.

    Parameters

    • previousOutput: OutPoint

      The previous outpoint of the cell.

    • since: bigint

      The since value of the cell input.

    • OptionalcellOutput: CellOutput

      The optional cell output associated with the cell input.

    • OptionaloutputData: `0x${string}`

      The optional output data associated with the cell input.

    Returns CellInput

Properties

previousOutput: OutPoint

The previous outpoint of the cell.

since: bigint

The since value of the cell input.

cellOutput?: CellOutput

The optional cell output associated with the cell input.

outputData?: `0x${string}`

The optional output data associated with the cell input.

byteLength?: number

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

Methods

  • Creates a CellInput instance from a CellInputLike object.

    Parameters

    • cellInput: CellInputLike

      A CellInputLike object or an instance of CellInput.

    Returns CellInput

    A CellInput instance.

    const cellInput = CellInput.from({
    previousOutput: { txHash: "0x...", index: 0 },
    since: 0n
    });
  • Complete extra infos in the input. Like the output of the out point. The instance will be modified.

    Parameters

    Returns Promise<void>

    true if succeed.

    await cellInput.completeExtraInfos();
    
  • 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 CellInput

    The decoded entity

    Will throw an error if the entity is not serializable

  • Create an entity from bytes

    Parameters

    Returns CellInput

    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