
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@substrate/generate-type-bundle
Advanced tools
This package allows you generate a valid [OverrideTypesBundle](https://github.com/polkadot-js/api/blob/master/packages/types/src/types/registry.ts#L73-L76) JSON file to inject into a polkadot-js `ApiPromise` under the `typesBundle` option key. This is a h
This package allows you generate a valid OverrideTypesBundle JSON file to inject into a polkadot-js ApiPromise under the typesBundle option key. This is a helper library that works specifically with polkadot-js. It is important to note that this library extracts chain types that are available via apps-config, if the chain types dont exist there it wont be able to support to bundle you need. Example packages that use this implicitly leverage this library are Substrate-api-sidecar, and Txwrapper-core.
NPM
npm install -g @substrate/generate-type-bundle
Yarn
yarn global add @substrate/generate-type-bundle
Options:
--help Show help [boolean]
--version Show version number [boolean]
-p, --path Path to directory to generate Type files into. [string]
-s, --specName A chain to generate types for. If this is not inputted
it will create a types bundle for all chains. [string]
-a, --availableChains List all available chains to generate types for.
Note: -p or --path is required.
-p or --path:
generate-type-bundle -p ~/Desktop/example/types
Note: This flag is required. The CLI will not generate any types bundles without specifying a directory.
-s or --specName:
generate-type-bundle -p ~/Desktop/example/types -s moonbeam
-a or --availableChains:
generate-type-bundle -a
import { ApiPromise } from '@polkadot/api';
const main = async () => {
const api = await ApiPromise.create({
provider: new WsProvider('ws://127.0.0.1:9944'),
typesBundle: require('path-to-file.json')
});
};
It is recommended to declare these env variables within a local .env file, but the below is an example usage from the terminal directly.
$ export SAS_SUBSTRATE_TYPES_BUNDLE=<path_to_file>
$ substrate-api-sidecar
FAQs
This package allows you generate a valid [OverrideTypesBundle](https://github.com/polkadot-js/api/blob/master/packages/types/src/types/registry.ts#L73-L76) JSON file to inject into a polkadot-js `ApiPromise` under the `typesBundle` option key. This is a h
The npm package @substrate/generate-type-bundle receives a total of 1 weekly downloads. As such, @substrate/generate-type-bundle popularity was classified as not popular.
We found that @substrate/generate-type-bundle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 20 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.