/domain
Retrieve EIP-712 domain information required for typed data signing when creating and signing orders in the Aori protocol. This endpoint provides the domain parameters needed to construct valid EIP-712 signatures.
Request
No request parameters required. This endpoint returns the current domain configuration for the Aori protocol.
Headers
- Name
x-api-key
- Type
- string
- Description
Optional API key for enhanced tracking and analytics
cURL
curl https://api.aori.io/domain \
-H "x-api-key: your_api_key_here"
Response
Returns the EIP-712 domain information object containing all parameters needed for typed data signing.
- Name
name
- Type
- string
- Description
The name of the signing domain (typically "Aori")
- Name
version
- Type
- string
- Description
The current version of the protocol domain
- Name
domainTypeString
- Type
- string
- Description
The EIP-712 domain type string used for signature construction
- Name
orderTypeString
- Type
- string
- Description
The EIP-712 order type string defining the order structure for signatures
Response
{
"name": "Aori",
"version": "0.3.1",
"domainTypeString": "EIP712Domain(string name,string version,address verifyingContract)",
"orderTypeString": "Order(uint128 inputAmount,uint128 outputAmount,address inputToken,address outputToken,uint32 startTime,uint32 endTime,uint32 srcEid,uint32 dstEid,address offerer,address recipient)"
}
Usage in SDK
The domain information is automatically fetched and cached when creating an Aori instance:
import { Aori } from '@aori-io/aori-ts';
// Domain information is automatically loaded during initialization
const aori = await Aori.create();
// Access cached domain information
const domainInfo = aori.getDomain();
console.log(domainInfo?.name); // "Aori"
console.log(domainInfo?.version); // "0.3.1"
You can also fetch domain information directly using the standalone function:
import { getDomain } from '@aori-io/aori-ts';
const domainInfo = await getDomain('https://api.aori.io', 'your_api_key');
EIP-712 Signing Integration
The domain information is essential for creating valid EIP-712 signatures when signing orders:
import { signReadableOrder } from '@aori-io/aori-ts';
// Get a quote first
const quote = await aori.getQuote(quoteRequest);
// Sign the order using EIP-712 with domain information
const { signature, orderHash } = await signReadableOrder(
quote,
signer,
userAddress,
'https://api.aori.io',
'your_api_key'
);
The SDK automatically uses the cached domain information when signing orders, ensuring compatibility with the Aori protocol's current domain configuration.