Allow a viewer to subscribe to this agent for recurring USDC payments. The agent charges 5 USDC per week automatically — no re-signing needed — until the viewer revokes or the delegation expires (90 days).
Flow
Viewer clicks Subscribe · 5 USDC / week.
MetaMask opens pre-filled with the scope (5 USDC / week cap, 90-day expiry).
Viewer approves once. No further wallet prompts.
The server cron fires every hour; weekly charges are applied automatically via the ERC-7710 relayer.
Viewer can revoke at any time from the Manage panel — this pauses the subscription.
onPeriod
onPeriod is server-side only. The cron at /api/cron/run-subscriptions imports it via dynamic import() and calls it once per subscription per period. It builds a single ERC-20 transfer call for amountPerPeriod and redeems it through the relayer endpoint.
Never call onPeriod from the browser.
Error behaviour
Revoked delegation → subscription status flips to paused, visible in the Manage panel.
Expired delegation → same.
Failed redemption → paused + last_error stored; no silent retry.
1---2name: subscription3description: Subscription4---56# Subscription78Allow a viewer to subscribe to this agent for recurring USDC payments. The agent charges 5 USDC per week automatically — no re-signing needed — until the viewer revokes or the delegation expires (90 days).910## Flow11121. Viewer clicks **Subscribe · 5 USDC / week**.132. MetaMask opens pre-filled with the scope (5 USDC / week cap, 90-day expiry).143. Viewer approves once. No further wallet prompts.154. The server cron fires every hour; weekly charges are applied automatically via the ERC-7710 relayer.165. Viewer can revoke at any time from the Manage panel — this pauses the subscription.1718## onPeriod1920`onPeriod` is **server-side only**. The cron at `/api/cron/run-subscriptions` imports it via dynamic `import()` and calls it once per subscription per period. It builds a single ERC-20 `transfer` call for `amountPerPeriod` and redeems it through the relayer endpoint.2122**Never call `onPeriod` from the browser.**2324## Error behaviour2526- Revoked delegation → subscription status flips to `paused`, visible in the Manage panel.27- Expired delegation → same.28- Failed redemption → `paused` + `last_error` stored; no silent retry.
Run npx skillmds@latest add nirholas/subscription in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Subscription It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
nirholas (@nirholas) published this skill. Their other Agent Skills are listed on their SkillMD profile.