phone-arrow-up-rightCall Data API

Generate swap call data for Rooster Protocol

post

Endpoint to generate the necessary call data for executing a token swap on the Rooster Protocol.

Body
inputTokenAddressstringRequired

Address of the input token. Use '0x0000000000000000000000000000000000000000' for the native gas token.

outputTokenAddressstringRequired

Address of the output token.

recipientAddressstringRequired

Address of the recipient of the output tokens.

amountstringRequired

Amount of the input token to swap (in its smallest unit, e.g., Wei).

slippagenumber · floatOptional

Optional. Slippage tolerance percentage (e.g., 3 for 3%). Defaults to a predefined value.

amountOutMinimumstringOptional

Optional. Minimum amount of output tokens expected (in Wei). If not provided, it will be calculated based on the slippage.

Responses
chevron-right
200

Successfully generated swap call data.

application/json
callDatastringOptional

Call data to be sent to the router contract.

Example: 0xac9650d80000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000c4522ba7eb00000000000000000000000035e44dc4702fd51744001e248b49cbf9fcc51f0c0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000009184e72a000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000154a14398c5c5b4b7913954cb82521fb7afa676314000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064f16d7904000000000000000000000000dddd73f5df1f0dc31373357beac77545dc5a6f3f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000008a6f6552ce3fdff3c26d004b255e59b6b5935f06000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084670ca181000000000000000000000000ea237441c92cae6fc17caaf9a7acb3f953be4bd1000000000000000000000000dddd73f5df1f0dc31373357beac77545dc5a6f3f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000
tostringOptional

Address of the router contract.

Example: 0x35e44dc4702Fd51744001E248B49CBf9fcc51f0C
valuestringOptional

Value (in Wei) to be sent with the transaction (usually 0, except when swapping with gas token).

Example: 10000000000000
expectedOutputstringOptional

Estimated amount of output tokens the user will receive.

Example: 2
amountOutMinimumstringOptional

Minimum amount of output tokens the user should receive after slippage (in Wei).

Example: 2
slippagenumber · floatOptional

The final slippage used for the calculation.

Example: 0.7
statusintegerOptional

HTTP status code (200 for success).

post
/swap/callData

Last updated