Skip to content

@x402r/evm: type the attestor identity response #39

@A1igator

Description

@A1igator

Problem

`packages/evm/src/extensions/attestation/server.ts` returns the attestor's identity as `{ info: { identity: await res.json() } }` — `identity` is `unknown`. Every arbiter invents its own shape, which means:

Example shape shipped by the garbage-detector arbiter in that PR:

```ts
{ arbiter, url, provider, operator, chains, description, skills, paymentScheme }
```

Proposal

Define a loose base `AttestorIdentity` type in `@x402r/evm` with optional common fields and an open index signature:

```ts
export interface AttestorIdentity {
arbiter?: Address;
url?: string;
paymentScheme?: { cli?: string; [k: string]: unknown };
description?: string;
skills?: string[];
provider?: string;
operator?: Address | null;
chains?: number[];
[key: string]: unknown;
}
```

Have `createAttestationExtension`'s server return `{ info: { identity: AttestorIdentity } }` so both servers and clients get autocomplete for the SDK-blessed convention while remaining open for arbiter-specific extensions.

Why this matters

  • The `url` advertisement pattern added in garbage-detector: advertise arbiter URL + README fixes arbiter-examples#12 becomes a first-class SDK convention rather than a private contract.
  • Downstream tooling (clients, CLI, third-party discovery) can reason about identity without per-arbiter knowledge.
  • Keeps the escape hatch (index signature) so arbiters can ship domain-specific fields.

Context

Discovered while reviewing BackTrackCo/arbiter-examples#12 (tracked as one of the SDK-level follow-ups from that PR).

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