v3.3.0
What's Changed
Custom Gas Token Support
This release adds custom gas token support. Added by @spsjvc, @douglance and @godzillaba in #310.
L2Network
- Added a new property
nativeToken?: string
- In case of a chain that uses ETH as its gas token, this is either
undefined
or the zero address - In case of a chain that uses a custom gas token, this is the address of said token on the parent chain
- In case of a chain that uses ETH as its gas token, this is either
Asset Bridger
- Added a new property
nativeToken?: string
which is read from theL2Network
object
EthBridger
- Added
getApproveGasTokenRequest
andapproveGasToken
for approving the gas token to be spent by the Inbox
Erc20Bridger
- Added
getApproveGasTokenRequest
andapproveGasToken
for approving the gas token to be spent by the relevant Gateway
The only extra thing you have to do for custom gas token chains is to make sure to call approveGasToken
before executing a deposit, so that the Inbox (in case of a native token deposit) or the relevant Gateway (in case of a token deposit) have allowance to spend your tokens in order to pay for fees. The rest of your code can stay the same, as everything else will be handled internally by the SDK.
Erc20Bridger
Full Changelog: v3.2.0...v3.3.0