Across API
Source code:
The API is designed to be run serverlessly (without storing state) and is a wrapper on top of the SDK. Implementation here.
Caching & Liveness
Users of the Across API are requested to cache results for no longer than 300 seconds.
The Across API serves data that is derived from the on-chain state of the Across contracts and relayer bots. The on-chain state is subject to change each block, and cached data can quickly become invalid as a result.
Calculating Suggested Fees
The API uses the Across SDK under the hood, but offers a convenient way to get suggested fees when placing a Deposit transaction.
Example:
You can visit this example in your browser: Link.
Or curl it on the CLI:
curl "https://across.to/api/suggested-fees?token=0x7f5c764cbc14f9669b88837ca1490cca17c31607&destinationChainId=42161&amount=100000000000"
Note: When filling relays, it is strongly recommended to use the Across SDK relayFeeCalculator. Using the suggested-fees
API endpoint is done at the relayer's own risk.
API Definition
All API calls use https://across.to/api
as the host.
suggested-fees
Path: /suggested-fees
Method: GET
Query Params
Returns a JSON object with the following properties:
Errors:
400: invalid input.
500: an unexpected error within the API.
Querying Limits
The API uses the UMA SDK under the hood, but offers a convenient way to get transfer limits.
Example: Finding limits for bridging USDC from Optimism to Arbitrum.
You can visit this example in your browser: Link
Or curl it on the CLI:
curl "https://across.to/api/limits?token=0x7f5c764cbc14f9669b88837ca1490cca17c31607&destinationChainId=42161"
API Definition
All API calls use https://across.to/api
as the host.
limits
Path: /limits
Method: GET
Query Params
Returns a JSON object with the following properties:
Errors:
400: invalid input.
500: an unexpected error within the API.
Finding Available Routes
Example:
You can visit this example in your browser: Link
Or curl it on the CLI:
curl "https://across.to/api/available-routes"
API Definition
All API calls use https://across.to/api
as the host.
available-routes
available-routes
Path: /available-routes
Method: GET
Query Params
Returns a JSON array of Objects
with the following properties:
Errors:
400: invalid input.
500: an unexpected error within the API.
Last updated