ISynapseIntentPreviewer
Functions
previewIntent
Preview the completion of a user intent.
Will not revert if the intent cannot be completed, returns empty values instead.
Returns (amountIn, []) if the intent is a no-op (tokenIn == tokenOut).
function previewIntent(
address swapQuoter,
address forwardTo,
address tokenIn,
address tokenOut,
uint256 amountIn
)
external
view
returns (uint256 amountOut, ISynapseIntentRouter.StepParams[] memory steps);
Parameters
Name | Type | Description |
---|---|---|
swapQuoter | address | Peripheral contract to use for swap quoting |
forwardTo | address | The address to which the proceeds of the intent should be forwarded to. Note: if no forwarding is required (or done within the intent), use address(0). |
tokenIn | address | Initial token for the intent |
tokenOut | address | Final token for the intent |
amountIn | uint256 | Initial amount of tokens to use for the intent |
Returns
Name | Type | Description |
---|---|---|
amountOut | uint256 | Final amount of tokens to receive. Zero if the intent cannot be completed. |
steps | ISynapseIntentRouter.StepParams[] | Steps to use in SynapseIntentRouter in order to complete the intent. Empty if the intent cannot be completed, or if intent is a no-op (tokenIn == tokenOut). |