[native] add findUserIDForWalletAddress to CommRustModule
Summary:
CommRustModule bindings and rust client method implementation
Depends on D11084
Test Plan:
called the JSI function from JS and successfully retrieved the user ID associated with a wallet address in my local DDB
diff --git a/native/account/siwe-panel.react.js b/native/account/siwe-panel.react.js index 02dd3fbed..2b49412d4 100644 --- a/native/account/siwe-panel.react.js +++ b/native/account/siwe-panel.react.js @@ -28,6 +28,7 @@ import { UnknownErrorAlertDetails } from '../utils/alert-messages.js'; import Alert from '../utils/alert.js'; import { getContentSigningKey } from '../utils/crypto-utils.js'; import { defaultLandingURLPrefix } from '../utils/url-utils.js'; +import { commRustModule } from '../native-modules.js'; const commSIWE = `${defaultLandingURLPrefix}/siwe`; @@ -110,6 +111,12 @@ function SIWEPanel(props: Props): React.Node { ); } + const identityUserID = await commRustModule.findUserIDForWalletAddress( + '0xF8b57E5eD505bC6fAfFC765c1AC8569063664c28', + ); + console.log(identityUserID); + const parsedIdentityResponse = JSON.parse(identityUserID); + console.log(parsedIdentityResponse.userID); const ed25519 = await getContentSigningKey(); setPrimaryIdentityPublicKey(ed25519); })();
LOG {"userID":"C81FF954-6216-4489-B23C-0EA145EA2003","isReserved":false} LOG C81FF954-6216-4489-B23C-0EA145EA2003
Reviewers: bartek, kamil
Reviewed By: bartek, kamil
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D11098