API Reference
Technical documentation for interacting with Amica Personas smart contracts and APIs.
Smart Contracts
Core Contracts
Amica Personas consists of several key smart contracts deployed on Arbitrum:
Contract | Address | Purpose |
---|---|---|
PersonaFactory | 0x... | Creates new personas |
PersonaToken | 0x... | ERC-20 token template |
PersonaRegistry | 0x... | Tracks all personas |
PersonaFactory
createPersona
Creates a new persona with associated token and liquidity pool.
function createPersona(
string memory name,
string memory symbol,
string memory description,
uint256 initialSupply,
uint256 creatorAllocation
) external payable returns (address personaAddress)
Parameters:
name
: Persona name (3-32 characters)symbol
: Token symbol (2-8 characters)description
: Persona description (max 500 characters)initialSupply
: Total token supplycreatorAllocation
: Percentage allocated to creator (0-20)
Returns:
personaAddress
: Address of deployed persona contract
Events:
event PersonaCreated(
address indexed personaAddress,
address indexed creator,
string name,
string symbol,
uint256 initialSupply
)
PersonaToken
Standard ERC-20 Methods
Each persona token implements the standard ERC-20 interface:
// Standard ERC-20 functions
function balanceOf(address account) external view returns (uint256)
function transfer(address to, uint256 amount) external returns (bool)
function approve(address spender, uint256 amount) external returns (bool)
function transferFrom(address from, address to, uint256 amount) external returns (bool)
function allowance(address owner, address spender) external view returns (uint256)
// Standard ERC-20 views
function name() external view returns (string memory)
function symbol() external view returns (string memory)
function decimals() external view returns (uint8)
function totalSupply() external view returns (uint256)
Custom Methods
getPersonaInfo
Returns metadata about the persona.
function getPersonaInfo() external view returns (
string memory name,
string memory symbol,
string memory description,
address creator,
uint256 createdAt,
address liquidityPool
)
GraphQL API
Endpoint
Query persona data using our GraphQL API powered by The Graph:
https://api.thegraph.com/subgraphs/name/amica/personas
Example Queries
Get All Personas
query {
personas(first: 10, orderBy: createdAt, orderDirection: desc) {
id
name
symbol
description
creator
totalSupply
liquidityPool
createdAt
}
}
Get Persona by Address
query {
persona(id: "0x...") {
id
name
symbol
description
creator
totalSupply
holders {
address
balance
}
transactions {
hash
from
to
amount
timestamp
}
}
}
Get User's Personas
query {
user(id: "0x...") {
createdPersonas {
id
name
symbol
totalSupply
}
holdings {
persona {
id
name
symbol
}
balance
}
}
}
REST API
Base URL
https://api.amica.arbius.ai
Endpoints
GET /personas
Retrieve list of all personas with optional filtering.
GET /personas?limit=10&offset=0&sortBy=createdAt&order=desc
Response:
{
"personas": [
{
"address": "0x...",
"name": "Example Persona",
"symbol": "EXAMPLE",
"creator": "0x...",
"totalSupply": "1000000",
"createdAt": 1234567890
}
],
"total": 100,
"limit": 10,
"offset": 0
}
GET /personas/:address
Get detailed information about a specific persona.
GET /personas/0x...
Response:
{
"address": "0x...",
"name": "Example Persona",
"symbol": "EXAMPLE",
"description": "An example AI persona",
"creator": "0x...",
"totalSupply": "1000000",
"liquidityPool": "0x...",
"createdAt": 1234567890,
"holders": 42,
"transactions": 156
}
GET /personas/:address/price
Get current price and market data for a persona token.
GET /personas/0x.../price
Response:
{
"price": "0.0000123",
"priceUsd": "0.045",
"marketCap": "45000",
"volume24h": "1234",
"priceChange24h": "+5.67%",
"liquidity": "12.5"
}
Rate Limits
API rate limits apply to protect service stability:
- REST API: 100 requests per minute per IP
- GraphQL: 1000 queries per hour per IP
- WebSocket: 10 concurrent connections per IP