Reference
Error codes
Every stable LayerHop error code with its HTTP status, cause and fix.
Every error response has the same shape. code is stable and safe to branch on; message is for humans and may change.
JSON
{
"error": {
"code": "QUOTE_EXPIRED",
"message": "Quote expired, request a new one",
"requestId": "0d5e1f6a-…",
"docsUrl": "https://docs.layerhop.com/errors/QUOTE_EXPIRED"
}
}The same codes appear per provider in the errors array of a successful quote response. The SDK throws them as LayerHopApiError with code, status and requestId.
All codes#
| Code | HTTP | Meaning |
|---|---|---|
INVALID_PARAMS |
400 |
A required parameter is missing or malformed, or the request is not allowed for this provider. |
UNSUPPORTED_CHAIN |
400 |
The chain id or slug is not in LayerHop's chain registry, or a provider does not serve it. |
UNSUPPORTED_TOKEN |
400 |
A provider does not recognise or will not route the source or destination token. |
AMOUNT_TOO_SMALL |
400 |
The input amount is zero or below the provider's minimum. |
AMOUNT_TOO_LARGE |
400 |
The input amount exceeds what a provider can fill. |
NO_ROUTE |
404 |
No provider supports this route, or every provider that does failed to quote. |
QUOTE_NOT_FOUND |
404 |
The quoteId is unknown to this API instance, or the provider can no longer build it. |
QUOTE_EXPIRED |
410 |
The quote is past its expiresAt and can no longer be built. |
ORDER_NOT_FOUND |
404 |
The provider does not know the order id or transaction hash. |
PROVIDER_ERROR |
502 |
An upstream liquidity provider returned an error or an unusable response. |
PROVIDER_TIMEOUT |
504 |
An upstream provider did not answer in time. |
RATE_LIMITED |
429 |
An upstream provider rate-limited LayerHop. |
UNAUTHORIZED |
401 |
A provider rejected LayerHop's credentials. |
INTERNAL |
500 |
An unexpected error inside LayerHop. |
Codes come from packages/shared/src/errors.ts; this page is generated from it.