Skip to main content
POST
/
widget
/
swap
curl --request POST \
  --url http://localhost:4000/v1/widget/swap \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "protocol": "lfj",
  "chainName": "avalanche",
  "fromToken": "AVAX",
  "toToken": "JOE",
  "routerAddress": "0xb00D916688FEE4aB6646994104E1441446947fc9",
  "slippageTolerance": 0.5
}
'
{
  "success": true,
  "metadata": {}
}

Authorizations

Authorization
string
header
required

Use this format: ApiKey <your_api_key>

Body

application/json

Parameters for generating swap metadata

protocol
string
required

Protocol name

Example:

"lfj"

chainName
string
required

Blockchain name

Example:

"avalanche"

fromToken
string
required

Input token

Example:

"AVAX"

toToken
string
required

Output token

Example:

"JOE"

routerAddress
string
required

KOL Router contract address

Example:

"0x123abc456def789012345678901234567890abcd"

slippageTolerance
number
required

Slippage tolerance (percentage)

Example:

0.5

Response

Swap metadata generated successfully

success
boolean
Example:

true

metadata
object

Generated metadata object containing all swap configuration