// sdk

Call SourceMark from your agent.

Thin TypeScript client for the HTTP gate. Pay-per-read still uses the Hedera buyer helpers in the repo when you attach X-PAYMENT.

Install from this repo
npm install ./sdk
Challenge + paid read
import { SourceMark } from 'sourcemark-sdk';

const sm = new SourceMark({ baseUrl: 'https://source-mark-production.up.railway.app' });

const challenge = await sm.challenge('aave-v3-ethereum', { metric: 'supplyAPY', asset: 'USDC' });

const result = await sm.read('aave-v3-ethereum', {
  metric: 'supplyAPY',
  asset: 'USDC',
  paymentHeader: process.env.X_PAYMENT,
});

console.log(result.status, result.body?.answer);
Also available
await sm.registry()
await sm.policy('aave-v3-ethereum')
await sm.receipt(digest)
await sm.payouts()
await sm.health()

Full docs: https://github.com/KartikDehru/source-mark/tree/main/sdk