Skip to content

Commit 187dd08

Browse files
authored
feat(game-bridge): add store tokens to game bridge (#2726)
1 parent 8e5ca00 commit 187dd08

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/game-bridge/src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const PASSPORT_FUNCTIONS = {
5353
getEmail: 'getEmail',
5454
getPassportId: 'getPassportId',
5555
getLinkedAddresses: 'getLinkedAddresses',
56+
storeTokens: 'storeTokens',
5657
imx: {
5758
getAddress: 'getAddress',
5859
isRegisteredOffchain: 'isRegisteredOffchain',
@@ -513,6 +514,19 @@ window.callFunction = async (jsonData: string) => {
513514
});
514515
break;
515516
}
517+
case PASSPORT_FUNCTIONS.storeTokens: {
518+
const tokenResponse = JSON.parse(data);
519+
const response = await getPassportClient().storeTokens(tokenResponse);
520+
trackDuration(moduleName, 'performedStoreTokens', mt(markStart));
521+
callbackToGame({
522+
responseFor: fxName,
523+
requestId,
524+
success: true,
525+
error: null,
526+
result: response,
527+
});
528+
break;
529+
}
516530
case PASSPORT_FUNCTIONS.imx.getAddress: {
517531
const address = await getProvider().getAddress();
518532
trackDuration(moduleName, 'performedImxGetAddress', mt(markStart));

0 commit comments

Comments
 (0)