Where do I get a type bundle for my chain?
Most chains publish their type bundles as an npm package (for example: Edgeware). One of the best places to check for the latest version is the polkadot-js/app and polkadot-js/api repositories. It's worth noting, however, that a types bundle is only needed for pre-Metadata v14 blocks, so for recently deployed chains it may be not needed.
Note: the type bundle format for typegen is slightly different from OverrideBundleDefinition of polkadot.js. The structure is as follows, all the fields are optional.
1
{
2
types: {}, // top-level type definitions, as `.types` option of `ApiPromise`
3
typesAlias: {}, // top-level type alieases, as `.typesAlias` option of `ApiPromise`
4
versions: [ // spec version specific overrides, same as `OverrideBundleDefinition.types` of `polkadot.js`
5
{
6
minmax: [0, 1010] // spec range
7
types: {}, // type overrides for the spec range
8
typesAlias: {}, // type alias overrides for the spec range
9
}
10
]
11
}
Copied!
Copy link