Skip to main content
POST https://api.trustware.io/api/v1/routes/route Builds the full transaction payload for signing and broadcasting. Call this after the user confirms the quote. Trustware creates an intent record internally so the transaction can be tracked from receipt submission through final settlement. Pass a metadata object with any fields you need echoed back in all subsequent status responses, such as user ID, withdrawal ID, fiat destination, or any other reference data.

Request

Destination calls with hooks.postHook

Pass hooks.postHook to execute a contract call on the destination chain once the routed funds arrive, instead of paying the destination token to a recipient address. Destination calls are EVM only. This example routes the native asset on Avalanche into a contract on Base, funding the call with the destination native asset. callData is the ABI encoding of depositNativeFor(address recipient) for the recipient in toAddress.
Requests are rejected before routing when target or callData is missing, when fullAmount is true without amountInputPos, or when neither fundAmount nor fullAmount is supplied. A posthook the API rejects returns 400 with a message describing the problem. hooks.postHook is also accepted on POST /api/v1/routes/deposit-address. Deposit-address routing is provider dependent, and so are deposit-address routes with a posthook, so that path is not available on every route.
The route status reflects the provider’s aggregate result. There is no separate field reporting the destination call on its own, so verify destination state by reading your own contract.

Response

Every field on an approval entry is optional, so skip any entry that does not carry a token, a spender, and a non-zero amount.

Token approvals

If the source token is an ERC-20, the required allowances must be granted before the route transaction is broadcast. The spender is always a provider contract, never a Trustware contract. When route.execution.approvals is present, each entry is the authoritative source for one allowance: approve amount of tokenAddress for spender on chainId. Grant each one, wait for it to confirm, then broadcast route.execution.transaction. An ERC-20 source route returns them inside route.execution:
Do not assume the spender is route.execution.transaction.to. It often is, but a route can require an allowance for a different address, and it can require more than one. When route.execution.approvals is present, use it.
Re-quoting can change the selected provider, which changes the required allowances. Rebuild the route and re-read approvals rather than reusing an earlier response. You can also check a specific allowance with GET /allowance before broadcasting. This is a source-chain allowance and is unrelated to hooks.postHook.toApprovalAddress, which controls a destination-chain allowance for a destination contract call. The @trustware/sdk headless core handles the source allowances automatically on EVM routes: Trustware.sendRouteTransaction() reads the current allowance, submits an approval for the exact amount when one is missing, waits for confirmation, and then sends the route transaction.