Open rphmeier opened 2 years ago
We generally avoid hand-typing the on-chain world. However, devs can convert from raw JS equivalents.
Here is an excerpt of the type conversion doc:
Rust | TypeScript |
```rs
type T0 = ();
type T1 = (A,);
type T2 = (A, B);
type T3 = Vec |
```ts
type T0 = null;
type T1 = A;
type T2 = [A, B];
type T3 = Uint8Array;
type T4 = Uint8Array & { length: n };
type T5 = A[];
type T6 = A[] & { length: n };
type T7 = A | undefined;
type T8 = O | ChainError |
Regarding XCM types, here are corresponding TS types (generated by WIP #229).
As long as V3 is correctly represented in FRAME metadata, the codec derivation and codegen should produce the correct output.
Tagging @tjjfvi––our type conversion expert––incase he'd like to add anything.
@rphmeier, does this answer your question?
Are XCMv2 (and soon, v3) types included in the repo?