Skip to main content

Get All Actors

Fetch all registered actors from the ActorRegistry contract.
cURL
curl https://proteus-production-6213.up.railway.app/api/chain/actors
actors
array
Array of actor objects from blockchain
total
number
Total number of actors returned
source
string
Always "blockchain" - indicates data source

Response

{
  "actors": [
    {
      "address": "0x1234567890abcdef1234567890abcdef12345678",
      "name": "Elon Musk",
      "x_username": "elonmusk",
      "verified": true,
      "block_number": 12345000
    },
    {
      "address": "0x9876543210fedcba9876543210fedcba98765432",
      "name": "Vitalik Buterin",
      "x_username": "VitalikButerin",
      "verified": true,
      "block_number": 12346000
    }
  ],
  "total": 2,
  "source": "blockchain"
}
Actor data is fetched from ActorRegistered events emitted by the ActorRegistry contract. The API queries historical events and enriches them with current on-chain state using the getActor() contract method.

Actor Object Fields

address
string
Ethereum address of the actor (can be zero address for unlinked actors)
name
string
Display name of the actor (e.g., “Elon Musk”)
x_username
string
X.com (Twitter) username without @ symbol
verified
boolean
Whether the actor has been verified by the platform
block_number
number
Block number when the actor was registered

Actor Verification

Actors must be verified before markets can be created for them. Verification is handled on-chain by the ActorRegistry contract owner.

Check if Actor is Verified

JavaScript
import { ethers } from 'ethers';

const actorRegistryABI = [
  "function getActor(address actorAddress) view returns (string name, string xUsername, bool verified)"
];

const provider = new ethers.JsonRpcProvider('https://sepolia.base.org');
const actorRegistry = new ethers.Contract(
  '0xC71CC19C5573C5E1E144829800cD0005D0eDB723',
  actorRegistryABI,
  provider
);

const actorAddress = '0x1234567890abcdef1234567890abcdef12345678';
const [name, xUsername, verified] = await actorRegistry.getActor(actorAddress);

console.log('Actor:', name);
console.log('X Username:', xUsername);
console.log('Verified:', verified);

Register New Actor

To register a new actor, you must interact directly with the ActorRegistry contract.

Contract Method

function registerActor(
  address actorAddress,
  string memory name,
  string memory xUsername
) external
actorAddress
address
required
Ethereum address of the actor (use zero address if unknown)
name
string
required
Display name (e.g., “Elon Musk”)
xUsername
string
required
X.com username without @ symbol (e.g., “elonmusk”)
Any address can register an actor, but the actor will not be verified until the contract owner approves them. Only verified actors can have markets created for them.

Using Web3.js

JavaScript
import { ethers } from 'ethers';

const actorRegistryABI = [
  "function registerActor(address actorAddress, string memory name, string memory xUsername) external"
];

const provider = new ethers.BrowserProvider(window.ethereum);
const signer = await provider.getSigner();
const actorRegistry = new ethers.Contract(
  '0xC71CC19C5573C5E1E144829800cD0005D0eDB723',
  actorRegistryABI,
  signer
);

// Register actor
const tx = await actorRegistry.registerActor(
  '0x0000000000000000000000000000000000000000',  // Zero address (unknown wallet)
  'Elon Musk',
  'elonmusk'
);

const receipt = await tx.wait();
console.log('Actor registered:', receipt.transactionHash);

Get Genesis NFT Holders

Fetch addresses holding Genesis NFTs (relevant for platform governance).
cURL
curl https://proteus-production-6213.up.railway.app/api/chain/genesis/holders
holders
array
Array of Genesis NFT holder data
holders[].address
string
Ethereum address of the holder
holders[].token_count
number
Number of Genesis NFTs held
holders[].token_ids
array
Array of token IDs owned
holders[].percentage_owned
number
Percentage of total supply owned (out of 100 total)
total_holders
number
Total number of unique holders
total_supply
number
Total Genesis NFT supply (100)

Response

{
  "holders": [
    {
      "address": "0xholder1234567890abcdef1234567890abcdef1234",
      "token_count": 5,
      "token_ids": [1, 5, 12, 23, 45],
      "percentage_owned": 5
    },
    {
      "address": "0xholder2222222222abcdef1234567890abcdef2222",
      "token_count": 3,
      "token_ids": [2, 8, 15],
      "percentage_owned": 3
    }
  ],
  "total_holders": 42,
  "total_supply": 100,
  "source": "blockchain"
}
Genesis NFT holders get:
  • Higher rate limits (500 req/min vs 100 req/min)
  • Platform fee share (percentage of all market fees)
  • Governance rights (future feature)

Contract Events

The ActorRegistry contract emits these events:

ActorRegistered

event ActorRegistered(
  address indexed actorAddress,
  string name,
  string xUsername,
  address indexed registeredBy
);
Emitted when a new actor is registered.

ActorVerified

event ActorVerified(
  address indexed actorAddress,
  bool verified
);
Emitted when an actor’s verification status changes.

Listening to Events

JavaScript
import { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider('https://sepolia.base.org');
const actorRegistry = new ethers.Contract(
  '0xC71CC19C5573C5E1E144829800cD0005D0eDB723',
  actorRegistryABI,
  provider
);

// Listen for new actor registrations
actorRegistry.on('ActorRegistered', (actorAddress, name, xUsername, registeredBy) => {
  console.log('New actor registered:');
  console.log('Address:', actorAddress);
  console.log('Name:', name);
  console.log('X Username:', xUsername);
  console.log('Registered by:', registeredBy);
});

// Query historical registrations
const filter = actorRegistry.filters.ActorRegistered();
const events = await actorRegistry.queryFilter(filter, 0, 'latest');

events.forEach(event => {
  console.log('Actor:', event.args.name, '@' + event.args.xUsername);
});

Error Handling

{
  "actors": [],
  "total": 0,
  "source": "blockchain",
  "error": "Could not query actor events"
}
The API gracefully handles contract query failures by returning an empty array. Common issues:
  • Empty response - Contract not deployed or no actors registered yet
  • RPC timeout - BASE network connectivity issue
  • Contract not available - ActorRegistry address not configured

Contract Address

BASE Sepolia (Testnet)

0xC71CC19C5573C5E1E144829800cD0005D0eDB723

BASE Mainnet

Not yet deployed.

Best Practices

  1. Cache actor data - Actor list changes infrequently (5 min TTL recommended)
  2. Verify actors exist before creating markets
  3. Check verification status before allowing market creation
  4. Handle empty responses gracefully (new deployments may have no actors)
  5. Use lowercase comparisons for X usernames (case-insensitive)

Build docs developers (and LLMs) love