Skip to content

Commit

Permalink
docs: fix call of estimateInitiateWithdrawalGas (#2539)
Browse files Browse the repository at this point in the history
fix call of estimateInitiateWithdrawalGas 

estimateInitiateWithdrawalGas is an action from publicActionsL2 not walletActions
  • Loading branch information
aaronmgdr authored Jul 27, 2024
1 parent c663937 commit 8bfb9fc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions site/pages/op-stack/actions/estimateInitiateWithdrawalGas.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Estimates gas required to initiate a [withdrawal](https://github.com/ethereum-op

```ts [example.ts]
import { base } from 'viem/chains'
import { account, walletClientL2 } from './config'
import { account, publicClientL2 } from './config'

const gas = await walletClientL2.estimateInitiateWithdrawalGas({
const gas = await publicClientL2.estimateInitiateWithdrawalGas({
account,
request: {
gas: 21_000n,
Expand All @@ -29,12 +29,12 @@ const gas = await walletClientL2.estimateInitiateWithdrawalGas({
import { createWalletClient, custom } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { mainnet } from 'viem/chains'
import { walletActionsL2 } from 'viem/op-stack'
import { publicActionsL2 } from 'viem/op-stack'

export const walletClientL2 = createWalletClient({
export const publicClientL2 = createPublicClient({
chain: mainnet,
transport: custom(window.ethereum)
}).extend(walletActionsL2())
}).extend(publicActionsL2())

// JSON-RPC Account
export const [account] = await walletClientL2.getAddresses()
Expand Down

0 comments on commit 8bfb9fc

Please sign in to comment.