import { getAddress } from 'viem';
import jsonStableStringify from 'fast-json-stable-stringify';
import crypto from 'crypto';
export const createTransactionTaskId = (request) => {
    // Create a normalized object where undefined values are explicitly null
    const normalized = {
        chainId: request.chainId,
        to: getAddress(request.to),
        data: request.data ?? null,
        value: request.value ?? null,
    };
    const deterministicJson = jsonStableStringify(normalized);
    return crypto.createHash('sha256').update(deterministicJson).digest('hex');
};
