const { EVM_CANDIDATE_CONFIG } = require('./evmCandidateConfig');
const { TOKENOMICS_CONFIG } = require('./tokenomicsConfig');

const CANONICAL_ASSET_POLICY = Object.freeze({
  role: 'canonical-native-asset',
  ledgerRole: 'canonical-candidate-ledger',
  name: EVM_CANDIDATE_CONFIG.currencyName,
  symbol: EVM_CANDIDATE_CONFIG.currencySymbol,
  decimals: EVM_CANDIDATE_CONFIG.currencyDecimals,
  genesisSupply: EVM_CANDIDATE_CONFIG.genesisSupply,
  circulatingSupply: '0',
  issuance: 'genesis-preallocated-candidate-locked',
  publicIssuance: false,
  externalTransfersEnabled: EVM_CANDIDATE_CONFIG.externalTransfersEnabled,
  addressFormat: '0x-evm'
});

const LEGACY_ASSET_POLICY = Object.freeze({
  role: 'legacy-application-point',
  ledgerRole: 'legacy-read-only-archive',
  name: TOKENOMICS_CONFIG.rewardUnitName,
  displaySymbol: 'plais Point',
  storedSymbol: TOKENOMICS_CONFIG.symbol,
  decimals: TOKENOMICS_CONFIG.decimals,
  policyCap: TOKENOMICS_CONFIG.maxSupply,
  phase: TOKENOMICS_CONFIG.phase,
  rewardMode: TOKENOMICS_CONFIG.rewardMode,
  issuance: process.env.AISFOR_COIN_ISSUANCE || 'legacy-simulation-locked',
  publicIssuance: TOKENOMICS_CONFIG.publicIssuance,
  resettable: TOKENOMICS_CONFIG.testnetResettable,
  convertibleToCanonical: false
});

module.exports = {
  CANONICAL_ASSET_POLICY,
  LEGACY_ASSET_POLICY
};
