File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,21 @@ Result-style `wait`.
162162
163163---
164164
165+ ## Utility Helpers
166+
167+ ### ` getL2TransactionHashFromLogs (logs ) → Hex | null `
168+
169+ Extracts the L2 transaction hash from L1 logs emitted by ` Bridgehub ` during deposit. Returns ` null ` if not found.
170+
171+ ` ` ` ts
172+ import { getL2TransactionHashFromLogs } from ' @matterlabs/zksync-js/ethers' ;
173+
174+ const l1Receipt = await client .l1 .waitForTransaction (l1TxHash );
175+ const l2TxHash = l1Receipt ? getL2TransactionHashFromLogs (l1Receipt .logs ) : null ;
176+ ` ` `
177+
178+ ---
179+
165180## Types (Overview)
166181
167182### Deposit Params
Original file line number Diff line number Diff line change @@ -160,6 +160,23 @@ Result-style `wait`.
160160{{#include ../ .. / ../ snippets / viem / reference / deposits .test .ts :create - token - deposit }}
161161```
162162
163+ ---
164+
165+ ## Utility Helpers
166+
167+ ### ` getL2TransactionHashFromLogs(logs) → Hex | null `
168+
169+ Extracts the L2 transaction hash from L1 logs emitted by ` Bridgehub ` during deposit. Returns ` null ` if not found.
170+
171+ ``` ts
172+ import { getL2TransactionHashFromLogs } from ' @matterlabs/zksync-js/viem' ;
173+
174+ const l1Receipt = await client .l1 .waitForTransactionReceipt ({ hash: l1TxHash });
175+ const l2TxHash = getL2TransactionHashFromLogs (l1Receipt .logs );
176+ ```
177+
178+ ---
179+
163180## Types (Overview)
164181
165182### Deposit Params
You can’t perform that action at this time.
0 commit comments