Skip to content

feat(write): claim-emissions command (#5 sub-task 8/13)#20

Merged
anajuliabit merged 1 commit intomainfrom
feat/claim-emissions
May 6, 2026
Merged

feat(write): claim-emissions command (#5 sub-task 8/13)#20
anajuliabit merged 1 commit intomainfrom
feat/claim-emissions

Conversation

@anajuliabit
Copy link
Copy Markdown
Collaborator

Claims a pod's emissions for a given epoch.

Network split: the V2 testnet ABI is leaner — hasPodOwnerClaimedEmissions and getPodEmissionsOfEpoch only exist on the V1 mainnet ABI. So:

  • mainnet pre-flight: NOT_POD_OWNER + ALREADY_CLAIMED + NO_EMISSIONS_DUE
  • testnet pre-flight: NOT_POD_OWNER only — caller bears the cost of a doomed re-claim if they're already-claimed for that epoch

Both networks share ownerOf and claimPodOwnerEmissions, so the actual write call is the same.

Output: { txHash, podId, epoch, amountClaimed: {raw, formatted} | {unavailable}, block, basescanUrl }. amountClaimed is {unavailable} on testnet (no on-chain way to know without the missing view). Two-phase write, args fingerprint { podId, epoch }.

🤖 Generated with Claude Code

@anajuliabit anajuliabit force-pushed the feat/claim-emissions branch 4 times, most recently from 731e185 to 53a7728 Compare May 6, 2026 00:13
Claims a pod's emissions for a given epoch. Both networks supported,
with caveats: testnet ABI is leaner so claim-status / amount-due
checks only run on mainnet.

Pre-flight (mainnet): NOT_POD_OWNER, ALREADY_CLAIMED, NO_EMISSIONS_DUE.
Pre-flight (testnet): NOT_POD_OWNER only — caller bears the cost of a
doomed re-claim if they're already-claimed for that epoch (testnet
ABI lacks hasPodOwnerClaimedEmissions / getPodEmissionsOfEpoch).

Args fingerprint: { podId, epoch }.
Output: { txHash, podId, epoch, amountClaimed, block, basescanUrl } —
amountClaimed is { unavailable } on testnet.

Pipeline green.
@anajuliabit anajuliabit force-pushed the feat/claim-emissions branch from 53a7728 to 655de6f Compare May 6, 2026 00:14
@anajuliabit anajuliabit merged commit 7abab41 into main May 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant