Overview
Substrate-aware input components for the Polkadot ecosystem
Component Overview
Relaycode ships a library of 22 input components and 10 contextual selectors that map directly to Substrate runtime types. Each component understands the SCALE type it represents, validates input accordingly, and emits values ready for SCALE encoding.
Components are resolved automatically through a priority-based type resolution system.
Available Components
| Component | Substrate Types | Description |
|---|---|---|
| AccountInput | AccountId, MultiAddress, Address | Address input with wallet integration and SS58 validation |
| BalanceInput | Balance, BalanceOf, Compact<Balance> | Token amount with denomination selector and balance display |
| AmountInput | u8-u128, i8-i128, Compact<uN> | Numeric integer input for unsigned and signed integers |
| BoolInput | bool | Toggle switch for boolean parameters |
| HashInput | H160, H256, H512, Hash | Fixed-length hex hash input with length validation |
| BytesInput | Bytes, Vec<u8> | Raw bytes hex input with multiple input modes |
| CallInput | Call, RuntimeCall | Nested extrinsic builder for composing calls |
| EnumInput | Enum types from metadata | Variant selector with dynamic inner value resolution |
| OptionInput | Option<T> | Optional value toggle wrapping any inner type |
| StructInput | Struct types from metadata | Named field grouping with recursive sub-inputs |
| TextInput | String, Text | Basic string input and fallback for unknown types |
| TupleInput | (T1, T2, ...) | Positional element inputs for tuple types |
| VectorInput | Vec<T>, BoundedVec<T>, BTreeSet<T> | Dynamic-length array with add/remove controls (supports unique mode for sets) |
| VectorFixedInput | [T; N] | Fixed-length array with N input slots |
| BTreeMapInput | BTreeMap<K, V> | Key-value pair entries |
| MomentInput | Moment | Timestamp input with date picker and presets |
| VoteInput | AccountVote | Voting preference input (Standard/Split) |
| VoteThresholdInput | VoteThreshold | Threshold selector (SuperMajorityApprove/Against/SimpleMajority) |
| KeyValueInput | KeyValue | Single key-value pair input |
For the full priority ordering and pattern matching details, see the Input Map API reference.
Shared Props
Every input component implements the ParamInputProps interface:
interface ParamInputProps {
name: string;
label?: string;
description?: string;
typeName?: string;
isDisabled?: boolean;
isRequired?: boolean;
error?: string;
client: DedotClient<PolkadotApi>;
typeId?: number;
value?: any;
onChange?: (value: unknown) => void;
palletContext?: PalletContextData | null;
isContextLoading?: boolean;
}See individual component pages for type-specific props and behavior details.
Contextual Selectors
When the extrinsic builder detects specific pallet and method combinations, it replaces generic inputs with contextual selectors that display live chain data. These are resolved via findComponentWithContext before falling back to the standard registry.
| Selector | Pallets | Description |
|---|---|---|
| ValidatorSelector | Staking, NominationPools | Searchable combobox for validators (single-select and multi-select modes) |
| PoolSelector | NominationPools | Searchable dropdown for nomination pool selection |
| ReferendumSelector | ConvictionVoting, Referenda | Dropdown for selecting active referenda |
| BountySelector | Bounties | Selector for on-chain bounty IDs |
| TrackSelector | ConvictionVoting | Dropdown for OpenGov track selection |
| EraSelector | Staking | Era index input with current era context |
| ContextHint | Various | Informational display for contextual data |
| SelectorFallback | Various | Loading/error state wrapper for selectors |