import { cwait, readOp, TypedClaim } from 'cwait';

import { createWordKey, WordClaimBody } from '../offchain';

export const extraLogic2 = cwait(async (id: string, i: number) => {
  console.log('extraLogic2 START + ', i);

  console.log('await extraLogic2 readOp + ', i);
  const result = await readOp<TypedClaim<WordClaimBody>>(createWordKey(id));

  console.log('extraLogic2 END + ', i);
  return result;
});
