Skip to content

feat(sdk): add AgentRegistryClient for Underwrite's agent-registry ge… - #692

Open
Michealshodipo56 wants to merge 1 commit into
TrusTrove:mainfrom
Michealshodipo56:feat/sdk-agent-registry-client
Open

feat(sdk): add AgentRegistryClient for Underwrite's agent-registry ge…#692
Michealshodipo56 wants to merge 1 commit into
TrusTrove:mainfrom
Michealshodipo56:feat/sdk-agent-registry-client

Conversation

@Michealshodipo56

Copy link
Copy Markdown
Contributor

…t_agent

Add a new SDK client for the external agent-registry contract (deployed from underwrite-contract, not TrusTrove's own registry). This enables apps/web to look up agent info (e.g. display name for who attested an invoice) without hand-rolling contract calls.

Changes:

  • Added Agent interface to packages/sdk/src/types/index.ts with agentId, pubkey, active, and registeredAt fields
  • Added agentSchema and parseAgent to packages/sdk/src/types/schemas.ts following the existing Profile/parseProfile pattern
  • Added agentRegistry to DEFAULT_CONTRACTS and SDKConfig.contractIds in packages/sdk/src/config.ts with env var NEXT_PUBLIC_AGENT_REGISTRY_CONTRACT_ID
  • Created packages/sdk/src/clients/agentRegistry.ts with AgentRegistryClient extending BaseContractClient, exposing getAgent() as a read-only call
  • Exported AgentRegistryClient from packages/sdk/src/index.ts
  • Added packages/sdk/src/clients/agentRegistry.test.ts with happy path and not-found/error path tests
  • Updated existing test files (base.test.ts, token.test.ts, config.test.ts) to include agentRegistry in contractIds

Closes #500

…t_agent

Add a new SDK client for the external agent-registry contract
(deployed from underwrite-contract, not TrusTrove's own registry).
This enables apps/web to look up agent info (e.g. display name for
who attested an invoice) without hand-rolling contract calls.

Changes:
- Added Agent interface to packages/sdk/src/types/index.ts
  with agentId, pubkey, active, and registeredAt fields
- Added agentSchema and parseAgent to packages/sdk/src/types/schemas.ts
  following the existing Profile/parseProfile pattern
- Added agentRegistry to DEFAULT_CONTRACTS and SDKConfig.contractIds
  in packages/sdk/src/config.ts with env var NEXT_PUBLIC_AGENT_REGISTRY_CONTRACT_ID
- Created packages/sdk/src/clients/agentRegistry.ts with AgentRegistryClient
  extending BaseContractClient, exposing getAgent() as a read-only call
- Exported AgentRegistryClient from packages/sdk/src/index.ts
- Added packages/sdk/src/clients/agentRegistry.test.ts with happy path
  and not-found/error path tests
- Updated existing test files (base.test.ts, token.test.ts, config.test.ts)
  to include agentRegistry in contractIds

Closes TrusTrove#499

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Michealshodipo56 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

@Michealshodipo56 is attempting to deploy a commit to the K1NGD4VID Team on Vercel.

A member of the Team first needs to authorize it.

@mergekeeper

mergekeeper Bot commented Aug 29, 2026

Copy link
Copy Markdown

Needs review

Linked to #500, but the diff does not match the issue scope.

The pull request implements SDK support for the agent-registry contract instead of the requested frontend verification badge features on invoice cards in apps/web.

Reviewed commit: 082d48bcc9b634b1c3c1a0b4c9251fe43e3332aa.

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.

[Medium] feat(web): verification badge on invoice cards (Unverified / Verified · risk score / Verification failed)

1 participant