import { getTime } from '../../../../onchain';
import { HISTORY_CODES, HistoryLink } from '../../shared';

import { forceHistoryId } from './forceHistoryId';

export const createLinkToCurrentHistory = ({ code }: { code: HISTORY_CODES }): HistoryLink => {
  const historyId = forceHistoryId();
  const timestamp = getTime();

  return {
    historyId,
    timestamp,
    code,
  };
};
