Router Intents
  • Router Intents
    • What is an Intent?
    • Why is Intent-driven DeFi a Requirement?
    • Intro to Router's CCIF
  • How to Create an Intent Adapter using Router's CCIF
  • How to Generate Calldata for Invoking an Intent Adapter
  • API Reference
    • StakeStone API Reference
    • StakeStone (X Layer) API Reference
    • Lido API Reference
    • Kim API Reference
    • SwapMode API Reference
    • Lynex API Reference
    • Scribe API Reference
    • Ring Exchange API Reference
    • xFai API Reference
    • BaseSwap API Reference
    • Thirdfy API Reference
    • Parifi API Reference
    • Wen API Reference
  • Chains Supported
  • Contract Addresses
    • Mainnet Contracts
    • Testnet Contracts
  • Audit Reports
  • Router CCIF Whitepaper
Powered by GitBook
On this page
  • Router Intents API Swagger
  • Get Quote
  • Base URL
  • Body
  • Response
  • Sample cURL
  • Compose Calldata
  • Base URL
  • Body
  • Response
  1. API Reference

StakeStone API Reference

PreviousAPI ReferenceNextStakeStone (X Layer) API Reference

Last updated 9 months ago

Router Intents API Swagger

Get Quote

POST /protocol/get-protocol-quotes

Fetch the quote for staking into StakeStone from any chain using any token.

Base URL

Body

{
    "ReceiverAddress": "0xcdACa3635f4B1C969af7C53988D4c8576698ba7C",
    "SourceTokens": [
        {
            "chainId": "1",
            "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "symbol": "USDC",
            "decimals": 6
        }
    ],
    "Amount": [
        "20000000"
    ],
    "SourceChainId": 1,
    "Protocol": [
        {
            "protocolId": "stakestone",
            "chainId": "1",
            "action": "stake",
            "poolId": "stakestone-stone-1",
            "data": {}
        }
    ]
}
Name
Type
Description

ReceiverAddress

string (required)

Wallet address to receive STONE

SourceTokens

array (required)

Array of tokens at the source side

Amount

array (required)

Array of token amounts being supplied

SourceChainId

int (required)

Network ID of the starting chain, for example: 137 for Polygon

Protocol

object (required)

Intent adapter information for StakeStone

SenderAddress

string (optional)

If SenderAddress is different from the ReceiverAddress

SlippageTolerance

float (optional)

1 means 1%; by default, this is set to 2%.

// For protocol, pass the following:
{
    "protocolId": "stakestone",
    "chainId": "1",
    "action": "stake",
    "poolId": "stakestone-stone-1",
    "data": {
        "bridgeChain": "169", // if you want to bridge stone to Manta, else data should be empty
        "bridgePoolId": "stakestone-stone" 
        }
}

Response

200: Success
{
  "Code": 0,
  "Errors": [],
  "PayLoad": {
    "quotationType": "BatchTransaction",
    "slippageTolerance": 0,
    "sourceTokens": [
      {
        "chainId": "1",
        "address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        "symbol": "ETH",
        "decimals": 18
      }
    ],
    "amount": [
      "100000000000000000"
    ],
    "sourceChainId": 1,
    "destinationChainId": 1,
    "destinationToken": {
      "address": "0x7122985656e38BDC0302Db86685bb972b145bD3C",
      "name": "stone",
      "symbol": "stone",
      "decimals": 18
    },
    "adapters": [
      {
        "adapterId": "stakestone_stake",
        "adapterType": "stake",
        "sourceChainId": 1,
        "destChainId": "1",
        "adapterOptions": {
          "srcToken": {
            "address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
            "name": "eth",
            "symbol": "eth",
            "decimals": 18
          },
          "amountIn": "100000000000000000",
          "amountOut": "98678000000000000",
          "destToken": {
            "address": "0x7122985656e38BDC0302Db86685bb972b145bD3C",
            "name": "stone",
            "symbol": "stone",
            "decimals": 18
          },
          "receiverAddress": "0x7830c87C02e56AFf27FA8Ab1241711331FA86F43",
          "data": {
            "refundAddress": "0x7830c87C02e56AFf27FA8Ab1241711331FA86F43",
            "partnerId": 83,
            "protocolData": {
              "bridgeChain": 1
            }
          }
        },
        "adapters": []
      }
    ],
    "quote": [
      {
        "amountSent": "100000000000000000",
        "amountReceived": 98678000000000000,
        "amountReceivedInEther": "0.098678",
        "exchangeRate": 1.0134,
        "srcToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        "destToken": "0x7122985656e38BDC0302Db86685bb972b145bD3C",
        "adapterId": "stakestone_stake",
        "estimatedTime": 12
      }
    ],
    "clientAddress": "0x7830c87C02e56AFf27FA8Ab1241711331FA86F43",
    "senderAddress": "0x7830c87C02e56AFf27FA8Ab1241711331FA86F43",
    "estimatedTime": 12
  }
}
400: Bad Request
{
  "Code": 1,
  "Error": [
    {
      "Code": "1",
      "Message": [
        {
          "title": "",
          "message": ""
        }
      ]
    }
  ],
  "Payload": null
}

Under protocol, set action as express-stake if you want the best path for the user. If the action is set as stake, our pathfinder will always generate a path that involves staking into StakeStone on Ethereum. In the case of express-stake, our pathfinder will also evaluate if directly swapping into STONE will result in a better output.

Sample cURL

curl --location 'https://api.pod.routerintents.com/router-intent/protocol/get-protocol-quotes' \
--header 'Accept: */*' \
--header 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: https://poc-intents-ui.vercel.app' \
--header 'Referer: https://poc-intents-ui.vercel.app/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: cross-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36' \
--header 'sec-ch-ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '{
    "ReceiverAddress": "0xcdACa3635f4B1C969af7C53988D4c8576698ba7C",
    "SourceTokens": [
        {
            "chainId": "1",
            "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "symbol": "USDC",
            "decimals": 6
        }
    ],
    "Amount": [
        "20000000"
    ],
    "SourceChainId": 1,
    "Protocol": [
        {
            "protocolId": "stakestone",
            "chainId": "1",
            "action": "stake",
            "poolId": "stakestone-stone-1",
            "data": {}
        }
    ]
}'


Compose Calldata

POST /adapter/compose-adapter-calldata

Fetch the calldata to execute the quote fetched via the get-protocol-quotes endpoint

Base URL

Body

Payload object from the response of the get-protocol-quotes endpoint

Response

200: Success
{
    "Code": 0,
    "Errors": [],
    "PayLoad": {
        "trnxId": "a411c306-fd83-4a65-8d6c-00b9d89dcd36",
        "gasPrice": "2122700",
        "calldata": "0xabcd",
        "to": "0xe088fC93EFDb514613481229D022D428988dEC60",
        "from": "0xcdACa3635f4B1C969af7C53988D4c8576698ba7C",
        "value": "0x00",
        "prioritySteps": [],
        "gasLimit": "750000"
        }
}
400: Bad Request
{
  "Code": 1,
  "Error": [
    {
      "Code": "1",
      "Message": [
        {
          "title": "",
          "message": ""
        }
      ]
    }
  ],
  "Payload": null
}

Notes:

  • In the payload, prioritySteps will contain the approval transaction calldata that needs to be executed before performing the transaction.

  • The estimated gasLimit sent by our APIs are not based on any simulations because it is not possible to simulate gasLimit without having token allowance. The gasLimit sent by our APIs is a highly conservative estimate of the gas that a tx could use. Since the actual gas limit will be much lower, we suggest that the API users estimate the gasLimit themselves once the approval tx is mined.

https://api.pod.routerintents.com
https://api.pod.routerintents.com
Swagger UI
Logo