A full-stack application with Node.js backend and React frontend to fetch and display NFT lists from XRP accounts using Dhali's payment claim API.
📖 Read the Complete Dhali API Documentation - Comprehensive guide to understanding and using Dhali's payment-based API system.
💻 Code References:
- DHALI_INTEGRATION_REFERENCE.js - Detailed code reference with extensive comments
- DHALI_QUICK_REFERENCE.js - Minimal quick-start code snippets for copy-paste
.
├── index.js # Backend server
├── package.json # Backend dependencies
├── .env # Environment variables
└── frontend/ # React frontend
├── public/
├── src/
└── package.json
- Install backend dependencies:
npm install- Make sure your
.envfile contains:
PAYMENT_CLAIM=your_payment_claim_token
MY_XRPL_ADDRESS=your_xrp_address
- Navigate to the frontend directory and install dependencies:
cd frontend
npm install- Start the backend server (from root directory):
npm startThe backend will run on http://localhost:3000
- In a new terminal, start the frontend (from frontend directory):
cd frontend
npm startThe frontend will run on http://localhost:3001 and automatically proxy API requests to the backend.
- Open your browser and visit
http://localhost:3001to use the application.
npm startThe server will start on http://localhost:3000 and you can access the API endpoints directly.
The React frontend provides a beautiful and intuitive interface to:
- View NFTs for the configured XRP account
- Search for NFTs from any XRP address
- Display NFT images, metadata, and details
- View payment claim information
- Expand NFT cards to see full details including Token ID, Issuer, URI, and raw data
- Responsive design that works on desktop and mobile
GET http://localhost:3000/nfts
Fetches NFTs for the XRP address configured in .env file.
GET http://localhost:3000/nfts/:address
Example:
GET http://localhost:3000/nfts/r9ukPqsBE5B3Sdf3asPnXWLUYVpGihJTYc
GET http://localhost:3000/claim-info
Shows decoded payment claim information.
GET http://localhost:3000/
Shows API information and available endpoints.
You can test the endpoints using curl:
# Fetch NFTs for configured account
curl http://localhost:3000/nfts
# Fetch NFTs for specific account
curl http://localhost:3000/nfts/r9ukPqsBE5B3Sdf3asPnXWLUYVpGihJTYc
# View claim information
curl http://localhost:3000/claim-infoOr open the URLs in your browser.
Success response:
{
"message": "NFTs fetched successfully",
"success": true,
"account": "r9ukPqsBE5B3Sdf3asPnXWLUYVpGihJTYc",
"nfts": [...],
"count": 5
}Error response:
{
"message": "Failed to fetch NFTs",
"success": false,
"error": "Error details",
"account": "r9ukPqsBE5B3Sdf3asPnXWLUYVpGihJTYc"
}- The application uses Dhali's payment claim for authorization
- Uses XRPL JSON-RPC
account_nftsmethod via Dhali's XRPL Cluster API - All errors are logged to the console for debugging
- Payment claims are cumulative - authorization amount covers multiple requests
-
DHALI_API_DOCUMENTATION.md - Complete guide to Dhali API integration
- What is Dhali and how it works
- Payment claims explained in detail
- Technical implementation details
- Cost analysis and usage guide
- Troubleshooting common issues
-
QUICK_START.md - Quick setup guide to get running fast
-
frontend/README.md - React frontend documentation
- Dhali Official Website
- Dhali Documentation
- Dhali Payment Terminal
- XRPL account_nfts Documentation
- XRP Ledger Payment Channels
This application demonstrates pay-per-use API access using XRP Ledger payment channels:
- You create a payment channel on the XRP Ledger with Dhali as the destination
- You generate a payment claim that authorizes Dhali to pull funds from your channel
- Each API request includes the payment claim in the
Payment-Claimheader - Dhali validates the claim and forwards the request to the XRPL Cluster API
- You only pay for actual usage - not the full authorization amount
- The response includes the NFT data from the XRP Ledger
{
"NFTokenID": "0008271005ECDB63C36C15BAAF49634CA2D7C65D9ADDD1DD864A4F3B05A2CF96",
"Issuer": "rYL3n9Ufc3W6ZHarPKEPZaF9gZruhRZkw",
"NFTokenTaxon": 10,
"TransferFee": 10000,
"URI": "ipfs://bafybeicqbqeuf3xdl2opbnzd7jevyulovzy5vvr7icl6z64guvcjc4vuumq/XDawg2875.json"
}✅ Pay-per-use - No subscriptions, only pay for what you use ✅ No rate limits - Scale as needed ✅ Transparent pricing - Know exactly what each request costs ✅ Real-time payments - Using XRP Ledger payment channels ✅ Beautiful UI - React frontend with responsive design ✅ Search any address - Look up NFTs for any XRP account ✅ Detailed NFT view - See metadata, URIs, and raw JSON data
Backend:
- Node.js + Express
- Axios for HTTP requests
- Dhali XRPL Cluster API
Frontend:
- React 18
- Axios for API calls
- CSS with gradient design
- Responsive layout
Blockchain:
- XRP Ledger (Mainnet)
- Dhali payment channels
- XRPL JSON-RPC methods