pub struct AgentCard {Show 25 fields
pub id: Uuid,
pub name: String,
pub description: Option<String>,
pub wallet_address: String,
pub public_key: String,
pub supported_networks: Vec<X402Network>,
pub supported_assets: Vec<X402Asset>,
pub a2a_skills: Vec<A2ASkill>,
pub trust_level: TrustLevel,
pub verified_at: Option<DateTime<Utc>>,
pub verification_method: Option<String>,
pub endpoint_url: Option<String>,
pub endpoint_protocol: Option<String>,
pub merchant_id: Option<String>,
pub merchant_name: Option<String>,
pub business_category: Option<String>,
pub max_transaction_amount: Option<u64>,
pub daily_volume_limit: Option<u64>,
pub requires_kyc: bool,
pub active: bool,
pub suspended_at: Option<DateTime<Utc>>,
pub suspension_reason: Option<String>,
pub metadata: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Agent Card - Identity and capability advertisement for AI agents
Agent cards enable discovery and verification of AI agents in the agent-to-agent commerce ecosystem. They contain:
- Identity: wallet address, public key for verification
- Capabilities: supported payment networks, assets, A2A skills
- Trust: verification level and limits
Fields§
§id: UuidUnique agent card ID
name: StringHuman-readable agent name
description: Option<String>Description of the agent’s purpose/capabilities
wallet_address: StringWallet address for receiving/sending payments
public_key: StringEd25519 public key for signature verification (hex-encoded)
supported_networks: Vec<X402Network>Supported blockchain networks
supported_assets: Vec<X402Asset>Supported payment assets (stablecoins)
a2a_skills: Vec<A2ASkill>List of A2A skills this agent supports
trust_level: TrustLevelTrust level determines transaction limits and capabilities
verified_at: Option<DateTime<Utc>>When the agent was verified (if applicable)
verification_method: Option<String>Method used for verification
endpoint_url: Option<String>URL for A2A communication
endpoint_protocol: Option<String>Protocol for endpoint (https, grpc, websocket)
merchant_id: Option<String>Associated merchant ID
merchant_name: Option<String>Merchant/business name
business_category: Option<String>Business category
max_transaction_amount: Option<u64>Maximum single transaction amount (in smallest unit)
daily_volume_limit: Option<u64>Daily volume limit (in smallest unit)
requires_kyc: boolWhether KYC is required for transactions
active: boolWhether the agent card is active
suspended_at: Option<DateTime<Utc>>When the agent was suspended (if applicable)
suspension_reason: Option<String>Reason for suspension
metadata: Option<String>Additional metadata (JSON)
created_at: DateTime<Utc>When the agent card was created
updated_at: DateTime<Utc>When the agent card was last updated
Implementations§
Source§impl AgentCard
impl AgentCard
Sourcepub fn new(
name: impl Into<String>,
wallet_address: impl Into<String>,
public_key: impl Into<String>,
) -> AgentCard
pub fn new( name: impl Into<String>, wallet_address: impl Into<String>, public_key: impl Into<String>, ) -> AgentCard
Create a new agent card
Sourcepub fn with_networks(self, networks: Vec<X402Network>) -> AgentCard
pub fn with_networks(self, networks: Vec<X402Network>) -> AgentCard
Add supported networks
Sourcepub fn with_assets(self, assets: Vec<X402Asset>) -> AgentCard
pub fn with_assets(self, assets: Vec<X402Asset>) -> AgentCard
Add supported assets
Sourcepub fn with_skills(self, skills: Vec<A2ASkill>) -> AgentCard
pub fn with_skills(self, skills: Vec<A2ASkill>) -> AgentCard
Add A2A skills
Sourcepub const fn with_trust_level(self, level: TrustLevel) -> AgentCard
pub const fn with_trust_level(self, level: TrustLevel) -> AgentCard
Set trust level
Sourcepub fn with_endpoint(
self,
url: impl Into<String>,
protocol: impl Into<String>,
) -> AgentCard
pub fn with_endpoint( self, url: impl Into<String>, protocol: impl Into<String>, ) -> AgentCard
Set endpoint
Sourcepub fn supports_network(&self, network: X402Network) -> bool
pub fn supports_network(&self, network: X402Network) -> bool
Check if agent supports a specific network
Sourcepub fn supports_asset(&self, asset: X402Asset) -> bool
pub fn supports_asset(&self, asset: X402Asset) -> bool
Check if agent supports a specific asset