Developer Documentation

Build on Unykorn X with comprehensive APIs, SDKs, and integration guides.

📚

API Reference

Complete REST API documentation with examples and SDKs

View Documentation →
🔌

WebSocket Feeds

Real-time price updates, transaction notifications, and ledger streams

View Documentation →
⚙️

SDKs

JavaScript, Python, Go, and Rust client libraries

View Documentation →

REST API

Base URL: https://api.unykornx.com/v1

Authentication

# Include API key in Authorization header
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.unykornx.com/v1/account

Get Account Balance

# GET /v1/account/:address
curl https://api.unykornx.com/v1/account/rAddress...
# Response
{
"address": "rAddress...",
"xrp_balance": "3.999800",
"balances": [
{ "currency": "USDT", "value": "185000000", "issuer": "rE85..." },
{ "currency": "EUR", "value": "50000000", "issuer": "rE85..." }
]
}

Get Exchange Quote

# GET /v1/quote?from=USDT&to=XRP&amount=1000
curl "https://api.unykornx.com/v1/quote?from=USDT&to=XRP&amount=1000"
# Response
{
"from": "USDT",
"to": "XRP",
"amount_in": "1000",
"amount_out": "3846.15",
"rate": "0.2600",
"slippage": "0.12%",
"valid_until": "2025-11-17T12:35:00Z"
}

Execute Swap

# POST /v1/swap
curl -X POST https://api.unykornx.com/v1/swap \
-H "Content-Type: application/json" \
-d '{"from": "USDT", "to": "XRP", "amount": "1000", "wallet": "rAddress...", "signature": "..."}'
# Response
{
"transaction_hash": "ABC123...",
"status": "success",
"amount_out": "3846.15"
}

WebSocket Feeds

WebSocket URL: wss://ws.unykornx.com/v1

Subscribe to Price Updates

// JavaScript example
const ws = new WebSocket('wss://ws.unykornx.com/v1');
ws.onopen = () => {
ws.send(JSON.stringify({
"type": "subscribe",
"channel": "prices",
"pairs": ["USDT/XRP", "GOLD/USDT"]
}));
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log(data); // { pair: "USDT/XRP", price: "0.2600", ... }
};

SDKs & Libraries

JavaScript/TypeScript

# Install
npm install @unykornx/sdk
# Usage
import { UnykornX } from '@unykornx/sdk';
const client = new UnykornX({ apiKey: 'YOUR_KEY' });
const balance = await client.getBalance('rAddress...');

Python

# Install
pip install unykornx
# Usage
from unykornx import UnykornX
client = UnykornX(api_key='YOUR_KEY')
balance = client.get_balance('rAddress...')

Architecture Documentation

For detailed system architecture, node topology, and integration guides, see our comprehensive documentation: