payment_id stringlengths 7 7 | network stringclasses 3
values | token stringclasses 1
value | expected_address stringlengths 34 48 | expected_amount int64 25 2.5k | tolerance float64 0 0.5 | tx_hash stringlengths 64 66 β | tx_network stringclasses 3
values | tx_token stringclasses 2
values | tx_to_address stringlengths 34 48 β | tx_amount float64 49.7 2.5k β | confirmations float64 0 26 β | required_confirmations int64 1 19 | status stringclasses 5
values | reason stringlengths 17 55 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PAY-001 | TRC20 | USDT | TxcwrWVZweDCtZXhgsC7VLA6btymh3fSVi | 250 | 0 | 50211670eae679f02e8d28a79023c39c200661fccd268a29a0d347301ef56e64 | TRC20 | USDT | TxcwrWVZweDCtZXhgsC7VLA6btymh3fSVi | 250 | 25 | 19 | confirmed | Payment verified. |
PAY-002 | ERC20 | USDT | 0xc3cd6089065c3146e80a9c222670bbe4f4c54977 | 1,000 | 0 | 0x656cf2d133187c8df95247f2866028de71159b42b4ea410fb9102f29a422eb14 | ERC20 | USDT | 0xc3cd6089065c3146e80a9c222670bbe4f4c54977 | 1,000 | 17 | 12 | confirmed | Payment verified. |
PAY-003 | TON | USDT | EQ8J1D-BwwBJKLOg1qx647KDnL9CdO-_gBvmSZVr4-epzgZ3 | 100 | 0 | 66c7a644fb12853ef86dcfaea21818b904ce6087413e3b266f850f1578b5c72d | TON | USDT | EQ8J1D-BwwBJKLOg1qx647KDnL9CdO-_gBvmSZVr4-epzgZ3 | 100 | 0 | 1 | detected | Transaction seen, awaiting first confirmation. |
PAY-004 | TRC20 | USDT | TVWDhy1RcdiyZsuNWMiE7oxutin8EGzR6L | 50 | 0 | a80b21ead8f062d15a4f4ef27e9589c6948f6d30c01c3f252edc87ff4adfa36d | TRC20 | USDT | TVWDhy1RcdiyZsuNWMiE7oxutin8EGzR6L | 50 | 0 | 19 | detected | Transaction seen, awaiting first confirmation. |
PAY-005 | ERC20 | USDT | 0x840164709ab7f3f386d0cd566647b5aa66634742 | 25 | 0 | null | null | null | null | null | null | 12 | pending | No matching transaction observed yet. |
PAY-006 | TON | USDT | EQzRqv3XzaXJrm8MBtGdimrbzXJx-bPyCONeg4zGZwBMhgjr | 1,000 | 0 | d3e21c5cf5f1dfd9c9b9f89900715dc1ac1a27df8713e4731de361b43be4de8d | TON | USDT | EQzRqv3XzaXJrm8MBtGdimrbzXJx-bPyCONeg4zGZwBMhgjr | 999.25 | 6 | 1 | failed | Underpaid by 0.75 USDT. |
PAY-007 | TRC20 | USDT | Tu9Ko9GX8ZzLsZgwPJJgkodmeDhJqGDGZi | 500 | 0 | 611088d013782257bffb6aaf423e6ed8c4b4a95db3ea22dfe9029629fa947bab | TRC20 | USDT | Tu9Ko9GX8ZzLsZgwPJJgkodmeDhJqGDGZi | 502 | 20 | 19 | confirmed | Payment verified. Overpaid by 2 USDT. |
PAY-008 | ERC20 | USDT | 0xe8e9ea7c72bb0bcc6bc4552e9071590d292a283a | 100 | 0 | 0x2043d77faecbaa4ff21db0c2e0b03dd475c5a6cd981f939451e0f1a365b67f7e | ERC20 | USDT | 0x8c59f8fca2f7c164c8170fbe7d5d5a4848145064 | 100 | 14 | 12 | failed | Destination address does not match the payment request. |
PAY-009 | TON | USDT | EQKtiM97KmCY1YL4aE0-UnonzJn7IuJRNy7P4Bw8elO6BaTl | 2,500 | 0 | c9ac2866c3a98faec23434556c1e237153dd2ad464cfad0ca708a6a9e3c6a935 | TON | USDC | EQKtiM97KmCY1YL4aE0-UnonzJn7IuJRNy7P4Bw8elO6BaTl | 2,500 | 5 | 1 | failed | Wrong token: expected USDT, got USDC. |
PAY-010 | TRC20 | USDT | TbzLcFPgZZAdnDannvDd2hjDr69GXdTmNN | 2,500 | 0 | 2b8e3e47285a4309b7b552e1c549c056de14c3c5a487a114cf3fbdd9fedd33ad | ERC20 | USDT | TbzLcFPgZZAdnDannvDd2hjDr69GXdTmNN | 2,500 | 25 | 19 | failed | Wrong network: expected trc20, got erc20. |
PAY-011 | TRC20 | USDT | Tu9Ko9GX8ZzLsZgwPJJgkodmeDhJqGDGZi | 502 | 0 | 611088d013782257bffb6aaf423e6ed8c4b4a95db3ea22dfe9029629fa947bab | TRC20 | USDT | Tu9Ko9GX8ZzLsZgwPJJgkodmeDhJqGDGZi | 502 | 20 | 19 | failed | Duplicate: transaction hash already credited. |
PAY-012 | TON | USDT | UQg2LVkYfWjDXTE7xA-HXIup9ElWVO3e4geh_c-hEZG5XpTC | 500 | 0 | fde802357419d1a8f25c875fe1adeb614f44e107d42c9fd2179837de27b9a615 | TON | USDT | UQg2LVkYfWjDXTE7xA-HXIup9ElWVO3e4geh_c-hEZG5XpTC | 500 | 7 | 1 | confirmed | Payment verified. |
PAY-013 | TRC20 | USDT | Ti4pNdmxyeyCWxSvERRs4ETPGCsctBXESE | 500 | 0 | e9fef5f6cd218b8058c683b14b4730ace2ca819c7f1644169ddf48aec468ec4c | TRC20 | USDT | Ti4pNdmxyeyCWxSvERRs4ETPGCsctBXESE | 500 | 9 | 19 | confirming | 9/19 confirmations. |
PAY-014 | ERC20 | USDT | 0xb739bb6410f0926b3b782d3cf1fca9f875c6f5b7 | 2,500 | 0 | 0x2ad4f890c3b2c81cf9fa8201bab985fcab0621dd282eecc1489fbf046878770c | ERC20 | USDT | 0xb739bb6410f0926b3b782d3cf1fca9f875c6f5b7 | 2,500 | 12 | 12 | confirmed | Payment verified. |
PAY-015 | TON | USDT | UQKqhsNCoayUYUUq_lv1ku-efupWQIINnO59FU09Gsgyyggv | 50 | 0.5 | a5a64d48546c9750f488d8cc4153169b3ca0f5b29e97cd4c694e538fd34a0848 | TON | USDT | UQKqhsNCoayUYUUq_lv1ku-efupWQIINnO59FU09Gsgyyggv | 49.7 | 11 | 1 | confirmed | Payment verified. |
PAY-016 | TRC20 | USDT | TJMF6XDQcHc4A51zqLj61CNX9sDxTX3TPt | 250 | 0 | c1688697e1505328b092e062b087fc93fcd80047acb8beb982a38a65614965b3 | TRC20 | USDT | TJMF6XDQcHc4A51zqLj61CNX9sDxTX3TPt | 250 | 21 | 19 | confirmed | Payment verified. |
PAY-017 | ERC20 | USDT | 0xbb5d00c1c3a605a23adf7fd582ca5b04c16bed33 | 50 | 0 | 0xededc7c11ee911a4ea8a6fc14f37543388251a8be60d6f8723ef72f124b53a1b | ERC20 | USDT | 0xbb5d00c1c3a605a23adf7fd582ca5b04c16bed33 | 50 | 0 | 12 | detected | Transaction seen, awaiting first confirmation. |
PAY-018 | TON | USDT | UQP1XxD7_JLaoZ3wBrojaaXQV7FQjOhstnZBIaun0ZSJi2v0 | 2,500 | 0 | 8e433bd7f39392e7fc6d7e2bda9e89070db48cd8a333e62b0b0b04f2b5eaf170 | TON | USDT | UQP1XxD7_JLaoZ3wBrojaaXQV7FQjOhstnZBIaun0ZSJi2v0 | 2,495 | 7 | 1 | failed | Underpaid by 5 USDT. |
PAY-019 | TRC20 | USDT | TFibm845WiSsiEaeEYQvAZS7ps61Bimgsp | 2,500 | 0 | 8f3de40bb03bd3393274299b77de16e53e43445d3d0743c590c3f91cd92683da | TRC20 | USDT | TFibm845WiSsiEaeEYQvAZS7ps61Bimgsp | 2,500 | 26 | 19 | confirmed | Payment verified. |
PAY-020 | ERC20 | USDT | 0x43c9887b2dfcbdae31915cac73b1abf7f0bd30b7 | 50 | 0 | null | null | null | null | null | null | 12 | pending | No matching transaction observed yet. |
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
FXFunds β Stablecoin Payments Bot πΈ
FXFunds Stablecoin Payments Bot is a blockchain payment automation tool that verifies stablecoin payments, tracks transaction confirmations and manages payment records for USDT on Ethereum (ERC20), Tron (TRC20) and TON. Built by FXFunds.
Overview
The bot takes a payment request (who should be paid, how much, in which token and on which network) and the transaction you observed on-chain, then decides the payment status: pending, detected, confirming, confirmed or failed, with a clear reason. A payment ledger keeps the history, blocks the same transaction hash from being credited twice, fires notifications on status changes and exports to JSON or CSV.
It is read-only. It never needs private keys or seed phrases, and it never signs or sends transactions. You supply transaction data from your own blockchain API, RPC node or explorer.
Key Capabilities
- Payment Verification β Checks network, token, destination address, amount and transaction hash format against the payment request.
- Confirmation Tracking β Compares confirmations with each network's requirement (configurable per payment).
- Multi-Network Support β Network profiles for USDT on ERC20, TRC20 and TON.
- Automatic Status Updates β Moves each payment through pending β detected β confirming β confirmed, or to failed with a reason.
- Duplicate Detection β A transaction hash that has already been credited cannot confirm a second payment.
- Payment Notifications β Pass a callback to receive
detected,confirmedandfailedevents and forward them to email, Slack, Telegram or a webhook. - Payment History & Reporting β The ledger exports every payment record to JSON or CSV.
- Error Handling β Underpayment, overpayment, wrong address, wrong token and wrong network each get a specific reason.
How the Bot Works
| Step | What happens |
|---|---|
| 1. Monitor | Your code fetches transactions from a blockchain API, RPC endpoint or explorer |
| 2. Detect | Pass the transaction and the payment request to the bot |
| 3. Validate | Network, hash format, token, destination address and amount are checked |
| 4. Confirm | Confirmations are compared with the required number |
| 5. Update | The payment status is set, with a reason |
| 6. Notify | Your callback receives the event when the status changes |
| 7. Record | The ledger stores the result for history and reconciliation |
Payment Statuses
| Status | Meaning |
|---|---|
| pending | No matching transaction observed yet |
| detected | Transaction matches but has 0 confirmations |
| confirming | Transaction matches; confirmations below the requirement |
| confirmed | Transaction matches and has enough confirmations |
| failed | Wrong network, token or address, underpaid, invalid hash, or duplicate |
Quick Start
Node.js
npm install @fxfunds/stablecoin-payments
npx @fxfunds/stablecoin-payments \
--network trc20 --id INV-1001 \
--address TXLAQ63Xg1NAzckPwKHvzw7CSEmLMEqcdj --amount 250 \
--hash a3f1c9e2b7d84f60c1e5a9b3d7f2e8c4a6b0d9e3f7c1a5b8e2d6f0c4a9b3e7d1 \
--confirmations 20
import { PaymentLedger } from "@fxfunds/stablecoin-payments";
const ledger = new PaymentLedger((event, result) => {
console.log(`${event}: ${result.paymentId} β ${result.reason}`);
});
const result = ledger.process(
{ paymentId: "INV-1001", network: "trc20", token: "USDT", address: "T...", amount: 250 },
{ txHash: "...", network: "trc20", token: "USDT", toAddress: "T...", amount: 250, confirmations: 20 }
);
console.log(result.status); // "confirmed"
console.log(ledger.toCSV());
Python
pip install fxfunds-stablecoin-payments
fxfunds-payments --network ton --id INV-2001 --address <wallet> --amount 100 \
--hash <tx_hash> --confirmations 1
# or
python -m fxfunds_stablecoin_payments --network ton --address <wallet> ...
from fxfunds_stablecoin_payments import PaymentLedger, PaymentRequest, ObservedTransaction
ledger = PaymentLedger(lambda event, r: print(event, r.payment_id, r.reason))
req = PaymentRequest("INV-2001", "ton", "USDT", "<wallet>", 100)
tx = ObservedTransaction("<tx_hash>", "ton", "USDT", "<wallet>", 100, confirmations=1)
print(ledger.process(req, tx).status) # "confirmed"
print(ledger.to_csv())
Run with no arguments to see a demo. Add --json for JSON output.
CLI Options
| Option | Description |
|---|---|
--network |
erc20, trc20 or ton |
--id |
Payment or invoice ID |
--address |
Wallet that should receive the payment |
--amount |
Expected amount |
--token |
Token symbol (default USDT) |
--required |
Required confirmations (default: network value) |
--tolerance |
Allowed shortfall (default 0) |
--hash |
Observed transaction hash (omit for pending) |
--to / --tx-amount / --tx-token / --tx-network |
Observed values, if different from the request |
--confirmations |
Observed confirmations |
Sample Output
FXFunds Stablecoin Payments Bot β demo
============================================================
INV-1001 PENDING No matching transaction observed yet.
[notify] detected β INV-1001
INV-1001 DETECTED Transaction seen, awaiting first confirmation.
INV-1001 CONFIRMING 7/19 confirmations.
[notify] confirmed β INV-1001
INV-1001 CONFIRMED Payment verified.
[notify] failed β INV-1002
INV-1002 FAILED Duplicate: transaction hash already credited.
Supported Networks
| Network | Token | Default Confirmations | Address Match |
|---|---|---|---|
| Ethereum (ERC20) | USDT | 12 | Case-insensitive |
| Tron (TRC20) | USDT | 19 | Exact |
| TON | USDT | 1 | Exact |
Defaults can be changed per payment with requiredConfirmations / --required. They are reference values, not guarantees from any network or provider. On TON, use the same address format (EQβ¦ or UQβ¦) for the request and the transaction.
Project Structure
fxfunds-stablecoin-payments/
βββ index.ts # TypeScript bot
βββ fxfunds_stablecoin_payments.py # Python bot
βββ package.json # NPM package config
βββ package-lock.json # NPM lock file
βββ tsconfig.json # TypeScript config
βββ pyproject.toml # PyPI package config
βββ setup.py # Legacy setup shim
βββ schema.json # JSON-LD structured data
βββ zenodo.json # Zenodo metadata
βββ heartbeat.txt # Auto-updated daily
βββ mkdocs.yml # ReadTheDocs config
βββ .readthedocs.yaml # ReadTheDocs build config
βββ docs/
β βββ index.md # Documentation
β βββ requirements.txt
βββ dataset/
β βββ stablecoin_payment_benchmarks.csv
βββ kaggle/
β βββ notebook.ipynb
βββ .github/workflows/
β βββ heartbeat.yml # Auto-commit daily
β βββ npm-publish.yml # Auto-publish to NPM
β βββ pypi-publish.yml # Auto-publish to PyPI
βββ README.md
βββ LICENSE
Dataset
dataset/stablecoin_payment_benchmarks.csv holds 20 synthetic payment scenarios across ERC20, TRC20 and TON, covering every status and failure reason, with the bot's verdict for each. It is for testing and demonstration only and does not contain real on-chain transactions.
Security and Data Handling
- Read-only: the bot never signs, broadcasts or transfers anything.
- No private keys or seed phrases are needed or accepted.
- Store blockchain API credentials in environment variables or a secrets manager, never in code.
- Validate data from external providers before relying on it.
- Review the code, add tests and check your integrations before processing real payments.
FAQ
What is FXFunds Stablecoin Payments Bot? Software that verifies stablecoin payments, tracks confirmations and manages payment records for USDT on ERC20, TRC20 and TON.
Which networks can it check? USDT on Ethereum (ERC20), Tron (TRC20) and TON.
Can it detect incoming payments automatically? It verifies transactions you pass to it. Connect it to your blockchain API or RPC node with a scheduler or event listener to run it continuously.
Does it prevent duplicate payment processing? Yes. The ledger refuses to credit a transaction hash that already confirmed another payment.
Can it send notifications?
Yes. Pass a callback to PaymentLedger and forward events to any channel you use.
Does it transfer funds? No. It is a read-only verification tool.
What is the official FXFunds website? https://fxfunds.com/
Keywords
Stablecoin Payments Β· USDT Β· Payment Verification Β· Crypto Payments Β· ERC20 Β· TRC20 Β· TON Β· Payment Bot Β· Confirmation Tracking Β· Blockchain Β· Fintech Β· FXFunds
Links
About FXFunds
FXFunds is a trading platform covering multiple financial markets, with digital payment methods including USDT on supported blockchain networks. Learn more at fxfunds.com.
License
MIT β FXFunds
- Downloads last month
- 13