Introduce instances, apply to balance derives (multi-result) (#3094)
* Introducce instances, apply to balance derives (multi-result) * Nonce extraction * Optimize
This commit is contained in:
@@ -268,8 +268,12 @@ export class TypeRegistry implements Registry {
|
||||
: undefined;
|
||||
}
|
||||
|
||||
public getDefinition (name: string): string | undefined {
|
||||
return this.#definitions.get(name);
|
||||
public getDefinition (typeName: string): string | undefined {
|
||||
return this.#definitions.get(typeName);
|
||||
}
|
||||
|
||||
public getModuleInstances (specName: string, moduleName: string): string[] | undefined {
|
||||
return this.#knownTypes?.typesBundle?.spec?.[specName]?.instances?.[moduleName];
|
||||
}
|
||||
|
||||
public getOrThrow <T extends Codec = Codec> (name: string, msg?: string): Constructor<T> {
|
||||
|
||||
@@ -47,6 +47,7 @@ export type DeriveCustom = Record<string, Record<string, (instanceId: string, ap
|
||||
export interface OverrideBundleDefinition {
|
||||
alias?: Record<string, OverrideModuleType>;
|
||||
derives?: DeriveCustom;
|
||||
instances?: Record<string, string[]>;
|
||||
rpc?: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>;
|
||||
types?: OverrideVersionedType[];
|
||||
}
|
||||
@@ -98,7 +99,8 @@ export interface Registry {
|
||||
get <T extends Codec = Codec> (name: string, withUnknown?: boolean): Constructor<T> | undefined;
|
||||
getChainProperties (): ChainProperties | undefined;
|
||||
getClassName (clazz: Constructor): string | undefined;
|
||||
getDefinition (name: string): string | undefined;
|
||||
getDefinition (typeName: string): string | undefined;
|
||||
getModuleInstances (specName: string, moduleName: string): string[] | undefined;
|
||||
getOrThrow <T extends Codec = Codec> (name: string, msg?: string): Constructor<T>;
|
||||
getOrUnknown <T extends Codec = Codec> (name: string): Constructor<T>;
|
||||
setKnownTypes (types: RegisteredTypes): void;
|
||||
|
||||
Reference in New Issue
Block a user