Skip to content

Commit

Permalink
feat: [DX-2781] add getTransactionReceipt function to game bridge (#1731
Browse files Browse the repository at this point in the history
)
  • Loading branch information
CodeSchwert authored May 2, 2024
1 parent 9ba6dc1 commit e9f3650
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/game-bridge/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const PASSPORT_FUNCTIONS = {
sendTransaction: 'zkEvmSendTransaction',
requestAccounts: 'zkEvmRequestAccounts',
getBalance: 'zkEvmGetBalance',
getTransactionReceipt: 'zkEvmGetTransactionReceipt',
},
};

Expand Down Expand Up @@ -579,6 +580,23 @@ window.callFunction = async (jsonData: string) => {
});
break;
}
case PASSPORT_FUNCTIONS.zkEvm.getTransactionReceipt: {
const request = JSON.parse(data);
const result = await getZkEvmProvider().request({
method: 'eth_getTransactionReceipt',
params: [request.txHash],
});
track(moduleName, 'performedZkevmGetTransactionReceipt', {
timeMs: Date.now() - markStart,
});
callbackToGame({
responseFor: fxName,
requestId,
success: true,
result,
});
break;
}
case trackFunction: {
const request = JSON.parse(data);
const properties = JSON.parse(request.properties);
Expand Down

0 comments on commit e9f3650

Please sign in to comment.