diff --git a/lib/types/identity-service-types.js b/lib/types/identity-service-types.js --- a/lib/types/identity-service-types.js +++ b/lib/types/identity-service-types.js @@ -161,6 +161,8 @@ +getFarcasterUsers?: ( farcasterIDs: $ReadOnlyArray, ) => Promise<$ReadOnlyArray>; + // linkFarcasterAccount is only implemented on native at the moment + +linkFarcasterAccount?: (farcasterID: string) => Promise; } export type IdentityServiceAuthLayer = { diff --git a/native/identity-service/identity-service-context-provider.react.js b/native/identity-service/identity-service-context-provider.react.js --- a/native/identity-service/identity-service-context-provider.react.js +++ b/native/identity-service/identity-service-context-provider.react.js @@ -540,6 +540,19 @@ const farcasterUsers = JSON.parse(farcasterUsersJSONString); return assertWithValidator(farcasterUsers, farcasterUsersValidator); }, + linkFarcasterAccount: async (farcasterID: string) => { + const { + deviceID, + userID, + accessToken: token, + } = await getAuthMetadata(); + return commRustModule.linkFarcasterAccount( + userID, + deviceID, + token, + farcasterID, + ); + }, }), [getAuthMetadata], );