@x402-stellar-bazaar/agent
v0.1.0
Published
Buyer/agent SDK: query the Stellar Bazaar and pay for discovered services with hard budget ceilings enforced before signing, plus a spend audit log.
Maintainers
Readme
@x402-stellar-bazaar/agent
Buyer/agent SDK for the Stellar Bazaar: discover paid services and pay for them with hard budget ceilings enforced before anything is signed.
import { StellarBazaarAgent } from "@x402-stellar-bazaar/agent";
const agent = new StellarBazaarAgent({
facilitatorUrl: FACILITATOR_URL,
privateKey: process.env.STELLAR_SECRET,
maxAmountPerCall: 1_000_000n, // 0.1 USDC per call
sessionBudget: 10_000_000n, // 1 USDC total
});
const { resources } = await agent.search({ query: "weather for a city" });
await agent.paidCall({ url: resources[0].resource, query: { city: "Lisbon" }, expectedPriceAtomic: 100_000n });
console.log(agent.spendReport()); // every payment + on-chain tx hashDocs: https://stellar-bazaar.netlify.app/docs/#buyers
