Documentation
¶
Index ¶
- Constants
- type AgentRegistration
- type Client
- func (c *Client) Close()
- func (c *Client) GetMetadata(ctx context.Context, agentID *big.Int, k string) ([]byte, error)
- func (c *Client) Register(ctx context.Context, key *ecdsa.PrivateKey, agentURI string) (*big.Int, error)
- func (c *Client) SetAgentURI(ctx context.Context, key *ecdsa.PrivateKey, agentID *big.Int, uri string) error
- func (c *Client) SetMetadata(ctx context.Context, key *ecdsa.PrivateKey, agentID *big.Int, k string, ...) error
- func (c *Client) TokenURI(ctx context.Context, agentID *big.Int) (string, error)
- type OnChainReg
- type ServiceDef
Constants ¶
const ( // IdentityRegistryBaseSepolia is the ERC-8004 Identity Registry on Base Sepolia. IdentityRegistryBaseSepolia = "0x8004A818BFB912233c491871b3d84c89A494BD9e" // ReputationRegistryBaseSepolia is the ERC-8004 Reputation Registry on Base Sepolia. ReputationRegistryBaseSepolia = "0x8004B663056A597Dffe9eCcC1965A193B7388713" // ValidationRegistryBaseSepolia is the ERC-8004 Validation Registry on Base Sepolia. ValidationRegistryBaseSepolia = "0x8004CB39f29c09145F24Ad9dDe2A108C1A2cdfC5" // DefaultRPCURL is the default JSON-RPC endpoint for Base Sepolia. DefaultRPCURL = "https://sepolia.base.org" // BaseSepoliaChainID is the EIP-155 chain ID for Base Sepolia. BaseSepoliaChainID = 84532 )
const RegistrationType = "https://eips.ethereum.org/EIPS/eip-8004#registration-v1"
RegistrationType is the canonical type URI for ERC-8004 registration v1.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentRegistration ¶
type AgentRegistration struct {
Type string `json:"type"` // REQUIRED
Name string `json:"name"` // REQUIRED
Description string `json:"description,omitempty"` // REQUIRED (omitempty for parsing)
Image string `json:"image,omitempty"` // REQUIRED (omitempty for parsing)
Services []ServiceDef `json:"services"` // REQUIRED (>=1)
X402Support bool `json:"x402Support"` // REQUIRED
Active bool `json:"active"` // REQUIRED
Registrations []OnChainReg `json:"registrations,omitempty"` // REQUIRED (>=1, omitempty for parsing)
SupportedTrust []string `json:"supportedTrust,omitempty"` // OPTIONAL
}
AgentRegistration is the JSON schema for the agent registration document served at agentURI (e.g., /.well-known/agent-registration.json). Conforms to ERC-8004 "Trustless Agents" registration format.
REQUIRED fields per spec: type, name, description, image, services (>=1), x402Support, active, registrations (>=1). OPTIONAL: supportedTrust.
Note: Description and Image use omitempty for parsing flexibility but MUST be populated when producing registration documents.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client interacts with the ERC-8004 Identity Registry on Base Sepolia.
func (*Client) GetMetadata ¶
GetMetadata reads metadata for the given key from the agent NFT.
func (*Client) Register ¶
func (c *Client) Register(ctx context.Context, key *ecdsa.PrivateKey, agentURI string) (*big.Int, error)
Register mints a new agent NFT with the given agentURI. Returns the minted agentId (token ID).
func (*Client) SetAgentURI ¶
func (c *Client) SetAgentURI(ctx context.Context, key *ecdsa.PrivateKey, agentID *big.Int, uri string) error
SetAgentURI updates the agentURI for an existing agent NFT.
type OnChainReg ¶
type OnChainReg struct {
AgentID int64 `json:"agentId"` // ERC-721 tokenId
AgentRegistry string `json:"agentRegistry"` // CAIP-10 format: "eip155:84532:0x8004A818..."
}
OnChainReg links the registration to its on-chain record.
type ServiceDef ¶
type ServiceDef struct {
Name string `json:"name"` // e.g., "web", "A2A", "MCP"
Endpoint string `json:"endpoint"` // full URL
Version string `json:"version,omitempty"` // protocol version (SHOULD per spec)
}
ServiceDef describes an endpoint the agent exposes.