Developer Guide

Build powerful applications on top of AEGIS-Ω with our comprehensive API and SDK

Smart Contract Integration

Integrate AEGIS-Ω into your smart contracts to leverage AI compute resources and token utilities.

Basic ERC-20 Integration

// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract AegisIntegration { IERC20 public aegisToken; constructor(address _aegisToken) { aegisToken = IERC20(_aegisToken); } function payForAICompute(uint256 amount) public { require( aegisToken.transferFrom(msg.sender, address(this), amount), "Transfer failed" ); // Trigger AI compute job _executeAIJob(amount); } function _executeAIJob(uint256 computeUnits) internal { // Your AI compute logic here } }

Staking Contract Example

contract AegisStaking { IERC20 public aegisToken; mapping(address => uint256) public stakedBalance; mapping(address => uint256) public stakingTimestamp; uint256 public constant APY = 12; // 12% APY function stake(uint256 amount) external { aegisToken.transferFrom(msg.sender, address(this), amount); if (stakedBalance[msg.sender] > 0) { _claimRewards(); } stakedBalance[msg.sender] += amount; stakingTimestamp[msg.sender] = block.timestamp; } function _claimRewards() internal { uint256 timeStaked = block.timestamp - stakingTimestamp[msg.sender]; uint256 reward = (stakedBalance[msg.sender] * APY * timeStaked) / (365 days * 100); // Transfer rewards } }

API Reference

Use our REST API to interact with AEGIS-Ω infrastructure and AI models.

Base URL

https://api.aegis-omega.io/v1

Endpoints

GET/token/balance/:address

Get AEGIS-Ω balance for an address

{ "address": "0x742d35...", "balance": "1000000", "decimals": 18 }
POST/ai/inference

Execute AI model inference

Request:

{ "model": "gpt-4", "prompt": "Your prompt here", "max_tokens": 100, "payment_tx": "0x..." }

Response:

{ "result": "AI response...", "tokens_used": 87, "cost_aegis": "0.05" }
GET/governance/proposals

List active governance proposals

{ "proposals": [ { "id": 1, "title": "Increase AI compute subsidy", "status": "active", "votes_for": 45000000, "votes_against": 12000000 } ] }

SDK Documentation

Use our official SDKs for JavaScript, Python, and Rust to build applications faster.

JavaScript/TypeScript

npm install @aegis/sdk

Python

pip install aegis-sdk

Rust

cargo add aegis-sdk

JavaScript/TypeScript Example

import { AegisClient } from '@aegis/sdk'; const client = new AegisClient({ apiKey: process.env.AEGIS_API_KEY, network: 'ethereum-mainnet' }); // Get token balance const balance = await client.getBalance('0x742d35...'); console.log('Balance:', balance); // Execute AI inference const result = await client.ai.inference({ model: 'gpt-4', prompt: 'Analyze this blockchain transaction', maxTokens: 100 }); console.log('AI Response:', result.text);

Python Example

from aegis_sdk import AegisClient client = AegisClient( api_key=os.getenv('AEGIS_API_KEY'), network='ethereum-mainnet' ) # Get token balance balance = client.get_balance('0x742d35...') print(f'Balance: {balance}') # Execute AI inference result = client.ai.inference( model='gpt-4', prompt='Analyze this blockchain transaction', max_tokens=100 ) print(f'AI Response: {result.text}')

Full Example Projects

Explore complete example projects to jumpstart your development.

AI-Powered NFT Generator

Generate unique NFTs using AI models, paid with AEGIS-Ω

github.com/aegis-omega/nft-generator

DeFi Trading Bot

Automated trading with AI-powered market analysis

github.com/aegis-omega/trading-bot

Governance Dashboard

Full-featured governance voting interface

github.com/aegis-omega/governance-ui

Need Help?

Join our developer community on Discord or check out our GitHub repository for more resources.