Optional
options?: { A Promise resolving to an object containing the taken amount, spent amount and result of the calculation.
import { getExpectedInput } from '@clober/v2-sdk'
const { takenAmount, spentAmount } = await getExpectedInput({
chainId: 421614,
inputToken: '0x00bfd44e79fb7f6dd5887a9426c8ef85a0cd23e0',
outputToken: '0x0000000000000000000000000000000000000000',
amountOut: '0.1', // take 0.1 ETH
})
Calculates the expected input for a given output amount, based on the provided market data.