# MUSEGOD docs: Claim your rewards

## Claim your rewards

Rewards sit in the distributor until they are claimed, and they never expire. Claiming is one transaction with no arguments. It costs a little ETH for gas on Robinhood Chain and nothing else.

The easiest way for a person is the rewards check on [musegod.org](https://musegod.org/rewards). The rest of this page is for agents, scripts and anyone who wants to do it by hand.

### 1. See what's waiting

```sh
curl -s "https://musegod.org/api/v1/rewards?q=0xYourWallet"
```

`earned` is what the wallet can claim now, in wei. `claim.ready` is true when it's above zero. The same number is onchain as `earned(address)`:

```sh
cast call 0xaAFC482D0757a705C8F3c41f375c1D79832D8975 "earned(address)(uint256)" 0xYourWallet --rpc-url https://rpc.mainnet.chain.robinhood.com
```

### 2. Send the claim

The answer carries the transaction, ready to sign:

```json
"claim": {
  "ready": true,
  "tx": { "chainId": 4663, "to": "0xaAFC482D0757a705C8F3c41f375c1D79832D8975", "data": "0x4e71d92d", "value": "0" },
  "forTx": { "chainId": 4663, "to": "0xaAFC482D0757a705C8F3c41f375c1D79832D8975", "data": "0xddeae033…", "value": "0" }
}
```

- `tx` is `claim()`. Send it from the holder's own wallet and the rewards go to that wallet.
- `forTx` is `claimFor(holder)`. Any wallet may send it, and the rewards still go to the holder, never to the sender. This lets an agent with its own gas wallet deliver a holder's rewards without touching their keys. It only works when the holder is a wallet, not a contract.

With Foundry:

```sh
cast send 0xaAFC482D0757a705C8F3c41f375c1D79832D8975 "claim()" --rpc-url https://rpc.mainnet.chain.robinhood.com --account holder
cast send 0xaAFC482D0757a705C8F3c41f375c1D79832D8975 "claimFor(address)" 0xHolder --rpc-url https://rpc.mainnet.chain.robinhood.com --account agent
```

With viem:

```js
import { createWalletClient, defineChain, http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'

const robinhood = defineChain({
  id: 4663,
  name: 'Robinhood Chain',
  nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
  rpcUrls: { default: { http: ['https://rpc.mainnet.chain.robinhood.com'] } },
})
const account = privateKeyToAccount(process.env.PRIVATE_KEY)
const wallet = createWalletClient({ account, chain: robinhood, transport: http() })

const r = await fetch(`https://musegod.org/api/v1/rewards?q=${account.address}`).then((r) => r.json())
if (r.claim.ready) {
  const hash = await wallet.sendTransaction({ to: r.claim.tx.to, data: r.claim.tx.data })
  console.log(`claimed: https://musegod.org/c/${hash}`)
}
```

### 3. Share it

Every claim gets its own card at `https://musegod.org/c/<tx hash>`. Post that link and X, Discord and Telegram show the amount on a card. See [Share](#share).

### When it reverts

| Error | Why |
| --- | --- |
| `NothingToClaim` | `earned` is zero. Hold, wait for the stream, try later. |
| `ExcludedAccount` | The address is excluded from rewards (the pool and the distributor itself). |
| `ClaimForContractNotAllowed` | `claimFor` was sent for a contract. A contract must call `claim()` itself. |

Simulate first with `eth_call` or `cast call` and nothing is spent on a claim that would fail.
