...
int: in SCALE integers can be encoded as fixed-width integer and compact integer. Compact integer itself has 4 modes. So generally we have 5 ways to serde integer (1 fixed-width + 4 modes of compact integers)
Code Block language bash { "type": "int", "mode": "CompactTwoByte" //possible values FixedWidth, CompactSingleByte, CompactTwoByte, CompactFourByte, CompactBigInteger, }
- bool: no tricks here {
Code Block language bash { "type": "bool"
}
2. Built-in containers
[Option / Result / Vec / typle : basically we are interested in only inner values of the container
Code Block language bash [
{{ "type": "Option",
{"item_type":
{ "type" : "bool"
}} },
{{ "type": "Result",
{"item_type":
{ "type": "int",
"mode": "CompactFourByte"
}} },
{
",{ "type": "Vec
{", "item_type": { "type": "bool" } }, { "type": "tuple", "items": [ { "type": "int", "mode": "CompactFourByte" }, { "type": "Option", "item_type":
{ "type" : "bool"
}
}} } ] } ]
3. Custom containers
- Structures
...