Supported Chains
The Aori protocol operates across multiple blockchain networks, enabling seamless cross-chain swaps. This page covers all supported chains, how to retrieve chain information, and working with chain-related data structures.
Supported Networks
The Aori SDK supports the following blockchain networks:
Chain | Chain Key | Chain ID | EID | Contract Address |
---|---|---|---|---|
Ethereum | ethereum | 1 | 30101 | 0x5F3CB376fb82402FcF6d917fD729542537b9C6ad |
Base | base | 8453 | 30184 | 0xF7c908EAA65FE48B201a5CD809Df9D28BdcB2C39 |
Arbitrum | arbitrum | 42161 | 30110 | 0x0e9018EEEbA45d70A9087d5d05295843afa3160a |
Optimism | optimism | 10 | 30111 | 0x684986544162a2c4cE4a6879981a4969b2c19E92 |
Chain Identifiers
Each chain can be referenced using multiple identifiers:
- Chain Key: Human-readable string identifier (e.g.,
"ethereum"
,"base"
) - Chain ID: Standard EVM chain identifier used by wallets and RPC providers
- EID: LayerZero Endpoint ID used for cross-chain messaging
- Contract Address: Aori protocol contract deployed on each chain
getChains
function
Retrieve information about all supported blockchain networks in the Aori protocol.
- Name
baseUrl
- Type
- string
- Description
API base URL (defaults to
https://api.aori.io
)
- Name
apiKey
- Type
- string
- Description
API key for authentication
Returns: ChainInfo[]
Basic Usage
import { getChains } from '@aori/aori-ts';
const chains = await getChains();
console.log('Supported chains:', chains.length);
chains.forEach(chain => {
console.log(`${chain.chainKey}: Chain ID ${chain.chainId}`);
});
Response
[
{
chainKey: "ethereum",
chainId: 1,
eid: 30101,
address: "0x5F3CB376fb82402FcF6d917fD729542537b9C6ad"
},
{
chainKey: "base",
chainId: 8453,
eid: 30184,
address: "0xF7c908EAA65FE48B201a5CD809Df9D28BdcB2C39"
},
{
chainKey: "arbitrum",
chainId: 42161,
eid: 30110,
address: "0x0e9018EEEbA45d70A9087d5d05295843afa3160a"
},
{
chainKey: "optimism",
chainId: 10,
eid: 30111,
address: "0x684986544162a2c4cE4a6879981a4969b2c19E92"
}
]
ChainInfo
type
The ChainInfo
interface provides metadata about supported blockchain networks in the Aori protocol.
- Name
chainKey
- Type
- string
- Description
Human-readable chain identifier used in API requests
- Name
chainId
- Type
- number
- Description
Standard EVM chain ID used by wallets and RPC providers
- Name
eid
- Type
- number
- Description
LayerZero endpoint ID for cross-chain messaging
- Name
address
- Type
- string
- Description
Aori protocol contract address deployed on this chain
ChainInfo Interface
interface ChainInfo {
chainKey: string;
chainId: number;
eid: number;
address: string;
}
Example
const chainInfo: ChainInfo = {
chainKey: "ethereum",
chainId: 1,
eid: 30101,
address: "0x5F3CB376fb82402FcF6d917fD729542537b9C6ad"
};
Working with Chains
Finding Chain Information
Chain Lookup Utilities
import { getChains } from '@aori/aori-ts';
const chains = await getChains();
// Find chain by chain key
function getChainByKey(chainKey: string) {
return chains.find(chain => chain.chainKey === chainKey);
}
// Find chain by chain ID
function getChainById(chainId: number) {
return chains.find(chain => chain.chainId === chainId);
}
// Find chain by LayerZero EID
function getChainByEid(eid: number) {
return chains.find(chain => chain.eid === eid);
}
// Usage examples
const ethereum = getChainByKey('ethereum');
const base = getChainById(8453);
const arbitrum = getChainByEid(30110);
Validating Chain Support
Chain Validation
async function validateChainSupport(inputChain: string, outputChain: string) {
const chains = await getChains();
const supportedChainKeys = chains.map(chain => chain.chainKey);
if (!supportedChainKeys.includes(inputChain)) {
throw new Error(`Input chain "${inputChain}" is not supported`);
}
if (!supportedChainKeys.includes(outputChain)) {
throw new Error(`Output chain "${outputChain}" is not supported`);
}
return true;
}
// Usage
try {
await validateChainSupport('ethereum', 'base');
console.log('✅ Chain pair is supported');
} catch (error) {
console.error('❌ Chain validation failed:', error.message);
}