// Copyright 2017-2026 @pezkuwi/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0

import type { BN } from '@pezkuwi/util';
import type { ExternalDef } from './types.js';

import { externalCommonwealthPNG } from '../ui/logos/external/index.js';

const HASH_PATHS = ['proposal/councilmotion'];

export const Commonwealth: ExternalDef = {
  // Note: Commonwealth may not support Pezkuwi networks yet. These are placeholder entries.
  chains: {
    Dicle: 'dicle',
    Pezkuwi: 'pezkuwi',
    Zagros: 'zagros'
  },
  create: (chain: string, path: string, data: BN | number | string, hash?: string): string =>
    `https://commonwealth.im/${chain}/${path}/${HASH_PATHS.includes(path) ? (hash || '') : data.toString()}`,
  homepage: 'https://commonwealth.im/',
  isActive: false,
  paths: {
    council: 'proposal/councilmotion',
    democracyProposal: 'proposal/democracyproposal',
    democracyReferendum: 'proposal/referendum',
    treasury: 'proposal/treasuryproposal'
  },
  ui: {
    logo: externalCommonwealthPNG
  }
};
