Learn how to upgrade your code to version 1.x if you have been using a 0.x version of the SDK before.
bridge
and prepareBridge
functions now require an additional type
field with the possible values of bridge
and bridgeSwap
. This is required as a swap requires slighly different arguments.
To adjust your existing code, you only need to add the highlighted field to your existing bridge
or prepareBridge
calls:
getApprovalAmount
function on chain adapters previously only returned the required approval amount (or undefined if no approval needed). Now this function returns an object with requiredAllowance
and availableAllowance
fields.approval-needed
variant of the prepareBridge
function. It allows integrations to display the available and required allowance before users initiate the approval transaction.
There is no action needed regarding this change unless you have implemented your own chain adapter.
getBridgeConfig
in the bridge API wrapper is still available and will keep working. However, we recommend to use the new function for more idiomatic code.