Router Knowledge Hub

REST API

Learn more about the REST API that can be used to query information as well as perform sensitive tasks

More abuot the REST API

Endpoints of the API

The router contains a REST API that can be used to query information as well as perform sensitive tasks. The API is available at the router’s IP address and at the ROUTER_EXTERNAL_PORT in the .env file.

DANGER

As described in the Spinning Up section, do NOT expose this API to the internet. The queries in this document must be done from a trusted environment, i.e. inside a VPC or directly on the router host machine.

Endpoints

GET /ping

Pings the router.

Example Request

cURL
Copy to Clipboard

Example Response

Copy to Clipboard

GET /config

Gets the router’s config.

Example Request

cURL
Copy to Clipboard

Example Response

Copy to Clipboard

POST /remove-liquidity

Remove’s router’s liquidity.

Request Body

  • adminToken: The admin token.
  • chainId: ChainId to remove liquidity from.
  • assetId: AssetId of the asset to remove liquidity from.
  • amount: Amount in true units to remove.
  • recipientAddress: Address to send the removed liquidity to.

Example Request

cURL
Copy to Clipboard

Example Response

Copy to Clipboard

POST /cancel-sender

Manually cancels sender’s transaction.

DANGER

This is a dangerous operation. If you cancel the sender side transaction and the router has prepared (or is in the process of preparing) the receiving side transaction, the router will lose funds.

Request Body

  • adminToken: The admin token.
  • senderChainId: The sender chainId to cancel the transaction on.
  • transactionId: The assetId from transaction to cancel.
  • user: The user’s address.

Example Request

cURL
Copy to Clipboard

Example Response

Copy to Clipboard

Ecosystem