diff --git a/packages/apps-routing/src/fellowship.ts b/packages/apps-routing/src/fellowship.ts index 66c720ee69..3726949341 100644 --- a/packages/apps-routing/src/fellowship.ts +++ b/packages/apps-routing/src/fellowship.ts @@ -13,7 +13,8 @@ export default function create (t: TFunction): Route { needsAccounts: true, needsApi: [ 'tx.fellowshipCollective.vote', - 'tx.fellowshipReferenda.submit' + 'tx.fellowshipReferenda.submit', + 'consts.fellowshipReferenda.tracks' ] }, group: 'governance', diff --git a/packages/apps-routing/src/referenda.ts b/packages/apps-routing/src/referenda.ts index 360ef0b632..b491adb0b0 100644 --- a/packages/apps-routing/src/referenda.ts +++ b/packages/apps-routing/src/referenda.ts @@ -12,7 +12,8 @@ export default function create (t: TFunction): Route { display: { needsApi: [ 'tx.referenda.submit', - 'tx.convictionVoting.vote' + 'tx.convictionVoting.vote', + 'consts.referenda.tracks' ] }, group: 'governance', diff --git a/packages/apps/src/endpoint.ts b/packages/apps/src/endpoint.ts index 0f14a2ef13..c9416d2b68 100644 --- a/packages/apps/src/endpoint.ts +++ b/packages/apps/src/endpoint.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { ApiPromise } from '@polkadot/api'; -import { isFunction } from '@polkadot/util'; +import { isFunction, isObject } from '@polkadot/util'; type ApiMapper = Record>>; @@ -11,7 +11,9 @@ function hasEndpoint (api: ApiPromise, endpoint: string, needsApiInstances: bool const [section] = (needsApiInstances && api.registry.getModuleInstances(api.runtimeVersion.specName.toString(), _section)) || [_section]; try { - return isFunction((api as unknown as ApiMapper)[area][section][method]); + return area === 'consts' + ? isObject((api as unknown as ApiMapper)[area][section][method]) + : isFunction((api as unknown as ApiMapper)[area][section][method]); } catch (error) { return false; }