Skip to content

Commit 0cf754c

Browse files
fix: update docs
1 parent bf5b7cd commit 0cf754c

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

docs/src/sdk-reference/ethers/deposits.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff 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

docs/src/sdk-reference/viem/deposits.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)