Fee staking integration
Stake, cooldown, claim, and fund with receipt sync.
After graduation, creators can deploy a staking pool and fund ETH rewards. Holders stake the launch token. API routes sync receipts after on-chain calls.
tsstake.ts
import { parseAbi } from "viem";
const poolAbi = parseAbi([
"function stake(uint256 amount)",
"function requestUnstake(uint256 amount)",
"function withdraw()",
"function claim()",
"function fund() payable",
"function earned(address account) view returns (uint256)",
]);
await walletClient.writeContract({
address: poolAddress,
abi: poolAbi,
functionName: "stake",
args: [amount],
});bashstaking-sync.sh
curl -sS -X POST "${API_URL}/staking/stake" \
-H "authorization: Bearer $JWT" \
-H "content-type: application/json" \
-d '{"pool":"0xPool","txHash":"0x…","amount":"1000000000000000000"}'
curl -sS "${API_URL}/tokens/0xToken/staking" -H "authorization: Bearer $JWT"Product guide: Fee staking.