SDK Downloads & Development Tools
Official SDKs, libraries, and development tools for integrating with XRPL.Sale platform across multiple programming languages.
Get Started Quickly
Our SDKs provide easy-to-use interfaces for all XRPL.Sale platform features including authentication, investment processing, project management, and real-time updates.
Easy Integration
Simple APIs with comprehensive examples
Type Safety
Full TypeScript support and typed responses
Auto-Updates
Automatic API version compatibility
Popular SDKs
JavaScript/TypeScript
Full-featured SDK with TypeScript support
Installation
npm install @xrplsale/sdk
Quick Start
import { XRPLSaleClient } from '@xrplsale/sdk';
const client = new XRPLSaleClient({
apiKey: 'your-api-key',
environment: 'production' // or 'testnet'
});
// List active projects
const projects = await client.projects.list();
// Get project details
const project = await client.projects.get('proj_abc123');
Features
Python
Pythonic SDK with asyncio support
Installation
pip install xrplsale
Quick Start
from xrplsale import XRPLSaleClient
import asyncio
client = XRPLSaleClient(
api_key='your-api-key',
environment='production'
)
async def main():
# List projects
projects = await client.projects.list()
# Get investment details
investment = await client.investments.get('inv_xyz')
asyncio.run(main())
Features
All Available SDKs
PHP
Laravel & Symfony ready
Go
High performance & concurrency
Java
Spring Boot integration
Ruby
Rails-friendly gem
C# (.NET)
.NET Core & Framework
Developer Tools & Utilities
CLI Tools
Command-line interface for developers
Installation
npm install -g @xrplsale/cli
Available Commands
xrplsale auth login
- Authenticate with API key or walletxrplsale projects list
- List and manage projectsxrplsale analytics platform
- View platform analyticsxrplsale webhooks create
- Manage webhook endpointsQuick Start Examples
JavaScript/TypeScript Example
import { XRPLSaleClient, InvestmentStatus } from '@xrplsale/sdk';
// Initialize client
const client = new XRPLSaleClient({
apiKey: process.env.XRPL_SALE_API_KEY,
environment: 'production'
});
// Example: Create a new project
async function createProject() {
try {
const project = await client.projects.create({
name: 'My DeFi Protocol',
description: 'Revolutionary DeFi protocol on XRPL',
tokenSymbol: 'MDP',
totalSupply: '100000000',
tiers: [
{
tier: 1,
pricePerToken: '0.001',
totalTokens: '20000000'
},
{
tier: 2,
pricePerToken: '0.0015',
totalTokens: '20000000'
}
],
saleStartDate: new Date('2025-02-01'),
saleEndDate: new Date('2025-03-01')
});
console.log('Project created:', project.id);
return project;
} catch (error) {
console.error('Failed to create project:', error.message);
throw error;
}
}
// Example: Monitor investments
async function monitorInvestments(projectId: string) {
const investments = await client.investments.list({
projectId,
status: InvestmentStatus.CONFIRMED
});
for (const investment of investments.data) {
console.log(`Investment ${investment.id}: ${investment.amount} XRP`);
}
}
// Example: Handle webhooks
import express from 'express';
const app = express();
app.use(express.raw({ type: 'application/json' }));
app.post('/webhooks', client.webhooks.middleware(), (req, res) => {
const event = req.body;
switch (event.type) {
case 'investment.created':
handleNewInvestment(event.data);
break;
case 'project.tier_completed':
handleTierCompleted(event.data);
break;
}
res.status(200).send('OK');
});
async function handleNewInvestment(data: any) {
console.log('New investment:', data.amount, 'XRP');
// Send confirmation email
await sendConfirmationEmail(data.investor_account, data.amount);
// Update analytics
await updateInvestmentAnalytics(data.project_id, data.amount);
}
Python Example
import asyncio
import os
from datetime import datetime, timedelta
from xrplsale import XRPLSaleClient, InvestmentStatus
# Initialize client
client = XRPLSaleClient(
api_key=os.getenv('XRPL_SALE_API_KEY'),
environment='production'
)
async def create_project():
"""Create a new project on XRPL.Sale"""
try:
project = await client.projects.create(
name='Python DeFi Project',
description='Advanced DeFi protocol built with Python',
token_symbol='PDP',
total_supply='50000000',
tiers=[
{
'tier': 1,
'price_per_token': '0.002',
'total_tokens': '10000000'
},
{
'tier': 2,
'price_per_token': '0.003',
'total_tokens': '10000000'
}
],
sale_start_date=datetime.now() + timedelta(days=7),
sale_end_date=datetime.now() + timedelta(days=37)
)
print(f"Project created: {project.id}")
return project
except Exception as e:
print(f"Failed to create project: {e}")
raise
async def get_project_analytics(project_id: str):
"""Get detailed analytics for a project"""
try:
analytics = await client.analytics.get_project_stats(project_id)
print(f"Total raised: {analytics.total_raised_xrp} XRP")
print(f"Number of investors: {analytics.investor_count}")
print(f"Current tier: {analytics.current_tier}")
print(f"Completion percentage: {analytics.completion_percentage}%")
return analytics
except Exception as e:
print(f"Failed to get analytics: {e}")
raise
async def process_investments(project_id: str):
"""Process and analyze investments for a project"""
try:
investments = await client.investments.list(
project_id=project_id,
status=InvestmentStatus.CONFIRMED,
limit=100
)
total_amount = 0
tier_distribution = {}
for investment in investments.data:
total_amount += float(investment.amount_xrp)
# Track tier distribution
for tier_allocation in investment.tier_allocations:
tier = tier_allocation.tier
if tier not in tier_distribution:
tier_distribution[tier] = 0
tier_distribution[tier] += float(tier_allocation.amount_xrp)
print(f"Total investments: {total_amount} XRP")
print("Tier distribution:", tier_distribution)
return {
'total_amount': total_amount,
'tier_distribution': tier_distribution
}
except Exception as e:
print(f"Failed to process investments: {e}")
raise
# Flask webhook handler example
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/webhooks/xrpl-sale', methods=['POST'])
def handle_webhook():
"""Handle XRPL.Sale webhook events"""
try:
# Verify webhook signature
if not client.webhooks.verify_signature(
request.get_data(),
request.headers.get('X-XRPL-Sale-Signature'),
os.getenv('WEBHOOK_SECRET')
):
return jsonify({'error': 'Invalid signature'}), 401
event = request.get_json()
# Handle different event types
if event['event_type'] == 'investment.created':
asyncio.create_task(handle_new_investment(event['data']))
elif event['event_type'] == 'project.launched':
asyncio.create_task(handle_project_launched(event['data']))
elif event['event_type'] == 'investment.tokens_distributed':
asyncio.create_task(handle_tokens_distributed(event['data']))
return jsonify({'status': 'success'}), 200
except Exception as e:
print(f"Webhook processing error: {e}")
return jsonify({'error': str(e)}), 500
async def handle_new_investment(data):
"""Handle new investment webhook"""
print(f"New investment: {data['amount_xrp']} XRP")
# Update local database
# Send notifications
# Trigger additional processing