Konkreettiset ohjeet sijoittajille ja asiakkaille
Mikä: Avaa api.asterpay.io
Mitä sanot:
Terminaalissa:
curl -v https://api.asterpay.io/v1/market/price/BTC
Mitä näet: HTTP 402 Payment Required + JSON
Mitä sanot:
Koodi:
import { createX402Client, createAgentWallet } from '@asterpay-io/x402';
const wallet = createAgentWallet({
name: 'Demo Agent',
privateKey: process.env.PRIVATE_KEY!,
network: 'base-sepolia',
spendingLimits: { daily: 10.00 }
});
const client = createX402Client({
wallet: wallet.config,
autoPayEnabled: true
});
// Automaattinen maksu!
const response = await client.fetch('https://api.asterpay.io/v1/market/price/BTC');
const data = await response.json();
console.log('BTC Price:', data.data.price);
Mitä sanot:
Mitä näytät:
Mitä sanot:
tsx demos/demo-market-data.ts
Näyttää: BTC/ETH hinnat, automaattinen maksu, kulut
tsx demos/demo-ai-summarize.ts
Näyttää: Tekstin yhteenveto, compression ratio, maksu