# launch:claim-fees — Ammora SDK 0.3.8 Claim the selected fee asset accrued to you as creator or partner. For WETH-denominated launch fees pass WETH, not the launched base token. npm run launch:claim-fees -- [recipient] Creator and partner each sign for their own entitlement in the same FeeVault. An optional payout address changes the destination, never the fee beneficiary. [Read in Docs](https://docs.ammora.org/examples?command=launch%3Aclaim-fees) · [Detailed guide](https://docs.ammora.org/guides/launchpad) · [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 launch:claim-fees -- ` (`tsx src/launch/claim-fees.ts`). Omit `--` and arguments when the source accepts none. ## Entry file: `src/launch/claim-fees.ts` ```typescript /** * Claim the selected fee asset accrued to you as creator or partner. * For WETH-denominated launch fees pass WETH, not the launched base token. * * npm run launch:claim-fees -- [recipient] * * Creator and partner each sign for their own entitlement in the same FeeVault. * An optional payout address changes the destination, never the fee beneficiary. */ import { ammoraLaunchFactoryV4Abi, feeVaultAbi, verifyAmmoraV4CoreAtBlock, } from "@ammora-protocol/sdk"; import { zeroAddress } from "viem"; import { verifyFeePayment } from "../shared/fee-payment.js"; import { printJson } from "../shared/input.js"; import { address, readBlock, reader, signer, v4Deployment } from "../shared/env.js"; import { planOwnFeeClaim } from "./fee-claim-plan.js"; import { amount, main, requireContract, send, tokenInfo, } from "../shared/run.js"; main(async () => { const token = address("AMMORA_FEE_TOKEN", process.argv[2]); const recipientArgument = process.argv[3]; const { wallet, account } = signer(); const client = await reader(); // The factory names its own fee vault, so there is nothing to configure. Creator and // partner fees for every launch it made settle there. const contracts = v4Deployment().contracts.launch; const factory = contracts.factory; const { number: blockNumber } = await readBlock(client); await verifyAmmoraV4CoreAtBlock(client, { configRegistry: contracts.configRegistry, launchFactory: factory, graduationAdapter: contracts.graduationAdapter, feePolicy: contracts.feePolicy, }, blockNumber); const feeVault = await client.readContract({ abi: ammoraLaunchFactoryV4Abi, address: factory, functionName: "feeVault", blockNumber, }) as `0x${string}`; const recipient = recipientArgument ? address("AMMORA_RECIPIENT", recipientArgument) : account.address; if (recipient === zeroAddress || recipient.toLowerCase() === feeVault.toLowerCase()) throw new Error("Payout must be nonzero and outside the fee vault"); await requireContract(client, "fee vault", feeVault); await requireContract(client, "token", token); const info = await tokenInfo(client, token); const owed = await client.readContract({ abi: feeVaultAbi, address: feeVault, functionName: "claimable", args: [token, account.address], blockNumber, }) as bigint; console.log(`fee vault ${feeVault}`); console.log(`beneficiary ${account.address}`); console.log(`owed ${amount(owed, info.decimals, info.symbol)}`); if (owed === 0n) { // Nothing has settled to this wallet for this token, so say so rather than spend gas. console.log("\nnothing owed for this token, no transaction sent"); return; } console.log(`paying to ${recipient}`); const transaction = planOwnFeeClaim(token, account.address, recipient); const hash = await send( "claim V4 launch fees", { to: feeVault, data: transaction.data }, wallet, account, client, ); const payment = await verifyFeePayment(client, { kind: "launch", hash, vault: feeVault, token, beneficiary: account.address, payout: recipient, }); printJson(payment); console.log(`received ${amount(payment.netAmount, info.decimals, info.symbol)}`); }); ``` ## 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/launch/fee-claim-plan.ts](https://docs.ammora.org/examples/source/src/launch/fee-claim-plan.ts.txt) - [src/shared/env.ts](https://docs.ammora.org/examples/source/src/shared/env.ts.txt) - [src/shared/fee-payment.ts](https://docs.ammora.org/examples/source/src/shared/fee-payment.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/launch/config-document.example.json](https://docs.ammora.org/examples/source/src/launch/config-document.example.json.txt) - [src/launch/team/fees.example.json](https://docs.ammora.org/examples/source/src/launch/team/fees.example.json.txt) - [src/launch/team/recipients.example.json](https://docs.ammora.org/examples/source/src/launch/team/recipients.example.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.