Skip to content

Commit

Permalink
fixup! fixup! feat(suite): minimal walletconnect implementation for evm
Browse files Browse the repository at this point in the history
  • Loading branch information
martykan committed Jan 23, 2025
1 parent d9af57c commit f42e19a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/suite-walletconnect/src/adapters/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ const ethereumRequestThunk = createThunk<
return response.payload.signature;
}
case 'eth_sendTransaction': {
const [transaction] = event.params.request.params;
const chainId = Number(event.params.chainId.replace('eip155:', ''));
const account = getAccount(transaction.from, chainId);
if (account.networkType !== 'ethereum') {
Expand Down
9 changes: 8 additions & 1 deletion packages/suite-walletconnect/src/walletConnectThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,22 @@ export const sessionRequestThunk = createThunk<
}

const result = await dispatch(adapter.requestThunk({ event }));
if (!result?.success) {
throw new Error('Device request failed');
}

await walletKit.respondSessionRequest({
topic: event.topic,
response: {
id: event.id,
jsonrpc: '2.0',
result,
result: result.payload,
},
});

if (desktopApi.available) {
desktopApi.appHide();
}
} catch (error) {
console.error(error);

Expand Down

0 comments on commit f42e19a

Please sign in to comment.