Skip to content

JustaName-id/virtuals-acp-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

acp-proxy-server

A thin proxy that sits between acp-cli and the ACP backend to demonstrate ENS naming for agents end-to-end. The ENS logic here is small and self-contained — it's intended to be absorbed directly into the ACP backend.

What it does

  • Transparently proxies every request it doesn't own straight to the ACP backend (UPSTREAM), Authorization header included — so existing flows (agent create, agent list, erc8004, email, …) are completely unaffected.
  • Serves the /ens endpoints itself, backed by JustaName. Names are gasless offchain ENS subnames (<label>.<parent-domain>) issued with the parent-domain API key — no end-user signature required.

The CLI is pointed at the proxy with a single env var (ACP_API_BASE_URL), so no CLI changes are needed; once the backend implements these endpoints, the proxy is removed and nothing else changes.

Endpoint contract

The endpoints the backend would implement. All responses are wrapped { "data": ... }, matching the rest of the ACP API.

Method Path Body Returns
POST /agents/:id/ens/claim { label?, records? } { ens, address, records }409 ENS_LABEL_TAKEN if the label is owned by another wallet
GET /agents/:id/ens { ens | null, address, records }
PATCH /agents/:id/ens { records } updated profile
GET /ens/resolve/:name { ens, address, records }
GET /ens/reverse/:address { ens | null, address, records }
GET /ens/available/:label { label, available }

On claim: the label defaults to a slug of the agent's name (unless provided), and the name is seeded with the agent's avatar (image) and description, with both ETH (coinType 60) and Base (ENSIP-11 2147492101) address records pointing at the agent's wallet. Auth: the proxy reuses the caller's bearer token to read the agent upstream; JustaName is authorized by the parent-domain API key.

Running it

npm install
cp .env.example .env       # set JUSTANAME_API_KEY + ENS_PARENT_DOMAIN
npm run dev                # http://localhost:8788

export ACP_API_BASE_URL=http://localhost:8788   # then drive it from acp-cli

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors