Expand description
§erc8004-search
Rust SDK for the ERC-8004 Semantic Search Service.
Provides a typed, ergonomic client for querying on-chain AI agent registrations via semantic search, with built-in x402 payment support.
§Quick Start
ⓘ
use erc8004_search::SearchClient;
use alloy_signer_local::PrivateKeySigner;
let signer: PrivateKeySigner = "0x...".parse()?;
let client = SearchClient::builder()
.evm_signer(signer)
.build()?;
let response = client.search("DeFi lending agent").await?;
for result in &response.results {
println!("#{} {} (score: {:.3})", result.rank, result.name, result.score);
}§Custom Endpoint
ⓘ
use erc8004_search::SearchClient;
use alloy_signer_local::PrivateKeySigner;
let signer: PrivateKeySigner = "0x...".parse()?;
let client = SearchClient::builder()
.base_url("https://custom.example.com")
.evm_signer(signer)
.build()?;§Feature Flags
evm(default) — EVM chain payment support viar402-evmsolana— Solana chain payment support viar402-svm
Structs§
- ApiFeatures
- Feature flags (ERC-8004 standard).
- ApiLimits
- API limits advertised via capabilities.
- Capabilities
Response GET /api/v1/capabilitiesresponse body.- Eip155
Exact Client - Client for signing EIP-155 exact scheme payments.
- Error
Response - Structured error response from the API.
- Filters
- Structured filter object (ERC-8004 standard).
- First
Match - Selector that returns the first matching candidate.
- Health
Response GET /api/v1/healthresponse body.- MaxAmount
- Selector that only accepts payments up to a maximum amount.
- Pagination
Meta - Pagination metadata (ERC-8004 standard).
- Prefer
Chain - Selector that prefers specific chains in priority order.
- Provider
Info - Service provider info.
- Result
Metadata - Extended metadata for a search result (ERC-8004 aligned).
- Search
Client - HTTP client for the ERC-8004 Semantic Search Service.
- Search
Client Builder - Builder for constructing a
SearchClientwith x402 payment and custom HTTP settings. - Search
Request POST /api/v1/searchrequest body.- Search
Response POST /api/v1/searchresponse body (ERC-8004 standard).- Search
Result Item - A single search result (ERC-8004 standard).
- Service
Health - Subsystem health indicators.
- X402
Client - The main x402 client that orchestrates scheme clients and selection.
Enums§
- Error
- All errors that can occur when using the SDK.
- Protocol
- Well-known service protocol names from the ERC-8004 specification.
- Trust
Model - Standard trust models from the ERC-8004 specification.
- Wallet
Filter - Wallet filter mode for reputation score re-aggregation.
Constants§
- DEFAULT_
BASE_ URL - Built-in default base URL for the QNTX-hosted ERC-8004 search service.
Traits§
- Payment
Selector - Trait for selecting the best payment candidate from available options.
Type Aliases§
- Result
- Convenience alias used throughout the SDK.