Cross Chain Swap Fee
Get the cross chain swap fee, paid in native gas on the source chain.
Use quoteLayerZeroFee()
to get the fee required to call swap()
. The fee ensures the cross chain message is paid for.
For the uint8 _functionType
argument use 1
for swap()
s. Here is an explanation of the other function types.
Estimate the fee for the message cost of the swap()
using offchain code like this:
quoteLayerZeroFee()
estimates the message fee and returns an amount of wei in source gas token. Use this as the { value: xxxx }
passed to the actual swap()
method when you perform the swap.
Note: quoteLayerZeroFee() returns a 2-value tuple:
Use feeWei
to call swap():
Last updated