-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.mjs
More file actions
31 lines (24 loc) · 935 Bytes
/
Copy pathtest.mjs
File metadata and controls
31 lines (24 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { AgentWebTools } from "./dist/index.mjs";
const tools = new AgentWebTools();
async function main() {
console.log("=== Health Check ===");
const health = await tools.health();
console.log("Status:", health.status);
console.log("Services:", health.services.length);
console.log("\n=== 402 Challenge Test ===");
try {
await tools.urlToMarkdown("https://example.com");
} catch (err) {
console.log("x402 challenge expected (no payment header)");
}
console.log("\n=== Free: DNS Lookup with payment ===");
const dns = await tools.dnsLookup("base.org");
console.log("DNS result status:", dns.success);
console.log("\n=== Token Price ===");
const eth = await tools.tokenPrice("eth");
console.log("ETH price:", eth.data?.priceUsd);
console.log("\n=== Gas Price ===");
const gas = await tools.gasPrice();
console.log("Gas:", gas.data?.gasPriceGwei, "Gwei");
}
main().catch(console.error);