The table below is a mapping between scale-codec types (Rust) and TypeScript types that we're using for Dedot:
| Scale Codec (Rust) | TypeScript (dedot) |
|---|---|
|
number |
|
bigint (native BigInt, not bn.js) |
bool |
boolean (true, false) |
Option<T> |
T | undefined |
Result<Ok, Err> |
|
Vec<T> |
Array<T> |
str |
string |
Tuple: (A, B), () |
[A, B], [] |
Struct:
|
|
Enum:
|
|
FlatEnum:
|
'Variant1' | 'Variant2' |