# fees:batch-claim — Ammora SDK 0.3.8 fees:batch-claim -- [new-progress.json]. Sequential own/delegated claims. [Read in Docs](https://docs.ammora.org/examples?command=fees%3Abatch-claim) · [Detailed guide](https://docs.ammora.org/guides/fee-sharing) · [Local setup](https://docs.ammora.org/guides/example-setup) ## Context and execution GIWA Sepolia 91342. Public SDK 0.3.8, Math 0.3.0. Source revision: `a9b3fd798fa51495e8defec99a25de59e4d70672`. Install the SDK in your app, or prepare the example project using the local setup guide for its npm commands. Review the entry source and guide for required arguments, roles and deployment selection. `AMMORA_SEND=0` does not turn send-only commands into previews. Never put CLI keys in a browser or resend an uncertain transaction. Command: `npm run fees:batch-claim -- ` (`tsx src/fees/batch-claim.ts`). Omit `--` and arguments when the source accepts none. ## Entry file: `src/fees/batch-claim.ts` ```typescript /** fees:batch-claim -- [new-progress.json]. Sequential own/delegated claims. */ import { buildClaimFeeVaultFor } from "@ammora-protocol/sdk"; import { feeVaultContext } from "./context.js"; import { document, feeRequests } from "./policy.js"; import { tokenCredit } from "./token-credit.js"; import { executeBatch } from "../shared/batch-execution.js"; import { main } from "../shared/run.js"; import { printJson } from "../shared/input.js"; main(async () => { const requests = feeRequests(document(process.argv[2])); const prepared = []; for (const request of requests) { const c = await feeVaultContext(request.vault); if (request.beneficiary.toLowerCase() !== c.caller.toLowerCase() && !await c.client.readContract({ address: c.vault, abi: c.abi, functionName: "claimDelegate", args: [request.beneficiary, c.caller] })) throw new Error("Caller lacks beneficiary delegation"); const amount = await c.client.readContract({ address: c.vault, abi: c.abi, functionName: "claimable", args: [request.token, request.beneficiary] }); if (amount === 0n) { printJson({ skipped: request, reason: "ZERO_FEE_NO_PAYMENT" }); continue; } prepared.push({ c, request, transaction: { to: c.vault, ...buildClaimFeeVaultFor(request.token, request.beneficiary, request.payout) } }); } if (!prepared.length) return; const c = { ...prepared[0]!.c, allowedTargets: prepared.map(p => p.c.vault) }; const hashes = await executeBatch(c, prepared.map(p => p.transaction), process.argv[3]); for (let i=0; i