From 8bc3f84933f9d54b4e2739b3c2c38c3592c749fe Mon Sep 17 00:00:00 2001 From: Alex Grover Date: Tue, 3 Oct 2023 20:26:19 -0700 Subject: [PATCH] feat: add type to post cast --- src/server/NeynarClient.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/server/NeynarClient.ts b/src/server/NeynarClient.ts index a0106f1..c1e0bc7 100644 --- a/src/server/NeynarClient.ts +++ b/src/server/NeynarClient.ts @@ -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 @@ -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('cast', params) } deleteCast(signerUuid: string, hash: Hash) {