import { Claim, ClaimKey, OrdJson, PreparedOperation, ResolvedOperation, User } from '@coinweb/contract-kit';

export type HexBigInt = `0x${string}`;

export type TypedClaim<TBody extends OrdJson = OrdJson, TKey extends ClaimKey = ClaimKey> = Claim & {
  body: TBody;
  fees_stored: HexBigInt;
  key: TKey;
};

export type ResolvedSlotOp = {
  SlotOp: 0;
};

export type ResolvedExecOp = {
  ExecOp: {
    id: string;
  };
};

export type ResolvedChildOp = {
  ChildOp: 0;
};

export type ResolvedOp = ResolvedOperation | ResolvedSlotOp | ResolvedExecOp | ResolvedChildOp;

export type PreparedExecOp = {
  ExecOp: {
    id: string;
  };
};

export type PreparedOp = PreparedOperation | PreparedExecOp;

export type Task = {
  op: PreparedOp;
  batchId: number;
};

export type ExecutorMethodArgs = [
  initialArgs?: unknown[],
  resolvedOps?: ResolvedOp[],
  caller?: User,
  isChild?: boolean,
];
