import { Claim, constructClaim } from '@coinweb/contract-kit';

import { toHex32 } from '../../../../shared';
import { creteHistoryAccessKey, HistoryAccess } from '../../shared';

export const createHistoryAccessClaim = ({
  id,
  historyId,
  timestamp,
}: {
  id: string;
  historyId: string;
  timestamp?: number;
}): Claim => {
  return constructClaim(creteHistoryAccessKey(id), { historyId, timestamp } satisfies HistoryAccess, toHex32(0));
};
