diff --git a/packages/apps/src/endpoint.ts b/packages/apps/src/endpoint.ts index 8a4e09df4d..8f49009f4c 100644 --- a/packages/apps/src/endpoint.ts +++ b/packages/apps/src/endpoint.ts @@ -10,11 +10,14 @@ type ApiMapper = Record>>; function hasEndpoint (api: ApiPromise, endpoint: string, needsApiInstances: boolean): boolean { const [area, _section, method] = endpoint.split('.'); const [section] = (needsApiInstances && api.registry.getModuleInstances(api.runtimeVersion.specName.toString(), _section)) || [_section]; + const resolvedSection = (api as unknown as ApiMapper)[area][section] + ? section + : _section; try { return area === 'consts' - ? isObject((api as unknown as ApiMapper)[area][section][method]) - : isFunction((api as unknown as ApiMapper)[area][section][method]); + ? isObject((api as unknown as ApiMapper)[area][resolvedSection][method]) + : isFunction((api as unknown as ApiMapper)[area][resolvedSection][method]); } catch { return false; }