# merkle:claim — Ammora SDK 0.3.8 First claim requires the distributor's independently obtained Merkle proof. [Read in Docs](https://docs.ammora.org/examples?command=merkle%3Aclaim) · [Detailed guide](https://docs.ammora.org/guides/docs-contract-features) · [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 merkle:claim -- ` (`tsx src/merkle/claim.ts`). Omit `--` and arguments when the source accepts none. ## Entry file: `src/merkle/claim.ts` ```typescript /** First claim requires the distributor's independently obtained Merkle proof. */ import { buildNewAmmoraMerkleDistributorClaim } from "@ammora-protocol/sdk"; import type { Hex } from "viem"; import { pinned, natural, execute } from "../shared/actions.js"; import { main } from "../shared/run.js"; main(async () => { const unlocked = natural(process.argv[3], "unlockedRaw"), locked = natural(process.argv[4], "lockedRaw"); if (unlocked + locked === 0n) throw new Error("Claim amount must be positive"); const proof = process.argv[5] === "empty" ? [] : (process.argv[5] ?? "").split(","); if (proof.some(p => !/^0x[0-9a-fA-F]{64}$/.test(p))) throw new Error("Every proof sibling must be bytes32"); const c = await pinned(process.argv[2]); await execute("Merkle allocation claim", c, { to: c.target, ...buildNewAmmoraMerkleDistributorClaim(unlocked, locked, proof as Hex[]) }); }); ``` ## Supporting files Keep relative paths intact. Local imports are listed recursively; JSON templates are choices to review, not approved inputs. Runtime-selected files and wallet/environment setup still follow the detailed guide. - [src/shared/actions.ts](https://docs.ammora.org/examples/source/src/shared/actions.ts.txt) - [src/shared/env.ts](https://docs.ammora.org/examples/source/src/shared/env.ts.txt) - [src/shared/input.ts](https://docs.ammora.org/examples/source/src/shared/input.ts.txt) - [src/shared/retry.ts](https://docs.ammora.org/examples/source/src/shared/retry.ts.txt) - [src/shared/rpc.ts](https://docs.ammora.org/examples/source/src/shared/rpc.ts.txt) - [src/shared/run.ts](https://docs.ammora.org/examples/source/src/shared/run.ts.txt) - [package.json](https://docs.ammora.org/examples/source/package.json.txt) - [package-lock.json](https://docs.ammora.org/examples/source/package-lock.json.txt) - [tsconfig.json](https://docs.ammora.org/examples/source/tsconfig.json.txt) - [.env.giwa.example](https://docs.ammora.org/examples/source/file.env.giwa.example.txt) - [.nvmrc](https://docs.ammora.org/examples/source/file.nvmrc.txt) ## AI implementation checklist Use the actual SDK exports and parameter types in the linked files. Start with reads and unsigned plans where supported. Use a connected wallet for browser signing. Preserve raw integer units, exact approvals, caller authority, deadlines and receipt reconciliation. Report local checks separately from live-chain verification.