mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-08-07 16:35:45 +00:00
971df8edba
- Remove all 3rd party parachain configurations from endpoints: - productionRelayPolkadot.ts: Keep only system parachains - productionRelayDicle.ts: Keep only system parachains - testingRelayZagros.ts: Keep only system parachains - testingRelayTeyrChain.ts: Keep only system parachains - Update domain references: - polkadot.js.org → pezkuwichain.app - wiki.polkadot.network → wiki.pezkuwichain.io - dotapps.io → pezkuwichain.app - statement.polkadot.network → docs.pezkuwichain.io/statement - support.polkadot.network → docs.pezkuwichain.io - Update repository references: - github.com/pezkuwi-js/apps → github.com/pezkuwichain/pwap - Rename system parachains to Pezkuwi ecosystem: - PolkadotAssetHub → PezkuwiAssetHub - polkadotBridgeHub → pezkuwiBridgeHub - polkadotCollectives → pezkuwiCollectives - polkadotCoretime → pezkuwiCoretime - polkadotPeople → pezkuwiPeople - Update network name in claims utility: - Polkadot → Pezkuwi
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
// Copyright 2017-2026 @pezkuwi/apps-routing authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { ApiPromise } from '@pezkuwi/api';
|
|
import type { Route, TFunction } from './types.js';
|
|
|
|
import Component, { useCounter } from '@pezkuwi/app-democracy';
|
|
|
|
function needsApiCheck (api: ApiPromise): boolean {
|
|
try {
|
|
// we need to be able to create an actual vote
|
|
// @ts-expect-error Standard variant is runtime converted
|
|
api.tx.democracy.vote(1, { Standard: { balance: 1, vote: { aye: true, conviction: 1 } } });
|
|
|
|
return true;
|
|
} catch {
|
|
console.warn('Unable to create referendum vote transaction, disabling democracy route');
|
|
|
|
return false;
|
|
}
|
|
}
|
|
|
|
export default function create (t: TFunction): Route {
|
|
return {
|
|
Component,
|
|
display: {
|
|
needsApi: [
|
|
'tx.democracy.propose'
|
|
],
|
|
needsApiCheck
|
|
},
|
|
group: 'governance',
|
|
icon: 'calendar-check',
|
|
name: 'democracy',
|
|
text: t('nav.democracy', 'Democracy', { ns: 'apps-routing' }),
|
|
useCounter
|
|
};
|
|
}
|