ghost-portal/packages/apps-routing/src/staking-async.ts
2026-01-30 11:03:02 +01:00

30 lines
747 B
TypeScript

// Copyright 2017-2026 @polkadot/apps-routing authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiPromise } from '@polkadot/api';
import type { Route, TFunction } from './types.js';
import Component from '@polkadot/app-staking-async';
function needsApiCheck (api: ApiPromise): boolean {
try {
return !!((api.tx.stakingAhClient) || (api.tx.staking && api.tx.stakingRcClient));
} catch {
return false;
}
}
export default function create (t: TFunction): Route {
return {
Component,
display: {
needsApi: [],
needsApiCheck
},
group: 'network',
icon: 'certificate',
name: 'staking-async',
text: t('nav.staking-async', 'Staking Async', { ns: 'apps-routing' })
};
}