Docs/Developers
Relayer API
The endpoint the app uses to submit signed requests.
Request#
The app signs a ForwardRequest in the browser and posts it here. All numbers are sent as strings.
HTTP
POST /api/relay
Content-Type: application/json
{
"request": {
"from": "0xYourAddress",
"to": "0x0382…AE43 (Scarf)",
"value": "0",
"gas": "214000",
"nonce": "7",
"data": "0x…encoded sendMessage(…)"
},
"signature": "0x…EIP-712 signature"
}If gas is "0" or missing, the relayer estimates it and adds 80,000. With a Paymaster configured it calls Paymaster.relay(); otherwise it calls Forwarder.execute() directly and pays the gas itself.
Response#
200 OK
{ "hash": "0x…transaction hash" }The relayer waits for the transaction to be mined before responding.
Errors#
| Status | Body | Cause |
|---|---|---|
| 400 | Invalid JSON | The body isn't valid JSON. |
| 400 | Missing request or signature | from, to, data or the signature is missing. |
| 503 | Relayer not configured (RELAYER_PRIVATE_KEY) | The server has no relayer key. |
| 503 | Forwarder not configured | No Forwarder address is set. |
| 500 | The error message | The transaction reverted, for example a bad signature or an unregistered recipient. |