```\n    function swap(\n        uint16 _chainId,\n        uint256 _srcPoolId,\n        uint256 _dstPoolId,\n        address payable _refundAddress,\n        Pool.CreditObj memory _c,\n        Pool.SwapObj memory _s,\n        IStargateRouter.lzTxObj memory _lzTxParams, \n        bytes calldata _to,\n        bytes calldata _payload\n    ) external payable onlyRouter {\n        bytes memory payload = abi.encode(TYPE_SWAP_REMOTE, _srcPoolId, _dstPoolId, _lzTxParams.dstGasForCall, _c, _s, _to, _payload);\n        _call(_chainId, TYPE_SWAP_REMOTE, _refundAddress, _lzTxParams, payload);\n    }\n\n    function _call(\n        uint16 _chainId,\n        uint8 _type,\n        address payable _refundAddress,\n        IStargateRouter.lzTxObj memory _lzTxParams,\n        bytes memory _payload\n    ) internal {\n        bytes memory lzTxParamBuilt = _txParamBuilder(_chainId, _type, _lzTxParams);\n        uint64 nextNonce = layerZeroEndpoint.getOutboundNonce(_chainId, address(this)) + 1;\n        layerZeroEndpoint.send{value: msg.value}(_chainId, bridgeLookup[_chainId], _payload, _refundAddress, address(this), lzTxParamBuilt);\n        emit SendMsg(_type, nextNonce);\n    }\n```\n