Developer Platform API
Overview
Authentication & Subscription System
Subscription Required
Headers
x-wallet-address: YOUR_WALLET_ADDRESS
Content-Type: application/jsonx-wallet-address: YOUR_WALLET_ADDRESS
Content-Type: application/jsonGET /health{
"success": true,
"message": "Server is running healthy",
"services": {
"solana": "http://localhost:3008",
"binance": "http://localhost:3007"
},
"subscription": {
"enabled": true,
"plans": [
{ "name": "Daily", "price": "10 USDC", "duration": "1 day" },
{ "name": "Weekly", "price": "40 USDC", "duration": "7 days" },
{ "name": "Monthly", "price": "100 USDC", "duration": "30 days" }
]
}
}GET /subscription/plansGET /subscription/status?walletAddress=YOUR_WALLET_ADDRESSPOST /subscription/verify-payment
Content-Type: application/json
{
"transactionHash": "0x...",
"walletAddress": "0x...",
"plan": "daily|weekly|monthly"
}POST /binance/buy
x-wallet-address: YOUR_WALLET_ADDRESS
Content-Type: application/json
{
"tokenAddress": "0x...",
"gasPrice": "5",
"slippage": 10,
"wallets": [
{
"privateKey": "0x...",
"bnbAmount": "0.1"
}
],
"sequential": false,
"skipBalanceValidation": false
}{
"success": true,
"data": {
"results": [
{
"wallet": "0x...",
"success": true,
"transactionHash": "0x...",
"bnbAmount": "0.1",
"tokenAmount": "1000.5",
"gasUsed": "0.002"
}
],
"summary": {
"totalWallets": 1,
"successfulTrades": 1,
"failedTrades": 0,
"totalBnbSpent": "0.1",
"totalTokensReceived": "1000.5"
}
}
}POST /binance/sell
x-wallet-address: YOUR_WALLET_ADDRESS
Content-Type: application/json
{
"tokenAddress": "0x...",
"gasPrice": "5",
"slippage": 10,
"wallets": [
{
"privateKey": "0x...",
"sellPercentage": 100
}
],
"sequential": false,
"skipBalanceValidation": false,
"feeRate": 1,
"feeRecipient": "0xF17Ac4aE0b212f0129988F15BaD4407437BFA091"
}POST /binance/consolidate
x-wallet-address: YOUR_WALLET_ADDRESS
Content-Type: application/json
{
"sourcePrivateKeys": ["0x...", "0x..."],
"destinationAddress": "0x...",
"gasPrice": "5",
"reserveAmount": "0.01"
}POST /binance/distribute
x-wallet-address: YOUR_WALLET_ADDRESS
Content-Type: application/json
{
"sourcePrivateKey": "0x...",
"distributions": [
{
"address": "0x...",
"amount": "0.1"
}
],
"gasPrice": "5"
}POST /binance/createMeme
x-wallet-address: YOUR_WALLET_ADDRESS
Content-Type: application/json
{
"privateKey": "0x...",
"name": "My Meme Token",
"symbol": "MMT",
"description": "A fun meme token",
"imageFile": "base64_encoded_image_data",
"website": "https://example.com",
"twitter": "https://twitter.com/example",
"telegram": "https://t.me/example",
"preSale": false,
"gasPrice": "5",
"buyWallets": [
{
"privateKey": "0x...",
"amount": "0.1",
"slippage": 10
}
]
}POST /solana/buy
x-wallet-address: YOUR_WALLET_ADDRESS
Content-Type: application/json
{
"tokenAddress": "TOKEN_MINT_ADDRESS",
"jitoTip": "0.001",
"slippage": 10,
"wallets": [
{
"privateKey": "BASE58_PRIVATE_KEY",
"solAmount": "0.1"
}
],
"sequential": false,
"skipBalanceValidation": false
}{
"success": true,
"data": {
"results": [
{
"wallet": "WALLET_ADDRESS",
"success": true,
"transactionHash": "SIGNATURE",
"solAmount": "0.1",
"tokenAmount": "1000.5",
"jitoTip": "0.001"
}
],
"summary": {
"totalWallets": 1,
"successfulTrades": 1,
"failedTrades": 0,
"totalSolSpent": "0.1",
"totalTokensReceived": "1000.5"
}
}
}POST /solana/sell
x-wallet-address: YOUR_WALLET_ADDRESS
Content-Type: application/json
{
"tokenAddress": "TOKEN_MINT_ADDRESS",
"jitoTip": "0.001",
"slippage": 10,
"wallets": [
{
"privateKey": "BASE58_PRIVATE_KEY",
"sellPercentage": 100
}
],
"sequential": false,
"skipBalanceValidation": false
}POST /solana/consolidate
x-wallet-address: YOUR_WALLET_ADDRESS
Content-Type: application/json
{
"sourcePrivateKeys": ["PRIVATE_KEY_1", "PRIVATE_KEY_2"],
"destinationAddress": "DESTINATION_ADDRESS",
"jitoTip": "0.001",
"reserveAmount": "0.01"
}POST /solana/distribute
x-wallet-address: YOUR_WALLET_ADDRESS
Content-Type: application/json
{
"sourcePrivateKey": "BASE58_PRIVATE_KEY",
"distributions": [
{
"address": "RECIPIENT_ADDRESS",
"amount": "0.1"
}
],
"jitoTip": "0.001"
}{
"success": false,
"error": "Wallet address required",
"code": "WALLET_ADDRESS_REQUIRED",
"message": "Please provide your wallet address in the x-wallet-address header"
}{
"success": false,
"error": "Active subscription required",
"code": "SUBSCRIPTION_REQUIRED",
"message": "You need an active subscription to access this endpoint. Please purchase a subscription plan.",
"subscriptionUrl": "/subscription/plans"
}{
"success": false,
"error": "Transaction failed",
"message": "Insufficient balance or slippage too low"
}{
"success": false,
"error": "Rate limit exceeded",
"message": "Too many requests. Please try again later."
}const axios = require('axios');
const API_BASE = 'http://localhost:8989';
const WALLET_ADDRESS = 'YOUR_WALLET_ADDRESS';
// Create API client
const apiClient = axios.create({
baseURL: API_BASE,
headers: {
'x-wallet-address': WALLET_ADDRESS,
'Content-Type': 'application/json'
}
});
// Buy tokens on BSC
async function buyTokenBSC(tokenAddress, bnbAmount, privateKey) {
try {
const response = await apiClient.post('/binance/buy', {
tokenAddress,
gasPrice: '5',
slippage: 10,
wallets: [{
privateKey,
bnbAmount
}],
sequential: false
});
return response.data;
} catch (error) {
console.error('Buy failed:', error.response?.data || error.message);
throw error;
}
}
// Buy tokens on Solana
async function buyTokenSolana(tokenAddress, solAmount, privateKey) {
try {
const response = await apiClient.post('/solana/buy', {
tokenAddress,
jitoTip: '0.001',
slippage: 10,
wallets: [{
privateKey,
solAmount
}],
sequential: false
});
return response.data;
} catch (error) {
console.error('Buy failed:', error.response?.data || error.message);
throw error;
}
}import requests
API_BASE = 'http://localhost:8989'
WALLET_ADDRESS = 'YOUR_WALLET_ADDRESS'
class TradingAPI:
def __init__(self, wallet_address):
self.base_url = API_BASE
self.headers = {
'x-wallet-address': wallet_address,
'Content-Type': 'application/json'
}
def buy_token_bsc(self, token_address, bnb_amount, private_key):
payload = {
'tokenAddress': token_address,
'gasPrice': '5',
'slippage': 10,
'wallets': [{
'privateKey': private_key,
'bnbAmount': bnb_amount
}],
'sequential': False
}
response = requests.post(
f'{self.base_url}/binance/buy',
json=payload,
headers=self.headers
)
return response.json()
def check_subscription_status(self):
response = requests.get(
f'{self.base_url}/subscription/status',
params={'walletAddress': self.headers['x-wallet-address']}
)
return response.json()
# Usage
api = TradingAPI(WALLET_ADDRESS)
status = api.check_subscription_status()
print(f"Subscription status: {status}")