Skip to content

[T2.4] Build lib/airdrop/activation-verify.ts (verifyFc) #1239

Description

@realproject7

Epic: #1229 · Spec: §3.3, §6.3 · Type: CODE · Estimate: 0.3 day

Scope

Create lib/airdrop/activation-verify.ts exporting:

```ts
export async function verifyFc(
username: string,
plotlinkFid: number
): Promise<
| { ok: true; fid: number }
| { ok: false; error: 'user_not_found' | 'not_following' | 'neynar_error' }

```

Wraps the 2 Neynar calls:

  1. getUserByUsername(username) → fid
  2. checkFollow(fid, plotlinkFid) → boolean

Partial-failure semantics (per §6.3):

  • (1) 4xx/not-found → { ok: false, error: 'user_not_found' }
  • (1) succeeds, (2) returns false → { ok: false, error: 'not_following' }
  • (1) succeeds, (2) returns true → { ok: true, fid }
  • Any 5xx / network → { ok: false, error: 'neynar_error' }

Use existing Neynar SDK / API key already used by DropCast.

Acceptance

  • User-not-found case returns correct error
  • Not-following case returns correct error (no partial DB write)
  • Following case returns { ok: true, fid }
  • Neynar 5xx surfaced as neynar_error
  • No DB writes happen in this lib (caller endpoint handles persistence)

Dependencies

None (Neynar key already configured)

Metadata

Metadata

Assignees

No one assigned

    Labels

    airdropPLOT 10x Airdrop Campaign

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions