Skip to main content
These endpoints back Earn over REST. With them and POST /route, you can find a vault, deposit into it from any supported asset, and withdraw later, without the SDK. The SDK equivalents are in Earn with the headless core. Every endpoint takes the same X-API-Key header and rate limits as POST /route. See authentication. A missing or invalid key returns 401.

The flow

1

Find a vault

Call GET /vaults to search, or GET /vaults/{network}/{vaultId} for a vault you already know.
2

Deposit

Call POST /route with vault: { vaultId, network }. Set toChain to the vault’s network.chainId, toToken to its asset.address, and toAddress to the EVM address that receives the position. Then sign, submit the receipt, and poll status as for any route.
3
4

Withdraw

Call GET /vaults/redeem/{network}/{vaultId}, then sign and send each returned transaction in order from the wallet that holds the position.
Successful responses wrap the result in data. Errors return error with a message, as on every endpoint. When vault data can’t be fetched, the endpoints return 503. Search and detail results are cached, so APY and TVL can lag the source by an hour or more. Positions are cached for up to a minute.

Search vaults

GET https://api.trustware.io/api/v1/routes/vaults Returns one page of vaults matching your filters. Repeat a list parameter to pass several values, such as ?allowedNetworks=base&allowedNetworks=arbitrum. Every parameter is optional. A perPage outside 1 to 10, a page or perPage that isn’t an integer, or a minTvl or minApy that isn’t a number returns 400.
nextPage is absent on the last page. Each vault has the shape of VaultSummary. To deposit, pass vaultId and network.name as the route’s vault, network.chainId as toChain, and asset.address as toToken. A flag carries content, severity, and an optional endDate as a Unix timestamp.

Get a vault

GET https://api.trustware.io/api/v1/routes/vaults/{network}/{vaultId} Returns one vault as data, with the same shape as a search result.

List positions

GET https://api.trustware.io/api/v1/routes/vaults/positions/{address} Returns every vault position the wallet holds, including vaults you don’t offer.
Treat a null data as no positions.

Get withdrawal transactions

GET https://api.trustware.io/api/v1/routes/vaults/redeem/{network}/{vaultId} Returns the unsigned transactions that withdraw a position. A withdrawal is not a route. It runs on the vault’s own chain, the vault’s asset returns to address, and there is no intent, receipt, or status to track. A request without address or assetAddress, with neither all=true nor amount, or with an all that isn’t a boolean returns 400.
Sign and send each transaction in the order returned, from address, on tx.chainId. Wait for each one to confirm before you send the next, and stop if one fails. To move the withdrawn asset somewhere else, build a new route with it as the source once the withdrawal confirms.