Option
Variant 688 v393Option
About This Type
Enum type: Option.
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)
| 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(FixedI128)
0x01<field0>01 Variant index 1 = Somefield 0 field0: FixedI128Code 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 = FixedI128
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
- 688
- Kind
- Variant
- Path
- Option
- Runtime
- v393