# portable:claim-source — Ammora SDK 0.3.8 A source-specific positive FeeVault claim with independent ETH/WETH gas budgeting. [Read in Docs](https://docs.ammora.org/examples?command=portable%3Aclaim-source) · [Detailed guide](https://docs.ammora.org/guides/src-portable-readme) · [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 portable:claim-source -- ` (`tsx src/portable/claim-source.ts`). Omit `--` and arguments when the source accepts none. ## Entry file: `src/portable/claim-source.ts` ```typescript /** A source-specific positive FeeVault claim with independent ETH/WETH gas budgeting. */ import { readFile } from "node:fs/promises"; import { verifyAmmoraPortableDeploymentAtBlock, AmmoraPortableLifecyclePlanner, assertAmmoraPortableBlockCanonical, type AmmoraPortableDeployment, type AmmoraPortableLifecycleTargets } from "@ammora-protocol/sdk"; import { address, readBlock, reader } from "../shared/env.js"; import { caller, execute, natural } from "../shared/actions.js"; import { printJson } from "../shared/input.js"; import { main } from "../shared/run.js"; import { requirePortableLifecycleAsset } from "./asset-model.js"; main(async () => { if (!process.argv[2] || !process.argv[3]) throw new Error("Supply reviewed deployment and lifecycle target manifests, curve, source kind and max fee per gas (wei)"); const deployment = JSON.parse(await readFile(process.argv[2], "utf8")) as AmmoraPortableDeployment; requirePortableLifecycleAsset(deployment.nativeAsset); const targets = JSON.parse(await readFile(process.argv[3], "utf8")) as AmmoraPortableLifecycleTargets; const account = caller(), curve = address("CURVE", process.argv[4]), client = await reader(), block = await readBlock(client); const context = await verifyAmmoraPortableDeploymentAtBlock(client, deployment, block.number); const sdk = new AmmoraPortableLifecyclePlanner(context, targets); const sources = await sdk.discoverFeeVaultSources(curve); const source = sources.find(item => item.kind === process.argv[5]); if (!source) throw new Error("Requested source kind was not discovered at this block"); const plan = await sdk.planFeeVaultClaim({ source, account, beneficiary: account, token: deployment.quoteAsset.token, minimumAmountRaw: 1n, gas: { maxFeePerGasNativeRaw: natural(process.argv[6], "max fee per gas", true), safetyMarginBps: 2000n } }); await assertAmmoraPortableBlockCanonical(context); printJson({ claim: plan.claim, gasBudget: plan.gasBudget, asOfBlock: block.number, payoutVerified: false }); await execute("portable-source-claim", { client, caller: account, allowedTargets: [source.source] }, plan.transaction); }); ``` ## 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/portable/asset-model.ts](https://docs.ammora.org/examples/source/src/portable/asset-model.ts.txt) - [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) - [src/portable/fixtures/synthetic-9-6.json](https://docs.ammora.org/examples/source/src/portable/fixtures/synthetic-9-6.json.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.