Commit 6b234c61 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge branch 'develop' into 08-17-fix_Remove_dotenv

parents 85832a0f 5d1a445e
---
'@eth-optimism/web3.js-plugin': patch
---
Update code exmaples in README
...@@ -28,10 +28,10 @@ yarn add @eth-optimism/web3.js-plugin ...@@ -28,10 +28,10 @@ yarn add @eth-optimism/web3.js-plugin
```typescript ```typescript
import Web3 from 'web3' import Web3 from 'web3'
import OptimismFeeEstimationPlugin from '@eth-optimism/web3.js-plugin' import { OptimismPlugin } from '@eth-optimism/web3.js-plugin'
const web3 = new Web3('http://yourProvider.com') const web3 = new Web3('http://yourProvider.com')
web3.registerPlugin(new OptimismFeeEstimationPlugin()) web3.registerPlugin(new OptimismPlugin())
``` ```
You will now have access to the following functions under the `op` namespace, i.e. `web3.op.someMethod` You will now have access to the following functions under the `op` namespace, i.e. `web3.op.someMethod`
...@@ -76,12 +76,15 @@ async estimateFees(transaction: Transaction, returnFormat?: ReturnFormat) ...@@ -76,12 +76,15 @@ async estimateFees(transaction: Transaction, returnFormat?: ReturnFormat)
```typescript ```typescript
import Web3 from 'web3' import Web3 from 'web3'
import { OptimismPlugin } from '@eth-optimism/web3.js-plugin'
import { import {
l2StandardBridgeABI, l2StandardBridgeABI,
l2StandardBridgeAddress, l2StandardBridgeAddress,
} from '@eth-optimism/contracts-ts' } from '@eth-optimism/contracts-ts'
const web3 = new Web3('https://mainnet.optimism.io') const web3 = new Web3('https://mainnet.optimism.io')
web3.registerPlugin(new OptimismPlugin())
const l2BridgeContract = new web3.eth.Contract( const l2BridgeContract = new web3.eth.Contract(
l2StandardBridgeABI, l2StandardBridgeABI,
optimistAddress[420] optimistAddress[420]
...@@ -117,12 +120,15 @@ console.log(totalFee) // 26608988767659n ...@@ -117,12 +120,15 @@ console.log(totalFee) // 26608988767659n
```typescript ```typescript
import Web3 from 'web3' import Web3 from 'web3'
import { OptimismPlugin } from '@eth-optimism/web3.js-plugin'
import { import {
l2StandardBridgeABI, l2StandardBridgeABI,
l2StandardBridgeAddress, l2StandardBridgeAddress,
} from '@eth-optimism/contracts-ts' } from '@eth-optimism/contracts-ts'
const web3 = new Web3('https://mainnet.optimism.io') const web3 = new Web3('https://mainnet.optimism.io')
web3.registerPlugin(new OptimismPlugin())
const l2BridgeContract = new web3.eth.Contract( const l2BridgeContract = new web3.eth.Contract(
l2StandardBridgeABI, l2StandardBridgeABI,
optimistAddress[420] optimistAddress[420]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment