Build your first compliant DeFi transaction in under 5 minutes.
Register at ilal.tech/login, then go to the API Keys dashboard and click Create API Key.
ilal_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxCheck the health endpoint — no auth required:
curl https://ilalapi-production.up.railway.app/api/v1/health{
"status": "ok",
"service": "ILAL API",
"database": "connected"
}Call POST /defi/swap with your API key. The API returns unsigned calldata — you sign and broadcast it with your own wallet.
curl -X POST https://ilalapi-production.up.railway.app/api/v1/defi/swap \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tokenIn": "0x4200000000000000000000000000000000000006",
"tokenOut": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amount": "1000000000000000",
"zeroForOne": true,
"userAddress": "YOUR_WALLET_ADDRESS"
}'{
"success": true,
"transaction": {
"to": "0x2aaf6c55...",
"data": "0xf3cd914c...",
"value": "0x0",
"chainId": 84532,
"gas": "0x1E8480"
},
"instructions": {
"network": "Base Sepolia (chainId: 84532)",
"rpcUrl": "https://sepolia.base.org"
}
}Take result.transaction and send it with your own signer — ethers.js, viem, or wagmi.
import { ethers } from 'ethers';
const provider = new ethers.JsonRpcProvider('https://sepolia.base.org');
const signer = new ethers.Wallet(YOUR_PRIVATE_KEY, provider);
// 1. Build the tx via ILAL API
const res = await fetch('https://ilalapi-production.up.railway.app/api/v1/defi/swap', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
tokenIn: '0x4200000000000000000000000000000000000006',
tokenOut: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
amount: '1000000000000000',
zeroForOne: true,
userAddress: await signer.getAddress(),
}),
});
const { transaction } = await res.json();
// 2. Sign and broadcast — your key, your transaction
const tx = await signer.sendTransaction(transaction);
console.log('Tx hash:', tx.hash);
await tx.wait();
console.log('Swap confirmed ✓');import { createWalletClient, createPublicClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { baseSepolia } from 'viem/chains';
const account = privateKeyToAccount(YOUR_PRIVATE_KEY);
const walletClient = createWalletClient({ account, chain: baseSepolia, transport: http() });
// 1. Build the tx
const res = await fetch('https://ilalapi-production.up.railway.app/api/v1/defi/swap', {
method: 'POST',
headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
tokenIn: '0x4200000000000000000000000000000000000006',
tokenOut: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
amount: '1000000000000000',
zeroForOne: true,
userAddress: account.address,
}),
});
const { transaction } = await res.json();
// 2. Send — your key, your transaction
const hash = await walletClient.sendTransaction({
to: transaction.to,
data: transaction.data,
value: BigInt(transaction.value),
});
console.log('Tx hash:', hash);