Skip to main content

Migrating from v3 to v4

@arbitrum/sdk v4 introduces a number of breaking changes. This document outlines the changes and provides guidance on how to migrate your existing v3 code to v4.

Breaking Changes

With the launch of Orbit chains from Offchain Labs, the Arbitrum SDK has been updated to support the new chains. This has resulted in a number of breaking changes to the SDK. The following is a list of the most significant changes:

L1 Network Removed

The Arbitrum SDK no longer requires the L1 network to be registered. Only Arbitrum networks need to be registered.

Arbitrum networks are any networks that are built with Arbitrum technology. This includes Arbitrum One, Arbitrum testnets, and any Orbit chain.

Renaming L1/L2 to Parent/Child

Throughout the codebase, most instances of the terms "L1" and "L2" have been replaced with "parent" and "child." Any time that the code is referring explicitly to an "L1", "L2", or "L3" that term is used. Though in most circumstances, when the code is referring to a parent-child relationship between chains, the terms "parent" and "child" is used.

v3 Namev4 Name
L1TransactionReceiptParentTransactionReceipt
L1ContractTransactionParentContractTransaction
L1ToL2MessageParentToChildMessage
L1ToL2MessageWriterParentToChildMessageWriter
L1ToL2MessageReaderParentToChildMessageReader
L1ToL2MessageReaderClassicParentToChildMessageReaderClassic
L1ToL2MessageStatusParentToChildMessageStatus
L1ToL2MessageGasEstimatorParentToChildMessageGasEstimator
L2TransactionReceiptChildTransactionReceipt
L2ContractTransactionChildContractTransaction
L2ToL1MessageChildToParentMessage
L2ToL1MessageWriterChildToParentMessageWriter
L2ToL1MessageReaderChildToParentMessageReader
L2ToL1MessageStatusChildToParentMessageStatus
L2NetworkArbitrumNetwork
getL2NetworkgetArbitrumNetwork
addCustomNetworkregisterCustomArbitrumNetwork

Asset Bridger Class Methods

The AssetBridger class methods have been renamed to reflect the new Parent/Child terminology.

v3 Namev4 Name
checkL1NetworkcheckParentChain
checkL2NetworkcheckChildChain

Erc20Bridger Class Methods

The Erc20Bridger class methods have been renamed to reflect the new Parent/Child terminology.

v3 Namev4 Name
getL1GatewayAddressgetParentGatewayAddress
getL2GatewayAddressgetChildGatewayAddress
getL2WithdrawalEventsgetWithdrawalEvents
getL1ERC20AddressgetParentERC20Address
getL2ERC20AddressgetChildERC20Address
l1TokenIsDisabledisDepositDisabled
l1ProviderparentProvider
getL1GatewaySetEventsgetParentGatewaySetEvents
getL2GatewaySetEventsgetChildGatewaySetEvents

Message Classes

The message classes have been renamed to reflect the new Parent/Child terminology. Also, we've taken the opportunity to improve some of the method names.

ChildToParentMessageClassic
v3 Namev4 Name
getL2ToL1EventsgetChildToParentEvents
ChildToParentChainMessageNitro
v3 Namev4 Name
getL2ToL1EventsgetChildToParentEvents
ChildTransactionReceipt
v3 Namev4 Name
getL2ToL1EventsgetChildToParentEvents
getL2ToL1MessagesgetChildToParentMessages
ParentToChildMessage
v3 Namev4 Name
EthDepositStatusEthDepositMessageStatus
ParentTransactionReceipt
v3 Namev4 Name
getL1ToL2MessagesClassicgetParentToChildMessagesClassic
getL1ToL2MessagesgetParentToChildMessages
ParentEthDepositTransactionReceipt
v3 Namev4 Name
waitForL2waitForChildTransactionReceipt
ParentContractCallTransactionReceipt
v3 Namev4 Name
waitForL2waitForChildTransactionReceipt