Skip to content

Commit

Permalink
feat: [DX-2756] add get passport id to game bridge (#1611)
Browse files Browse the repository at this point in the history
  • Loading branch information
nattb8 authored Mar 21, 2024
1 parent fa15494 commit 0fc0ed3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/game-bridge/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const PASSPORT_FUNCTIONS = {
getIdToken: 'getIdToken',
logout: 'logout',
getEmail: 'getEmail',
getPassportId: 'getPassportId',
imx: {
getAddress: 'getAddress',
isRegisteredOffchain: 'isRegisteredOffchain',
Expand Down Expand Up @@ -411,6 +412,19 @@ window.callFunction = async (jsonData: string) => {
});
break;
}
case PASSPORT_FUNCTIONS.getPassportId: {
const userProfile = await passportClient?.getUserInfo();
track(moduleName, 'performedGetPassportId', {
timeMs: Date.now() - markStart,
});
callbackToGame({
responseFor: fxName,
requestId,
success: true,
result: userProfile?.sub,
});
break;
}
case PASSPORT_FUNCTIONS.imx.getAddress: {
const address = await getProvider().getAddress();
track(moduleName, 'performedImxGetAddress', {
Expand Down

0 comments on commit 0fc0ed3

Please sign in to comment.