Skip to content

Commit 6f2d067

Browse files
committed
continue types
1 parent bf75d6c commit 6f2d067

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

docs/pages/types.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ Another alias of `string`, but indicates that the value is a valid hexadecimal s
2929

3030
## Enum
3131

32+
Enums in the chain are represented as `{ type: string, value: T }`. As many of the types have nested enums that would make it hard to work with (both creating these types and also reading them), Polkadot-API helps through a set of utilites.
33+
34+
First of all, the Enums that are widely used across multiple chains are in a directory of well-known types, and they are represented with a descriptive name. A few examples: `MultiAddress`, `BalanceStatus`, `IdentityJudgement`, and many of the XCM pallet types: `XcmV3Junction`, `XcmV3MultiassetFungibility`, etc.
35+
36+
For these types, you can import them directly from the generated code and use them by calling their type:
37+
38+
<video src="enums.mp4" controls />
3239

3340
## Binary
3441

@@ -51,7 +58,7 @@ Same as `Binary`, but when the chain metadata specifies a length. The length is
5158

5259
## FixedSizeArray&lt;L, T&gt;
5360

54-
When the metadata has a type that's an array of a specific length, that's also shown as a `FixedSizeArray&lt;L, T&gt;`, which is a superset of `Array&lt;T&gt;>`, except that it checks that the length must be `L`.
61+
When the metadata has a type that's an array of a specific length, that's also shown as a `FixedSizeArray<L, T>`, which is a superset of `Array<T>`, except that it checks that the length must be `L`.
5562

5663
## Interface types
5764

docs/public/enums.mp4

11.2 MB
Binary file not shown.

0 commit comments

Comments
 (0)