Simple payment validator for BSC network that checks if BNB and USDT transactions are legit. Uses Moralis to verify wallet addresses, amounts, and timestamps from transaction hashes. Added some safety checks to catch wrong payments and keep things secure.
-
Get Moralis API Key
- Go to Moralis
- Sign up or login to your account
- Go to Web3 APIs in the dashboard
- Create a new API key or use an existing one
- Copy your API key
-
Environment Setup
- Create a
.env.localfile in the root directory - Add your Moralis API key:
NEXT_PUBLIC_MORALIS_API_KEY=your-api-key-here
- Create a
-
Install Dependencies
npm install # or yarn install -
Run the Project
npm run dev # or yarn dev
- Validates BNB and USDT transactions on BSC network
- Checks wallet addresses
- Verifies transaction amounts
- Validates transaction timestamps
- 98% minimum amount threshold
- 1-hour time window validation
// Example API call
const response = await fetch('/api/validate/transaction', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
transactionHash: '0x...',
wallet: '0x...',
amount: '100',
currency: 'BNB' // or 'USDT'
}),
});The validator returns different status codes:
200: Transaction is valid400: Invalid parameters or transaction500: Server error
Feel free to submit issues and pull requests.
MIT