Earned versus claimable, the UI states in between, and how to format the amounts
A rewards panel needs two numbers from two different endpoints, and mixing them up is the most expensive mistake in this integration. This guide covers which is which, every state you need to render, and the formatting trap that makes valid rewards look like zero.
Two Numbers, Two Endpoints
Row in your UI
Field
Endpoint
”Earned so far”
accumulatedRewards
GET /v1/users/{address}/rewards
The claim button
claimable
GET /v1/claims/{campaignId}/{address}
Only claims.get() may drive a claim button.accumulatedRewards tracks live accrual and always runs ahead of what a published merkle root actually covers. A button wired to it over-promises, and the transaction reverts with InvalidProof().
The two numbers differing is normal, not a bug. See How Claiming Works. Show the earned figure as the one that moves; show claimable on the button.
Only campaigns the user has already entered appear here. To surface campaigns they could earn from but have not joined, call campaigns.list with userAddress instead.
import { TbiNotFoundError } from "@boostxyz/tbi-sdk";let proof = null;try { proof = await tbi.claims.get({ chainId: 8453, campaignIndex: 56 }, userAddress);} catch (e) { if (!(e instanceof TbiNotFoundError)) throw e; // 404: no position, no root yet, or claims have closed. See below.}
A 404 here is usually a normal state, not an error. It means either the address has no position in that campaign, or no published root covers its rewards yet. Catch TbiNotFoundError and render an accruing state; surfacing it as a failure produces support tickets for a system working correctly.There is one exception. The endpoint also returns 404 once the campaign’s claims have closed, including for users who never claimed. Claims can only close after the claim deadline, so a 404 past the deadline means closed. Do not show an accruing state there. Gate the copy on the campaign schedule, not on the 404 alone.Past the deadline, a proof can still come back: claims stay open until the creator withdraws. Show the claim button whenever a proof comes back, and show the deadline only until it passes. See Claim Windows.
Check Many Campaigns at Once
When you are rendering a list, one request per campaign is wasteful. claims.statuses batches up to 100 campaign IDs:
Note what is not in that condition: campaign status. Ended campaigns stay claimable, and finalized means everything earned is claimable. Gate on the amount.
Formatting Amounts
import { formatUnits } from "viem";function formatReward(raw: bigint, decimals: number) { const n = Number(formatUnits(raw, decimals)); if (n === 0) return "0"; if (Math.abs(n) < 1) { return n.toLocaleString("en-US", { maximumSignificantDigits: 4 }); } return n.toLocaleString("en-US", { maximumFractionDigits: 4 });}
The < 1 branch is load-bearing. A position opened in the last few hours can hold a reward of around 0.00003 tokens, and a fixed four-decimal format renders that as 0.0000, a valid claimable reward that reads as empty. Switch to significant digits below 1, and keep raw units available in your debug tooling.
Every amount is a bigint, so JSON.stringify throws on these objects. See Data Conventions for the logging and persistence serializers.
Keep Exploring
Claim Rewards
Turn a claimable amount into a confirmed transaction.
How Claiming Works
Why earned and claimable move on different clocks.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Rabbithole","description":"Documentation for Rabbithole: earning on rabbithole.gg, running campaigns, and integrating campaign data and claims into your own product.","colors":{"primary":"#0a9e65","light":"#43e661","dark":"#0a9e65"},"logo":{"light":"https://mintcdn.com/rabbitholegg/EWYGmQeQine82u4p/logo/light.svg?fit=max\u0026auto=format\u0026n=EWYGmQeQine82u4p\u0026q=85\u0026s=448bf8dcbc69b1557d167caa0e43a497","dark":"https://mintcdn.com/rabbitholegg/EWYGmQeQine82u4p/logo/dark.svg?fit=max\u0026auto=format\u0026n=EWYGmQeQine82u4p\u0026q=85\u0026s=cff4d95b8248a9bbea85844969e44fb4","href":"https://app.rabbithole.gg"},"favicon":"https://mintcdn.com/rabbitholegg/W8WNmeUZgs4-kiNB/favicon.svg?fit=max\u0026auto=format\u0026n=W8WNmeUZgs4-kiNB\u0026q=85\u0026s=3781a3fe4ee3db3d6a31d27df929d77f","api":{"playground":{"display":"interactive"}},"navbar":{"links":[{"href":"https://discord.gg/JTCqaekdm","label":"Support"}],"primary":{"type":"button","label":"Open Rabbithole","href":"https://app.rabbithole.gg"}},"footer":{"socials":{"x":"https://x.com/rabbithole_gg","discord":"https://discord.gg/JTCqaekdm","github":"https://github.com/boostxyz"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Open Rabbithole","icon":"rabbit","href":"https://app.rabbithole.gg"},{"anchor":"Discord","icon":"discord","href":"https://discord.gg/JTCqaekdm"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"rabbitholegg","hasAudioNarration":false,"actualSubdomain":"rabbitholegg","customDomains":["docs.rabbithole.gg"],"gitSource":{"type":"github","owner":"boostxyz","repo":"rh-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6af392615bd4a55c13c9ed82","clientVersion":"0.0.4428","searchFilterCounts":[{"language":"default","tag":"Developers","count":20},{"language":"default","tag":"Campaigns","count":17},{"language":"default","tag":"API Reference","count":15},{"language":"default","tag":"Rabbithole","count":7},{"language":"default","tag":"Examples","count":6},{"language":"default","tag":"Run a Campaign","count":5},{"language":"default","tag":"Guides","count":5},{"language":"default","tag":"Overview","count":4},{"language":"default","tag":"Core Concepts","count":4},{"language":"default","tag":"Concepts","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".rh-anim{--rh-accent: #16c784;--rh-accent-subtle: rgba(22, 199, 132, 0.14);--rh-ease: cubic-bezier(0.22, 1, 0.36, 1);--rh-text: #0f172a;--rh-text-2: rgba(15, 23, 42, 0.65);--rh-text-3: rgba(15, 23, 42, 0.42);--rh-border: rgba(15, 23, 42, 0.12);--rh-border-strong: rgba(15, 23, 42, 0.22);--rh-surface: rgba(15, 23, 42, 0.03);--rh-muted-stroke: rgba(15, 23, 42, 0.28);--rh-grid: rgba(15, 23, 42, 0.08);--rh-mono: ui-monospace, \"SF Mono\", Menlo, monospace;color:var(--rh-text);margin:1.5rem 0 2rem}html.dark .rh-anim{--rh-text: #ffffff;--rh-text-2: rgba(255, 255, 255, 0.62);--rh-text-3: rgba(255, 255, 255, 0.4);--rh-border: rgba(255, 255, 255, 0.1);--rh-border-strong: rgba(255, 255, 255, 0.2);--rh-surface: rgba(255, 255, 255, 0.035);--rh-muted-stroke: rgba(255, 255, 255, 0.24);--rh-grid: rgba(255, 255, 255, 0.07)}.rh-anim .rh-label{color:var(--rh-text-2);font-family:var(--rh-mono);font-size:0.6875rem;line-height:1rem;text-transform:uppercase;letter-spacing:0.18em}.rh-anim .rh-label--muted{color:var(--rh-text-3)}.rh-anim .rh-label--positive{color:var(--rh-accent)}.rh-anim .rh-value{color:var(--rh-text);font-family:var(--rh-mono);font-variant-numeric:tabular-nums;font-size:2rem;font-weight:400;line-height:1;letter-spacing:-0.025em}.rh-anim .rh-value--positive{color:var(--rh-accent)}.rh-anim .rh-value--muted{color:var(--rh-text-3)}.rh-anim .rh-body{color:var(--rh-text-2);font-size:0.9375rem;line-height:1.6}.rh-anim [data-reveal=\"pending\"]{opacity:0;transform:translateY(12px)}.rh-anim [data-reveal=\"in\"]{opacity:1;transform:none;transition:opacity 240ms var(--rh-ease), transform 240ms var(--rh-ease);transition-delay:var(--rh-reveal-delay, 0ms)}.rh-anim [data-draw] .gd-line{stroke-dasharray:1;stroke-dashoffset:1}.rh-anim [data-draw=\"on\"] .gd-line,.rh-anim [data-reveal=\"in\"] .gd-line{stroke-dashoffset:0;animation:rhRedraw 6s var(--rh-ease) infinite;animation-delay:var(--gd-stagger, 0s)}@keyframes rhRedraw{0%{stroke-dashoffset:1}55%{stroke-dashoffset:0}100%{stroke-dashoffset:0}}.rh-anim [data-draw] .gd-mark,.rh-anim [data-reveal] .gd-mark{opacity:0;transform:scale(0.4);transform-origin:center;transform-box:fill-box}.rh-anim [data-draw=\"on\"] .gd-mark,.rh-anim [data-reveal=\"in\"] .gd-mark{opacity:1;transform:none;transition:opacity 260ms var(--rh-ease) 620ms, transform 320ms var(--rh-ease) 620ms}@keyframes rhPulse{0%,100%{opacity:1}50%{opacity:0.5}}.rh-anim [data-draw=\"on\"] .gd-pulse{animation:rhPulse 3s ease-in-out infinite 900ms}.rh-anim .rh-modes{display:flex;flex-direction:column;gap:0.75rem}@media (min-width: 768px){.rh-anim .rh-modes{flex-direction:row;gap:1rem}}.rh-anim .rh-mode{display:flex;flex-direction:column;min-width:0;flex-basis:0;text-align:left;padding:1.25rem 1.25rem 1.75rem;border-radius:1rem;border:1px solid var(--rh-border);background:transparent;cursor:pointer;color:inherit;font:inherit;transition:flex-grow 700ms var(--rh-ease), background-color 700ms var(--rh-ease), border-color 700ms var(--rh-ease)}@media (min-width: 768px){.rh-anim .rh-mode{height:288px}}.rh-anim .rh-mode:hover{border-color:var(--rh-border-strong)}.rh-anim .rh-mode[aria-expanded=\"true\"]{border-color:var(--rh-border-strong);background:var(--rh-surface)}.rh-anim .rh-mode__name{font-size:1rem;font-weight:500;color:var(--rh-text-2);transition:color 300ms var(--rh-ease)}.rh-anim .rh-mode:hover .rh-mode__name,.rh-anim .rh-mode[aria-expanded=\"true\"] .rh-mode__name{color:var(--rh-text)}.rh-anim .rh-mode__mechanic{margin-top:0.5rem;font-size:0.875rem;line-height:1.55;color:var(--rh-text-2)}.rh-anim .rh-mode__panel{display:grid;grid-template-rows:0fr;transition:grid-template-rows 700ms var(--rh-ease);pointer-events:none}.rh-anim .rh-mode[aria-expanded=\"true\"] .rh-mode__panel{grid-template-rows:1fr;pointer-events:auto}.rh-anim .rh-mode__panel>div{min-height:0;overflow:hidden}.rh-anim .rh-mode__inner{padding-top:1.5rem;opacity:0;transition:opacity 150ms var(--rh-ease)}.rh-anim .rh-mode[aria-expanded=\"true\"] .rh-mode__inner{opacity:1;transition:opacity 300ms var(--rh-ease) 250ms}.rh-anim .rh-mode__diagram{display:block;width:100%;max-width:220px;height:auto}.rh-anim .rh-mode__detail{display:block;margin-top:1rem;max-width:36ch;font-size:0.875rem;line-height:1.55;color:var(--rh-text-2)}.rh-anim .rh-modes-note{margin-top:1.5rem;font-size:0.875rem;color:var(--rh-text-3)}.rh-anim .rh-timeline{position:relative;display:flex;flex-direction:column;list-style:none;margin:0;padding:0}.rh-anim .rh-timeline__spine,.rh-anim .rh-timeline__fill{position:absolute;left:5px;top:0.5rem;bottom:0.5rem;width:1px}.rh-anim .rh-timeline__spine{background:var(--rh-border-strong)}.rh-anim .rh-timeline__fill{transform-origin:top;background:linear-gradient(to bottom, var(--rh-accent), rgba(22, 199, 132, 0.4))}.rh-anim .rh-step{position:relative;display:flex;gap:1.5rem;padding-bottom:2.25rem;margin:0}.rh-anim .rh-step:last-child{padding-bottom:0}.rh-anim .rh-step__node{position:relative;z-index:1;margin-top:0.375rem;width:11px;height:11px;flex-shrink:0;border-radius:999px;border:1px solid var(--rh-border-strong);background:var(--rh-page-bg, transparent);transform:scale(0.75);transition:transform 300ms var(--rh-ease), border-color 300ms var(--rh-ease), background-color 300ms var(--rh-ease), box-shadow 300ms var(--rh-ease)}.rh-anim .rh-step[data-on=\"true\"] .rh-step__node{transform:scale(1);border-color:var(--rh-accent);background:var(--rh-accent);box-shadow:0 0 0 4px var(--rh-accent-subtle)}.rh-anim .rh-step__body{min-width:0;flex:1;opacity:0.45;transition:opacity 300ms var(--rh-ease)}.rh-anim .rh-step[data-on=\"true\"] .rh-step__body{opacity:1}.rh-anim .rh-step__head{display:flex;flex-wrap:wrap;align-items:baseline;gap:0.25rem 0.75rem}.rh-anim .rh-step__title{margin:0;font-size:1.125rem;font-weight:600;color:var(--rh-text)}.rh-anim .rh-step__text{margin:0.5rem 0 0;max-width:46ch}.rh-anim .rh-step__control{display:block;margin-top:0.5rem}.rh-anim .rh-hud{display:flex;flex-wrap:wrap;align-items:flex-end;gap:1.5rem 2.5rem;margin:0}.rh-anim .rh-hud>div{margin:0}.rh-anim .rh-hud dt,.rh-anim .rh-hud dd{margin:0}.rh-anim .rh-hud dd{margin-top:0.25rem}.rh-anim .rh-chart{position:relative;margin-top:1.5rem;height:280px}@media (min-width: 768px){.rh-anim .rh-chart{height:360px}}.rh-anim .rh-chart svg{position:absolute;inset:0;width:100%;height:100%}.rh-anim .rh-chart__dot{position:absolute;width:9px;height:9px;border-radius:999px;background:var(--rh-accent);box-shadow:0 0 0 8px var(--rh-accent-subtle);transform:translate(-50%, -50%)}.rh-anim .rh-chart__marker{position:absolute;top:0;transform:translateX(-50%);white-space:nowrap}.rh-anim .rh-legend{display:grid;grid-template-columns:1fr;gap:1.5rem;margin-top:2rem}@media (min-width: 768px){.rh-anim .rh-legend{grid-template-columns:1fr 1fr;gap:2.5rem}}.rh-anim .rh-legend__item{display:flex;gap:0.75rem}.rh-anim .rh-legend__swatch{margin-top:0.625rem;height:2px;width:1.5rem;flex-shrink:0;border-radius:999px;background:var(--rh-accent)}.rh-anim .rh-legend__swatch--dashed{background:none;height:0;border-top:2px dashed var(--rh-muted-stroke)}.rh-anim .rh-legend__title{margin:0;font-size:1rem;font-weight:500;color:var(--rh-text)}.rh-anim .rh-legend__text{margin:0.25rem 0 0;max-width:34ch}@media (prefers-reduced-motion: reduce){.rh-anim [data-draw] .gd-line,.rh-anim [data-reveal] .gd-mark,.rh-anim [data-draw] .gd-mark{stroke-dashoffset:0!important;opacity:1!important;transform:none!important;transition:none!important;animation:none!important}}.is-wide~div #content-container{max-width:1000px!important}.is-wide~div #content-area{width:100%!important}.rh-ref{--rh-accent: #16c784;--rh-flame: #f97316;--rh-mono: ui-monospace, \"SF Mono\", Menlo, monospace;--rh-text: #0f172a;--rh-text-2: rgba(15, 23, 42, 0.68);--rh-text-3: rgba(15, 23, 42, 0.45);--rh-rule: rgba(15, 23, 42, 0.16);--rh-rule-soft: rgba(15, 23, 42, 0.08);margin:1.25rem 0 2.5rem}html.dark .rh-ref{--rh-text: #ffffff;--rh-text-2: rgba(255, 255, 255, 0.7);--rh-text-3: rgba(255, 255, 255, 0.45);--rh-rule: rgba(255, 255, 255, 0.16);--rh-rule-soft: rgba(255, 255, 255, 0.08)}.rh-ref table{width:100%;border-collapse:collapse;text-align:left;margin:0;font-size:0.875rem}.rh-ref thead tr{border-bottom:1px solid var(--rh-rule)}.rh-ref th,.rh-ref td{border:0;background:none;vertical-align:top;padding:0.85rem 1.5rem 0.85rem 0}.rh-ref th:last-child,.rh-ref td:last-child{padding-right:0}.rh-ref thead th{color:var(--rh-text-2);font-family:var(--rh-mono);font-size:0.6875rem;line-height:1rem;font-weight:400;text-transform:uppercase;letter-spacing:0.18em;padding-top:0;padding-bottom:0.75rem}.rh-ref tbody tr{border-bottom:1px solid var(--rh-rule-soft)}.rh-ref tbody th{color:var(--rh-text);font-size:1rem;font-weight:500;line-height:1.35;width:24%}.rh-ref tbody td{color:var(--rh-text-2);line-height:1.6}.rh-ref .rh-mono{font-family:var(--rh-mono);font-size:0.8125rem;color:var(--rh-text-2);white-space:nowrap}.rh-ref .rh-tag{font-family:var(--rh-mono);font-size:0.6875rem;line-height:1rem;text-transform:uppercase;letter-spacing:0.16em;white-space:nowrap}.rh-ref .rh-tag--rule{color:var(--rh-flame)}.rh-ref .rh-tag--weight{color:var(--rh-accent)}.rh-ref .rh-tag--report{color:var(--rh-text-3)}.rh-ref .rh-tag--always{color:var(--rh-accent)}.rh-ref .rh-tag--approval{color:var(--rh-text-3)}.rh-ref.rh-ref--pair{display:grid;grid-template-columns:1fr;gap:2.5rem 3.5rem}@media (min-width: 768px){.rh-ref.rh-ref--pair{grid-template-columns:1fr 1fr}}.rh-ref--pair h3{margin:0 0 1rem;color:var(--rh-text-2);font-family:var(--rh-mono);font-size:0.6875rem;font-weight:400;line-height:1rem;text-transform:uppercase;letter-spacing:0.18em}.rh-ref--pair tbody th{font-size:0.9375rem;font-weight:400;width:auto}.rh-ref--pair tbody td{text-align:right;width:1%;white-space:nowrap}.rh-ref .rh-market{padding:0.25rem 0 1.75rem;border-bottom:1px solid var(--rh-rule-soft)}.rh-ref .rh-market:last-child{border-bottom:0}.rh-ref .rh-market h3{margin:1.5rem 0 1rem;color:var(--rh-text);font-size:1.125rem;font-weight:600}.rh-ref .rh-market dl{margin:0;display:grid;gap:0.75rem}.rh-ref .rh-market div{display:grid;grid-template-columns:1fr;gap:0.25rem;margin:0}@media (min-width: 640px){.rh-ref .rh-market div{grid-template-columns:160px 1fr;gap:1.5rem}}.rh-ref .rh-market dt{margin:0;padding-top:0.2rem;color:var(--rh-text-2);font-family:var(--rh-mono);font-size:0.6875rem;line-height:1rem;text-transform:uppercase;letter-spacing:0.18em}.rh-ref .rh-market dd{margin:0;color:var(--rh-text-2);font-size:0.9375rem;line-height:1.6}.rh-ref--markets .rh-market table{margin:0}.rh-ref--markets .rh-market tbody tr{border-bottom:0}.rh-ref--markets .rh-market tbody th{width:160px;padding:0.4rem 1.5rem 0.4rem 0;color:var(--rh-text-2);font-family:var(--rh-mono);font-size:0.6875rem;font-weight:400;line-height:1rem;text-transform:uppercase;letter-spacing:0.18em}.rh-ref--markets .rh-market tbody td{padding:0.4rem 0;font-size:0.9375rem}"}]}
{"page":{"pagePath":"developers/guides/show-user-rewards","slug":"/developers/guides/show-user-rewards","pageMetadata":{"title":"Show User Rewards","description":"Earned versus claimable, the UI states in between, and how to format the amounts","href":"/developers/guides/show-user-rewards"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Earned versus claimable, the UI states in between, and how to format the amounts\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,CodeGroup,Heading,Table,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`A rewards panel needs two numbers from two different endpoints, and mixing them up is the most expensive mistake in this integration. This guide covers which is which, every state you need to render, and the formatting trap that makes valid rewards look like zero.`}),`\n`,_jsx(Heading,{level:`2`,id:`two-numbers-two-endpoints`,children:`Two Numbers, Two Endpoints`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Row in your UI`}),_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Endpoint`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`”Earned so far”`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`accumulatedRewards`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`GET /v1/users/{address}/rewards`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`The claim button`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`claimable`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`GET /v1/claims/{campaignId}/{address}`})})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[`Only `,_jsx(_components.code,{children:`claims.get()`}),` may drive a claim button.`]}),` `,_jsx(_components.code,{children:`accumulatedRewards`}),` tracks live accrual and always runs ahead of what a published merkle root actually covers. A button wired to it over-promises, and the transaction reverts with `,_jsx(_components.code,{children:`InvalidProof()`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[`The two numbers differing is normal, not a bug. See `,_jsx(_components.a,{href:`/developers/concepts/claiming#two-clocks`,children:`How Claiming Works`}),`. Show the earned figure as the one that moves; show claimable on the button.`]}),`\n`,_jsx(Heading,{level:`2`,id:`read-lifetime-earnings`,children:`Read Lifetime Earnings`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`curl`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api-tbi.boost.xyz/v1/users/0xUSER/rewards?chainId=8453\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`7`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` rewards`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` tbi`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`rewards`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forUser`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`userAddress`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` chainId:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 8453`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` status:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"active\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"finalized\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` row`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` rewards`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`find`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`((`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`r`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` r`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`campaignIndex`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 56`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`accumulatedRewards`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// bigint, accrues continuously`})]}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`Only campaigns the user has `,_jsx(_components.strong,{children:`already entered`}),` appear here. To surface campaigns they could earn from but have not joined, call `,_jsx(_components.code,{children:`campaigns.list`}),` with `,_jsx(_components.code,{children:`userAddress`}),` instead.`]}),`\n`,_jsx(Heading,{level:`2`,id:`read-the-claimable-amount`,children:`Read the Claimable Amount`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`curl`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api-tbi.boost.xyz/v1/claims/8453:56/0xUSER`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`9`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`TbiNotFoundError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@boostxyz/tbi-sdk\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`let`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` proof`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` proof`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` tbi`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`claims`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chainId:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 8453`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`campaignIndex:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 56`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`userAddress`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`} `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`e`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` instanceof`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` TbiNotFoundError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // 404: no position, no root yet, or claims have closed. See below.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),`\n`,_jsxs(Warning,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`A 404 here is usually a normal state, not an error.`}),` It means either the address has no position in that campaign, or no published root covers its rewards yet. Catch `,_jsx(_components.code,{children:`TbiNotFoundError`}),` and render an accruing state; surfacing it as a failure produces support tickets for a system working correctly.`]}),_jsxs(_components.p,{children:[`There is one exception. The endpoint also returns 404 once the campaign’s `,_jsx(_components.strong,{children:`claims have closed`}),`, including for users who never claimed. Claims can only close after the claim deadline, so a 404 past the deadline means closed. Do not show an accruing state there. Gate the copy on the campaign schedule, not on the 404 alone.`]}),_jsxs(_components.p,{children:[`Past the deadline, a proof can still come back: claims stay open until the creator withdraws. Show the claim button whenever a proof comes back, and show the deadline only until it passes. See `,_jsx(_components.a,{href:`/developers/concepts/claiming#claim-windows`,children:`Claim Windows`}),`.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`check-many-campaigns-at-once`,children:`Check Many Campaigns at Once`}),`\n`,_jsxs(_components.p,{children:[`When you are rendering a list, one request per campaign is wasteful. `,_jsx(_components.code,{children:`claims.statuses`}),` batches up to `,_jsx(_components.strong,{children:`100 campaign IDs`}),`:`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`curl`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api-tbi.boost.xyz/v1/claims/statuses?userAddress=0xUSER\u0026campaignIds=8453:56\u0026campaignIds=8453:100\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`4`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` statuses`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` tbi`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`claims`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`statuses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`userAddress`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chainId:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 8453`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`campaignIndex:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 56`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chainId:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 8453`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`campaignIndex:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 100`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]);`})}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`Campaigns without a published root report `,_jsx(_components.code,{children:`claimable: 0n`}),` rather than erroring, so there is no 404 to handle on this path.`]}),`\n`,_jsx(Heading,{level:`2`,id:`ui-states`,children:`UI States`}),`\n`,_jsx(_components.p,{children:`Five states cover everything a user can be in:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Condition`}),_jsx(_components.th,{children:`Show`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`No position in the campaign`}),_jsx(_components.td,{children:`Nothing, or a prompt to deposit`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Position exists, `,_jsx(_components.code,{children:`claims.get`}),` returns 404, claim deadline not yet passed`]}),_jsx(_components.td,{children:`”Rewards accruing, claimable after the next distribution”`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`claims.get`}),` returns 404 and the claim deadline has passed`]}),_jsx(_components.td,{children:`”Claims closed”, never an accruing message`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`claimable === 0n`}),` and `,_jsx(_components.code,{children:`accumulatedRewards > 0n`})]}),_jsx(_components.td,{children:`The same accruing message`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`claimable > 0n`}),`, wallet on the wrong chain`]}),_jsx(_components.td,{children:`A button that prompts a switch to the reward chain`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`claimable > 0n`}),`, wallet on the reward chain`]}),_jsx(_components.td,{children:`An active claim button`})]})]})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` canClaim`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` proof`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` null`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` proof`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`claimable`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`n`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` walletChainId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` campaign`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chainId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Note what is `,_jsx(_components.strong,{children:`not`}),` in that condition: campaign status. Ended campaigns stay claimable, and `,_jsx(_components.code,{children:`finalized`}),` means everything earned is claimable. Gate on the amount.`]}),`\n`,_jsx(Heading,{level:`2`,id:`formatting-amounts`,children:`Formatting Amounts`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`formatUnits`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"viem\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` formatReward`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`raw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` bigint`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`decimals`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` number`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` n`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Number`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`formatUnits`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`raw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`decimals`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`n`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Math`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`abs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toLocaleString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"en-US\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`maximumSignificantDigits:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toLocaleString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"en-US\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`maximumFractionDigits:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`\u003c 1`}),` branch is load-bearing. A position opened in the last few hours can hold a reward of around `,_jsx(_components.code,{children:`0.00003`}),` tokens, and a fixed four-decimal format renders that as `,_jsx(_components.code,{children:`0.0000`}),`, a valid claimable reward that reads as empty. Switch to significant digits below 1, and keep raw units available in your debug tooling.`]})}),`\n`,_jsxs(_components.p,{children:[`Every amount is a `,_jsx(_components.code,{children:`bigint`}),`, so `,_jsx(_components.code,{children:`JSON.stringify`}),` throws on these objects. See `,_jsx(_components.a,{href:`/developers/concepts/data-conventions#every-amount-is-a-bigint`,children:`Data Conventions`}),` for the logging and persistence serializers.`]}),`\n`,_jsx(Heading,{level:`2`,id:`keep-exploring`,children:`Keep Exploring`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Claim Rewards`,href:`/developers/guides/claim-rewards`,children:_jsx(_components.p,{children:`Turn a claimable amount into a confirmed transaction.`})}),_jsx(Card,{title:`How Claiming Works`,href:`/developers/concepts/claiming`,children:_jsx(_components.p,{children:`Why earned and claimable move on different clocks.`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Show User Rewards","description":"Earned versus claimable, the UI states in between, and how to format the amounts","href":"/developers/guides/show-user-rewards"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Two Numbers, Two Endpoints","slug":"two-numbers-two-endpoints","depth":2,"children":[]},{"title":"Read Lifetime Earnings","slug":"read-lifetime-earnings","depth":2,"children":[]},{"title":"Read the Claimable Amount","slug":"read-the-claimable-amount","depth":2,"children":[]},{"title":"Check Many Campaigns at Once","slug":"check-many-campaigns-at-once","depth":2,"children":[]},{"title":"UI States","slug":"ui-states","depth":2,"children":[]},{"title":"Formatting Amounts","slug":"formatting-amounts","depth":2,"children":[]},{"title":"Keep Exploring","slug":"keep-exploring","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"rabbitholegg","siteName":"Rabbithole","title":"Show User Rewards - Rabbithole","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-10T21:53:41.763Z","originalFileLocation":"developers/guides/show-user-rewards.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Earned versus claimable, the UI states in between, and how to format the amounts\">\u003cmeta data-mint-head name=\"application-name\" content=\"Rabbithole\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/rabbitholegg/VVAV4vZMVKiY9V-B/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/rabbitholegg/VVAV4vZMVKiY9V-B/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/rabbitholegg/VVAV4vZMVKiY9V-B/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/rabbitholegg/VVAV4vZMVKiY9V-B/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/rabbitholegg/VVAV4vZMVKiY9V-B/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/rabbitholegg/VVAV4vZMVKiY9V-B/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/rabbitholegg/VVAV4vZMVKiY9V-B/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/rabbitholegg/VVAV4vZMVKiY9V-B/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/rabbitholegg/VVAV4vZMVKiY9V-B/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Show User Rewards - Rabbithole\">\u003cmeta data-mint-head property=\"og:description\" content=\"Earned versus claimable, the UI states in between, and how to format the amounts\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Rabbithole\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.rabbithole.gg/developers/guides/show-user-rewards\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://rabbitholegg.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Show+User+Rewards\u0026amp;description=Earned+versus+claimable%2C+the+UI+states+in+between%2C+and+how+to+format+the+amounts\u0026amp;theme=e67618a328b360540abaf021\u0026amp;signature=4cd0cf358c9679229afc5384a0a2cb9f387e2718c359ff27c31fbd958c281260\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Show User Rewards - Rabbithole\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Earned versus claimable, the UI states in between, and how to format the amounts\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://rabbitholegg.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Show+User+Rewards\u0026amp;description=Earned+versus+claimable%2C+the+UI+states+in+between%2C+and+how+to+format+the+amounts\u0026amp;theme=e67618a328b360540abaf021\u0026amp;signature=4cd0cf358c9679229afc5384a0a2cb9f387e2718c359ff27c31fbd958c281260\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/rabbitholegg/VVAV4vZMVKiY9V-B/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Rabbithole\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0a9e65\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.rabbithole.gg/developers/guides/show-user-rewards\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/developers/guides/show-user-rewards.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.rabbithole.gg/#organization\",\"name\":\"Rabbithole\",\"url\":\"https://docs.rabbithole.gg\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/rabbitholegg/EWYGmQeQine82u4p/logo/light.svg?fit=max\u0026auto=format\u0026n=EWYGmQeQine82u4p\u0026q=85\u0026s=448bf8dcbc69b1557d167caa0e43a497\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.rabbithole.gg#website\",\"name\":\"Rabbithole\",\"url\":\"https://docs.rabbithole.gg\",\"publisher\":{\"@id\":\"https://docs.rabbithole.gg/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.rabbithole.gg/developers/guides/show-user-rewards#webpage\",\"url\":\"https://docs.rabbithole.gg/developers/guides/show-user-rewards\",\"name\":\"Show User Rewards\",\"description\":\"Earned versus claimable, the UI states in between, and how to format the amounts\",\"dateModified\":\"2026-11-10T21:53:41.763Z\",\"isPartOf\":{\"@id\":\"https://docs.rabbithole.gg#website\"},\"breadcrumb\":{\"@id\":\"https://docs.rabbithole.gg/developers/guides/show-user-rewards#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.rabbithole.gg/developers/guides/show-user-rewards#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://docs.rabbithole.gg/developers/guides/display-campaign-stats\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Show User Rewards\",\"item\":\"https://docs.rabbithole.gg/developers/guides/show-user-rewards\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.rabbithole.gg/developers/guides/show-user-rewards#article\",\"headline\":\"Show User Rewards\",\"name\":\"Show User Rewards\",\"description\":\"Earned versus claimable, the UI states in between, and how to format the amounts\",\"url\":\"https://docs.rabbithole.gg/developers/guides/show-user-rewards\",\"mainEntityOfPage\":{\"@id\":\"https://docs.rabbithole.gg/developers/guides/show-user-rewards#webpage\"},\"dateModified\":\"2026-11-10T21:53:41.763Z\",\"publisher\":{\"@id\":\"https://docs.rabbithole.gg/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.rabbithole.gg#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Rabbithole\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Rabbithole\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/developers/guides/show-user-rewards.md","siteName":"Rabbithole","nav":{"global":{"anchors":[{"anchor":"Open Rabbithole","icon":"rabbit","href":"https://app.rabbithole.gg"},{"anchor":"Discord","icon":"discord","href":"https://discord.gg/JTCqaekdm"}]},"tabs":[{"tab":"Rabbithole","pages":[{"title":"Rabbithole","href":"/rabbithole/introduction"}]},{"tab":"Campaigns","pages":[{"title":"Campaigns","href":"/campaigns/introduction"}]},{"tab":"Developers","groups":[{"group":"Get Started","pages":[{"title":"Developer Overview","href":"/developers/overview"},{"title":"Quickstart","href":"/developers/quickstart"}]},{"group":"Examples","pages":[{"title":"Project Setup","href":"/developers/examples/setup"},{"title":"Reward Badge","href":"/developers/examples/reward-badge"},{"title":"Opportunities List","href":"/developers/examples/opportunities-list"},{"title":"Rewards Panel","href":"/developers/examples/rewards-panel"},{"title":"Claim Button","href":"/developers/examples/claim-button"},{"title":"Recipes","href":"/developers/examples/recipes"}]},{"group":"Concepts","pages":[{"title":"Campaigns, IDs, and Chains","href":"/developers/concepts/campaigns"},{"title":"How Claiming Works","href":"/developers/concepts/claiming"},{"title":"Data Conventions","href":"/developers/concepts/data-conventions"},{"title":"How Referrals Work","href":"/developers/concepts/referrals"}]},{"group":"Guides","pages":[{"title":"Display Campaign Stats","description":"Show a live reward APR, TVL, and participant count next to your pool or vault","href":"/developers/guides/display-campaign-stats"},{"title":"Show User Rewards","href":"/developers/guides/show-user-rewards"},{"title":"Claim Rewards","description":"Submit the claim from your own UI, with viem or from any stack using raw calldata","href":"/developers/guides/claim-rewards"},{"title":"Forwarder Deposits","href":"/developers/guides/forwarder-deposits"},{"title":"Add Referrals","href":"/developers/guides/referrals"}]},{"group":"Reference","pages":[{"title":"TypeScript SDK","href":"/developers/sdk"},{"title":"Contracts","href":"/developers/contracts"},{"title":"Errors","href":"/developers/errors"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]}]},"basePath":"","title":"Show User Rewards - Rabbithole","deploymentId":"dpl_4dgnk6TA5fUgboKHTvWWyeqm3idh","buildId":"dpl_4dgnk6TA5fUgboKHTvWWyeqm3idh","dynamics":[],"chunks":[]}