Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3351538
D13811.id45437.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
808 B
Referenced Files
None
Subscribers
None
D13811.id45437.diff
View Options
diff --git a/keyserver/src/utils/farcaster-utils.js b/keyserver/src/utils/farcaster-utils.js
new file mode 100644
--- /dev/null
+++ b/keyserver/src/utils/farcaster-utils.js
@@ -0,0 +1,26 @@
+// @flow
+
+import { getRustAPI } from 'rust-node-addon';
+
+import { verifyUserIDs } from '../fetchers/user-fetchers.js';
+
+async function getVerifiedUserIDForFID(fid: string): Promise<?string> {
+ const rustAPI = await getRustAPI();
+ const farcasterUsers = await rustAPI.getFarcasterUsers([fid]);
+
+ if (farcasterUsers.length !== 1) {
+ return null;
+ }
+
+ const userIDForFID = farcasterUsers[0].userID;
+
+ const verifiedUserIDs = await verifyUserIDs([userIDForFID]);
+
+ if (verifiedUserIDs.length !== 1) {
+ return null;
+ }
+
+ return userIDForFID;
+}
+
+export { getVerifiedUserIDForFID };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 2:23 AM (8 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2572933
Default Alt Text
D13811.id45437.diff (808 B)
Attached To
Mode
D13811: [keyserver] add function to grab comm userID for given fid if on keyserver
Attached
Detach File
Event Timeline
Log In to Comment