Getting Started
This guide will get you all set up and ready to use the Aori API. We'll cover how to get started using one of our SDK's and how to make your first API request. We'll also look at where to go next to find all the information you need to take full advantage of the Execution API.
Interacting with the Aori API currently requires an API key, visit the Aori Developer Portal to receive an integrator ID to be provided tracking and analytics on your integration.
Introduction
URL's | |
---|---|
https://api.aori.io | HTTP API to be able to execute intents. |
wss://api.aori.io | WebSocket API for real time event streaming. |
Endpoints | Method | Description |
---|---|---|
/quote | POST | Request a price quote for cross-chain swaps |
/swap | POST | Submit a signed swap order for execution |
/chains | GET | Get information about supported blockchain networks |
/domain | GET | Get EIP-712 domain information for typed data signing |
/tokens | GET | Get information about supported tokens across networks |
/data/query | GET | Query historical orders with filtering and pagination |
/data/status | GET | Get current status and execution details of an order |
/data/details | GET | Get comprehensive order details with event history |
/stream | Websocket | Real-time WebSocket stream for order events |
Choosing your Client
Before making your first API request, you need to pick which API client you will use.
# Install the TypeScript SDK
npm install @aori-io/aori-ts --save
The recommended way to interact with the Aori API is by using one of our SDKs. Today, Aori offers fine-tuned Typescript and Rust libraries to make your integration as easy as possible and give you the best experience when interacting with Aori.
API Key Authentication
While the Aori API doesn't require authentication for basic usage, we recommend obtaining an API key from the Aori Developer Portal for enhanced tracking and analytics.
Using API Keys
const apiKey = process.env.AORI_API_KEY;
// Include API key in any request
const quote = await getQuote(quoteRequest, 'https://api.aori.io', apiKey);
const swap = await submitSwap(swapRequest, 'https://api.aori.io', apiKey);
Making your first API request
After picking your preferred client, you are ready to make your first call to Aori. Let's start by checking the API health status.
Check Connectivity
curl https://api.aori.io/health
Response
{
"status": "ok"
}
Aori Instance Usage
The Aori
class provides a stateful interface for interacting with the Aori protocol. It manages chain information, domain data, and token metadata.
Creating an Instance
Instance Creation
import { Aori } from '@aori-io/aori-ts';
// Basic usage
const aori = await Aori.create();
// With API key and token pre-loading
const aori = await Aori.create(
'https://api.aori.io',
'wss://api.aori.io',
'your_api_key',
true // Load tokens during initialization
);
Core Operations
Essential Methods
// Chain information
const allChains = aori.getAllChains();
const ethereum = aori.getChain('ethereum');
// Token management
await aori.loadTokens('ethereum');
const tokens = aori.getTokens('ethereum');
const allTokens = aori.getAllTokens();
// Trading operations
const quote = await aori.getQuote(quoteRequest);
const { signature } = await aori.signReadableOrder(quote, signer, userAddress);
const result = await aori.executeSwap(quote, swapConfig);
// Order tracking
const status = await aori.getOrderStatus(orderHash);
const orders = await aori.queryOrders({ offerer: userAddress });
Native Token Support
Native Token Operations
import { NATIVE_TOKEN_ADDRESS } from '@aori-io/aori-ts';
// Check if token is native ETH
const isNative = aori.isNativeToken(NATIVE_TOKEN_ADDRESS);
// Execute native swap
const nativeConfig = {
type: 'native' as const,
txExecutor: {
sendTransaction: (tx) => wallet.sendTransaction(tx)
}
};
const result = await aori.executeSwap(quote, nativeConfig);
---
## What's next? {{ title: 'Core Concepts' }}
Great, now you're set up with the Aori SDK and have made your first request. Here's concepts to explore next to build powerful cross-chain applications:
### Quotes
Request pricing for cross-chain swaps with real-time market data. Quotes include all necessary parameters for order creation.
[Learn more about quotes →](/developers/quotes)
### Swaps
Submit signed orders to execute cross-chain swaps. Swaps are atomic operations with guaranteed settlement or refund.
[Learn more about swaps →](/developers/swaps)
### Orders
Work with order structures and lifecycle management. Track orders from creation through completion.
[Learn more about orders →](/developers/orders)
### Status Tracking
Monitor order execution in real-time with status updates and transaction hashes for both source and destination chains.
[Learn more about status tracking →](/developers/status)
### Signatures
Cryptographically sign orders using your private key or wallet to authorize cross-chain swaps securely.
[Learn more about signatures →](/developers/signatures)
### WebSocket Streaming
Monitor order events in real-time with WebSocket connections and event subscriptions for live updates.
[Learn more about WebSocket streaming →](/developers/websockets)
### Data & Querying
Query historical orders with advanced filtering and pagination for analytics and order management.
[Learn more about data querying →](/developers/data)
### Supported Chains
Learn about supported blockchain networks, chain identifiers, and contract addresses.
[Learn more about supported chains →](/developers/chains)
### Native Token Support
Work with native tokens (ETH) directly without requiring wrapped tokens. Includes quotes, swaps, and transaction execution.
[Learn more about native tokens →](/developers/native-tokens)