A research workflow recipe for turning public unlock evidence into a compact paid x402 risk call.
import { wrapFetchWithPayment, x402HTTPClient } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const httpClient = new x402HTTPClient(client);
const response = await fetchWithPayment("https://unlockpressure.pricepilot402-arya.workers.dev/v1/token/risk-summary", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ token: "SXT", lookbackDays: 90 })
});
const paid = await httpClient.processResponse(response);
console.log(paid.body);
curl -i "https://unlockpressure.pricepilot402-arya.workers.dev/v1/token/risk-summary" \
-H "content-type: application/json" \
--data '{"token":"SXT","lookbackDays":90}'curl -i "https://unlockpressure.pricepilot402-arya.workers.dev/v1/unlock-risk" \
-H "content-type: application/json" \
--data '{"token":"SXT","unlock_event_id":"unlock_8059a416","includeEvidence":true}'