get_agent: Retrieve full agent data by agent_id.
fn get_agent(env: soroban_sdk::Env, agent_id: soroban_sdk::Symbol) -> AgentData
initialize: One-time setup to configure admin and validator addresses. Must be called immediately after contract deployment.
fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
validator: soroban_sdk::Address,
)
record_payment: Track a payment for an agent request. In production, this integrates with Stellar Asset Contract for actual XLM transfers.
caller - Address making the paymentagent_id - Agent being paid foramount_stroops - Payment amount in stroopsfn record_payment(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
agent_id: soroban_sdk::Symbol,
amount_stroops: i128,
)
register_agent: Permanently record a new agent on-chain. Called exclusively by AgentValidator after fee collection + signature verification.
owner - Stellar address of agent owneragent_id - Unique on-chain identifierprice_xlm - Agent price per request (whole XLM)metadata_hash - IPFS CID or configuration hashfn register_agent(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
agent_id: soroban_sdk::Symbol,
price_xlm: i128,
metadata_hash: soroban_sdk::Symbol,
)
registry_admin: Query the admin address.
fn registry_admin(env: soroban_sdk::Env) -> soroban_sdk::Address
get_agent_price: Query agent's price per request.
fn get_agent_price(env: soroban_sdk::Env, agent_id: soroban_sdk::Symbol) -> i128
get_agent_stats: Get usage and earnings statistics.
fn get_agent_stats(env: soroban_sdk::Env, agent_id: soroban_sdk::Symbol) -> (u64, i128)
is_agent_active: Quick check if agent is active.
fn is_agent_active(env: soroban_sdk::Env, agent_id: soroban_sdk::Symbol) -> bool
deactivate_agent: Disable an agent (admin-only, irreversible).
fn deactivate_agent(env: soroban_sdk::Env, agent_id: soroban_sdk::Symbol)
validator_address: Query the registered validator address.
fn validator_address(env: soroban_sdk::Env) -> soroban_sdk::Address