Highlights
- All ***Arbitrum Classic*** functionality, except withdrawals, has now been removed. Classic withdrawals are still supported since there exist pending withdrawals to the classic Outbox.
- All functions that send transactions directly now have a `get*Request` variant for getting a request for the transaction that would be sent. This allows sdk consumers to get a request and send it themselves later.
- Retryable data tools for improved estimation of retryable parameters
EthBridger
- New `getDepositRequest` and `getWithdrawalRequest` get transaction request objects that can be sent later. `deposit` and `withdraw` now accept transaction request objects as arguments as well as existing params. Return object also contains L2 gas estimate information.
- Removed `depositEstimateGas` and `withdrawEstimateGas`. Equivalent estimates can now be made by calling `getDepositRequest` or `getWithdrawalRequest` and then calling `provider.estimateGas` with the result
- `deposit` params no longer contain an `l2Provider` property
- `destinationAddress` in `EthWithdrawParams` interface is mandatory. There’s no more default l2Signer's address. So, inputs of `getWithdrawalRequest` and `withdraw` method should contain `destinationAddress`.
Erc20Bridger
- New `getDepositRequest` , `getWithdrawalRequest` and `getApproveTokenRequest` functions for getting transaction request objects that can be sent later. `deposit` , `withdraw` and `approveToken` now accept transaction request objects as arguments as well as existing params. Return object also contains L2 gas estimate information.
- Removed `depositEstimateGas` and `withdrawEstimateGas`. Equivalent estimates can now be made by calling `getDepositRequest` or `getWithdrawalRequest` and then calling `provider.estimateGas` with the result
- `excessFeeRefundAddress` and `callValueRefundAddress` can now be customised when calling `deposit`. `from` must now be supplied when calling `deposit`
Retryable data tools
- Inbox methods now return an error when called with specific parameters. This error contains retryable data information useful for estimating L1ToL2 gas limits.
- New class `RetryableDataTools` for parsing these error messages
L1ToL2Message
- `fromClassic` and `fromNitro` removed
- `fromTxComponents` renamed to `fromEventComponents`
- Arguments `retryableCreationId` and `l2TxHash` removed from the `L1ToL2Message` constructor
- `getInputs` function removed in favour of `messageData` property
- Added `getSuccessfulRedeem` function for getting the first redeem transaction that succeeded.
- Added `getAutoRedeemAttempt` function for getting the redeem transaction that was automatically executed
- Added `getLifetime` function for getting the retryable lifetime setting
- Added `keepAlive` function for increasing the timeout of a retryable
- Added new `EthDepositMessage` class a separate from general `L1ToL2Message` class
- Added new `EthDepositStatus` for the return of `EthDepositMessage.status` method
L1ToL2MessageCreator
- New method `getTicketCreationRequest` for creating `L1ToL2Messages` as transaction requests
- `createRetryableTicket` arguments updated. Individual arguments moved into a params object, also accepts a transaction request object instead of params
L1ToL2MessageGasEstimator
- Refactored `estimateRetryableTicketGasLimit` to accept a single params object and an optional `senderDeposit` value
- Added `estimateMaxFeePerGas` method for estimating l2 max fee per gas
- Added `isValid` method for determining whether gas parameters are still valid
- Refactored `estimateAll` params
- Added `populateFunctionParams` method that internally uses `RetryableDataTools` to estimate the parameters for a contract that internally creates a retryable ticket
L1Transaction
- Added `getMessageDeliveredEvents` and `getInboxMessageDeliveredEvents` methods for getting events emitted from Inbox.sol and Bridge.sol
- Added `getMessageEvents` method for linking message delivered and inbox message delivered
- Renamed `getEthDepositMessages` to `getEthDeposits`
- Removed `getL1ToL2Message`, only the plural `getL1ToL2Messages` is now available
L2ToL1Transaction
- Added `L2ToL1TransactionNitro` and `L2ToL1TransactionClassic` for interacting with nitro and classic outboxes respectively. `L2ToL1Transaction` still exists as composition class that internally calls the correct nitro or classic class when relevant
- Removed `outboxAddress` from `fromEvent` static constructor
- Renamed `getEventLogs` to `getL2ToL1Events`
L2Transaction
- Added `getRedeemScheduledEvents` method
- Removed `l2Provider` parameter from `getL2ToL1Messages` method
- Added `getBatchConfirmations` method for getting the number of L1 block confirmations that a batch has
- Added `getBatchNumber` method for getting the batch number of an L2 transaction
- Removed `l1Provider` parameter from `isDataAvailable` method
- Added `toRedeemTransaction` to convert an L2 transaction into a `RedeemTransaction`
Misc
- Reduced production dependency and package size
- Integration tests now run against nitro v2.0.0
- `ArbSdkError` can now capture inner errors and stack traces
- Address is now optional and moved into `filter` object in `EventFetcher`
- Event objects used to accept either named, or unnamed tuples. This lead to complicated types, that were difficult to construct. Now only named tuples are supported.
- In line with L2 network objects, all L1 network objects now have the property `isArbitrum` with the value `false`.
- `L2Network` objects now contains a `nitroGenesisBlock` specifying when the l2 block at which nitro was enabled - value set to 0 for networks that have always been nitro.
- `rpcUrl` removed from the network object