Skip to content

Models and Types

Core data models and types used throughout the SDK.

AgentId = str # Format: "chainId:tokenId" (e.g., "11155111:123")
ChainId = int # Chain identifier
Address = str # Ethereum address (0x-hex)
URI = str # https://... or ipfs://...
CID = str # IPFS CID
Timestamp = int # Unix timestamp
IdemKey = str # Idempotency key

Agent IDs uniquely identify agents across chains:

  • Format: "chainId:tokenId"
  • chainId: Blockchain network ID (e.g., 11155111 for Sepolia, 1 for Ethereum mainnet)
  • tokenId: ERC-721 token ID from Identity Registry
  • Example: "11155111:123" = Agent #123 on Sepolia testnet

Feedback IDs uniquely identify individual feedback entries:

  • Format: "agentId:clientAddress:feedbackIndex"
  • agentId: The agent’s ID in "chainId:tokenId" format
  • clientAddress: Ethereum address of feedback giver (normalized to lowercase)
  • feedbackIndex: Sequential index of feedback from this client to this agent (1-based)
  • Example: "11155111:123:0x742d35cc6634c0532925a3b844bc9e7595f0beb7:1"
class EndpointType(Enum):
MCP = "MCP"
A2A = "A2A"
ENS = "ENS"
DID = "DID"
WALLET = "wallet"
class TrustModel(Enum):
REPUTATION = "reputation"
CRYPTO_ECONOMIC = "crypto-economic"
TEE_ATTESTATION = "tee-attestation"
@dataclass
class Endpoint:
type: EndpointType
value: str # Endpoint value (URL, name, DID, ENS)
meta: Dict[str, Any] # Optional metadata
@dataclass
class RegistrationFile:
agentId: Optional[AgentId]
agentURI: Optional[URI]
name: str
description: str
image: Optional[URI]
walletAddress: Optional[Address]
walletChainId: Optional[int]
endpoints: List[Endpoint]
trustModels: List[Union[TrustModel, str]]
owners: List[Address]
operators: List[Address]
active: bool
x402support: bool
metadata: Dict[str, Any]
updatedAt: Timestamp

Note: In TypeScript, there are no built-in to_dict() or from_dict() methods. Use JSON.stringify() and JSON.parse() for serialization, or access properties directly from the interface.

@dataclass
class AgentSummary:
chainId: ChainId
agentId: AgentId
name: str
image: Optional[URI]
description: str
owners: List[Address]
operators: List[Address]
mcp: bool
a2a: bool
ens: Optional[str]
did: Optional[str]
walletAddress: Optional[Address]
supportedTrusts: List[str]
a2aSkills: List[str]
mcpTools: List[str]
mcpPrompts: List[str]
mcpResources: List[str]
active: bool
x402support: bool
extras: Dict[str, Any]
@dataclass
class Feedback:
id: str # "agentId:clientAddress:index"
agentId: AgentId
reviewer: Address
score: Optional[float]
tags: List[str]
text: Optional[str]
context: Optional[Dict[str, Any]]
proofOfPayment: Optional[Dict]
fileURI: Optional[URI]
createdAt: Timestamp
answers: List[Dict[str, Any]]
isRevoked: bool
# Off-chain fields
capability: Optional[str]
name: Optional[str]
skill: Optional[str]
task: Optional[str]

Note: In TypeScript, Feedback.id is a tuple [AgentId, Address, number] rather than a string. The string format "agentId:clientAddress:feedbackIndex" is represented by the FeedbackId type.

@dataclass
class SearchParams:
chains: Optional[List[ChainId]] = None
name: Optional[str] = None
description: Optional[str] = None
owners: Optional[List[Address]] = None
mcp: Optional[bool] = None
a2a: Optional[bool] = None
ens: Optional[str] = None
walletAddress: Optional[Address] = None
supportedTrust: Optional[List[str]] = None
a2aSkills: Optional[List[str]] = None
mcpTools: Optional[List[str]] = None
mcpPrompts: Optional[List[str]] = None
mcpResources: Optional[List[str]] = None
active: Optional[bool] = True
x402support: Optional[bool] = None
def to_dict() -> Dict