import { getContext } from '../../../../onchain';

let localTrackingId: string | null = null;
let localTrackingDerivation = 0;

export const getNewHistoryId = () => {
  if (!localTrackingId) {
    localTrackingId = getContext().call.txid.slice(0, 16);
  }

  return `${localTrackingId}${localTrackingDerivation++}`;
};
