import { decodeAbiParameters, encodeAbiParameters } from "viem";
const ABI = [
    { name: "recipients", type: "address[]" },
    { name: "tokens", type: "address[]" },
    { name: "maxAmountPerTx", type: "uint256" },
];
export const transferTargetTemplate = {
    name: "SharedTransferTargetPermission",
    address: "0x0000000000000000000000000000000000000000",
    encoder: {
        encode(params) {
            return encodeAbiParameters(ABI, [
                params.allowedRecipients,
                params.allowedTokens,
                params.maxAmountPerTx,
            ]);
        },
        decode(data) {
            const decoded = decodeAbiParameters(ABI, data);
            return {
                allowedRecipients: [...decoded[0]],
                allowedTokens: [...decoded[1]],
                maxAmountPerTx: decoded[2],
            };
        },
    },
    explainer: {
        explain(params) {
            const warnings = [];
            if (params.allowedRecipients.length === 0) {
                warnings.push("No recipients specified — all transfers will be blocked");
            }
            if (params.allowedTokens.length === 0) {
                warnings.push("No tokens specified — all transfers will be blocked");
            }
            return {
                templateName: "SharedTransferTargetPermission",
                humanReadable: [
                    `ERC-20 transfers restricted to ${params.allowedRecipients.length} approved recipient(s)`,
                    `Gated tokens: ${params.allowedTokens.join(", ")}`,
                    `Maximum amount per transfer: ${params.maxAmountPerTx.toString()} (base units)`,
                    `Approved recipients: ${params.allowedRecipients.join(", ")}`,
                ],
                warnings,
            };
        },
    },
};
//# sourceMappingURL=transferTarget.js.map