Origin

Variant 98 v393

pallet_contracts::Origin

About This Type

Enum type: Origin.

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 (2)

IndexNameFieldsDocs
0Rootnone
1Signed

SCALE Encoding

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

Examples

Root
0x00
00 Variant index 0 = Root
Signed = Signed(AccountId)
0x01<field0>
01 Variant index 1 = Signed
field 0 field0: AccountId

Code Examples

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

const registry = new TypeRegistry();

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

Type Parameters

T = Runtime

Referenced By (1)

Type Information

Type ID
98
Kind
Variant
Path
pallet_contracts::Origin
Runtime
v393