Skip to main content

Crate erc8004_search

Crate erc8004_search 

Source
Expand description

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 via r402-evm
  • solana — Solana chain payment support via r402-svm

Structs§

ApiFeatures
Feature flags (ERC-8004 standard).
ApiLimits
API limits advertised via capabilities.
CapabilitiesResponse
GET /api/v1/capabilities response body.
Eip155ExactClient
Client for signing EIP-155 exact scheme payments.
ErrorResponse
Structured error response from the API.
Filters
Structured filter object (ERC-8004 standard).
FirstMatch
Selector that returns the first matching candidate.
HealthResponse
GET /api/v1/health response body.
MaxAmount
Selector that only accepts payments up to a maximum amount.
PaginationMeta
Pagination metadata (ERC-8004 standard).
PreferChain
Selector that prefers specific chains in priority order.
ProviderInfo
Service provider info.
ResultMetadata
Extended metadata for a search result (ERC-8004 aligned).
SearchClient
HTTP client for the ERC-8004 Semantic Search Service.
SearchClientBuilder
Builder for constructing a SearchClient with x402 payment and custom HTTP settings.
SearchRequest
POST /api/v1/search request body.
SearchResponse
POST /api/v1/search response body (ERC-8004 standard).
SearchResultItem
A single search result (ERC-8004 standard).
ServiceHealth
Subsystem health indicators.
X402Client
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.
TrustModel
Standard trust models from the ERC-8004 specification.
WalletFilter
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§

PaymentSelector
Trait for selecting the best payment candidate from available options.

Type Aliases§

Result
Convenience alias used throughout the SDK.