mirror of
https://github.com/pezkuwichain/pezkuwi-sdk-ui.git
synced 2026-04-21 23:47:59 +00:00
d949863789
Comprehensive web interface for interacting with Pezkuwi blockchain. Features: - Blockchain explorer - Wallet management - Staking interface - Governance participation - Developer tools Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
36 lines
1011 B
TypeScript
36 lines
1011 B
TypeScript
// Copyright 2017-2026 @pezkuwi/apps-config authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { ApiPromise } from '@pezkuwi/api';
|
|
import type { TrackInfo } from './types.js';
|
|
|
|
import { KUSAMA_GENESIS, POLKADOT_GENESIS } from '../../constants.js';
|
|
import { kusama } from './kusama.js';
|
|
import { polkadot } from './polkadot.js';
|
|
|
|
const KNOWN_GENE_TRACKS: Record<string, Record<string, TrackInfo[]>> = {
|
|
[KUSAMA_GENESIS]: kusama,
|
|
[POLKADOT_GENESIS]: polkadot
|
|
};
|
|
|
|
const KNOWN_SPEC_TRACKS: Record<string, Record<string, TrackInfo[]>> = {
|
|
kusama,
|
|
// for kitchensink, we just use the root
|
|
node: {
|
|
referenda: [
|
|
{
|
|
id: 0,
|
|
name: 'root',
|
|
origin: { system: 'Root' }
|
|
}
|
|
]
|
|
},
|
|
polkadot
|
|
};
|
|
|
|
export function getGovernanceTracks (api: ApiPromise, specName: string, palletReferenda: string): TrackInfo[] | undefined {
|
|
const lookup = KNOWN_GENE_TRACKS[api.genesisHash.toHex()] || KNOWN_SPEC_TRACKS[specName];
|
|
|
|
return lookup?.[palletReferenda];
|
|
}
|