Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xentfi.com/llms.txt

Use this file to discover all available pages before exploring further.

This guide covers setting up your development environment for testing and integrating XentFi APIs.

Test Networks

XentFi provides test networks for all supported blockchains to help you develop and test without using real funds.

Available Testnets

NetworkChain IDFaucet URLNative Token
Sepolia11155111Get ETHETH
Base Sepolia84532Get ETHETH
Mumbai80001Get MATICMATIC
Arbitrum Sepolia421614Get ETHETH
Optimism Sepolia11155420Get ETHETH
BNB Testnet97Get BNBBNB
Solana Devnet1Get SOLSOL

Development vs Production Comparison

AspectDevelopmentProduction
NetworkTestnet (Sepolia, Mumbai, etc.)Mainnet
API KeysSandbox keysProduction keys
FundsFaucet tokens (free)Real cryptocurrency
Transaction CostFree (testnet gas)Real gas fees
Rate LimitsHigher limitsStandard limits
MonitoringOptionalRequired
WebhooksUse ngrok for local testingProduction endpoints

Environment Setup

1. Get Sandbox API Keys

1

Log into Dashboard

2

Create Sandbox Keys

Navigate to Settings → API Keys and select “Sandbox” environment
3

Save Credentials

Copy your sandbox apiKey and appId

2. Configure Environment Variables

Create a .env file in your project:
# XentFi Sandbox Configuration
XENTFI_API_KEY=your_sandbox_api_key
XENTFI_ORG_ID=your_org_id
XENTFI_BASE_URL=https://api.xentfi.com/v1
XENTFI_ENVIRONMENT=sandbox

# Webhook Testing (optional)
XENTFI_WEBHOOK_SECRET=your_webhook_secret
XENTFI_WEBHOOK_URL=https://your-ngrok-url/webhooks/xentfi

# Network Configuration (optional)
XENTFI_DEFAULT_NETWORK=sepolia

3. Install SDK

# Node.js / TypeScript
npm install @xentfi/sdk

4. Initialize Client

// Node.js
import { XentFiClient } from '@xentfi/sdk';

const client = new XentFiClient({
apiKey: process.env.XENTFI_API_KEY,
appId: process.env.XENTFI_APP_ID,
environment: 'sandbox',
network: 'sepolia' // default testnet
});

Local Development with Testnet

Getting Test Tokens

1

Create a Test Wallet

First, create a master wallet on your chosen testnet:
curl -X POST https://api.xentfi.com/v1/master-wallets \
-H "apiKey: $XENTFI_API_KEY" \
-H "orgId: $XENTFI_ORG_ID" \
-d '{
"name": "Test Wallet",
"blockchainId": "eth-sepolia"
}'
2

Get Wallet Address

Copy the walletAddress from the response.
3

Request Test Tokens

Visit the faucet for your chosen testnet and paste your wallet address.
4

Verify Balance

curl -X GET https://api.xentfi.com/v1/addresses/{addressId}/balance \
-H "apiKey: $XENTFI_API_KEY" \
-H "orgId: $XENTFI_ORG_ID"

Webhook Testing with ngrok

For local webhook development, use ngrok to expose your local server:
# Install ngrok (macOS)
brew install ngrok

# Or download from https://ngrok.com/download

# Start ngrok on port 3000
ngrok http 3000

# Copy the HTTPS URL (e.g., https://abc123.ngrok.io)
Configure your webhook with the ngrok URL:
curl -X POST https://api.xentfi.com/v1/webhooks \
-H "apiKey: $XENTFI_API_KEY" \
-H "orgId: $XENTFI_ORG_ID" \
-d '{
"url": "https://abc123.ngrok.io/webhooks/xentfi",
"events": ["payment.completed", "payment.failed"],
"secret": "your-webhook-secret"
}'

Sample Development Workflow

flowchart LR
subgraph Local["Local Development"]
Code[Write Code]
Test[Run Tests]
Debug[Debug Issues]
end

subgraph Testnet["Testnet Environment"]
Wallet[Create Test Wallet]
Payment[Process Test Payment]
Webhook[Receive Webhook]
end

subgraph Production["Production"]
Deploy[Deploy to Production]
Monitor[Monitor Transactions]
end

Local --> Testnet
Testnet --> Production

Testing Checklist

Before moving to production, ensure you’ve tested:
  • API key authentication works
  • Master wallet creation succeeds
  • Deposit address generation works
  • Payment link creation and access
  • Payment processing with test tokens
  • Webhook events received and verified
  • Signature verification implemented
  • Error handling for all scenarios
  • Rate limit handling
  • Idempotency keys working correctly
  • Balance checking functionality

Common Development Issues

Solution: Request more tokens from the faucet. Some faucets have daily limits.
Solution:
  • Verify ngrok is running
  • Check webhook URL is accessible
  • Verify signature verification
Solution:
  • Testnet may be congested
  • Increase gas limit
  • Wait and retry
Solution:
  • Sandbox has higher limits
  • Implement delays between requests
  • Contact support for temporary increase

Migrating to Production

1

Generate Production Keys

Create new API keys with “Production” environment in dashboard
2

Update Configuration

Change environment from sandbox to production
3

Deploy Webhooks

Update webhook URLs to production endpoints
4

Create Production Wallets

Deploy wallets on mainnet networks
5

Enable Monitoring

Turn on monitoring for all production wallets
6

Go Live

Update your application configuration and launch

Pre-Migration Checklist

  • All tests pass on testnet
  • Error handling implemented
  • Rate limit handling in place
  • Webhook signature verification working
  • Idempotency keys implemented
  • Monitoring and alerting configured
  • Security review completed
  • Backup and recovery procedures ready

Support During Development

Next Steps

Authentication

Learn about API security best practices

Rate Limits

Understand API rate limiting

Products

Explore all XentFi products

API Reference

Browse complete API documentation