YCRRewards ERC-20 balance, without the user paying gas. The indexer calls YCRRewards.claimFor(user, activeActionTypes) from the authorized oracle wallet.
Request
Fields
string
required
User’s address. Must have accrued pending YCR (see
/api/mobile/rewards/:address).integer
default:"7"
Bitmask of action types to claim.
0xff (255) claims all 7 action types. Defaults
to 7 which covers the first 3 types only; pass 255 to claim everything.Response — 200 OK
eth_getTransactionReceipt for confirmation. After confirmation, the YCR moves
from pendingOf(user) into balanceOf(user) on the YCR ERC-20 contract.
Empty-claim guard. The endpoint reads
YCRRewards.pendingOf(address) before submitting.
If it’s 0 the call returns 400 { error: { code: "NOTHING_TO_CLAIM" }, pendingYcr: "0" }
and no transaction is sent — so a claim with nothing pending never reverts on-chain or
wastes relayer gas. Check pendingYcr via /rewards/:address
before offering a claim.Example
On-chain effect
0x1a64…14f1) is authorized as a setMinter on YCR. It calls
claimFor(user, activeActionTypes) which sweeps the pending into the user’s balance
and emits Claim(user, amount).