Types
Option
¶
Bases: ScaleType
Option is a type that represents an optional value, which can be either Some(value) if a value is present or None if it is absent, allowing for safe handling of null or missing values without causing runtime errors.
U8
¶
U16
¶
U32
¶
U64
¶
U128
¶
U256
¶
I8
¶
I16
¶
I32
¶
I64
¶
I128
¶
I256
¶
H160
¶
H256
¶
H512
¶
Struct
¶
Bases: ScaleType
A struct is a composite data type that groups together zero or more values with various types into a single object
Set
¶
Bases: ScaleType
The Set type in Substrate is an unordered collection that contains unique elements. It is implemented using a binary search tree, allowing for efficient insertion, removal, and lookup operations.
Era
¶
Bases: ScaleType
An Era represents a range of blocks in which a transaction is allowed to be executed.
An Era may either be "immortal", in which case the transaction is always valid, or "mortal", in which case the transaction has a defined start block and period in which it is valid.
is_immortal() -> bool
¶
Returns true if the era is immortal, false if mortal.
birth(current: int) -> int
¶
Gets the block number of the start of the era given, with current
as the reference block number for the era, normally included as part
of the transaction.
death(current: int) -> int
¶
Gets the block number of the first block at which the era has ended.
If the era is immortal, 2**64 - 1 (the maximum unsigned 64-bit integer) is returned.
Bool
¶
GenericAccountIndex
¶
Bases: U32
The AccountIndex type Substrate represents an account index, which is a unique identifier assigned to an account in the Substrate runtime.
Vec
¶
Bases: ScaleType
A Vec in RUST is a dynamically resizable array that can hold a sequence of elements of the same type, allowing for efficient random access and insertion or removal of elements at the end of the vector.
BoundedVec
¶
Bases: Vec
BoundedVec is a fixed-size vector used in Substrate, with a maximum number of elements that can be added. It is used in cases where a fixed-size buffer is required, such as in the case of the transaction input/output limit in the Substrate runtime.
BitVec
¶
Bases: ScaleType
A BitVec that represents an array of bits. The bits are however stored encoded. The difference between this and a normal Bytes would be that the length prefix indicates the number of bits encoded, not the bytes
Enum
¶
Bases: ScaleType
A fixed number of variants, each mutually exclusive and potentially implying a further value or series of values.
Conviction
¶
Bases: Enum
Conviction represents a measure of the degree of confidence or trust that a stakeholder has in a particular proposal in the Substrate runtime. It is used to determine the voting power of a stakeholder for a particular proposal, with higher conviction leading to more voting power.
GenericMultiAddress
¶
Bases: Enum
MultiAddress is a type used in the Substrate runtime to represent an address that can be expressed in multiple ways, such as an account ID, a public key, or a human-readable name, allowing for flexible addressing and storage of data.
GenericMetadataVersioned
¶
Bases: Tuple
Tuple that contains a backwards compatible MetadataAll type
GenericVariant
¶
ScaleInfoStorageEntryMetadata
¶
Bases: GenericStorageEntryMetadata
get_param_info(max_recursion: int = TYPE_DECOMP_MAX_RECURSIVE) -> list
¶
Return a type decomposition how to format parameters for current storage function
Returns:
Type | Description |
---|---|
list
|
GenericRuntimeCallDefinition
¶
GenericExtrinsic
¶
Bases: ScaleType
The Extrinsic type is used to send transactions from an account to the Substrate runtime, and it can contain one or more calls to the runtime functions.
GenericEvent
¶
Bases: Enum
An Event is a type used to represent a runtime event, which is a signal that indicates that a specific state transition has occurred.
It is implemented as a variant enum that contains different types of events, such as system events, runtime events, and custom events, each with its own set of fields that describe the event.