Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
feat: add type to post cast
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-grover committed Oct 4, 2023
1 parent 2d6a685 commit 8bc3f84
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/server/NeynarClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ export type FeedResponse = {
}
}

// TODO: type non-success responses
export type PostCastResponse = {
success: true
cast: {
hash: Hash
author: { fid: number }
text: string
}
}

// Abbreviated type definition, just covering the cases we're using
type JsonValue = string | number | null
type Json = Record<string, JsonValue | JsonValue[] | Json[]>
Expand Down Expand Up @@ -128,7 +138,7 @@ export default class NeynarClient {
}
if (extra?.embeds) params.embeds = extra.embeds
if (extra?.parent) params.parent = extra.parent
return this.post('cast', params)
return this.post<PostCastResponse>('cast', params)
}

deleteCast(signerUuid: string, hash: Hash) {
Expand Down

0 comments on commit 8bc3f84

Please sign in to comment.