Base protocols for all SCALE codable structures. Accept runtime and lazy type definition. Should never be implemented directly. Will be automatically implemented by one of the child protocols. Should be used only at core-level to support all types of structures (dynamic+static).
For structures that can be decoded without type definitions (static). Only runtime is passed to them. Should be implemented by all static structures (StaticCall
, StaticEvent
, StaticStorageKey
, etc.)
For fully static structures that even don't need runtime for coding. Lazy protocols should be added to this structures too, without any implementations (will be provided automatically).
Base protocol for dynamic types. This types can be encoded/decoded only by providing type definition. Implemented by Value
and all dynamic types - AnyCall
, AnyEvent
, AnyStorageKey
, AnyRuntimeCall
, AnySignature
etc.
Stronger protocol for types that can be coded without runtime only by providing type definition. Automatically implement Dynamic protocols. Implemented by Value
and some core types.
Base protocol for all JSON codable structures. Should never be implemented directly. Used only in the core. One of the children protocols should be implemented instead. Doesn't have own coding context implementation, only protocol.
For structures that can be encoded/decoded with runtime only. Implemented by all static structures.
Built-in Swift protocols for JSON coding. Implemented by fully static structures that don't need runtime for coding. Lazy protocols should be added to them without any implementation.
Protocol for structures that need Runtime and Type Definition for coding. All dynamic types in the SDK.
Stronger protocol for types that can be coded without runtime only by providing type definition. Automatically implement Dynamic protocols. Implemented by Value
and some core types.
Most top-level protocol for type validation. Provides dynamic runtime-based validation. Implemented directly by Compact, Data, Arrays. Allows dynamic type check (like integer overflow even if type sizes is different).
Protocol that implemented as static method. Allows validation at the runtime initialization. Main protocol for implementation by custom types. Provides default implementation for ValidatableTypeDynamic
.
Helper protocol which splits type info parsing and validation steps.
Helper protocols to simplify validation of composite types. Automatically parses Type Definition and extracts fields. Static protocol can match them with provided field types.
Helper protocols to simplify validation of variant types. Automatically parses Type Definition and extracts variants with fields. Static protocol can match them with provided variant types.
Depends on ValidatableTypeDynamic
protocol. Allows usage of type with dynamic AnyCall
, AnyRuntimeCall
and AnyStorageKey
objects. Provides a way to convert some value to the proper Value
object with attached Type Definition, which then can be encoded to SCALE/JSON. Do a runtime validation before conversion, and throws errors if value can't be converted. Implemented by all basic types in SDK.
Main protocol for identifiable types. It allows to provide definition for the type. Automatically implements ValidatableTypeStatic
protocol. Fully static types should be defined as IdentifiableType
.
Helper protocols for identifiable types which allow to pass parameters to the static method. Usable for Data/Compact/Arrays to provide configuration like dynamic/fixed.
Protocols for types attached to Pallets/Runtime API which could be obtained from metadata directly: Call
, Event
, StorageKey
, PalletError
, Constant
, RuntimeCall
,
Frame equivalent to the ValidatableTypeDynamic
. Validates frame type with provided runtime. Implemented by dynamic frame types.
Basic protocol for all static frame types. Provides interface for type identification and validation.
Helper protocols for frame types for simpler validation implementation.
Frame type equivalent for IdentifiableTypeStatic
. Provides own version of Type Definition. Provides default implementation for validation. Default target for implementation for static frame types.