Skip to content

Commit 02bd64d

Browse files
committed
updated file import paths
1 parent a7f27f5 commit 02bd64d

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

pages/builders/app-developers/tutorials/sdk-trace-txns.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,34 +71,34 @@ You need to import some dependencies into your Node REPL session.
7171

7272
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L3-L4 hash=57a929d665f2e5e4a7ecd085ad3d0b01
7373
```
74-
74+
7575
## Set session variables
7676

7777
You'll need a few variables throughout this tutorial. Let's set those up now.
7878

7979
<Steps>
8080
{<h3>Import RPC URLs</h3>}
8181

82-
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L9-L10 hash=014f5d17eddb45fc081c7db9f33361b4
82+
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L13-L14 hash=6be30f5429fdd050fc32c21de4627d2e
8383
```
8484

8585
{<h3>Set the deposit to trace</h3>}
8686

8787
You'll be tracing a specific deposit in this tutorial. Deposit tracing is generally based on the transaction hash of the transaction that triggered the deposit. You can replace this transaction hash with your own if you'd like.
8888

89-
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L14 hash=367c797c3e9746addedf43857f789eeb
89+
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L17 hash=367c797c3e9746addedf43857f789eeb
9090
```
9191

9292
{<h3>Set the withdrawal to trace</h3>}
9393

9494
You'll also be tracing a specific withdrawal in this tutorial. Like with deposits, withdrawal tracing is generally based on the transaction hash of the transaction that triggered the withdrawal. You can replace this transaction hash with your own if you'd like.
9595

96-
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L15 hash=545d1eed00ad0a235e2c79c8a87efd30
96+
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L18 hash=545d1eed00ad0a235e2c79c8a87efd30
9797
```
9898

9999
{<h3>Create the RPC providers</h3>}
100100

101-
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L16-L25 hash=067eb34f545b809ac450a5dd5d06dd09
101+
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L20-L28 hash=6286672ca3163543e9d8ddeb5b1b6477
102102
```
103103
</Steps>
104104

@@ -111,21 +111,21 @@ You can use viem to trace a deposit.
111111

112112
You can query for the deposit status using the transaction hash of the deposit.
113113

114-
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L28-L29 hash=bbde51077bd7a3539e03ffc406daf25f
114+
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L30-L32 hash=b3693011e87b605cdd29baeffb080b9a
115115
```
116116

117117
{<h3>Get the deposit transaction receipt</h3>}
118118

119119
Retrieve the transaction receipt for the deposit using the viem client.
120120

121-
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L32-L34 hash=077581a56fc7b26f62589f0a6ae99e0d
121+
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L34-L36 hash=077581a56fc7b26f62589f0a6ae99e0d
122122
```
123123

124124
{<h3>Get the deposit transaction</h3>}
125125

126126
You can directly query for the L2 transaction that executed the deposit.
127127

128-
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L36-L38 hash=c67f0abeef0f2f817b7fb04be8f157a6
128+
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L38-L40 hash=c67f0abeef0f2f817b7fb04be8f157a6
129129
```
130130
</Steps>
131131

@@ -138,21 +138,21 @@ You can use viem's functions to trace a withdrawal.
138138

139139
Like deposits, withdrawals can have multiple statuses depending on where they are in the process.
140140

141-
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L40-L42 hash=55ceda3d9d2f9abf037f8b259de14f26
141+
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L42-L44 hash=55ceda3d9d2f9abf037f8b259de14f26
142142
```
143143

144144
{<h3>Get the withdrawal transaction receipt</h3>}
145145

146146
Retrieve the L1 transaction receipt for the withdrawal.
147147

148-
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L44-L46 hash=d784970abbfd37215d33274d60173ab2
148+
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L46-L48 hash=d784970abbfd37215d33274d60173ab2
149149
```
150150

151151
{<h3>Get the withdrawal transaction</h3>}
152152

153153
Directly query for the L1 transaction that executed the withdrawal.
154154

155-
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L48-L50 hash=48358bc45243db4e69de6ed3d49a67f9
155+
```js file=<rootDir>/public/tutorials/sdk-trace-txns.js#L50-L52 hash=48358bc45243db4e69de6ed3d49a67f9
156156
```
157157
</Steps>
158158

public/tutorials/sdk-trace-txns.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
const { createPublicClient, http } = require('viem');
44
const { optimismSepolia, sepolia } = require('viem/chains');
55

6+
const L1_RPC_URL= "https://rpc.ankr.com/eth_sepolia";
7+
const L2_RPC_URL= "https://sepolia.optimism.io";
68
// Need to use Alchemy or something here because the getDepositsByAddress and
79
// getWithdrawalsByAddress functions use a large block range that the public RPC doesn't support
810
// because it uses Ankr. Maybe the SDK should be updated to use smaller block ranges depending
911
// on the RPC but that's a separate issue.
10-
const l1RpcUrl = "https://rpc.ankr.com/eth_sepolia";
11-
const l2RpcUrl = "https://sepolia.optimism.io";
12+
13+
const l1RpcUrl = L1_RPC_URL;
14+
const l2RpcUrl = L2_RPC_URL;
1215

1316
// Docs CI wallet, will have deposits and withdrawals.
1417
const depositHash = '0x5896d6e4a47b465e0d925723bab838c62ef53468139a5e9ba501efd70f90cccb'
@@ -19,7 +22,6 @@ const l1Client = createPublicClient({
1922
transport: http(l1RpcUrl),
2023
});
2124

22-
2325
const l2Client = createPublicClient({
2426
chain: optimismSepolia,
2527
transport: http(l2RpcUrl),

0 commit comments

Comments
 (0)