API Documentation
Complete guide for integrating Roocoin API into your social media platform
Quick Start
Base URL for all API requests:
https://roocoin-production.up.railway.app
Authentication
Protected endpoints require an API key in the request header
x-api-key: SocialMediaTeam2026SecretKey
Contract Addresses
Deployed smart contracts on Sepolia testnet
0xADa01bA7F3D8E8aD99aB74ddE5F900198c45Fe1A
0xC677da73bAF20fEE2AB48F2bFEcf97212eaBa661
API Endpoints
Available endpoints for blockchain interactions
Check if the API is running
curl https://roocoin-production.up.railway.app/health
{
"status": "ok",
"timestamp": "2026-02-02T12:22:12.455Z",
"network": "sepolia"
}
Get ROO token balance for a wallet address
curl https://roocoin-production.up.railway.app/api/wallet/balance/0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1
{
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1",
"balance": "1000.0",
"formattedBalance": "1,000.00 ROO"
}
Distribute ROO tokens to a user for a specific activity
curl -X POST https://roocoin-production.up.railway.app/api/rewards/distribute \
-H "Content-Type: application/json" \
-H "x-api-key: SocialMediaTeam2026SecretKey" \
-d '{
"userAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1",
"activityType": "POST_CREATE",
"metadata": {"postId": "12345"}
}'
{
"success": true,
"transactionHash": "0x123abc...",
"reward": "10",
"activityType": "POST_CREATE",
"recipient": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1"
}
Distribute rewards to multiple users (more gas-efficient)
curl -X POST https://roocoin-production.up.railway.app/api/rewards/batch-distribute \
-H "Content-Type: application/json" \
-H "x-api-key: SocialMediaTeam2026SecretKey" \
-d '{
"distributions": [
{"userAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1", "amount": "10"},
{"userAddress": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", "amount": "5"}
]
}'
Award viral bonus based on engagement count. 1 ROOBYTES per 1000 engagements (likes + comments + shares)
curl -X POST https://roocoin-production.up.railway.app/api/rewards/viral \
-H "Content-Type: application/json" \
-H "x-api-key: SocialMediaTeam2026SecretKey" \
-d '{
"userAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1",
"postId": "viral-post-123",
"engagementCount": 5000,
"breakdown": {"likes": 2000, "comments": 1500, "shares": 1500}
}'
{
"success": true,
"txHash": "0xviral123...",
"amount": 5,
"postId": "viral-post-123",
"engagementCount": 5000,
"breakdown": {"likes": 2000, "comments": 1500, "shares": 1500},
"calculation": "5000 engagements รท 1000 = 5 ROOBYTES"
}
๐ฅ Viral Bonus: Content creators are rewarded dynamically based on their engagement performance. Minimum 1000 engagements required.
Award referral bonus after user completes verification. 10 ROOBYTES to referrer when referee completes first post or verification
curl -X POST https://roocoin-production.up.railway.app/api/rewards/referral/verify \
-H "Content-Type: application/json" \
-H "x-api-key: SocialMediaTeam2026SecretKey" \
-d '{
"referrerAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1",
"refereeAddress": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
"verificationAction": "FIRST_POST"
}'
{
"success": true,
"txHash": "0xreferral456...",
"amount": 10,
"referrerAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1",
"refereeAddress": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
"verificationAction": "FIRST_POST",
"message": "Referral bonus awarded: 10 ROOBYTES"
}
๐ฅ Smart Referrals: Prevents abuse by only rewarding referrers after their referees demonstrate genuine engagement.
Create a new custodial wallet for a user (platform stores private key securely)
curl -X POST https://roocoin-production.up.railway.app/api/wallet/create \
-H "Content-Type: application/json" \
-d '{}'
{
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1",
"privateKey": "0xabc123...",
"mnemonic": "word1 word2 word3..."
}
โ ๏ธ IMPORTANT: Store privateKey encrypted in your database. Never expose it to users.
Manual wallet crediting by admin. Requires authentication with x-api-key header. Not for public use
curl -X POST https://roocoin-production.up.railway.app/api/wallet/faucet \\
-H "Content-Type: application/json" \\
-H "x-api-key: YOUR_PLATFORM_API_KEY" \\
-d '{
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"amount": "100"
}'
{
"success": true,
"message": "Admin credit successful",
"amount": "100",
"recipient": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"transactionHash": "0xabc123...",
"newBalance": "150.5",
"creditedBy": "admin"
}
๐ Admin Authentication Required: Public faucet disabled. Only authorized admins can credit user wallets.
โฝ Percentage-Based Fee System
All transactions use a percentage-based fee model. Posting is FREE!
- Transaction fee: 1% of the amount
- Gas fee: 0.5% of the amount (covers ETH costs)
- Total fee: 1.5% of transaction amount
- Example: Send 100 ROOBYTES = 101.5 total (100 + 1% + 0.5%)
- Free posting (amount: 0) requires no fees or transaction
Deduct ROOBYTES when user spends on platform. Creating posts is now FREE (amount: 0). + 0.1 ROOBYTES gas fee (only if amount > 0)
curl -X POST https://roocoin-production.up.railway.app/api/wallet/spend \
-H "Content-Type: application/json" \
-d '{
"userPrivateKey": "0xabc123...",
"amount": "0",
"activityType": "POST_CREATE",
"metadata": {"postId": "12345"}
}'
{
"success": true,
"transactionHash": null,
"userAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1",
"amount": "0",
"gasFee": "0",
"totalCharged": "0",
"activityType": "POST_CREATE",
"remainingBalance": "100.00",
"metadata": {"postId": "12345"},
"message": "Free activity - no transaction required"
}
Transfer ROOBYTES from custodial wallet to user's external MetaMask wallet. + 1% withdrawal fee + 0.1 ROOBYTES gas fee
curl -X POST https://roocoin-production.up.railway.app/api/wallet/transfer \
-H "Content-Type: application/json" \
-d '{
"fromPrivateKey": "0xabc123...",
"toAddress": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
"amount": "100"
}'
{
"success": true,
"transactionHash": "0xghi789...",
"collectionHash": "0xabc123...",
"from": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1",
"to": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
"amount": "100",
"withdrawalFee": "1.0000 (1%)",
"gasFee": "0.1",
"totalCharged": "101.1000",
"breakdown": {
"transferAmount": "100",
"withdrawalFee": "1.0000",
"gasFee": "0.1",
"total": "101.1000"
}
}
๐ฐ Withdrawal Fee: 1% of transfer amount is charged to prevent abuse and support platform sustainability.
Peer-to-peer transfer - User sends ROOBYTES to another user on the platform. + 1% transaction fee + 0.5% gas fee
curl -X POST https://roocoin-production.up.railway.app/api/wallet/send \
-H "Content-Type: application/json" \
-d '{
"fromPrivateKey": "0xabc123...",
"toAddress": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
"amount": "10",
"metadata": {"note": "Thanks for the help!"}
}'
{
"success": true,
"transactionHash": "0xjkl012...",
"collectionHash": "0xdef456...",
"from": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1",
"to": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
"amount": "10",
"transactionFee": "0.1000 (1%)",
"gasFee": "0.0500 (0.5%)",
"totalCharged": "10.1500",
"remainingBalance": "89.8500",
"breakdown": {
"sendAmount": "10",
"transactionFee": "0.1000",
"gasFee": "0.0500",
"totalFees": "0.1500",
"total": "10.1500"
},
"metadata": {"note": "Thanks for the help!"}
}
๐ก Use case: Tipping creators, sending gifts, splitting rewards. Percentage fees ensure fair costs at any amount.
Wallet Integration Flow
Complete user journey for custodial wallet management
/api/wallet/create โ User gets custodial wallet/api/wallet/faucet (with API key) โ User gets credited/api/wallet/spend (1 ROO) โ Post created/api/rewards/distribute โ User earns ROO/api/wallet/transfer โ ROO sent to their walletStatistics & Analytics
Real-time blockchain metrics for admin dashboard
Get all statistics in a single call (optimized for admin dashboard)
curl https://roocoin-production.up.railway.app/api/stats/dashboard
{
"success": true,
"data": {
"circulation": {
"total": "1000000.0",
"symbol": "ROO",
"label": "Total Circulation"
},
"treasury": {
"balance": "500000.0",
"address": "0x0cB2Fdc39Cf998BaA86E80099aC4E9cB998adD54",
"symbol": "ROO",
"label": "Reserve Balance"
},
"staking": {
"totalLocked": "250000.0",
"contract": "0xC677da73bAF20fEE2AB48F2bFEcf97212eaBa661",
"symbol": "ROO",
"label": "Total Staked"
},
"lifetime": {
"minted": "1000000.0",
"burned": "0.0",
"symbol": "ROO"
},
"network": "sepolia",
"timestamp": "2026-02-11T00:00:00.000Z"
}
}
Total circulation of ROO tokens
Platform reserve balance
Total ROO locked in staking
Lifetime minting (all rewards)
Lifetime burning (removed from circulation)
Smart contract addresses and network
๐ก Performance Tip: Use /api/stats/dashboard for admin dashboards to get all metrics in one call instead of making multiple requests.
Activity Types & Rewards
Reward amounts for different social media activities
| Activity Type | Reward (ROO) | Description |
|---|---|---|
POST_CREATE |
0 (FREE) | User creates a post - now free! |
POST_LIKE |
0.01 | User likes a post |
POST_COMMENT |
0 | Disabled |
POST_SHARE |
0.01 | User shares a post |
REFERRAL |
10 | User refers another user (after verification) |
PROFILE_FOLLOW |
0.1 | User follows a profile |
DAILY_LOGIN |
0.1 | User logs in daily |
CONTENT_VIRAL |
1 per 1000 engagements | Dynamic viral bonus (use /api/rewards/viral) |
Integration Examples
Sample code for popular programming languages
JavaScript / Node.js
const axios = require('axios');
const API_BASE = 'https://roocoin-production.up.railway.app';
const API_KEY = 'SocialMediaTeam2026SecretKey';
async function rewardPostCreation(userAddress, postId) {
const response = await axios.post(
`${API_BASE}/api/rewards/distribute`,
{
userAddress: userAddress,
activityType: 'POST_CREATE',
metadata: { postId: postId }
},
{
headers: {
'Content-Type': 'application/json',
'x-api-key': API_KEY
}
}
);
return response.data;
}
// Usage
rewardPostCreation('0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1', 'post_12345');
Python
import requests
API_BASE = 'https://roocoin-production.up.railway.app'
API_KEY = 'SocialMediaTeam2026SecretKey'
def reward_post_creation(user_address, post_id):
url = f'{API_BASE}/api/rewards/distribute'
headers = {
'Content-Type': 'application/json',
'x-api-key': API_KEY
}
data = {
'userAddress': user_address,
'activityType': 'POST_CREATE',
'metadata': {'postId': post_id}
}
response = requests.post(url, json=data, headers=headers)
return response.json()
# Usage
reward_post_creation('0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1', 'post_12345')
Error Handling
Common HTTP status codes and error responses
{
"error": "Error message",
"details": "Additional details if available"
}
Important Notes
- Testnet Only: All transactions are on Sepolia testnet for testing purposes
- Gas Fees: Gas fees are paid by the platform, not end users
- Transaction Speed: Sepolia block time is ~12 seconds; expect 15-30 second confirmations
- Batch Operations: Use batch endpoints when distributing to multiple users for better gas efficiency
- Rate Limiting: Consider implementing rate limiting on your end to prevent abuse