Option
Variant 168 v393Option
About This Type
Flexible address format supporting multiple encoding styles.
Allows specifying an account as Id (AccountId32), Index (u32 account index), Raw bytes, Address32, or Address20. Most commonly used with the Id variant.
Encoding: Variant: 0x00=Id (32 bytes), 0x01=Index (compact u32), 0x02=Raw, 0x03=Address32, 0x04=Address20.
Variants (2)
| Index | Name | Fields | Docs |
|---|---|---|---|
| 0 | None | none | |
| 1 | Some |
SCALE Encoding
- Rule
- 1-byte variant selects the address format, followed by format-specific data.
- Size
- variable (1–33 bytes)
Examples
Id variant (AccountId32) = Id(5Grw...QY)
0x00d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d00 Variant 0 = Idd43593c7...56da27d 32-byte AccountId32Code Examples
import { TypeRegistry } from "@polkadot/types";
const registry = new TypeRegistry();
// Encode Option — variant "None"
const value = registry.createType("Option", "None");
console.log("Hex:", value.toHex());Type Parameters
T = (u32, u32)
Referenced By (157)
#39 SubtensorModule::Event via SubnetLeaseCreated.end_block#57 Sudo::Event via KeyChanged.old#62 Scheduler::Event via Dispatched.id#62 Scheduler::Event via RetrySet.id#62 Scheduler::Event via RetryCancelled.id#62 Scheduler::Event via CallUnavailable.id#62 Scheduler::Event via PeriodicFailed.id#62 Scheduler::Event via RetryFailed.id#62 Scheduler::Event via PermanentlyOverweight.id#112 WeightsPerClass via max_extrinsic#112 WeightsPerClass via max_total#112 WeightsPerClass via reserved#143 SubtensorModule::Call via swap_hotkey.netuid#143 SubtensorModule::Call via swap_hotkey_v2.netuid#143 SubtensorModule::Call via register_network_with_identity.identity#143 SubtensorModule::Call via remove_stake_full_limit.limit_price#143 SubtensorModule::Call via register_leased_network.end_block#143 SubtensorModule::Call via add_stake_burn.limit#164 Multisig::Call via as_multi.maybe_timepoint#164 Multisig::Call via approve_as_multi.maybe_timepoint
and 137 more...
Type Information
- Type ID
- 168
- Kind
- Variant
- Path
- Option
- Runtime
- v393