/**
 * Contract ABIs for relay service
 */

export const MessageSentABI = [
  "event MessageSent(bytes32 indexed messageId, uint64 indexed destinationChainSelector, address indexed sender, bytes receiver, bytes data, tuple(address token, uint256 amount, uint8 amountType)[] tokenAmounts, address feeToken, bytes extraArgs)"
];

export const RelayRouterABI = [
  "function relayMessage(address bridge, tuple(bytes32 messageId, uint64 sourceChainSelector, bytes sender, bytes data, tuple(address token, uint256 amount, uint8 amountType)[] tokenAmounts) calldata message) external",
  "event MessageRelayed(bytes32 indexed messageId, uint64 indexed sourceChainSelector, address indexed bridge, address recipient, uint256 amount)",
  "function authorizedBridges(address) view returns (bool)",
  "function hasRole(bytes32, address) view returns (bool)"
];

export const RelayBridgeABI = [
  // CWMultiTokenBridgeL2 / Chainlink receivers: destTokenAmounts (address,uint256)[]
  "function ccipReceive(tuple(bytes32 messageId, uint64 sourceChainSelector, bytes sender, bytes data, tuple(address token, uint256 amount)[] destTokenAmounts) calldata message) external",
  // Legacy CCIPRelayBridge (WETH): tokenAmounts with amountType
  "function ccipReceive(tuple(bytes32 messageId, uint64 sourceChainSelector, bytes sender, bytes data, tuple(address token, uint256 amount, uint8 amountType)[] tokenAmounts) calldata message) external",
  "event CrossChainTransferCompleted(bytes32 indexed messageId, uint64 indexed sourceChainSelector, address indexed recipient, uint256 amount)",
  "function processed(bytes32) view returns (bool)",
  "function processedTransfers(bytes32) view returns (bool)",
  "function canonicalToMirrored(address canonicalToken) view returns (address)"
];

export const ERC20ABI = [
  "function balanceOf(address account) view returns (uint256)"
];
