TransactionSource

Variant 581 v393

sp_runtime::transaction_validity::TransactionSource

About This Type

Enum type: TransactionSource.

A tagged union where the first byte selects which variant is active, followed by that variant's data.

Encoding: 1-byte variant index followed by the selected variant's field data.

Variants (3)

IndexNameFieldsDocs
0InBlocknone
1Localnone
2Externalnone

SCALE Encoding

Rule
1-byte variant index followed by variant-specific field data. 3 possible variants.
Size
variable (1+ bytes)

Examples

InBlock
0x00
00 Variant index 0 = InBlock
Local
0x01
01 Variant index 1 = Local
External
0x02
02 Variant index 2 = External

Code Examples

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

const registry = new TypeRegistry();

// Encode TransactionSource — variant "InBlock"
const value = registry.createType("TransactionSource", "InBlock");
console.log("Hex:", value.toHex());

Type Information

Type ID
581
Kind
Variant
Path
sp_runtime::transaction_validity::TransactionSource
Runtime
v393