Prepare v0.1.0 for publish#5
Conversation
- Add pollingInterval: 100 to fork public client (Anvil mines instantly, default 4s polling wastes time per waitForTransactionReceipt) - Warn when FORK_URL not set and falling back to public RPC Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Spec gaps: - Add setAgentWallet + unsetAgentWallet - Make agentURI optional in registerAgent (zero-arg overload) - Make responseHash optional in appendResponse (default zeroHash) New helpers: - parseRegisterReceipt — extract agentId from tx receipt - parseGiveFeedbackReceipt — extract feedbackIndex from tx receipt - readAllFeedbackBatched — chunk clientAddresses to avoid RPC limits Docs & metadata: - Add README.md and CHANGELOG.md - Add repository/homepage/bugs to package.json - Lower Node engine from >=22 to >=18 - Bump version to 0.1.0 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
||
| ## Stability | ||
|
|
||
| ERC-8004 is Draft status. The on-chain contracts are UUPS upgradeable. At 0.x, minor version bumps may contain breaking changes. |
There was a problem hiding this comment.
Why do we need to mention it ? Isn't this common knowledge
| ## Install | ||
|
|
||
| ```bash | ||
| pnpm add @x402r/erc8004 viem |
There was a problem hiding this comment.
If view is dep ? do we need to list view ? why not pnpm install or something
| @@ -0,0 +1,124 @@ | |||
| # @x402r/erc8004 | |||
|
|
|||
| TypeScript SDK for [ERC-8004](https://eips.ethereum.org/EIPS/eip-8004) Identity and Reputation registries. Pure [viem](https://viem.sh), zero additional dependencies. | |||
There was a problem hiding this comment.
seems marking jargon. keep it technical
| @@ -1,12 +1,20 @@ | |||
| { | |||
| "name": "@x402r/erc8004", | |||
| "version": "0.0.0", | |||
There was a problem hiding this comment.
maybe release alpha version first for testing with SDK, than can release actual stable one ?
SDK Review — Full Audit (v0.1.0 Pre-publish)Comprehensive audit against ERC-8004 spec, deployed contract ABIs, agent0-sdk, and chain deployments. Bugs1.
// Current (buggy)
if (agentURI && metadata && metadata.length > 0) { ... }
if (agentURI) { ... }
// Fix
if (agentURI !== undefined && metadata && metadata.length > 0) { ... }
if (agentURI !== undefined) { ... }Missing SDK Functions2. No EIP-712 signing helper for The contract requires an EIP-712 signature from Callers must manually build this with viem's 3. Missing Both ABIs have 4. Missing
Event/Receipt Parser Gaps5. Returns 6. Missing receipt parsers for 4 events (low)
Inconsistent with the pattern established by Documentation/DX Gaps7. After NFT transfer or 8. ABI uses Chain Coverage9. Addresses are verified correct — all 4 addresses match both 10. 7 chains covered, 20+ deployed chains missing. CREATE2 addresses are identical across chains, so adding chains is just new map entries. Notable missing mainnets for v0.1.0:
The design plan says "only list chains we've verified deployment on" — this is intentional, but worth expanding for v0.1.0 if deployments are confirmed. ABI Coverage SummaryIdentity Registry (30 ABI entries)
Reputation Registry (18 ABI entries)
agent0-sdk Comparison
Spec Security Considerations
Summary: One bug ( Generated with Claude Code using review-sdk skill |
Bug fix: - registerAgent: if(agentURI) → if(agentURI !== undefined) to handle empty string New functions: - signAgentWalletConsent — EIP-712 signing helper for setAgentWallet - getVersion (identity + reputation) — read contract version string - getIdentityRegistry — get linked Identity Registry from Reputation Registry - parseMetadataSetReceipt, parseURIUpdatedReceipt (identity) - parseFeedbackRevokedReceipt, parseResponseAppendedReceipt (reputation) Improvements: - parseGiveFeedbackReceipt now returns all 11 event fields - 7 new chains added (Avalanche, BSC, Scroll, Linea, Mantle, Gnosis, Celo) - JSDoc: resolveAgent agentWallet=address(0), giveFeedback int128 signed value - README: technical description, npm install, updated API tables, 14 chains - Version → 0.1.0-alpha.0 for SDK integration testing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SDK ReviewFound 10 issues (reviewed: tests, conventions, dead code, SDK design): 1. [Dead Code — 85] The PR makes erc8004/src/identity/register.ts Lines 20 to 47 in cadfecd 2. [SDK Design — 85] Every other function in this SDK is erc8004/src/identity/signAgentWalletConsent.ts Lines 15 to 19 in cadfecd 3. [Tests — 85] The test uses erc8004/tests/identity.test.ts Lines 210 to 230 in cadfecd 4. [Conventions — 80] Hardcoded EIP-712 domain
erc8004/src/identity/signAgentWalletConsent.ts Lines 38 to 42 in cadfecd 5. [SDK Design — 80] Chunking erc8004/src/reputation/readAllFeedbackBatched.ts Lines 1 to 36 in cadfecd 6. [Dead Code — 80] Both Lines 9 to 24 in cadfecd 7. [Conventions — 75] Every other write function calls 8. [Conventions — 75]
9. [Conventions — 75] Unnecessary Three new functions ( erc8004/src/identity/getVersion.ts Lines 16 to 21 in cadfecd 10. [Tests — 75] The test encodes a full erc8004/tests/reputation.test.ts Lines 127 to 136 in cadfecd Generated with Claude Code using review-sdk skill |
Fixes: - registerAgent: throw when metadata provided without agentURI (dead param path) - signAgentWalletConsent: move publicClient into params (single-client pattern) - signAgentWalletConsent: use requireAccount instead of account! assertion - parseGiveFeedbackReceipt: use Hex type instead of template literal - Remove as Promise<T> casts from getVersion/getIdentityRegistry - Export GetVersionParameters from root barrel Design: - Merge readAllFeedbackBatched into readAllFeedback as optional batchSize param - Delete readAllFeedbackBatched.ts (separate file was unnecessary API surface) Tests: - signAgentWalletConsent: assert chainId + verifyingContract (security fields) - signAgentWalletConsent: add requireAccount test - registerAgent: add metadata-without-URI test - parseGiveFeedbackReceipt: assert all 10 fields with toEqual Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Review round 2 — pushback on #4 (hardcoded EIP-712 domain)Both reviewers flagged that Keeping as-is for now. Rationale:
If the domain ever changes (extremely unlikely), we bump a patch version. The fork test will fail in CI before any release ships with the wrong domain. |
Summary
setAgentWallet,unsetAgentWalletagentURIoptional inregisterAgent(zero-arg register overload)responseHashoptional inappendResponse(defaultzeroHash)parseRegisterReceipt,parseGiveFeedbackReceiptreadAllFeedbackBatched— chunksclientAddressesto avoid RPC limitsREADME.mdandCHANGELOG.mdrepository/homepage/bugstopackage.json>=22to>=180.1.0Test plan
npm pack --dry-runverified (56 files, 34.6 kB)pnpm publish --access publicafter merge🤖 Generated with Claude Code