Skip to content

Align getActiveJobs return type with AcpJobApi interface #19

@antfleet-ops

Description

@antfleet-ops

Summary

AcpApiClient.getActiveJobs() returns OffChainJob[], but the AcpJobApi interface declares getActiveJobs() as returning objects shaped like { chainId: number; onChainJobId: string }[].

Evidence

  • src/events/acpApiClient.ts implements:
async getActiveJobs(): Promise<OffChainJob[]> {
  ...
  const data = (await res.json()) as { jobs: OffChainJob[] };
  return data.jobs || [];
}
  • src/events/types.ts declares:
getActiveJobs(): Promise<{ chainId: number; onChainJobId: string }[]>;

Why this matters

Consumers typed against AcpJobApi may rely on chainId / onChainJobId, while the concrete implementation returns full backend job records instead. That can cause runtime breakage or force consumers to cast around the SDK types.

Suggested fix

Either update the interface to declare Promise<OffChainJob[]>, or adapt AcpApiClient.getActiveJobs() to map backend jobs into the interface shape.

Suggested regression test

Add a type-level or unit test that asserts AcpApiClient satisfies AcpJobApi with the intended getActiveJobs() result shape.


Found by AntFleet's Virtuals-backed public repo scan using an Opus-first, blind GPT confirmation workflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions