Request examples

Here you can find /routes and /quote cURL request examples for Solana

Routes Request

From EVM to SOL:

  • the routes request without requesting the gas on the destination chain:

curl --request POST \
--url https://li.quest/v1/advanced/routes \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data ' 
{
    "fromChainId": 137, 
    "fromAmount": "2000000", 
    "fromTokenAddress": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174", 
    "toChainId": "SOL", 
    "toTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", 
    "fromAddress": "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0", 
    "toAddress": "S5ARSDD3ddZqqqqqb2EUE2h2F1XQHBk7bErRW1WPGe4",
    "options": 
    { 
        "slippage": 0.03 
    }
} '
  • the routes request with the gas on the destination chain:

curl --request POST \
--url https://li.quest/v1/advanced/routes \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data ' 
{
    "fromChainId": "POL", 
    "fromAmount": "2000000", 
    "fromTokenAddress": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174", 
    "toChainId": 1151111081099710, 
    "toTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", 
    "fromAddress": "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0", 
    "toAddress": "S5ARSDD3ddZqqqqqb2EUE2h2F1XQHBk7bErRW1WPGe4",
    "fromAmountForGas": 284126,
    "options": 
    { 
        "slippage": 0.03
    } 
} '

From SOL to EVM:

  • the routes request without requesting the gas on the destination chain:

curl --request POST \
--url https://li.quest/v1/advanced/routes \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data ' 
{
    "fromChainId": "SOL", 
    "fromAmount": "2000000", 
    "fromTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "toChainId": 137, 
    "toTokenAddress": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174", 
    "fromAddress": "S5ARSDD3ddZqqqqqb2EUE2h2F1XQHBk7bErRW1WPGe4",
    "toAddress": "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0",
    "options": 
    { 
        "slippage": 0.03 
    }
} '
  • the routes request with the gas on the destination chain:

curl --request POST \
--url https://li.quest/v1/advanced/routes \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data ' 
{
    "fromChainId": 1151111081099710, 
    "fromAmount": "2000000", 
    "fromTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "toChainId": "POL", 
    "toTokenAddress": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174", 
    "fromAddress": "S5ARSDD3ddZqqqqqb2EUE2h2F1XQHBk7bErRW1WPGe4",
    "toAddress": "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0",
    "fromAmountForGas": 37376,
    "options": 
    { 
        "slippage": 0.03
    } 
} '

Quote Request

From EVM to SOL:

  • the quote request without requesting the gas on the destination chain:

curl --request GET \
     --url 'https://li.quest/v1/quote?fromChain=POL&toChain=1151111081099710&fromToken=0x2791bca1f2de4661ed88a30c99a7a9449aa84174&toToken=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&fromAddress=0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0&toAddress=S5ARSDD3ddZqqqqqb2EUE2h2F1XQHBk7bErRW1WPGe4&fromAmount=2000000&slippage=0.03' \
     --header 'accept: application/json'
  • the routes request with the gas on the destination chain:

curl --request GET \
     --url 'https://li.quest/v1/quote?fromChain=137&toChain=SOL&fromToken=0x2791bca1f2de4661ed88a30c99a7a9449aa84174&toToken=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&fromAddress=0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0&toAddress=S5ARSDD3ddZqqqqqb2EUE2h2F1XQHBk7bErRW1WPGe4&fromAmount=2000000&slippage=0.03&fromAmountForGas=284126' \
     --header 'accept: application/json'

From SOL to EVM:

  • the quote request without requesting the gas on the destination chain:

curl --request GET \
     --url 'https://li.quest/v1/quote?fromChain=1151111081099710&toChain=POL&toToken=0x2791bca1f2de4661ed88a30c99a7a9449aa84174&fromToken=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&toAddress=0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0&fromAddress=S5ARSDD3ddZqqqqqb2EUE2h2F1XQHBk7bErRW1WPGe4&fromAmount=2000000&slippage=0.03' \
     --header 'accept: application/json'
  • the routes request with the gas on the destination chain:

curl --request GET \
     --url 'https://li.quest/v1/quote?fromChain=1151111081099710&toChain=POL&toToken=0x2791bca1f2de4661ed88a30c99a7a9449aa84174&fromToken=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&toAddress=0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0&fromAddress=S5ARSDD3ddZqqqqqb2EUE2h2F1XQHBk7bErRW1WPGe4&fromAmount=2000000&slippage=0.03&fromAmountForGas=37376' \
     --header 'accept: application/json'

Last updated