Documentation Index
Fetch the complete documentation index at: https://docs.trustware.io/llms.txt
Use this file to discover all available pages before exploring further.
GET https://api.trustware.io/api/v1/sdk/rpc/evm/allowance
Returns the ERC-20 allowance an ownerAddress has granted to a spenderAddress on a specific EVM chain. Trustware proxies the underlying call so you don’t have to manage public RPC endpoints or rate limits per chain.
Use this before broadcasting a route transaction whose source token is an ERC-20. If allowance is below fromAmount, prompt the user to approve the spender first.
The spender is the active route’s provider contract (Squid, LiFi, etc.) —
not a Trustware contract. Re-quoting can change the selected provider,
which changes the spender; always check allowance against the
to address
from the latest POST /route response.Query parameters
| Parameter | Required | Description |
|---|---|---|
chainId | Yes | EVM chain ID as a string (e.g. "8453" for Base, "1" for Ethereum). |
tokenAddress | Yes | ERC-20 token contract address. |
ownerAddress | Yes | Wallet address whose allowance you are reading. |
spenderAddress | Yes | The spender to check allowance against. For Trustware integrations this is route.execution.transaction.to from the latest POST /route response. |
Request
Response
| Field | Description |
|---|---|
success | true if the call resolved against the chain. |
data.chainId | Chain ID the call was made against. |
data.tokenAddress | Lowercased token contract address. |
data.ownerAddress | Lowercased owner address. |
data.spenderAddress | Lowercased spender address. |
data.allowance | Allowance as a string-encoded uint256 in the token’s smallest unit. The value 2^256 - 1 indicates an “unlimited” approval. |
data.rpcHost | The upstream RPC host Trustware used. Useful for debugging. |
Errors
The endpoint returns{ "success": false, "error": "...", ... } for validation failures (invalid address, unsupported chain) or upstream RPC failures. Inspect the HTTP status code alongside the error payload:
400— Malformed address, unsupported chain, or missing query parameter.429— Rate limit hit; honor theRetry-Afterheader.500/502— Upstream RPC failed after retries.
Compare
allowance to your route’s fromAmount (both in the token’s
smallest unit). If allowance < fromAmount, prompt the user to approve the
spender before broadcasting.