The capacity of the cell.
The lock script of the cell.
OptionaltypeThe optional type script of the cell.
Static OptionalbyteThe bytes length of the entity, if it is fixed, otherwise undefined
StaticfromCreates a CellOutput instance from a CellOutputLike object.
If outputData is provided, capacity is ensured to meet the occupied minimum.
Valid instances are returned as-is, while invalid instances are reconstructed
shallowly without mutating the original.
A CellOutputLike object or an instance of CellOutput.
OptionaloutputData: BytesLike | null
Optional output data for capacity verification.
A CellOutput instance.
// Basic usage with explicit capacity
const cellOutput1 = CellOutput.from({
capacity: 1000n,
lock: { codeHash: "0x...", hashType: "type", args: "0x..." },
type: { codeHash: "0x...", hashType: "type", args: "0x..." }
});
// Automatic capacity calculation
const cellOutput2 = CellOutput.from({
lock: { codeHash: "0x...", hashType: "type", args: "0x..." }
}, "0x1234");
StaticBaseGenerate a base class of CCC to create a serializable instance. This should be used with the codec decorator.
StaticencodeEncode the entity into bytes
The entity to encode
The encoded bytes
StaticdecodeDecode the entity from bytes
The bytes to decode
Optional_context: any
Optional context passed to the codec
The decoded entity
StaticfromCreate an entity from bytes
Optional_context: any
Optional context passed to the codec
The created entity
Check if the entity is equal to another entity
The other entity to compare with
True if the entities are equal, false otherwise
Calculate the hash of the entity
The hash of the entity
Convert the entity to a full-byte untrimmed Hex representation
The entity full-byte untrimmed hexadecimal representation
StaticBaseGenerate a base class of CCC to create a serializable Union instance. This should be used with the codec decorator.
Creates an instance of CellOutput.