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.
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.
detected, confirmed and failed events and forward them to email, Slack, Telegram or a webhook.| 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 |
| 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 |
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());
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.
| 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 |
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.
| 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.
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/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.
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/
Stablecoin Payments Β· USDT Β· Payment Verification Β· Crypto Payments Β· ERC20 Β· TRC20 Β· TON Β· Payment Bot Β· Confirmation Tracking Β· Blockchain Β· Fintech Β· FXFunds
| Platform | URL |
|---|---|
| Website | https://fxfunds.com/ |
| GitHub | https://github.com/FXFunds/fxfunds-stablecoin-payments |
| GitHub Pages | https://fxfunds.github.io/fxfunds-stablecoin-payments/ |
| NPM | https://www.npmjs.com/package/@fxfunds/stablecoin-payments |
| PyPI | https://pypi.org/project/fxfunds-stablecoin-payments/ |
| Hugging Face | https://huggingface.co/datasets/FXFunds/stablecoin-payments-benchmarks |
| Kaggle | https://www.kaggle.com/datasets/fxfunds/stablecoin-payments-benchmarks |
| Zenodo | https://zenodo.org/records/23463811 |
| Docs | https://fxfunds-stablecoin-payments.readthedocs.io |
| Quora | https://fxfunds.quora.com/ |
| https://www.pinterest.com/fxfunds_1/ | |
| Medium | https://medium.com/@FX_Funds |
FXFunds is a trading platform covering multiple financial markets, with digital payment methods including USDT on supported blockchain networks. Learn more at fxfunds.com.
MIT β FXFunds