GitHub - Whoiszxl/ex-exchange: A Java SDK for Cryptocurrency Payments in Centralized Systems

·

Introduction to Tues Pay

Tues Pay is a Java SDK designed for cryptocurrency payments in centralized systems. Currently, it supports Bitcoin payments, Ethereum payments, and ERC20 token payments. With comprehensive documentation, you can quickly integrate crypto deposits, withdrawals, and e-commerce transactions for businesses like online stores and financial platforms.


Project Structure

The SDK is organized into modular components for flexibility:

tues-pay
├── tues-bitcoin       # Bitcoin Java service
├── tues-core          # Core cryptocurrency Java dependencies
├── tues-erc20         # ERC20 token Java service
├── tues-eth           # Ethereum Java service
└── tues-ethereum-core # Ethereum core Java dependencies
docs                  # Setup guides
sql                   # Database scripts

How It Works

  1. Transaction Scanning:
    Built in Java, Tues Pay uses scheduled tasks to scan transactions from self-hosted cryptocurrency nodes. This enables automated deposit processing.
  2. Order Integration:
    When generating an order, call the Tues Pay API (/currencyName/createRecharge/{orderId}/{amount}) with:

    • currencyName: Cryptocurrency type (e.g., bitcoin, ethereum).
    • orderId: Unique order identifier.
    • amount: Payment amount.

    The system generates a unique wallet address linked to the order.

  3. Blockchain Confirmation:

    • A background task scans blocks from height 0 to the latest, checking transactions against database records.
    • When a transaction matches the deposit address and amount, the order is marked confirmed.
    • Another task verifies block confirmations against a configurable threshold (e.g., 6 confirmations for Bitcoin) before finalizing the deposit.

Deployment Guide

1. Node Setup

Follow the environment setup guide in the docs folder to deploy your cryptocurrency wallet nodes.

2. Security Configuration

Encrypt sensitive node credentials (username/password) using EncryptPropertiesUtils in tues-core to avoid plaintext exposure.

3. Database Setup

4. Build and Run


Core Features


FAQs

Q1: How do I handle transaction delays?

A: Delays can occur due to network congestion. Monitor confirmations via the /transaction/status endpoint.

Q2: Can I add support for other cryptocurrencies?

A: Yes! Extend tues-core and implement the PaymentHandler interface for new currencies.

Q3: Is this SDK suitable for high-volume transactions?

A: Absolutely. The task-based architecture ensures scalability. For heavy loads, consider optimizing node RPC settings.

👉 Explore advanced crypto integration tips

👉 Learn about secure key management


### Keywords
1. **Cryptocurrency Payments**  
2. **Java SDK**  
3. **Bitcoin Integration**  
4. **Ethereum Payments**  
5. **ERC20 Tokens**  
6. **Blockchain Transactions**  
7. **Payment Gateway**  
8. **Crypto Deposits**