Skip to main content
Before you post an ad or start a trade, read the catalogue: which chains the relayer serves, which tokens live on them, and which token pairs can be traded across. These six read-only endpoints need no sign-in. A chain row carries the contract addresses your wallet calls. A token row says what kind of asset it is and how many decimals it has. A route is one direction of trade: an ad token on the ad chain, which the maker escrows in the AdManager, paired with an order token on the order chain, which the bridger escrows in the OrderPortal. Routes are one-way; the reverse direction is a separate route. See Makers and bridgers and Supported networks.

Endpoints

Every list is cursor-paged: limit 1 to 100, default 25, and pass nextCursor back as cursor (Pagination). The catalogue changes rarely, so cache it instead of refetching on every render.

List chains

GET /v1/chains
Stellar contract addresses come back as 0x + 64 hex (the 32-byte contract id). Convert them to a C… strkey for display. Hide a chain as an ad chain when blsKeyRegistryAddress is null: creating an ad there is refused.

Get one chain

GET /v1/chains/:chainId. :chainId is the decimal chain id, such as 1000002, not a UUID. The response is one chain object as in the list.

List tokens

GET /v1/tokens

Token kinds

Amounts everywhere in the API are integer strings in the token’s smallest unit. Use decimals to format them.

Get one token

GET /v1/tokens/:id. :id is the token’s UUID. The response is one token object as in the list.

List routes

GET /v1/routes
Each route already carries both tokens with their decimals, kind and chain, so a pair picker needs no further call. To fill one, list the chains once, then list the routes with both adChainId and orderChainId.

Route statuses

The list shows only ACTIVE routes unless you pass status. Send status=ALL to show a maker whose ad sits on a retired route.

Get one route

GET /v1/routes/:id. Answers a retired route too, so an ad or trade on it can still show its route. The response is the route object as in the list, plus timing: the route’s current clocks, read from both escrows on chain.
A chain read that fails is not an error: you get the route with timing: null, or with one half null. The relayer keeps a complete answer for up to 10 minutes and a failed read for 1 minute.

The route’s clocks

Every trade on a route runs against a set of timers that live on chain, set per peer chain on each escrow. Deadlines and clocks explains what they do to a trade. timing holds two sets:
  • ad: the AdManager on the ad chain, for this order chain (the primary’s window);
  • order: the OrderPortal on the order chain, for this ad chain (the follower’s stagger).
Each value is in seconds, as a decimal string: timing is the route’s current version, which is what a new trade is held to. A trade that is already open keeps its own version, so for a live trade read its own fields (deadline, claimFinalizeAt and the others on Trades) rather than the route’s. A set that was never configured comes back null. On chain, every create and lock on such a route reverts with RouteTiming__NotSet, so no trade can start on it. The relayer uses the clocks to pick a new order’s deadline: 24 hours by default, longer when the route’s windows need it, and never more than 7 days less 10 minutes out.