diff --git a/lib/types/farcaster-types.js b/lib/types/farcaster-types.js --- a/lib/types/farcaster-types.js +++ b/lib/types/farcaster-types.js @@ -14,7 +14,7 @@ +fid: string, }; -export type FarcasterUser = { +export type NeynarUserWithViewerContext = { +fid: number, +viewerContext: { +following: boolean, @@ -22,7 +22,7 @@ ... }; -export type FarcasterChannel = { +export type NeynarChannel = { +id: string, +name: string, ... diff --git a/lib/utils/neynar-client.js b/lib/utils/neynar-client.js --- a/lib/utils/neynar-client.js +++ b/lib/utils/neynar-client.js @@ -4,13 +4,13 @@ import { getMessageForException } from './errors.js'; import type { - FarcasterChannel, - FarcasterUser, + NeynarChannel, + NeynarUserWithViewerContext, } from '../types/farcaster-types.js'; type FetchFollowersResponse = { +result: { - +users: $ReadOnlyArray, + +users: $ReadOnlyArray, +next: { +cursor: ?string, }, @@ -18,14 +18,14 @@ }; type FetchFollowedFarcasterChannelsResponse = { - +channels: $ReadOnlyArray, + +channels: $ReadOnlyArray, +next: { +cursor: ?string, }, }; type FetchFarcasterChannelByNameResponse = { - +channels: $ReadOnlyArray, + +channels: $ReadOnlyArray, }; const neynarBaseURL = 'https://api.neynar.com/'; @@ -102,9 +102,7 @@ return fids; } - async fetchFollowedFarcasterChannels( - fid: string, - ): Promise { + async fetchFollowedFarcasterChannels(fid: string): Promise { const farcasterChannels = []; let paginationCursor = null; @@ -150,7 +148,7 @@ async fetchFarcasterChannelByName( channelName: string, - ): Promise { + ): Promise { const params: { [string]: string } = { q: channelName, }; diff --git a/native/community-settings/tag-farcaster-channel/tag-farcaster-channel.react.js b/native/community-settings/tag-farcaster-channel/tag-farcaster-channel.react.js --- a/native/community-settings/tag-farcaster-channel/tag-farcaster-channel.react.js +++ b/native/community-settings/tag-farcaster-channel/tag-farcaster-channel.react.js @@ -11,7 +11,7 @@ useCreateOrUpdateFarcasterChannelTag, } from 'lib/actions/community-actions.js'; import { NeynarClientContext } from 'lib/components/neynar-client-provider.react.js'; -import type { FarcasterChannel } from 'lib/types/farcaster-types.js'; +import type { NeynarChannel } from 'lib/types/farcaster-types.js'; import { useCurrentUserFID } from 'lib/utils/farcaster-utils.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; @@ -48,10 +48,10 @@ invariant(fid, 'FID should be set'); const [selectedChannel, setSelectedChannel] = - React.useState(null); + React.useState(null); const [channelOptions, setChannelOptions] = React.useState< - $ReadOnlyArray, + $ReadOnlyArray, >([]); const [error, setError] = React.useState(null);