ISynapseIntentPreviewer

Git Source

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

NameTypeDescription
swapQuoteraddressPeripheral contract to use for swap quoting
forwardToaddressThe 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).
tokenInaddressInitial token for the intent
tokenOutaddressFinal token for the intent
amountInuint256Initial amount of tokens to use for the intent

Returns

NameTypeDescription
amountOutuint256Final amount of tokens to receive. Zero if the intent cannot be completed.
stepsISynapseIntentRouter.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).