Event lazy create classes (#3685)

* Event lazy create classes

* head fallback
This commit is contained in:
Jaco
2021-06-22 09:49:45 +02:00
committed by GitHub
parent abb54d2538
commit 060275d1ae
6 changed files with 48 additions and 34 deletions
+1 -1
View File
@@ -286,7 +286,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
}
// get unique types & validate
metadata.getUniqTypes(false);
metadata.getUniqTypes(this._options.throwOnUnknown || false);
return [genesisHash, metadata];
}
+4
View File
@@ -73,6 +73,10 @@ export interface ApiOptions extends RegisteredTypes {
* @description Throws an error when the initial connection fails (same as isReadyOrError)
*/
throwOnConnect?: boolean;
/**
* @description Throws an error when some types are unknown (useful with throwOnConnect)
*/
throwOnUnknown?: boolean;
}
// A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic