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,7 @@ farcasterIDs: $ReadOnlyArray, ) => Promise<$ReadOnlyArray>; +linkFarcasterAccount: (farcasterID: string) => Promise; + +unlinkFarcasterAccount: () => 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 @@ -553,6 +553,14 @@ farcasterID, ); }, + unlinkFarcasterAccount: async () => { + const { + deviceID, + userID, + accessToken: token, + } = await getAuthMetadata(); + return commRustModule.unlinkFarcasterAccount(userID, deviceID, token); + }, }), [getAuthMetadata], ); diff --git a/web/grpc/identity-service-client-proxy.js b/web/grpc/identity-service-client-proxy.js --- a/web/grpc/identity-service-client-proxy.js +++ b/web/grpc/identity-service-client-proxy.js @@ -131,6 +131,10 @@ linkFarcasterAccount: (farcasterID: string) => Promise = this.proxyToWorker('linkFarcasterAccount'); + + unlinkFarcasterAccount: () => Promise = this.proxyToWorker( + 'unlinkFarcasterAccount', + ); } export { IdentityServiceClientSharedProxy }; diff --git a/web/grpc/identity-service-client-wrapper.js b/web/grpc/identity-service-client-wrapper.js --- a/web/grpc/identity-service-client-wrapper.js +++ b/web/grpc/identity-service-client-wrapper.js @@ -572,6 +572,14 @@ linkFarcasterAccountRequest.setFarcasterId(farcasterID); await client.linkFarcasterAccount(linkFarcasterAccountRequest); }; + + unlinkFarcasterAccount: () => Promise = async () => { + const client = this.authClient; + if (!client) { + throw new Error('Identity service client is not initialized'); + } + await client.unlinkFarcasterAccount(new Empty()); + }; } function authNewDeviceKeyUpload(