Blocks are produced every ~5 seconds. Every cadence on this page derives from that. A
UI that polls every second just burns four requests waiting for a round that has not
happened yet.
Pick the right mechanism
1. WebSocket — newHeads
number, hash, parentHash,
timestamp, stateRoot, gasUsed, baseFeePerGas, miner, transactions, plus a
YouthChain extra, ycCommitSigners (the validator indices whose signatures committed the
block).
Unsubscribe with eth_unsubscribe and the id you were given. Reconnect on close: a dropped
socket loses every subscription, and the app must re-subscribe and backfill the blocks it
missed via eth_getBlockByNumber.
2. Polling a receipt
For “did my transaction land”, polling the receipt is simpler than a subscription and costs one request per block:3. Async REST endpoints
Some REST endpoints do several transactions and answer before they settle. They return202 Accepted with the hashes and a pollUrl.
Faucet
pollUrl until nativeBalance is non-zero:
The faucet used to hold the connection until all three receipts existed, which took ~40 s
and exceeded the default timeout of most HTTP clients — a working faucet looked broken.
If you have an older client that treats a slow response as failure, it can be simplified:
the answer is immediate now.
Engagement
POST /api/mobile/engagement returns a txHash right away with status: "pending". The
reward is visible once the block is committed:
Idempotency-Key header so a network retry replays the original response instead of
recording the action twice — mobile networks retry on their own, and a double like is a
double mint.
Cadence cheat sheet
Prefer one
newHeads subscription per app over N polling loops: one socket tells every
screen that the chain moved, and each screen refetches only what it shows.