Transactions
Broadcast a signed payload
POST /v1/transactions/broadcast submits a signed transaction and returns its hash.
Endpoint
Send chainId and the signedPayload from the device. Optional fields are ledgerTxId to link a Ledger API record, and txHash (64 hexadecimal characters without 0x) for chains where the wallet computes the hash itself: Gram (TON) and Monero.
curl -sS -X POST "https://blockchain.gray3.io/v1/transactions/broadcast" \
-H "X-Gray-Project-Id: proj_your_project_id" \
-H "Authorization: Bearer gray_sk_your_secret" \
-H "Content-Type: application/json" \
-d '{
"chainId": "ethereum-sepolia",
"signedPayload": "0x…",
"kind": "transfer",
"from": "0xYourAddress",
"to": "0xRecipient",
"value": "1000000000000000000"
}'Response
HTTP 200 — success envelope wraps the payload in data.
{
"data": {
"txHash": "0x…",
"status": "broadcast",
"ledgerTxId": "ltx_…"
}
}| Field | Required | Description |
|---|---|---|
| txHash | Yes | string | null. The transaction hash, or null when the network did not return one |
| status | Yes | "broadcast" when the network accepted the transaction and returned a hash, or "submitted" when it was handed to the network without a hash |
| ledgerTxId | No | Echoes the linked Ledger API record when you passed one |
| warnings | No | string[]. For example "ledger_write_failed" |
Submitted without a hash
Gram (TON) and Monero can return status: "submitted" with txHash: null when the request has no txHash. Treat the transaction as sent, do not broadcast it again, and confirm it by refreshing activity for the sending address. For both chains the wallet computes the hash locally (the Gram client SDK returns it from signing); pass it in the optional txHash body field (64 hexadecimal characters, no 0x prefix) so the response is broadcast with that hash and it is recorded on any linked Ledger API record.
HTTP 200 — success envelope wraps the payload in data.
{
"data": {
"txHash": null,
"status": "submitted"
}
}Warnings
The response may include a warnings array. The value ledger_write_failed means the transaction was broadcast successfully but the linked Ledger API record could not be updated. Do not broadcast again. Update the record yourself with PATCH /v1/transactions/{id} on the Ledger API.
HTTP 200 — success envelope wraps the payload in data.
{
"data": {
"txHash": "0x…",
"status": "broadcast",
"ledgerTxId": "ltx_…",
"warnings": ["ledger_write_failed"]
}
}Errors
Errors use HTTP { "error": { "code", "message", "retryable" } }. Branch on code, not the message text.
Every authenticated route may also return unauthorized (401), revoked_secret (401), forbidden (403), credits_exhausted (402), plan_feature_denied (403), rate_limit_exceeded (429, retryable), and invalid_argument (413) for request bodies over 256 KiB.
| Code | HTTP | When |
|---|---|---|
| invalid_argument | 400 | Missing or malformed chainId, address, or body fields |
| plan_chain_denied | 403 | chainId is not on the project plan |
| chain_disabled | 403 | Chain turned off in Console › Networks |
| unsupported_capability | 400 | Capability not offered for this chain (e.g. testnet prices) |
| invalid_argument | 400 | Bad intent kind, missing from/to, or malformed signedPayload |
| unsupported_capability | 400 | The chain does not support this operation, such as a gas estimate on a non-EVM chain |
| simulation_failed | 400 | Simulate reported failure (may also return ok: false in data) |
| tx_unavailable | 503 | Preparation, broadcast, or receipt lookup is temporarily unavailable (retryable) |
| provider_error | 400 | Custom-chain RPC returned JSON-RPC error |
{
"error": {
"code": "invalid_argument",
"message": "Human-readable detail (may be sanitized).",
"retryable": false
}
}