{
    "Function": "swapTokensGeneric",
    "File": "src/Facets/GenericSwapFacet.sol",
    "Parent Contracts": [
        "src/Facets/Swapper.sol",
        "src/Interfaces/ILiFi.sol"
    ],
    "High-Level Calls": [
        "LibAsset",
        "LibAsset",
        "LibAsset"
    ],
    "Internal Calls": [
        "_executeSwaps"
    ],
    "Library Calls": [
        "getOwnBalance",
        "transferAsset",
        "getOwnBalance"
    ],
    "Low-Level Calls": [],
    "Code": "function swapTokensGeneric(LiFiData memory _lifiData, LibSwap.SwapData[] calldata _swapData) public payable {\n        uint256 receivingAssetIdBalance = LibAsset.getOwnBalance(_lifiData.receivingAssetId);\n\n        // Swap\n        _executeSwaps(_lifiData, _swapData);\n\n        uint256 postSwapBalance = LibAsset.getOwnBalance(_lifiData.receivingAssetId) - receivingAssetIdBalance;\n\n        LibAsset.transferAsset(_lifiData.receivingAssetId, payable(msg.sender), postSwapBalance);\n\n        emit LiFiTransferStarted(\n            _lifiData.transactionId,\n            _lifiData.integrator,\n            _lifiData.referrer,\n            _lifiData.sendingAssetId,\n            _lifiData.receivingAssetId,\n            _lifiData.receiver,\n            _lifiData.amount,\n            _lifiData.destinationChainId,\n            block.timestamp\n        );\n    }"
}