/**
 * Contract ABIs extracted from forge build artifacts
 *
 * These ABIs are the single source of truth, generated from onchain/out/
 * To update: run `forge build` in onchain/ directory
 */

import KraikenForgeOutput from '../../onchain/out/Kraiken.sol/Kraiken.json' assert { type: 'json' };
import StakeForgeOutput from '../../onchain/out/Stake.sol/Stake.json' assert { type: 'json' };

/**
 * Kraiken ERC20 token contract ABI
 */
export const KRAIKEN_ABI = KraikenForgeOutput.abi;

/**
 * Stake (Harberger tax staking) contract ABI
 */
export const STAKE_ABI = StakeForgeOutput.abi;

/**
 * LiquidityManager events-only ABI
 * Tracks recenters, ETH reserve, and VWAP data
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
export const LiquidityManagerAbi = [
  {"type":"event","name":"EthAbundance","inputs":[{"name":"currentTick","type":"int24","indexed":false},{"name":"ethBalance","type":"uint256","indexed":false},{"name":"outstandingSupply","type":"uint256","indexed":false},{"name":"vwap","type":"uint256","indexed":false},{"name":"vwapTick","type":"int24","indexed":false}],"anonymous":false},
  {"type":"event","name":"EthScarcity","inputs":[{"name":"currentTick","type":"int24","indexed":false},{"name":"ethBalance","type":"uint256","indexed":false},{"name":"outstandingSupply","type":"uint256","indexed":false},{"name":"vwap","type":"uint256","indexed":false},{"name":"vwapTick","type":"int24","indexed":false}],"anonymous":false},
  {"type":"event","name":"Recentered","inputs":[{"name":"currentTick","type":"int24","indexed":true},{"name":"isUp","type":"bool","indexed":true}],"anonymous":false}
] as const;

export const LM_ABI = LiquidityManagerAbi;

// Re-export for convenience
export const ABIS = {
  Kraiken: KRAIKEN_ABI,
  Stake: STAKE_ABI,
  LiquidityManager: LM_ABI,
} as const;

// Backward-compatible aliases
// eslint-disable-next-line @typescript-eslint/naming-convention
export const KraikenAbi = KRAIKEN_ABI;
// eslint-disable-next-line @typescript-eslint/naming-convention
export const StakeAbi = STAKE_ABI;
