Commit be331568 authored by Kelvin Fichter's avatar Kelvin Fichter

fix(sdk): automatically create std/ETH bridges

Updates the SDK to automatically create the Standard and ETH bridges as
long as the L1StandardBridge provider is supplied.
parent 5bb850b4
---
'@eth-optimism/sdk': patch
---
Have SDK automatically create Standard and ETH bridges when L1StandardBridge is provided.
...@@ -165,19 +165,19 @@ export const getBridgeAdapters = ( ...@@ -165,19 +165,19 @@ export const getBridgeAdapters = (
} }
): BridgeAdapters => { ): BridgeAdapters => {
const adapterData: BridgeAdapterData = { const adapterData: BridgeAdapterData = {
...(CONTRACT_ADDRESSES[l2ChainId] ...(CONTRACT_ADDRESSES[l2ChainId] || opts?.contracts?.l1?.L1StandardBridge
? { ? {
Standard: { Standard: {
Adapter: StandardBridgeAdapter, Adapter: StandardBridgeAdapter,
l1Bridge: l1Bridge:
opts.contracts?.l1?.L1StandardBridge || opts?.contracts?.l1?.L1StandardBridge ||
CONTRACT_ADDRESSES[l2ChainId].l1.L1StandardBridge, CONTRACT_ADDRESSES[l2ChainId].l1.L1StandardBridge,
l2Bridge: predeploys.L2StandardBridge, l2Bridge: predeploys.L2StandardBridge,
}, },
ETH: { ETH: {
Adapter: ETHBridgeAdapter, Adapter: ETHBridgeAdapter,
l1Bridge: l1Bridge:
opts.contracts?.l1?.L1StandardBridge || opts?.contracts?.l1?.L1StandardBridge ||
CONTRACT_ADDRESSES[l2ChainId].l1.L1StandardBridge, CONTRACT_ADDRESSES[l2ChainId].l1.L1StandardBridge,
l2Bridge: predeploys.L2StandardBridge, l2Bridge: predeploys.L2StandardBridge,
}, },
......
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