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

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

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

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

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