RYS API Service

White-label Solana token account recovery. Integrate our battle-tested infrastructure into your app and earn fees on every transaction.

๐Ÿ”Œ

Plug & Play

Simple REST API. Get your API key and start integrating in minutes. No complex setup required.

๐Ÿ’ฐ

Earn Revenue

Keep 70% of the 15% fee on every transaction. Your users recover SOL, you earn passive income.

๐Ÿ”’

Secure by Design

Returns unsigned transactions. Private keys never leave your users' devices.

โšก

Battle-Tested

Powered by RefundYourSOL infrastructure. Millions of accounts closed, thousands of SOL recovered.

๐Ÿ“Š Fee Structure

Total fee is 15% of recovered SOL. This is split between you and the RYS platform.

85%
User Keeps
10.5%
You Earn
4.5%
RYS Platform

Example: User recovers 1 SOL โ†’ User gets 0.85 SOL, You earn 0.105 SOL, Platform gets 0.045 SOL

๐Ÿš€ Quick Start

// 1. Check wallets for closeable accounts
const response = await fetch('https://api.refundyoursol.com/api/v1/check', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'X-API-Key': 'your_api_key_here'
    },
    body: JSON.stringify({
        walletAddresses: ['wallet1...', 'wallet2...']
    })
});

const data = await response.json();
console.log(data.totals.totalEstimatedReturn); // SOL user will receive

๐Ÿ“– API Reference

All API endpoints require the X-API-Key header.

POST /api/v1/check

Check wallets for empty token accounts and estimate recovery.

// Request
{
    "walletAddresses": ["wallet1...", "wallet2..."]  // Max 20 wallets
}

// Response
{
    "success": true,
    "wallets": [{
        "address": "wallet1...",
        "emptyTokenAccounts": 15,
        "accountsWithBalance": 3,
        "walletBalance": 0.5,
        "potentialRecovery": 0.0306,
        "estimatedReturn": 0.026,
        "fee": 0.0046,
        "canProcess": true
    }],
    "totals": {
        "totalEmptyAccounts": 15,
        "totalPotentialRecovery": 0.0306,
        "totalEstimatedReturn": 0.026
    }
}

POST /api/v1/close

Generate unsigned transactions to close token accounts. Client signs and submits.

// Request
{
    "walletAddresses": ["wallet1..."],
    "refundWallet": "destination...",  // Optional: where to send recovered SOL
    "burnAccounts": false              // Optional: burn tokens before closing
}

// Response
{
    "success": true,
    "walletTransactions": {
        "wallet1...": [{
            "transaction": "base64_encoded_unsigned_tx",
            "accountsInTx": 10,
            "estimatedFee": 0.003
        }]
    },
    "summary": {
        "totalAccountsToClose": 10,
        "totalPotentialRecovery": 0.0204,
        "totalFee": 0.00306,
        "userReturn": 0.01734
    }
}

POST /api/v1/confirm

Log completed transactions for tracking and stats.

// Request
{
    "walletAddress": "wallet1...",
    "signature": "tx_signature...",
    "accountsClosed": 10,
    "solRecovered": 0.0204
}

// Response
{
    "success": true,
    "message": "Transaction logged successfully",
    "stats": {
        "accountsClosed": 10,
        "solRecovered": 0.0204,
        "ownerFeeEarned": 0.00214
    }
}

GET /api/v1/stats

Get your API key statistics and recent transactions.

// Response
{
    "success": true,
    "stats": {
        "totalRequests": 1250,
        "totalAccountsClosed": 8500,
        "totalSolRecovered": 17.34,
        "totalFeesEarned": 1.82,
        "feeWallet": "your_fee_wallet...",
        "createdAt": "2024-01-15T10:30:00Z",
        "lastUsedAt": "2024-12-21T15:45:00Z"
    },
    "recentTransactions": [...]
}

๐Ÿ’ป Full Integration Example

import { Connection, Keypair, VersionedTransaction } from '@solana/web3.js';
import bs58 from 'bs58';

const API_KEY = 'your_api_key_here';
const API_BASE = 'https://api.refundyoursol.com';

async function recoverSOL(walletAddress, privateKey) {
    // 1. Check for closeable accounts
    const checkRes = await fetch(`${API_BASE}/api/v1/check`, {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'X-API-Key': API_KEY
        },
        body: JSON.stringify({ walletAddresses: [walletAddress] })
    });
    
    const checkData = await checkRes.json();
    const wallet = checkData.wallets[0];
    
    if (wallet.emptyTokenAccounts === 0) {
        console.log('No accounts to close');
        return;
    }
    
    console.log(`Found ${wallet.emptyTokenAccounts} accounts, estimated return: ${wallet.estimatedReturn} SOL`);
    
    // 2. Get unsigned transactions
    const closeRes = await fetch(`${API_BASE}/api/v1/close`, {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'X-API-Key': API_KEY
        },
        body: JSON.stringify({ walletAddresses: [walletAddress] })
    });
    
    const closeData = await closeRes.json();
    const transactions = closeData.walletTransactions[walletAddress];
    
    // 3. Sign and submit each transaction
    const connection = new Connection('https://api.mainnet-beta.solana.com');
    const keypair = Keypair.fromSecretKey(bs58.decode(privateKey));
    
    for (const txData of transactions) {
        // Decode transaction
        const txBuffer = Buffer.from(txData.transaction, 'base64');
        const tx = VersionedTransaction.deserialize(txBuffer);
        
        // Sign
        tx.sign([keypair]);
        
        // Submit
        const signature = await connection.sendTransaction(tx);
        console.log(`TX sent: ${signature}`);
        
        // Wait for confirmation
        await connection.confirmTransaction(signature);
        
        // 4. Log the transaction
        await fetch(`${API_BASE}/api/v1/confirm`, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                'X-API-Key': API_KEY
            },
            body: JSON.stringify({
                walletAddress,
                signature,
                accountsClosed: txData.accountsInTx,
                solRecovered: txData.accountsInTx * 0.00203928
            })
        });
    }
    
    console.log('Recovery complete!');
}

// Usage
recoverSOL('your_wallet_address', 'your_private_key');

๐Ÿ”‘ Your API Key

๐Ÿ’Ž Simple Pricing

No setup fees. No monthly fees. You only pay when you earn.

Free

to get started

  • โœ“ Unlimited API requests
  • โœ“ Keep 70% of the 15% fee (10.5% of recovered SOL)
  • โœ“ Real-time statistics dashboard
  • โœ“ Full documentation & examples
  • โœ“ Telegram support
Get Your API Key โ†’

Contact us on Telegram to get your API key