Option
Variant 426 v411Option
About This Type
Optional value: Some(value) or None.
Used when a value may or may not be present. Common in storage queries where a key may not exist.
Encoding: Variant: 0x00 = None, 0x01 = Some(value). Exception: Option<bool> uses 0x00=None, 0x01=true, 0x02=false.
Variants (2)
| Index | Name | Fields | Docs |
|---|---|---|---|
| 0 | None | none | |
| 1 | Some |
SCALE Encoding
- Rule
- 1-byte variant index followed by variant-specific field data. 2 possible variants.
- Size
- variable (1+ bytes)
Examples
None
0x0000 Variant index 0 = NoneSome = Some(MultiSignature)
0x01<field0>01 Variant index 1 = Somefield 0 field0: MultiSignatureCode 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 = MultiSignature
Referenced By (60)
#39 SubtensorModule::Event via SubnetLeaseCreated.end_block#68 Sudo::Event via KeyChanged.old#73 Scheduler::Event via Dispatched.id#73 Scheduler::Event via RetrySet.id#73 Scheduler::Event via RetryCancelled.id#73 Scheduler::Event via CallUnavailable.id#73 Scheduler::Event via PeriodicFailed.id#73 Scheduler::Event via RetryFailed.id#73 Scheduler::Event via PermanentlyOverweight.id#123 WeightsPerClass via max_extrinsic#123 WeightsPerClass via max_total#123 WeightsPerClass via reserved#141 StoredPendingChange via forced#231 SubnetLease via end_block#234 SubtensorModule::Call via swap_hotkey.netuid#234 SubtensorModule::Call via swap_hotkey_v2.netuid#234 SubtensorModule::Call via register_network_with_identity.identity#234 SubtensorModule::Call via remove_stake_full_limit.limit_price#234 SubtensorModule::Call via register_leased_network.end_block#234 SubtensorModule::Call via add_stake_burn.limit
and 40 more...
Type Information
- Type ID
- 426
- Kind
- Variant
- Path
- Option
- Runtime
- v411