SDK

This document covers the agent-creation contract integration in the Regent SDK.

Overview

The Regent SDK provides TypeScript interfaces and implementations for interacting with the Regent Agent Factory smart contracts. This enables:

  • Creating sovereign agents on-chain

  • Managing agent lifecycle (pause, resume, transfer)

  • Configuring tokenomics (bond, rake, treasury)

  • Integrating with ERC-8004 identity

Packages

Package
Description

@regent/contracts

TypeScript interfaces and viem clients for factory contracts

@regent/agents

High-level orchestration (factory + ERC-8004 + wallet)

@regent/regentx

CLI for agent management

Architecture

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│  @regent/regentx│────▶│ @regent/agents  │────▶│ @regent/contracts│
│     (CLI)       │     │   (Manager)     │     │   (Factory)     │
└─────────────────┘     └─────────────────┘     └─────────────────┘
                               │                        │
                               ▼                        ▼
                        ┌─────────────┐          ┌─────────────┐
                        │@regent/erc8004│        │ On-Chain    │
                        │  (Identity) │          │ Contracts   │
                        └─────────────┘          └─────────────┘

Quick Start

Local Development (Mock Mode)

On-Chain Mode

Factory Interface

The RegentAgentFactory interface defines the contract between the SDK and on-chain factories:

Agent ID Format

Agent IDs are formatted as chainId:localId:

This format allows cross-chain agent identification.

Tokenomics Configuration

Rake (Revenue Share)

The rake is specified in basis points (1-10000):

Bond

Initial bond amount in wei:

CLI Usage

Solidity Interface

The SDK expects contracts implementing IRegentAgentFactory:

Full ABI available in @regent/contracts/abi.

Last updated