Control wasm initialization via initWasm: false flag (#2076)
This commit is contained in:
@@ -217,7 +217,9 @@ export default abstract class Init<ApiType extends ApiTypes> extends Decorate<Ap
|
||||
try {
|
||||
const [hasMeta, cryptoReady] = await Promise.all([
|
||||
this.loadMeta(),
|
||||
cryptoWaitReady()
|
||||
this._options.initWasm === false
|
||||
? Promise.resolve(true)
|
||||
: cryptoWaitReady()
|
||||
]);
|
||||
|
||||
if (hasMeta && !this._isReady && cryptoReady) {
|
||||
|
||||
@@ -33,6 +33,10 @@ export interface ApiOptions extends RegisteredTypes {
|
||||
* @description Add custom derives to be injected
|
||||
*/
|
||||
derives?: DeriveCustom;
|
||||
/**
|
||||
* @description Control the initialization of the wasm libraries. When not specified, it defaults to `true`, initializing the wasm libraries, set to `false` to not initialize wasm. (No sr25519 support)
|
||||
*/
|
||||
initWasm?: boolean;
|
||||
/**
|
||||
* @description pre-bundles is a map of 'genesis hash and runtime spec version' as key to a metadata hex string
|
||||
* if genesis hash and runtime spec version matches, then use metadata, else fetch it from chain
|
||||
|
||||
Reference in New Issue
Block a user