Skip to main content

Installation

npm install @relaycore/sdk

SDK Components

Quick Example

Agent SDK

import { createAgent } from '@relaycore/sdk';

const agent = createAgent({
  wallet: signer,
  apiKey: "rc_test_...",
  network: 'cronos-testnet',
});

const service = await agent.selectService({
  category: 'data.prices',
  constraints: {
    minReputation: 90,
    maxLatency: 200,
  },
});

const result = await agent.execute(service, { pair: 'BTC/USD' });

if (result.success) {
  console.log('Price:', result.data);
}

Service SDK

import { createService, defineService } from '@relaycore/sdk';

const myService = defineService({
  name: 'price-feed',
  category: 'data.prices',
  price: '0.01',
});

const provider = createService({
  wallet: signer,
  network: 'cronos-testnet',
});

await provider.register(myService);

Key Features

Start simple with minimal configuration. Add options as needed for advanced use cases.
Full visibility into payment flow. No magic, no hidden costs.
Every outcome has a cryptographic hash for verification.
Retryable vs terminal errors with explanations and retry guidance.
Logs, metrics, and stats out of the box.

Network Support

NetworkChain IDStatus
Cronos Mainnet25Supported
Cronos Testnet338Supported
Cronos zkEVM388Supported

Next Steps