Skip to content

feat(sdk): developer-NFT read/claim actions + nonce coercion fix - #195

Merged
MuncleUscles merged 2 commits into
v2-devfrom
feat/developer-nft-actions-v2dev
Jul 7, 2026
Merged

MuncleUscles merged 2 commits into
v2-devfrom
feat/developer-nft-actions-v2dev

Conversation

@MuncleUscles

Copy link
Copy Markdown
Member

Adds SDK support for the developer NFT reward mechanism so libraries — and the tooling e2e suite — can read and claim developer rewards, plus a nonce-serialization fix uncovered while building it.

Developer NFT actions (src/contracts/actions.ts, src/abi/nftMinter.ts)

  • getDeveloperNft({ developer }) → DeveloperNft | null (nftId, developer, claimableRewards, lastClaimedEpoch, ghosts)
  • getClaimableRewardsFromFees({ nftId }) → bigint
  • getClaimableRewardsFromInflation({ nftId, numberOfEpochsToClaim }) → bigint
  • claimNftRewards({ nftId }) / claimNftEpochs({ nftId, numberOfEpochsToClaim })
  • NFTMinter address resolved automatically via the on-chain AddressManager.

Verified end-to-end against a live dev-env stack — the developer-NFT accuracy e2e (055_developer_nft_rewards) reconciles these views to the wei against on-chain fee events and the epoch inflation formula.

Nonce fix (src/accounts/actions.ts)

getCurrentNonce returned the RPC's hex quantity string while the declared return type (and callers) expect a number. On the local-account signing path the raw string flowed into viem's transaction serializer, which encoded the ASCII characters as the nonce bytes — producing an unmineable transaction and an infinite receipt wait. This bit any local-account consensus call (appeals, top-ups) on network backends; the fix coerces to Number.

Tests

npm test (typecheck + vitest): 89 passing. Build clean.

Draft. Cherry-picked cleanly onto current v2-dev (the callkey-sentinel commit this was originally stacked on is already merged via #190).

Expose the on-chain developer-NFT reward flow: getDeveloperNft,
getClaimableRewardsFromFees, getClaimableRewardsFromInflation, claimNft
rewards/epochs. NFTMinter ABI + AddressManager-based address resolution.
Mirrors existing action patterns; unit tests added. (Codex-generated;
build + 90 tests green. Base is fix/callkey-wildcard-sentinel — rebase onto
v2-dev before PR.)
getCurrentNonce returned the RPC's hex quantity string while the declared
return type (and callers) expect a number. On the local-account signing path
the raw string flows into viem's transaction serializer, which encodes the
ASCII characters as the nonce bytes — producing an unmineable transaction and
an infinite receipt wait. Affects any local-account consensus call (appeals,
top-ups) on network backends.
@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 662f86e2-95d1-4dde-933f-4a2bef07bad4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/developer-nft-actions-v2dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MuncleUscles
MuncleUscles marked this pull request as ready for review July 6, 2026 16:52
@MuncleUscles

Copy link
Copy Markdown
Member Author

/run-e2e

1 similar comment
@MuncleUscles

Copy link
Copy Markdown
Member Author

/run-e2e

@MuncleUscles
MuncleUscles merged commit 60e8ca3 into v2-dev Jul 7, 2026
10 of 11 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