getClaimHistory
Fetch the signed-in user’s claim history — their past pool-reward claims, newest first. The authed, per-user read behind a “your claims” panel and the natural companion to claimProfit.
import { getClaimHistory } from "@symmio/trading-core";
const page = await getClaimHistory(config, {
accessToken: token.accessToken,
tokenContractAddress: "0xToken…", // optional — omit for every pool
size: 25,
});The endpoint is authed and scoped to the caller — it only ever returns claims the user owns — so the optional filters narrow within that set. Pagination is path-based (/{start}/{size}); count is the total across all pages, so it is what a pager should divide, not items.length.
This is a REST read against the listing backend, not a contract call, and it is authed: the accessToken from
authenticateListing is sent as an Authorization: Bearer <token> header. The backend is
resolved from the config before the request, so a target without Pools fails immediately and without any network
traffic — see resolveListingService.
No solver id
Pool listing is chain-level — one listing backend is served per chain — so getClaimHistory takes only an optional chainId and no solverId. Pass a chainId to target a specific deployment’s listing backend; omit it to use the config’s default chain.
Parameters
accessTokenstringrequiredBearer token from authenticateListing. Sent as Authorization: Bearer <token>. A bad
or expired token yields a 401 (see Throws).
tokenContractAddressstringoptionalNarrow to one pool by its token contract address. Omit for the user’s claims across every pool.
accountAddressstringoptionalNarrow to claims credited to one sub-account. Omit for the user’s claims across all of their sub-accounts.
startnumberoptionalRow offset. Defaults to 0.
sizenumberoptionalPage size. Defaults to 150.
chainIdnumberoptionalTarget chain id. Defaults to the config’s defaultChainId. Selects which chain’s listing backend is used. There is
no solverId — listing is resolved at chain level.
Returns
Promise<PoolClaimHistoryPage>One page of the user’s claims. count is the total across all pages (what a pager divides); items is the page’s
PoolClaim rows, newest first. Each row carries claimRequestId, the accountAddress that received the USDC, the
amount (18-decimal bigint USD), the transactionHash (or null), and the time (Unix seconds).
Query options
import { getClaimHistoryQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getClaimHistoryQueryOptions(config, { accessToken, tokenContractAddress: "0xToken…" }));getClaimHistoryQueryOptions(config, options) returns a TanStack options bag with a stable queryKey, the queryFn, and enabled. The bearer accessToken is dropped from the key — it is a credential, not a cache dimension.
Throws
LISTING_NOT_CONFIGURED— aSymmError(kind: "config") when the chain has nolistingbackend configured. Gate withsupportsListingServiceto hide the claim history instead of erroring.FETCH_CLAIM_HISTORY_FAILED— the request itself failed. Any axios failure becomes aSymmApiErrorcarryingstatus,statusText,responseData,urlandmethod; a non-axios throw becomes a plainSymmError(kind: "api"). A401means theaccessTokenwas missing, malformed, or expired — re-runauthenticateListingand retry.
Related
claimProfit— the write this history records.getUserProfit— the current claimable/claimed balances.- Listing auth — mints the
accessTokenthis read requires. useClaimHistory— the React hook.- Pools — the slice overview.