Bool
Primitive 9 v393About This Type
Boolean value: true or false.
Used for flags and binary state.
Encoding: 1 byte: 0x00 = false, 0x01 = true.
Primitive Type
- Name
- Bool
- Byte Size
- 1 byte
- SCALE Encoding
- Fixed-width, little-endian
SCALE Encoding
- Rule
- Fixed 1 byte: 0x00 = false, 0x01 = true.
- Size
- 1 byte
Examples
true
0x0101 truefalse
0x0000 falseCode Examples
import { TypeRegistry } from "@polkadot/types";
const registry = new TypeRegistry();
// Encode a Bool value
const value = registry.createType("Bool", true);
console.log("Hex:", value.toHex());
console.log("Bytes:", value.toU8a());Type Information
- Type ID
- 9
- Kind
- Primitive
- Runtime
- v393