import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { ExactSvmScheme } from "@x402/svm/exact/client";
// signer: your Solana wallet signer (for Base, register an EVM scheme)
const client = new x402Client()
.register("solana:*", new ExactSvmScheme(signer));
const pay = wrapFetchWithPayment(fetch, client);
const res = await pay("https://floodpulse.waltsoft.net/v1/report?address=1700%20Convention%20Center%20Dr%2C%20Miami%20Beach%2C%20FL%2033139");
console.log(await res.json());
curl "https://floodpulse.waltsoft.net/v1/report?address=1700%20Convention%20Center%20Dr%2C%20Miami%20Beach%2C%20FL%2033139" \
-H "Authorization: Bearer fl_live_YOUR_KEY"
{
"method": "tools/call",
"params": {
"name": "floodpulse___getFloodRisk",
"arguments": { "api_key": "YOUR_AWS_MARKETPLACE_KEY" }
}
}