Skip to content
Docs

Transactions

Broadcast a signed payload

POST /v1/transactions/broadcast submits a signed transaction and returns its hash.

Endpoint

POST/v1/transactions/broadcast

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.

Request
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.

json
{
  "data": {
    "txHash": "0x…",
    "status": "broadcast",
    "ledgerTxId": "ltx_…"
  }
}
FieldRequiredDescription
txHashYesstring | null. The transaction hash, or null when the network did not return one
statusYes"broadcast" when the network accepted the transaction and returned a hash, or "submitted" when it was handed to the network without a hash
ledgerTxIdNoEchoes the linked Ledger API record when you passed one
warningsNostring[]. 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.

json
{
  "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.

json
{
  "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.

CodeHTTPWhen
invalid_argument400Missing or malformed chainId, address, or body fields
plan_chain_denied403chainId is not on the project plan
chain_disabled403Chain turned off in Console › Networks
unsupported_capability400Capability not offered for this chain (e.g. testnet prices)
invalid_argument400Bad intent kind, missing from/to, or malformed signedPayload
unsupported_capability400The chain does not support this operation, such as a gas estimate on a non-EVM chain
simulation_failed400Simulate reported failure (may also return ok: false in data)
tx_unavailable503Preparation, broadcast, or receipt lookup is temporarily unavailable (retryable)
provider_error400Custom-chain RPC returned JSON-RPC error
json
{
  "error": {
    "code": "invalid_argument",
    "message": "Human-readable detail (may be sanitized).",
    "retryable": false
  }
}