Cross Chain Swap Fee
Get the cross chain swap fee, paid in native gas on the source chain.
// Router.sol method to get the value for swap()
function quoteLayerZeroFee(
uint16 _dstChainId,
uint8 _functionType,
bytes calldata _toAddress,
bytes calldata _transferAndCallPayload,
Router.lzTxObj memory _lzTxParams
) external view override returns (uint256, uint256)let quoteData = await router.quoteLayerZeroFee(
dstChainId, // destination chainId
functionType, // function type: see Bridge.sol for all types
toAddress, // destination of tokens
"0x", // payload, using abi.encode()
({
dstGasForCall: 0, // extra gas, if calling smart contract,
dstNativeAmount: 0, // amount of dust dropped in destination wallet
dstNativeAddr: taskArgs.dstNativeAddr // destination wallet for dust
})
)Last updated
