Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions API_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ interface SDKConfig {
}
```

> **Hedera testnet:** The SDK ships registry defaults for chain ID `296`, but no built-in subgraph URL. Provide a `subgraphOverrides` entry (e.g., `{ 296: 'https://your-hedera-subgraph.example' }`) when instantiating the SDK to enable subgraph-backed features on Hedera.

### Chain & Registry Methods
```typescript
async chainId(): Promise<ChainId>
Expand Down
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,45 @@ npm run build

## Quick Start

### Supported Test Networks

| Network | `chainId` | Notes |
| ------------------ | --------- | ----- |
| Ethereum Sepolia | 11155111 | Default registry + default subgraph URL bundled with the SDK. |
| Hedera Testnet | 296 | Provide a Hedera JSON-RPC endpoint (e.g., `https://testnet.hashio.io/api`). Supply a subgraph URL via `subgraphUrl`/`subgraphOverrides` for search features. |
| Base Sepolia | 84532 | Registry addresses included. Configure `subgraphOverrides` for query support. |
| Linea Sepolia | 59141 | Registry addresses included. Configure `subgraphOverrides` for query support. |

> ℹ️ When using Hedera Testnet, the SDK cannot auto-detect a subgraph yet. Pass a Hedera-compatible subgraph endpoint explicitly if you rely on search, feedback history, or reputation summary APIs.

### 1. Initialize SDK

```typescript
import { SDK } from 'agent0-sdk';

// Initialize SDK with IPFS and subgraph
const sdk = new SDK({
chainId: 11155111, // Ethereum Sepolia testnet
chainId: 11155111, // Default: Ethereum Sepolia (see Supported Test Networks for other chainIds)
rpcUrl: process.env.RPC_URL!,
signer: process.env.PRIVATE_KEY, // Optional: for write operations
ipfs: 'pinata', // Options: 'pinata', 'filecoinPin', 'node'
pinataJwt: process.env.PINATA_JWT // For Pinata
// Subgraph URL auto-defaults from DEFAULT_SUBGRAPH_URLS
// Override subgraphUrl/subgraphOverrides when supplying your own endpoint
// Hedera testnet (chainId 296) requires providing subgraphOverrides: { 296: 'https://your-hedera-subgraph.example' }
});
```

> **Note:** Hedera testnet (chainId `296`) includes default registry addresses but does not have a bundled subgraph URL. When targeting Hedera, pass a `subgraphOverrides` entry during SDK initialization, for example:

```typescript
const sdk = new SDK({
chainId: 296,
rpcUrl: process.env.RPC_URL!,
subgraphOverrides: {
296: 'https://your-hedera-subgraph.example',
},
// ...other config options
});
```

Expand Down Expand Up @@ -165,7 +191,7 @@ console.log(`Average score: ${summary.averageScore}`);
```typescript
// Option 1: Filecoin Pin (free for ERC-8004 agents)
const sdk = new SDK({
chainId: 11155111,
chainId: 11155111, // Configure with the chainId for your target network
rpcUrl: '...',
signer: privateKey,
ipfs: 'filecoinPin',
Expand Down Expand Up @@ -197,7 +223,7 @@ await agent.registerHTTP('https://example.com/agent-registration.json');

## 🚀 Coming Soon

- More chains (currently Ethereum Sepolia only)
- More chains (currently supports Ethereum Sepolia, Hedera Testnet, Base Sepolia, and Linea Sepolia; more networks coming soon)
- Support for validations
- Multi-chain agents search
- Enhanced x402 payments
Expand Down
6 changes: 6 additions & 0 deletions src/core/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,12 @@ export const DEFAULT_REGISTRIES: Record<ChainId, Record<string, string>> = {
REPUTATION: '0x8004B8FD1A363aa02fDC07635C0c5F94f6Af5B7E',
VALIDATION: '0x8004CB39f29c09145F24Ad9dDe2A108C1A2cdfC5',
},
296: {
// Hedera Testnet
IDENTITY: '0x4c74ebd72921d537159ed2053f46c12a7d8e5923',
REPUTATION: '0xc565edcba77e3abeade40bfd6cf6bf583b3293e0',
VALIDATION: '0x18df085d85c586e9241e0cd121ca422f571c2da6',
},
84532: {
// Base Sepolia
IDENTITY: '0x8004AA63c570c570eBF15376c0dB199918BFe9Fb',
Expand Down
12 changes: 12 additions & 0 deletions tests/contracts.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { DEFAULT_REGISTRIES, DEFAULT_SUBGRAPH_URLS } from '../src/core/contracts';

describe('DEFAULT_REGISTRIES', () => {
it('includes Hedera testnet addresses and no default subgraph URL', () => {
expect(DEFAULT_REGISTRIES[296]).toEqual({
IDENTITY: '0x4c74ebd72921d537159ed2053f46c12a7d8e5923',
REPUTATION: '0xc565edcba77e3abeade40bfd6cf6bf583b3293e0',
VALIDATION: '0x18df085d85c586e9241e0cd121ca422f571c2da6',
});
expect(DEFAULT_SUBGRAPH_URLS[296]).toBeUndefined();
});
});