From 6f2d0673f0b5edae0f90ac6571a6c32bd0cdb575 Mon Sep 17 00:00:00 2001 From: Victor Oliva Date: Tue, 9 Apr 2024 15:04:45 +0200 Subject: [PATCH] continue types --- docs/pages/types.mdx | 9 ++++++++- docs/public/enums.mp4 | Bin 0 -> 11795987 bytes 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 docs/public/enums.mp4 diff --git a/docs/pages/types.mdx b/docs/pages/types.mdx index 13375cc9..2967d093 100644 --- a/docs/pages/types.mdx +++ b/docs/pages/types.mdx @@ -29,6 +29,13 @@ Another alias of `string`, but indicates that the value is a valid hexadecimal s ## Enum +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. + +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. + +For these types, you can import them directly from the generated code and use them by calling their type: + +