Vec<u8>

Sequence 14 v393

About This Type

Boolean value: true or false.

Used for flags, toggles, and binary state in storage and call parameters.

Encoding: Fixed-width: 1 byte. 0x00 = false, 0x01 = true.

Common Uses

  • • Feature flags
  • • Success/failure indicators
  • • Registration status

Sequence (Vec)

Element Type
u8
SCALE Encoding
Length-prefixed (Compact<u32> length followed by elements)

SCALE Encoding

Rule
Fixed 1 byte: 0x00 = false, 0x01 = true.
Size
1 byte

Examples

true
0x01
01 true
false
0x00
00 false

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode a Vec<u8>
const vec = registry.createType("Vec<u8>", [1, 2, 3]);
console.log("Hex:", vec.toHex());

Referenced By (100)

and 80 more...

Type Information

Type ID
14
Kind
Sequence
Runtime
v393